resources_js_pages_user_Index_vue.js 694KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_user_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!**********************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \**********************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  269. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/user/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  277. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. users: Object,
  281. initialSearch: String
  282. },
  283. setup: function setup(__props, _ref) {
  284. var expose = _ref.expose;
  285. expose();
  286. var props = __props;
  287. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  288. search = _useSearchText.search;
  289. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  290. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/users', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  291. search: search.value
  292. }), {
  293. preserveState: true
  294. });
  295. });
  296. var __returned__ = {
  297. props: props,
  298. search: search,
  299. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  300. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  301. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  302. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  303. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  304. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  305. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  306. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  307. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  308. };
  309. Object.defineProperty(__returned__, '__isScriptSetup', {
  310. enumerable: false,
  311. value: true
  312. });
  313. return __returned__;
  314. }
  315. });
  316. /***/ }),
  317. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  318. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  319. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  320. \***********************************************************************************************************************************************************************************************************************************************************************************/
  321. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  322. "use strict";
  323. __webpack_require__.r(__webpack_exports__);
  324. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  325. /* harmony export */ "render": () => (/* binding */ render)
  326. /* harmony export */ });
  327. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  328. var _hoisted_1 = {
  329. key: 1,
  330. "class": "p-button-label"
  331. };
  332. var _hoisted_2 = {
  333. key: 1,
  334. "class": "p-button-label"
  335. };
  336. function render(_ctx, _cache, $props, $setup, $data, $options) {
  337. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  338. key: 0,
  339. "class": "p-button p-component",
  340. as: "button",
  341. type: "button"
  342. }, {
  343. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  344. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  345. key: 0,
  346. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  347. }, null, 2
  348. /* CLASS */
  349. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  350. /* TEXT */
  351. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  352. }),
  353. _: 1
  354. /* STABLE */
  355. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  356. key: 1,
  357. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  358. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  359. key: 0,
  360. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  361. }, null, 2
  362. /* CLASS */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  364. /* TEXT */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  366. /* CLASS */
  367. ));
  368. }
  369. /***/ }),
  370. /***/ "./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":
  371. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  372. !*** ./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 ***!
  373. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  374. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  375. "use strict";
  376. __webpack_require__.r(__webpack_exports__);
  377. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  378. /* harmony export */ "render": () => (/* binding */ render)
  379. /* harmony export */ });
  380. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  381. var _withScopeId = function _withScopeId(n) {
  382. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  383. };
  384. var _hoisted_1 = {
  385. "class": "layout-footer"
  386. };
  387. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  388. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  389. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  390. href: "https://dijitalcode.com",
  391. target: "_blank",
  392. "class": "font-medium ml-2"
  393. }, "DijitalCODE", -1
  394. /* HOISTED */
  395. );
  396. });
  397. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  398. function render(_ctx, _cache) {
  399. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  400. }
  401. /***/ }),
  402. /***/ "./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":
  403. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  404. !*** ./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 ***!
  405. \********************************************************************************************************************************************************************************************************************************************************************************/
  406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  407. "use strict";
  408. __webpack_require__.r(__webpack_exports__);
  409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  410. /* harmony export */ "render": () => (/* binding */ render)
  411. /* harmony export */ });
  412. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  413. var _hoisted_1 = {
  414. key: 0
  415. };
  416. var _hoisted_2 = {
  417. key: 1
  418. };
  419. function render(_ctx, _cache, $props, $setup, $data, $options) {
  420. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  421. 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, {
  422. key: 0,
  423. severity: "success",
  424. onClose: $setup.onClose
  425. }, {
  426. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  427. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  428. /* TEXT */
  429. )];
  430. }),
  431. _: 1
  432. /* STABLE */
  433. })) : (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, {
  434. key: 1,
  435. severity: "error",
  436. onClose: $setup.onClose
  437. }, {
  438. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  439. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  440. /* TEXT */
  441. )];
  442. }),
  443. _: 1
  444. /* STABLE */
  445. })) : (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, {
  446. key: 2,
  447. severity: "error",
  448. onClose: $setup.onClose
  449. }, {
  450. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  451. 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
  452. /* TEXT */
  453. ))];
  454. }),
  455. _: 1
  456. /* STABLE */
  457. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  458. /* STABLE_FRAGMENT */
  459. );
  460. }
  461. /***/ }),
  462. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  463. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  464. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  465. \***********************************************************************************************************************************************************************************************************************************************************************************/
  466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  467. "use strict";
  468. __webpack_require__.r(__webpack_exports__);
  469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  470. /* harmony export */ "render": () => (/* binding */ render)
  471. /* harmony export */ });
  472. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  473. var _hoisted_1 = {
  474. key: 0,
  475. "class": "p-paginator p-component flex justify-content-start"
  476. };
  477. var _hoisted_2 = {
  478. "class": "p-paginator-pages"
  479. };
  480. var _hoisted_3 = ["innerHTML"];
  481. function render(_ctx, _cache, $props, $setup, $data, $options) {
  482. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  483. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  484. key: "link-".concat(key),
  485. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  486. 'p-disabled': link
  487. }]),
  488. innerHTML: link.label
  489. }, null, 10
  490. /* CLASS, PROPS */
  491. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  492. key: "link-".concat(key),
  493. href: link.url,
  494. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  495. 'p-highlight': link.active
  496. }, "p-paginator-page p-paginator-element p-link"]),
  497. innerHTML: link.label
  498. }, null, 8
  499. /* PROPS */
  500. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  501. /* STABLE_FRAGMENT */
  502. );
  503. }), 256
  504. /* UNKEYED_FRAGMENT */
  505. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  506. }
  507. /***/ }),
  508. /***/ "./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":
  509. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  510. !*** ./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 ***!
  511. \********************************************************************************************************************************************************************************************************************************************************************************************/
  512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  513. "use strict";
  514. __webpack_require__.r(__webpack_exports__);
  515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  516. /* harmony export */ "render": () => (/* binding */ render)
  517. /* harmony export */ });
  518. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  519. function render(_ctx, _cache, $props, $setup, $data, $options) {
  520. 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"], {
  521. "class": "layout-menu",
  522. items: $props.menu,
  523. root: true
  524. }, null, 8
  525. /* PROPS */
  526. , ["items"])]);
  527. }
  528. /***/ }),
  529. /***/ "./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":
  530. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  531. !*** ./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 ***!
  532. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  534. "use strict";
  535. __webpack_require__.r(__webpack_exports__);
  536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  537. /* harmony export */ "render": () => (/* binding */ render)
  538. /* harmony export */ });
  539. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  540. var _withScopeId = function _withScopeId(n) {
  541. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  542. };
  543. var _hoisted_1 = {
  544. key: 0
  545. };
  546. var _hoisted_2 = ["aria-label"];
  547. var _hoisted_3 = ["aria-label"];
  548. function render(_ctx, _cache, $props, $setup, $data, $options) {
  549. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  550. 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) {
  551. 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", {
  552. key: i,
  553. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  554. 'layout-menuitem-category': $props.root
  555. }]),
  556. role: "none"
  557. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  558. key: 0
  559. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  560. "class": "layout-menuitem-root-text",
  561. "aria-label": item.label
  562. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  563. /* TEXT, PROPS */
  564. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  565. items: item.items
  566. }, null, 8
  567. /* PROPS */
  568. , ["items"])], 64
  569. /* STABLE_FRAGMENT */
  570. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  571. key: 1
  572. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  573. key: 0,
  574. role: "menuitem",
  575. href: item.to,
  576. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  577. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  578. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  579. }]),
  580. "aria-label": item.label
  581. }, {
  582. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  583. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  585. }, null, 2
  586. /* CLASS */
  587. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  588. /* TEXT */
  589. )];
  590. }),
  591. _: 2
  592. /* DYNAMIC */
  593. }, 1032
  594. /* PROPS, DYNAMIC_SLOTS */
  595. , ["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", {
  596. key: 1,
  597. href: "#",
  598. role: "menuitem",
  599. "aria-label": item.label
  600. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  601. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  602. }, null, 2
  603. /* CLASS */
  604. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  605. /* TEXT */
  606. )], 8
  607. /* PROPS */
  608. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  609. items: item.items
  610. }, null, 8
  611. /* PROPS */
  612. , ["items"])], 64
  613. /* STABLE_FRAGMENT */
  614. ))], 2
  615. /* CLASS */
  616. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  617. /* STABLE_FRAGMENT */
  618. );
  619. }), 256
  620. /* UNKEYED_FRAGMENT */
  621. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  622. }
  623. /***/ }),
  624. /***/ "./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":
  625. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  626. !*** ./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 ***!
  627. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  629. "use strict";
  630. __webpack_require__.r(__webpack_exports__);
  631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  632. /* harmony export */ "render": () => (/* binding */ render)
  633. /* harmony export */ });
  634. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  635. var _withScopeId = function _withScopeId(n) {
  636. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  637. };
  638. var _hoisted_1 = {
  639. "class": "layout-topbar"
  640. };
  641. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  642. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  643. alt: "Logo",
  644. src: "/images/logo.svg",
  645. "class": "md:mr-3"
  646. }, null, -1
  647. /* HOISTED */
  648. );
  649. });
  650. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  651. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  652. /* HOISTED */
  653. );
  654. });
  655. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  656. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  657. "class": "pi pi-bars"
  658. }, null, -1
  659. /* HOISTED */
  660. );
  661. });
  662. var _hoisted_5 = [_hoisted_4];
  663. var _hoisted_6 = {
  664. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  665. };
  666. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": "pi pi-ellipsis-v"
  669. }, null, -1
  670. /* HOISTED */
  671. );
  672. });
  673. var _hoisted_8 = [_hoisted_7];
  674. var _hoisted_9 = {
  675. "class": "layout-topbar-menu hidden lg:flex origin-top"
  676. };
  677. var _hoisted_10 = {
  678. "class": "align-self-center"
  679. };
  680. var _hoisted_11 = {
  681. "class": "hidden lg:inline"
  682. };
  683. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  684. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": "pi pi-user"
  686. }, null, -1
  687. /* HOISTED */
  688. );
  689. });
  690. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  691. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  692. /* HOISTED */
  693. );
  694. });
  695. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  696. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  697. "class": "pi pi-sign-out"
  698. }, null, -1
  699. /* HOISTED */
  700. );
  701. });
  702. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  703. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  704. /* HOISTED */
  705. );
  706. });
  707. function render(_ctx, _cache, $props, $setup, $data, $options) {
  708. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  709. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  710. 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"], {
  711. href: "/",
  712. "class": "layout-topbar-logo"
  713. }, {
  714. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  715. return [_hoisted_2, _hoisted_3];
  716. }),
  717. _: 1
  718. /* STABLE */
  719. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  720. "class": "p-link layout-menu-button layout-topbar-button",
  721. onClick: _cache[0] || (_cache[0] = function ($event) {
  722. return _ctx.$emit('menu-toggle', $event);
  723. })
  724. }, _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, {
  725. selector: '@next',
  726. enterClass: 'hidden',
  727. enterActiveClass: 'scalein',
  728. leaveToClass: 'hidden',
  729. leaveActiveClass: 'fadeout',
  730. hideOnOutsideClick: true
  731. }]]), (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
  732. /* TEXT */
  733. )]), (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"], {
  734. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  735. "class": "p-link layout-topbar-button"
  736. }, {
  737. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  738. return [_hoisted_12, _hoisted_13];
  739. }),
  740. _: 1
  741. /* STABLE */
  742. }, 8
  743. /* PROPS */
  744. , ["href"])), [[_directive_tooltip, {
  745. value: 'Ubah Profil',
  746. "class": 'layout-topbar-menu-tooltip'
  747. }, void 0, {
  748. bottom: true
  749. }]])]), (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"], {
  750. href: _ctx.route('logout'),
  751. as: "button",
  752. method: "post",
  753. "class": "p-link layout-topbar-button"
  754. }, {
  755. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  756. return [_hoisted_14, _hoisted_15];
  757. }),
  758. _: 1
  759. /* STABLE */
  760. }, 8
  761. /* PROPS */
  762. , ["href"])), [[_directive_tooltip, {
  763. value: 'Keluar',
  764. "class": 'layout-topbar-menu-tooltip'
  765. }, void 0, {
  766. bottom: true
  767. }]])])])]);
  768. }
  769. /***/ }),
  770. /***/ "./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":
  771. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  772. !*** ./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 ***!
  773. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  775. "use strict";
  776. __webpack_require__.r(__webpack_exports__);
  777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  778. /* harmony export */ "render": () => (/* binding */ render)
  779. /* harmony export */ });
  780. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  781. var _withScopeId = function _withScopeId(n) {
  782. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  783. };
  784. var _hoisted_1 = {
  785. "class": "layout-sidebar"
  786. };
  787. var _hoisted_2 = {
  788. "class": "layout-main-container"
  789. };
  790. var _hoisted_3 = {
  791. "class": "layout-main"
  792. };
  793. var _hoisted_4 = {
  794. key: 0,
  795. "class": "layout-mask p-component-overlay"
  796. };
  797. function render(_ctx, _cache, $props, $setup, $data, $options) {
  798. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  799. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  800. onClick: $setup.onWrapperClick
  801. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  802. onMenuToggle: $setup.onMenuToggle
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  804. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  805. }, null, 8
  806. /* PROPS */
  807. , ["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, {
  808. name: "layout-mask"
  809. }, {
  810. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  811. 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)];
  812. }),
  813. _: 1
  814. /* STABLE */
  815. })], 2
  816. /* CLASS */
  817. );
  818. }
  819. /***/ }),
  820. /***/ "./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/user/Index.vue?vue&type=template&id=3aca4497":
  821. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  822. !*** ./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/user/Index.vue?vue&type=template&id=3aca4497 ***!
  823. \***************************************************************************************************************************************************************************************************************************************************************************/
  824. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  825. "use strict";
  826. __webpack_require__.r(__webpack_exports__);
  827. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  828. /* harmony export */ "render": () => (/* binding */ render)
  829. /* harmony export */ });
  830. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  831. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  832. /* HOISTED */
  833. );
  834. var _hoisted_2 = {
  835. "class": "grid"
  836. };
  837. var _hoisted_3 = {
  838. "class": "col-12 md:col-8"
  839. };
  840. var _hoisted_4 = {
  841. "class": "flex align-items-center"
  842. };
  843. var _hoisted_5 = {
  844. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  845. };
  846. function render(_ctx, _cache, $props, $setup, $data, $options) {
  847. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  848. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  849. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  850. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  851. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  852. title: "Daftar User"
  853. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  854. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  855. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  856. responsiveLayout: "scroll",
  857. columnResizeMode: "expand",
  858. value: $props.users.data,
  859. rowHover: true,
  860. stripedRows: true
  861. }, {
  862. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  863. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  864. "class": "w-full md:w-27rem",
  865. placeholder: "cari, contoh: tina, tina@xx.com",
  866. modelValue: $setup.search,
  867. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  868. return $setup.search = $event;
  869. })
  870. }, null, 8
  871. /* PROPS */
  872. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  873. label: "Tambah User",
  874. icon: "pi pi-pencil",
  875. "class": "p-button-outlined",
  876. href: _ctx.route('users.create')
  877. }, null, 8
  878. /* PROPS */
  879. , ["href"])])])];
  880. }),
  881. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  882. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  883. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  884. field: value.field,
  885. header: value.header,
  886. key: value.field
  887. }, null, 8
  888. /* PROPS */
  889. , ["field", "header"]);
  890. }), 128
  891. /* KEYED_FRAGMENT */
  892. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  893. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  894. var data = _ref.data;
  895. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  896. icon: "pi pi-pencil",
  897. "class": "p-button-icon-only p-button-rounded p-button-text",
  898. href: _ctx.route('users.edit', data.id)
  899. }, null, 8
  900. /* PROPS */
  901. , ["href"]), [[_directive_tooltip, 'Ubah User', void 0, {
  902. bottom: true
  903. }]])];
  904. }),
  905. _: 1
  906. /* STABLE */
  907. })];
  908. }),
  909. _: 1
  910. /* STABLE */
  911. }, 8
  912. /* PROPS */
  913. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  914. links: $props.users.links
  915. }, null, 8
  916. /* PROPS */
  917. , ["links"])];
  918. }),
  919. _: 1
  920. /* STABLE */
  921. })], 64
  922. /* STABLE_FRAGMENT */
  923. );
  924. }
  925. /***/ }),
  926. /***/ "./resources/js/components/useSearchText.js":
  927. /*!**************************************************!*\
  928. !*** ./resources/js/components/useSearchText.js ***!
  929. \**************************************************/
  930. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  931. "use strict";
  932. __webpack_require__.r(__webpack_exports__);
  933. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  934. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  935. /* harmony export */ });
  936. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  937. function useSearchText(props) {
  938. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  939. return {
  940. search: search
  941. };
  942. }
  943. /***/ }),
  944. /***/ "./resources/js/pages/user/tableHeader.js":
  945. /*!************************************************!*\
  946. !*** ./resources/js/pages/user/tableHeader.js ***!
  947. \************************************************/
  948. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  949. "use strict";
  950. __webpack_require__.r(__webpack_exports__);
  951. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  952. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  953. /* harmony export */ });
  954. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  955. field: 'name',
  956. header: 'Nama'
  957. }, {
  958. field: 'email',
  959. header: 'Email'
  960. }, {
  961. field: 'role',
  962. header: 'Hak Akses'
  963. }, {
  964. field: 'status',
  965. header: 'Status'
  966. }]);
  967. /***/ }),
  968. /***/ "./resources/js/utils/menu.js":
  969. /*!************************************!*\
  970. !*** ./resources/js/utils/menu.js ***!
  971. \************************************/
  972. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  973. "use strict";
  974. __webpack_require__.r(__webpack_exports__);
  975. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  976. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  977. /* harmony export */ });
  978. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  979. // Admin
  980. 1: [{
  981. label: 'Home',
  982. items: [{
  983. label: 'Dashboard',
  984. icon: 'pi pi-home',
  985. to: '/dashboards',
  986. component: 'home/Index'
  987. }]
  988. }, {
  989. label: 'Master',
  990. items: [{
  991. label: 'User',
  992. icon: 'pi pi-user',
  993. to: '/users',
  994. component: 'user/Index'
  995. }]
  996. }],
  997. // Supervisor
  998. 2: [{
  999. label: 'Home',
  1000. items: [{
  1001. label: 'Dashboard',
  1002. icon: 'pi pi-home',
  1003. to: '/dashboards',
  1004. component: 'home/Index'
  1005. }]
  1006. }, {
  1007. label: 'Menu',
  1008. items: [{
  1009. label: 'Pengeluaran',
  1010. icon: 'pi pi-wallet',
  1011. to: '/expenses',
  1012. component: 'expense/Index'
  1013. }, {
  1014. label: 'Laporan',
  1015. icon: 'pi pi-book',
  1016. items: [{
  1017. label: 'Mutasi',
  1018. icon: 'pi pi-circle',
  1019. to: '/reports/mutations',
  1020. component: 'mutation/Report'
  1021. }]
  1022. }]
  1023. }, {
  1024. label: 'Master',
  1025. items: [{
  1026. label: 'Jenis Kendaraan',
  1027. icon: 'pi pi-car',
  1028. to: '/type-vehicles',
  1029. component: 'typevehicle/Index'
  1030. }, {
  1031. label: 'Jenis Member',
  1032. icon: 'pi pi-id-card',
  1033. to: '/type-members',
  1034. component: 'typemember/Index'
  1035. }]
  1036. }, {
  1037. label: 'Pengaturan',
  1038. items: [{
  1039. label: 'Tarif Parkir',
  1040. icon: 'pi pi-car',
  1041. to: '/parking-fees/create',
  1042. component: 'parkingfee/Create'
  1043. }]
  1044. }],
  1045. // Operator
  1046. 3: [{
  1047. label: 'Home',
  1048. items: [{
  1049. label: 'Dashboard',
  1050. icon: 'pi pi-home',
  1051. to: '/dashboards',
  1052. component: 'home/Index'
  1053. }]
  1054. }, {
  1055. label: 'Transaksi',
  1056. items: [{
  1057. label: 'Transaksi Keluar',
  1058. icon: 'pi pi-car',
  1059. to: '/transactions/create',
  1060. component: 'transaction/Create'
  1061. }]
  1062. }, {
  1063. label: 'Menu',
  1064. items: [{
  1065. label: 'Pengeluaran',
  1066. icon: 'pi pi-wallet',
  1067. to: '/expenses',
  1068. component: 'expense/Index'
  1069. }, {
  1070. label: 'Member',
  1071. icon: 'pi pi-id-card',
  1072. to: '/members',
  1073. component: 'member/Index'
  1074. }, {
  1075. label: 'Top Up',
  1076. icon: 'pi pi-car',
  1077. to: '/top-ups',
  1078. component: 'topup/Index'
  1079. }]
  1080. }]
  1081. });
  1082. /***/ }),
  1083. /***/ "./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":
  1084. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1085. !*** ./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 ***!
  1086. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1087. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1088. "use strict";
  1089. __webpack_require__.r(__webpack_exports__);
  1090. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1091. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1092. /* harmony export */ });
  1093. /* 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");
  1094. /* 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__);
  1095. // Imports
  1096. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1097. // Module
  1098. ___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}", ""]);
  1099. // Exports
  1100. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1101. /***/ }),
  1102. /***/ "./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":
  1103. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1104. !*** ./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 ***!
  1105. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1106. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1107. "use strict";
  1108. __webpack_require__.r(__webpack_exports__);
  1109. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1110. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1111. /* harmony export */ });
  1112. /* 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");
  1113. /* 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__);
  1114. // Imports
  1115. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1116. // Module
  1117. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1118. // Exports
  1119. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1120. /***/ }),
  1121. /***/ "./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":
  1122. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1123. !*** ./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 ***!
  1124. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1125. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1126. "use strict";
  1127. __webpack_require__.r(__webpack_exports__);
  1128. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1129. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1130. /* harmony export */ });
  1131. /* 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");
  1132. /* 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__);
  1133. // Imports
  1134. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1135. // Module
  1136. ___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}", ""]);
  1137. // Exports
  1138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1139. /***/ }),
  1140. /***/ "./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":
  1141. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1142. !*** ./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 ***!
  1143. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1144. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1145. "use strict";
  1146. __webpack_require__.r(__webpack_exports__);
  1147. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1148. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1149. /* harmony export */ });
  1150. /* 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");
  1151. /* 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__);
  1152. // Imports
  1153. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1154. // Module
  1155. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\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}", ""]);
  1156. // Exports
  1157. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1158. /***/ }),
  1159. /***/ "./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":
  1160. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1161. !*** ./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 ***!
  1162. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1163. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1164. "use strict";
  1165. __webpack_require__.r(__webpack_exports__);
  1166. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1167. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1168. /* harmony export */ });
  1169. /* 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");
  1170. /* 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__);
  1171. // Imports
  1172. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1173. // Module
  1174. ___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: 996;\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: 995;\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}", ""]);
  1175. // Exports
  1176. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1177. /***/ }),
  1178. /***/ "./node_modules/lodash/lodash.js":
  1179. /*!***************************************!*\
  1180. !*** ./node_modules/lodash/lodash.js ***!
  1181. \***************************************/
  1182. /***/ (function(module, exports, __webpack_require__) {
  1183. /* module decorator */ module = __webpack_require__.nmd(module);
  1184. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1185. * @license
  1186. * Lodash <https://lodash.com/>
  1187. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1188. * Released under MIT license <https://lodash.com/license>
  1189. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1190. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1191. */
  1192. ;(function() {
  1193. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1194. var undefined;
  1195. /** Used as the semantic version number. */
  1196. var VERSION = '4.17.21';
  1197. /** Used as the size to enable large array optimizations. */
  1198. var LARGE_ARRAY_SIZE = 200;
  1199. /** Error message constants. */
  1200. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1201. FUNC_ERROR_TEXT = 'Expected a function',
  1202. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1203. /** Used to stand-in for `undefined` hash values. */
  1204. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1205. /** Used as the maximum memoize cache size. */
  1206. var MAX_MEMOIZE_SIZE = 500;
  1207. /** Used as the internal argument placeholder. */
  1208. var PLACEHOLDER = '__lodash_placeholder__';
  1209. /** Used to compose bitmasks for cloning. */
  1210. var CLONE_DEEP_FLAG = 1,
  1211. CLONE_FLAT_FLAG = 2,
  1212. CLONE_SYMBOLS_FLAG = 4;
  1213. /** Used to compose bitmasks for value comparisons. */
  1214. var COMPARE_PARTIAL_FLAG = 1,
  1215. COMPARE_UNORDERED_FLAG = 2;
  1216. /** Used to compose bitmasks for function metadata. */
  1217. var WRAP_BIND_FLAG = 1,
  1218. WRAP_BIND_KEY_FLAG = 2,
  1219. WRAP_CURRY_BOUND_FLAG = 4,
  1220. WRAP_CURRY_FLAG = 8,
  1221. WRAP_CURRY_RIGHT_FLAG = 16,
  1222. WRAP_PARTIAL_FLAG = 32,
  1223. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1224. WRAP_ARY_FLAG = 128,
  1225. WRAP_REARG_FLAG = 256,
  1226. WRAP_FLIP_FLAG = 512;
  1227. /** Used as default options for `_.truncate`. */
  1228. var DEFAULT_TRUNC_LENGTH = 30,
  1229. DEFAULT_TRUNC_OMISSION = '...';
  1230. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1231. var HOT_COUNT = 800,
  1232. HOT_SPAN = 16;
  1233. /** Used to indicate the type of lazy iteratees. */
  1234. var LAZY_FILTER_FLAG = 1,
  1235. LAZY_MAP_FLAG = 2,
  1236. LAZY_WHILE_FLAG = 3;
  1237. /** Used as references for various `Number` constants. */
  1238. var INFINITY = 1 / 0,
  1239. MAX_SAFE_INTEGER = 9007199254740991,
  1240. MAX_INTEGER = 1.7976931348623157e+308,
  1241. NAN = 0 / 0;
  1242. /** Used as references for the maximum length and index of an array. */
  1243. var MAX_ARRAY_LENGTH = 4294967295,
  1244. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1245. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1246. /** Used to associate wrap methods with their bit flags. */
  1247. var wrapFlags = [
  1248. ['ary', WRAP_ARY_FLAG],
  1249. ['bind', WRAP_BIND_FLAG],
  1250. ['bindKey', WRAP_BIND_KEY_FLAG],
  1251. ['curry', WRAP_CURRY_FLAG],
  1252. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1253. ['flip', WRAP_FLIP_FLAG],
  1254. ['partial', WRAP_PARTIAL_FLAG],
  1255. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1256. ['rearg', WRAP_REARG_FLAG]
  1257. ];
  1258. /** `Object#toString` result references. */
  1259. var argsTag = '[object Arguments]',
  1260. arrayTag = '[object Array]',
  1261. asyncTag = '[object AsyncFunction]',
  1262. boolTag = '[object Boolean]',
  1263. dateTag = '[object Date]',
  1264. domExcTag = '[object DOMException]',
  1265. errorTag = '[object Error]',
  1266. funcTag = '[object Function]',
  1267. genTag = '[object GeneratorFunction]',
  1268. mapTag = '[object Map]',
  1269. numberTag = '[object Number]',
  1270. nullTag = '[object Null]',
  1271. objectTag = '[object Object]',
  1272. promiseTag = '[object Promise]',
  1273. proxyTag = '[object Proxy]',
  1274. regexpTag = '[object RegExp]',
  1275. setTag = '[object Set]',
  1276. stringTag = '[object String]',
  1277. symbolTag = '[object Symbol]',
  1278. undefinedTag = '[object Undefined]',
  1279. weakMapTag = '[object WeakMap]',
  1280. weakSetTag = '[object WeakSet]';
  1281. var arrayBufferTag = '[object ArrayBuffer]',
  1282. dataViewTag = '[object DataView]',
  1283. float32Tag = '[object Float32Array]',
  1284. float64Tag = '[object Float64Array]',
  1285. int8Tag = '[object Int8Array]',
  1286. int16Tag = '[object Int16Array]',
  1287. int32Tag = '[object Int32Array]',
  1288. uint8Tag = '[object Uint8Array]',
  1289. uint8ClampedTag = '[object Uint8ClampedArray]',
  1290. uint16Tag = '[object Uint16Array]',
  1291. uint32Tag = '[object Uint32Array]';
  1292. /** Used to match empty string literals in compiled template source. */
  1293. var reEmptyStringLeading = /\b__p \+= '';/g,
  1294. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1295. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1296. /** Used to match HTML entities and HTML characters. */
  1297. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1298. reUnescapedHtml = /[&<>"']/g,
  1299. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1300. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1301. /** Used to match template delimiters. */
  1302. var reEscape = /<%-([\s\S]+?)%>/g,
  1303. reEvaluate = /<%([\s\S]+?)%>/g,
  1304. reInterpolate = /<%=([\s\S]+?)%>/g;
  1305. /** Used to match property names within property paths. */
  1306. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1307. reIsPlainProp = /^\w*$/,
  1308. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1309. /**
  1310. * Used to match `RegExp`
  1311. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1312. */
  1313. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1314. reHasRegExpChar = RegExp(reRegExpChar.source);
  1315. /** Used to match leading whitespace. */
  1316. var reTrimStart = /^\s+/;
  1317. /** Used to match a single whitespace character. */
  1318. var reWhitespace = /\s/;
  1319. /** Used to match wrap detail comments. */
  1320. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1321. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1322. reSplitDetails = /,? & /;
  1323. /** Used to match words composed of alphanumeric characters. */
  1324. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1325. /**
  1326. * Used to validate the `validate` option in `_.template` variable.
  1327. *
  1328. * Forbids characters which could potentially change the meaning of the function argument definition:
  1329. * - "()," (modification of function parameters)
  1330. * - "=" (default value)
  1331. * - "[]{}" (destructuring of function parameters)
  1332. * - "/" (beginning of a comment)
  1333. * - whitespace
  1334. */
  1335. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1336. /** Used to match backslashes in property paths. */
  1337. var reEscapeChar = /\\(\\)?/g;
  1338. /**
  1339. * Used to match
  1340. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1341. */
  1342. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1343. /** Used to match `RegExp` flags from their coerced string values. */
  1344. var reFlags = /\w*$/;
  1345. /** Used to detect bad signed hexadecimal string values. */
  1346. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1347. /** Used to detect binary string values. */
  1348. var reIsBinary = /^0b[01]+$/i;
  1349. /** Used to detect host constructors (Safari). */
  1350. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1351. /** Used to detect octal string values. */
  1352. var reIsOctal = /^0o[0-7]+$/i;
  1353. /** Used to detect unsigned integer values. */
  1354. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1355. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1356. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1357. /** Used to ensure capturing order of template delimiters. */
  1358. var reNoMatch = /($^)/;
  1359. /** Used to match unescaped characters in compiled string literals. */
  1360. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1361. /** Used to compose unicode character classes. */
  1362. var rsAstralRange = '\\ud800-\\udfff',
  1363. rsComboMarksRange = '\\u0300-\\u036f',
  1364. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1365. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1366. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1367. rsDingbatRange = '\\u2700-\\u27bf',
  1368. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1369. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1370. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1371. rsPunctuationRange = '\\u2000-\\u206f',
  1372. 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',
  1373. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1374. rsVarRange = '\\ufe0e\\ufe0f',
  1375. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1376. /** Used to compose unicode capture groups. */
  1377. var rsApos = "['\u2019]",
  1378. rsAstral = '[' + rsAstralRange + ']',
  1379. rsBreak = '[' + rsBreakRange + ']',
  1380. rsCombo = '[' + rsComboRange + ']',
  1381. rsDigits = '\\d+',
  1382. rsDingbat = '[' + rsDingbatRange + ']',
  1383. rsLower = '[' + rsLowerRange + ']',
  1384. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1385. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1386. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1387. rsNonAstral = '[^' + rsAstralRange + ']',
  1388. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1389. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1390. rsUpper = '[' + rsUpperRange + ']',
  1391. rsZWJ = '\\u200d';
  1392. /** Used to compose unicode regexes. */
  1393. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1394. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1395. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1396. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1397. reOptMod = rsModifier + '?',
  1398. rsOptVar = '[' + rsVarRange + ']?',
  1399. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1400. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1401. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1402. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1403. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1404. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1405. /** Used to match apostrophes. */
  1406. var reApos = RegExp(rsApos, 'g');
  1407. /**
  1408. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1409. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1410. */
  1411. var reComboMark = RegExp(rsCombo, 'g');
  1412. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1413. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1414. /** Used to match complex or compound words. */
  1415. var reUnicodeWord = RegExp([
  1416. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1417. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1418. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1419. rsUpper + '+' + rsOptContrUpper,
  1420. rsOrdUpper,
  1421. rsOrdLower,
  1422. rsDigits,
  1423. rsEmoji
  1424. ].join('|'), 'g');
  1425. /** 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/). */
  1426. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1427. /** Used to detect strings that need a more robust regexp to match words. */
  1428. 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 ]/;
  1429. /** Used to assign default `context` object properties. */
  1430. var contextProps = [
  1431. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1432. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1433. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1434. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1435. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1436. ];
  1437. /** Used to make template sourceURLs easier to identify. */
  1438. var templateCounter = -1;
  1439. /** Used to identify `toStringTag` values of typed arrays. */
  1440. var typedArrayTags = {};
  1441. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1442. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1443. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1444. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1445. typedArrayTags[uint32Tag] = true;
  1446. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1447. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1448. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1449. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1450. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1451. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1452. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1453. typedArrayTags[weakMapTag] = false;
  1454. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1455. var cloneableTags = {};
  1456. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1457. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1458. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1459. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1460. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1461. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1462. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1463. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1464. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1465. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1466. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1467. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1468. cloneableTags[weakMapTag] = false;
  1469. /** Used to map Latin Unicode letters to basic Latin letters. */
  1470. var deburredLetters = {
  1471. // Latin-1 Supplement block.
  1472. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1473. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1474. '\xc7': 'C', '\xe7': 'c',
  1475. '\xd0': 'D', '\xf0': 'd',
  1476. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1477. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1478. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1479. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1480. '\xd1': 'N', '\xf1': 'n',
  1481. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1482. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1483. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1484. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1485. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1486. '\xc6': 'Ae', '\xe6': 'ae',
  1487. '\xde': 'Th', '\xfe': 'th',
  1488. '\xdf': 'ss',
  1489. // Latin Extended-A block.
  1490. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1491. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1492. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1493. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1494. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1495. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1496. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1497. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1498. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1499. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1500. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1501. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1502. '\u0134': 'J', '\u0135': 'j',
  1503. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1504. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1505. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1506. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1507. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1508. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1509. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1510. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1511. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1512. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1513. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1514. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1515. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1516. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1517. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1518. '\u0174': 'W', '\u0175': 'w',
  1519. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1520. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1521. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1522. '\u0132': 'IJ', '\u0133': 'ij',
  1523. '\u0152': 'Oe', '\u0153': 'oe',
  1524. '\u0149': "'n", '\u017f': 's'
  1525. };
  1526. /** Used to map characters to HTML entities. */
  1527. var htmlEscapes = {
  1528. '&': '&amp;',
  1529. '<': '&lt;',
  1530. '>': '&gt;',
  1531. '"': '&quot;',
  1532. "'": '&#39;'
  1533. };
  1534. /** Used to map HTML entities to characters. */
  1535. var htmlUnescapes = {
  1536. '&amp;': '&',
  1537. '&lt;': '<',
  1538. '&gt;': '>',
  1539. '&quot;': '"',
  1540. '&#39;': "'"
  1541. };
  1542. /** Used to escape characters for inclusion in compiled string literals. */
  1543. var stringEscapes = {
  1544. '\\': '\\',
  1545. "'": "'",
  1546. '\n': 'n',
  1547. '\r': 'r',
  1548. '\u2028': 'u2028',
  1549. '\u2029': 'u2029'
  1550. };
  1551. /** Built-in method references without a dependency on `root`. */
  1552. var freeParseFloat = parseFloat,
  1553. freeParseInt = parseInt;
  1554. /** Detect free variable `global` from Node.js. */
  1555. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1556. /** Detect free variable `self`. */
  1557. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1558. /** Used as a reference to the global object. */
  1559. var root = freeGlobal || freeSelf || Function('return this')();
  1560. /** Detect free variable `exports`. */
  1561. var freeExports = true && exports && !exports.nodeType && exports;
  1562. /** Detect free variable `module`. */
  1563. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1564. /** Detect the popular CommonJS extension `module.exports`. */
  1565. var moduleExports = freeModule && freeModule.exports === freeExports;
  1566. /** Detect free variable `process` from Node.js. */
  1567. var freeProcess = moduleExports && freeGlobal.process;
  1568. /** Used to access faster Node.js helpers. */
  1569. var nodeUtil = (function() {
  1570. try {
  1571. // Use `util.types` for Node.js 10+.
  1572. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1573. if (types) {
  1574. return types;
  1575. }
  1576. // Legacy `process.binding('util')` for Node.js < 10.
  1577. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1578. } catch (e) {}
  1579. }());
  1580. /* Node.js helper references. */
  1581. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1582. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1583. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1584. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1585. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1586. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1587. /*--------------------------------------------------------------------------*/
  1588. /**
  1589. * A faster alternative to `Function#apply`, this function invokes `func`
  1590. * with the `this` binding of `thisArg` and the arguments of `args`.
  1591. *
  1592. * @private
  1593. * @param {Function} func The function to invoke.
  1594. * @param {*} thisArg The `this` binding of `func`.
  1595. * @param {Array} args The arguments to invoke `func` with.
  1596. * @returns {*} Returns the result of `func`.
  1597. */
  1598. function apply(func, thisArg, args) {
  1599. switch (args.length) {
  1600. case 0: return func.call(thisArg);
  1601. case 1: return func.call(thisArg, args[0]);
  1602. case 2: return func.call(thisArg, args[0], args[1]);
  1603. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1604. }
  1605. return func.apply(thisArg, args);
  1606. }
  1607. /**
  1608. * A specialized version of `baseAggregator` for arrays.
  1609. *
  1610. * @private
  1611. * @param {Array} [array] The array to iterate over.
  1612. * @param {Function} setter The function to set `accumulator` values.
  1613. * @param {Function} iteratee The iteratee to transform keys.
  1614. * @param {Object} accumulator The initial aggregated object.
  1615. * @returns {Function} Returns `accumulator`.
  1616. */
  1617. function arrayAggregator(array, setter, iteratee, accumulator) {
  1618. var index = -1,
  1619. length = array == null ? 0 : array.length;
  1620. while (++index < length) {
  1621. var value = array[index];
  1622. setter(accumulator, value, iteratee(value), array);
  1623. }
  1624. return accumulator;
  1625. }
  1626. /**
  1627. * A specialized version of `_.forEach` for arrays without support for
  1628. * iteratee shorthands.
  1629. *
  1630. * @private
  1631. * @param {Array} [array] The array to iterate over.
  1632. * @param {Function} iteratee The function invoked per iteration.
  1633. * @returns {Array} Returns `array`.
  1634. */
  1635. function arrayEach(array, iteratee) {
  1636. var index = -1,
  1637. length = array == null ? 0 : array.length;
  1638. while (++index < length) {
  1639. if (iteratee(array[index], index, array) === false) {
  1640. break;
  1641. }
  1642. }
  1643. return array;
  1644. }
  1645. /**
  1646. * A specialized version of `_.forEachRight` for arrays without support for
  1647. * iteratee shorthands.
  1648. *
  1649. * @private
  1650. * @param {Array} [array] The array to iterate over.
  1651. * @param {Function} iteratee The function invoked per iteration.
  1652. * @returns {Array} Returns `array`.
  1653. */
  1654. function arrayEachRight(array, iteratee) {
  1655. var length = array == null ? 0 : array.length;
  1656. while (length--) {
  1657. if (iteratee(array[length], length, array) === false) {
  1658. break;
  1659. }
  1660. }
  1661. return array;
  1662. }
  1663. /**
  1664. * A specialized version of `_.every` for arrays without support for
  1665. * iteratee shorthands.
  1666. *
  1667. * @private
  1668. * @param {Array} [array] The array to iterate over.
  1669. * @param {Function} predicate The function invoked per iteration.
  1670. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1671. * else `false`.
  1672. */
  1673. function arrayEvery(array, predicate) {
  1674. var index = -1,
  1675. length = array == null ? 0 : array.length;
  1676. while (++index < length) {
  1677. if (!predicate(array[index], index, array)) {
  1678. return false;
  1679. }
  1680. }
  1681. return true;
  1682. }
  1683. /**
  1684. * A specialized version of `_.filter` for arrays without support for
  1685. * iteratee shorthands.
  1686. *
  1687. * @private
  1688. * @param {Array} [array] The array to iterate over.
  1689. * @param {Function} predicate The function invoked per iteration.
  1690. * @returns {Array} Returns the new filtered array.
  1691. */
  1692. function arrayFilter(array, predicate) {
  1693. var index = -1,
  1694. length = array == null ? 0 : array.length,
  1695. resIndex = 0,
  1696. result = [];
  1697. while (++index < length) {
  1698. var value = array[index];
  1699. if (predicate(value, index, array)) {
  1700. result[resIndex++] = value;
  1701. }
  1702. }
  1703. return result;
  1704. }
  1705. /**
  1706. * A specialized version of `_.includes` for arrays without support for
  1707. * specifying an index to search from.
  1708. *
  1709. * @private
  1710. * @param {Array} [array] The array to inspect.
  1711. * @param {*} target The value to search for.
  1712. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1713. */
  1714. function arrayIncludes(array, value) {
  1715. var length = array == null ? 0 : array.length;
  1716. return !!length && baseIndexOf(array, value, 0) > -1;
  1717. }
  1718. /**
  1719. * This function is like `arrayIncludes` except that it accepts a comparator.
  1720. *
  1721. * @private
  1722. * @param {Array} [array] The array to inspect.
  1723. * @param {*} target The value to search for.
  1724. * @param {Function} comparator The comparator invoked per element.
  1725. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1726. */
  1727. function arrayIncludesWith(array, value, comparator) {
  1728. var index = -1,
  1729. length = array == null ? 0 : array.length;
  1730. while (++index < length) {
  1731. if (comparator(value, array[index])) {
  1732. return true;
  1733. }
  1734. }
  1735. return false;
  1736. }
  1737. /**
  1738. * A specialized version of `_.map` for arrays without support for iteratee
  1739. * shorthands.
  1740. *
  1741. * @private
  1742. * @param {Array} [array] The array to iterate over.
  1743. * @param {Function} iteratee The function invoked per iteration.
  1744. * @returns {Array} Returns the new mapped array.
  1745. */
  1746. function arrayMap(array, iteratee) {
  1747. var index = -1,
  1748. length = array == null ? 0 : array.length,
  1749. result = Array(length);
  1750. while (++index < length) {
  1751. result[index] = iteratee(array[index], index, array);
  1752. }
  1753. return result;
  1754. }
  1755. /**
  1756. * Appends the elements of `values` to `array`.
  1757. *
  1758. * @private
  1759. * @param {Array} array The array to modify.
  1760. * @param {Array} values The values to append.
  1761. * @returns {Array} Returns `array`.
  1762. */
  1763. function arrayPush(array, values) {
  1764. var index = -1,
  1765. length = values.length,
  1766. offset = array.length;
  1767. while (++index < length) {
  1768. array[offset + index] = values[index];
  1769. }
  1770. return array;
  1771. }
  1772. /**
  1773. * A specialized version of `_.reduce` for arrays without support for
  1774. * iteratee shorthands.
  1775. *
  1776. * @private
  1777. * @param {Array} [array] The array to iterate over.
  1778. * @param {Function} iteratee The function invoked per iteration.
  1779. * @param {*} [accumulator] The initial value.
  1780. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1781. * the initial value.
  1782. * @returns {*} Returns the accumulated value.
  1783. */
  1784. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1785. var index = -1,
  1786. length = array == null ? 0 : array.length;
  1787. if (initAccum && length) {
  1788. accumulator = array[++index];
  1789. }
  1790. while (++index < length) {
  1791. accumulator = iteratee(accumulator, array[index], index, array);
  1792. }
  1793. return accumulator;
  1794. }
  1795. /**
  1796. * A specialized version of `_.reduceRight` for arrays without support for
  1797. * iteratee shorthands.
  1798. *
  1799. * @private
  1800. * @param {Array} [array] The array to iterate over.
  1801. * @param {Function} iteratee The function invoked per iteration.
  1802. * @param {*} [accumulator] The initial value.
  1803. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1804. * the initial value.
  1805. * @returns {*} Returns the accumulated value.
  1806. */
  1807. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1808. var length = array == null ? 0 : array.length;
  1809. if (initAccum && length) {
  1810. accumulator = array[--length];
  1811. }
  1812. while (length--) {
  1813. accumulator = iteratee(accumulator, array[length], length, array);
  1814. }
  1815. return accumulator;
  1816. }
  1817. /**
  1818. * A specialized version of `_.some` for arrays without support for iteratee
  1819. * shorthands.
  1820. *
  1821. * @private
  1822. * @param {Array} [array] The array to iterate over.
  1823. * @param {Function} predicate The function invoked per iteration.
  1824. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1825. * else `false`.
  1826. */
  1827. function arraySome(array, predicate) {
  1828. var index = -1,
  1829. length = array == null ? 0 : array.length;
  1830. while (++index < length) {
  1831. if (predicate(array[index], index, array)) {
  1832. return true;
  1833. }
  1834. }
  1835. return false;
  1836. }
  1837. /**
  1838. * Gets the size of an ASCII `string`.
  1839. *
  1840. * @private
  1841. * @param {string} string The string inspect.
  1842. * @returns {number} Returns the string size.
  1843. */
  1844. var asciiSize = baseProperty('length');
  1845. /**
  1846. * Converts an ASCII `string` to an array.
  1847. *
  1848. * @private
  1849. * @param {string} string The string to convert.
  1850. * @returns {Array} Returns the converted array.
  1851. */
  1852. function asciiToArray(string) {
  1853. return string.split('');
  1854. }
  1855. /**
  1856. * Splits an ASCII `string` into an array of its words.
  1857. *
  1858. * @private
  1859. * @param {string} The string to inspect.
  1860. * @returns {Array} Returns the words of `string`.
  1861. */
  1862. function asciiWords(string) {
  1863. return string.match(reAsciiWord) || [];
  1864. }
  1865. /**
  1866. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1867. * without support for iteratee shorthands, which iterates over `collection`
  1868. * using `eachFunc`.
  1869. *
  1870. * @private
  1871. * @param {Array|Object} collection The collection to inspect.
  1872. * @param {Function} predicate The function invoked per iteration.
  1873. * @param {Function} eachFunc The function to iterate over `collection`.
  1874. * @returns {*} Returns the found element or its key, else `undefined`.
  1875. */
  1876. function baseFindKey(collection, predicate, eachFunc) {
  1877. var result;
  1878. eachFunc(collection, function(value, key, collection) {
  1879. if (predicate(value, key, collection)) {
  1880. result = key;
  1881. return false;
  1882. }
  1883. });
  1884. return result;
  1885. }
  1886. /**
  1887. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1888. * support for iteratee shorthands.
  1889. *
  1890. * @private
  1891. * @param {Array} array The array to inspect.
  1892. * @param {Function} predicate The function invoked per iteration.
  1893. * @param {number} fromIndex The index to search from.
  1894. * @param {boolean} [fromRight] Specify iterating from right to left.
  1895. * @returns {number} Returns the index of the matched value, else `-1`.
  1896. */
  1897. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1898. var length = array.length,
  1899. index = fromIndex + (fromRight ? 1 : -1);
  1900. while ((fromRight ? index-- : ++index < length)) {
  1901. if (predicate(array[index], index, array)) {
  1902. return index;
  1903. }
  1904. }
  1905. return -1;
  1906. }
  1907. /**
  1908. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1909. *
  1910. * @private
  1911. * @param {Array} array The array to inspect.
  1912. * @param {*} value The value to search for.
  1913. * @param {number} fromIndex The index to search from.
  1914. * @returns {number} Returns the index of the matched value, else `-1`.
  1915. */
  1916. function baseIndexOf(array, value, fromIndex) {
  1917. return value === value
  1918. ? strictIndexOf(array, value, fromIndex)
  1919. : baseFindIndex(array, baseIsNaN, fromIndex);
  1920. }
  1921. /**
  1922. * This function is like `baseIndexOf` except that it accepts a comparator.
  1923. *
  1924. * @private
  1925. * @param {Array} array The array to inspect.
  1926. * @param {*} value The value to search for.
  1927. * @param {number} fromIndex The index to search from.
  1928. * @param {Function} comparator The comparator invoked per element.
  1929. * @returns {number} Returns the index of the matched value, else `-1`.
  1930. */
  1931. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1932. var index = fromIndex - 1,
  1933. length = array.length;
  1934. while (++index < length) {
  1935. if (comparator(array[index], value)) {
  1936. return index;
  1937. }
  1938. }
  1939. return -1;
  1940. }
  1941. /**
  1942. * The base implementation of `_.isNaN` without support for number objects.
  1943. *
  1944. * @private
  1945. * @param {*} value The value to check.
  1946. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1947. */
  1948. function baseIsNaN(value) {
  1949. return value !== value;
  1950. }
  1951. /**
  1952. * The base implementation of `_.mean` and `_.meanBy` without support for
  1953. * iteratee shorthands.
  1954. *
  1955. * @private
  1956. * @param {Array} array The array to iterate over.
  1957. * @param {Function} iteratee The function invoked per iteration.
  1958. * @returns {number} Returns the mean.
  1959. */
  1960. function baseMean(array, iteratee) {
  1961. var length = array == null ? 0 : array.length;
  1962. return length ? (baseSum(array, iteratee) / length) : NAN;
  1963. }
  1964. /**
  1965. * The base implementation of `_.property` without support for deep paths.
  1966. *
  1967. * @private
  1968. * @param {string} key The key of the property to get.
  1969. * @returns {Function} Returns the new accessor function.
  1970. */
  1971. function baseProperty(key) {
  1972. return function(object) {
  1973. return object == null ? undefined : object[key];
  1974. };
  1975. }
  1976. /**
  1977. * The base implementation of `_.propertyOf` without support for deep paths.
  1978. *
  1979. * @private
  1980. * @param {Object} object The object to query.
  1981. * @returns {Function} Returns the new accessor function.
  1982. */
  1983. function basePropertyOf(object) {
  1984. return function(key) {
  1985. return object == null ? undefined : object[key];
  1986. };
  1987. }
  1988. /**
  1989. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1990. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1991. *
  1992. * @private
  1993. * @param {Array|Object} collection The collection to iterate over.
  1994. * @param {Function} iteratee The function invoked per iteration.
  1995. * @param {*} accumulator The initial value.
  1996. * @param {boolean} initAccum Specify using the first or last element of
  1997. * `collection` as the initial value.
  1998. * @param {Function} eachFunc The function to iterate over `collection`.
  1999. * @returns {*} Returns the accumulated value.
  2000. */
  2001. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2002. eachFunc(collection, function(value, index, collection) {
  2003. accumulator = initAccum
  2004. ? (initAccum = false, value)
  2005. : iteratee(accumulator, value, index, collection);
  2006. });
  2007. return accumulator;
  2008. }
  2009. /**
  2010. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2011. * sort order of `array` and replaces criteria objects with their corresponding
  2012. * values.
  2013. *
  2014. * @private
  2015. * @param {Array} array The array to sort.
  2016. * @param {Function} comparer The function to define sort order.
  2017. * @returns {Array} Returns `array`.
  2018. */
  2019. function baseSortBy(array, comparer) {
  2020. var length = array.length;
  2021. array.sort(comparer);
  2022. while (length--) {
  2023. array[length] = array[length].value;
  2024. }
  2025. return array;
  2026. }
  2027. /**
  2028. * The base implementation of `_.sum` and `_.sumBy` without support for
  2029. * iteratee shorthands.
  2030. *
  2031. * @private
  2032. * @param {Array} array The array to iterate over.
  2033. * @param {Function} iteratee The function invoked per iteration.
  2034. * @returns {number} Returns the sum.
  2035. */
  2036. function baseSum(array, iteratee) {
  2037. var result,
  2038. index = -1,
  2039. length = array.length;
  2040. while (++index < length) {
  2041. var current = iteratee(array[index]);
  2042. if (current !== undefined) {
  2043. result = result === undefined ? current : (result + current);
  2044. }
  2045. }
  2046. return result;
  2047. }
  2048. /**
  2049. * The base implementation of `_.times` without support for iteratee shorthands
  2050. * or max array length checks.
  2051. *
  2052. * @private
  2053. * @param {number} n The number of times to invoke `iteratee`.
  2054. * @param {Function} iteratee The function invoked per iteration.
  2055. * @returns {Array} Returns the array of results.
  2056. */
  2057. function baseTimes(n, iteratee) {
  2058. var index = -1,
  2059. result = Array(n);
  2060. while (++index < n) {
  2061. result[index] = iteratee(index);
  2062. }
  2063. return result;
  2064. }
  2065. /**
  2066. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2067. * of key-value pairs for `object` corresponding to the property names of `props`.
  2068. *
  2069. * @private
  2070. * @param {Object} object The object to query.
  2071. * @param {Array} props The property names to get values for.
  2072. * @returns {Object} Returns the key-value pairs.
  2073. */
  2074. function baseToPairs(object, props) {
  2075. return arrayMap(props, function(key) {
  2076. return [key, object[key]];
  2077. });
  2078. }
  2079. /**
  2080. * The base implementation of `_.trim`.
  2081. *
  2082. * @private
  2083. * @param {string} string The string to trim.
  2084. * @returns {string} Returns the trimmed string.
  2085. */
  2086. function baseTrim(string) {
  2087. return string
  2088. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2089. : string;
  2090. }
  2091. /**
  2092. * The base implementation of `_.unary` without support for storing metadata.
  2093. *
  2094. * @private
  2095. * @param {Function} func The function to cap arguments for.
  2096. * @returns {Function} Returns the new capped function.
  2097. */
  2098. function baseUnary(func) {
  2099. return function(value) {
  2100. return func(value);
  2101. };
  2102. }
  2103. /**
  2104. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2105. * array of `object` property values corresponding to the property names
  2106. * of `props`.
  2107. *
  2108. * @private
  2109. * @param {Object} object The object to query.
  2110. * @param {Array} props The property names to get values for.
  2111. * @returns {Object} Returns the array of property values.
  2112. */
  2113. function baseValues(object, props) {
  2114. return arrayMap(props, function(key) {
  2115. return object[key];
  2116. });
  2117. }
  2118. /**
  2119. * Checks if a `cache` value for `key` exists.
  2120. *
  2121. * @private
  2122. * @param {Object} cache The cache to query.
  2123. * @param {string} key The key of the entry to check.
  2124. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2125. */
  2126. function cacheHas(cache, key) {
  2127. return cache.has(key);
  2128. }
  2129. /**
  2130. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2131. * that is not found in the character symbols.
  2132. *
  2133. * @private
  2134. * @param {Array} strSymbols The string symbols to inspect.
  2135. * @param {Array} chrSymbols The character symbols to find.
  2136. * @returns {number} Returns the index of the first unmatched string symbol.
  2137. */
  2138. function charsStartIndex(strSymbols, chrSymbols) {
  2139. var index = -1,
  2140. length = strSymbols.length;
  2141. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2142. return index;
  2143. }
  2144. /**
  2145. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2146. * that is not found in the character symbols.
  2147. *
  2148. * @private
  2149. * @param {Array} strSymbols The string symbols to inspect.
  2150. * @param {Array} chrSymbols The character symbols to find.
  2151. * @returns {number} Returns the index of the last unmatched string symbol.
  2152. */
  2153. function charsEndIndex(strSymbols, chrSymbols) {
  2154. var index = strSymbols.length;
  2155. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2156. return index;
  2157. }
  2158. /**
  2159. * Gets the number of `placeholder` occurrences in `array`.
  2160. *
  2161. * @private
  2162. * @param {Array} array The array to inspect.
  2163. * @param {*} placeholder The placeholder to search for.
  2164. * @returns {number} Returns the placeholder count.
  2165. */
  2166. function countHolders(array, placeholder) {
  2167. var length = array.length,
  2168. result = 0;
  2169. while (length--) {
  2170. if (array[length] === placeholder) {
  2171. ++result;
  2172. }
  2173. }
  2174. return result;
  2175. }
  2176. /**
  2177. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2178. * letters to basic Latin letters.
  2179. *
  2180. * @private
  2181. * @param {string} letter The matched letter to deburr.
  2182. * @returns {string} Returns the deburred letter.
  2183. */
  2184. var deburrLetter = basePropertyOf(deburredLetters);
  2185. /**
  2186. * Used by `_.escape` to convert characters to HTML entities.
  2187. *
  2188. * @private
  2189. * @param {string} chr The matched character to escape.
  2190. * @returns {string} Returns the escaped character.
  2191. */
  2192. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2193. /**
  2194. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2195. *
  2196. * @private
  2197. * @param {string} chr The matched character to escape.
  2198. * @returns {string} Returns the escaped character.
  2199. */
  2200. function escapeStringChar(chr) {
  2201. return '\\' + stringEscapes[chr];
  2202. }
  2203. /**
  2204. * Gets the value at `key` of `object`.
  2205. *
  2206. * @private
  2207. * @param {Object} [object] The object to query.
  2208. * @param {string} key The key of the property to get.
  2209. * @returns {*} Returns the property value.
  2210. */
  2211. function getValue(object, key) {
  2212. return object == null ? undefined : object[key];
  2213. }
  2214. /**
  2215. * Checks if `string` contains Unicode symbols.
  2216. *
  2217. * @private
  2218. * @param {string} string The string to inspect.
  2219. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2220. */
  2221. function hasUnicode(string) {
  2222. return reHasUnicode.test(string);
  2223. }
  2224. /**
  2225. * Checks if `string` contains a word composed of Unicode symbols.
  2226. *
  2227. * @private
  2228. * @param {string} string The string to inspect.
  2229. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2230. */
  2231. function hasUnicodeWord(string) {
  2232. return reHasUnicodeWord.test(string);
  2233. }
  2234. /**
  2235. * Converts `iterator` to an array.
  2236. *
  2237. * @private
  2238. * @param {Object} iterator The iterator to convert.
  2239. * @returns {Array} Returns the converted array.
  2240. */
  2241. function iteratorToArray(iterator) {
  2242. var data,
  2243. result = [];
  2244. while (!(data = iterator.next()).done) {
  2245. result.push(data.value);
  2246. }
  2247. return result;
  2248. }
  2249. /**
  2250. * Converts `map` to its key-value pairs.
  2251. *
  2252. * @private
  2253. * @param {Object} map The map to convert.
  2254. * @returns {Array} Returns the key-value pairs.
  2255. */
  2256. function mapToArray(map) {
  2257. var index = -1,
  2258. result = Array(map.size);
  2259. map.forEach(function(value, key) {
  2260. result[++index] = [key, value];
  2261. });
  2262. return result;
  2263. }
  2264. /**
  2265. * Creates a unary function that invokes `func` with its argument transformed.
  2266. *
  2267. * @private
  2268. * @param {Function} func The function to wrap.
  2269. * @param {Function} transform The argument transform.
  2270. * @returns {Function} Returns the new function.
  2271. */
  2272. function overArg(func, transform) {
  2273. return function(arg) {
  2274. return func(transform(arg));
  2275. };
  2276. }
  2277. /**
  2278. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2279. * and returns an array of their indexes.
  2280. *
  2281. * @private
  2282. * @param {Array} array The array to modify.
  2283. * @param {*} placeholder The placeholder to replace.
  2284. * @returns {Array} Returns the new array of placeholder indexes.
  2285. */
  2286. function replaceHolders(array, placeholder) {
  2287. var index = -1,
  2288. length = array.length,
  2289. resIndex = 0,
  2290. result = [];
  2291. while (++index < length) {
  2292. var value = array[index];
  2293. if (value === placeholder || value === PLACEHOLDER) {
  2294. array[index] = PLACEHOLDER;
  2295. result[resIndex++] = index;
  2296. }
  2297. }
  2298. return result;
  2299. }
  2300. /**
  2301. * Converts `set` to an array of its values.
  2302. *
  2303. * @private
  2304. * @param {Object} set The set to convert.
  2305. * @returns {Array} Returns the values.
  2306. */
  2307. function setToArray(set) {
  2308. var index = -1,
  2309. result = Array(set.size);
  2310. set.forEach(function(value) {
  2311. result[++index] = value;
  2312. });
  2313. return result;
  2314. }
  2315. /**
  2316. * Converts `set` to its value-value pairs.
  2317. *
  2318. * @private
  2319. * @param {Object} set The set to convert.
  2320. * @returns {Array} Returns the value-value pairs.
  2321. */
  2322. function setToPairs(set) {
  2323. var index = -1,
  2324. result = Array(set.size);
  2325. set.forEach(function(value) {
  2326. result[++index] = [value, value];
  2327. });
  2328. return result;
  2329. }
  2330. /**
  2331. * A specialized version of `_.indexOf` which performs strict equality
  2332. * comparisons of values, i.e. `===`.
  2333. *
  2334. * @private
  2335. * @param {Array} array The array to inspect.
  2336. * @param {*} value The value to search for.
  2337. * @param {number} fromIndex The index to search from.
  2338. * @returns {number} Returns the index of the matched value, else `-1`.
  2339. */
  2340. function strictIndexOf(array, value, fromIndex) {
  2341. var index = fromIndex - 1,
  2342. length = array.length;
  2343. while (++index < length) {
  2344. if (array[index] === value) {
  2345. return index;
  2346. }
  2347. }
  2348. return -1;
  2349. }
  2350. /**
  2351. * A specialized version of `_.lastIndexOf` which performs strict equality
  2352. * comparisons of values, i.e. `===`.
  2353. *
  2354. * @private
  2355. * @param {Array} array The array to inspect.
  2356. * @param {*} value The value to search for.
  2357. * @param {number} fromIndex The index to search from.
  2358. * @returns {number} Returns the index of the matched value, else `-1`.
  2359. */
  2360. function strictLastIndexOf(array, value, fromIndex) {
  2361. var index = fromIndex + 1;
  2362. while (index--) {
  2363. if (array[index] === value) {
  2364. return index;
  2365. }
  2366. }
  2367. return index;
  2368. }
  2369. /**
  2370. * Gets the number of symbols in `string`.
  2371. *
  2372. * @private
  2373. * @param {string} string The string to inspect.
  2374. * @returns {number} Returns the string size.
  2375. */
  2376. function stringSize(string) {
  2377. return hasUnicode(string)
  2378. ? unicodeSize(string)
  2379. : asciiSize(string);
  2380. }
  2381. /**
  2382. * Converts `string` to an array.
  2383. *
  2384. * @private
  2385. * @param {string} string The string to convert.
  2386. * @returns {Array} Returns the converted array.
  2387. */
  2388. function stringToArray(string) {
  2389. return hasUnicode(string)
  2390. ? unicodeToArray(string)
  2391. : asciiToArray(string);
  2392. }
  2393. /**
  2394. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2395. * character of `string`.
  2396. *
  2397. * @private
  2398. * @param {string} string The string to inspect.
  2399. * @returns {number} Returns the index of the last non-whitespace character.
  2400. */
  2401. function trimmedEndIndex(string) {
  2402. var index = string.length;
  2403. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2404. return index;
  2405. }
  2406. /**
  2407. * Used by `_.unescape` to convert HTML entities to characters.
  2408. *
  2409. * @private
  2410. * @param {string} chr The matched character to unescape.
  2411. * @returns {string} Returns the unescaped character.
  2412. */
  2413. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2414. /**
  2415. * Gets the size of a Unicode `string`.
  2416. *
  2417. * @private
  2418. * @param {string} string The string inspect.
  2419. * @returns {number} Returns the string size.
  2420. */
  2421. function unicodeSize(string) {
  2422. var result = reUnicode.lastIndex = 0;
  2423. while (reUnicode.test(string)) {
  2424. ++result;
  2425. }
  2426. return result;
  2427. }
  2428. /**
  2429. * Converts a Unicode `string` to an array.
  2430. *
  2431. * @private
  2432. * @param {string} string The string to convert.
  2433. * @returns {Array} Returns the converted array.
  2434. */
  2435. function unicodeToArray(string) {
  2436. return string.match(reUnicode) || [];
  2437. }
  2438. /**
  2439. * Splits a Unicode `string` into an array of its words.
  2440. *
  2441. * @private
  2442. * @param {string} The string to inspect.
  2443. * @returns {Array} Returns the words of `string`.
  2444. */
  2445. function unicodeWords(string) {
  2446. return string.match(reUnicodeWord) || [];
  2447. }
  2448. /*--------------------------------------------------------------------------*/
  2449. /**
  2450. * Create a new pristine `lodash` function using the `context` object.
  2451. *
  2452. * @static
  2453. * @memberOf _
  2454. * @since 1.1.0
  2455. * @category Util
  2456. * @param {Object} [context=root] The context object.
  2457. * @returns {Function} Returns a new `lodash` function.
  2458. * @example
  2459. *
  2460. * _.mixin({ 'foo': _.constant('foo') });
  2461. *
  2462. * var lodash = _.runInContext();
  2463. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2464. *
  2465. * _.isFunction(_.foo);
  2466. * // => true
  2467. * _.isFunction(_.bar);
  2468. * // => false
  2469. *
  2470. * lodash.isFunction(lodash.foo);
  2471. * // => false
  2472. * lodash.isFunction(lodash.bar);
  2473. * // => true
  2474. *
  2475. * // Create a suped-up `defer` in Node.js.
  2476. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2477. */
  2478. var runInContext = (function runInContext(context) {
  2479. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2480. /** Built-in constructor references. */
  2481. var Array = context.Array,
  2482. Date = context.Date,
  2483. Error = context.Error,
  2484. Function = context.Function,
  2485. Math = context.Math,
  2486. Object = context.Object,
  2487. RegExp = context.RegExp,
  2488. String = context.String,
  2489. TypeError = context.TypeError;
  2490. /** Used for built-in method references. */
  2491. var arrayProto = Array.prototype,
  2492. funcProto = Function.prototype,
  2493. objectProto = Object.prototype;
  2494. /** Used to detect overreaching core-js shims. */
  2495. var coreJsData = context['__core-js_shared__'];
  2496. /** Used to resolve the decompiled source of functions. */
  2497. var funcToString = funcProto.toString;
  2498. /** Used to check objects for own properties. */
  2499. var hasOwnProperty = objectProto.hasOwnProperty;
  2500. /** Used to generate unique IDs. */
  2501. var idCounter = 0;
  2502. /** Used to detect methods masquerading as native. */
  2503. var maskSrcKey = (function() {
  2504. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2505. return uid ? ('Symbol(src)_1.' + uid) : '';
  2506. }());
  2507. /**
  2508. * Used to resolve the
  2509. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2510. * of values.
  2511. */
  2512. var nativeObjectToString = objectProto.toString;
  2513. /** Used to infer the `Object` constructor. */
  2514. var objectCtorString = funcToString.call(Object);
  2515. /** Used to restore the original `_` reference in `_.noConflict`. */
  2516. var oldDash = root._;
  2517. /** Used to detect if a method is native. */
  2518. var reIsNative = RegExp('^' +
  2519. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2520. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2521. );
  2522. /** Built-in value references. */
  2523. var Buffer = moduleExports ? context.Buffer : undefined,
  2524. Symbol = context.Symbol,
  2525. Uint8Array = context.Uint8Array,
  2526. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2527. getPrototype = overArg(Object.getPrototypeOf, Object),
  2528. objectCreate = Object.create,
  2529. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2530. splice = arrayProto.splice,
  2531. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2532. symIterator = Symbol ? Symbol.iterator : undefined,
  2533. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2534. var defineProperty = (function() {
  2535. try {
  2536. var func = getNative(Object, 'defineProperty');
  2537. func({}, '', {});
  2538. return func;
  2539. } catch (e) {}
  2540. }());
  2541. /** Mocked built-ins. */
  2542. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2543. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2544. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2545. /* Built-in method references for those with the same name as other `lodash` methods. */
  2546. var nativeCeil = Math.ceil,
  2547. nativeFloor = Math.floor,
  2548. nativeGetSymbols = Object.getOwnPropertySymbols,
  2549. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2550. nativeIsFinite = context.isFinite,
  2551. nativeJoin = arrayProto.join,
  2552. nativeKeys = overArg(Object.keys, Object),
  2553. nativeMax = Math.max,
  2554. nativeMin = Math.min,
  2555. nativeNow = Date.now,
  2556. nativeParseInt = context.parseInt,
  2557. nativeRandom = Math.random,
  2558. nativeReverse = arrayProto.reverse;
  2559. /* Built-in method references that are verified to be native. */
  2560. var DataView = getNative(context, 'DataView'),
  2561. Map = getNative(context, 'Map'),
  2562. Promise = getNative(context, 'Promise'),
  2563. Set = getNative(context, 'Set'),
  2564. WeakMap = getNative(context, 'WeakMap'),
  2565. nativeCreate = getNative(Object, 'create');
  2566. /** Used to store function metadata. */
  2567. var metaMap = WeakMap && new WeakMap;
  2568. /** Used to lookup unminified function names. */
  2569. var realNames = {};
  2570. /** Used to detect maps, sets, and weakmaps. */
  2571. var dataViewCtorString = toSource(DataView),
  2572. mapCtorString = toSource(Map),
  2573. promiseCtorString = toSource(Promise),
  2574. setCtorString = toSource(Set),
  2575. weakMapCtorString = toSource(WeakMap);
  2576. /** Used to convert symbols to primitives and strings. */
  2577. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2578. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2579. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2580. /*------------------------------------------------------------------------*/
  2581. /**
  2582. * Creates a `lodash` object which wraps `value` to enable implicit method
  2583. * chain sequences. Methods that operate on and return arrays, collections,
  2584. * and functions can be chained together. Methods that retrieve a single value
  2585. * or may return a primitive value will automatically end the chain sequence
  2586. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2587. * with `_#value`.
  2588. *
  2589. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2590. * enabled using `_.chain`.
  2591. *
  2592. * The execution of chained methods is lazy, that is, it's deferred until
  2593. * `_#value` is implicitly or explicitly called.
  2594. *
  2595. * Lazy evaluation allows several methods to support shortcut fusion.
  2596. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2597. * the creation of intermediate arrays and can greatly reduce the number of
  2598. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2599. * fusion if the section is applied to an array and iteratees accept only
  2600. * one argument. The heuristic for whether a section qualifies for shortcut
  2601. * fusion is subject to change.
  2602. *
  2603. * Chaining is supported in custom builds as long as the `_#value` method is
  2604. * directly or indirectly included in the build.
  2605. *
  2606. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2607. *
  2608. * The wrapper `Array` methods are:
  2609. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2610. *
  2611. * The wrapper `String` methods are:
  2612. * `replace` and `split`
  2613. *
  2614. * The wrapper methods that support shortcut fusion are:
  2615. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2616. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2617. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2618. *
  2619. * The chainable wrapper methods are:
  2620. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2621. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2622. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2623. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2624. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2625. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2626. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2627. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2628. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2629. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2630. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2631. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2632. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2633. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2634. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2635. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2636. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2637. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2638. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2639. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2640. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2641. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2642. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2643. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2644. *
  2645. * The wrapper methods that are **not** chainable by default are:
  2646. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2647. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2648. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2649. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2650. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2651. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2652. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2653. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2654. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2655. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2656. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2657. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2658. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2659. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2660. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2661. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2662. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2663. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2664. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2665. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2666. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2667. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2668. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2669. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2670. * `upperFirst`, `value`, and `words`
  2671. *
  2672. * @name _
  2673. * @constructor
  2674. * @category Seq
  2675. * @param {*} value The value to wrap in a `lodash` instance.
  2676. * @returns {Object} Returns the new `lodash` wrapper instance.
  2677. * @example
  2678. *
  2679. * function square(n) {
  2680. * return n * n;
  2681. * }
  2682. *
  2683. * var wrapped = _([1, 2, 3]);
  2684. *
  2685. * // Returns an unwrapped value.
  2686. * wrapped.reduce(_.add);
  2687. * // => 6
  2688. *
  2689. * // Returns a wrapped value.
  2690. * var squares = wrapped.map(square);
  2691. *
  2692. * _.isArray(squares);
  2693. * // => false
  2694. *
  2695. * _.isArray(squares.value());
  2696. * // => true
  2697. */
  2698. function lodash(value) {
  2699. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2700. if (value instanceof LodashWrapper) {
  2701. return value;
  2702. }
  2703. if (hasOwnProperty.call(value, '__wrapped__')) {
  2704. return wrapperClone(value);
  2705. }
  2706. }
  2707. return new LodashWrapper(value);
  2708. }
  2709. /**
  2710. * The base implementation of `_.create` without support for assigning
  2711. * properties to the created object.
  2712. *
  2713. * @private
  2714. * @param {Object} proto The object to inherit from.
  2715. * @returns {Object} Returns the new object.
  2716. */
  2717. var baseCreate = (function() {
  2718. function object() {}
  2719. return function(proto) {
  2720. if (!isObject(proto)) {
  2721. return {};
  2722. }
  2723. if (objectCreate) {
  2724. return objectCreate(proto);
  2725. }
  2726. object.prototype = proto;
  2727. var result = new object;
  2728. object.prototype = undefined;
  2729. return result;
  2730. };
  2731. }());
  2732. /**
  2733. * The function whose prototype chain sequence wrappers inherit from.
  2734. *
  2735. * @private
  2736. */
  2737. function baseLodash() {
  2738. // No operation performed.
  2739. }
  2740. /**
  2741. * The base constructor for creating `lodash` wrapper objects.
  2742. *
  2743. * @private
  2744. * @param {*} value The value to wrap.
  2745. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2746. */
  2747. function LodashWrapper(value, chainAll) {
  2748. this.__wrapped__ = value;
  2749. this.__actions__ = [];
  2750. this.__chain__ = !!chainAll;
  2751. this.__index__ = 0;
  2752. this.__values__ = undefined;
  2753. }
  2754. /**
  2755. * By default, the template delimiters used by lodash are like those in
  2756. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2757. * following template settings to use alternative delimiters.
  2758. *
  2759. * @static
  2760. * @memberOf _
  2761. * @type {Object}
  2762. */
  2763. lodash.templateSettings = {
  2764. /**
  2765. * Used to detect `data` property values to be HTML-escaped.
  2766. *
  2767. * @memberOf _.templateSettings
  2768. * @type {RegExp}
  2769. */
  2770. 'escape': reEscape,
  2771. /**
  2772. * Used to detect code to be evaluated.
  2773. *
  2774. * @memberOf _.templateSettings
  2775. * @type {RegExp}
  2776. */
  2777. 'evaluate': reEvaluate,
  2778. /**
  2779. * Used to detect `data` property values to inject.
  2780. *
  2781. * @memberOf _.templateSettings
  2782. * @type {RegExp}
  2783. */
  2784. 'interpolate': reInterpolate,
  2785. /**
  2786. * Used to reference the data object in the template text.
  2787. *
  2788. * @memberOf _.templateSettings
  2789. * @type {string}
  2790. */
  2791. 'variable': '',
  2792. /**
  2793. * Used to import variables into the compiled template.
  2794. *
  2795. * @memberOf _.templateSettings
  2796. * @type {Object}
  2797. */
  2798. 'imports': {
  2799. /**
  2800. * A reference to the `lodash` function.
  2801. *
  2802. * @memberOf _.templateSettings.imports
  2803. * @type {Function}
  2804. */
  2805. '_': lodash
  2806. }
  2807. };
  2808. // Ensure wrappers are instances of `baseLodash`.
  2809. lodash.prototype = baseLodash.prototype;
  2810. lodash.prototype.constructor = lodash;
  2811. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2812. LodashWrapper.prototype.constructor = LodashWrapper;
  2813. /*------------------------------------------------------------------------*/
  2814. /**
  2815. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2816. *
  2817. * @private
  2818. * @constructor
  2819. * @param {*} value The value to wrap.
  2820. */
  2821. function LazyWrapper(value) {
  2822. this.__wrapped__ = value;
  2823. this.__actions__ = [];
  2824. this.__dir__ = 1;
  2825. this.__filtered__ = false;
  2826. this.__iteratees__ = [];
  2827. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2828. this.__views__ = [];
  2829. }
  2830. /**
  2831. * Creates a clone of the lazy wrapper object.
  2832. *
  2833. * @private
  2834. * @name clone
  2835. * @memberOf LazyWrapper
  2836. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2837. */
  2838. function lazyClone() {
  2839. var result = new LazyWrapper(this.__wrapped__);
  2840. result.__actions__ = copyArray(this.__actions__);
  2841. result.__dir__ = this.__dir__;
  2842. result.__filtered__ = this.__filtered__;
  2843. result.__iteratees__ = copyArray(this.__iteratees__);
  2844. result.__takeCount__ = this.__takeCount__;
  2845. result.__views__ = copyArray(this.__views__);
  2846. return result;
  2847. }
  2848. /**
  2849. * Reverses the direction of lazy iteration.
  2850. *
  2851. * @private
  2852. * @name reverse
  2853. * @memberOf LazyWrapper
  2854. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2855. */
  2856. function lazyReverse() {
  2857. if (this.__filtered__) {
  2858. var result = new LazyWrapper(this);
  2859. result.__dir__ = -1;
  2860. result.__filtered__ = true;
  2861. } else {
  2862. result = this.clone();
  2863. result.__dir__ *= -1;
  2864. }
  2865. return result;
  2866. }
  2867. /**
  2868. * Extracts the unwrapped value from its lazy wrapper.
  2869. *
  2870. * @private
  2871. * @name value
  2872. * @memberOf LazyWrapper
  2873. * @returns {*} Returns the unwrapped value.
  2874. */
  2875. function lazyValue() {
  2876. var array = this.__wrapped__.value(),
  2877. dir = this.__dir__,
  2878. isArr = isArray(array),
  2879. isRight = dir < 0,
  2880. arrLength = isArr ? array.length : 0,
  2881. view = getView(0, arrLength, this.__views__),
  2882. start = view.start,
  2883. end = view.end,
  2884. length = end - start,
  2885. index = isRight ? end : (start - 1),
  2886. iteratees = this.__iteratees__,
  2887. iterLength = iteratees.length,
  2888. resIndex = 0,
  2889. takeCount = nativeMin(length, this.__takeCount__);
  2890. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2891. return baseWrapperValue(array, this.__actions__);
  2892. }
  2893. var result = [];
  2894. outer:
  2895. while (length-- && resIndex < takeCount) {
  2896. index += dir;
  2897. var iterIndex = -1,
  2898. value = array[index];
  2899. while (++iterIndex < iterLength) {
  2900. var data = iteratees[iterIndex],
  2901. iteratee = data.iteratee,
  2902. type = data.type,
  2903. computed = iteratee(value);
  2904. if (type == LAZY_MAP_FLAG) {
  2905. value = computed;
  2906. } else if (!computed) {
  2907. if (type == LAZY_FILTER_FLAG) {
  2908. continue outer;
  2909. } else {
  2910. break outer;
  2911. }
  2912. }
  2913. }
  2914. result[resIndex++] = value;
  2915. }
  2916. return result;
  2917. }
  2918. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2919. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2920. LazyWrapper.prototype.constructor = LazyWrapper;
  2921. /*------------------------------------------------------------------------*/
  2922. /**
  2923. * Creates a hash object.
  2924. *
  2925. * @private
  2926. * @constructor
  2927. * @param {Array} [entries] The key-value pairs to cache.
  2928. */
  2929. function Hash(entries) {
  2930. var index = -1,
  2931. length = entries == null ? 0 : entries.length;
  2932. this.clear();
  2933. while (++index < length) {
  2934. var entry = entries[index];
  2935. this.set(entry[0], entry[1]);
  2936. }
  2937. }
  2938. /**
  2939. * Removes all key-value entries from the hash.
  2940. *
  2941. * @private
  2942. * @name clear
  2943. * @memberOf Hash
  2944. */
  2945. function hashClear() {
  2946. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2947. this.size = 0;
  2948. }
  2949. /**
  2950. * Removes `key` and its value from the hash.
  2951. *
  2952. * @private
  2953. * @name delete
  2954. * @memberOf Hash
  2955. * @param {Object} hash The hash to modify.
  2956. * @param {string} key The key of the value to remove.
  2957. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2958. */
  2959. function hashDelete(key) {
  2960. var result = this.has(key) && delete this.__data__[key];
  2961. this.size -= result ? 1 : 0;
  2962. return result;
  2963. }
  2964. /**
  2965. * Gets the hash value for `key`.
  2966. *
  2967. * @private
  2968. * @name get
  2969. * @memberOf Hash
  2970. * @param {string} key The key of the value to get.
  2971. * @returns {*} Returns the entry value.
  2972. */
  2973. function hashGet(key) {
  2974. var data = this.__data__;
  2975. if (nativeCreate) {
  2976. var result = data[key];
  2977. return result === HASH_UNDEFINED ? undefined : result;
  2978. }
  2979. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2980. }
  2981. /**
  2982. * Checks if a hash value for `key` exists.
  2983. *
  2984. * @private
  2985. * @name has
  2986. * @memberOf Hash
  2987. * @param {string} key The key of the entry to check.
  2988. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2989. */
  2990. function hashHas(key) {
  2991. var data = this.__data__;
  2992. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2993. }
  2994. /**
  2995. * Sets the hash `key` to `value`.
  2996. *
  2997. * @private
  2998. * @name set
  2999. * @memberOf Hash
  3000. * @param {string} key The key of the value to set.
  3001. * @param {*} value The value to set.
  3002. * @returns {Object} Returns the hash instance.
  3003. */
  3004. function hashSet(key, value) {
  3005. var data = this.__data__;
  3006. this.size += this.has(key) ? 0 : 1;
  3007. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3008. return this;
  3009. }
  3010. // Add methods to `Hash`.
  3011. Hash.prototype.clear = hashClear;
  3012. Hash.prototype['delete'] = hashDelete;
  3013. Hash.prototype.get = hashGet;
  3014. Hash.prototype.has = hashHas;
  3015. Hash.prototype.set = hashSet;
  3016. /*------------------------------------------------------------------------*/
  3017. /**
  3018. * Creates an list cache object.
  3019. *
  3020. * @private
  3021. * @constructor
  3022. * @param {Array} [entries] The key-value pairs to cache.
  3023. */
  3024. function ListCache(entries) {
  3025. var index = -1,
  3026. length = entries == null ? 0 : entries.length;
  3027. this.clear();
  3028. while (++index < length) {
  3029. var entry = entries[index];
  3030. this.set(entry[0], entry[1]);
  3031. }
  3032. }
  3033. /**
  3034. * Removes all key-value entries from the list cache.
  3035. *
  3036. * @private
  3037. * @name clear
  3038. * @memberOf ListCache
  3039. */
  3040. function listCacheClear() {
  3041. this.__data__ = [];
  3042. this.size = 0;
  3043. }
  3044. /**
  3045. * Removes `key` and its value from the list cache.
  3046. *
  3047. * @private
  3048. * @name delete
  3049. * @memberOf ListCache
  3050. * @param {string} key The key of the value to remove.
  3051. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3052. */
  3053. function listCacheDelete(key) {
  3054. var data = this.__data__,
  3055. index = assocIndexOf(data, key);
  3056. if (index < 0) {
  3057. return false;
  3058. }
  3059. var lastIndex = data.length - 1;
  3060. if (index == lastIndex) {
  3061. data.pop();
  3062. } else {
  3063. splice.call(data, index, 1);
  3064. }
  3065. --this.size;
  3066. return true;
  3067. }
  3068. /**
  3069. * Gets the list cache value for `key`.
  3070. *
  3071. * @private
  3072. * @name get
  3073. * @memberOf ListCache
  3074. * @param {string} key The key of the value to get.
  3075. * @returns {*} Returns the entry value.
  3076. */
  3077. function listCacheGet(key) {
  3078. var data = this.__data__,
  3079. index = assocIndexOf(data, key);
  3080. return index < 0 ? undefined : data[index][1];
  3081. }
  3082. /**
  3083. * Checks if a list cache value for `key` exists.
  3084. *
  3085. * @private
  3086. * @name has
  3087. * @memberOf ListCache
  3088. * @param {string} key The key of the entry to check.
  3089. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3090. */
  3091. function listCacheHas(key) {
  3092. return assocIndexOf(this.__data__, key) > -1;
  3093. }
  3094. /**
  3095. * Sets the list cache `key` to `value`.
  3096. *
  3097. * @private
  3098. * @name set
  3099. * @memberOf ListCache
  3100. * @param {string} key The key of the value to set.
  3101. * @param {*} value The value to set.
  3102. * @returns {Object} Returns the list cache instance.
  3103. */
  3104. function listCacheSet(key, value) {
  3105. var data = this.__data__,
  3106. index = assocIndexOf(data, key);
  3107. if (index < 0) {
  3108. ++this.size;
  3109. data.push([key, value]);
  3110. } else {
  3111. data[index][1] = value;
  3112. }
  3113. return this;
  3114. }
  3115. // Add methods to `ListCache`.
  3116. ListCache.prototype.clear = listCacheClear;
  3117. ListCache.prototype['delete'] = listCacheDelete;
  3118. ListCache.prototype.get = listCacheGet;
  3119. ListCache.prototype.has = listCacheHas;
  3120. ListCache.prototype.set = listCacheSet;
  3121. /*------------------------------------------------------------------------*/
  3122. /**
  3123. * Creates a map cache object to store key-value pairs.
  3124. *
  3125. * @private
  3126. * @constructor
  3127. * @param {Array} [entries] The key-value pairs to cache.
  3128. */
  3129. function MapCache(entries) {
  3130. var index = -1,
  3131. length = entries == null ? 0 : entries.length;
  3132. this.clear();
  3133. while (++index < length) {
  3134. var entry = entries[index];
  3135. this.set(entry[0], entry[1]);
  3136. }
  3137. }
  3138. /**
  3139. * Removes all key-value entries from the map.
  3140. *
  3141. * @private
  3142. * @name clear
  3143. * @memberOf MapCache
  3144. */
  3145. function mapCacheClear() {
  3146. this.size = 0;
  3147. this.__data__ = {
  3148. 'hash': new Hash,
  3149. 'map': new (Map || ListCache),
  3150. 'string': new Hash
  3151. };
  3152. }
  3153. /**
  3154. * Removes `key` and its value from the map.
  3155. *
  3156. * @private
  3157. * @name delete
  3158. * @memberOf MapCache
  3159. * @param {string} key The key of the value to remove.
  3160. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3161. */
  3162. function mapCacheDelete(key) {
  3163. var result = getMapData(this, key)['delete'](key);
  3164. this.size -= result ? 1 : 0;
  3165. return result;
  3166. }
  3167. /**
  3168. * Gets the map value for `key`.
  3169. *
  3170. * @private
  3171. * @name get
  3172. * @memberOf MapCache
  3173. * @param {string} key The key of the value to get.
  3174. * @returns {*} Returns the entry value.
  3175. */
  3176. function mapCacheGet(key) {
  3177. return getMapData(this, key).get(key);
  3178. }
  3179. /**
  3180. * Checks if a map value for `key` exists.
  3181. *
  3182. * @private
  3183. * @name has
  3184. * @memberOf MapCache
  3185. * @param {string} key The key of the entry to check.
  3186. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3187. */
  3188. function mapCacheHas(key) {
  3189. return getMapData(this, key).has(key);
  3190. }
  3191. /**
  3192. * Sets the map `key` to `value`.
  3193. *
  3194. * @private
  3195. * @name set
  3196. * @memberOf MapCache
  3197. * @param {string} key The key of the value to set.
  3198. * @param {*} value The value to set.
  3199. * @returns {Object} Returns the map cache instance.
  3200. */
  3201. function mapCacheSet(key, value) {
  3202. var data = getMapData(this, key),
  3203. size = data.size;
  3204. data.set(key, value);
  3205. this.size += data.size == size ? 0 : 1;
  3206. return this;
  3207. }
  3208. // Add methods to `MapCache`.
  3209. MapCache.prototype.clear = mapCacheClear;
  3210. MapCache.prototype['delete'] = mapCacheDelete;
  3211. MapCache.prototype.get = mapCacheGet;
  3212. MapCache.prototype.has = mapCacheHas;
  3213. MapCache.prototype.set = mapCacheSet;
  3214. /*------------------------------------------------------------------------*/
  3215. /**
  3216. *
  3217. * Creates an array cache object to store unique values.
  3218. *
  3219. * @private
  3220. * @constructor
  3221. * @param {Array} [values] The values to cache.
  3222. */
  3223. function SetCache(values) {
  3224. var index = -1,
  3225. length = values == null ? 0 : values.length;
  3226. this.__data__ = new MapCache;
  3227. while (++index < length) {
  3228. this.add(values[index]);
  3229. }
  3230. }
  3231. /**
  3232. * Adds `value` to the array cache.
  3233. *
  3234. * @private
  3235. * @name add
  3236. * @memberOf SetCache
  3237. * @alias push
  3238. * @param {*} value The value to cache.
  3239. * @returns {Object} Returns the cache instance.
  3240. */
  3241. function setCacheAdd(value) {
  3242. this.__data__.set(value, HASH_UNDEFINED);
  3243. return this;
  3244. }
  3245. /**
  3246. * Checks if `value` is in the array cache.
  3247. *
  3248. * @private
  3249. * @name has
  3250. * @memberOf SetCache
  3251. * @param {*} value The value to search for.
  3252. * @returns {number} Returns `true` if `value` is found, else `false`.
  3253. */
  3254. function setCacheHas(value) {
  3255. return this.__data__.has(value);
  3256. }
  3257. // Add methods to `SetCache`.
  3258. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3259. SetCache.prototype.has = setCacheHas;
  3260. /*------------------------------------------------------------------------*/
  3261. /**
  3262. * Creates a stack cache object to store key-value pairs.
  3263. *
  3264. * @private
  3265. * @constructor
  3266. * @param {Array} [entries] The key-value pairs to cache.
  3267. */
  3268. function Stack(entries) {
  3269. var data = this.__data__ = new ListCache(entries);
  3270. this.size = data.size;
  3271. }
  3272. /**
  3273. * Removes all key-value entries from the stack.
  3274. *
  3275. * @private
  3276. * @name clear
  3277. * @memberOf Stack
  3278. */
  3279. function stackClear() {
  3280. this.__data__ = new ListCache;
  3281. this.size = 0;
  3282. }
  3283. /**
  3284. * Removes `key` and its value from the stack.
  3285. *
  3286. * @private
  3287. * @name delete
  3288. * @memberOf Stack
  3289. * @param {string} key The key of the value to remove.
  3290. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3291. */
  3292. function stackDelete(key) {
  3293. var data = this.__data__,
  3294. result = data['delete'](key);
  3295. this.size = data.size;
  3296. return result;
  3297. }
  3298. /**
  3299. * Gets the stack value for `key`.
  3300. *
  3301. * @private
  3302. * @name get
  3303. * @memberOf Stack
  3304. * @param {string} key The key of the value to get.
  3305. * @returns {*} Returns the entry value.
  3306. */
  3307. function stackGet(key) {
  3308. return this.__data__.get(key);
  3309. }
  3310. /**
  3311. * Checks if a stack value for `key` exists.
  3312. *
  3313. * @private
  3314. * @name has
  3315. * @memberOf Stack
  3316. * @param {string} key The key of the entry to check.
  3317. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3318. */
  3319. function stackHas(key) {
  3320. return this.__data__.has(key);
  3321. }
  3322. /**
  3323. * Sets the stack `key` to `value`.
  3324. *
  3325. * @private
  3326. * @name set
  3327. * @memberOf Stack
  3328. * @param {string} key The key of the value to set.
  3329. * @param {*} value The value to set.
  3330. * @returns {Object} Returns the stack cache instance.
  3331. */
  3332. function stackSet(key, value) {
  3333. var data = this.__data__;
  3334. if (data instanceof ListCache) {
  3335. var pairs = data.__data__;
  3336. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3337. pairs.push([key, value]);
  3338. this.size = ++data.size;
  3339. return this;
  3340. }
  3341. data = this.__data__ = new MapCache(pairs);
  3342. }
  3343. data.set(key, value);
  3344. this.size = data.size;
  3345. return this;
  3346. }
  3347. // Add methods to `Stack`.
  3348. Stack.prototype.clear = stackClear;
  3349. Stack.prototype['delete'] = stackDelete;
  3350. Stack.prototype.get = stackGet;
  3351. Stack.prototype.has = stackHas;
  3352. Stack.prototype.set = stackSet;
  3353. /*------------------------------------------------------------------------*/
  3354. /**
  3355. * Creates an array of the enumerable property names of the array-like `value`.
  3356. *
  3357. * @private
  3358. * @param {*} value The value to query.
  3359. * @param {boolean} inherited Specify returning inherited property names.
  3360. * @returns {Array} Returns the array of property names.
  3361. */
  3362. function arrayLikeKeys(value, inherited) {
  3363. var isArr = isArray(value),
  3364. isArg = !isArr && isArguments(value),
  3365. isBuff = !isArr && !isArg && isBuffer(value),
  3366. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3367. skipIndexes = isArr || isArg || isBuff || isType,
  3368. result = skipIndexes ? baseTimes(value.length, String) : [],
  3369. length = result.length;
  3370. for (var key in value) {
  3371. if ((inherited || hasOwnProperty.call(value, key)) &&
  3372. !(skipIndexes && (
  3373. // Safari 9 has enumerable `arguments.length` in strict mode.
  3374. key == 'length' ||
  3375. // Node.js 0.10 has enumerable non-index properties on buffers.
  3376. (isBuff && (key == 'offset' || key == 'parent')) ||
  3377. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3378. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3379. // Skip index properties.
  3380. isIndex(key, length)
  3381. ))) {
  3382. result.push(key);
  3383. }
  3384. }
  3385. return result;
  3386. }
  3387. /**
  3388. * A specialized version of `_.sample` for arrays.
  3389. *
  3390. * @private
  3391. * @param {Array} array The array to sample.
  3392. * @returns {*} Returns the random element.
  3393. */
  3394. function arraySample(array) {
  3395. var length = array.length;
  3396. return length ? array[baseRandom(0, length - 1)] : undefined;
  3397. }
  3398. /**
  3399. * A specialized version of `_.sampleSize` for arrays.
  3400. *
  3401. * @private
  3402. * @param {Array} array The array to sample.
  3403. * @param {number} n The number of elements to sample.
  3404. * @returns {Array} Returns the random elements.
  3405. */
  3406. function arraySampleSize(array, n) {
  3407. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3408. }
  3409. /**
  3410. * A specialized version of `_.shuffle` for arrays.
  3411. *
  3412. * @private
  3413. * @param {Array} array The array to shuffle.
  3414. * @returns {Array} Returns the new shuffled array.
  3415. */
  3416. function arrayShuffle(array) {
  3417. return shuffleSelf(copyArray(array));
  3418. }
  3419. /**
  3420. * This function is like `assignValue` except that it doesn't assign
  3421. * `undefined` values.
  3422. *
  3423. * @private
  3424. * @param {Object} object The object to modify.
  3425. * @param {string} key The key of the property to assign.
  3426. * @param {*} value The value to assign.
  3427. */
  3428. function assignMergeValue(object, key, value) {
  3429. if ((value !== undefined && !eq(object[key], value)) ||
  3430. (value === undefined && !(key in object))) {
  3431. baseAssignValue(object, key, value);
  3432. }
  3433. }
  3434. /**
  3435. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3436. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3437. * for equality comparisons.
  3438. *
  3439. * @private
  3440. * @param {Object} object The object to modify.
  3441. * @param {string} key The key of the property to assign.
  3442. * @param {*} value The value to assign.
  3443. */
  3444. function assignValue(object, key, value) {
  3445. var objValue = object[key];
  3446. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3447. (value === undefined && !(key in object))) {
  3448. baseAssignValue(object, key, value);
  3449. }
  3450. }
  3451. /**
  3452. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3453. *
  3454. * @private
  3455. * @param {Array} array The array to inspect.
  3456. * @param {*} key The key to search for.
  3457. * @returns {number} Returns the index of the matched value, else `-1`.
  3458. */
  3459. function assocIndexOf(array, key) {
  3460. var length = array.length;
  3461. while (length--) {
  3462. if (eq(array[length][0], key)) {
  3463. return length;
  3464. }
  3465. }
  3466. return -1;
  3467. }
  3468. /**
  3469. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3470. * by `iteratee` and values set by `setter`.
  3471. *
  3472. * @private
  3473. * @param {Array|Object} collection The collection to iterate over.
  3474. * @param {Function} setter The function to set `accumulator` values.
  3475. * @param {Function} iteratee The iteratee to transform keys.
  3476. * @param {Object} accumulator The initial aggregated object.
  3477. * @returns {Function} Returns `accumulator`.
  3478. */
  3479. function baseAggregator(collection, setter, iteratee, accumulator) {
  3480. baseEach(collection, function(value, key, collection) {
  3481. setter(accumulator, value, iteratee(value), collection);
  3482. });
  3483. return accumulator;
  3484. }
  3485. /**
  3486. * The base implementation of `_.assign` without support for multiple sources
  3487. * or `customizer` functions.
  3488. *
  3489. * @private
  3490. * @param {Object} object The destination object.
  3491. * @param {Object} source The source object.
  3492. * @returns {Object} Returns `object`.
  3493. */
  3494. function baseAssign(object, source) {
  3495. return object && copyObject(source, keys(source), object);
  3496. }
  3497. /**
  3498. * The base implementation of `_.assignIn` without support for multiple sources
  3499. * or `customizer` functions.
  3500. *
  3501. * @private
  3502. * @param {Object} object The destination object.
  3503. * @param {Object} source The source object.
  3504. * @returns {Object} Returns `object`.
  3505. */
  3506. function baseAssignIn(object, source) {
  3507. return object && copyObject(source, keysIn(source), object);
  3508. }
  3509. /**
  3510. * The base implementation of `assignValue` and `assignMergeValue` without
  3511. * value checks.
  3512. *
  3513. * @private
  3514. * @param {Object} object The object to modify.
  3515. * @param {string} key The key of the property to assign.
  3516. * @param {*} value The value to assign.
  3517. */
  3518. function baseAssignValue(object, key, value) {
  3519. if (key == '__proto__' && defineProperty) {
  3520. defineProperty(object, key, {
  3521. 'configurable': true,
  3522. 'enumerable': true,
  3523. 'value': value,
  3524. 'writable': true
  3525. });
  3526. } else {
  3527. object[key] = value;
  3528. }
  3529. }
  3530. /**
  3531. * The base implementation of `_.at` without support for individual paths.
  3532. *
  3533. * @private
  3534. * @param {Object} object The object to iterate over.
  3535. * @param {string[]} paths The property paths to pick.
  3536. * @returns {Array} Returns the picked elements.
  3537. */
  3538. function baseAt(object, paths) {
  3539. var index = -1,
  3540. length = paths.length,
  3541. result = Array(length),
  3542. skip = object == null;
  3543. while (++index < length) {
  3544. result[index] = skip ? undefined : get(object, paths[index]);
  3545. }
  3546. return result;
  3547. }
  3548. /**
  3549. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3550. *
  3551. * @private
  3552. * @param {number} number The number to clamp.
  3553. * @param {number} [lower] The lower bound.
  3554. * @param {number} upper The upper bound.
  3555. * @returns {number} Returns the clamped number.
  3556. */
  3557. function baseClamp(number, lower, upper) {
  3558. if (number === number) {
  3559. if (upper !== undefined) {
  3560. number = number <= upper ? number : upper;
  3561. }
  3562. if (lower !== undefined) {
  3563. number = number >= lower ? number : lower;
  3564. }
  3565. }
  3566. return number;
  3567. }
  3568. /**
  3569. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3570. * traversed objects.
  3571. *
  3572. * @private
  3573. * @param {*} value The value to clone.
  3574. * @param {boolean} bitmask The bitmask flags.
  3575. * 1 - Deep clone
  3576. * 2 - Flatten inherited properties
  3577. * 4 - Clone symbols
  3578. * @param {Function} [customizer] The function to customize cloning.
  3579. * @param {string} [key] The key of `value`.
  3580. * @param {Object} [object] The parent object of `value`.
  3581. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3582. * @returns {*} Returns the cloned value.
  3583. */
  3584. function baseClone(value, bitmask, customizer, key, object, stack) {
  3585. var result,
  3586. isDeep = bitmask & CLONE_DEEP_FLAG,
  3587. isFlat = bitmask & CLONE_FLAT_FLAG,
  3588. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3589. if (customizer) {
  3590. result = object ? customizer(value, key, object, stack) : customizer(value);
  3591. }
  3592. if (result !== undefined) {
  3593. return result;
  3594. }
  3595. if (!isObject(value)) {
  3596. return value;
  3597. }
  3598. var isArr = isArray(value);
  3599. if (isArr) {
  3600. result = initCloneArray(value);
  3601. if (!isDeep) {
  3602. return copyArray(value, result);
  3603. }
  3604. } else {
  3605. var tag = getTag(value),
  3606. isFunc = tag == funcTag || tag == genTag;
  3607. if (isBuffer(value)) {
  3608. return cloneBuffer(value, isDeep);
  3609. }
  3610. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3611. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3612. if (!isDeep) {
  3613. return isFlat
  3614. ? copySymbolsIn(value, baseAssignIn(result, value))
  3615. : copySymbols(value, baseAssign(result, value));
  3616. }
  3617. } else {
  3618. if (!cloneableTags[tag]) {
  3619. return object ? value : {};
  3620. }
  3621. result = initCloneByTag(value, tag, isDeep);
  3622. }
  3623. }
  3624. // Check for circular references and return its corresponding clone.
  3625. stack || (stack = new Stack);
  3626. var stacked = stack.get(value);
  3627. if (stacked) {
  3628. return stacked;
  3629. }
  3630. stack.set(value, result);
  3631. if (isSet(value)) {
  3632. value.forEach(function(subValue) {
  3633. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3634. });
  3635. } else if (isMap(value)) {
  3636. value.forEach(function(subValue, key) {
  3637. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3638. });
  3639. }
  3640. var keysFunc = isFull
  3641. ? (isFlat ? getAllKeysIn : getAllKeys)
  3642. : (isFlat ? keysIn : keys);
  3643. var props = isArr ? undefined : keysFunc(value);
  3644. arrayEach(props || value, function(subValue, key) {
  3645. if (props) {
  3646. key = subValue;
  3647. subValue = value[key];
  3648. }
  3649. // Recursively populate clone (susceptible to call stack limits).
  3650. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3651. });
  3652. return result;
  3653. }
  3654. /**
  3655. * The base implementation of `_.conforms` which doesn't clone `source`.
  3656. *
  3657. * @private
  3658. * @param {Object} source The object of property predicates to conform to.
  3659. * @returns {Function} Returns the new spec function.
  3660. */
  3661. function baseConforms(source) {
  3662. var props = keys(source);
  3663. return function(object) {
  3664. return baseConformsTo(object, source, props);
  3665. };
  3666. }
  3667. /**
  3668. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3669. *
  3670. * @private
  3671. * @param {Object} object The object to inspect.
  3672. * @param {Object} source The object of property predicates to conform to.
  3673. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3674. */
  3675. function baseConformsTo(object, source, props) {
  3676. var length = props.length;
  3677. if (object == null) {
  3678. return !length;
  3679. }
  3680. object = Object(object);
  3681. while (length--) {
  3682. var key = props[length],
  3683. predicate = source[key],
  3684. value = object[key];
  3685. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3686. return false;
  3687. }
  3688. }
  3689. return true;
  3690. }
  3691. /**
  3692. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3693. * to provide to `func`.
  3694. *
  3695. * @private
  3696. * @param {Function} func The function to delay.
  3697. * @param {number} wait The number of milliseconds to delay invocation.
  3698. * @param {Array} args The arguments to provide to `func`.
  3699. * @returns {number|Object} Returns the timer id or timeout object.
  3700. */
  3701. function baseDelay(func, wait, args) {
  3702. if (typeof func != 'function') {
  3703. throw new TypeError(FUNC_ERROR_TEXT);
  3704. }
  3705. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3706. }
  3707. /**
  3708. * The base implementation of methods like `_.difference` without support
  3709. * for excluding multiple arrays or iteratee shorthands.
  3710. *
  3711. * @private
  3712. * @param {Array} array The array to inspect.
  3713. * @param {Array} values The values to exclude.
  3714. * @param {Function} [iteratee] The iteratee invoked per element.
  3715. * @param {Function} [comparator] The comparator invoked per element.
  3716. * @returns {Array} Returns the new array of filtered values.
  3717. */
  3718. function baseDifference(array, values, iteratee, comparator) {
  3719. var index = -1,
  3720. includes = arrayIncludes,
  3721. isCommon = true,
  3722. length = array.length,
  3723. result = [],
  3724. valuesLength = values.length;
  3725. if (!length) {
  3726. return result;
  3727. }
  3728. if (iteratee) {
  3729. values = arrayMap(values, baseUnary(iteratee));
  3730. }
  3731. if (comparator) {
  3732. includes = arrayIncludesWith;
  3733. isCommon = false;
  3734. }
  3735. else if (values.length >= LARGE_ARRAY_SIZE) {
  3736. includes = cacheHas;
  3737. isCommon = false;
  3738. values = new SetCache(values);
  3739. }
  3740. outer:
  3741. while (++index < length) {
  3742. var value = array[index],
  3743. computed = iteratee == null ? value : iteratee(value);
  3744. value = (comparator || value !== 0) ? value : 0;
  3745. if (isCommon && computed === computed) {
  3746. var valuesIndex = valuesLength;
  3747. while (valuesIndex--) {
  3748. if (values[valuesIndex] === computed) {
  3749. continue outer;
  3750. }
  3751. }
  3752. result.push(value);
  3753. }
  3754. else if (!includes(values, computed, comparator)) {
  3755. result.push(value);
  3756. }
  3757. }
  3758. return result;
  3759. }
  3760. /**
  3761. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3762. *
  3763. * @private
  3764. * @param {Array|Object} collection The collection to iterate over.
  3765. * @param {Function} iteratee The function invoked per iteration.
  3766. * @returns {Array|Object} Returns `collection`.
  3767. */
  3768. var baseEach = createBaseEach(baseForOwn);
  3769. /**
  3770. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3771. *
  3772. * @private
  3773. * @param {Array|Object} collection The collection to iterate over.
  3774. * @param {Function} iteratee The function invoked per iteration.
  3775. * @returns {Array|Object} Returns `collection`.
  3776. */
  3777. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3778. /**
  3779. * The base implementation of `_.every` without support for iteratee shorthands.
  3780. *
  3781. * @private
  3782. * @param {Array|Object} collection The collection to iterate over.
  3783. * @param {Function} predicate The function invoked per iteration.
  3784. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3785. * else `false`
  3786. */
  3787. function baseEvery(collection, predicate) {
  3788. var result = true;
  3789. baseEach(collection, function(value, index, collection) {
  3790. result = !!predicate(value, index, collection);
  3791. return result;
  3792. });
  3793. return result;
  3794. }
  3795. /**
  3796. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3797. * `comparator` to determine the extremum value.
  3798. *
  3799. * @private
  3800. * @param {Array} array The array to iterate over.
  3801. * @param {Function} iteratee The iteratee invoked per iteration.
  3802. * @param {Function} comparator The comparator used to compare values.
  3803. * @returns {*} Returns the extremum value.
  3804. */
  3805. function baseExtremum(array, iteratee, comparator) {
  3806. var index = -1,
  3807. length = array.length;
  3808. while (++index < length) {
  3809. var value = array[index],
  3810. current = iteratee(value);
  3811. if (current != null && (computed === undefined
  3812. ? (current === current && !isSymbol(current))
  3813. : comparator(current, computed)
  3814. )) {
  3815. var computed = current,
  3816. result = value;
  3817. }
  3818. }
  3819. return result;
  3820. }
  3821. /**
  3822. * The base implementation of `_.fill` without an iteratee call guard.
  3823. *
  3824. * @private
  3825. * @param {Array} array The array to fill.
  3826. * @param {*} value The value to fill `array` with.
  3827. * @param {number} [start=0] The start position.
  3828. * @param {number} [end=array.length] The end position.
  3829. * @returns {Array} Returns `array`.
  3830. */
  3831. function baseFill(array, value, start, end) {
  3832. var length = array.length;
  3833. start = toInteger(start);
  3834. if (start < 0) {
  3835. start = -start > length ? 0 : (length + start);
  3836. }
  3837. end = (end === undefined || end > length) ? length : toInteger(end);
  3838. if (end < 0) {
  3839. end += length;
  3840. }
  3841. end = start > end ? 0 : toLength(end);
  3842. while (start < end) {
  3843. array[start++] = value;
  3844. }
  3845. return array;
  3846. }
  3847. /**
  3848. * The base implementation of `_.filter` without support for iteratee shorthands.
  3849. *
  3850. * @private
  3851. * @param {Array|Object} collection The collection to iterate over.
  3852. * @param {Function} predicate The function invoked per iteration.
  3853. * @returns {Array} Returns the new filtered array.
  3854. */
  3855. function baseFilter(collection, predicate) {
  3856. var result = [];
  3857. baseEach(collection, function(value, index, collection) {
  3858. if (predicate(value, index, collection)) {
  3859. result.push(value);
  3860. }
  3861. });
  3862. return result;
  3863. }
  3864. /**
  3865. * The base implementation of `_.flatten` with support for restricting flattening.
  3866. *
  3867. * @private
  3868. * @param {Array} array The array to flatten.
  3869. * @param {number} depth The maximum recursion depth.
  3870. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3871. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3872. * @param {Array} [result=[]] The initial result value.
  3873. * @returns {Array} Returns the new flattened array.
  3874. */
  3875. function baseFlatten(array, depth, predicate, isStrict, result) {
  3876. var index = -1,
  3877. length = array.length;
  3878. predicate || (predicate = isFlattenable);
  3879. result || (result = []);
  3880. while (++index < length) {
  3881. var value = array[index];
  3882. if (depth > 0 && predicate(value)) {
  3883. if (depth > 1) {
  3884. // Recursively flatten arrays (susceptible to call stack limits).
  3885. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3886. } else {
  3887. arrayPush(result, value);
  3888. }
  3889. } else if (!isStrict) {
  3890. result[result.length] = value;
  3891. }
  3892. }
  3893. return result;
  3894. }
  3895. /**
  3896. * The base implementation of `baseForOwn` which iterates over `object`
  3897. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3898. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3899. *
  3900. * @private
  3901. * @param {Object} object The object to iterate over.
  3902. * @param {Function} iteratee The function invoked per iteration.
  3903. * @param {Function} keysFunc The function to get the keys of `object`.
  3904. * @returns {Object} Returns `object`.
  3905. */
  3906. var baseFor = createBaseFor();
  3907. /**
  3908. * This function is like `baseFor` except that it iterates over properties
  3909. * in the opposite order.
  3910. *
  3911. * @private
  3912. * @param {Object} object The object to iterate over.
  3913. * @param {Function} iteratee The function invoked per iteration.
  3914. * @param {Function} keysFunc The function to get the keys of `object`.
  3915. * @returns {Object} Returns `object`.
  3916. */
  3917. var baseForRight = createBaseFor(true);
  3918. /**
  3919. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3920. *
  3921. * @private
  3922. * @param {Object} object The object to iterate over.
  3923. * @param {Function} iteratee The function invoked per iteration.
  3924. * @returns {Object} Returns `object`.
  3925. */
  3926. function baseForOwn(object, iteratee) {
  3927. return object && baseFor(object, iteratee, keys);
  3928. }
  3929. /**
  3930. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3931. *
  3932. * @private
  3933. * @param {Object} object The object to iterate over.
  3934. * @param {Function} iteratee The function invoked per iteration.
  3935. * @returns {Object} Returns `object`.
  3936. */
  3937. function baseForOwnRight(object, iteratee) {
  3938. return object && baseForRight(object, iteratee, keys);
  3939. }
  3940. /**
  3941. * The base implementation of `_.functions` which creates an array of
  3942. * `object` function property names filtered from `props`.
  3943. *
  3944. * @private
  3945. * @param {Object} object The object to inspect.
  3946. * @param {Array} props The property names to filter.
  3947. * @returns {Array} Returns the function names.
  3948. */
  3949. function baseFunctions(object, props) {
  3950. return arrayFilter(props, function(key) {
  3951. return isFunction(object[key]);
  3952. });
  3953. }
  3954. /**
  3955. * The base implementation of `_.get` without support for default values.
  3956. *
  3957. * @private
  3958. * @param {Object} object The object to query.
  3959. * @param {Array|string} path The path of the property to get.
  3960. * @returns {*} Returns the resolved value.
  3961. */
  3962. function baseGet(object, path) {
  3963. path = castPath(path, object);
  3964. var index = 0,
  3965. length = path.length;
  3966. while (object != null && index < length) {
  3967. object = object[toKey(path[index++])];
  3968. }
  3969. return (index && index == length) ? object : undefined;
  3970. }
  3971. /**
  3972. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3973. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3974. * symbols of `object`.
  3975. *
  3976. * @private
  3977. * @param {Object} object The object to query.
  3978. * @param {Function} keysFunc The function to get the keys of `object`.
  3979. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3980. * @returns {Array} Returns the array of property names and symbols.
  3981. */
  3982. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3983. var result = keysFunc(object);
  3984. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3985. }
  3986. /**
  3987. * The base implementation of `getTag` without fallbacks for buggy environments.
  3988. *
  3989. * @private
  3990. * @param {*} value The value to query.
  3991. * @returns {string} Returns the `toStringTag`.
  3992. */
  3993. function baseGetTag(value) {
  3994. if (value == null) {
  3995. return value === undefined ? undefinedTag : nullTag;
  3996. }
  3997. return (symToStringTag && symToStringTag in Object(value))
  3998. ? getRawTag(value)
  3999. : objectToString(value);
  4000. }
  4001. /**
  4002. * The base implementation of `_.gt` which doesn't coerce arguments.
  4003. *
  4004. * @private
  4005. * @param {*} value The value to compare.
  4006. * @param {*} other The other value to compare.
  4007. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4008. * else `false`.
  4009. */
  4010. function baseGt(value, other) {
  4011. return value > other;
  4012. }
  4013. /**
  4014. * The base implementation of `_.has` without support for deep paths.
  4015. *
  4016. * @private
  4017. * @param {Object} [object] The object to query.
  4018. * @param {Array|string} key The key to check.
  4019. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4020. */
  4021. function baseHas(object, key) {
  4022. return object != null && hasOwnProperty.call(object, key);
  4023. }
  4024. /**
  4025. * The base implementation of `_.hasIn` without support for deep paths.
  4026. *
  4027. * @private
  4028. * @param {Object} [object] The object to query.
  4029. * @param {Array|string} key The key to check.
  4030. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4031. */
  4032. function baseHasIn(object, key) {
  4033. return object != null && key in Object(object);
  4034. }
  4035. /**
  4036. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4037. *
  4038. * @private
  4039. * @param {number} number The number to check.
  4040. * @param {number} start The start of the range.
  4041. * @param {number} end The end of the range.
  4042. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4043. */
  4044. function baseInRange(number, start, end) {
  4045. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4046. }
  4047. /**
  4048. * The base implementation of methods like `_.intersection`, without support
  4049. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4050. *
  4051. * @private
  4052. * @param {Array} arrays The arrays to inspect.
  4053. * @param {Function} [iteratee] The iteratee invoked per element.
  4054. * @param {Function} [comparator] The comparator invoked per element.
  4055. * @returns {Array} Returns the new array of shared values.
  4056. */
  4057. function baseIntersection(arrays, iteratee, comparator) {
  4058. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4059. length = arrays[0].length,
  4060. othLength = arrays.length,
  4061. othIndex = othLength,
  4062. caches = Array(othLength),
  4063. maxLength = Infinity,
  4064. result = [];
  4065. while (othIndex--) {
  4066. var array = arrays[othIndex];
  4067. if (othIndex && iteratee) {
  4068. array = arrayMap(array, baseUnary(iteratee));
  4069. }
  4070. maxLength = nativeMin(array.length, maxLength);
  4071. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4072. ? new SetCache(othIndex && array)
  4073. : undefined;
  4074. }
  4075. array = arrays[0];
  4076. var index = -1,
  4077. seen = caches[0];
  4078. outer:
  4079. while (++index < length && result.length < maxLength) {
  4080. var value = array[index],
  4081. computed = iteratee ? iteratee(value) : value;
  4082. value = (comparator || value !== 0) ? value : 0;
  4083. if (!(seen
  4084. ? cacheHas(seen, computed)
  4085. : includes(result, computed, comparator)
  4086. )) {
  4087. othIndex = othLength;
  4088. while (--othIndex) {
  4089. var cache = caches[othIndex];
  4090. if (!(cache
  4091. ? cacheHas(cache, computed)
  4092. : includes(arrays[othIndex], computed, comparator))
  4093. ) {
  4094. continue outer;
  4095. }
  4096. }
  4097. if (seen) {
  4098. seen.push(computed);
  4099. }
  4100. result.push(value);
  4101. }
  4102. }
  4103. return result;
  4104. }
  4105. /**
  4106. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4107. * `object` with values transformed by `iteratee` and set by `setter`.
  4108. *
  4109. * @private
  4110. * @param {Object} object The object to iterate over.
  4111. * @param {Function} setter The function to set `accumulator` values.
  4112. * @param {Function} iteratee The iteratee to transform values.
  4113. * @param {Object} accumulator The initial inverted object.
  4114. * @returns {Function} Returns `accumulator`.
  4115. */
  4116. function baseInverter(object, setter, iteratee, accumulator) {
  4117. baseForOwn(object, function(value, key, object) {
  4118. setter(accumulator, iteratee(value), key, object);
  4119. });
  4120. return accumulator;
  4121. }
  4122. /**
  4123. * The base implementation of `_.invoke` without support for individual
  4124. * method arguments.
  4125. *
  4126. * @private
  4127. * @param {Object} object The object to query.
  4128. * @param {Array|string} path The path of the method to invoke.
  4129. * @param {Array} args The arguments to invoke the method with.
  4130. * @returns {*} Returns the result of the invoked method.
  4131. */
  4132. function baseInvoke(object, path, args) {
  4133. path = castPath(path, object);
  4134. object = parent(object, path);
  4135. var func = object == null ? object : object[toKey(last(path))];
  4136. return func == null ? undefined : apply(func, object, args);
  4137. }
  4138. /**
  4139. * The base implementation of `_.isArguments`.
  4140. *
  4141. * @private
  4142. * @param {*} value The value to check.
  4143. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4144. */
  4145. function baseIsArguments(value) {
  4146. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4147. }
  4148. /**
  4149. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4150. *
  4151. * @private
  4152. * @param {*} value The value to check.
  4153. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4154. */
  4155. function baseIsArrayBuffer(value) {
  4156. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4157. }
  4158. /**
  4159. * The base implementation of `_.isDate` without Node.js optimizations.
  4160. *
  4161. * @private
  4162. * @param {*} value The value to check.
  4163. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4164. */
  4165. function baseIsDate(value) {
  4166. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4167. }
  4168. /**
  4169. * The base implementation of `_.isEqual` which supports partial comparisons
  4170. * and tracks traversed objects.
  4171. *
  4172. * @private
  4173. * @param {*} value The value to compare.
  4174. * @param {*} other The other value to compare.
  4175. * @param {boolean} bitmask The bitmask flags.
  4176. * 1 - Unordered comparison
  4177. * 2 - Partial comparison
  4178. * @param {Function} [customizer] The function to customize comparisons.
  4179. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4180. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4181. */
  4182. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4183. if (value === other) {
  4184. return true;
  4185. }
  4186. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4187. return value !== value && other !== other;
  4188. }
  4189. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4190. }
  4191. /**
  4192. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4193. * deep comparisons and tracks traversed objects enabling objects with circular
  4194. * references to be compared.
  4195. *
  4196. * @private
  4197. * @param {Object} object The object to compare.
  4198. * @param {Object} other The other object to compare.
  4199. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4200. * @param {Function} customizer The function to customize comparisons.
  4201. * @param {Function} equalFunc The function to determine equivalents of values.
  4202. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4203. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4204. */
  4205. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4206. var objIsArr = isArray(object),
  4207. othIsArr = isArray(other),
  4208. objTag = objIsArr ? arrayTag : getTag(object),
  4209. othTag = othIsArr ? arrayTag : getTag(other);
  4210. objTag = objTag == argsTag ? objectTag : objTag;
  4211. othTag = othTag == argsTag ? objectTag : othTag;
  4212. var objIsObj = objTag == objectTag,
  4213. othIsObj = othTag == objectTag,
  4214. isSameTag = objTag == othTag;
  4215. if (isSameTag && isBuffer(object)) {
  4216. if (!isBuffer(other)) {
  4217. return false;
  4218. }
  4219. objIsArr = true;
  4220. objIsObj = false;
  4221. }
  4222. if (isSameTag && !objIsObj) {
  4223. stack || (stack = new Stack);
  4224. return (objIsArr || isTypedArray(object))
  4225. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4226. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4227. }
  4228. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4229. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4230. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4231. if (objIsWrapped || othIsWrapped) {
  4232. var objUnwrapped = objIsWrapped ? object.value() : object,
  4233. othUnwrapped = othIsWrapped ? other.value() : other;
  4234. stack || (stack = new Stack);
  4235. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4236. }
  4237. }
  4238. if (!isSameTag) {
  4239. return false;
  4240. }
  4241. stack || (stack = new Stack);
  4242. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4243. }
  4244. /**
  4245. * The base implementation of `_.isMap` without Node.js optimizations.
  4246. *
  4247. * @private
  4248. * @param {*} value The value to check.
  4249. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4250. */
  4251. function baseIsMap(value) {
  4252. return isObjectLike(value) && getTag(value) == mapTag;
  4253. }
  4254. /**
  4255. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4256. *
  4257. * @private
  4258. * @param {Object} object The object to inspect.
  4259. * @param {Object} source The object of property values to match.
  4260. * @param {Array} matchData The property names, values, and compare flags to match.
  4261. * @param {Function} [customizer] The function to customize comparisons.
  4262. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4263. */
  4264. function baseIsMatch(object, source, matchData, customizer) {
  4265. var index = matchData.length,
  4266. length = index,
  4267. noCustomizer = !customizer;
  4268. if (object == null) {
  4269. return !length;
  4270. }
  4271. object = Object(object);
  4272. while (index--) {
  4273. var data = matchData[index];
  4274. if ((noCustomizer && data[2])
  4275. ? data[1] !== object[data[0]]
  4276. : !(data[0] in object)
  4277. ) {
  4278. return false;
  4279. }
  4280. }
  4281. while (++index < length) {
  4282. data = matchData[index];
  4283. var key = data[0],
  4284. objValue = object[key],
  4285. srcValue = data[1];
  4286. if (noCustomizer && data[2]) {
  4287. if (objValue === undefined && !(key in object)) {
  4288. return false;
  4289. }
  4290. } else {
  4291. var stack = new Stack;
  4292. if (customizer) {
  4293. var result = customizer(objValue, srcValue, key, object, source, stack);
  4294. }
  4295. if (!(result === undefined
  4296. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4297. : result
  4298. )) {
  4299. return false;
  4300. }
  4301. }
  4302. }
  4303. return true;
  4304. }
  4305. /**
  4306. * The base implementation of `_.isNative` without bad shim checks.
  4307. *
  4308. * @private
  4309. * @param {*} value The value to check.
  4310. * @returns {boolean} Returns `true` if `value` is a native function,
  4311. * else `false`.
  4312. */
  4313. function baseIsNative(value) {
  4314. if (!isObject(value) || isMasked(value)) {
  4315. return false;
  4316. }
  4317. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4318. return pattern.test(toSource(value));
  4319. }
  4320. /**
  4321. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4322. *
  4323. * @private
  4324. * @param {*} value The value to check.
  4325. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4326. */
  4327. function baseIsRegExp(value) {
  4328. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4329. }
  4330. /**
  4331. * The base implementation of `_.isSet` without Node.js optimizations.
  4332. *
  4333. * @private
  4334. * @param {*} value The value to check.
  4335. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4336. */
  4337. function baseIsSet(value) {
  4338. return isObjectLike(value) && getTag(value) == setTag;
  4339. }
  4340. /**
  4341. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4342. *
  4343. * @private
  4344. * @param {*} value The value to check.
  4345. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4346. */
  4347. function baseIsTypedArray(value) {
  4348. return isObjectLike(value) &&
  4349. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4350. }
  4351. /**
  4352. * The base implementation of `_.iteratee`.
  4353. *
  4354. * @private
  4355. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4356. * @returns {Function} Returns the iteratee.
  4357. */
  4358. function baseIteratee(value) {
  4359. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4360. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4361. if (typeof value == 'function') {
  4362. return value;
  4363. }
  4364. if (value == null) {
  4365. return identity;
  4366. }
  4367. if (typeof value == 'object') {
  4368. return isArray(value)
  4369. ? baseMatchesProperty(value[0], value[1])
  4370. : baseMatches(value);
  4371. }
  4372. return property(value);
  4373. }
  4374. /**
  4375. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4376. *
  4377. * @private
  4378. * @param {Object} object The object to query.
  4379. * @returns {Array} Returns the array of property names.
  4380. */
  4381. function baseKeys(object) {
  4382. if (!isPrototype(object)) {
  4383. return nativeKeys(object);
  4384. }
  4385. var result = [];
  4386. for (var key in Object(object)) {
  4387. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4388. result.push(key);
  4389. }
  4390. }
  4391. return result;
  4392. }
  4393. /**
  4394. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4395. *
  4396. * @private
  4397. * @param {Object} object The object to query.
  4398. * @returns {Array} Returns the array of property names.
  4399. */
  4400. function baseKeysIn(object) {
  4401. if (!isObject(object)) {
  4402. return nativeKeysIn(object);
  4403. }
  4404. var isProto = isPrototype(object),
  4405. result = [];
  4406. for (var key in object) {
  4407. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4408. result.push(key);
  4409. }
  4410. }
  4411. return result;
  4412. }
  4413. /**
  4414. * The base implementation of `_.lt` which doesn't coerce arguments.
  4415. *
  4416. * @private
  4417. * @param {*} value The value to compare.
  4418. * @param {*} other The other value to compare.
  4419. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4420. * else `false`.
  4421. */
  4422. function baseLt(value, other) {
  4423. return value < other;
  4424. }
  4425. /**
  4426. * The base implementation of `_.map` without support for iteratee shorthands.
  4427. *
  4428. * @private
  4429. * @param {Array|Object} collection The collection to iterate over.
  4430. * @param {Function} iteratee The function invoked per iteration.
  4431. * @returns {Array} Returns the new mapped array.
  4432. */
  4433. function baseMap(collection, iteratee) {
  4434. var index = -1,
  4435. result = isArrayLike(collection) ? Array(collection.length) : [];
  4436. baseEach(collection, function(value, key, collection) {
  4437. result[++index] = iteratee(value, key, collection);
  4438. });
  4439. return result;
  4440. }
  4441. /**
  4442. * The base implementation of `_.matches` which doesn't clone `source`.
  4443. *
  4444. * @private
  4445. * @param {Object} source The object of property values to match.
  4446. * @returns {Function} Returns the new spec function.
  4447. */
  4448. function baseMatches(source) {
  4449. var matchData = getMatchData(source);
  4450. if (matchData.length == 1 && matchData[0][2]) {
  4451. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4452. }
  4453. return function(object) {
  4454. return object === source || baseIsMatch(object, source, matchData);
  4455. };
  4456. }
  4457. /**
  4458. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4459. *
  4460. * @private
  4461. * @param {string} path The path of the property to get.
  4462. * @param {*} srcValue The value to match.
  4463. * @returns {Function} Returns the new spec function.
  4464. */
  4465. function baseMatchesProperty(path, srcValue) {
  4466. if (isKey(path) && isStrictComparable(srcValue)) {
  4467. return matchesStrictComparable(toKey(path), srcValue);
  4468. }
  4469. return function(object) {
  4470. var objValue = get(object, path);
  4471. return (objValue === undefined && objValue === srcValue)
  4472. ? hasIn(object, path)
  4473. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4474. };
  4475. }
  4476. /**
  4477. * The base implementation of `_.merge` without support for multiple sources.
  4478. *
  4479. * @private
  4480. * @param {Object} object The destination object.
  4481. * @param {Object} source The source object.
  4482. * @param {number} srcIndex The index of `source`.
  4483. * @param {Function} [customizer] The function to customize merged values.
  4484. * @param {Object} [stack] Tracks traversed source values and their merged
  4485. * counterparts.
  4486. */
  4487. function baseMerge(object, source, srcIndex, customizer, stack) {
  4488. if (object === source) {
  4489. return;
  4490. }
  4491. baseFor(source, function(srcValue, key) {
  4492. stack || (stack = new Stack);
  4493. if (isObject(srcValue)) {
  4494. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4495. }
  4496. else {
  4497. var newValue = customizer
  4498. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4499. : undefined;
  4500. if (newValue === undefined) {
  4501. newValue = srcValue;
  4502. }
  4503. assignMergeValue(object, key, newValue);
  4504. }
  4505. }, keysIn);
  4506. }
  4507. /**
  4508. * A specialized version of `baseMerge` for arrays and objects which performs
  4509. * deep merges and tracks traversed objects enabling objects with circular
  4510. * references to be merged.
  4511. *
  4512. * @private
  4513. * @param {Object} object The destination object.
  4514. * @param {Object} source The source object.
  4515. * @param {string} key The key of the value to merge.
  4516. * @param {number} srcIndex The index of `source`.
  4517. * @param {Function} mergeFunc The function to merge values.
  4518. * @param {Function} [customizer] The function to customize assigned values.
  4519. * @param {Object} [stack] Tracks traversed source values and their merged
  4520. * counterparts.
  4521. */
  4522. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4523. var objValue = safeGet(object, key),
  4524. srcValue = safeGet(source, key),
  4525. stacked = stack.get(srcValue);
  4526. if (stacked) {
  4527. assignMergeValue(object, key, stacked);
  4528. return;
  4529. }
  4530. var newValue = customizer
  4531. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4532. : undefined;
  4533. var isCommon = newValue === undefined;
  4534. if (isCommon) {
  4535. var isArr = isArray(srcValue),
  4536. isBuff = !isArr && isBuffer(srcValue),
  4537. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4538. newValue = srcValue;
  4539. if (isArr || isBuff || isTyped) {
  4540. if (isArray(objValue)) {
  4541. newValue = objValue;
  4542. }
  4543. else if (isArrayLikeObject(objValue)) {
  4544. newValue = copyArray(objValue);
  4545. }
  4546. else if (isBuff) {
  4547. isCommon = false;
  4548. newValue = cloneBuffer(srcValue, true);
  4549. }
  4550. else if (isTyped) {
  4551. isCommon = false;
  4552. newValue = cloneTypedArray(srcValue, true);
  4553. }
  4554. else {
  4555. newValue = [];
  4556. }
  4557. }
  4558. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4559. newValue = objValue;
  4560. if (isArguments(objValue)) {
  4561. newValue = toPlainObject(objValue);
  4562. }
  4563. else if (!isObject(objValue) || isFunction(objValue)) {
  4564. newValue = initCloneObject(srcValue);
  4565. }
  4566. }
  4567. else {
  4568. isCommon = false;
  4569. }
  4570. }
  4571. if (isCommon) {
  4572. // Recursively merge objects and arrays (susceptible to call stack limits).
  4573. stack.set(srcValue, newValue);
  4574. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4575. stack['delete'](srcValue);
  4576. }
  4577. assignMergeValue(object, key, newValue);
  4578. }
  4579. /**
  4580. * The base implementation of `_.nth` which doesn't coerce arguments.
  4581. *
  4582. * @private
  4583. * @param {Array} array The array to query.
  4584. * @param {number} n The index of the element to return.
  4585. * @returns {*} Returns the nth element of `array`.
  4586. */
  4587. function baseNth(array, n) {
  4588. var length = array.length;
  4589. if (!length) {
  4590. return;
  4591. }
  4592. n += n < 0 ? length : 0;
  4593. return isIndex(n, length) ? array[n] : undefined;
  4594. }
  4595. /**
  4596. * The base implementation of `_.orderBy` without param guards.
  4597. *
  4598. * @private
  4599. * @param {Array|Object} collection The collection to iterate over.
  4600. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4601. * @param {string[]} orders The sort orders of `iteratees`.
  4602. * @returns {Array} Returns the new sorted array.
  4603. */
  4604. function baseOrderBy(collection, iteratees, orders) {
  4605. if (iteratees.length) {
  4606. iteratees = arrayMap(iteratees, function(iteratee) {
  4607. if (isArray(iteratee)) {
  4608. return function(value) {
  4609. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4610. }
  4611. }
  4612. return iteratee;
  4613. });
  4614. } else {
  4615. iteratees = [identity];
  4616. }
  4617. var index = -1;
  4618. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4619. var result = baseMap(collection, function(value, key, collection) {
  4620. var criteria = arrayMap(iteratees, function(iteratee) {
  4621. return iteratee(value);
  4622. });
  4623. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4624. });
  4625. return baseSortBy(result, function(object, other) {
  4626. return compareMultiple(object, other, orders);
  4627. });
  4628. }
  4629. /**
  4630. * The base implementation of `_.pick` without support for individual
  4631. * property identifiers.
  4632. *
  4633. * @private
  4634. * @param {Object} object The source object.
  4635. * @param {string[]} paths The property paths to pick.
  4636. * @returns {Object} Returns the new object.
  4637. */
  4638. function basePick(object, paths) {
  4639. return basePickBy(object, paths, function(value, path) {
  4640. return hasIn(object, path);
  4641. });
  4642. }
  4643. /**
  4644. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4645. *
  4646. * @private
  4647. * @param {Object} object The source object.
  4648. * @param {string[]} paths The property paths to pick.
  4649. * @param {Function} predicate The function invoked per property.
  4650. * @returns {Object} Returns the new object.
  4651. */
  4652. function basePickBy(object, paths, predicate) {
  4653. var index = -1,
  4654. length = paths.length,
  4655. result = {};
  4656. while (++index < length) {
  4657. var path = paths[index],
  4658. value = baseGet(object, path);
  4659. if (predicate(value, path)) {
  4660. baseSet(result, castPath(path, object), value);
  4661. }
  4662. }
  4663. return result;
  4664. }
  4665. /**
  4666. * A specialized version of `baseProperty` which supports deep paths.
  4667. *
  4668. * @private
  4669. * @param {Array|string} path The path of the property to get.
  4670. * @returns {Function} Returns the new accessor function.
  4671. */
  4672. function basePropertyDeep(path) {
  4673. return function(object) {
  4674. return baseGet(object, path);
  4675. };
  4676. }
  4677. /**
  4678. * The base implementation of `_.pullAllBy` without support for iteratee
  4679. * shorthands.
  4680. *
  4681. * @private
  4682. * @param {Array} array The array to modify.
  4683. * @param {Array} values The values to remove.
  4684. * @param {Function} [iteratee] The iteratee invoked per element.
  4685. * @param {Function} [comparator] The comparator invoked per element.
  4686. * @returns {Array} Returns `array`.
  4687. */
  4688. function basePullAll(array, values, iteratee, comparator) {
  4689. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4690. index = -1,
  4691. length = values.length,
  4692. seen = array;
  4693. if (array === values) {
  4694. values = copyArray(values);
  4695. }
  4696. if (iteratee) {
  4697. seen = arrayMap(array, baseUnary(iteratee));
  4698. }
  4699. while (++index < length) {
  4700. var fromIndex = 0,
  4701. value = values[index],
  4702. computed = iteratee ? iteratee(value) : value;
  4703. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4704. if (seen !== array) {
  4705. splice.call(seen, fromIndex, 1);
  4706. }
  4707. splice.call(array, fromIndex, 1);
  4708. }
  4709. }
  4710. return array;
  4711. }
  4712. /**
  4713. * The base implementation of `_.pullAt` without support for individual
  4714. * indexes or capturing the removed elements.
  4715. *
  4716. * @private
  4717. * @param {Array} array The array to modify.
  4718. * @param {number[]} indexes The indexes of elements to remove.
  4719. * @returns {Array} Returns `array`.
  4720. */
  4721. function basePullAt(array, indexes) {
  4722. var length = array ? indexes.length : 0,
  4723. lastIndex = length - 1;
  4724. while (length--) {
  4725. var index = indexes[length];
  4726. if (length == lastIndex || index !== previous) {
  4727. var previous = index;
  4728. if (isIndex(index)) {
  4729. splice.call(array, index, 1);
  4730. } else {
  4731. baseUnset(array, index);
  4732. }
  4733. }
  4734. }
  4735. return array;
  4736. }
  4737. /**
  4738. * The base implementation of `_.random` without support for returning
  4739. * floating-point numbers.
  4740. *
  4741. * @private
  4742. * @param {number} lower The lower bound.
  4743. * @param {number} upper The upper bound.
  4744. * @returns {number} Returns the random number.
  4745. */
  4746. function baseRandom(lower, upper) {
  4747. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4748. }
  4749. /**
  4750. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4751. * coerce arguments.
  4752. *
  4753. * @private
  4754. * @param {number} start The start of the range.
  4755. * @param {number} end The end of the range.
  4756. * @param {number} step The value to increment or decrement by.
  4757. * @param {boolean} [fromRight] Specify iterating from right to left.
  4758. * @returns {Array} Returns the range of numbers.
  4759. */
  4760. function baseRange(start, end, step, fromRight) {
  4761. var index = -1,
  4762. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4763. result = Array(length);
  4764. while (length--) {
  4765. result[fromRight ? length : ++index] = start;
  4766. start += step;
  4767. }
  4768. return result;
  4769. }
  4770. /**
  4771. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4772. *
  4773. * @private
  4774. * @param {string} string The string to repeat.
  4775. * @param {number} n The number of times to repeat the string.
  4776. * @returns {string} Returns the repeated string.
  4777. */
  4778. function baseRepeat(string, n) {
  4779. var result = '';
  4780. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4781. return result;
  4782. }
  4783. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4784. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4785. do {
  4786. if (n % 2) {
  4787. result += string;
  4788. }
  4789. n = nativeFloor(n / 2);
  4790. if (n) {
  4791. string += string;
  4792. }
  4793. } while (n);
  4794. return result;
  4795. }
  4796. /**
  4797. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4798. *
  4799. * @private
  4800. * @param {Function} func The function to apply a rest parameter to.
  4801. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4802. * @returns {Function} Returns the new function.
  4803. */
  4804. function baseRest(func, start) {
  4805. return setToString(overRest(func, start, identity), func + '');
  4806. }
  4807. /**
  4808. * The base implementation of `_.sample`.
  4809. *
  4810. * @private
  4811. * @param {Array|Object} collection The collection to sample.
  4812. * @returns {*} Returns the random element.
  4813. */
  4814. function baseSample(collection) {
  4815. return arraySample(values(collection));
  4816. }
  4817. /**
  4818. * The base implementation of `_.sampleSize` without param guards.
  4819. *
  4820. * @private
  4821. * @param {Array|Object} collection The collection to sample.
  4822. * @param {number} n The number of elements to sample.
  4823. * @returns {Array} Returns the random elements.
  4824. */
  4825. function baseSampleSize(collection, n) {
  4826. var array = values(collection);
  4827. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4828. }
  4829. /**
  4830. * The base implementation of `_.set`.
  4831. *
  4832. * @private
  4833. * @param {Object} object The object to modify.
  4834. * @param {Array|string} path The path of the property to set.
  4835. * @param {*} value The value to set.
  4836. * @param {Function} [customizer] The function to customize path creation.
  4837. * @returns {Object} Returns `object`.
  4838. */
  4839. function baseSet(object, path, value, customizer) {
  4840. if (!isObject(object)) {
  4841. return object;
  4842. }
  4843. path = castPath(path, object);
  4844. var index = -1,
  4845. length = path.length,
  4846. lastIndex = length - 1,
  4847. nested = object;
  4848. while (nested != null && ++index < length) {
  4849. var key = toKey(path[index]),
  4850. newValue = value;
  4851. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4852. return object;
  4853. }
  4854. if (index != lastIndex) {
  4855. var objValue = nested[key];
  4856. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4857. if (newValue === undefined) {
  4858. newValue = isObject(objValue)
  4859. ? objValue
  4860. : (isIndex(path[index + 1]) ? [] : {});
  4861. }
  4862. }
  4863. assignValue(nested, key, newValue);
  4864. nested = nested[key];
  4865. }
  4866. return object;
  4867. }
  4868. /**
  4869. * The base implementation of `setData` without support for hot loop shorting.
  4870. *
  4871. * @private
  4872. * @param {Function} func The function to associate metadata with.
  4873. * @param {*} data The metadata.
  4874. * @returns {Function} Returns `func`.
  4875. */
  4876. var baseSetData = !metaMap ? identity : function(func, data) {
  4877. metaMap.set(func, data);
  4878. return func;
  4879. };
  4880. /**
  4881. * The base implementation of `setToString` without support for hot loop shorting.
  4882. *
  4883. * @private
  4884. * @param {Function} func The function to modify.
  4885. * @param {Function} string The `toString` result.
  4886. * @returns {Function} Returns `func`.
  4887. */
  4888. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4889. return defineProperty(func, 'toString', {
  4890. 'configurable': true,
  4891. 'enumerable': false,
  4892. 'value': constant(string),
  4893. 'writable': true
  4894. });
  4895. };
  4896. /**
  4897. * The base implementation of `_.shuffle`.
  4898. *
  4899. * @private
  4900. * @param {Array|Object} collection The collection to shuffle.
  4901. * @returns {Array} Returns the new shuffled array.
  4902. */
  4903. function baseShuffle(collection) {
  4904. return shuffleSelf(values(collection));
  4905. }
  4906. /**
  4907. * The base implementation of `_.slice` without an iteratee call guard.
  4908. *
  4909. * @private
  4910. * @param {Array} array The array to slice.
  4911. * @param {number} [start=0] The start position.
  4912. * @param {number} [end=array.length] The end position.
  4913. * @returns {Array} Returns the slice of `array`.
  4914. */
  4915. function baseSlice(array, start, end) {
  4916. var index = -1,
  4917. length = array.length;
  4918. if (start < 0) {
  4919. start = -start > length ? 0 : (length + start);
  4920. }
  4921. end = end > length ? length : end;
  4922. if (end < 0) {
  4923. end += length;
  4924. }
  4925. length = start > end ? 0 : ((end - start) >>> 0);
  4926. start >>>= 0;
  4927. var result = Array(length);
  4928. while (++index < length) {
  4929. result[index] = array[index + start];
  4930. }
  4931. return result;
  4932. }
  4933. /**
  4934. * The base implementation of `_.some` without support for iteratee shorthands.
  4935. *
  4936. * @private
  4937. * @param {Array|Object} collection The collection to iterate over.
  4938. * @param {Function} predicate The function invoked per iteration.
  4939. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4940. * else `false`.
  4941. */
  4942. function baseSome(collection, predicate) {
  4943. var result;
  4944. baseEach(collection, function(value, index, collection) {
  4945. result = predicate(value, index, collection);
  4946. return !result;
  4947. });
  4948. return !!result;
  4949. }
  4950. /**
  4951. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4952. * performs a binary search of `array` to determine the index at which `value`
  4953. * should be inserted into `array` in order to maintain its sort order.
  4954. *
  4955. * @private
  4956. * @param {Array} array The sorted array to inspect.
  4957. * @param {*} value The value to evaluate.
  4958. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4959. * @returns {number} Returns the index at which `value` should be inserted
  4960. * into `array`.
  4961. */
  4962. function baseSortedIndex(array, value, retHighest) {
  4963. var low = 0,
  4964. high = array == null ? low : array.length;
  4965. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4966. while (low < high) {
  4967. var mid = (low + high) >>> 1,
  4968. computed = array[mid];
  4969. if (computed !== null && !isSymbol(computed) &&
  4970. (retHighest ? (computed <= value) : (computed < value))) {
  4971. low = mid + 1;
  4972. } else {
  4973. high = mid;
  4974. }
  4975. }
  4976. return high;
  4977. }
  4978. return baseSortedIndexBy(array, value, identity, retHighest);
  4979. }
  4980. /**
  4981. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4982. * which invokes `iteratee` for `value` and each element of `array` to compute
  4983. * their sort ranking. The iteratee is invoked with one argument; (value).
  4984. *
  4985. * @private
  4986. * @param {Array} array The sorted array to inspect.
  4987. * @param {*} value The value to evaluate.
  4988. * @param {Function} iteratee The iteratee invoked per element.
  4989. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4990. * @returns {number} Returns the index at which `value` should be inserted
  4991. * into `array`.
  4992. */
  4993. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4994. var low = 0,
  4995. high = array == null ? 0 : array.length;
  4996. if (high === 0) {
  4997. return 0;
  4998. }
  4999. value = iteratee(value);
  5000. var valIsNaN = value !== value,
  5001. valIsNull = value === null,
  5002. valIsSymbol = isSymbol(value),
  5003. valIsUndefined = value === undefined;
  5004. while (low < high) {
  5005. var mid = nativeFloor((low + high) / 2),
  5006. computed = iteratee(array[mid]),
  5007. othIsDefined = computed !== undefined,
  5008. othIsNull = computed === null,
  5009. othIsReflexive = computed === computed,
  5010. othIsSymbol = isSymbol(computed);
  5011. if (valIsNaN) {
  5012. var setLow = retHighest || othIsReflexive;
  5013. } else if (valIsUndefined) {
  5014. setLow = othIsReflexive && (retHighest || othIsDefined);
  5015. } else if (valIsNull) {
  5016. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5017. } else if (valIsSymbol) {
  5018. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5019. } else if (othIsNull || othIsSymbol) {
  5020. setLow = false;
  5021. } else {
  5022. setLow = retHighest ? (computed <= value) : (computed < value);
  5023. }
  5024. if (setLow) {
  5025. low = mid + 1;
  5026. } else {
  5027. high = mid;
  5028. }
  5029. }
  5030. return nativeMin(high, MAX_ARRAY_INDEX);
  5031. }
  5032. /**
  5033. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5034. * support for iteratee shorthands.
  5035. *
  5036. * @private
  5037. * @param {Array} array The array to inspect.
  5038. * @param {Function} [iteratee] The iteratee invoked per element.
  5039. * @returns {Array} Returns the new duplicate free array.
  5040. */
  5041. function baseSortedUniq(array, iteratee) {
  5042. var index = -1,
  5043. length = array.length,
  5044. resIndex = 0,
  5045. result = [];
  5046. while (++index < length) {
  5047. var value = array[index],
  5048. computed = iteratee ? iteratee(value) : value;
  5049. if (!index || !eq(computed, seen)) {
  5050. var seen = computed;
  5051. result[resIndex++] = value === 0 ? 0 : value;
  5052. }
  5053. }
  5054. return result;
  5055. }
  5056. /**
  5057. * The base implementation of `_.toNumber` which doesn't ensure correct
  5058. * conversions of binary, hexadecimal, or octal string values.
  5059. *
  5060. * @private
  5061. * @param {*} value The value to process.
  5062. * @returns {number} Returns the number.
  5063. */
  5064. function baseToNumber(value) {
  5065. if (typeof value == 'number') {
  5066. return value;
  5067. }
  5068. if (isSymbol(value)) {
  5069. return NAN;
  5070. }
  5071. return +value;
  5072. }
  5073. /**
  5074. * The base implementation of `_.toString` which doesn't convert nullish
  5075. * values to empty strings.
  5076. *
  5077. * @private
  5078. * @param {*} value The value to process.
  5079. * @returns {string} Returns the string.
  5080. */
  5081. function baseToString(value) {
  5082. // Exit early for strings to avoid a performance hit in some environments.
  5083. if (typeof value == 'string') {
  5084. return value;
  5085. }
  5086. if (isArray(value)) {
  5087. // Recursively convert values (susceptible to call stack limits).
  5088. return arrayMap(value, baseToString) + '';
  5089. }
  5090. if (isSymbol(value)) {
  5091. return symbolToString ? symbolToString.call(value) : '';
  5092. }
  5093. var result = (value + '');
  5094. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5095. }
  5096. /**
  5097. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5098. *
  5099. * @private
  5100. * @param {Array} array The array to inspect.
  5101. * @param {Function} [iteratee] The iteratee invoked per element.
  5102. * @param {Function} [comparator] The comparator invoked per element.
  5103. * @returns {Array} Returns the new duplicate free array.
  5104. */
  5105. function baseUniq(array, iteratee, comparator) {
  5106. var index = -1,
  5107. includes = arrayIncludes,
  5108. length = array.length,
  5109. isCommon = true,
  5110. result = [],
  5111. seen = result;
  5112. if (comparator) {
  5113. isCommon = false;
  5114. includes = arrayIncludesWith;
  5115. }
  5116. else if (length >= LARGE_ARRAY_SIZE) {
  5117. var set = iteratee ? null : createSet(array);
  5118. if (set) {
  5119. return setToArray(set);
  5120. }
  5121. isCommon = false;
  5122. includes = cacheHas;
  5123. seen = new SetCache;
  5124. }
  5125. else {
  5126. seen = iteratee ? [] : result;
  5127. }
  5128. outer:
  5129. while (++index < length) {
  5130. var value = array[index],
  5131. computed = iteratee ? iteratee(value) : value;
  5132. value = (comparator || value !== 0) ? value : 0;
  5133. if (isCommon && computed === computed) {
  5134. var seenIndex = seen.length;
  5135. while (seenIndex--) {
  5136. if (seen[seenIndex] === computed) {
  5137. continue outer;
  5138. }
  5139. }
  5140. if (iteratee) {
  5141. seen.push(computed);
  5142. }
  5143. result.push(value);
  5144. }
  5145. else if (!includes(seen, computed, comparator)) {
  5146. if (seen !== result) {
  5147. seen.push(computed);
  5148. }
  5149. result.push(value);
  5150. }
  5151. }
  5152. return result;
  5153. }
  5154. /**
  5155. * The base implementation of `_.unset`.
  5156. *
  5157. * @private
  5158. * @param {Object} object The object to modify.
  5159. * @param {Array|string} path The property path to unset.
  5160. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5161. */
  5162. function baseUnset(object, path) {
  5163. path = castPath(path, object);
  5164. object = parent(object, path);
  5165. return object == null || delete object[toKey(last(path))];
  5166. }
  5167. /**
  5168. * The base implementation of `_.update`.
  5169. *
  5170. * @private
  5171. * @param {Object} object The object to modify.
  5172. * @param {Array|string} path The path of the property to update.
  5173. * @param {Function} updater The function to produce the updated value.
  5174. * @param {Function} [customizer] The function to customize path creation.
  5175. * @returns {Object} Returns `object`.
  5176. */
  5177. function baseUpdate(object, path, updater, customizer) {
  5178. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5179. }
  5180. /**
  5181. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5182. * without support for iteratee shorthands.
  5183. *
  5184. * @private
  5185. * @param {Array} array The array to query.
  5186. * @param {Function} predicate The function invoked per iteration.
  5187. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5188. * @param {boolean} [fromRight] Specify iterating from right to left.
  5189. * @returns {Array} Returns the slice of `array`.
  5190. */
  5191. function baseWhile(array, predicate, isDrop, fromRight) {
  5192. var length = array.length,
  5193. index = fromRight ? length : -1;
  5194. while ((fromRight ? index-- : ++index < length) &&
  5195. predicate(array[index], index, array)) {}
  5196. return isDrop
  5197. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5198. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5199. }
  5200. /**
  5201. * The base implementation of `wrapperValue` which returns the result of
  5202. * performing a sequence of actions on the unwrapped `value`, where each
  5203. * successive action is supplied the return value of the previous.
  5204. *
  5205. * @private
  5206. * @param {*} value The unwrapped value.
  5207. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5208. * @returns {*} Returns the resolved value.
  5209. */
  5210. function baseWrapperValue(value, actions) {
  5211. var result = value;
  5212. if (result instanceof LazyWrapper) {
  5213. result = result.value();
  5214. }
  5215. return arrayReduce(actions, function(result, action) {
  5216. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5217. }, result);
  5218. }
  5219. /**
  5220. * The base implementation of methods like `_.xor`, without support for
  5221. * iteratee shorthands, that accepts an array of arrays to inspect.
  5222. *
  5223. * @private
  5224. * @param {Array} arrays The arrays to inspect.
  5225. * @param {Function} [iteratee] The iteratee invoked per element.
  5226. * @param {Function} [comparator] The comparator invoked per element.
  5227. * @returns {Array} Returns the new array of values.
  5228. */
  5229. function baseXor(arrays, iteratee, comparator) {
  5230. var length = arrays.length;
  5231. if (length < 2) {
  5232. return length ? baseUniq(arrays[0]) : [];
  5233. }
  5234. var index = -1,
  5235. result = Array(length);
  5236. while (++index < length) {
  5237. var array = arrays[index],
  5238. othIndex = -1;
  5239. while (++othIndex < length) {
  5240. if (othIndex != index) {
  5241. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5242. }
  5243. }
  5244. }
  5245. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5246. }
  5247. /**
  5248. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5249. *
  5250. * @private
  5251. * @param {Array} props The property identifiers.
  5252. * @param {Array} values The property values.
  5253. * @param {Function} assignFunc The function to assign values.
  5254. * @returns {Object} Returns the new object.
  5255. */
  5256. function baseZipObject(props, values, assignFunc) {
  5257. var index = -1,
  5258. length = props.length,
  5259. valsLength = values.length,
  5260. result = {};
  5261. while (++index < length) {
  5262. var value = index < valsLength ? values[index] : undefined;
  5263. assignFunc(result, props[index], value);
  5264. }
  5265. return result;
  5266. }
  5267. /**
  5268. * Casts `value` to an empty array if it's not an array like object.
  5269. *
  5270. * @private
  5271. * @param {*} value The value to inspect.
  5272. * @returns {Array|Object} Returns the cast array-like object.
  5273. */
  5274. function castArrayLikeObject(value) {
  5275. return isArrayLikeObject(value) ? value : [];
  5276. }
  5277. /**
  5278. * Casts `value` to `identity` if it's not a function.
  5279. *
  5280. * @private
  5281. * @param {*} value The value to inspect.
  5282. * @returns {Function} Returns cast function.
  5283. */
  5284. function castFunction(value) {
  5285. return typeof value == 'function' ? value : identity;
  5286. }
  5287. /**
  5288. * Casts `value` to a path array if it's not one.
  5289. *
  5290. * @private
  5291. * @param {*} value The value to inspect.
  5292. * @param {Object} [object] The object to query keys on.
  5293. * @returns {Array} Returns the cast property path array.
  5294. */
  5295. function castPath(value, object) {
  5296. if (isArray(value)) {
  5297. return value;
  5298. }
  5299. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5300. }
  5301. /**
  5302. * A `baseRest` alias which can be replaced with `identity` by module
  5303. * replacement plugins.
  5304. *
  5305. * @private
  5306. * @type {Function}
  5307. * @param {Function} func The function to apply a rest parameter to.
  5308. * @returns {Function} Returns the new function.
  5309. */
  5310. var castRest = baseRest;
  5311. /**
  5312. * Casts `array` to a slice if it's needed.
  5313. *
  5314. * @private
  5315. * @param {Array} array The array to inspect.
  5316. * @param {number} start The start position.
  5317. * @param {number} [end=array.length] The end position.
  5318. * @returns {Array} Returns the cast slice.
  5319. */
  5320. function castSlice(array, start, end) {
  5321. var length = array.length;
  5322. end = end === undefined ? length : end;
  5323. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5324. }
  5325. /**
  5326. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5327. *
  5328. * @private
  5329. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5330. */
  5331. var clearTimeout = ctxClearTimeout || function(id) {
  5332. return root.clearTimeout(id);
  5333. };
  5334. /**
  5335. * Creates a clone of `buffer`.
  5336. *
  5337. * @private
  5338. * @param {Buffer} buffer The buffer to clone.
  5339. * @param {boolean} [isDeep] Specify a deep clone.
  5340. * @returns {Buffer} Returns the cloned buffer.
  5341. */
  5342. function cloneBuffer(buffer, isDeep) {
  5343. if (isDeep) {
  5344. return buffer.slice();
  5345. }
  5346. var length = buffer.length,
  5347. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5348. buffer.copy(result);
  5349. return result;
  5350. }
  5351. /**
  5352. * Creates a clone of `arrayBuffer`.
  5353. *
  5354. * @private
  5355. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5356. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5357. */
  5358. function cloneArrayBuffer(arrayBuffer) {
  5359. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5360. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5361. return result;
  5362. }
  5363. /**
  5364. * Creates a clone of `dataView`.
  5365. *
  5366. * @private
  5367. * @param {Object} dataView The data view to clone.
  5368. * @param {boolean} [isDeep] Specify a deep clone.
  5369. * @returns {Object} Returns the cloned data view.
  5370. */
  5371. function cloneDataView(dataView, isDeep) {
  5372. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5373. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5374. }
  5375. /**
  5376. * Creates a clone of `regexp`.
  5377. *
  5378. * @private
  5379. * @param {Object} regexp The regexp to clone.
  5380. * @returns {Object} Returns the cloned regexp.
  5381. */
  5382. function cloneRegExp(regexp) {
  5383. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5384. result.lastIndex = regexp.lastIndex;
  5385. return result;
  5386. }
  5387. /**
  5388. * Creates a clone of the `symbol` object.
  5389. *
  5390. * @private
  5391. * @param {Object} symbol The symbol object to clone.
  5392. * @returns {Object} Returns the cloned symbol object.
  5393. */
  5394. function cloneSymbol(symbol) {
  5395. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5396. }
  5397. /**
  5398. * Creates a clone of `typedArray`.
  5399. *
  5400. * @private
  5401. * @param {Object} typedArray The typed array to clone.
  5402. * @param {boolean} [isDeep] Specify a deep clone.
  5403. * @returns {Object} Returns the cloned typed array.
  5404. */
  5405. function cloneTypedArray(typedArray, isDeep) {
  5406. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5407. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5408. }
  5409. /**
  5410. * Compares values to sort them in ascending order.
  5411. *
  5412. * @private
  5413. * @param {*} value The value to compare.
  5414. * @param {*} other The other value to compare.
  5415. * @returns {number} Returns the sort order indicator for `value`.
  5416. */
  5417. function compareAscending(value, other) {
  5418. if (value !== other) {
  5419. var valIsDefined = value !== undefined,
  5420. valIsNull = value === null,
  5421. valIsReflexive = value === value,
  5422. valIsSymbol = isSymbol(value);
  5423. var othIsDefined = other !== undefined,
  5424. othIsNull = other === null,
  5425. othIsReflexive = other === other,
  5426. othIsSymbol = isSymbol(other);
  5427. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5428. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5429. (valIsNull && othIsDefined && othIsReflexive) ||
  5430. (!valIsDefined && othIsReflexive) ||
  5431. !valIsReflexive) {
  5432. return 1;
  5433. }
  5434. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5435. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5436. (othIsNull && valIsDefined && valIsReflexive) ||
  5437. (!othIsDefined && valIsReflexive) ||
  5438. !othIsReflexive) {
  5439. return -1;
  5440. }
  5441. }
  5442. return 0;
  5443. }
  5444. /**
  5445. * Used by `_.orderBy` to compare multiple properties of a value to another
  5446. * and stable sort them.
  5447. *
  5448. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5449. * specify an order of "desc" for descending or "asc" for ascending sort order
  5450. * of corresponding values.
  5451. *
  5452. * @private
  5453. * @param {Object} object The object to compare.
  5454. * @param {Object} other The other object to compare.
  5455. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5456. * @returns {number} Returns the sort order indicator for `object`.
  5457. */
  5458. function compareMultiple(object, other, orders) {
  5459. var index = -1,
  5460. objCriteria = object.criteria,
  5461. othCriteria = other.criteria,
  5462. length = objCriteria.length,
  5463. ordersLength = orders.length;
  5464. while (++index < length) {
  5465. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5466. if (result) {
  5467. if (index >= ordersLength) {
  5468. return result;
  5469. }
  5470. var order = orders[index];
  5471. return result * (order == 'desc' ? -1 : 1);
  5472. }
  5473. }
  5474. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5475. // that causes it, under certain circumstances, to provide the same value for
  5476. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5477. // for more details.
  5478. //
  5479. // This also ensures a stable sort in V8 and other engines.
  5480. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5481. return object.index - other.index;
  5482. }
  5483. /**
  5484. * Creates an array that is the composition of partially applied arguments,
  5485. * placeholders, and provided arguments into a single array of arguments.
  5486. *
  5487. * @private
  5488. * @param {Array} args The provided arguments.
  5489. * @param {Array} partials The arguments to prepend to those provided.
  5490. * @param {Array} holders The `partials` placeholder indexes.
  5491. * @params {boolean} [isCurried] Specify composing for a curried function.
  5492. * @returns {Array} Returns the new array of composed arguments.
  5493. */
  5494. function composeArgs(args, partials, holders, isCurried) {
  5495. var argsIndex = -1,
  5496. argsLength = args.length,
  5497. holdersLength = holders.length,
  5498. leftIndex = -1,
  5499. leftLength = partials.length,
  5500. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5501. result = Array(leftLength + rangeLength),
  5502. isUncurried = !isCurried;
  5503. while (++leftIndex < leftLength) {
  5504. result[leftIndex] = partials[leftIndex];
  5505. }
  5506. while (++argsIndex < holdersLength) {
  5507. if (isUncurried || argsIndex < argsLength) {
  5508. result[holders[argsIndex]] = args[argsIndex];
  5509. }
  5510. }
  5511. while (rangeLength--) {
  5512. result[leftIndex++] = args[argsIndex++];
  5513. }
  5514. return result;
  5515. }
  5516. /**
  5517. * This function is like `composeArgs` except that the arguments composition
  5518. * is tailored for `_.partialRight`.
  5519. *
  5520. * @private
  5521. * @param {Array} args The provided arguments.
  5522. * @param {Array} partials The arguments to append to those provided.
  5523. * @param {Array} holders The `partials` placeholder indexes.
  5524. * @params {boolean} [isCurried] Specify composing for a curried function.
  5525. * @returns {Array} Returns the new array of composed arguments.
  5526. */
  5527. function composeArgsRight(args, partials, holders, isCurried) {
  5528. var argsIndex = -1,
  5529. argsLength = args.length,
  5530. holdersIndex = -1,
  5531. holdersLength = holders.length,
  5532. rightIndex = -1,
  5533. rightLength = partials.length,
  5534. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5535. result = Array(rangeLength + rightLength),
  5536. isUncurried = !isCurried;
  5537. while (++argsIndex < rangeLength) {
  5538. result[argsIndex] = args[argsIndex];
  5539. }
  5540. var offset = argsIndex;
  5541. while (++rightIndex < rightLength) {
  5542. result[offset + rightIndex] = partials[rightIndex];
  5543. }
  5544. while (++holdersIndex < holdersLength) {
  5545. if (isUncurried || argsIndex < argsLength) {
  5546. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5547. }
  5548. }
  5549. return result;
  5550. }
  5551. /**
  5552. * Copies the values of `source` to `array`.
  5553. *
  5554. * @private
  5555. * @param {Array} source The array to copy values from.
  5556. * @param {Array} [array=[]] The array to copy values to.
  5557. * @returns {Array} Returns `array`.
  5558. */
  5559. function copyArray(source, array) {
  5560. var index = -1,
  5561. length = source.length;
  5562. array || (array = Array(length));
  5563. while (++index < length) {
  5564. array[index] = source[index];
  5565. }
  5566. return array;
  5567. }
  5568. /**
  5569. * Copies properties of `source` to `object`.
  5570. *
  5571. * @private
  5572. * @param {Object} source The object to copy properties from.
  5573. * @param {Array} props The property identifiers to copy.
  5574. * @param {Object} [object={}] The object to copy properties to.
  5575. * @param {Function} [customizer] The function to customize copied values.
  5576. * @returns {Object} Returns `object`.
  5577. */
  5578. function copyObject(source, props, object, customizer) {
  5579. var isNew = !object;
  5580. object || (object = {});
  5581. var index = -1,
  5582. length = props.length;
  5583. while (++index < length) {
  5584. var key = props[index];
  5585. var newValue = customizer
  5586. ? customizer(object[key], source[key], key, object, source)
  5587. : undefined;
  5588. if (newValue === undefined) {
  5589. newValue = source[key];
  5590. }
  5591. if (isNew) {
  5592. baseAssignValue(object, key, newValue);
  5593. } else {
  5594. assignValue(object, key, newValue);
  5595. }
  5596. }
  5597. return object;
  5598. }
  5599. /**
  5600. * Copies own symbols of `source` to `object`.
  5601. *
  5602. * @private
  5603. * @param {Object} source The object to copy symbols from.
  5604. * @param {Object} [object={}] The object to copy symbols to.
  5605. * @returns {Object} Returns `object`.
  5606. */
  5607. function copySymbols(source, object) {
  5608. return copyObject(source, getSymbols(source), object);
  5609. }
  5610. /**
  5611. * Copies own and inherited symbols of `source` to `object`.
  5612. *
  5613. * @private
  5614. * @param {Object} source The object to copy symbols from.
  5615. * @param {Object} [object={}] The object to copy symbols to.
  5616. * @returns {Object} Returns `object`.
  5617. */
  5618. function copySymbolsIn(source, object) {
  5619. return copyObject(source, getSymbolsIn(source), object);
  5620. }
  5621. /**
  5622. * Creates a function like `_.groupBy`.
  5623. *
  5624. * @private
  5625. * @param {Function} setter The function to set accumulator values.
  5626. * @param {Function} [initializer] The accumulator object initializer.
  5627. * @returns {Function} Returns the new aggregator function.
  5628. */
  5629. function createAggregator(setter, initializer) {
  5630. return function(collection, iteratee) {
  5631. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5632. accumulator = initializer ? initializer() : {};
  5633. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5634. };
  5635. }
  5636. /**
  5637. * Creates a function like `_.assign`.
  5638. *
  5639. * @private
  5640. * @param {Function} assigner The function to assign values.
  5641. * @returns {Function} Returns the new assigner function.
  5642. */
  5643. function createAssigner(assigner) {
  5644. return baseRest(function(object, sources) {
  5645. var index = -1,
  5646. length = sources.length,
  5647. customizer = length > 1 ? sources[length - 1] : undefined,
  5648. guard = length > 2 ? sources[2] : undefined;
  5649. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5650. ? (length--, customizer)
  5651. : undefined;
  5652. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5653. customizer = length < 3 ? undefined : customizer;
  5654. length = 1;
  5655. }
  5656. object = Object(object);
  5657. while (++index < length) {
  5658. var source = sources[index];
  5659. if (source) {
  5660. assigner(object, source, index, customizer);
  5661. }
  5662. }
  5663. return object;
  5664. });
  5665. }
  5666. /**
  5667. * Creates a `baseEach` or `baseEachRight` function.
  5668. *
  5669. * @private
  5670. * @param {Function} eachFunc The function to iterate over a collection.
  5671. * @param {boolean} [fromRight] Specify iterating from right to left.
  5672. * @returns {Function} Returns the new base function.
  5673. */
  5674. function createBaseEach(eachFunc, fromRight) {
  5675. return function(collection, iteratee) {
  5676. if (collection == null) {
  5677. return collection;
  5678. }
  5679. if (!isArrayLike(collection)) {
  5680. return eachFunc(collection, iteratee);
  5681. }
  5682. var length = collection.length,
  5683. index = fromRight ? length : -1,
  5684. iterable = Object(collection);
  5685. while ((fromRight ? index-- : ++index < length)) {
  5686. if (iteratee(iterable[index], index, iterable) === false) {
  5687. break;
  5688. }
  5689. }
  5690. return collection;
  5691. };
  5692. }
  5693. /**
  5694. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5695. *
  5696. * @private
  5697. * @param {boolean} [fromRight] Specify iterating from right to left.
  5698. * @returns {Function} Returns the new base function.
  5699. */
  5700. function createBaseFor(fromRight) {
  5701. return function(object, iteratee, keysFunc) {
  5702. var index = -1,
  5703. iterable = Object(object),
  5704. props = keysFunc(object),
  5705. length = props.length;
  5706. while (length--) {
  5707. var key = props[fromRight ? length : ++index];
  5708. if (iteratee(iterable[key], key, iterable) === false) {
  5709. break;
  5710. }
  5711. }
  5712. return object;
  5713. };
  5714. }
  5715. /**
  5716. * Creates a function that wraps `func` to invoke it with the optional `this`
  5717. * binding of `thisArg`.
  5718. *
  5719. * @private
  5720. * @param {Function} func The function to wrap.
  5721. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5722. * @param {*} [thisArg] The `this` binding of `func`.
  5723. * @returns {Function} Returns the new wrapped function.
  5724. */
  5725. function createBind(func, bitmask, thisArg) {
  5726. var isBind = bitmask & WRAP_BIND_FLAG,
  5727. Ctor = createCtor(func);
  5728. function wrapper() {
  5729. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5730. return fn.apply(isBind ? thisArg : this, arguments);
  5731. }
  5732. return wrapper;
  5733. }
  5734. /**
  5735. * Creates a function like `_.lowerFirst`.
  5736. *
  5737. * @private
  5738. * @param {string} methodName The name of the `String` case method to use.
  5739. * @returns {Function} Returns the new case function.
  5740. */
  5741. function createCaseFirst(methodName) {
  5742. return function(string) {
  5743. string = toString(string);
  5744. var strSymbols = hasUnicode(string)
  5745. ? stringToArray(string)
  5746. : undefined;
  5747. var chr = strSymbols
  5748. ? strSymbols[0]
  5749. : string.charAt(0);
  5750. var trailing = strSymbols
  5751. ? castSlice(strSymbols, 1).join('')
  5752. : string.slice(1);
  5753. return chr[methodName]() + trailing;
  5754. };
  5755. }
  5756. /**
  5757. * Creates a function like `_.camelCase`.
  5758. *
  5759. * @private
  5760. * @param {Function} callback The function to combine each word.
  5761. * @returns {Function} Returns the new compounder function.
  5762. */
  5763. function createCompounder(callback) {
  5764. return function(string) {
  5765. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5766. };
  5767. }
  5768. /**
  5769. * Creates a function that produces an instance of `Ctor` regardless of
  5770. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5771. *
  5772. * @private
  5773. * @param {Function} Ctor The constructor to wrap.
  5774. * @returns {Function} Returns the new wrapped function.
  5775. */
  5776. function createCtor(Ctor) {
  5777. return function() {
  5778. // Use a `switch` statement to work with class constructors. See
  5779. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5780. // for more details.
  5781. var args = arguments;
  5782. switch (args.length) {
  5783. case 0: return new Ctor;
  5784. case 1: return new Ctor(args[0]);
  5785. case 2: return new Ctor(args[0], args[1]);
  5786. case 3: return new Ctor(args[0], args[1], args[2]);
  5787. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5788. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5789. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5790. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5791. }
  5792. var thisBinding = baseCreate(Ctor.prototype),
  5793. result = Ctor.apply(thisBinding, args);
  5794. // Mimic the constructor's `return` behavior.
  5795. // See https://es5.github.io/#x13.2.2 for more details.
  5796. return isObject(result) ? result : thisBinding;
  5797. };
  5798. }
  5799. /**
  5800. * Creates a function that wraps `func` to enable currying.
  5801. *
  5802. * @private
  5803. * @param {Function} func The function to wrap.
  5804. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5805. * @param {number} arity The arity of `func`.
  5806. * @returns {Function} Returns the new wrapped function.
  5807. */
  5808. function createCurry(func, bitmask, arity) {
  5809. var Ctor = createCtor(func);
  5810. function wrapper() {
  5811. var length = arguments.length,
  5812. args = Array(length),
  5813. index = length,
  5814. placeholder = getHolder(wrapper);
  5815. while (index--) {
  5816. args[index] = arguments[index];
  5817. }
  5818. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5819. ? []
  5820. : replaceHolders(args, placeholder);
  5821. length -= holders.length;
  5822. if (length < arity) {
  5823. return createRecurry(
  5824. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5825. args, holders, undefined, undefined, arity - length);
  5826. }
  5827. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5828. return apply(fn, this, args);
  5829. }
  5830. return wrapper;
  5831. }
  5832. /**
  5833. * Creates a `_.find` or `_.findLast` function.
  5834. *
  5835. * @private
  5836. * @param {Function} findIndexFunc The function to find the collection index.
  5837. * @returns {Function} Returns the new find function.
  5838. */
  5839. function createFind(findIndexFunc) {
  5840. return function(collection, predicate, fromIndex) {
  5841. var iterable = Object(collection);
  5842. if (!isArrayLike(collection)) {
  5843. var iteratee = getIteratee(predicate, 3);
  5844. collection = keys(collection);
  5845. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5846. }
  5847. var index = findIndexFunc(collection, predicate, fromIndex);
  5848. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5849. };
  5850. }
  5851. /**
  5852. * Creates a `_.flow` or `_.flowRight` function.
  5853. *
  5854. * @private
  5855. * @param {boolean} [fromRight] Specify iterating from right to left.
  5856. * @returns {Function} Returns the new flow function.
  5857. */
  5858. function createFlow(fromRight) {
  5859. return flatRest(function(funcs) {
  5860. var length = funcs.length,
  5861. index = length,
  5862. prereq = LodashWrapper.prototype.thru;
  5863. if (fromRight) {
  5864. funcs.reverse();
  5865. }
  5866. while (index--) {
  5867. var func = funcs[index];
  5868. if (typeof func != 'function') {
  5869. throw new TypeError(FUNC_ERROR_TEXT);
  5870. }
  5871. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5872. var wrapper = new LodashWrapper([], true);
  5873. }
  5874. }
  5875. index = wrapper ? index : length;
  5876. while (++index < length) {
  5877. func = funcs[index];
  5878. var funcName = getFuncName(func),
  5879. data = funcName == 'wrapper' ? getData(func) : undefined;
  5880. if (data && isLaziable(data[0]) &&
  5881. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5882. !data[4].length && data[9] == 1
  5883. ) {
  5884. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5885. } else {
  5886. wrapper = (func.length == 1 && isLaziable(func))
  5887. ? wrapper[funcName]()
  5888. : wrapper.thru(func);
  5889. }
  5890. }
  5891. return function() {
  5892. var args = arguments,
  5893. value = args[0];
  5894. if (wrapper && args.length == 1 && isArray(value)) {
  5895. return wrapper.plant(value).value();
  5896. }
  5897. var index = 0,
  5898. result = length ? funcs[index].apply(this, args) : value;
  5899. while (++index < length) {
  5900. result = funcs[index].call(this, result);
  5901. }
  5902. return result;
  5903. };
  5904. });
  5905. }
  5906. /**
  5907. * Creates a function that wraps `func` to invoke it with optional `this`
  5908. * binding of `thisArg`, partial application, and currying.
  5909. *
  5910. * @private
  5911. * @param {Function|string} func The function or method name to wrap.
  5912. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5913. * @param {*} [thisArg] The `this` binding of `func`.
  5914. * @param {Array} [partials] The arguments to prepend to those provided to
  5915. * the new function.
  5916. * @param {Array} [holders] The `partials` placeholder indexes.
  5917. * @param {Array} [partialsRight] The arguments to append to those provided
  5918. * to the new function.
  5919. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5920. * @param {Array} [argPos] The argument positions of the new function.
  5921. * @param {number} [ary] The arity cap of `func`.
  5922. * @param {number} [arity] The arity of `func`.
  5923. * @returns {Function} Returns the new wrapped function.
  5924. */
  5925. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5926. var isAry = bitmask & WRAP_ARY_FLAG,
  5927. isBind = bitmask & WRAP_BIND_FLAG,
  5928. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5929. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5930. isFlip = bitmask & WRAP_FLIP_FLAG,
  5931. Ctor = isBindKey ? undefined : createCtor(func);
  5932. function wrapper() {
  5933. var length = arguments.length,
  5934. args = Array(length),
  5935. index = length;
  5936. while (index--) {
  5937. args[index] = arguments[index];
  5938. }
  5939. if (isCurried) {
  5940. var placeholder = getHolder(wrapper),
  5941. holdersCount = countHolders(args, placeholder);
  5942. }
  5943. if (partials) {
  5944. args = composeArgs(args, partials, holders, isCurried);
  5945. }
  5946. if (partialsRight) {
  5947. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5948. }
  5949. length -= holdersCount;
  5950. if (isCurried && length < arity) {
  5951. var newHolders = replaceHolders(args, placeholder);
  5952. return createRecurry(
  5953. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5954. args, newHolders, argPos, ary, arity - length
  5955. );
  5956. }
  5957. var thisBinding = isBind ? thisArg : this,
  5958. fn = isBindKey ? thisBinding[func] : func;
  5959. length = args.length;
  5960. if (argPos) {
  5961. args = reorder(args, argPos);
  5962. } else if (isFlip && length > 1) {
  5963. args.reverse();
  5964. }
  5965. if (isAry && ary < length) {
  5966. args.length = ary;
  5967. }
  5968. if (this && this !== root && this instanceof wrapper) {
  5969. fn = Ctor || createCtor(fn);
  5970. }
  5971. return fn.apply(thisBinding, args);
  5972. }
  5973. return wrapper;
  5974. }
  5975. /**
  5976. * Creates a function like `_.invertBy`.
  5977. *
  5978. * @private
  5979. * @param {Function} setter The function to set accumulator values.
  5980. * @param {Function} toIteratee The function to resolve iteratees.
  5981. * @returns {Function} Returns the new inverter function.
  5982. */
  5983. function createInverter(setter, toIteratee) {
  5984. return function(object, iteratee) {
  5985. return baseInverter(object, setter, toIteratee(iteratee), {});
  5986. };
  5987. }
  5988. /**
  5989. * Creates a function that performs a mathematical operation on two values.
  5990. *
  5991. * @private
  5992. * @param {Function} operator The function to perform the operation.
  5993. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5994. * @returns {Function} Returns the new mathematical operation function.
  5995. */
  5996. function createMathOperation(operator, defaultValue) {
  5997. return function(value, other) {
  5998. var result;
  5999. if (value === undefined && other === undefined) {
  6000. return defaultValue;
  6001. }
  6002. if (value !== undefined) {
  6003. result = value;
  6004. }
  6005. if (other !== undefined) {
  6006. if (result === undefined) {
  6007. return other;
  6008. }
  6009. if (typeof value == 'string' || typeof other == 'string') {
  6010. value = baseToString(value);
  6011. other = baseToString(other);
  6012. } else {
  6013. value = baseToNumber(value);
  6014. other = baseToNumber(other);
  6015. }
  6016. result = operator(value, other);
  6017. }
  6018. return result;
  6019. };
  6020. }
  6021. /**
  6022. * Creates a function like `_.over`.
  6023. *
  6024. * @private
  6025. * @param {Function} arrayFunc The function to iterate over iteratees.
  6026. * @returns {Function} Returns the new over function.
  6027. */
  6028. function createOver(arrayFunc) {
  6029. return flatRest(function(iteratees) {
  6030. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6031. return baseRest(function(args) {
  6032. var thisArg = this;
  6033. return arrayFunc(iteratees, function(iteratee) {
  6034. return apply(iteratee, thisArg, args);
  6035. });
  6036. });
  6037. });
  6038. }
  6039. /**
  6040. * Creates the padding for `string` based on `length`. The `chars` string
  6041. * is truncated if the number of characters exceeds `length`.
  6042. *
  6043. * @private
  6044. * @param {number} length The padding length.
  6045. * @param {string} [chars=' '] The string used as padding.
  6046. * @returns {string} Returns the padding for `string`.
  6047. */
  6048. function createPadding(length, chars) {
  6049. chars = chars === undefined ? ' ' : baseToString(chars);
  6050. var charsLength = chars.length;
  6051. if (charsLength < 2) {
  6052. return charsLength ? baseRepeat(chars, length) : chars;
  6053. }
  6054. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6055. return hasUnicode(chars)
  6056. ? castSlice(stringToArray(result), 0, length).join('')
  6057. : result.slice(0, length);
  6058. }
  6059. /**
  6060. * Creates a function that wraps `func` to invoke it with the `this` binding
  6061. * of `thisArg` and `partials` prepended to the arguments it receives.
  6062. *
  6063. * @private
  6064. * @param {Function} func The function to wrap.
  6065. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6066. * @param {*} thisArg The `this` binding of `func`.
  6067. * @param {Array} partials The arguments to prepend to those provided to
  6068. * the new function.
  6069. * @returns {Function} Returns the new wrapped function.
  6070. */
  6071. function createPartial(func, bitmask, thisArg, partials) {
  6072. var isBind = bitmask & WRAP_BIND_FLAG,
  6073. Ctor = createCtor(func);
  6074. function wrapper() {
  6075. var argsIndex = -1,
  6076. argsLength = arguments.length,
  6077. leftIndex = -1,
  6078. leftLength = partials.length,
  6079. args = Array(leftLength + argsLength),
  6080. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6081. while (++leftIndex < leftLength) {
  6082. args[leftIndex] = partials[leftIndex];
  6083. }
  6084. while (argsLength--) {
  6085. args[leftIndex++] = arguments[++argsIndex];
  6086. }
  6087. return apply(fn, isBind ? thisArg : this, args);
  6088. }
  6089. return wrapper;
  6090. }
  6091. /**
  6092. * Creates a `_.range` or `_.rangeRight` function.
  6093. *
  6094. * @private
  6095. * @param {boolean} [fromRight] Specify iterating from right to left.
  6096. * @returns {Function} Returns the new range function.
  6097. */
  6098. function createRange(fromRight) {
  6099. return function(start, end, step) {
  6100. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6101. end = step = undefined;
  6102. }
  6103. // Ensure the sign of `-0` is preserved.
  6104. start = toFinite(start);
  6105. if (end === undefined) {
  6106. end = start;
  6107. start = 0;
  6108. } else {
  6109. end = toFinite(end);
  6110. }
  6111. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6112. return baseRange(start, end, step, fromRight);
  6113. };
  6114. }
  6115. /**
  6116. * Creates a function that performs a relational operation on two values.
  6117. *
  6118. * @private
  6119. * @param {Function} operator The function to perform the operation.
  6120. * @returns {Function} Returns the new relational operation function.
  6121. */
  6122. function createRelationalOperation(operator) {
  6123. return function(value, other) {
  6124. if (!(typeof value == 'string' && typeof other == 'string')) {
  6125. value = toNumber(value);
  6126. other = toNumber(other);
  6127. }
  6128. return operator(value, other);
  6129. };
  6130. }
  6131. /**
  6132. * Creates a function that wraps `func` to continue currying.
  6133. *
  6134. * @private
  6135. * @param {Function} func The function to wrap.
  6136. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6137. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6138. * @param {*} placeholder The placeholder value.
  6139. * @param {*} [thisArg] The `this` binding of `func`.
  6140. * @param {Array} [partials] The arguments to prepend to those provided to
  6141. * the new function.
  6142. * @param {Array} [holders] The `partials` placeholder indexes.
  6143. * @param {Array} [argPos] The argument positions of the new function.
  6144. * @param {number} [ary] The arity cap of `func`.
  6145. * @param {number} [arity] The arity of `func`.
  6146. * @returns {Function} Returns the new wrapped function.
  6147. */
  6148. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6149. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6150. newHolders = isCurry ? holders : undefined,
  6151. newHoldersRight = isCurry ? undefined : holders,
  6152. newPartials = isCurry ? partials : undefined,
  6153. newPartialsRight = isCurry ? undefined : partials;
  6154. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6155. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6156. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6157. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6158. }
  6159. var newData = [
  6160. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6161. newHoldersRight, argPos, ary, arity
  6162. ];
  6163. var result = wrapFunc.apply(undefined, newData);
  6164. if (isLaziable(func)) {
  6165. setData(result, newData);
  6166. }
  6167. result.placeholder = placeholder;
  6168. return setWrapToString(result, func, bitmask);
  6169. }
  6170. /**
  6171. * Creates a function like `_.round`.
  6172. *
  6173. * @private
  6174. * @param {string} methodName The name of the `Math` method to use when rounding.
  6175. * @returns {Function} Returns the new round function.
  6176. */
  6177. function createRound(methodName) {
  6178. var func = Math[methodName];
  6179. return function(number, precision) {
  6180. number = toNumber(number);
  6181. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6182. if (precision && nativeIsFinite(number)) {
  6183. // Shift with exponential notation to avoid floating-point issues.
  6184. // See [MDN](https://mdn.io/round#Examples) for more details.
  6185. var pair = (toString(number) + 'e').split('e'),
  6186. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6187. pair = (toString(value) + 'e').split('e');
  6188. return +(pair[0] + 'e' + (+pair[1] - precision));
  6189. }
  6190. return func(number);
  6191. };
  6192. }
  6193. /**
  6194. * Creates a set object of `values`.
  6195. *
  6196. * @private
  6197. * @param {Array} values The values to add to the set.
  6198. * @returns {Object} Returns the new set.
  6199. */
  6200. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6201. return new Set(values);
  6202. };
  6203. /**
  6204. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6205. *
  6206. * @private
  6207. * @param {Function} keysFunc The function to get the keys of a given object.
  6208. * @returns {Function} Returns the new pairs function.
  6209. */
  6210. function createToPairs(keysFunc) {
  6211. return function(object) {
  6212. var tag = getTag(object);
  6213. if (tag == mapTag) {
  6214. return mapToArray(object);
  6215. }
  6216. if (tag == setTag) {
  6217. return setToPairs(object);
  6218. }
  6219. return baseToPairs(object, keysFunc(object));
  6220. };
  6221. }
  6222. /**
  6223. * Creates a function that either curries or invokes `func` with optional
  6224. * `this` binding and partially applied arguments.
  6225. *
  6226. * @private
  6227. * @param {Function|string} func The function or method name to wrap.
  6228. * @param {number} bitmask The bitmask flags.
  6229. * 1 - `_.bind`
  6230. * 2 - `_.bindKey`
  6231. * 4 - `_.curry` or `_.curryRight` of a bound function
  6232. * 8 - `_.curry`
  6233. * 16 - `_.curryRight`
  6234. * 32 - `_.partial`
  6235. * 64 - `_.partialRight`
  6236. * 128 - `_.rearg`
  6237. * 256 - `_.ary`
  6238. * 512 - `_.flip`
  6239. * @param {*} [thisArg] The `this` binding of `func`.
  6240. * @param {Array} [partials] The arguments to be partially applied.
  6241. * @param {Array} [holders] The `partials` placeholder indexes.
  6242. * @param {Array} [argPos] The argument positions of the new function.
  6243. * @param {number} [ary] The arity cap of `func`.
  6244. * @param {number} [arity] The arity of `func`.
  6245. * @returns {Function} Returns the new wrapped function.
  6246. */
  6247. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6248. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6249. if (!isBindKey && typeof func != 'function') {
  6250. throw new TypeError(FUNC_ERROR_TEXT);
  6251. }
  6252. var length = partials ? partials.length : 0;
  6253. if (!length) {
  6254. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6255. partials = holders = undefined;
  6256. }
  6257. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6258. arity = arity === undefined ? arity : toInteger(arity);
  6259. length -= holders ? holders.length : 0;
  6260. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6261. var partialsRight = partials,
  6262. holdersRight = holders;
  6263. partials = holders = undefined;
  6264. }
  6265. var data = isBindKey ? undefined : getData(func);
  6266. var newData = [
  6267. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6268. argPos, ary, arity
  6269. ];
  6270. if (data) {
  6271. mergeData(newData, data);
  6272. }
  6273. func = newData[0];
  6274. bitmask = newData[1];
  6275. thisArg = newData[2];
  6276. partials = newData[3];
  6277. holders = newData[4];
  6278. arity = newData[9] = newData[9] === undefined
  6279. ? (isBindKey ? 0 : func.length)
  6280. : nativeMax(newData[9] - length, 0);
  6281. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6282. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6283. }
  6284. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6285. var result = createBind(func, bitmask, thisArg);
  6286. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6287. result = createCurry(func, bitmask, arity);
  6288. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6289. result = createPartial(func, bitmask, thisArg, partials);
  6290. } else {
  6291. result = createHybrid.apply(undefined, newData);
  6292. }
  6293. var setter = data ? baseSetData : setData;
  6294. return setWrapToString(setter(result, newData), func, bitmask);
  6295. }
  6296. /**
  6297. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6298. * of source objects to the destination object for all destination properties
  6299. * that resolve to `undefined`.
  6300. *
  6301. * @private
  6302. * @param {*} objValue The destination value.
  6303. * @param {*} srcValue The source value.
  6304. * @param {string} key The key of the property to assign.
  6305. * @param {Object} object The parent object of `objValue`.
  6306. * @returns {*} Returns the value to assign.
  6307. */
  6308. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6309. if (objValue === undefined ||
  6310. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6311. return srcValue;
  6312. }
  6313. return objValue;
  6314. }
  6315. /**
  6316. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6317. * objects into destination objects that are passed thru.
  6318. *
  6319. * @private
  6320. * @param {*} objValue The destination value.
  6321. * @param {*} srcValue The source value.
  6322. * @param {string} key The key of the property to merge.
  6323. * @param {Object} object The parent object of `objValue`.
  6324. * @param {Object} source The parent object of `srcValue`.
  6325. * @param {Object} [stack] Tracks traversed source values and their merged
  6326. * counterparts.
  6327. * @returns {*} Returns the value to assign.
  6328. */
  6329. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6330. if (isObject(objValue) && isObject(srcValue)) {
  6331. // Recursively merge objects and arrays (susceptible to call stack limits).
  6332. stack.set(srcValue, objValue);
  6333. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6334. stack['delete'](srcValue);
  6335. }
  6336. return objValue;
  6337. }
  6338. /**
  6339. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6340. * objects.
  6341. *
  6342. * @private
  6343. * @param {*} value The value to inspect.
  6344. * @param {string} key The key of the property to inspect.
  6345. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6346. */
  6347. function customOmitClone(value) {
  6348. return isPlainObject(value) ? undefined : value;
  6349. }
  6350. /**
  6351. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6352. * partial deep comparisons.
  6353. *
  6354. * @private
  6355. * @param {Array} array The array to compare.
  6356. * @param {Array} other The other array to compare.
  6357. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6358. * @param {Function} customizer The function to customize comparisons.
  6359. * @param {Function} equalFunc The function to determine equivalents of values.
  6360. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6361. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6362. */
  6363. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6364. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6365. arrLength = array.length,
  6366. othLength = other.length;
  6367. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6368. return false;
  6369. }
  6370. // Check that cyclic values are equal.
  6371. var arrStacked = stack.get(array);
  6372. var othStacked = stack.get(other);
  6373. if (arrStacked && othStacked) {
  6374. return arrStacked == other && othStacked == array;
  6375. }
  6376. var index = -1,
  6377. result = true,
  6378. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6379. stack.set(array, other);
  6380. stack.set(other, array);
  6381. // Ignore non-index properties.
  6382. while (++index < arrLength) {
  6383. var arrValue = array[index],
  6384. othValue = other[index];
  6385. if (customizer) {
  6386. var compared = isPartial
  6387. ? customizer(othValue, arrValue, index, other, array, stack)
  6388. : customizer(arrValue, othValue, index, array, other, stack);
  6389. }
  6390. if (compared !== undefined) {
  6391. if (compared) {
  6392. continue;
  6393. }
  6394. result = false;
  6395. break;
  6396. }
  6397. // Recursively compare arrays (susceptible to call stack limits).
  6398. if (seen) {
  6399. if (!arraySome(other, function(othValue, othIndex) {
  6400. if (!cacheHas(seen, othIndex) &&
  6401. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6402. return seen.push(othIndex);
  6403. }
  6404. })) {
  6405. result = false;
  6406. break;
  6407. }
  6408. } else if (!(
  6409. arrValue === othValue ||
  6410. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6411. )) {
  6412. result = false;
  6413. break;
  6414. }
  6415. }
  6416. stack['delete'](array);
  6417. stack['delete'](other);
  6418. return result;
  6419. }
  6420. /**
  6421. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6422. * the same `toStringTag`.
  6423. *
  6424. * **Note:** This function only supports comparing values with tags of
  6425. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6426. *
  6427. * @private
  6428. * @param {Object} object The object to compare.
  6429. * @param {Object} other The other object to compare.
  6430. * @param {string} tag The `toStringTag` of the objects to compare.
  6431. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6432. * @param {Function} customizer The function to customize comparisons.
  6433. * @param {Function} equalFunc The function to determine equivalents of values.
  6434. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6435. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6436. */
  6437. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6438. switch (tag) {
  6439. case dataViewTag:
  6440. if ((object.byteLength != other.byteLength) ||
  6441. (object.byteOffset != other.byteOffset)) {
  6442. return false;
  6443. }
  6444. object = object.buffer;
  6445. other = other.buffer;
  6446. case arrayBufferTag:
  6447. if ((object.byteLength != other.byteLength) ||
  6448. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6449. return false;
  6450. }
  6451. return true;
  6452. case boolTag:
  6453. case dateTag:
  6454. case numberTag:
  6455. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6456. // Invalid dates are coerced to `NaN`.
  6457. return eq(+object, +other);
  6458. case errorTag:
  6459. return object.name == other.name && object.message == other.message;
  6460. case regexpTag:
  6461. case stringTag:
  6462. // Coerce regexes to strings and treat strings, primitives and objects,
  6463. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6464. // for more details.
  6465. return object == (other + '');
  6466. case mapTag:
  6467. var convert = mapToArray;
  6468. case setTag:
  6469. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6470. convert || (convert = setToArray);
  6471. if (object.size != other.size && !isPartial) {
  6472. return false;
  6473. }
  6474. // Assume cyclic values are equal.
  6475. var stacked = stack.get(object);
  6476. if (stacked) {
  6477. return stacked == other;
  6478. }
  6479. bitmask |= COMPARE_UNORDERED_FLAG;
  6480. // Recursively compare objects (susceptible to call stack limits).
  6481. stack.set(object, other);
  6482. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6483. stack['delete'](object);
  6484. return result;
  6485. case symbolTag:
  6486. if (symbolValueOf) {
  6487. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6488. }
  6489. }
  6490. return false;
  6491. }
  6492. /**
  6493. * A specialized version of `baseIsEqualDeep` for objects with support for
  6494. * partial deep comparisons.
  6495. *
  6496. * @private
  6497. * @param {Object} object The object to compare.
  6498. * @param {Object} other The other object to compare.
  6499. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6500. * @param {Function} customizer The function to customize comparisons.
  6501. * @param {Function} equalFunc The function to determine equivalents of values.
  6502. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6503. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6504. */
  6505. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6506. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6507. objProps = getAllKeys(object),
  6508. objLength = objProps.length,
  6509. othProps = getAllKeys(other),
  6510. othLength = othProps.length;
  6511. if (objLength != othLength && !isPartial) {
  6512. return false;
  6513. }
  6514. var index = objLength;
  6515. while (index--) {
  6516. var key = objProps[index];
  6517. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6518. return false;
  6519. }
  6520. }
  6521. // Check that cyclic values are equal.
  6522. var objStacked = stack.get(object);
  6523. var othStacked = stack.get(other);
  6524. if (objStacked && othStacked) {
  6525. return objStacked == other && othStacked == object;
  6526. }
  6527. var result = true;
  6528. stack.set(object, other);
  6529. stack.set(other, object);
  6530. var skipCtor = isPartial;
  6531. while (++index < objLength) {
  6532. key = objProps[index];
  6533. var objValue = object[key],
  6534. othValue = other[key];
  6535. if (customizer) {
  6536. var compared = isPartial
  6537. ? customizer(othValue, objValue, key, other, object, stack)
  6538. : customizer(objValue, othValue, key, object, other, stack);
  6539. }
  6540. // Recursively compare objects (susceptible to call stack limits).
  6541. if (!(compared === undefined
  6542. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6543. : compared
  6544. )) {
  6545. result = false;
  6546. break;
  6547. }
  6548. skipCtor || (skipCtor = key == 'constructor');
  6549. }
  6550. if (result && !skipCtor) {
  6551. var objCtor = object.constructor,
  6552. othCtor = other.constructor;
  6553. // Non `Object` object instances with different constructors are not equal.
  6554. if (objCtor != othCtor &&
  6555. ('constructor' in object && 'constructor' in other) &&
  6556. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6557. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6558. result = false;
  6559. }
  6560. }
  6561. stack['delete'](object);
  6562. stack['delete'](other);
  6563. return result;
  6564. }
  6565. /**
  6566. * A specialized version of `baseRest` which flattens the rest array.
  6567. *
  6568. * @private
  6569. * @param {Function} func The function to apply a rest parameter to.
  6570. * @returns {Function} Returns the new function.
  6571. */
  6572. function flatRest(func) {
  6573. return setToString(overRest(func, undefined, flatten), func + '');
  6574. }
  6575. /**
  6576. * Creates an array of own enumerable property names and symbols of `object`.
  6577. *
  6578. * @private
  6579. * @param {Object} object The object to query.
  6580. * @returns {Array} Returns the array of property names and symbols.
  6581. */
  6582. function getAllKeys(object) {
  6583. return baseGetAllKeys(object, keys, getSymbols);
  6584. }
  6585. /**
  6586. * Creates an array of own and inherited enumerable property names and
  6587. * symbols of `object`.
  6588. *
  6589. * @private
  6590. * @param {Object} object The object to query.
  6591. * @returns {Array} Returns the array of property names and symbols.
  6592. */
  6593. function getAllKeysIn(object) {
  6594. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6595. }
  6596. /**
  6597. * Gets metadata for `func`.
  6598. *
  6599. * @private
  6600. * @param {Function} func The function to query.
  6601. * @returns {*} Returns the metadata for `func`.
  6602. */
  6603. var getData = !metaMap ? noop : function(func) {
  6604. return metaMap.get(func);
  6605. };
  6606. /**
  6607. * Gets the name of `func`.
  6608. *
  6609. * @private
  6610. * @param {Function} func The function to query.
  6611. * @returns {string} Returns the function name.
  6612. */
  6613. function getFuncName(func) {
  6614. var result = (func.name + ''),
  6615. array = realNames[result],
  6616. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6617. while (length--) {
  6618. var data = array[length],
  6619. otherFunc = data.func;
  6620. if (otherFunc == null || otherFunc == func) {
  6621. return data.name;
  6622. }
  6623. }
  6624. return result;
  6625. }
  6626. /**
  6627. * Gets the argument placeholder value for `func`.
  6628. *
  6629. * @private
  6630. * @param {Function} func The function to inspect.
  6631. * @returns {*} Returns the placeholder value.
  6632. */
  6633. function getHolder(func) {
  6634. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6635. return object.placeholder;
  6636. }
  6637. /**
  6638. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6639. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6640. * If arguments are provided, the chosen function is invoked with them and
  6641. * its result is returned.
  6642. *
  6643. * @private
  6644. * @param {*} [value] The value to convert to an iteratee.
  6645. * @param {number} [arity] The arity of the created iteratee.
  6646. * @returns {Function} Returns the chosen function or its result.
  6647. */
  6648. function getIteratee() {
  6649. var result = lodash.iteratee || iteratee;
  6650. result = result === iteratee ? baseIteratee : result;
  6651. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6652. }
  6653. /**
  6654. * Gets the data for `map`.
  6655. *
  6656. * @private
  6657. * @param {Object} map The map to query.
  6658. * @param {string} key The reference key.
  6659. * @returns {*} Returns the map data.
  6660. */
  6661. function getMapData(map, key) {
  6662. var data = map.__data__;
  6663. return isKeyable(key)
  6664. ? data[typeof key == 'string' ? 'string' : 'hash']
  6665. : data.map;
  6666. }
  6667. /**
  6668. * Gets the property names, values, and compare flags of `object`.
  6669. *
  6670. * @private
  6671. * @param {Object} object The object to query.
  6672. * @returns {Array} Returns the match data of `object`.
  6673. */
  6674. function getMatchData(object) {
  6675. var result = keys(object),
  6676. length = result.length;
  6677. while (length--) {
  6678. var key = result[length],
  6679. value = object[key];
  6680. result[length] = [key, value, isStrictComparable(value)];
  6681. }
  6682. return result;
  6683. }
  6684. /**
  6685. * Gets the native function at `key` of `object`.
  6686. *
  6687. * @private
  6688. * @param {Object} object The object to query.
  6689. * @param {string} key The key of the method to get.
  6690. * @returns {*} Returns the function if it's native, else `undefined`.
  6691. */
  6692. function getNative(object, key) {
  6693. var value = getValue(object, key);
  6694. return baseIsNative(value) ? value : undefined;
  6695. }
  6696. /**
  6697. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6698. *
  6699. * @private
  6700. * @param {*} value The value to query.
  6701. * @returns {string} Returns the raw `toStringTag`.
  6702. */
  6703. function getRawTag(value) {
  6704. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6705. tag = value[symToStringTag];
  6706. try {
  6707. value[symToStringTag] = undefined;
  6708. var unmasked = true;
  6709. } catch (e) {}
  6710. var result = nativeObjectToString.call(value);
  6711. if (unmasked) {
  6712. if (isOwn) {
  6713. value[symToStringTag] = tag;
  6714. } else {
  6715. delete value[symToStringTag];
  6716. }
  6717. }
  6718. return result;
  6719. }
  6720. /**
  6721. * Creates an array of the own enumerable symbols of `object`.
  6722. *
  6723. * @private
  6724. * @param {Object} object The object to query.
  6725. * @returns {Array} Returns the array of symbols.
  6726. */
  6727. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6728. if (object == null) {
  6729. return [];
  6730. }
  6731. object = Object(object);
  6732. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6733. return propertyIsEnumerable.call(object, symbol);
  6734. });
  6735. };
  6736. /**
  6737. * Creates an array of the own and inherited enumerable symbols of `object`.
  6738. *
  6739. * @private
  6740. * @param {Object} object The object to query.
  6741. * @returns {Array} Returns the array of symbols.
  6742. */
  6743. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6744. var result = [];
  6745. while (object) {
  6746. arrayPush(result, getSymbols(object));
  6747. object = getPrototype(object);
  6748. }
  6749. return result;
  6750. };
  6751. /**
  6752. * Gets the `toStringTag` of `value`.
  6753. *
  6754. * @private
  6755. * @param {*} value The value to query.
  6756. * @returns {string} Returns the `toStringTag`.
  6757. */
  6758. var getTag = baseGetTag;
  6759. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6760. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6761. (Map && getTag(new Map) != mapTag) ||
  6762. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6763. (Set && getTag(new Set) != setTag) ||
  6764. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6765. getTag = function(value) {
  6766. var result = baseGetTag(value),
  6767. Ctor = result == objectTag ? value.constructor : undefined,
  6768. ctorString = Ctor ? toSource(Ctor) : '';
  6769. if (ctorString) {
  6770. switch (ctorString) {
  6771. case dataViewCtorString: return dataViewTag;
  6772. case mapCtorString: return mapTag;
  6773. case promiseCtorString: return promiseTag;
  6774. case setCtorString: return setTag;
  6775. case weakMapCtorString: return weakMapTag;
  6776. }
  6777. }
  6778. return result;
  6779. };
  6780. }
  6781. /**
  6782. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6783. *
  6784. * @private
  6785. * @param {number} start The start of the view.
  6786. * @param {number} end The end of the view.
  6787. * @param {Array} transforms The transformations to apply to the view.
  6788. * @returns {Object} Returns an object containing the `start` and `end`
  6789. * positions of the view.
  6790. */
  6791. function getView(start, end, transforms) {
  6792. var index = -1,
  6793. length = transforms.length;
  6794. while (++index < length) {
  6795. var data = transforms[index],
  6796. size = data.size;
  6797. switch (data.type) {
  6798. case 'drop': start += size; break;
  6799. case 'dropRight': end -= size; break;
  6800. case 'take': end = nativeMin(end, start + size); break;
  6801. case 'takeRight': start = nativeMax(start, end - size); break;
  6802. }
  6803. }
  6804. return { 'start': start, 'end': end };
  6805. }
  6806. /**
  6807. * Extracts wrapper details from the `source` body comment.
  6808. *
  6809. * @private
  6810. * @param {string} source The source to inspect.
  6811. * @returns {Array} Returns the wrapper details.
  6812. */
  6813. function getWrapDetails(source) {
  6814. var match = source.match(reWrapDetails);
  6815. return match ? match[1].split(reSplitDetails) : [];
  6816. }
  6817. /**
  6818. * Checks if `path` exists on `object`.
  6819. *
  6820. * @private
  6821. * @param {Object} object The object to query.
  6822. * @param {Array|string} path The path to check.
  6823. * @param {Function} hasFunc The function to check properties.
  6824. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6825. */
  6826. function hasPath(object, path, hasFunc) {
  6827. path = castPath(path, object);
  6828. var index = -1,
  6829. length = path.length,
  6830. result = false;
  6831. while (++index < length) {
  6832. var key = toKey(path[index]);
  6833. if (!(result = object != null && hasFunc(object, key))) {
  6834. break;
  6835. }
  6836. object = object[key];
  6837. }
  6838. if (result || ++index != length) {
  6839. return result;
  6840. }
  6841. length = object == null ? 0 : object.length;
  6842. return !!length && isLength(length) && isIndex(key, length) &&
  6843. (isArray(object) || isArguments(object));
  6844. }
  6845. /**
  6846. * Initializes an array clone.
  6847. *
  6848. * @private
  6849. * @param {Array} array The array to clone.
  6850. * @returns {Array} Returns the initialized clone.
  6851. */
  6852. function initCloneArray(array) {
  6853. var length = array.length,
  6854. result = new array.constructor(length);
  6855. // Add properties assigned by `RegExp#exec`.
  6856. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6857. result.index = array.index;
  6858. result.input = array.input;
  6859. }
  6860. return result;
  6861. }
  6862. /**
  6863. * Initializes an object clone.
  6864. *
  6865. * @private
  6866. * @param {Object} object The object to clone.
  6867. * @returns {Object} Returns the initialized clone.
  6868. */
  6869. function initCloneObject(object) {
  6870. return (typeof object.constructor == 'function' && !isPrototype(object))
  6871. ? baseCreate(getPrototype(object))
  6872. : {};
  6873. }
  6874. /**
  6875. * Initializes an object clone based on its `toStringTag`.
  6876. *
  6877. * **Note:** This function only supports cloning values with tags of
  6878. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6879. *
  6880. * @private
  6881. * @param {Object} object The object to clone.
  6882. * @param {string} tag The `toStringTag` of the object to clone.
  6883. * @param {boolean} [isDeep] Specify a deep clone.
  6884. * @returns {Object} Returns the initialized clone.
  6885. */
  6886. function initCloneByTag(object, tag, isDeep) {
  6887. var Ctor = object.constructor;
  6888. switch (tag) {
  6889. case arrayBufferTag:
  6890. return cloneArrayBuffer(object);
  6891. case boolTag:
  6892. case dateTag:
  6893. return new Ctor(+object);
  6894. case dataViewTag:
  6895. return cloneDataView(object, isDeep);
  6896. case float32Tag: case float64Tag:
  6897. case int8Tag: case int16Tag: case int32Tag:
  6898. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6899. return cloneTypedArray(object, isDeep);
  6900. case mapTag:
  6901. return new Ctor;
  6902. case numberTag:
  6903. case stringTag:
  6904. return new Ctor(object);
  6905. case regexpTag:
  6906. return cloneRegExp(object);
  6907. case setTag:
  6908. return new Ctor;
  6909. case symbolTag:
  6910. return cloneSymbol(object);
  6911. }
  6912. }
  6913. /**
  6914. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6915. *
  6916. * @private
  6917. * @param {string} source The source to modify.
  6918. * @returns {Array} details The details to insert.
  6919. * @returns {string} Returns the modified source.
  6920. */
  6921. function insertWrapDetails(source, details) {
  6922. var length = details.length;
  6923. if (!length) {
  6924. return source;
  6925. }
  6926. var lastIndex = length - 1;
  6927. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6928. details = details.join(length > 2 ? ', ' : ' ');
  6929. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6930. }
  6931. /**
  6932. * Checks if `value` is a flattenable `arguments` object or array.
  6933. *
  6934. * @private
  6935. * @param {*} value The value to check.
  6936. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6937. */
  6938. function isFlattenable(value) {
  6939. return isArray(value) || isArguments(value) ||
  6940. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6941. }
  6942. /**
  6943. * Checks if `value` is a valid array-like index.
  6944. *
  6945. * @private
  6946. * @param {*} value The value to check.
  6947. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6948. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6949. */
  6950. function isIndex(value, length) {
  6951. var type = typeof value;
  6952. length = length == null ? MAX_SAFE_INTEGER : length;
  6953. return !!length &&
  6954. (type == 'number' ||
  6955. (type != 'symbol' && reIsUint.test(value))) &&
  6956. (value > -1 && value % 1 == 0 && value < length);
  6957. }
  6958. /**
  6959. * Checks if the given arguments are from an iteratee call.
  6960. *
  6961. * @private
  6962. * @param {*} value The potential iteratee value argument.
  6963. * @param {*} index The potential iteratee index or key argument.
  6964. * @param {*} object The potential iteratee object argument.
  6965. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6966. * else `false`.
  6967. */
  6968. function isIterateeCall(value, index, object) {
  6969. if (!isObject(object)) {
  6970. return false;
  6971. }
  6972. var type = typeof index;
  6973. if (type == 'number'
  6974. ? (isArrayLike(object) && isIndex(index, object.length))
  6975. : (type == 'string' && index in object)
  6976. ) {
  6977. return eq(object[index], value);
  6978. }
  6979. return false;
  6980. }
  6981. /**
  6982. * Checks if `value` is a property name and not a property path.
  6983. *
  6984. * @private
  6985. * @param {*} value The value to check.
  6986. * @param {Object} [object] The object to query keys on.
  6987. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6988. */
  6989. function isKey(value, object) {
  6990. if (isArray(value)) {
  6991. return false;
  6992. }
  6993. var type = typeof value;
  6994. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6995. value == null || isSymbol(value)) {
  6996. return true;
  6997. }
  6998. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6999. (object != null && value in Object(object));
  7000. }
  7001. /**
  7002. * Checks if `value` is suitable for use as unique object key.
  7003. *
  7004. * @private
  7005. * @param {*} value The value to check.
  7006. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7007. */
  7008. function isKeyable(value) {
  7009. var type = typeof value;
  7010. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7011. ? (value !== '__proto__')
  7012. : (value === null);
  7013. }
  7014. /**
  7015. * Checks if `func` has a lazy counterpart.
  7016. *
  7017. * @private
  7018. * @param {Function} func The function to check.
  7019. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7020. * else `false`.
  7021. */
  7022. function isLaziable(func) {
  7023. var funcName = getFuncName(func),
  7024. other = lodash[funcName];
  7025. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7026. return false;
  7027. }
  7028. if (func === other) {
  7029. return true;
  7030. }
  7031. var data = getData(other);
  7032. return !!data && func === data[0];
  7033. }
  7034. /**
  7035. * Checks if `func` has its source masked.
  7036. *
  7037. * @private
  7038. * @param {Function} func The function to check.
  7039. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7040. */
  7041. function isMasked(func) {
  7042. return !!maskSrcKey && (maskSrcKey in func);
  7043. }
  7044. /**
  7045. * Checks if `func` is capable of being masked.
  7046. *
  7047. * @private
  7048. * @param {*} value The value to check.
  7049. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7050. */
  7051. var isMaskable = coreJsData ? isFunction : stubFalse;
  7052. /**
  7053. * Checks if `value` is likely a prototype object.
  7054. *
  7055. * @private
  7056. * @param {*} value The value to check.
  7057. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7058. */
  7059. function isPrototype(value) {
  7060. var Ctor = value && value.constructor,
  7061. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7062. return value === proto;
  7063. }
  7064. /**
  7065. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7066. *
  7067. * @private
  7068. * @param {*} value The value to check.
  7069. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7070. * equality comparisons, else `false`.
  7071. */
  7072. function isStrictComparable(value) {
  7073. return value === value && !isObject(value);
  7074. }
  7075. /**
  7076. * A specialized version of `matchesProperty` for source values suitable
  7077. * for strict equality comparisons, i.e. `===`.
  7078. *
  7079. * @private
  7080. * @param {string} key The key of the property to get.
  7081. * @param {*} srcValue The value to match.
  7082. * @returns {Function} Returns the new spec function.
  7083. */
  7084. function matchesStrictComparable(key, srcValue) {
  7085. return function(object) {
  7086. if (object == null) {
  7087. return false;
  7088. }
  7089. return object[key] === srcValue &&
  7090. (srcValue !== undefined || (key in Object(object)));
  7091. };
  7092. }
  7093. /**
  7094. * A specialized version of `_.memoize` which clears the memoized function's
  7095. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7096. *
  7097. * @private
  7098. * @param {Function} func The function to have its output memoized.
  7099. * @returns {Function} Returns the new memoized function.
  7100. */
  7101. function memoizeCapped(func) {
  7102. var result = memoize(func, function(key) {
  7103. if (cache.size === MAX_MEMOIZE_SIZE) {
  7104. cache.clear();
  7105. }
  7106. return key;
  7107. });
  7108. var cache = result.cache;
  7109. return result;
  7110. }
  7111. /**
  7112. * Merges the function metadata of `source` into `data`.
  7113. *
  7114. * Merging metadata reduces the number of wrappers used to invoke a function.
  7115. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7116. * may be applied regardless of execution order. Methods like `_.ary` and
  7117. * `_.rearg` modify function arguments, making the order in which they are
  7118. * executed important, preventing the merging of metadata. However, we make
  7119. * an exception for a safe combined case where curried functions have `_.ary`
  7120. * and or `_.rearg` applied.
  7121. *
  7122. * @private
  7123. * @param {Array} data The destination metadata.
  7124. * @param {Array} source The source metadata.
  7125. * @returns {Array} Returns `data`.
  7126. */
  7127. function mergeData(data, source) {
  7128. var bitmask = data[1],
  7129. srcBitmask = source[1],
  7130. newBitmask = bitmask | srcBitmask,
  7131. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7132. var isCombo =
  7133. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7134. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7135. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7136. // Exit early if metadata can't be merged.
  7137. if (!(isCommon || isCombo)) {
  7138. return data;
  7139. }
  7140. // Use source `thisArg` if available.
  7141. if (srcBitmask & WRAP_BIND_FLAG) {
  7142. data[2] = source[2];
  7143. // Set when currying a bound function.
  7144. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7145. }
  7146. // Compose partial arguments.
  7147. var value = source[3];
  7148. if (value) {
  7149. var partials = data[3];
  7150. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7151. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7152. }
  7153. // Compose partial right arguments.
  7154. value = source[5];
  7155. if (value) {
  7156. partials = data[5];
  7157. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7158. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7159. }
  7160. // Use source `argPos` if available.
  7161. value = source[7];
  7162. if (value) {
  7163. data[7] = value;
  7164. }
  7165. // Use source `ary` if it's smaller.
  7166. if (srcBitmask & WRAP_ARY_FLAG) {
  7167. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7168. }
  7169. // Use source `arity` if one is not provided.
  7170. if (data[9] == null) {
  7171. data[9] = source[9];
  7172. }
  7173. // Use source `func` and merge bitmasks.
  7174. data[0] = source[0];
  7175. data[1] = newBitmask;
  7176. return data;
  7177. }
  7178. /**
  7179. * This function is like
  7180. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7181. * except that it includes inherited enumerable properties.
  7182. *
  7183. * @private
  7184. * @param {Object} object The object to query.
  7185. * @returns {Array} Returns the array of property names.
  7186. */
  7187. function nativeKeysIn(object) {
  7188. var result = [];
  7189. if (object != null) {
  7190. for (var key in Object(object)) {
  7191. result.push(key);
  7192. }
  7193. }
  7194. return result;
  7195. }
  7196. /**
  7197. * Converts `value` to a string using `Object.prototype.toString`.
  7198. *
  7199. * @private
  7200. * @param {*} value The value to convert.
  7201. * @returns {string} Returns the converted string.
  7202. */
  7203. function objectToString(value) {
  7204. return nativeObjectToString.call(value);
  7205. }
  7206. /**
  7207. * A specialized version of `baseRest` which transforms the rest array.
  7208. *
  7209. * @private
  7210. * @param {Function} func The function to apply a rest parameter to.
  7211. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7212. * @param {Function} transform The rest array transform.
  7213. * @returns {Function} Returns the new function.
  7214. */
  7215. function overRest(func, start, transform) {
  7216. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7217. return function() {
  7218. var args = arguments,
  7219. index = -1,
  7220. length = nativeMax(args.length - start, 0),
  7221. array = Array(length);
  7222. while (++index < length) {
  7223. array[index] = args[start + index];
  7224. }
  7225. index = -1;
  7226. var otherArgs = Array(start + 1);
  7227. while (++index < start) {
  7228. otherArgs[index] = args[index];
  7229. }
  7230. otherArgs[start] = transform(array);
  7231. return apply(func, this, otherArgs);
  7232. };
  7233. }
  7234. /**
  7235. * Gets the parent value at `path` of `object`.
  7236. *
  7237. * @private
  7238. * @param {Object} object The object to query.
  7239. * @param {Array} path The path to get the parent value of.
  7240. * @returns {*} Returns the parent value.
  7241. */
  7242. function parent(object, path) {
  7243. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7244. }
  7245. /**
  7246. * Reorder `array` according to the specified indexes where the element at
  7247. * the first index is assigned as the first element, the element at
  7248. * the second index is assigned as the second element, and so on.
  7249. *
  7250. * @private
  7251. * @param {Array} array The array to reorder.
  7252. * @param {Array} indexes The arranged array indexes.
  7253. * @returns {Array} Returns `array`.
  7254. */
  7255. function reorder(array, indexes) {
  7256. var arrLength = array.length,
  7257. length = nativeMin(indexes.length, arrLength),
  7258. oldArray = copyArray(array);
  7259. while (length--) {
  7260. var index = indexes[length];
  7261. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7262. }
  7263. return array;
  7264. }
  7265. /**
  7266. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7267. *
  7268. * @private
  7269. * @param {Object} object The object to query.
  7270. * @param {string} key The key of the property to get.
  7271. * @returns {*} Returns the property value.
  7272. */
  7273. function safeGet(object, key) {
  7274. if (key === 'constructor' && typeof object[key] === 'function') {
  7275. return;
  7276. }
  7277. if (key == '__proto__') {
  7278. return;
  7279. }
  7280. return object[key];
  7281. }
  7282. /**
  7283. * Sets metadata for `func`.
  7284. *
  7285. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7286. * period of time, it will trip its breaker and transition to an identity
  7287. * function to avoid garbage collection pauses in V8. See
  7288. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7289. * for more details.
  7290. *
  7291. * @private
  7292. * @param {Function} func The function to associate metadata with.
  7293. * @param {*} data The metadata.
  7294. * @returns {Function} Returns `func`.
  7295. */
  7296. var setData = shortOut(baseSetData);
  7297. /**
  7298. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7299. *
  7300. * @private
  7301. * @param {Function} func The function to delay.
  7302. * @param {number} wait The number of milliseconds to delay invocation.
  7303. * @returns {number|Object} Returns the timer id or timeout object.
  7304. */
  7305. var setTimeout = ctxSetTimeout || function(func, wait) {
  7306. return root.setTimeout(func, wait);
  7307. };
  7308. /**
  7309. * Sets the `toString` method of `func` to return `string`.
  7310. *
  7311. * @private
  7312. * @param {Function} func The function to modify.
  7313. * @param {Function} string The `toString` result.
  7314. * @returns {Function} Returns `func`.
  7315. */
  7316. var setToString = shortOut(baseSetToString);
  7317. /**
  7318. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7319. * with wrapper details in a comment at the top of the source body.
  7320. *
  7321. * @private
  7322. * @param {Function} wrapper The function to modify.
  7323. * @param {Function} reference The reference function.
  7324. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7325. * @returns {Function} Returns `wrapper`.
  7326. */
  7327. function setWrapToString(wrapper, reference, bitmask) {
  7328. var source = (reference + '');
  7329. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7330. }
  7331. /**
  7332. * Creates a function that'll short out and invoke `identity` instead
  7333. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7334. * milliseconds.
  7335. *
  7336. * @private
  7337. * @param {Function} func The function to restrict.
  7338. * @returns {Function} Returns the new shortable function.
  7339. */
  7340. function shortOut(func) {
  7341. var count = 0,
  7342. lastCalled = 0;
  7343. return function() {
  7344. var stamp = nativeNow(),
  7345. remaining = HOT_SPAN - (stamp - lastCalled);
  7346. lastCalled = stamp;
  7347. if (remaining > 0) {
  7348. if (++count >= HOT_COUNT) {
  7349. return arguments[0];
  7350. }
  7351. } else {
  7352. count = 0;
  7353. }
  7354. return func.apply(undefined, arguments);
  7355. };
  7356. }
  7357. /**
  7358. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7359. *
  7360. * @private
  7361. * @param {Array} array The array to shuffle.
  7362. * @param {number} [size=array.length] The size of `array`.
  7363. * @returns {Array} Returns `array`.
  7364. */
  7365. function shuffleSelf(array, size) {
  7366. var index = -1,
  7367. length = array.length,
  7368. lastIndex = length - 1;
  7369. size = size === undefined ? length : size;
  7370. while (++index < size) {
  7371. var rand = baseRandom(index, lastIndex),
  7372. value = array[rand];
  7373. array[rand] = array[index];
  7374. array[index] = value;
  7375. }
  7376. array.length = size;
  7377. return array;
  7378. }
  7379. /**
  7380. * Converts `string` to a property path array.
  7381. *
  7382. * @private
  7383. * @param {string} string The string to convert.
  7384. * @returns {Array} Returns the property path array.
  7385. */
  7386. var stringToPath = memoizeCapped(function(string) {
  7387. var result = [];
  7388. if (string.charCodeAt(0) === 46 /* . */) {
  7389. result.push('');
  7390. }
  7391. string.replace(rePropName, function(match, number, quote, subString) {
  7392. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7393. });
  7394. return result;
  7395. });
  7396. /**
  7397. * Converts `value` to a string key if it's not a string or symbol.
  7398. *
  7399. * @private
  7400. * @param {*} value The value to inspect.
  7401. * @returns {string|symbol} Returns the key.
  7402. */
  7403. function toKey(value) {
  7404. if (typeof value == 'string' || isSymbol(value)) {
  7405. return value;
  7406. }
  7407. var result = (value + '');
  7408. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7409. }
  7410. /**
  7411. * Converts `func` to its source code.
  7412. *
  7413. * @private
  7414. * @param {Function} func The function to convert.
  7415. * @returns {string} Returns the source code.
  7416. */
  7417. function toSource(func) {
  7418. if (func != null) {
  7419. try {
  7420. return funcToString.call(func);
  7421. } catch (e) {}
  7422. try {
  7423. return (func + '');
  7424. } catch (e) {}
  7425. }
  7426. return '';
  7427. }
  7428. /**
  7429. * Updates wrapper `details` based on `bitmask` flags.
  7430. *
  7431. * @private
  7432. * @returns {Array} details The details to modify.
  7433. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7434. * @returns {Array} Returns `details`.
  7435. */
  7436. function updateWrapDetails(details, bitmask) {
  7437. arrayEach(wrapFlags, function(pair) {
  7438. var value = '_.' + pair[0];
  7439. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7440. details.push(value);
  7441. }
  7442. });
  7443. return details.sort();
  7444. }
  7445. /**
  7446. * Creates a clone of `wrapper`.
  7447. *
  7448. * @private
  7449. * @param {Object} wrapper The wrapper to clone.
  7450. * @returns {Object} Returns the cloned wrapper.
  7451. */
  7452. function wrapperClone(wrapper) {
  7453. if (wrapper instanceof LazyWrapper) {
  7454. return wrapper.clone();
  7455. }
  7456. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7457. result.__actions__ = copyArray(wrapper.__actions__);
  7458. result.__index__ = wrapper.__index__;
  7459. result.__values__ = wrapper.__values__;
  7460. return result;
  7461. }
  7462. /*------------------------------------------------------------------------*/
  7463. /**
  7464. * Creates an array of elements split into groups the length of `size`.
  7465. * If `array` can't be split evenly, the final chunk will be the remaining
  7466. * elements.
  7467. *
  7468. * @static
  7469. * @memberOf _
  7470. * @since 3.0.0
  7471. * @category Array
  7472. * @param {Array} array The array to process.
  7473. * @param {number} [size=1] The length of each chunk
  7474. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7475. * @returns {Array} Returns the new array of chunks.
  7476. * @example
  7477. *
  7478. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7479. * // => [['a', 'b'], ['c', 'd']]
  7480. *
  7481. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7482. * // => [['a', 'b', 'c'], ['d']]
  7483. */
  7484. function chunk(array, size, guard) {
  7485. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7486. size = 1;
  7487. } else {
  7488. size = nativeMax(toInteger(size), 0);
  7489. }
  7490. var length = array == null ? 0 : array.length;
  7491. if (!length || size < 1) {
  7492. return [];
  7493. }
  7494. var index = 0,
  7495. resIndex = 0,
  7496. result = Array(nativeCeil(length / size));
  7497. while (index < length) {
  7498. result[resIndex++] = baseSlice(array, index, (index += size));
  7499. }
  7500. return result;
  7501. }
  7502. /**
  7503. * Creates an array with all falsey values removed. The values `false`, `null`,
  7504. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7505. *
  7506. * @static
  7507. * @memberOf _
  7508. * @since 0.1.0
  7509. * @category Array
  7510. * @param {Array} array The array to compact.
  7511. * @returns {Array} Returns the new array of filtered values.
  7512. * @example
  7513. *
  7514. * _.compact([0, 1, false, 2, '', 3]);
  7515. * // => [1, 2, 3]
  7516. */
  7517. function compact(array) {
  7518. var index = -1,
  7519. length = array == null ? 0 : array.length,
  7520. resIndex = 0,
  7521. result = [];
  7522. while (++index < length) {
  7523. var value = array[index];
  7524. if (value) {
  7525. result[resIndex++] = value;
  7526. }
  7527. }
  7528. return result;
  7529. }
  7530. /**
  7531. * Creates a new array concatenating `array` with any additional arrays
  7532. * and/or values.
  7533. *
  7534. * @static
  7535. * @memberOf _
  7536. * @since 4.0.0
  7537. * @category Array
  7538. * @param {Array} array The array to concatenate.
  7539. * @param {...*} [values] The values to concatenate.
  7540. * @returns {Array} Returns the new concatenated array.
  7541. * @example
  7542. *
  7543. * var array = [1];
  7544. * var other = _.concat(array, 2, [3], [[4]]);
  7545. *
  7546. * console.log(other);
  7547. * // => [1, 2, 3, [4]]
  7548. *
  7549. * console.log(array);
  7550. * // => [1]
  7551. */
  7552. function concat() {
  7553. var length = arguments.length;
  7554. if (!length) {
  7555. return [];
  7556. }
  7557. var args = Array(length - 1),
  7558. array = arguments[0],
  7559. index = length;
  7560. while (index--) {
  7561. args[index - 1] = arguments[index];
  7562. }
  7563. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7564. }
  7565. /**
  7566. * Creates an array of `array` values not included in the other given arrays
  7567. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7568. * for equality comparisons. The order and references of result values are
  7569. * determined by the first array.
  7570. *
  7571. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7572. *
  7573. * @static
  7574. * @memberOf _
  7575. * @since 0.1.0
  7576. * @category Array
  7577. * @param {Array} array The array to inspect.
  7578. * @param {...Array} [values] The values to exclude.
  7579. * @returns {Array} Returns the new array of filtered values.
  7580. * @see _.without, _.xor
  7581. * @example
  7582. *
  7583. * _.difference([2, 1], [2, 3]);
  7584. * // => [1]
  7585. */
  7586. var difference = baseRest(function(array, values) {
  7587. return isArrayLikeObject(array)
  7588. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7589. : [];
  7590. });
  7591. /**
  7592. * This method is like `_.difference` except that it accepts `iteratee` which
  7593. * is invoked for each element of `array` and `values` to generate the criterion
  7594. * by which they're compared. The order and references of result values are
  7595. * determined by the first array. The iteratee is invoked with one argument:
  7596. * (value).
  7597. *
  7598. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7599. *
  7600. * @static
  7601. * @memberOf _
  7602. * @since 4.0.0
  7603. * @category Array
  7604. * @param {Array} array The array to inspect.
  7605. * @param {...Array} [values] The values to exclude.
  7606. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7607. * @returns {Array} Returns the new array of filtered values.
  7608. * @example
  7609. *
  7610. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7611. * // => [1.2]
  7612. *
  7613. * // The `_.property` iteratee shorthand.
  7614. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7615. * // => [{ 'x': 2 }]
  7616. */
  7617. var differenceBy = baseRest(function(array, values) {
  7618. var iteratee = last(values);
  7619. if (isArrayLikeObject(iteratee)) {
  7620. iteratee = undefined;
  7621. }
  7622. return isArrayLikeObject(array)
  7623. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7624. : [];
  7625. });
  7626. /**
  7627. * This method is like `_.difference` except that it accepts `comparator`
  7628. * which is invoked to compare elements of `array` to `values`. The order and
  7629. * references of result values are determined by the first array. The comparator
  7630. * is invoked with two arguments: (arrVal, othVal).
  7631. *
  7632. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7633. *
  7634. * @static
  7635. * @memberOf _
  7636. * @since 4.0.0
  7637. * @category Array
  7638. * @param {Array} array The array to inspect.
  7639. * @param {...Array} [values] The values to exclude.
  7640. * @param {Function} [comparator] The comparator invoked per element.
  7641. * @returns {Array} Returns the new array of filtered values.
  7642. * @example
  7643. *
  7644. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7645. *
  7646. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7647. * // => [{ 'x': 2, 'y': 1 }]
  7648. */
  7649. var differenceWith = baseRest(function(array, values) {
  7650. var comparator = last(values);
  7651. if (isArrayLikeObject(comparator)) {
  7652. comparator = undefined;
  7653. }
  7654. return isArrayLikeObject(array)
  7655. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7656. : [];
  7657. });
  7658. /**
  7659. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7660. *
  7661. * @static
  7662. * @memberOf _
  7663. * @since 0.5.0
  7664. * @category Array
  7665. * @param {Array} array The array to query.
  7666. * @param {number} [n=1] The number of elements to drop.
  7667. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7668. * @returns {Array} Returns the slice of `array`.
  7669. * @example
  7670. *
  7671. * _.drop([1, 2, 3]);
  7672. * // => [2, 3]
  7673. *
  7674. * _.drop([1, 2, 3], 2);
  7675. * // => [3]
  7676. *
  7677. * _.drop([1, 2, 3], 5);
  7678. * // => []
  7679. *
  7680. * _.drop([1, 2, 3], 0);
  7681. * // => [1, 2, 3]
  7682. */
  7683. function drop(array, n, guard) {
  7684. var length = array == null ? 0 : array.length;
  7685. if (!length) {
  7686. return [];
  7687. }
  7688. n = (guard || n === undefined) ? 1 : toInteger(n);
  7689. return baseSlice(array, n < 0 ? 0 : n, length);
  7690. }
  7691. /**
  7692. * Creates a slice of `array` with `n` elements dropped from the end.
  7693. *
  7694. * @static
  7695. * @memberOf _
  7696. * @since 3.0.0
  7697. * @category Array
  7698. * @param {Array} array The array to query.
  7699. * @param {number} [n=1] The number of elements to drop.
  7700. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7701. * @returns {Array} Returns the slice of `array`.
  7702. * @example
  7703. *
  7704. * _.dropRight([1, 2, 3]);
  7705. * // => [1, 2]
  7706. *
  7707. * _.dropRight([1, 2, 3], 2);
  7708. * // => [1]
  7709. *
  7710. * _.dropRight([1, 2, 3], 5);
  7711. * // => []
  7712. *
  7713. * _.dropRight([1, 2, 3], 0);
  7714. * // => [1, 2, 3]
  7715. */
  7716. function dropRight(array, n, guard) {
  7717. var length = array == null ? 0 : array.length;
  7718. if (!length) {
  7719. return [];
  7720. }
  7721. n = (guard || n === undefined) ? 1 : toInteger(n);
  7722. n = length - n;
  7723. return baseSlice(array, 0, n < 0 ? 0 : n);
  7724. }
  7725. /**
  7726. * Creates a slice of `array` excluding elements dropped from the end.
  7727. * Elements are dropped until `predicate` returns falsey. The predicate is
  7728. * invoked with three arguments: (value, index, array).
  7729. *
  7730. * @static
  7731. * @memberOf _
  7732. * @since 3.0.0
  7733. * @category Array
  7734. * @param {Array} array The array to query.
  7735. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7736. * @returns {Array} Returns the slice of `array`.
  7737. * @example
  7738. *
  7739. * var users = [
  7740. * { 'user': 'barney', 'active': true },
  7741. * { 'user': 'fred', 'active': false },
  7742. * { 'user': 'pebbles', 'active': false }
  7743. * ];
  7744. *
  7745. * _.dropRightWhile(users, function(o) { return !o.active; });
  7746. * // => objects for ['barney']
  7747. *
  7748. * // The `_.matches` iteratee shorthand.
  7749. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7750. * // => objects for ['barney', 'fred']
  7751. *
  7752. * // The `_.matchesProperty` iteratee shorthand.
  7753. * _.dropRightWhile(users, ['active', false]);
  7754. * // => objects for ['barney']
  7755. *
  7756. * // The `_.property` iteratee shorthand.
  7757. * _.dropRightWhile(users, 'active');
  7758. * // => objects for ['barney', 'fred', 'pebbles']
  7759. */
  7760. function dropRightWhile(array, predicate) {
  7761. return (array && array.length)
  7762. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7763. : [];
  7764. }
  7765. /**
  7766. * Creates a slice of `array` excluding elements dropped from the beginning.
  7767. * Elements are dropped until `predicate` returns falsey. The predicate is
  7768. * invoked with three arguments: (value, index, array).
  7769. *
  7770. * @static
  7771. * @memberOf _
  7772. * @since 3.0.0
  7773. * @category Array
  7774. * @param {Array} array The array to query.
  7775. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7776. * @returns {Array} Returns the slice of `array`.
  7777. * @example
  7778. *
  7779. * var users = [
  7780. * { 'user': 'barney', 'active': false },
  7781. * { 'user': 'fred', 'active': false },
  7782. * { 'user': 'pebbles', 'active': true }
  7783. * ];
  7784. *
  7785. * _.dropWhile(users, function(o) { return !o.active; });
  7786. * // => objects for ['pebbles']
  7787. *
  7788. * // The `_.matches` iteratee shorthand.
  7789. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7790. * // => objects for ['fred', 'pebbles']
  7791. *
  7792. * // The `_.matchesProperty` iteratee shorthand.
  7793. * _.dropWhile(users, ['active', false]);
  7794. * // => objects for ['pebbles']
  7795. *
  7796. * // The `_.property` iteratee shorthand.
  7797. * _.dropWhile(users, 'active');
  7798. * // => objects for ['barney', 'fred', 'pebbles']
  7799. */
  7800. function dropWhile(array, predicate) {
  7801. return (array && array.length)
  7802. ? baseWhile(array, getIteratee(predicate, 3), true)
  7803. : [];
  7804. }
  7805. /**
  7806. * Fills elements of `array` with `value` from `start` up to, but not
  7807. * including, `end`.
  7808. *
  7809. * **Note:** This method mutates `array`.
  7810. *
  7811. * @static
  7812. * @memberOf _
  7813. * @since 3.2.0
  7814. * @category Array
  7815. * @param {Array} array The array to fill.
  7816. * @param {*} value The value to fill `array` with.
  7817. * @param {number} [start=0] The start position.
  7818. * @param {number} [end=array.length] The end position.
  7819. * @returns {Array} Returns `array`.
  7820. * @example
  7821. *
  7822. * var array = [1, 2, 3];
  7823. *
  7824. * _.fill(array, 'a');
  7825. * console.log(array);
  7826. * // => ['a', 'a', 'a']
  7827. *
  7828. * _.fill(Array(3), 2);
  7829. * // => [2, 2, 2]
  7830. *
  7831. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7832. * // => [4, '*', '*', 10]
  7833. */
  7834. function fill(array, value, start, end) {
  7835. var length = array == null ? 0 : array.length;
  7836. if (!length) {
  7837. return [];
  7838. }
  7839. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7840. start = 0;
  7841. end = length;
  7842. }
  7843. return baseFill(array, value, start, end);
  7844. }
  7845. /**
  7846. * This method is like `_.find` except that it returns the index of the first
  7847. * element `predicate` returns truthy for instead of the element itself.
  7848. *
  7849. * @static
  7850. * @memberOf _
  7851. * @since 1.1.0
  7852. * @category Array
  7853. * @param {Array} array The array to inspect.
  7854. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7855. * @param {number} [fromIndex=0] The index to search from.
  7856. * @returns {number} Returns the index of the found element, else `-1`.
  7857. * @example
  7858. *
  7859. * var users = [
  7860. * { 'user': 'barney', 'active': false },
  7861. * { 'user': 'fred', 'active': false },
  7862. * { 'user': 'pebbles', 'active': true }
  7863. * ];
  7864. *
  7865. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7866. * // => 0
  7867. *
  7868. * // The `_.matches` iteratee shorthand.
  7869. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7870. * // => 1
  7871. *
  7872. * // The `_.matchesProperty` iteratee shorthand.
  7873. * _.findIndex(users, ['active', false]);
  7874. * // => 0
  7875. *
  7876. * // The `_.property` iteratee shorthand.
  7877. * _.findIndex(users, 'active');
  7878. * // => 2
  7879. */
  7880. function findIndex(array, predicate, fromIndex) {
  7881. var length = array == null ? 0 : array.length;
  7882. if (!length) {
  7883. return -1;
  7884. }
  7885. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7886. if (index < 0) {
  7887. index = nativeMax(length + index, 0);
  7888. }
  7889. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7890. }
  7891. /**
  7892. * This method is like `_.findIndex` except that it iterates over elements
  7893. * of `collection` from right to left.
  7894. *
  7895. * @static
  7896. * @memberOf _
  7897. * @since 2.0.0
  7898. * @category Array
  7899. * @param {Array} array The array to inspect.
  7900. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7901. * @param {number} [fromIndex=array.length-1] The index to search from.
  7902. * @returns {number} Returns the index of the found element, else `-1`.
  7903. * @example
  7904. *
  7905. * var users = [
  7906. * { 'user': 'barney', 'active': true },
  7907. * { 'user': 'fred', 'active': false },
  7908. * { 'user': 'pebbles', 'active': false }
  7909. * ];
  7910. *
  7911. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7912. * // => 2
  7913. *
  7914. * // The `_.matches` iteratee shorthand.
  7915. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7916. * // => 0
  7917. *
  7918. * // The `_.matchesProperty` iteratee shorthand.
  7919. * _.findLastIndex(users, ['active', false]);
  7920. * // => 2
  7921. *
  7922. * // The `_.property` iteratee shorthand.
  7923. * _.findLastIndex(users, 'active');
  7924. * // => 0
  7925. */
  7926. function findLastIndex(array, predicate, fromIndex) {
  7927. var length = array == null ? 0 : array.length;
  7928. if (!length) {
  7929. return -1;
  7930. }
  7931. var index = length - 1;
  7932. if (fromIndex !== undefined) {
  7933. index = toInteger(fromIndex);
  7934. index = fromIndex < 0
  7935. ? nativeMax(length + index, 0)
  7936. : nativeMin(index, length - 1);
  7937. }
  7938. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7939. }
  7940. /**
  7941. * Flattens `array` a single level deep.
  7942. *
  7943. * @static
  7944. * @memberOf _
  7945. * @since 0.1.0
  7946. * @category Array
  7947. * @param {Array} array The array to flatten.
  7948. * @returns {Array} Returns the new flattened array.
  7949. * @example
  7950. *
  7951. * _.flatten([1, [2, [3, [4]], 5]]);
  7952. * // => [1, 2, [3, [4]], 5]
  7953. */
  7954. function flatten(array) {
  7955. var length = array == null ? 0 : array.length;
  7956. return length ? baseFlatten(array, 1) : [];
  7957. }
  7958. /**
  7959. * Recursively flattens `array`.
  7960. *
  7961. * @static
  7962. * @memberOf _
  7963. * @since 3.0.0
  7964. * @category Array
  7965. * @param {Array} array The array to flatten.
  7966. * @returns {Array} Returns the new flattened array.
  7967. * @example
  7968. *
  7969. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7970. * // => [1, 2, 3, 4, 5]
  7971. */
  7972. function flattenDeep(array) {
  7973. var length = array == null ? 0 : array.length;
  7974. return length ? baseFlatten(array, INFINITY) : [];
  7975. }
  7976. /**
  7977. * Recursively flatten `array` up to `depth` times.
  7978. *
  7979. * @static
  7980. * @memberOf _
  7981. * @since 4.4.0
  7982. * @category Array
  7983. * @param {Array} array The array to flatten.
  7984. * @param {number} [depth=1] The maximum recursion depth.
  7985. * @returns {Array} Returns the new flattened array.
  7986. * @example
  7987. *
  7988. * var array = [1, [2, [3, [4]], 5]];
  7989. *
  7990. * _.flattenDepth(array, 1);
  7991. * // => [1, 2, [3, [4]], 5]
  7992. *
  7993. * _.flattenDepth(array, 2);
  7994. * // => [1, 2, 3, [4], 5]
  7995. */
  7996. function flattenDepth(array, depth) {
  7997. var length = array == null ? 0 : array.length;
  7998. if (!length) {
  7999. return [];
  8000. }
  8001. depth = depth === undefined ? 1 : toInteger(depth);
  8002. return baseFlatten(array, depth);
  8003. }
  8004. /**
  8005. * The inverse of `_.toPairs`; this method returns an object composed
  8006. * from key-value `pairs`.
  8007. *
  8008. * @static
  8009. * @memberOf _
  8010. * @since 4.0.0
  8011. * @category Array
  8012. * @param {Array} pairs The key-value pairs.
  8013. * @returns {Object} Returns the new object.
  8014. * @example
  8015. *
  8016. * _.fromPairs([['a', 1], ['b', 2]]);
  8017. * // => { 'a': 1, 'b': 2 }
  8018. */
  8019. function fromPairs(pairs) {
  8020. var index = -1,
  8021. length = pairs == null ? 0 : pairs.length,
  8022. result = {};
  8023. while (++index < length) {
  8024. var pair = pairs[index];
  8025. result[pair[0]] = pair[1];
  8026. }
  8027. return result;
  8028. }
  8029. /**
  8030. * Gets the first element of `array`.
  8031. *
  8032. * @static
  8033. * @memberOf _
  8034. * @since 0.1.0
  8035. * @alias first
  8036. * @category Array
  8037. * @param {Array} array The array to query.
  8038. * @returns {*} Returns the first element of `array`.
  8039. * @example
  8040. *
  8041. * _.head([1, 2, 3]);
  8042. * // => 1
  8043. *
  8044. * _.head([]);
  8045. * // => undefined
  8046. */
  8047. function head(array) {
  8048. return (array && array.length) ? array[0] : undefined;
  8049. }
  8050. /**
  8051. * Gets the index at which the first occurrence of `value` is found in `array`
  8052. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8053. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8054. * offset from the end of `array`.
  8055. *
  8056. * @static
  8057. * @memberOf _
  8058. * @since 0.1.0
  8059. * @category Array
  8060. * @param {Array} array The array to inspect.
  8061. * @param {*} value The value to search for.
  8062. * @param {number} [fromIndex=0] The index to search from.
  8063. * @returns {number} Returns the index of the matched value, else `-1`.
  8064. * @example
  8065. *
  8066. * _.indexOf([1, 2, 1, 2], 2);
  8067. * // => 1
  8068. *
  8069. * // Search from the `fromIndex`.
  8070. * _.indexOf([1, 2, 1, 2], 2, 2);
  8071. * // => 3
  8072. */
  8073. function indexOf(array, value, fromIndex) {
  8074. var length = array == null ? 0 : array.length;
  8075. if (!length) {
  8076. return -1;
  8077. }
  8078. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8079. if (index < 0) {
  8080. index = nativeMax(length + index, 0);
  8081. }
  8082. return baseIndexOf(array, value, index);
  8083. }
  8084. /**
  8085. * Gets all but the last element of `array`.
  8086. *
  8087. * @static
  8088. * @memberOf _
  8089. * @since 0.1.0
  8090. * @category Array
  8091. * @param {Array} array The array to query.
  8092. * @returns {Array} Returns the slice of `array`.
  8093. * @example
  8094. *
  8095. * _.initial([1, 2, 3]);
  8096. * // => [1, 2]
  8097. */
  8098. function initial(array) {
  8099. var length = array == null ? 0 : array.length;
  8100. return length ? baseSlice(array, 0, -1) : [];
  8101. }
  8102. /**
  8103. * Creates an array of unique values that are included in all given arrays
  8104. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8105. * for equality comparisons. The order and references of result values are
  8106. * determined by the first array.
  8107. *
  8108. * @static
  8109. * @memberOf _
  8110. * @since 0.1.0
  8111. * @category Array
  8112. * @param {...Array} [arrays] The arrays to inspect.
  8113. * @returns {Array} Returns the new array of intersecting values.
  8114. * @example
  8115. *
  8116. * _.intersection([2, 1], [2, 3]);
  8117. * // => [2]
  8118. */
  8119. var intersection = baseRest(function(arrays) {
  8120. var mapped = arrayMap(arrays, castArrayLikeObject);
  8121. return (mapped.length && mapped[0] === arrays[0])
  8122. ? baseIntersection(mapped)
  8123. : [];
  8124. });
  8125. /**
  8126. * This method is like `_.intersection` except that it accepts `iteratee`
  8127. * which is invoked for each element of each `arrays` to generate the criterion
  8128. * by which they're compared. The order and references of result values are
  8129. * determined by the first array. The iteratee is invoked with one argument:
  8130. * (value).
  8131. *
  8132. * @static
  8133. * @memberOf _
  8134. * @since 4.0.0
  8135. * @category Array
  8136. * @param {...Array} [arrays] The arrays to inspect.
  8137. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8138. * @returns {Array} Returns the new array of intersecting values.
  8139. * @example
  8140. *
  8141. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8142. * // => [2.1]
  8143. *
  8144. * // The `_.property` iteratee shorthand.
  8145. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8146. * // => [{ 'x': 1 }]
  8147. */
  8148. var intersectionBy = baseRest(function(arrays) {
  8149. var iteratee = last(arrays),
  8150. mapped = arrayMap(arrays, castArrayLikeObject);
  8151. if (iteratee === last(mapped)) {
  8152. iteratee = undefined;
  8153. } else {
  8154. mapped.pop();
  8155. }
  8156. return (mapped.length && mapped[0] === arrays[0])
  8157. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8158. : [];
  8159. });
  8160. /**
  8161. * This method is like `_.intersection` except that it accepts `comparator`
  8162. * which is invoked to compare elements of `arrays`. The order and references
  8163. * of result values are determined by the first array. The comparator is
  8164. * invoked with two arguments: (arrVal, othVal).
  8165. *
  8166. * @static
  8167. * @memberOf _
  8168. * @since 4.0.0
  8169. * @category Array
  8170. * @param {...Array} [arrays] The arrays to inspect.
  8171. * @param {Function} [comparator] The comparator invoked per element.
  8172. * @returns {Array} Returns the new array of intersecting values.
  8173. * @example
  8174. *
  8175. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8176. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8177. *
  8178. * _.intersectionWith(objects, others, _.isEqual);
  8179. * // => [{ 'x': 1, 'y': 2 }]
  8180. */
  8181. var intersectionWith = baseRest(function(arrays) {
  8182. var comparator = last(arrays),
  8183. mapped = arrayMap(arrays, castArrayLikeObject);
  8184. comparator = typeof comparator == 'function' ? comparator : undefined;
  8185. if (comparator) {
  8186. mapped.pop();
  8187. }
  8188. return (mapped.length && mapped[0] === arrays[0])
  8189. ? baseIntersection(mapped, undefined, comparator)
  8190. : [];
  8191. });
  8192. /**
  8193. * Converts all elements in `array` into a string separated by `separator`.
  8194. *
  8195. * @static
  8196. * @memberOf _
  8197. * @since 4.0.0
  8198. * @category Array
  8199. * @param {Array} array The array to convert.
  8200. * @param {string} [separator=','] The element separator.
  8201. * @returns {string} Returns the joined string.
  8202. * @example
  8203. *
  8204. * _.join(['a', 'b', 'c'], '~');
  8205. * // => 'a~b~c'
  8206. */
  8207. function join(array, separator) {
  8208. return array == null ? '' : nativeJoin.call(array, separator);
  8209. }
  8210. /**
  8211. * Gets the last element of `array`.
  8212. *
  8213. * @static
  8214. * @memberOf _
  8215. * @since 0.1.0
  8216. * @category Array
  8217. * @param {Array} array The array to query.
  8218. * @returns {*} Returns the last element of `array`.
  8219. * @example
  8220. *
  8221. * _.last([1, 2, 3]);
  8222. * // => 3
  8223. */
  8224. function last(array) {
  8225. var length = array == null ? 0 : array.length;
  8226. return length ? array[length - 1] : undefined;
  8227. }
  8228. /**
  8229. * This method is like `_.indexOf` except that it iterates over elements of
  8230. * `array` from right to left.
  8231. *
  8232. * @static
  8233. * @memberOf _
  8234. * @since 0.1.0
  8235. * @category Array
  8236. * @param {Array} array The array to inspect.
  8237. * @param {*} value The value to search for.
  8238. * @param {number} [fromIndex=array.length-1] The index to search from.
  8239. * @returns {number} Returns the index of the matched value, else `-1`.
  8240. * @example
  8241. *
  8242. * _.lastIndexOf([1, 2, 1, 2], 2);
  8243. * // => 3
  8244. *
  8245. * // Search from the `fromIndex`.
  8246. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8247. * // => 1
  8248. */
  8249. function lastIndexOf(array, value, fromIndex) {
  8250. var length = array == null ? 0 : array.length;
  8251. if (!length) {
  8252. return -1;
  8253. }
  8254. var index = length;
  8255. if (fromIndex !== undefined) {
  8256. index = toInteger(fromIndex);
  8257. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8258. }
  8259. return value === value
  8260. ? strictLastIndexOf(array, value, index)
  8261. : baseFindIndex(array, baseIsNaN, index, true);
  8262. }
  8263. /**
  8264. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8265. * element from the end is returned.
  8266. *
  8267. * @static
  8268. * @memberOf _
  8269. * @since 4.11.0
  8270. * @category Array
  8271. * @param {Array} array The array to query.
  8272. * @param {number} [n=0] The index of the element to return.
  8273. * @returns {*} Returns the nth element of `array`.
  8274. * @example
  8275. *
  8276. * var array = ['a', 'b', 'c', 'd'];
  8277. *
  8278. * _.nth(array, 1);
  8279. * // => 'b'
  8280. *
  8281. * _.nth(array, -2);
  8282. * // => 'c';
  8283. */
  8284. function nth(array, n) {
  8285. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8286. }
  8287. /**
  8288. * Removes all given values from `array` using
  8289. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8290. * for equality comparisons.
  8291. *
  8292. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8293. * to remove elements from an array by predicate.
  8294. *
  8295. * @static
  8296. * @memberOf _
  8297. * @since 2.0.0
  8298. * @category Array
  8299. * @param {Array} array The array to modify.
  8300. * @param {...*} [values] The values to remove.
  8301. * @returns {Array} Returns `array`.
  8302. * @example
  8303. *
  8304. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8305. *
  8306. * _.pull(array, 'a', 'c');
  8307. * console.log(array);
  8308. * // => ['b', 'b']
  8309. */
  8310. var pull = baseRest(pullAll);
  8311. /**
  8312. * This method is like `_.pull` except that it accepts an array of values to remove.
  8313. *
  8314. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8315. *
  8316. * @static
  8317. * @memberOf _
  8318. * @since 4.0.0
  8319. * @category Array
  8320. * @param {Array} array The array to modify.
  8321. * @param {Array} values The values to remove.
  8322. * @returns {Array} Returns `array`.
  8323. * @example
  8324. *
  8325. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8326. *
  8327. * _.pullAll(array, ['a', 'c']);
  8328. * console.log(array);
  8329. * // => ['b', 'b']
  8330. */
  8331. function pullAll(array, values) {
  8332. return (array && array.length && values && values.length)
  8333. ? basePullAll(array, values)
  8334. : array;
  8335. }
  8336. /**
  8337. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8338. * invoked for each element of `array` and `values` to generate the criterion
  8339. * by which they're compared. The iteratee is invoked with one argument: (value).
  8340. *
  8341. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8342. *
  8343. * @static
  8344. * @memberOf _
  8345. * @since 4.0.0
  8346. * @category Array
  8347. * @param {Array} array The array to modify.
  8348. * @param {Array} values The values to remove.
  8349. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8350. * @returns {Array} Returns `array`.
  8351. * @example
  8352. *
  8353. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8354. *
  8355. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8356. * console.log(array);
  8357. * // => [{ 'x': 2 }]
  8358. */
  8359. function pullAllBy(array, values, iteratee) {
  8360. return (array && array.length && values && values.length)
  8361. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8362. : array;
  8363. }
  8364. /**
  8365. * This method is like `_.pullAll` except that it accepts `comparator` which
  8366. * is invoked to compare elements of `array` to `values`. The comparator is
  8367. * invoked with two arguments: (arrVal, othVal).
  8368. *
  8369. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8370. *
  8371. * @static
  8372. * @memberOf _
  8373. * @since 4.6.0
  8374. * @category Array
  8375. * @param {Array} array The array to modify.
  8376. * @param {Array} values The values to remove.
  8377. * @param {Function} [comparator] The comparator invoked per element.
  8378. * @returns {Array} Returns `array`.
  8379. * @example
  8380. *
  8381. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8382. *
  8383. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8384. * console.log(array);
  8385. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8386. */
  8387. function pullAllWith(array, values, comparator) {
  8388. return (array && array.length && values && values.length)
  8389. ? basePullAll(array, values, undefined, comparator)
  8390. : array;
  8391. }
  8392. /**
  8393. * Removes elements from `array` corresponding to `indexes` and returns an
  8394. * array of removed elements.
  8395. *
  8396. * **Note:** Unlike `_.at`, this method mutates `array`.
  8397. *
  8398. * @static
  8399. * @memberOf _
  8400. * @since 3.0.0
  8401. * @category Array
  8402. * @param {Array} array The array to modify.
  8403. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8404. * @returns {Array} Returns the new array of removed elements.
  8405. * @example
  8406. *
  8407. * var array = ['a', 'b', 'c', 'd'];
  8408. * var pulled = _.pullAt(array, [1, 3]);
  8409. *
  8410. * console.log(array);
  8411. * // => ['a', 'c']
  8412. *
  8413. * console.log(pulled);
  8414. * // => ['b', 'd']
  8415. */
  8416. var pullAt = flatRest(function(array, indexes) {
  8417. var length = array == null ? 0 : array.length,
  8418. result = baseAt(array, indexes);
  8419. basePullAt(array, arrayMap(indexes, function(index) {
  8420. return isIndex(index, length) ? +index : index;
  8421. }).sort(compareAscending));
  8422. return result;
  8423. });
  8424. /**
  8425. * Removes all elements from `array` that `predicate` returns truthy for
  8426. * and returns an array of the removed elements. The predicate is invoked
  8427. * with three arguments: (value, index, array).
  8428. *
  8429. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8430. * to pull elements from an array by value.
  8431. *
  8432. * @static
  8433. * @memberOf _
  8434. * @since 2.0.0
  8435. * @category Array
  8436. * @param {Array} array The array to modify.
  8437. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8438. * @returns {Array} Returns the new array of removed elements.
  8439. * @example
  8440. *
  8441. * var array = [1, 2, 3, 4];
  8442. * var evens = _.remove(array, function(n) {
  8443. * return n % 2 == 0;
  8444. * });
  8445. *
  8446. * console.log(array);
  8447. * // => [1, 3]
  8448. *
  8449. * console.log(evens);
  8450. * // => [2, 4]
  8451. */
  8452. function remove(array, predicate) {
  8453. var result = [];
  8454. if (!(array && array.length)) {
  8455. return result;
  8456. }
  8457. var index = -1,
  8458. indexes = [],
  8459. length = array.length;
  8460. predicate = getIteratee(predicate, 3);
  8461. while (++index < length) {
  8462. var value = array[index];
  8463. if (predicate(value, index, array)) {
  8464. result.push(value);
  8465. indexes.push(index);
  8466. }
  8467. }
  8468. basePullAt(array, indexes);
  8469. return result;
  8470. }
  8471. /**
  8472. * Reverses `array` so that the first element becomes the last, the second
  8473. * element becomes the second to last, and so on.
  8474. *
  8475. * **Note:** This method mutates `array` and is based on
  8476. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8477. *
  8478. * @static
  8479. * @memberOf _
  8480. * @since 4.0.0
  8481. * @category Array
  8482. * @param {Array} array The array to modify.
  8483. * @returns {Array} Returns `array`.
  8484. * @example
  8485. *
  8486. * var array = [1, 2, 3];
  8487. *
  8488. * _.reverse(array);
  8489. * // => [3, 2, 1]
  8490. *
  8491. * console.log(array);
  8492. * // => [3, 2, 1]
  8493. */
  8494. function reverse(array) {
  8495. return array == null ? array : nativeReverse.call(array);
  8496. }
  8497. /**
  8498. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8499. *
  8500. * **Note:** This method is used instead of
  8501. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8502. * returned.
  8503. *
  8504. * @static
  8505. * @memberOf _
  8506. * @since 3.0.0
  8507. * @category Array
  8508. * @param {Array} array The array to slice.
  8509. * @param {number} [start=0] The start position.
  8510. * @param {number} [end=array.length] The end position.
  8511. * @returns {Array} Returns the slice of `array`.
  8512. */
  8513. function slice(array, start, end) {
  8514. var length = array == null ? 0 : array.length;
  8515. if (!length) {
  8516. return [];
  8517. }
  8518. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8519. start = 0;
  8520. end = length;
  8521. }
  8522. else {
  8523. start = start == null ? 0 : toInteger(start);
  8524. end = end === undefined ? length : toInteger(end);
  8525. }
  8526. return baseSlice(array, start, end);
  8527. }
  8528. /**
  8529. * Uses a binary search to determine the lowest index at which `value`
  8530. * should be inserted into `array` in order to maintain its sort order.
  8531. *
  8532. * @static
  8533. * @memberOf _
  8534. * @since 0.1.0
  8535. * @category Array
  8536. * @param {Array} array The sorted array to inspect.
  8537. * @param {*} value The value to evaluate.
  8538. * @returns {number} Returns the index at which `value` should be inserted
  8539. * into `array`.
  8540. * @example
  8541. *
  8542. * _.sortedIndex([30, 50], 40);
  8543. * // => 1
  8544. */
  8545. function sortedIndex(array, value) {
  8546. return baseSortedIndex(array, value);
  8547. }
  8548. /**
  8549. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8550. * which is invoked for `value` and each element of `array` to compute their
  8551. * sort ranking. The iteratee is invoked with one argument: (value).
  8552. *
  8553. * @static
  8554. * @memberOf _
  8555. * @since 4.0.0
  8556. * @category Array
  8557. * @param {Array} array The sorted array to inspect.
  8558. * @param {*} value The value to evaluate.
  8559. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8560. * @returns {number} Returns the index at which `value` should be inserted
  8561. * into `array`.
  8562. * @example
  8563. *
  8564. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8565. *
  8566. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8567. * // => 0
  8568. *
  8569. * // The `_.property` iteratee shorthand.
  8570. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8571. * // => 0
  8572. */
  8573. function sortedIndexBy(array, value, iteratee) {
  8574. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8575. }
  8576. /**
  8577. * This method is like `_.indexOf` except that it performs a binary
  8578. * search on a sorted `array`.
  8579. *
  8580. * @static
  8581. * @memberOf _
  8582. * @since 4.0.0
  8583. * @category Array
  8584. * @param {Array} array The array to inspect.
  8585. * @param {*} value The value to search for.
  8586. * @returns {number} Returns the index of the matched value, else `-1`.
  8587. * @example
  8588. *
  8589. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8590. * // => 1
  8591. */
  8592. function sortedIndexOf(array, value) {
  8593. var length = array == null ? 0 : array.length;
  8594. if (length) {
  8595. var index = baseSortedIndex(array, value);
  8596. if (index < length && eq(array[index], value)) {
  8597. return index;
  8598. }
  8599. }
  8600. return -1;
  8601. }
  8602. /**
  8603. * This method is like `_.sortedIndex` except that it returns the highest
  8604. * index at which `value` should be inserted into `array` in order to
  8605. * maintain its sort order.
  8606. *
  8607. * @static
  8608. * @memberOf _
  8609. * @since 3.0.0
  8610. * @category Array
  8611. * @param {Array} array The sorted array to inspect.
  8612. * @param {*} value The value to evaluate.
  8613. * @returns {number} Returns the index at which `value` should be inserted
  8614. * into `array`.
  8615. * @example
  8616. *
  8617. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8618. * // => 4
  8619. */
  8620. function sortedLastIndex(array, value) {
  8621. return baseSortedIndex(array, value, true);
  8622. }
  8623. /**
  8624. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8625. * which is invoked for `value` and each element of `array` to compute their
  8626. * sort ranking. The iteratee is invoked with one argument: (value).
  8627. *
  8628. * @static
  8629. * @memberOf _
  8630. * @since 4.0.0
  8631. * @category Array
  8632. * @param {Array} array The sorted array to inspect.
  8633. * @param {*} value The value to evaluate.
  8634. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8635. * @returns {number} Returns the index at which `value` should be inserted
  8636. * into `array`.
  8637. * @example
  8638. *
  8639. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8640. *
  8641. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8642. * // => 1
  8643. *
  8644. * // The `_.property` iteratee shorthand.
  8645. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8646. * // => 1
  8647. */
  8648. function sortedLastIndexBy(array, value, iteratee) {
  8649. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8650. }
  8651. /**
  8652. * This method is like `_.lastIndexOf` except that it performs a binary
  8653. * search on a sorted `array`.
  8654. *
  8655. * @static
  8656. * @memberOf _
  8657. * @since 4.0.0
  8658. * @category Array
  8659. * @param {Array} array The array to inspect.
  8660. * @param {*} value The value to search for.
  8661. * @returns {number} Returns the index of the matched value, else `-1`.
  8662. * @example
  8663. *
  8664. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8665. * // => 3
  8666. */
  8667. function sortedLastIndexOf(array, value) {
  8668. var length = array == null ? 0 : array.length;
  8669. if (length) {
  8670. var index = baseSortedIndex(array, value, true) - 1;
  8671. if (eq(array[index], value)) {
  8672. return index;
  8673. }
  8674. }
  8675. return -1;
  8676. }
  8677. /**
  8678. * This method is like `_.uniq` except that it's designed and optimized
  8679. * for sorted arrays.
  8680. *
  8681. * @static
  8682. * @memberOf _
  8683. * @since 4.0.0
  8684. * @category Array
  8685. * @param {Array} array The array to inspect.
  8686. * @returns {Array} Returns the new duplicate free array.
  8687. * @example
  8688. *
  8689. * _.sortedUniq([1, 1, 2]);
  8690. * // => [1, 2]
  8691. */
  8692. function sortedUniq(array) {
  8693. return (array && array.length)
  8694. ? baseSortedUniq(array)
  8695. : [];
  8696. }
  8697. /**
  8698. * This method is like `_.uniqBy` except that it's designed and optimized
  8699. * for sorted arrays.
  8700. *
  8701. * @static
  8702. * @memberOf _
  8703. * @since 4.0.0
  8704. * @category Array
  8705. * @param {Array} array The array to inspect.
  8706. * @param {Function} [iteratee] The iteratee invoked per element.
  8707. * @returns {Array} Returns the new duplicate free array.
  8708. * @example
  8709. *
  8710. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8711. * // => [1.1, 2.3]
  8712. */
  8713. function sortedUniqBy(array, iteratee) {
  8714. return (array && array.length)
  8715. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8716. : [];
  8717. }
  8718. /**
  8719. * Gets all but the first element of `array`.
  8720. *
  8721. * @static
  8722. * @memberOf _
  8723. * @since 4.0.0
  8724. * @category Array
  8725. * @param {Array} array The array to query.
  8726. * @returns {Array} Returns the slice of `array`.
  8727. * @example
  8728. *
  8729. * _.tail([1, 2, 3]);
  8730. * // => [2, 3]
  8731. */
  8732. function tail(array) {
  8733. var length = array == null ? 0 : array.length;
  8734. return length ? baseSlice(array, 1, length) : [];
  8735. }
  8736. /**
  8737. * Creates a slice of `array` with `n` elements taken from the beginning.
  8738. *
  8739. * @static
  8740. * @memberOf _
  8741. * @since 0.1.0
  8742. * @category Array
  8743. * @param {Array} array The array to query.
  8744. * @param {number} [n=1] The number of elements to take.
  8745. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8746. * @returns {Array} Returns the slice of `array`.
  8747. * @example
  8748. *
  8749. * _.take([1, 2, 3]);
  8750. * // => [1]
  8751. *
  8752. * _.take([1, 2, 3], 2);
  8753. * // => [1, 2]
  8754. *
  8755. * _.take([1, 2, 3], 5);
  8756. * // => [1, 2, 3]
  8757. *
  8758. * _.take([1, 2, 3], 0);
  8759. * // => []
  8760. */
  8761. function take(array, n, guard) {
  8762. if (!(array && array.length)) {
  8763. return [];
  8764. }
  8765. n = (guard || n === undefined) ? 1 : toInteger(n);
  8766. return baseSlice(array, 0, n < 0 ? 0 : n);
  8767. }
  8768. /**
  8769. * Creates a slice of `array` with `n` elements taken from the end.
  8770. *
  8771. * @static
  8772. * @memberOf _
  8773. * @since 3.0.0
  8774. * @category Array
  8775. * @param {Array} array The array to query.
  8776. * @param {number} [n=1] The number of elements to take.
  8777. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8778. * @returns {Array} Returns the slice of `array`.
  8779. * @example
  8780. *
  8781. * _.takeRight([1, 2, 3]);
  8782. * // => [3]
  8783. *
  8784. * _.takeRight([1, 2, 3], 2);
  8785. * // => [2, 3]
  8786. *
  8787. * _.takeRight([1, 2, 3], 5);
  8788. * // => [1, 2, 3]
  8789. *
  8790. * _.takeRight([1, 2, 3], 0);
  8791. * // => []
  8792. */
  8793. function takeRight(array, n, guard) {
  8794. var length = array == null ? 0 : array.length;
  8795. if (!length) {
  8796. return [];
  8797. }
  8798. n = (guard || n === undefined) ? 1 : toInteger(n);
  8799. n = length - n;
  8800. return baseSlice(array, n < 0 ? 0 : n, length);
  8801. }
  8802. /**
  8803. * Creates a slice of `array` with elements taken from the end. Elements are
  8804. * taken until `predicate` returns falsey. The predicate is invoked with
  8805. * three arguments: (value, index, array).
  8806. *
  8807. * @static
  8808. * @memberOf _
  8809. * @since 3.0.0
  8810. * @category Array
  8811. * @param {Array} array The array to query.
  8812. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8813. * @returns {Array} Returns the slice of `array`.
  8814. * @example
  8815. *
  8816. * var users = [
  8817. * { 'user': 'barney', 'active': true },
  8818. * { 'user': 'fred', 'active': false },
  8819. * { 'user': 'pebbles', 'active': false }
  8820. * ];
  8821. *
  8822. * _.takeRightWhile(users, function(o) { return !o.active; });
  8823. * // => objects for ['fred', 'pebbles']
  8824. *
  8825. * // The `_.matches` iteratee shorthand.
  8826. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8827. * // => objects for ['pebbles']
  8828. *
  8829. * // The `_.matchesProperty` iteratee shorthand.
  8830. * _.takeRightWhile(users, ['active', false]);
  8831. * // => objects for ['fred', 'pebbles']
  8832. *
  8833. * // The `_.property` iteratee shorthand.
  8834. * _.takeRightWhile(users, 'active');
  8835. * // => []
  8836. */
  8837. function takeRightWhile(array, predicate) {
  8838. return (array && array.length)
  8839. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8840. : [];
  8841. }
  8842. /**
  8843. * Creates a slice of `array` with elements taken from the beginning. Elements
  8844. * are taken until `predicate` returns falsey. The predicate is invoked with
  8845. * three arguments: (value, index, array).
  8846. *
  8847. * @static
  8848. * @memberOf _
  8849. * @since 3.0.0
  8850. * @category Array
  8851. * @param {Array} array The array to query.
  8852. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8853. * @returns {Array} Returns the slice of `array`.
  8854. * @example
  8855. *
  8856. * var users = [
  8857. * { 'user': 'barney', 'active': false },
  8858. * { 'user': 'fred', 'active': false },
  8859. * { 'user': 'pebbles', 'active': true }
  8860. * ];
  8861. *
  8862. * _.takeWhile(users, function(o) { return !o.active; });
  8863. * // => objects for ['barney', 'fred']
  8864. *
  8865. * // The `_.matches` iteratee shorthand.
  8866. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8867. * // => objects for ['barney']
  8868. *
  8869. * // The `_.matchesProperty` iteratee shorthand.
  8870. * _.takeWhile(users, ['active', false]);
  8871. * // => objects for ['barney', 'fred']
  8872. *
  8873. * // The `_.property` iteratee shorthand.
  8874. * _.takeWhile(users, 'active');
  8875. * // => []
  8876. */
  8877. function takeWhile(array, predicate) {
  8878. return (array && array.length)
  8879. ? baseWhile(array, getIteratee(predicate, 3))
  8880. : [];
  8881. }
  8882. /**
  8883. * Creates an array of unique values, in order, from all given arrays using
  8884. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8885. * for equality comparisons.
  8886. *
  8887. * @static
  8888. * @memberOf _
  8889. * @since 0.1.0
  8890. * @category Array
  8891. * @param {...Array} [arrays] The arrays to inspect.
  8892. * @returns {Array} Returns the new array of combined values.
  8893. * @example
  8894. *
  8895. * _.union([2], [1, 2]);
  8896. * // => [2, 1]
  8897. */
  8898. var union = baseRest(function(arrays) {
  8899. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8900. });
  8901. /**
  8902. * This method is like `_.union` except that it accepts `iteratee` which is
  8903. * invoked for each element of each `arrays` to generate the criterion by
  8904. * which uniqueness is computed. Result values are chosen from the first
  8905. * array in which the value occurs. The iteratee is invoked with one argument:
  8906. * (value).
  8907. *
  8908. * @static
  8909. * @memberOf _
  8910. * @since 4.0.0
  8911. * @category Array
  8912. * @param {...Array} [arrays] The arrays to inspect.
  8913. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8914. * @returns {Array} Returns the new array of combined values.
  8915. * @example
  8916. *
  8917. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8918. * // => [2.1, 1.2]
  8919. *
  8920. * // The `_.property` iteratee shorthand.
  8921. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8922. * // => [{ 'x': 1 }, { 'x': 2 }]
  8923. */
  8924. var unionBy = baseRest(function(arrays) {
  8925. var iteratee = last(arrays);
  8926. if (isArrayLikeObject(iteratee)) {
  8927. iteratee = undefined;
  8928. }
  8929. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8930. });
  8931. /**
  8932. * This method is like `_.union` except that it accepts `comparator` which
  8933. * is invoked to compare elements of `arrays`. Result values are chosen from
  8934. * the first array in which the value occurs. The comparator is invoked
  8935. * with two arguments: (arrVal, othVal).
  8936. *
  8937. * @static
  8938. * @memberOf _
  8939. * @since 4.0.0
  8940. * @category Array
  8941. * @param {...Array} [arrays] The arrays to inspect.
  8942. * @param {Function} [comparator] The comparator invoked per element.
  8943. * @returns {Array} Returns the new array of combined values.
  8944. * @example
  8945. *
  8946. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8947. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8948. *
  8949. * _.unionWith(objects, others, _.isEqual);
  8950. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8951. */
  8952. var unionWith = baseRest(function(arrays) {
  8953. var comparator = last(arrays);
  8954. comparator = typeof comparator == 'function' ? comparator : undefined;
  8955. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8956. });
  8957. /**
  8958. * Creates a duplicate-free version of an array, using
  8959. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8960. * for equality comparisons, in which only the first occurrence of each element
  8961. * is kept. The order of result values is determined by the order they occur
  8962. * in the array.
  8963. *
  8964. * @static
  8965. * @memberOf _
  8966. * @since 0.1.0
  8967. * @category Array
  8968. * @param {Array} array The array to inspect.
  8969. * @returns {Array} Returns the new duplicate free array.
  8970. * @example
  8971. *
  8972. * _.uniq([2, 1, 2]);
  8973. * // => [2, 1]
  8974. */
  8975. function uniq(array) {
  8976. return (array && array.length) ? baseUniq(array) : [];
  8977. }
  8978. /**
  8979. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8980. * invoked for each element in `array` to generate the criterion by which
  8981. * uniqueness is computed. The order of result values is determined by the
  8982. * order they occur in the array. The iteratee is invoked with one argument:
  8983. * (value).
  8984. *
  8985. * @static
  8986. * @memberOf _
  8987. * @since 4.0.0
  8988. * @category Array
  8989. * @param {Array} array The array to inspect.
  8990. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8991. * @returns {Array} Returns the new duplicate free array.
  8992. * @example
  8993. *
  8994. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8995. * // => [2.1, 1.2]
  8996. *
  8997. * // The `_.property` iteratee shorthand.
  8998. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8999. * // => [{ 'x': 1 }, { 'x': 2 }]
  9000. */
  9001. function uniqBy(array, iteratee) {
  9002. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9003. }
  9004. /**
  9005. * This method is like `_.uniq` except that it accepts `comparator` which
  9006. * is invoked to compare elements of `array`. The order of result values is
  9007. * determined by the order they occur in the array.The comparator is invoked
  9008. * with two arguments: (arrVal, othVal).
  9009. *
  9010. * @static
  9011. * @memberOf _
  9012. * @since 4.0.0
  9013. * @category Array
  9014. * @param {Array} array The array to inspect.
  9015. * @param {Function} [comparator] The comparator invoked per element.
  9016. * @returns {Array} Returns the new duplicate free array.
  9017. * @example
  9018. *
  9019. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9020. *
  9021. * _.uniqWith(objects, _.isEqual);
  9022. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9023. */
  9024. function uniqWith(array, comparator) {
  9025. comparator = typeof comparator == 'function' ? comparator : undefined;
  9026. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9027. }
  9028. /**
  9029. * This method is like `_.zip` except that it accepts an array of grouped
  9030. * elements and creates an array regrouping the elements to their pre-zip
  9031. * configuration.
  9032. *
  9033. * @static
  9034. * @memberOf _
  9035. * @since 1.2.0
  9036. * @category Array
  9037. * @param {Array} array The array of grouped elements to process.
  9038. * @returns {Array} Returns the new array of regrouped elements.
  9039. * @example
  9040. *
  9041. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9042. * // => [['a', 1, true], ['b', 2, false]]
  9043. *
  9044. * _.unzip(zipped);
  9045. * // => [['a', 'b'], [1, 2], [true, false]]
  9046. */
  9047. function unzip(array) {
  9048. if (!(array && array.length)) {
  9049. return [];
  9050. }
  9051. var length = 0;
  9052. array = arrayFilter(array, function(group) {
  9053. if (isArrayLikeObject(group)) {
  9054. length = nativeMax(group.length, length);
  9055. return true;
  9056. }
  9057. });
  9058. return baseTimes(length, function(index) {
  9059. return arrayMap(array, baseProperty(index));
  9060. });
  9061. }
  9062. /**
  9063. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9064. * how regrouped values should be combined. The iteratee is invoked with the
  9065. * elements of each group: (...group).
  9066. *
  9067. * @static
  9068. * @memberOf _
  9069. * @since 3.8.0
  9070. * @category Array
  9071. * @param {Array} array The array of grouped elements to process.
  9072. * @param {Function} [iteratee=_.identity] The function to combine
  9073. * regrouped values.
  9074. * @returns {Array} Returns the new array of regrouped elements.
  9075. * @example
  9076. *
  9077. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9078. * // => [[1, 10, 100], [2, 20, 200]]
  9079. *
  9080. * _.unzipWith(zipped, _.add);
  9081. * // => [3, 30, 300]
  9082. */
  9083. function unzipWith(array, iteratee) {
  9084. if (!(array && array.length)) {
  9085. return [];
  9086. }
  9087. var result = unzip(array);
  9088. if (iteratee == null) {
  9089. return result;
  9090. }
  9091. return arrayMap(result, function(group) {
  9092. return apply(iteratee, undefined, group);
  9093. });
  9094. }
  9095. /**
  9096. * Creates an array excluding all given values using
  9097. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9098. * for equality comparisons.
  9099. *
  9100. * **Note:** Unlike `_.pull`, this method returns a new array.
  9101. *
  9102. * @static
  9103. * @memberOf _
  9104. * @since 0.1.0
  9105. * @category Array
  9106. * @param {Array} array The array to inspect.
  9107. * @param {...*} [values] The values to exclude.
  9108. * @returns {Array} Returns the new array of filtered values.
  9109. * @see _.difference, _.xor
  9110. * @example
  9111. *
  9112. * _.without([2, 1, 2, 3], 1, 2);
  9113. * // => [3]
  9114. */
  9115. var without = baseRest(function(array, values) {
  9116. return isArrayLikeObject(array)
  9117. ? baseDifference(array, values)
  9118. : [];
  9119. });
  9120. /**
  9121. * Creates an array of unique values that is the
  9122. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9123. * of the given arrays. The order of result values is determined by the order
  9124. * they occur in the arrays.
  9125. *
  9126. * @static
  9127. * @memberOf _
  9128. * @since 2.4.0
  9129. * @category Array
  9130. * @param {...Array} [arrays] The arrays to inspect.
  9131. * @returns {Array} Returns the new array of filtered values.
  9132. * @see _.difference, _.without
  9133. * @example
  9134. *
  9135. * _.xor([2, 1], [2, 3]);
  9136. * // => [1, 3]
  9137. */
  9138. var xor = baseRest(function(arrays) {
  9139. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9140. });
  9141. /**
  9142. * This method is like `_.xor` except that it accepts `iteratee` which is
  9143. * invoked for each element of each `arrays` to generate the criterion by
  9144. * which by which they're compared. The order of result values is determined
  9145. * by the order they occur in the arrays. The iteratee is invoked with one
  9146. * argument: (value).
  9147. *
  9148. * @static
  9149. * @memberOf _
  9150. * @since 4.0.0
  9151. * @category Array
  9152. * @param {...Array} [arrays] The arrays to inspect.
  9153. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9154. * @returns {Array} Returns the new array of filtered values.
  9155. * @example
  9156. *
  9157. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9158. * // => [1.2, 3.4]
  9159. *
  9160. * // The `_.property` iteratee shorthand.
  9161. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9162. * // => [{ 'x': 2 }]
  9163. */
  9164. var xorBy = baseRest(function(arrays) {
  9165. var iteratee = last(arrays);
  9166. if (isArrayLikeObject(iteratee)) {
  9167. iteratee = undefined;
  9168. }
  9169. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9170. });
  9171. /**
  9172. * This method is like `_.xor` except that it accepts `comparator` which is
  9173. * invoked to compare elements of `arrays`. The order of result values is
  9174. * determined by the order they occur in the arrays. The comparator is invoked
  9175. * with two arguments: (arrVal, othVal).
  9176. *
  9177. * @static
  9178. * @memberOf _
  9179. * @since 4.0.0
  9180. * @category Array
  9181. * @param {...Array} [arrays] The arrays to inspect.
  9182. * @param {Function} [comparator] The comparator invoked per element.
  9183. * @returns {Array} Returns the new array of filtered values.
  9184. * @example
  9185. *
  9186. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9187. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9188. *
  9189. * _.xorWith(objects, others, _.isEqual);
  9190. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9191. */
  9192. var xorWith = baseRest(function(arrays) {
  9193. var comparator = last(arrays);
  9194. comparator = typeof comparator == 'function' ? comparator : undefined;
  9195. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9196. });
  9197. /**
  9198. * Creates an array of grouped elements, the first of which contains the
  9199. * first elements of the given arrays, the second of which contains the
  9200. * second elements of the given arrays, and so on.
  9201. *
  9202. * @static
  9203. * @memberOf _
  9204. * @since 0.1.0
  9205. * @category Array
  9206. * @param {...Array} [arrays] The arrays to process.
  9207. * @returns {Array} Returns the new array of grouped elements.
  9208. * @example
  9209. *
  9210. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9211. * // => [['a', 1, true], ['b', 2, false]]
  9212. */
  9213. var zip = baseRest(unzip);
  9214. /**
  9215. * This method is like `_.fromPairs` except that it accepts two arrays,
  9216. * one of property identifiers and one of corresponding values.
  9217. *
  9218. * @static
  9219. * @memberOf _
  9220. * @since 0.4.0
  9221. * @category Array
  9222. * @param {Array} [props=[]] The property identifiers.
  9223. * @param {Array} [values=[]] The property values.
  9224. * @returns {Object} Returns the new object.
  9225. * @example
  9226. *
  9227. * _.zipObject(['a', 'b'], [1, 2]);
  9228. * // => { 'a': 1, 'b': 2 }
  9229. */
  9230. function zipObject(props, values) {
  9231. return baseZipObject(props || [], values || [], assignValue);
  9232. }
  9233. /**
  9234. * This method is like `_.zipObject` except that it supports property paths.
  9235. *
  9236. * @static
  9237. * @memberOf _
  9238. * @since 4.1.0
  9239. * @category Array
  9240. * @param {Array} [props=[]] The property identifiers.
  9241. * @param {Array} [values=[]] The property values.
  9242. * @returns {Object} Returns the new object.
  9243. * @example
  9244. *
  9245. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9246. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9247. */
  9248. function zipObjectDeep(props, values) {
  9249. return baseZipObject(props || [], values || [], baseSet);
  9250. }
  9251. /**
  9252. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9253. * how grouped values should be combined. The iteratee is invoked with the
  9254. * elements of each group: (...group).
  9255. *
  9256. * @static
  9257. * @memberOf _
  9258. * @since 3.8.0
  9259. * @category Array
  9260. * @param {...Array} [arrays] The arrays to process.
  9261. * @param {Function} [iteratee=_.identity] The function to combine
  9262. * grouped values.
  9263. * @returns {Array} Returns the new array of grouped elements.
  9264. * @example
  9265. *
  9266. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9267. * return a + b + c;
  9268. * });
  9269. * // => [111, 222]
  9270. */
  9271. var zipWith = baseRest(function(arrays) {
  9272. var length = arrays.length,
  9273. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9274. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9275. return unzipWith(arrays, iteratee);
  9276. });
  9277. /*------------------------------------------------------------------------*/
  9278. /**
  9279. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9280. * chain sequences enabled. The result of such sequences must be unwrapped
  9281. * with `_#value`.
  9282. *
  9283. * @static
  9284. * @memberOf _
  9285. * @since 1.3.0
  9286. * @category Seq
  9287. * @param {*} value The value to wrap.
  9288. * @returns {Object} Returns the new `lodash` wrapper instance.
  9289. * @example
  9290. *
  9291. * var users = [
  9292. * { 'user': 'barney', 'age': 36 },
  9293. * { 'user': 'fred', 'age': 40 },
  9294. * { 'user': 'pebbles', 'age': 1 }
  9295. * ];
  9296. *
  9297. * var youngest = _
  9298. * .chain(users)
  9299. * .sortBy('age')
  9300. * .map(function(o) {
  9301. * return o.user + ' is ' + o.age;
  9302. * })
  9303. * .head()
  9304. * .value();
  9305. * // => 'pebbles is 1'
  9306. */
  9307. function chain(value) {
  9308. var result = lodash(value);
  9309. result.__chain__ = true;
  9310. return result;
  9311. }
  9312. /**
  9313. * This method invokes `interceptor` and returns `value`. The interceptor
  9314. * is invoked with one argument; (value). The purpose of this method is to
  9315. * "tap into" a method chain sequence in order to modify intermediate results.
  9316. *
  9317. * @static
  9318. * @memberOf _
  9319. * @since 0.1.0
  9320. * @category Seq
  9321. * @param {*} value The value to provide to `interceptor`.
  9322. * @param {Function} interceptor The function to invoke.
  9323. * @returns {*} Returns `value`.
  9324. * @example
  9325. *
  9326. * _([1, 2, 3])
  9327. * .tap(function(array) {
  9328. * // Mutate input array.
  9329. * array.pop();
  9330. * })
  9331. * .reverse()
  9332. * .value();
  9333. * // => [2, 1]
  9334. */
  9335. function tap(value, interceptor) {
  9336. interceptor(value);
  9337. return value;
  9338. }
  9339. /**
  9340. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9341. * The purpose of this method is to "pass thru" values replacing intermediate
  9342. * results in a method chain sequence.
  9343. *
  9344. * @static
  9345. * @memberOf _
  9346. * @since 3.0.0
  9347. * @category Seq
  9348. * @param {*} value The value to provide to `interceptor`.
  9349. * @param {Function} interceptor The function to invoke.
  9350. * @returns {*} Returns the result of `interceptor`.
  9351. * @example
  9352. *
  9353. * _(' abc ')
  9354. * .chain()
  9355. * .trim()
  9356. * .thru(function(value) {
  9357. * return [value];
  9358. * })
  9359. * .value();
  9360. * // => ['abc']
  9361. */
  9362. function thru(value, interceptor) {
  9363. return interceptor(value);
  9364. }
  9365. /**
  9366. * This method is the wrapper version of `_.at`.
  9367. *
  9368. * @name at
  9369. * @memberOf _
  9370. * @since 1.0.0
  9371. * @category Seq
  9372. * @param {...(string|string[])} [paths] The property paths to pick.
  9373. * @returns {Object} Returns the new `lodash` wrapper instance.
  9374. * @example
  9375. *
  9376. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9377. *
  9378. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9379. * // => [3, 4]
  9380. */
  9381. var wrapperAt = flatRest(function(paths) {
  9382. var length = paths.length,
  9383. start = length ? paths[0] : 0,
  9384. value = this.__wrapped__,
  9385. interceptor = function(object) { return baseAt(object, paths); };
  9386. if (length > 1 || this.__actions__.length ||
  9387. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9388. return this.thru(interceptor);
  9389. }
  9390. value = value.slice(start, +start + (length ? 1 : 0));
  9391. value.__actions__.push({
  9392. 'func': thru,
  9393. 'args': [interceptor],
  9394. 'thisArg': undefined
  9395. });
  9396. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9397. if (length && !array.length) {
  9398. array.push(undefined);
  9399. }
  9400. return array;
  9401. });
  9402. });
  9403. /**
  9404. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9405. *
  9406. * @name chain
  9407. * @memberOf _
  9408. * @since 0.1.0
  9409. * @category Seq
  9410. * @returns {Object} Returns the new `lodash` wrapper instance.
  9411. * @example
  9412. *
  9413. * var users = [
  9414. * { 'user': 'barney', 'age': 36 },
  9415. * { 'user': 'fred', 'age': 40 }
  9416. * ];
  9417. *
  9418. * // A sequence without explicit chaining.
  9419. * _(users).head();
  9420. * // => { 'user': 'barney', 'age': 36 }
  9421. *
  9422. * // A sequence with explicit chaining.
  9423. * _(users)
  9424. * .chain()
  9425. * .head()
  9426. * .pick('user')
  9427. * .value();
  9428. * // => { 'user': 'barney' }
  9429. */
  9430. function wrapperChain() {
  9431. return chain(this);
  9432. }
  9433. /**
  9434. * Executes the chain sequence and returns the wrapped result.
  9435. *
  9436. * @name commit
  9437. * @memberOf _
  9438. * @since 3.2.0
  9439. * @category Seq
  9440. * @returns {Object} Returns the new `lodash` wrapper instance.
  9441. * @example
  9442. *
  9443. * var array = [1, 2];
  9444. * var wrapped = _(array).push(3);
  9445. *
  9446. * console.log(array);
  9447. * // => [1, 2]
  9448. *
  9449. * wrapped = wrapped.commit();
  9450. * console.log(array);
  9451. * // => [1, 2, 3]
  9452. *
  9453. * wrapped.last();
  9454. * // => 3
  9455. *
  9456. * console.log(array);
  9457. * // => [1, 2, 3]
  9458. */
  9459. function wrapperCommit() {
  9460. return new LodashWrapper(this.value(), this.__chain__);
  9461. }
  9462. /**
  9463. * Gets the next value on a wrapped object following the
  9464. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9465. *
  9466. * @name next
  9467. * @memberOf _
  9468. * @since 4.0.0
  9469. * @category Seq
  9470. * @returns {Object} Returns the next iterator value.
  9471. * @example
  9472. *
  9473. * var wrapped = _([1, 2]);
  9474. *
  9475. * wrapped.next();
  9476. * // => { 'done': false, 'value': 1 }
  9477. *
  9478. * wrapped.next();
  9479. * // => { 'done': false, 'value': 2 }
  9480. *
  9481. * wrapped.next();
  9482. * // => { 'done': true, 'value': undefined }
  9483. */
  9484. function wrapperNext() {
  9485. if (this.__values__ === undefined) {
  9486. this.__values__ = toArray(this.value());
  9487. }
  9488. var done = this.__index__ >= this.__values__.length,
  9489. value = done ? undefined : this.__values__[this.__index__++];
  9490. return { 'done': done, 'value': value };
  9491. }
  9492. /**
  9493. * Enables the wrapper to be iterable.
  9494. *
  9495. * @name Symbol.iterator
  9496. * @memberOf _
  9497. * @since 4.0.0
  9498. * @category Seq
  9499. * @returns {Object} Returns the wrapper object.
  9500. * @example
  9501. *
  9502. * var wrapped = _([1, 2]);
  9503. *
  9504. * wrapped[Symbol.iterator]() === wrapped;
  9505. * // => true
  9506. *
  9507. * Array.from(wrapped);
  9508. * // => [1, 2]
  9509. */
  9510. function wrapperToIterator() {
  9511. return this;
  9512. }
  9513. /**
  9514. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9515. *
  9516. * @name plant
  9517. * @memberOf _
  9518. * @since 3.2.0
  9519. * @category Seq
  9520. * @param {*} value The value to plant.
  9521. * @returns {Object} Returns the new `lodash` wrapper instance.
  9522. * @example
  9523. *
  9524. * function square(n) {
  9525. * return n * n;
  9526. * }
  9527. *
  9528. * var wrapped = _([1, 2]).map(square);
  9529. * var other = wrapped.plant([3, 4]);
  9530. *
  9531. * other.value();
  9532. * // => [9, 16]
  9533. *
  9534. * wrapped.value();
  9535. * // => [1, 4]
  9536. */
  9537. function wrapperPlant(value) {
  9538. var result,
  9539. parent = this;
  9540. while (parent instanceof baseLodash) {
  9541. var clone = wrapperClone(parent);
  9542. clone.__index__ = 0;
  9543. clone.__values__ = undefined;
  9544. if (result) {
  9545. previous.__wrapped__ = clone;
  9546. } else {
  9547. result = clone;
  9548. }
  9549. var previous = clone;
  9550. parent = parent.__wrapped__;
  9551. }
  9552. previous.__wrapped__ = value;
  9553. return result;
  9554. }
  9555. /**
  9556. * This method is the wrapper version of `_.reverse`.
  9557. *
  9558. * **Note:** This method mutates the wrapped array.
  9559. *
  9560. * @name reverse
  9561. * @memberOf _
  9562. * @since 0.1.0
  9563. * @category Seq
  9564. * @returns {Object} Returns the new `lodash` wrapper instance.
  9565. * @example
  9566. *
  9567. * var array = [1, 2, 3];
  9568. *
  9569. * _(array).reverse().value()
  9570. * // => [3, 2, 1]
  9571. *
  9572. * console.log(array);
  9573. * // => [3, 2, 1]
  9574. */
  9575. function wrapperReverse() {
  9576. var value = this.__wrapped__;
  9577. if (value instanceof LazyWrapper) {
  9578. var wrapped = value;
  9579. if (this.__actions__.length) {
  9580. wrapped = new LazyWrapper(this);
  9581. }
  9582. wrapped = wrapped.reverse();
  9583. wrapped.__actions__.push({
  9584. 'func': thru,
  9585. 'args': [reverse],
  9586. 'thisArg': undefined
  9587. });
  9588. return new LodashWrapper(wrapped, this.__chain__);
  9589. }
  9590. return this.thru(reverse);
  9591. }
  9592. /**
  9593. * Executes the chain sequence to resolve the unwrapped value.
  9594. *
  9595. * @name value
  9596. * @memberOf _
  9597. * @since 0.1.0
  9598. * @alias toJSON, valueOf
  9599. * @category Seq
  9600. * @returns {*} Returns the resolved unwrapped value.
  9601. * @example
  9602. *
  9603. * _([1, 2, 3]).value();
  9604. * // => [1, 2, 3]
  9605. */
  9606. function wrapperValue() {
  9607. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9608. }
  9609. /*------------------------------------------------------------------------*/
  9610. /**
  9611. * Creates an object composed of keys generated from the results of running
  9612. * each element of `collection` thru `iteratee`. The corresponding value of
  9613. * each key is the number of times the key was returned by `iteratee`. The
  9614. * iteratee is invoked with one argument: (value).
  9615. *
  9616. * @static
  9617. * @memberOf _
  9618. * @since 0.5.0
  9619. * @category Collection
  9620. * @param {Array|Object} collection The collection to iterate over.
  9621. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9622. * @returns {Object} Returns the composed aggregate object.
  9623. * @example
  9624. *
  9625. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9626. * // => { '4': 1, '6': 2 }
  9627. *
  9628. * // The `_.property` iteratee shorthand.
  9629. * _.countBy(['one', 'two', 'three'], 'length');
  9630. * // => { '3': 2, '5': 1 }
  9631. */
  9632. var countBy = createAggregator(function(result, value, key) {
  9633. if (hasOwnProperty.call(result, key)) {
  9634. ++result[key];
  9635. } else {
  9636. baseAssignValue(result, key, 1);
  9637. }
  9638. });
  9639. /**
  9640. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9641. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9642. * invoked with three arguments: (value, index|key, collection).
  9643. *
  9644. * **Note:** This method returns `true` for
  9645. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9646. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9647. * elements of empty collections.
  9648. *
  9649. * @static
  9650. * @memberOf _
  9651. * @since 0.1.0
  9652. * @category Collection
  9653. * @param {Array|Object} collection The collection to iterate over.
  9654. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9655. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9656. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9657. * else `false`.
  9658. * @example
  9659. *
  9660. * _.every([true, 1, null, 'yes'], Boolean);
  9661. * // => false
  9662. *
  9663. * var users = [
  9664. * { 'user': 'barney', 'age': 36, 'active': false },
  9665. * { 'user': 'fred', 'age': 40, 'active': false }
  9666. * ];
  9667. *
  9668. * // The `_.matches` iteratee shorthand.
  9669. * _.every(users, { 'user': 'barney', 'active': false });
  9670. * // => false
  9671. *
  9672. * // The `_.matchesProperty` iteratee shorthand.
  9673. * _.every(users, ['active', false]);
  9674. * // => true
  9675. *
  9676. * // The `_.property` iteratee shorthand.
  9677. * _.every(users, 'active');
  9678. * // => false
  9679. */
  9680. function every(collection, predicate, guard) {
  9681. var func = isArray(collection) ? arrayEvery : baseEvery;
  9682. if (guard && isIterateeCall(collection, predicate, guard)) {
  9683. predicate = undefined;
  9684. }
  9685. return func(collection, getIteratee(predicate, 3));
  9686. }
  9687. /**
  9688. * Iterates over elements of `collection`, returning an array of all elements
  9689. * `predicate` returns truthy for. The predicate is invoked with three
  9690. * arguments: (value, index|key, collection).
  9691. *
  9692. * **Note:** Unlike `_.remove`, this method returns a new array.
  9693. *
  9694. * @static
  9695. * @memberOf _
  9696. * @since 0.1.0
  9697. * @category Collection
  9698. * @param {Array|Object} collection The collection to iterate over.
  9699. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9700. * @returns {Array} Returns the new filtered array.
  9701. * @see _.reject
  9702. * @example
  9703. *
  9704. * var users = [
  9705. * { 'user': 'barney', 'age': 36, 'active': true },
  9706. * { 'user': 'fred', 'age': 40, 'active': false }
  9707. * ];
  9708. *
  9709. * _.filter(users, function(o) { return !o.active; });
  9710. * // => objects for ['fred']
  9711. *
  9712. * // The `_.matches` iteratee shorthand.
  9713. * _.filter(users, { 'age': 36, 'active': true });
  9714. * // => objects for ['barney']
  9715. *
  9716. * // The `_.matchesProperty` iteratee shorthand.
  9717. * _.filter(users, ['active', false]);
  9718. * // => objects for ['fred']
  9719. *
  9720. * // The `_.property` iteratee shorthand.
  9721. * _.filter(users, 'active');
  9722. * // => objects for ['barney']
  9723. *
  9724. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9725. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9726. * // => objects for ['fred', 'barney']
  9727. */
  9728. function filter(collection, predicate) {
  9729. var func = isArray(collection) ? arrayFilter : baseFilter;
  9730. return func(collection, getIteratee(predicate, 3));
  9731. }
  9732. /**
  9733. * Iterates over elements of `collection`, returning the first element
  9734. * `predicate` returns truthy for. The predicate is invoked with three
  9735. * arguments: (value, index|key, collection).
  9736. *
  9737. * @static
  9738. * @memberOf _
  9739. * @since 0.1.0
  9740. * @category Collection
  9741. * @param {Array|Object} collection The collection to inspect.
  9742. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9743. * @param {number} [fromIndex=0] The index to search from.
  9744. * @returns {*} Returns the matched element, else `undefined`.
  9745. * @example
  9746. *
  9747. * var users = [
  9748. * { 'user': 'barney', 'age': 36, 'active': true },
  9749. * { 'user': 'fred', 'age': 40, 'active': false },
  9750. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9751. * ];
  9752. *
  9753. * _.find(users, function(o) { return o.age < 40; });
  9754. * // => object for 'barney'
  9755. *
  9756. * // The `_.matches` iteratee shorthand.
  9757. * _.find(users, { 'age': 1, 'active': true });
  9758. * // => object for 'pebbles'
  9759. *
  9760. * // The `_.matchesProperty` iteratee shorthand.
  9761. * _.find(users, ['active', false]);
  9762. * // => object for 'fred'
  9763. *
  9764. * // The `_.property` iteratee shorthand.
  9765. * _.find(users, 'active');
  9766. * // => object for 'barney'
  9767. */
  9768. var find = createFind(findIndex);
  9769. /**
  9770. * This method is like `_.find` except that it iterates over elements of
  9771. * `collection` from right to left.
  9772. *
  9773. * @static
  9774. * @memberOf _
  9775. * @since 2.0.0
  9776. * @category Collection
  9777. * @param {Array|Object} collection The collection to inspect.
  9778. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9779. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9780. * @returns {*} Returns the matched element, else `undefined`.
  9781. * @example
  9782. *
  9783. * _.findLast([1, 2, 3, 4], function(n) {
  9784. * return n % 2 == 1;
  9785. * });
  9786. * // => 3
  9787. */
  9788. var findLast = createFind(findLastIndex);
  9789. /**
  9790. * Creates a flattened array of values by running each element in `collection`
  9791. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9792. * with three arguments: (value, index|key, collection).
  9793. *
  9794. * @static
  9795. * @memberOf _
  9796. * @since 4.0.0
  9797. * @category Collection
  9798. * @param {Array|Object} collection The collection to iterate over.
  9799. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9800. * @returns {Array} Returns the new flattened array.
  9801. * @example
  9802. *
  9803. * function duplicate(n) {
  9804. * return [n, n];
  9805. * }
  9806. *
  9807. * _.flatMap([1, 2], duplicate);
  9808. * // => [1, 1, 2, 2]
  9809. */
  9810. function flatMap(collection, iteratee) {
  9811. return baseFlatten(map(collection, iteratee), 1);
  9812. }
  9813. /**
  9814. * This method is like `_.flatMap` except that it recursively flattens the
  9815. * mapped results.
  9816. *
  9817. * @static
  9818. * @memberOf _
  9819. * @since 4.7.0
  9820. * @category Collection
  9821. * @param {Array|Object} collection The collection to iterate over.
  9822. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9823. * @returns {Array} Returns the new flattened array.
  9824. * @example
  9825. *
  9826. * function duplicate(n) {
  9827. * return [[[n, n]]];
  9828. * }
  9829. *
  9830. * _.flatMapDeep([1, 2], duplicate);
  9831. * // => [1, 1, 2, 2]
  9832. */
  9833. function flatMapDeep(collection, iteratee) {
  9834. return baseFlatten(map(collection, iteratee), INFINITY);
  9835. }
  9836. /**
  9837. * This method is like `_.flatMap` except that it recursively flattens the
  9838. * mapped results up to `depth` times.
  9839. *
  9840. * @static
  9841. * @memberOf _
  9842. * @since 4.7.0
  9843. * @category Collection
  9844. * @param {Array|Object} collection The collection to iterate over.
  9845. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9846. * @param {number} [depth=1] The maximum recursion depth.
  9847. * @returns {Array} Returns the new flattened array.
  9848. * @example
  9849. *
  9850. * function duplicate(n) {
  9851. * return [[[n, n]]];
  9852. * }
  9853. *
  9854. * _.flatMapDepth([1, 2], duplicate, 2);
  9855. * // => [[1, 1], [2, 2]]
  9856. */
  9857. function flatMapDepth(collection, iteratee, depth) {
  9858. depth = depth === undefined ? 1 : toInteger(depth);
  9859. return baseFlatten(map(collection, iteratee), depth);
  9860. }
  9861. /**
  9862. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9863. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9864. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9865. *
  9866. * **Note:** As with other "Collections" methods, objects with a "length"
  9867. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9868. * or `_.forOwn` for object iteration.
  9869. *
  9870. * @static
  9871. * @memberOf _
  9872. * @since 0.1.0
  9873. * @alias each
  9874. * @category Collection
  9875. * @param {Array|Object} collection The collection to iterate over.
  9876. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9877. * @returns {Array|Object} Returns `collection`.
  9878. * @see _.forEachRight
  9879. * @example
  9880. *
  9881. * _.forEach([1, 2], function(value) {
  9882. * console.log(value);
  9883. * });
  9884. * // => Logs `1` then `2`.
  9885. *
  9886. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9887. * console.log(key);
  9888. * });
  9889. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9890. */
  9891. function forEach(collection, iteratee) {
  9892. var func = isArray(collection) ? arrayEach : baseEach;
  9893. return func(collection, getIteratee(iteratee, 3));
  9894. }
  9895. /**
  9896. * This method is like `_.forEach` except that it iterates over elements of
  9897. * `collection` from right to left.
  9898. *
  9899. * @static
  9900. * @memberOf _
  9901. * @since 2.0.0
  9902. * @alias eachRight
  9903. * @category Collection
  9904. * @param {Array|Object} collection The collection to iterate over.
  9905. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9906. * @returns {Array|Object} Returns `collection`.
  9907. * @see _.forEach
  9908. * @example
  9909. *
  9910. * _.forEachRight([1, 2], function(value) {
  9911. * console.log(value);
  9912. * });
  9913. * // => Logs `2` then `1`.
  9914. */
  9915. function forEachRight(collection, iteratee) {
  9916. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9917. return func(collection, getIteratee(iteratee, 3));
  9918. }
  9919. /**
  9920. * Creates an object composed of keys generated from the results of running
  9921. * each element of `collection` thru `iteratee`. The order of grouped values
  9922. * is determined by the order they occur in `collection`. The corresponding
  9923. * value of each key is an array of elements responsible for generating the
  9924. * key. The iteratee is invoked with one argument: (value).
  9925. *
  9926. * @static
  9927. * @memberOf _
  9928. * @since 0.1.0
  9929. * @category Collection
  9930. * @param {Array|Object} collection The collection to iterate over.
  9931. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9932. * @returns {Object} Returns the composed aggregate object.
  9933. * @example
  9934. *
  9935. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9936. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9937. *
  9938. * // The `_.property` iteratee shorthand.
  9939. * _.groupBy(['one', 'two', 'three'], 'length');
  9940. * // => { '3': ['one', 'two'], '5': ['three'] }
  9941. */
  9942. var groupBy = createAggregator(function(result, value, key) {
  9943. if (hasOwnProperty.call(result, key)) {
  9944. result[key].push(value);
  9945. } else {
  9946. baseAssignValue(result, key, [value]);
  9947. }
  9948. });
  9949. /**
  9950. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9951. * checked for a substring of `value`, otherwise
  9952. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9953. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9954. * the offset from the end of `collection`.
  9955. *
  9956. * @static
  9957. * @memberOf _
  9958. * @since 0.1.0
  9959. * @category Collection
  9960. * @param {Array|Object|string} collection The collection to inspect.
  9961. * @param {*} value The value to search for.
  9962. * @param {number} [fromIndex=0] The index to search from.
  9963. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9964. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9965. * @example
  9966. *
  9967. * _.includes([1, 2, 3], 1);
  9968. * // => true
  9969. *
  9970. * _.includes([1, 2, 3], 1, 2);
  9971. * // => false
  9972. *
  9973. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9974. * // => true
  9975. *
  9976. * _.includes('abcd', 'bc');
  9977. * // => true
  9978. */
  9979. function includes(collection, value, fromIndex, guard) {
  9980. collection = isArrayLike(collection) ? collection : values(collection);
  9981. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9982. var length = collection.length;
  9983. if (fromIndex < 0) {
  9984. fromIndex = nativeMax(length + fromIndex, 0);
  9985. }
  9986. return isString(collection)
  9987. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9988. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9989. }
  9990. /**
  9991. * Invokes the method at `path` of each element in `collection`, returning
  9992. * an array of the results of each invoked method. Any additional arguments
  9993. * are provided to each invoked method. If `path` is a function, it's invoked
  9994. * for, and `this` bound to, each element in `collection`.
  9995. *
  9996. * @static
  9997. * @memberOf _
  9998. * @since 4.0.0
  9999. * @category Collection
  10000. * @param {Array|Object} collection The collection to iterate over.
  10001. * @param {Array|Function|string} path The path of the method to invoke or
  10002. * the function invoked per iteration.
  10003. * @param {...*} [args] The arguments to invoke each method with.
  10004. * @returns {Array} Returns the array of results.
  10005. * @example
  10006. *
  10007. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10008. * // => [[1, 5, 7], [1, 2, 3]]
  10009. *
  10010. * _.invokeMap([123, 456], String.prototype.split, '');
  10011. * // => [['1', '2', '3'], ['4', '5', '6']]
  10012. */
  10013. var invokeMap = baseRest(function(collection, path, args) {
  10014. var index = -1,
  10015. isFunc = typeof path == 'function',
  10016. result = isArrayLike(collection) ? Array(collection.length) : [];
  10017. baseEach(collection, function(value) {
  10018. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10019. });
  10020. return result;
  10021. });
  10022. /**
  10023. * Creates an object composed of keys generated from the results of running
  10024. * each element of `collection` thru `iteratee`. The corresponding value of
  10025. * each key is the last element responsible for generating the key. The
  10026. * iteratee is invoked with one argument: (value).
  10027. *
  10028. * @static
  10029. * @memberOf _
  10030. * @since 4.0.0
  10031. * @category Collection
  10032. * @param {Array|Object} collection The collection to iterate over.
  10033. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10034. * @returns {Object} Returns the composed aggregate object.
  10035. * @example
  10036. *
  10037. * var array = [
  10038. * { 'dir': 'left', 'code': 97 },
  10039. * { 'dir': 'right', 'code': 100 }
  10040. * ];
  10041. *
  10042. * _.keyBy(array, function(o) {
  10043. * return String.fromCharCode(o.code);
  10044. * });
  10045. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10046. *
  10047. * _.keyBy(array, 'dir');
  10048. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10049. */
  10050. var keyBy = createAggregator(function(result, value, key) {
  10051. baseAssignValue(result, key, value);
  10052. });
  10053. /**
  10054. * Creates an array of values by running each element in `collection` thru
  10055. * `iteratee`. The iteratee is invoked with three arguments:
  10056. * (value, index|key, collection).
  10057. *
  10058. * Many lodash methods are guarded to work as iteratees for methods like
  10059. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10060. *
  10061. * The guarded methods are:
  10062. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10063. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10064. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10065. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10066. *
  10067. * @static
  10068. * @memberOf _
  10069. * @since 0.1.0
  10070. * @category Collection
  10071. * @param {Array|Object} collection The collection to iterate over.
  10072. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10073. * @returns {Array} Returns the new mapped array.
  10074. * @example
  10075. *
  10076. * function square(n) {
  10077. * return n * n;
  10078. * }
  10079. *
  10080. * _.map([4, 8], square);
  10081. * // => [16, 64]
  10082. *
  10083. * _.map({ 'a': 4, 'b': 8 }, square);
  10084. * // => [16, 64] (iteration order is not guaranteed)
  10085. *
  10086. * var users = [
  10087. * { 'user': 'barney' },
  10088. * { 'user': 'fred' }
  10089. * ];
  10090. *
  10091. * // The `_.property` iteratee shorthand.
  10092. * _.map(users, 'user');
  10093. * // => ['barney', 'fred']
  10094. */
  10095. function map(collection, iteratee) {
  10096. var func = isArray(collection) ? arrayMap : baseMap;
  10097. return func(collection, getIteratee(iteratee, 3));
  10098. }
  10099. /**
  10100. * This method is like `_.sortBy` except that it allows specifying the sort
  10101. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10102. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10103. * descending or "asc" for ascending sort order of corresponding values.
  10104. *
  10105. * @static
  10106. * @memberOf _
  10107. * @since 4.0.0
  10108. * @category Collection
  10109. * @param {Array|Object} collection The collection to iterate over.
  10110. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10111. * The iteratees to sort by.
  10112. * @param {string[]} [orders] The sort orders of `iteratees`.
  10113. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10114. * @returns {Array} Returns the new sorted array.
  10115. * @example
  10116. *
  10117. * var users = [
  10118. * { 'user': 'fred', 'age': 48 },
  10119. * { 'user': 'barney', 'age': 34 },
  10120. * { 'user': 'fred', 'age': 40 },
  10121. * { 'user': 'barney', 'age': 36 }
  10122. * ];
  10123. *
  10124. * // Sort by `user` in ascending order and by `age` in descending order.
  10125. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10126. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10127. */
  10128. function orderBy(collection, iteratees, orders, guard) {
  10129. if (collection == null) {
  10130. return [];
  10131. }
  10132. if (!isArray(iteratees)) {
  10133. iteratees = iteratees == null ? [] : [iteratees];
  10134. }
  10135. orders = guard ? undefined : orders;
  10136. if (!isArray(orders)) {
  10137. orders = orders == null ? [] : [orders];
  10138. }
  10139. return baseOrderBy(collection, iteratees, orders);
  10140. }
  10141. /**
  10142. * Creates an array of elements split into two groups, the first of which
  10143. * contains elements `predicate` returns truthy for, the second of which
  10144. * contains elements `predicate` returns falsey for. The predicate is
  10145. * invoked with one argument: (value).
  10146. *
  10147. * @static
  10148. * @memberOf _
  10149. * @since 3.0.0
  10150. * @category Collection
  10151. * @param {Array|Object} collection The collection to iterate over.
  10152. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10153. * @returns {Array} Returns the array of grouped elements.
  10154. * @example
  10155. *
  10156. * var users = [
  10157. * { 'user': 'barney', 'age': 36, 'active': false },
  10158. * { 'user': 'fred', 'age': 40, 'active': true },
  10159. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10160. * ];
  10161. *
  10162. * _.partition(users, function(o) { return o.active; });
  10163. * // => objects for [['fred'], ['barney', 'pebbles']]
  10164. *
  10165. * // The `_.matches` iteratee shorthand.
  10166. * _.partition(users, { 'age': 1, 'active': false });
  10167. * // => objects for [['pebbles'], ['barney', 'fred']]
  10168. *
  10169. * // The `_.matchesProperty` iteratee shorthand.
  10170. * _.partition(users, ['active', false]);
  10171. * // => objects for [['barney', 'pebbles'], ['fred']]
  10172. *
  10173. * // The `_.property` iteratee shorthand.
  10174. * _.partition(users, 'active');
  10175. * // => objects for [['fred'], ['barney', 'pebbles']]
  10176. */
  10177. var partition = createAggregator(function(result, value, key) {
  10178. result[key ? 0 : 1].push(value);
  10179. }, function() { return [[], []]; });
  10180. /**
  10181. * Reduces `collection` to a value which is the accumulated result of running
  10182. * each element in `collection` thru `iteratee`, where each successive
  10183. * invocation is supplied the return value of the previous. If `accumulator`
  10184. * is not given, the first element of `collection` is used as the initial
  10185. * value. The iteratee is invoked with four arguments:
  10186. * (accumulator, value, index|key, collection).
  10187. *
  10188. * Many lodash methods are guarded to work as iteratees for methods like
  10189. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10190. *
  10191. * The guarded methods are:
  10192. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10193. * and `sortBy`
  10194. *
  10195. * @static
  10196. * @memberOf _
  10197. * @since 0.1.0
  10198. * @category Collection
  10199. * @param {Array|Object} collection The collection to iterate over.
  10200. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10201. * @param {*} [accumulator] The initial value.
  10202. * @returns {*} Returns the accumulated value.
  10203. * @see _.reduceRight
  10204. * @example
  10205. *
  10206. * _.reduce([1, 2], function(sum, n) {
  10207. * return sum + n;
  10208. * }, 0);
  10209. * // => 3
  10210. *
  10211. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10212. * (result[value] || (result[value] = [])).push(key);
  10213. * return result;
  10214. * }, {});
  10215. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10216. */
  10217. function reduce(collection, iteratee, accumulator) {
  10218. var func = isArray(collection) ? arrayReduce : baseReduce,
  10219. initAccum = arguments.length < 3;
  10220. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10221. }
  10222. /**
  10223. * This method is like `_.reduce` except that it iterates over elements of
  10224. * `collection` from right to left.
  10225. *
  10226. * @static
  10227. * @memberOf _
  10228. * @since 0.1.0
  10229. * @category Collection
  10230. * @param {Array|Object} collection The collection to iterate over.
  10231. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10232. * @param {*} [accumulator] The initial value.
  10233. * @returns {*} Returns the accumulated value.
  10234. * @see _.reduce
  10235. * @example
  10236. *
  10237. * var array = [[0, 1], [2, 3], [4, 5]];
  10238. *
  10239. * _.reduceRight(array, function(flattened, other) {
  10240. * return flattened.concat(other);
  10241. * }, []);
  10242. * // => [4, 5, 2, 3, 0, 1]
  10243. */
  10244. function reduceRight(collection, iteratee, accumulator) {
  10245. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10246. initAccum = arguments.length < 3;
  10247. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10248. }
  10249. /**
  10250. * The opposite of `_.filter`; this method returns the elements of `collection`
  10251. * that `predicate` does **not** return truthy for.
  10252. *
  10253. * @static
  10254. * @memberOf _
  10255. * @since 0.1.0
  10256. * @category Collection
  10257. * @param {Array|Object} collection The collection to iterate over.
  10258. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10259. * @returns {Array} Returns the new filtered array.
  10260. * @see _.filter
  10261. * @example
  10262. *
  10263. * var users = [
  10264. * { 'user': 'barney', 'age': 36, 'active': false },
  10265. * { 'user': 'fred', 'age': 40, 'active': true }
  10266. * ];
  10267. *
  10268. * _.reject(users, function(o) { return !o.active; });
  10269. * // => objects for ['fred']
  10270. *
  10271. * // The `_.matches` iteratee shorthand.
  10272. * _.reject(users, { 'age': 40, 'active': true });
  10273. * // => objects for ['barney']
  10274. *
  10275. * // The `_.matchesProperty` iteratee shorthand.
  10276. * _.reject(users, ['active', false]);
  10277. * // => objects for ['fred']
  10278. *
  10279. * // The `_.property` iteratee shorthand.
  10280. * _.reject(users, 'active');
  10281. * // => objects for ['barney']
  10282. */
  10283. function reject(collection, predicate) {
  10284. var func = isArray(collection) ? arrayFilter : baseFilter;
  10285. return func(collection, negate(getIteratee(predicate, 3)));
  10286. }
  10287. /**
  10288. * Gets a random element from `collection`.
  10289. *
  10290. * @static
  10291. * @memberOf _
  10292. * @since 2.0.0
  10293. * @category Collection
  10294. * @param {Array|Object} collection The collection to sample.
  10295. * @returns {*} Returns the random element.
  10296. * @example
  10297. *
  10298. * _.sample([1, 2, 3, 4]);
  10299. * // => 2
  10300. */
  10301. function sample(collection) {
  10302. var func = isArray(collection) ? arraySample : baseSample;
  10303. return func(collection);
  10304. }
  10305. /**
  10306. * Gets `n` random elements at unique keys from `collection` up to the
  10307. * size of `collection`.
  10308. *
  10309. * @static
  10310. * @memberOf _
  10311. * @since 4.0.0
  10312. * @category Collection
  10313. * @param {Array|Object} collection The collection to sample.
  10314. * @param {number} [n=1] The number of elements to sample.
  10315. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10316. * @returns {Array} Returns the random elements.
  10317. * @example
  10318. *
  10319. * _.sampleSize([1, 2, 3], 2);
  10320. * // => [3, 1]
  10321. *
  10322. * _.sampleSize([1, 2, 3], 4);
  10323. * // => [2, 3, 1]
  10324. */
  10325. function sampleSize(collection, n, guard) {
  10326. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10327. n = 1;
  10328. } else {
  10329. n = toInteger(n);
  10330. }
  10331. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10332. return func(collection, n);
  10333. }
  10334. /**
  10335. * Creates an array of shuffled values, using a version of the
  10336. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10337. *
  10338. * @static
  10339. * @memberOf _
  10340. * @since 0.1.0
  10341. * @category Collection
  10342. * @param {Array|Object} collection The collection to shuffle.
  10343. * @returns {Array} Returns the new shuffled array.
  10344. * @example
  10345. *
  10346. * _.shuffle([1, 2, 3, 4]);
  10347. * // => [4, 1, 3, 2]
  10348. */
  10349. function shuffle(collection) {
  10350. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10351. return func(collection);
  10352. }
  10353. /**
  10354. * Gets the size of `collection` by returning its length for array-like
  10355. * values or the number of own enumerable string keyed properties for objects.
  10356. *
  10357. * @static
  10358. * @memberOf _
  10359. * @since 0.1.0
  10360. * @category Collection
  10361. * @param {Array|Object|string} collection The collection to inspect.
  10362. * @returns {number} Returns the collection size.
  10363. * @example
  10364. *
  10365. * _.size([1, 2, 3]);
  10366. * // => 3
  10367. *
  10368. * _.size({ 'a': 1, 'b': 2 });
  10369. * // => 2
  10370. *
  10371. * _.size('pebbles');
  10372. * // => 7
  10373. */
  10374. function size(collection) {
  10375. if (collection == null) {
  10376. return 0;
  10377. }
  10378. if (isArrayLike(collection)) {
  10379. return isString(collection) ? stringSize(collection) : collection.length;
  10380. }
  10381. var tag = getTag(collection);
  10382. if (tag == mapTag || tag == setTag) {
  10383. return collection.size;
  10384. }
  10385. return baseKeys(collection).length;
  10386. }
  10387. /**
  10388. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10389. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10390. * invoked with three arguments: (value, index|key, collection).
  10391. *
  10392. * @static
  10393. * @memberOf _
  10394. * @since 0.1.0
  10395. * @category Collection
  10396. * @param {Array|Object} collection The collection to iterate over.
  10397. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10398. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10399. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10400. * else `false`.
  10401. * @example
  10402. *
  10403. * _.some([null, 0, 'yes', false], Boolean);
  10404. * // => true
  10405. *
  10406. * var users = [
  10407. * { 'user': 'barney', 'active': true },
  10408. * { 'user': 'fred', 'active': false }
  10409. * ];
  10410. *
  10411. * // The `_.matches` iteratee shorthand.
  10412. * _.some(users, { 'user': 'barney', 'active': false });
  10413. * // => false
  10414. *
  10415. * // The `_.matchesProperty` iteratee shorthand.
  10416. * _.some(users, ['active', false]);
  10417. * // => true
  10418. *
  10419. * // The `_.property` iteratee shorthand.
  10420. * _.some(users, 'active');
  10421. * // => true
  10422. */
  10423. function some(collection, predicate, guard) {
  10424. var func = isArray(collection) ? arraySome : baseSome;
  10425. if (guard && isIterateeCall(collection, predicate, guard)) {
  10426. predicate = undefined;
  10427. }
  10428. return func(collection, getIteratee(predicate, 3));
  10429. }
  10430. /**
  10431. * Creates an array of elements, sorted in ascending order by the results of
  10432. * running each element in a collection thru each iteratee. This method
  10433. * performs a stable sort, that is, it preserves the original sort order of
  10434. * equal elements. The iteratees are invoked with one argument: (value).
  10435. *
  10436. * @static
  10437. * @memberOf _
  10438. * @since 0.1.0
  10439. * @category Collection
  10440. * @param {Array|Object} collection The collection to iterate over.
  10441. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10442. * The iteratees to sort by.
  10443. * @returns {Array} Returns the new sorted array.
  10444. * @example
  10445. *
  10446. * var users = [
  10447. * { 'user': 'fred', 'age': 48 },
  10448. * { 'user': 'barney', 'age': 36 },
  10449. * { 'user': 'fred', 'age': 30 },
  10450. * { 'user': 'barney', 'age': 34 }
  10451. * ];
  10452. *
  10453. * _.sortBy(users, [function(o) { return o.user; }]);
  10454. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10455. *
  10456. * _.sortBy(users, ['user', 'age']);
  10457. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10458. */
  10459. var sortBy = baseRest(function(collection, iteratees) {
  10460. if (collection == null) {
  10461. return [];
  10462. }
  10463. var length = iteratees.length;
  10464. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10465. iteratees = [];
  10466. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10467. iteratees = [iteratees[0]];
  10468. }
  10469. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10470. });
  10471. /*------------------------------------------------------------------------*/
  10472. /**
  10473. * Gets the timestamp of the number of milliseconds that have elapsed since
  10474. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10475. *
  10476. * @static
  10477. * @memberOf _
  10478. * @since 2.4.0
  10479. * @category Date
  10480. * @returns {number} Returns the timestamp.
  10481. * @example
  10482. *
  10483. * _.defer(function(stamp) {
  10484. * console.log(_.now() - stamp);
  10485. * }, _.now());
  10486. * // => Logs the number of milliseconds it took for the deferred invocation.
  10487. */
  10488. var now = ctxNow || function() {
  10489. return root.Date.now();
  10490. };
  10491. /*------------------------------------------------------------------------*/
  10492. /**
  10493. * The opposite of `_.before`; this method creates a function that invokes
  10494. * `func` once it's called `n` or more times.
  10495. *
  10496. * @static
  10497. * @memberOf _
  10498. * @since 0.1.0
  10499. * @category Function
  10500. * @param {number} n The number of calls before `func` is invoked.
  10501. * @param {Function} func The function to restrict.
  10502. * @returns {Function} Returns the new restricted function.
  10503. * @example
  10504. *
  10505. * var saves = ['profile', 'settings'];
  10506. *
  10507. * var done = _.after(saves.length, function() {
  10508. * console.log('done saving!');
  10509. * });
  10510. *
  10511. * _.forEach(saves, function(type) {
  10512. * asyncSave({ 'type': type, 'complete': done });
  10513. * });
  10514. * // => Logs 'done saving!' after the two async saves have completed.
  10515. */
  10516. function after(n, func) {
  10517. if (typeof func != 'function') {
  10518. throw new TypeError(FUNC_ERROR_TEXT);
  10519. }
  10520. n = toInteger(n);
  10521. return function() {
  10522. if (--n < 1) {
  10523. return func.apply(this, arguments);
  10524. }
  10525. };
  10526. }
  10527. /**
  10528. * Creates a function that invokes `func`, with up to `n` arguments,
  10529. * ignoring any additional arguments.
  10530. *
  10531. * @static
  10532. * @memberOf _
  10533. * @since 3.0.0
  10534. * @category Function
  10535. * @param {Function} func The function to cap arguments for.
  10536. * @param {number} [n=func.length] The arity cap.
  10537. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10538. * @returns {Function} Returns the new capped function.
  10539. * @example
  10540. *
  10541. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10542. * // => [6, 8, 10]
  10543. */
  10544. function ary(func, n, guard) {
  10545. n = guard ? undefined : n;
  10546. n = (func && n == null) ? func.length : n;
  10547. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10548. }
  10549. /**
  10550. * Creates a function that invokes `func`, with the `this` binding and arguments
  10551. * of the created function, while it's called less than `n` times. Subsequent
  10552. * calls to the created function return the result of the last `func` invocation.
  10553. *
  10554. * @static
  10555. * @memberOf _
  10556. * @since 3.0.0
  10557. * @category Function
  10558. * @param {number} n The number of calls at which `func` is no longer invoked.
  10559. * @param {Function} func The function to restrict.
  10560. * @returns {Function} Returns the new restricted function.
  10561. * @example
  10562. *
  10563. * jQuery(element).on('click', _.before(5, addContactToList));
  10564. * // => Allows adding up to 4 contacts to the list.
  10565. */
  10566. function before(n, func) {
  10567. var result;
  10568. if (typeof func != 'function') {
  10569. throw new TypeError(FUNC_ERROR_TEXT);
  10570. }
  10571. n = toInteger(n);
  10572. return function() {
  10573. if (--n > 0) {
  10574. result = func.apply(this, arguments);
  10575. }
  10576. if (n <= 1) {
  10577. func = undefined;
  10578. }
  10579. return result;
  10580. };
  10581. }
  10582. /**
  10583. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10584. * and `partials` prepended to the arguments it receives.
  10585. *
  10586. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10587. * may be used as a placeholder for partially applied arguments.
  10588. *
  10589. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10590. * property of bound functions.
  10591. *
  10592. * @static
  10593. * @memberOf _
  10594. * @since 0.1.0
  10595. * @category Function
  10596. * @param {Function} func The function to bind.
  10597. * @param {*} thisArg The `this` binding of `func`.
  10598. * @param {...*} [partials] The arguments to be partially applied.
  10599. * @returns {Function} Returns the new bound function.
  10600. * @example
  10601. *
  10602. * function greet(greeting, punctuation) {
  10603. * return greeting + ' ' + this.user + punctuation;
  10604. * }
  10605. *
  10606. * var object = { 'user': 'fred' };
  10607. *
  10608. * var bound = _.bind(greet, object, 'hi');
  10609. * bound('!');
  10610. * // => 'hi fred!'
  10611. *
  10612. * // Bound with placeholders.
  10613. * var bound = _.bind(greet, object, _, '!');
  10614. * bound('hi');
  10615. * // => 'hi fred!'
  10616. */
  10617. var bind = baseRest(function(func, thisArg, partials) {
  10618. var bitmask = WRAP_BIND_FLAG;
  10619. if (partials.length) {
  10620. var holders = replaceHolders(partials, getHolder(bind));
  10621. bitmask |= WRAP_PARTIAL_FLAG;
  10622. }
  10623. return createWrap(func, bitmask, thisArg, partials, holders);
  10624. });
  10625. /**
  10626. * Creates a function that invokes the method at `object[key]` with `partials`
  10627. * prepended to the arguments it receives.
  10628. *
  10629. * This method differs from `_.bind` by allowing bound functions to reference
  10630. * methods that may be redefined or don't yet exist. See
  10631. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10632. * for more details.
  10633. *
  10634. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10635. * builds, may be used as a placeholder for partially applied arguments.
  10636. *
  10637. * @static
  10638. * @memberOf _
  10639. * @since 0.10.0
  10640. * @category Function
  10641. * @param {Object} object The object to invoke the method on.
  10642. * @param {string} key The key of the method.
  10643. * @param {...*} [partials] The arguments to be partially applied.
  10644. * @returns {Function} Returns the new bound function.
  10645. * @example
  10646. *
  10647. * var object = {
  10648. * 'user': 'fred',
  10649. * 'greet': function(greeting, punctuation) {
  10650. * return greeting + ' ' + this.user + punctuation;
  10651. * }
  10652. * };
  10653. *
  10654. * var bound = _.bindKey(object, 'greet', 'hi');
  10655. * bound('!');
  10656. * // => 'hi fred!'
  10657. *
  10658. * object.greet = function(greeting, punctuation) {
  10659. * return greeting + 'ya ' + this.user + punctuation;
  10660. * };
  10661. *
  10662. * bound('!');
  10663. * // => 'hiya fred!'
  10664. *
  10665. * // Bound with placeholders.
  10666. * var bound = _.bindKey(object, 'greet', _, '!');
  10667. * bound('hi');
  10668. * // => 'hiya fred!'
  10669. */
  10670. var bindKey = baseRest(function(object, key, partials) {
  10671. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10672. if (partials.length) {
  10673. var holders = replaceHolders(partials, getHolder(bindKey));
  10674. bitmask |= WRAP_PARTIAL_FLAG;
  10675. }
  10676. return createWrap(key, bitmask, object, partials, holders);
  10677. });
  10678. /**
  10679. * Creates a function that accepts arguments of `func` and either invokes
  10680. * `func` returning its result, if at least `arity` number of arguments have
  10681. * been provided, or returns a function that accepts the remaining `func`
  10682. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10683. * is not sufficient.
  10684. *
  10685. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10686. * may be used as a placeholder for provided arguments.
  10687. *
  10688. * **Note:** This method doesn't set the "length" property of curried functions.
  10689. *
  10690. * @static
  10691. * @memberOf _
  10692. * @since 2.0.0
  10693. * @category Function
  10694. * @param {Function} func The function to curry.
  10695. * @param {number} [arity=func.length] The arity of `func`.
  10696. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10697. * @returns {Function} Returns the new curried function.
  10698. * @example
  10699. *
  10700. * var abc = function(a, b, c) {
  10701. * return [a, b, c];
  10702. * };
  10703. *
  10704. * var curried = _.curry(abc);
  10705. *
  10706. * curried(1)(2)(3);
  10707. * // => [1, 2, 3]
  10708. *
  10709. * curried(1, 2)(3);
  10710. * // => [1, 2, 3]
  10711. *
  10712. * curried(1, 2, 3);
  10713. * // => [1, 2, 3]
  10714. *
  10715. * // Curried with placeholders.
  10716. * curried(1)(_, 3)(2);
  10717. * // => [1, 2, 3]
  10718. */
  10719. function curry(func, arity, guard) {
  10720. arity = guard ? undefined : arity;
  10721. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10722. result.placeholder = curry.placeholder;
  10723. return result;
  10724. }
  10725. /**
  10726. * This method is like `_.curry` except that arguments are applied to `func`
  10727. * in the manner of `_.partialRight` instead of `_.partial`.
  10728. *
  10729. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10730. * builds, may be used as a placeholder for provided arguments.
  10731. *
  10732. * **Note:** This method doesn't set the "length" property of curried functions.
  10733. *
  10734. * @static
  10735. * @memberOf _
  10736. * @since 3.0.0
  10737. * @category Function
  10738. * @param {Function} func The function to curry.
  10739. * @param {number} [arity=func.length] The arity of `func`.
  10740. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10741. * @returns {Function} Returns the new curried function.
  10742. * @example
  10743. *
  10744. * var abc = function(a, b, c) {
  10745. * return [a, b, c];
  10746. * };
  10747. *
  10748. * var curried = _.curryRight(abc);
  10749. *
  10750. * curried(3)(2)(1);
  10751. * // => [1, 2, 3]
  10752. *
  10753. * curried(2, 3)(1);
  10754. * // => [1, 2, 3]
  10755. *
  10756. * curried(1, 2, 3);
  10757. * // => [1, 2, 3]
  10758. *
  10759. * // Curried with placeholders.
  10760. * curried(3)(1, _)(2);
  10761. * // => [1, 2, 3]
  10762. */
  10763. function curryRight(func, arity, guard) {
  10764. arity = guard ? undefined : arity;
  10765. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10766. result.placeholder = curryRight.placeholder;
  10767. return result;
  10768. }
  10769. /**
  10770. * Creates a debounced function that delays invoking `func` until after `wait`
  10771. * milliseconds have elapsed since the last time the debounced function was
  10772. * invoked. The debounced function comes with a `cancel` method to cancel
  10773. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10774. * Provide `options` to indicate whether `func` should be invoked on the
  10775. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10776. * with the last arguments provided to the debounced function. Subsequent
  10777. * calls to the debounced function return the result of the last `func`
  10778. * invocation.
  10779. *
  10780. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10781. * invoked on the trailing edge of the timeout only if the debounced function
  10782. * is invoked more than once during the `wait` timeout.
  10783. *
  10784. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10785. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10786. *
  10787. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10788. * for details over the differences between `_.debounce` and `_.throttle`.
  10789. *
  10790. * @static
  10791. * @memberOf _
  10792. * @since 0.1.0
  10793. * @category Function
  10794. * @param {Function} func The function to debounce.
  10795. * @param {number} [wait=0] The number of milliseconds to delay.
  10796. * @param {Object} [options={}] The options object.
  10797. * @param {boolean} [options.leading=false]
  10798. * Specify invoking on the leading edge of the timeout.
  10799. * @param {number} [options.maxWait]
  10800. * The maximum time `func` is allowed to be delayed before it's invoked.
  10801. * @param {boolean} [options.trailing=true]
  10802. * Specify invoking on the trailing edge of the timeout.
  10803. * @returns {Function} Returns the new debounced function.
  10804. * @example
  10805. *
  10806. * // Avoid costly calculations while the window size is in flux.
  10807. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10808. *
  10809. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10810. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10811. * 'leading': true,
  10812. * 'trailing': false
  10813. * }));
  10814. *
  10815. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10816. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10817. * var source = new EventSource('/stream');
  10818. * jQuery(source).on('message', debounced);
  10819. *
  10820. * // Cancel the trailing debounced invocation.
  10821. * jQuery(window).on('popstate', debounced.cancel);
  10822. */
  10823. function debounce(func, wait, options) {
  10824. var lastArgs,
  10825. lastThis,
  10826. maxWait,
  10827. result,
  10828. timerId,
  10829. lastCallTime,
  10830. lastInvokeTime = 0,
  10831. leading = false,
  10832. maxing = false,
  10833. trailing = true;
  10834. if (typeof func != 'function') {
  10835. throw new TypeError(FUNC_ERROR_TEXT);
  10836. }
  10837. wait = toNumber(wait) || 0;
  10838. if (isObject(options)) {
  10839. leading = !!options.leading;
  10840. maxing = 'maxWait' in options;
  10841. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10842. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10843. }
  10844. function invokeFunc(time) {
  10845. var args = lastArgs,
  10846. thisArg = lastThis;
  10847. lastArgs = lastThis = undefined;
  10848. lastInvokeTime = time;
  10849. result = func.apply(thisArg, args);
  10850. return result;
  10851. }
  10852. function leadingEdge(time) {
  10853. // Reset any `maxWait` timer.
  10854. lastInvokeTime = time;
  10855. // Start the timer for the trailing edge.
  10856. timerId = setTimeout(timerExpired, wait);
  10857. // Invoke the leading edge.
  10858. return leading ? invokeFunc(time) : result;
  10859. }
  10860. function remainingWait(time) {
  10861. var timeSinceLastCall = time - lastCallTime,
  10862. timeSinceLastInvoke = time - lastInvokeTime,
  10863. timeWaiting = wait - timeSinceLastCall;
  10864. return maxing
  10865. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10866. : timeWaiting;
  10867. }
  10868. function shouldInvoke(time) {
  10869. var timeSinceLastCall = time - lastCallTime,
  10870. timeSinceLastInvoke = time - lastInvokeTime;
  10871. // Either this is the first call, activity has stopped and we're at the
  10872. // trailing edge, the system time has gone backwards and we're treating
  10873. // it as the trailing edge, or we've hit the `maxWait` limit.
  10874. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10875. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10876. }
  10877. function timerExpired() {
  10878. var time = now();
  10879. if (shouldInvoke(time)) {
  10880. return trailingEdge(time);
  10881. }
  10882. // Restart the timer.
  10883. timerId = setTimeout(timerExpired, remainingWait(time));
  10884. }
  10885. function trailingEdge(time) {
  10886. timerId = undefined;
  10887. // Only invoke if we have `lastArgs` which means `func` has been
  10888. // debounced at least once.
  10889. if (trailing && lastArgs) {
  10890. return invokeFunc(time);
  10891. }
  10892. lastArgs = lastThis = undefined;
  10893. return result;
  10894. }
  10895. function cancel() {
  10896. if (timerId !== undefined) {
  10897. clearTimeout(timerId);
  10898. }
  10899. lastInvokeTime = 0;
  10900. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10901. }
  10902. function flush() {
  10903. return timerId === undefined ? result : trailingEdge(now());
  10904. }
  10905. function debounced() {
  10906. var time = now(),
  10907. isInvoking = shouldInvoke(time);
  10908. lastArgs = arguments;
  10909. lastThis = this;
  10910. lastCallTime = time;
  10911. if (isInvoking) {
  10912. if (timerId === undefined) {
  10913. return leadingEdge(lastCallTime);
  10914. }
  10915. if (maxing) {
  10916. // Handle invocations in a tight loop.
  10917. clearTimeout(timerId);
  10918. timerId = setTimeout(timerExpired, wait);
  10919. return invokeFunc(lastCallTime);
  10920. }
  10921. }
  10922. if (timerId === undefined) {
  10923. timerId = setTimeout(timerExpired, wait);
  10924. }
  10925. return result;
  10926. }
  10927. debounced.cancel = cancel;
  10928. debounced.flush = flush;
  10929. return debounced;
  10930. }
  10931. /**
  10932. * Defers invoking the `func` until the current call stack has cleared. Any
  10933. * additional arguments are provided to `func` when it's invoked.
  10934. *
  10935. * @static
  10936. * @memberOf _
  10937. * @since 0.1.0
  10938. * @category Function
  10939. * @param {Function} func The function to defer.
  10940. * @param {...*} [args] The arguments to invoke `func` with.
  10941. * @returns {number} Returns the timer id.
  10942. * @example
  10943. *
  10944. * _.defer(function(text) {
  10945. * console.log(text);
  10946. * }, 'deferred');
  10947. * // => Logs 'deferred' after one millisecond.
  10948. */
  10949. var defer = baseRest(function(func, args) {
  10950. return baseDelay(func, 1, args);
  10951. });
  10952. /**
  10953. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10954. * provided to `func` when it's invoked.
  10955. *
  10956. * @static
  10957. * @memberOf _
  10958. * @since 0.1.0
  10959. * @category Function
  10960. * @param {Function} func The function to delay.
  10961. * @param {number} wait The number of milliseconds to delay invocation.
  10962. * @param {...*} [args] The arguments to invoke `func` with.
  10963. * @returns {number} Returns the timer id.
  10964. * @example
  10965. *
  10966. * _.delay(function(text) {
  10967. * console.log(text);
  10968. * }, 1000, 'later');
  10969. * // => Logs 'later' after one second.
  10970. */
  10971. var delay = baseRest(function(func, wait, args) {
  10972. return baseDelay(func, toNumber(wait) || 0, args);
  10973. });
  10974. /**
  10975. * Creates a function that invokes `func` with arguments reversed.
  10976. *
  10977. * @static
  10978. * @memberOf _
  10979. * @since 4.0.0
  10980. * @category Function
  10981. * @param {Function} func The function to flip arguments for.
  10982. * @returns {Function} Returns the new flipped function.
  10983. * @example
  10984. *
  10985. * var flipped = _.flip(function() {
  10986. * return _.toArray(arguments);
  10987. * });
  10988. *
  10989. * flipped('a', 'b', 'c', 'd');
  10990. * // => ['d', 'c', 'b', 'a']
  10991. */
  10992. function flip(func) {
  10993. return createWrap(func, WRAP_FLIP_FLAG);
  10994. }
  10995. /**
  10996. * Creates a function that memoizes the result of `func`. If `resolver` is
  10997. * provided, it determines the cache key for storing the result based on the
  10998. * arguments provided to the memoized function. By default, the first argument
  10999. * provided to the memoized function is used as the map cache key. The `func`
  11000. * is invoked with the `this` binding of the memoized function.
  11001. *
  11002. * **Note:** The cache is exposed as the `cache` property on the memoized
  11003. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11004. * constructor with one whose instances implement the
  11005. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11006. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11007. *
  11008. * @static
  11009. * @memberOf _
  11010. * @since 0.1.0
  11011. * @category Function
  11012. * @param {Function} func The function to have its output memoized.
  11013. * @param {Function} [resolver] The function to resolve the cache key.
  11014. * @returns {Function} Returns the new memoized function.
  11015. * @example
  11016. *
  11017. * var object = { 'a': 1, 'b': 2 };
  11018. * var other = { 'c': 3, 'd': 4 };
  11019. *
  11020. * var values = _.memoize(_.values);
  11021. * values(object);
  11022. * // => [1, 2]
  11023. *
  11024. * values(other);
  11025. * // => [3, 4]
  11026. *
  11027. * object.a = 2;
  11028. * values(object);
  11029. * // => [1, 2]
  11030. *
  11031. * // Modify the result cache.
  11032. * values.cache.set(object, ['a', 'b']);
  11033. * values(object);
  11034. * // => ['a', 'b']
  11035. *
  11036. * // Replace `_.memoize.Cache`.
  11037. * _.memoize.Cache = WeakMap;
  11038. */
  11039. function memoize(func, resolver) {
  11040. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11041. throw new TypeError(FUNC_ERROR_TEXT);
  11042. }
  11043. var memoized = function() {
  11044. var args = arguments,
  11045. key = resolver ? resolver.apply(this, args) : args[0],
  11046. cache = memoized.cache;
  11047. if (cache.has(key)) {
  11048. return cache.get(key);
  11049. }
  11050. var result = func.apply(this, args);
  11051. memoized.cache = cache.set(key, result) || cache;
  11052. return result;
  11053. };
  11054. memoized.cache = new (memoize.Cache || MapCache);
  11055. return memoized;
  11056. }
  11057. // Expose `MapCache`.
  11058. memoize.Cache = MapCache;
  11059. /**
  11060. * Creates a function that negates the result of the predicate `func`. The
  11061. * `func` predicate is invoked with the `this` binding and arguments of the
  11062. * created function.
  11063. *
  11064. * @static
  11065. * @memberOf _
  11066. * @since 3.0.0
  11067. * @category Function
  11068. * @param {Function} predicate The predicate to negate.
  11069. * @returns {Function} Returns the new negated function.
  11070. * @example
  11071. *
  11072. * function isEven(n) {
  11073. * return n % 2 == 0;
  11074. * }
  11075. *
  11076. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11077. * // => [1, 3, 5]
  11078. */
  11079. function negate(predicate) {
  11080. if (typeof predicate != 'function') {
  11081. throw new TypeError(FUNC_ERROR_TEXT);
  11082. }
  11083. return function() {
  11084. var args = arguments;
  11085. switch (args.length) {
  11086. case 0: return !predicate.call(this);
  11087. case 1: return !predicate.call(this, args[0]);
  11088. case 2: return !predicate.call(this, args[0], args[1]);
  11089. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11090. }
  11091. return !predicate.apply(this, args);
  11092. };
  11093. }
  11094. /**
  11095. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11096. * to the function return the value of the first invocation. The `func` is
  11097. * invoked with the `this` binding and arguments of the created function.
  11098. *
  11099. * @static
  11100. * @memberOf _
  11101. * @since 0.1.0
  11102. * @category Function
  11103. * @param {Function} func The function to restrict.
  11104. * @returns {Function} Returns the new restricted function.
  11105. * @example
  11106. *
  11107. * var initialize = _.once(createApplication);
  11108. * initialize();
  11109. * initialize();
  11110. * // => `createApplication` is invoked once
  11111. */
  11112. function once(func) {
  11113. return before(2, func);
  11114. }
  11115. /**
  11116. * Creates a function that invokes `func` with its arguments transformed.
  11117. *
  11118. * @static
  11119. * @since 4.0.0
  11120. * @memberOf _
  11121. * @category Function
  11122. * @param {Function} func The function to wrap.
  11123. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11124. * The argument transforms.
  11125. * @returns {Function} Returns the new function.
  11126. * @example
  11127. *
  11128. * function doubled(n) {
  11129. * return n * 2;
  11130. * }
  11131. *
  11132. * function square(n) {
  11133. * return n * n;
  11134. * }
  11135. *
  11136. * var func = _.overArgs(function(x, y) {
  11137. * return [x, y];
  11138. * }, [square, doubled]);
  11139. *
  11140. * func(9, 3);
  11141. * // => [81, 6]
  11142. *
  11143. * func(10, 5);
  11144. * // => [100, 10]
  11145. */
  11146. var overArgs = castRest(function(func, transforms) {
  11147. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11148. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11149. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11150. var funcsLength = transforms.length;
  11151. return baseRest(function(args) {
  11152. var index = -1,
  11153. length = nativeMin(args.length, funcsLength);
  11154. while (++index < length) {
  11155. args[index] = transforms[index].call(this, args[index]);
  11156. }
  11157. return apply(func, this, args);
  11158. });
  11159. });
  11160. /**
  11161. * Creates a function that invokes `func` with `partials` prepended to the
  11162. * arguments it receives. This method is like `_.bind` except it does **not**
  11163. * alter the `this` binding.
  11164. *
  11165. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11166. * builds, may be used as a placeholder for partially applied arguments.
  11167. *
  11168. * **Note:** This method doesn't set the "length" property of partially
  11169. * applied functions.
  11170. *
  11171. * @static
  11172. * @memberOf _
  11173. * @since 0.2.0
  11174. * @category Function
  11175. * @param {Function} func The function to partially apply arguments to.
  11176. * @param {...*} [partials] The arguments to be partially applied.
  11177. * @returns {Function} Returns the new partially applied function.
  11178. * @example
  11179. *
  11180. * function greet(greeting, name) {
  11181. * return greeting + ' ' + name;
  11182. * }
  11183. *
  11184. * var sayHelloTo = _.partial(greet, 'hello');
  11185. * sayHelloTo('fred');
  11186. * // => 'hello fred'
  11187. *
  11188. * // Partially applied with placeholders.
  11189. * var greetFred = _.partial(greet, _, 'fred');
  11190. * greetFred('hi');
  11191. * // => 'hi fred'
  11192. */
  11193. var partial = baseRest(function(func, partials) {
  11194. var holders = replaceHolders(partials, getHolder(partial));
  11195. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11196. });
  11197. /**
  11198. * This method is like `_.partial` except that partially applied arguments
  11199. * are appended to the arguments it receives.
  11200. *
  11201. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11202. * builds, may be used as a placeholder for partially applied arguments.
  11203. *
  11204. * **Note:** This method doesn't set the "length" property of partially
  11205. * applied functions.
  11206. *
  11207. * @static
  11208. * @memberOf _
  11209. * @since 1.0.0
  11210. * @category Function
  11211. * @param {Function} func The function to partially apply arguments to.
  11212. * @param {...*} [partials] The arguments to be partially applied.
  11213. * @returns {Function} Returns the new partially applied function.
  11214. * @example
  11215. *
  11216. * function greet(greeting, name) {
  11217. * return greeting + ' ' + name;
  11218. * }
  11219. *
  11220. * var greetFred = _.partialRight(greet, 'fred');
  11221. * greetFred('hi');
  11222. * // => 'hi fred'
  11223. *
  11224. * // Partially applied with placeholders.
  11225. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11226. * sayHelloTo('fred');
  11227. * // => 'hello fred'
  11228. */
  11229. var partialRight = baseRest(function(func, partials) {
  11230. var holders = replaceHolders(partials, getHolder(partialRight));
  11231. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11232. });
  11233. /**
  11234. * Creates a function that invokes `func` with arguments arranged according
  11235. * to the specified `indexes` where the argument value at the first index is
  11236. * provided as the first argument, the argument value at the second index is
  11237. * provided as the second argument, and so on.
  11238. *
  11239. * @static
  11240. * @memberOf _
  11241. * @since 3.0.0
  11242. * @category Function
  11243. * @param {Function} func The function to rearrange arguments for.
  11244. * @param {...(number|number[])} indexes The arranged argument indexes.
  11245. * @returns {Function} Returns the new function.
  11246. * @example
  11247. *
  11248. * var rearged = _.rearg(function(a, b, c) {
  11249. * return [a, b, c];
  11250. * }, [2, 0, 1]);
  11251. *
  11252. * rearged('b', 'c', 'a')
  11253. * // => ['a', 'b', 'c']
  11254. */
  11255. var rearg = flatRest(function(func, indexes) {
  11256. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11257. });
  11258. /**
  11259. * Creates a function that invokes `func` with the `this` binding of the
  11260. * created function and arguments from `start` and beyond provided as
  11261. * an array.
  11262. *
  11263. * **Note:** This method is based on the
  11264. * [rest parameter](https://mdn.io/rest_parameters).
  11265. *
  11266. * @static
  11267. * @memberOf _
  11268. * @since 4.0.0
  11269. * @category Function
  11270. * @param {Function} func The function to apply a rest parameter to.
  11271. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11272. * @returns {Function} Returns the new function.
  11273. * @example
  11274. *
  11275. * var say = _.rest(function(what, names) {
  11276. * return what + ' ' + _.initial(names).join(', ') +
  11277. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11278. * });
  11279. *
  11280. * say('hello', 'fred', 'barney', 'pebbles');
  11281. * // => 'hello fred, barney, & pebbles'
  11282. */
  11283. function rest(func, start) {
  11284. if (typeof func != 'function') {
  11285. throw new TypeError(FUNC_ERROR_TEXT);
  11286. }
  11287. start = start === undefined ? start : toInteger(start);
  11288. return baseRest(func, start);
  11289. }
  11290. /**
  11291. * Creates a function that invokes `func` with the `this` binding of the
  11292. * create function and an array of arguments much like
  11293. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11294. *
  11295. * **Note:** This method is based on the
  11296. * [spread operator](https://mdn.io/spread_operator).
  11297. *
  11298. * @static
  11299. * @memberOf _
  11300. * @since 3.2.0
  11301. * @category Function
  11302. * @param {Function} func The function to spread arguments over.
  11303. * @param {number} [start=0] The start position of the spread.
  11304. * @returns {Function} Returns the new function.
  11305. * @example
  11306. *
  11307. * var say = _.spread(function(who, what) {
  11308. * return who + ' says ' + what;
  11309. * });
  11310. *
  11311. * say(['fred', 'hello']);
  11312. * // => 'fred says hello'
  11313. *
  11314. * var numbers = Promise.all([
  11315. * Promise.resolve(40),
  11316. * Promise.resolve(36)
  11317. * ]);
  11318. *
  11319. * numbers.then(_.spread(function(x, y) {
  11320. * return x + y;
  11321. * }));
  11322. * // => a Promise of 76
  11323. */
  11324. function spread(func, start) {
  11325. if (typeof func != 'function') {
  11326. throw new TypeError(FUNC_ERROR_TEXT);
  11327. }
  11328. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11329. return baseRest(function(args) {
  11330. var array = args[start],
  11331. otherArgs = castSlice(args, 0, start);
  11332. if (array) {
  11333. arrayPush(otherArgs, array);
  11334. }
  11335. return apply(func, this, otherArgs);
  11336. });
  11337. }
  11338. /**
  11339. * Creates a throttled function that only invokes `func` at most once per
  11340. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11341. * method to cancel delayed `func` invocations and a `flush` method to
  11342. * immediately invoke them. Provide `options` to indicate whether `func`
  11343. * should be invoked on the leading and/or trailing edge of the `wait`
  11344. * timeout. The `func` is invoked with the last arguments provided to the
  11345. * throttled function. Subsequent calls to the throttled function return the
  11346. * result of the last `func` invocation.
  11347. *
  11348. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11349. * invoked on the trailing edge of the timeout only if the throttled function
  11350. * is invoked more than once during the `wait` timeout.
  11351. *
  11352. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11353. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11354. *
  11355. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11356. * for details over the differences between `_.throttle` and `_.debounce`.
  11357. *
  11358. * @static
  11359. * @memberOf _
  11360. * @since 0.1.0
  11361. * @category Function
  11362. * @param {Function} func The function to throttle.
  11363. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11364. * @param {Object} [options={}] The options object.
  11365. * @param {boolean} [options.leading=true]
  11366. * Specify invoking on the leading edge of the timeout.
  11367. * @param {boolean} [options.trailing=true]
  11368. * Specify invoking on the trailing edge of the timeout.
  11369. * @returns {Function} Returns the new throttled function.
  11370. * @example
  11371. *
  11372. * // Avoid excessively updating the position while scrolling.
  11373. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11374. *
  11375. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11376. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11377. * jQuery(element).on('click', throttled);
  11378. *
  11379. * // Cancel the trailing throttled invocation.
  11380. * jQuery(window).on('popstate', throttled.cancel);
  11381. */
  11382. function throttle(func, wait, options) {
  11383. var leading = true,
  11384. trailing = true;
  11385. if (typeof func != 'function') {
  11386. throw new TypeError(FUNC_ERROR_TEXT);
  11387. }
  11388. if (isObject(options)) {
  11389. leading = 'leading' in options ? !!options.leading : leading;
  11390. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11391. }
  11392. return debounce(func, wait, {
  11393. 'leading': leading,
  11394. 'maxWait': wait,
  11395. 'trailing': trailing
  11396. });
  11397. }
  11398. /**
  11399. * Creates a function that accepts up to one argument, ignoring any
  11400. * additional arguments.
  11401. *
  11402. * @static
  11403. * @memberOf _
  11404. * @since 4.0.0
  11405. * @category Function
  11406. * @param {Function} func The function to cap arguments for.
  11407. * @returns {Function} Returns the new capped function.
  11408. * @example
  11409. *
  11410. * _.map(['6', '8', '10'], _.unary(parseInt));
  11411. * // => [6, 8, 10]
  11412. */
  11413. function unary(func) {
  11414. return ary(func, 1);
  11415. }
  11416. /**
  11417. * Creates a function that provides `value` to `wrapper` as its first
  11418. * argument. Any additional arguments provided to the function are appended
  11419. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11420. * binding of the created function.
  11421. *
  11422. * @static
  11423. * @memberOf _
  11424. * @since 0.1.0
  11425. * @category Function
  11426. * @param {*} value The value to wrap.
  11427. * @param {Function} [wrapper=identity] The wrapper function.
  11428. * @returns {Function} Returns the new function.
  11429. * @example
  11430. *
  11431. * var p = _.wrap(_.escape, function(func, text) {
  11432. * return '<p>' + func(text) + '</p>';
  11433. * });
  11434. *
  11435. * p('fred, barney, & pebbles');
  11436. * // => '<p>fred, barney, &amp; pebbles</p>'
  11437. */
  11438. function wrap(value, wrapper) {
  11439. return partial(castFunction(wrapper), value);
  11440. }
  11441. /*------------------------------------------------------------------------*/
  11442. /**
  11443. * Casts `value` as an array if it's not one.
  11444. *
  11445. * @static
  11446. * @memberOf _
  11447. * @since 4.4.0
  11448. * @category Lang
  11449. * @param {*} value The value to inspect.
  11450. * @returns {Array} Returns the cast array.
  11451. * @example
  11452. *
  11453. * _.castArray(1);
  11454. * // => [1]
  11455. *
  11456. * _.castArray({ 'a': 1 });
  11457. * // => [{ 'a': 1 }]
  11458. *
  11459. * _.castArray('abc');
  11460. * // => ['abc']
  11461. *
  11462. * _.castArray(null);
  11463. * // => [null]
  11464. *
  11465. * _.castArray(undefined);
  11466. * // => [undefined]
  11467. *
  11468. * _.castArray();
  11469. * // => []
  11470. *
  11471. * var array = [1, 2, 3];
  11472. * console.log(_.castArray(array) === array);
  11473. * // => true
  11474. */
  11475. function castArray() {
  11476. if (!arguments.length) {
  11477. return [];
  11478. }
  11479. var value = arguments[0];
  11480. return isArray(value) ? value : [value];
  11481. }
  11482. /**
  11483. * Creates a shallow clone of `value`.
  11484. *
  11485. * **Note:** This method is loosely based on the
  11486. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11487. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11488. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11489. * arrays. The own enumerable properties of `arguments` objects are cloned
  11490. * as plain objects. An empty object is returned for uncloneable values such
  11491. * as error objects, functions, DOM nodes, and WeakMaps.
  11492. *
  11493. * @static
  11494. * @memberOf _
  11495. * @since 0.1.0
  11496. * @category Lang
  11497. * @param {*} value The value to clone.
  11498. * @returns {*} Returns the cloned value.
  11499. * @see _.cloneDeep
  11500. * @example
  11501. *
  11502. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11503. *
  11504. * var shallow = _.clone(objects);
  11505. * console.log(shallow[0] === objects[0]);
  11506. * // => true
  11507. */
  11508. function clone(value) {
  11509. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11510. }
  11511. /**
  11512. * This method is like `_.clone` except that it accepts `customizer` which
  11513. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11514. * cloning is handled by the method instead. The `customizer` is invoked with
  11515. * up to four arguments; (value [, index|key, object, stack]).
  11516. *
  11517. * @static
  11518. * @memberOf _
  11519. * @since 4.0.0
  11520. * @category Lang
  11521. * @param {*} value The value to clone.
  11522. * @param {Function} [customizer] The function to customize cloning.
  11523. * @returns {*} Returns the cloned value.
  11524. * @see _.cloneDeepWith
  11525. * @example
  11526. *
  11527. * function customizer(value) {
  11528. * if (_.isElement(value)) {
  11529. * return value.cloneNode(false);
  11530. * }
  11531. * }
  11532. *
  11533. * var el = _.cloneWith(document.body, customizer);
  11534. *
  11535. * console.log(el === document.body);
  11536. * // => false
  11537. * console.log(el.nodeName);
  11538. * // => 'BODY'
  11539. * console.log(el.childNodes.length);
  11540. * // => 0
  11541. */
  11542. function cloneWith(value, customizer) {
  11543. customizer = typeof customizer == 'function' ? customizer : undefined;
  11544. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11545. }
  11546. /**
  11547. * This method is like `_.clone` except that it recursively clones `value`.
  11548. *
  11549. * @static
  11550. * @memberOf _
  11551. * @since 1.0.0
  11552. * @category Lang
  11553. * @param {*} value The value to recursively clone.
  11554. * @returns {*} Returns the deep cloned value.
  11555. * @see _.clone
  11556. * @example
  11557. *
  11558. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11559. *
  11560. * var deep = _.cloneDeep(objects);
  11561. * console.log(deep[0] === objects[0]);
  11562. * // => false
  11563. */
  11564. function cloneDeep(value) {
  11565. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11566. }
  11567. /**
  11568. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11569. *
  11570. * @static
  11571. * @memberOf _
  11572. * @since 4.0.0
  11573. * @category Lang
  11574. * @param {*} value The value to recursively clone.
  11575. * @param {Function} [customizer] The function to customize cloning.
  11576. * @returns {*} Returns the deep cloned value.
  11577. * @see _.cloneWith
  11578. * @example
  11579. *
  11580. * function customizer(value) {
  11581. * if (_.isElement(value)) {
  11582. * return value.cloneNode(true);
  11583. * }
  11584. * }
  11585. *
  11586. * var el = _.cloneDeepWith(document.body, customizer);
  11587. *
  11588. * console.log(el === document.body);
  11589. * // => false
  11590. * console.log(el.nodeName);
  11591. * // => 'BODY'
  11592. * console.log(el.childNodes.length);
  11593. * // => 20
  11594. */
  11595. function cloneDeepWith(value, customizer) {
  11596. customizer = typeof customizer == 'function' ? customizer : undefined;
  11597. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11598. }
  11599. /**
  11600. * Checks if `object` conforms to `source` by invoking the predicate
  11601. * properties of `source` with the corresponding property values of `object`.
  11602. *
  11603. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11604. * partially applied.
  11605. *
  11606. * @static
  11607. * @memberOf _
  11608. * @since 4.14.0
  11609. * @category Lang
  11610. * @param {Object} object The object to inspect.
  11611. * @param {Object} source The object of property predicates to conform to.
  11612. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11613. * @example
  11614. *
  11615. * var object = { 'a': 1, 'b': 2 };
  11616. *
  11617. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11618. * // => true
  11619. *
  11620. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11621. * // => false
  11622. */
  11623. function conformsTo(object, source) {
  11624. return source == null || baseConformsTo(object, source, keys(source));
  11625. }
  11626. /**
  11627. * Performs a
  11628. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11629. * comparison between two values to determine if they are equivalent.
  11630. *
  11631. * @static
  11632. * @memberOf _
  11633. * @since 4.0.0
  11634. * @category Lang
  11635. * @param {*} value The value to compare.
  11636. * @param {*} other The other value to compare.
  11637. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11638. * @example
  11639. *
  11640. * var object = { 'a': 1 };
  11641. * var other = { 'a': 1 };
  11642. *
  11643. * _.eq(object, object);
  11644. * // => true
  11645. *
  11646. * _.eq(object, other);
  11647. * // => false
  11648. *
  11649. * _.eq('a', 'a');
  11650. * // => true
  11651. *
  11652. * _.eq('a', Object('a'));
  11653. * // => false
  11654. *
  11655. * _.eq(NaN, NaN);
  11656. * // => true
  11657. */
  11658. function eq(value, other) {
  11659. return value === other || (value !== value && other !== other);
  11660. }
  11661. /**
  11662. * Checks if `value` is greater than `other`.
  11663. *
  11664. * @static
  11665. * @memberOf _
  11666. * @since 3.9.0
  11667. * @category Lang
  11668. * @param {*} value The value to compare.
  11669. * @param {*} other The other value to compare.
  11670. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11671. * else `false`.
  11672. * @see _.lt
  11673. * @example
  11674. *
  11675. * _.gt(3, 1);
  11676. * // => true
  11677. *
  11678. * _.gt(3, 3);
  11679. * // => false
  11680. *
  11681. * _.gt(1, 3);
  11682. * // => false
  11683. */
  11684. var gt = createRelationalOperation(baseGt);
  11685. /**
  11686. * Checks if `value` is greater than or equal to `other`.
  11687. *
  11688. * @static
  11689. * @memberOf _
  11690. * @since 3.9.0
  11691. * @category Lang
  11692. * @param {*} value The value to compare.
  11693. * @param {*} other The other value to compare.
  11694. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11695. * `other`, else `false`.
  11696. * @see _.lte
  11697. * @example
  11698. *
  11699. * _.gte(3, 1);
  11700. * // => true
  11701. *
  11702. * _.gte(3, 3);
  11703. * // => true
  11704. *
  11705. * _.gte(1, 3);
  11706. * // => false
  11707. */
  11708. var gte = createRelationalOperation(function(value, other) {
  11709. return value >= other;
  11710. });
  11711. /**
  11712. * Checks if `value` is likely an `arguments` object.
  11713. *
  11714. * @static
  11715. * @memberOf _
  11716. * @since 0.1.0
  11717. * @category Lang
  11718. * @param {*} value The value to check.
  11719. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11720. * else `false`.
  11721. * @example
  11722. *
  11723. * _.isArguments(function() { return arguments; }());
  11724. * // => true
  11725. *
  11726. * _.isArguments([1, 2, 3]);
  11727. * // => false
  11728. */
  11729. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11730. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11731. !propertyIsEnumerable.call(value, 'callee');
  11732. };
  11733. /**
  11734. * Checks if `value` is classified as an `Array` object.
  11735. *
  11736. * @static
  11737. * @memberOf _
  11738. * @since 0.1.0
  11739. * @category Lang
  11740. * @param {*} value The value to check.
  11741. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11742. * @example
  11743. *
  11744. * _.isArray([1, 2, 3]);
  11745. * // => true
  11746. *
  11747. * _.isArray(document.body.children);
  11748. * // => false
  11749. *
  11750. * _.isArray('abc');
  11751. * // => false
  11752. *
  11753. * _.isArray(_.noop);
  11754. * // => false
  11755. */
  11756. var isArray = Array.isArray;
  11757. /**
  11758. * Checks if `value` is classified as an `ArrayBuffer` object.
  11759. *
  11760. * @static
  11761. * @memberOf _
  11762. * @since 4.3.0
  11763. * @category Lang
  11764. * @param {*} value The value to check.
  11765. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11766. * @example
  11767. *
  11768. * _.isArrayBuffer(new ArrayBuffer(2));
  11769. * // => true
  11770. *
  11771. * _.isArrayBuffer(new Array(2));
  11772. * // => false
  11773. */
  11774. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11775. /**
  11776. * Checks if `value` is array-like. A value is considered array-like if it's
  11777. * not a function and has a `value.length` that's an integer greater than or
  11778. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11779. *
  11780. * @static
  11781. * @memberOf _
  11782. * @since 4.0.0
  11783. * @category Lang
  11784. * @param {*} value The value to check.
  11785. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11786. * @example
  11787. *
  11788. * _.isArrayLike([1, 2, 3]);
  11789. * // => true
  11790. *
  11791. * _.isArrayLike(document.body.children);
  11792. * // => true
  11793. *
  11794. * _.isArrayLike('abc');
  11795. * // => true
  11796. *
  11797. * _.isArrayLike(_.noop);
  11798. * // => false
  11799. */
  11800. function isArrayLike(value) {
  11801. return value != null && isLength(value.length) && !isFunction(value);
  11802. }
  11803. /**
  11804. * This method is like `_.isArrayLike` except that it also checks if `value`
  11805. * is an object.
  11806. *
  11807. * @static
  11808. * @memberOf _
  11809. * @since 4.0.0
  11810. * @category Lang
  11811. * @param {*} value The value to check.
  11812. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11813. * else `false`.
  11814. * @example
  11815. *
  11816. * _.isArrayLikeObject([1, 2, 3]);
  11817. * // => true
  11818. *
  11819. * _.isArrayLikeObject(document.body.children);
  11820. * // => true
  11821. *
  11822. * _.isArrayLikeObject('abc');
  11823. * // => false
  11824. *
  11825. * _.isArrayLikeObject(_.noop);
  11826. * // => false
  11827. */
  11828. function isArrayLikeObject(value) {
  11829. return isObjectLike(value) && isArrayLike(value);
  11830. }
  11831. /**
  11832. * Checks if `value` is classified as a boolean primitive or object.
  11833. *
  11834. * @static
  11835. * @memberOf _
  11836. * @since 0.1.0
  11837. * @category Lang
  11838. * @param {*} value The value to check.
  11839. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11840. * @example
  11841. *
  11842. * _.isBoolean(false);
  11843. * // => true
  11844. *
  11845. * _.isBoolean(null);
  11846. * // => false
  11847. */
  11848. function isBoolean(value) {
  11849. return value === true || value === false ||
  11850. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11851. }
  11852. /**
  11853. * Checks if `value` is a buffer.
  11854. *
  11855. * @static
  11856. * @memberOf _
  11857. * @since 4.3.0
  11858. * @category Lang
  11859. * @param {*} value The value to check.
  11860. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11861. * @example
  11862. *
  11863. * _.isBuffer(new Buffer(2));
  11864. * // => true
  11865. *
  11866. * _.isBuffer(new Uint8Array(2));
  11867. * // => false
  11868. */
  11869. var isBuffer = nativeIsBuffer || stubFalse;
  11870. /**
  11871. * Checks if `value` is classified as a `Date` object.
  11872. *
  11873. * @static
  11874. * @memberOf _
  11875. * @since 0.1.0
  11876. * @category Lang
  11877. * @param {*} value The value to check.
  11878. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11879. * @example
  11880. *
  11881. * _.isDate(new Date);
  11882. * // => true
  11883. *
  11884. * _.isDate('Mon April 23 2012');
  11885. * // => false
  11886. */
  11887. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11888. /**
  11889. * Checks if `value` is likely a DOM element.
  11890. *
  11891. * @static
  11892. * @memberOf _
  11893. * @since 0.1.0
  11894. * @category Lang
  11895. * @param {*} value The value to check.
  11896. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11897. * @example
  11898. *
  11899. * _.isElement(document.body);
  11900. * // => true
  11901. *
  11902. * _.isElement('<body>');
  11903. * // => false
  11904. */
  11905. function isElement(value) {
  11906. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11907. }
  11908. /**
  11909. * Checks if `value` is an empty object, collection, map, or set.
  11910. *
  11911. * Objects are considered empty if they have no own enumerable string keyed
  11912. * properties.
  11913. *
  11914. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11915. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11916. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11917. *
  11918. * @static
  11919. * @memberOf _
  11920. * @since 0.1.0
  11921. * @category Lang
  11922. * @param {*} value The value to check.
  11923. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11924. * @example
  11925. *
  11926. * _.isEmpty(null);
  11927. * // => true
  11928. *
  11929. * _.isEmpty(true);
  11930. * // => true
  11931. *
  11932. * _.isEmpty(1);
  11933. * // => true
  11934. *
  11935. * _.isEmpty([1, 2, 3]);
  11936. * // => false
  11937. *
  11938. * _.isEmpty({ 'a': 1 });
  11939. * // => false
  11940. */
  11941. function isEmpty(value) {
  11942. if (value == null) {
  11943. return true;
  11944. }
  11945. if (isArrayLike(value) &&
  11946. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11947. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11948. return !value.length;
  11949. }
  11950. var tag = getTag(value);
  11951. if (tag == mapTag || tag == setTag) {
  11952. return !value.size;
  11953. }
  11954. if (isPrototype(value)) {
  11955. return !baseKeys(value).length;
  11956. }
  11957. for (var key in value) {
  11958. if (hasOwnProperty.call(value, key)) {
  11959. return false;
  11960. }
  11961. }
  11962. return true;
  11963. }
  11964. /**
  11965. * Performs a deep comparison between two values to determine if they are
  11966. * equivalent.
  11967. *
  11968. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11969. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11970. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11971. * by their own, not inherited, enumerable properties. Functions and DOM
  11972. * nodes are compared by strict equality, i.e. `===`.
  11973. *
  11974. * @static
  11975. * @memberOf _
  11976. * @since 0.1.0
  11977. * @category Lang
  11978. * @param {*} value The value to compare.
  11979. * @param {*} other The other value to compare.
  11980. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11981. * @example
  11982. *
  11983. * var object = { 'a': 1 };
  11984. * var other = { 'a': 1 };
  11985. *
  11986. * _.isEqual(object, other);
  11987. * // => true
  11988. *
  11989. * object === other;
  11990. * // => false
  11991. */
  11992. function isEqual(value, other) {
  11993. return baseIsEqual(value, other);
  11994. }
  11995. /**
  11996. * This method is like `_.isEqual` except that it accepts `customizer` which
  11997. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11998. * are handled by the method instead. The `customizer` is invoked with up to
  11999. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12000. *
  12001. * @static
  12002. * @memberOf _
  12003. * @since 4.0.0
  12004. * @category Lang
  12005. * @param {*} value The value to compare.
  12006. * @param {*} other The other value to compare.
  12007. * @param {Function} [customizer] The function to customize comparisons.
  12008. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12009. * @example
  12010. *
  12011. * function isGreeting(value) {
  12012. * return /^h(?:i|ello)$/.test(value);
  12013. * }
  12014. *
  12015. * function customizer(objValue, othValue) {
  12016. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12017. * return true;
  12018. * }
  12019. * }
  12020. *
  12021. * var array = ['hello', 'goodbye'];
  12022. * var other = ['hi', 'goodbye'];
  12023. *
  12024. * _.isEqualWith(array, other, customizer);
  12025. * // => true
  12026. */
  12027. function isEqualWith(value, other, customizer) {
  12028. customizer = typeof customizer == 'function' ? customizer : undefined;
  12029. var result = customizer ? customizer(value, other) : undefined;
  12030. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12031. }
  12032. /**
  12033. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12034. * `SyntaxError`, `TypeError`, or `URIError` object.
  12035. *
  12036. * @static
  12037. * @memberOf _
  12038. * @since 3.0.0
  12039. * @category Lang
  12040. * @param {*} value The value to check.
  12041. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12042. * @example
  12043. *
  12044. * _.isError(new Error);
  12045. * // => true
  12046. *
  12047. * _.isError(Error);
  12048. * // => false
  12049. */
  12050. function isError(value) {
  12051. if (!isObjectLike(value)) {
  12052. return false;
  12053. }
  12054. var tag = baseGetTag(value);
  12055. return tag == errorTag || tag == domExcTag ||
  12056. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12057. }
  12058. /**
  12059. * Checks if `value` is a finite primitive number.
  12060. *
  12061. * **Note:** This method is based on
  12062. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12063. *
  12064. * @static
  12065. * @memberOf _
  12066. * @since 0.1.0
  12067. * @category Lang
  12068. * @param {*} value The value to check.
  12069. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12070. * @example
  12071. *
  12072. * _.isFinite(3);
  12073. * // => true
  12074. *
  12075. * _.isFinite(Number.MIN_VALUE);
  12076. * // => true
  12077. *
  12078. * _.isFinite(Infinity);
  12079. * // => false
  12080. *
  12081. * _.isFinite('3');
  12082. * // => false
  12083. */
  12084. function isFinite(value) {
  12085. return typeof value == 'number' && nativeIsFinite(value);
  12086. }
  12087. /**
  12088. * Checks if `value` is classified as a `Function` object.
  12089. *
  12090. * @static
  12091. * @memberOf _
  12092. * @since 0.1.0
  12093. * @category Lang
  12094. * @param {*} value The value to check.
  12095. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12096. * @example
  12097. *
  12098. * _.isFunction(_);
  12099. * // => true
  12100. *
  12101. * _.isFunction(/abc/);
  12102. * // => false
  12103. */
  12104. function isFunction(value) {
  12105. if (!isObject(value)) {
  12106. return false;
  12107. }
  12108. // The use of `Object#toString` avoids issues with the `typeof` operator
  12109. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12110. var tag = baseGetTag(value);
  12111. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12112. }
  12113. /**
  12114. * Checks if `value` is an integer.
  12115. *
  12116. * **Note:** This method is based on
  12117. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12118. *
  12119. * @static
  12120. * @memberOf _
  12121. * @since 4.0.0
  12122. * @category Lang
  12123. * @param {*} value The value to check.
  12124. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12125. * @example
  12126. *
  12127. * _.isInteger(3);
  12128. * // => true
  12129. *
  12130. * _.isInteger(Number.MIN_VALUE);
  12131. * // => false
  12132. *
  12133. * _.isInteger(Infinity);
  12134. * // => false
  12135. *
  12136. * _.isInteger('3');
  12137. * // => false
  12138. */
  12139. function isInteger(value) {
  12140. return typeof value == 'number' && value == toInteger(value);
  12141. }
  12142. /**
  12143. * Checks if `value` is a valid array-like length.
  12144. *
  12145. * **Note:** This method is loosely based on
  12146. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12147. *
  12148. * @static
  12149. * @memberOf _
  12150. * @since 4.0.0
  12151. * @category Lang
  12152. * @param {*} value The value to check.
  12153. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12154. * @example
  12155. *
  12156. * _.isLength(3);
  12157. * // => true
  12158. *
  12159. * _.isLength(Number.MIN_VALUE);
  12160. * // => false
  12161. *
  12162. * _.isLength(Infinity);
  12163. * // => false
  12164. *
  12165. * _.isLength('3');
  12166. * // => false
  12167. */
  12168. function isLength(value) {
  12169. return typeof value == 'number' &&
  12170. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12171. }
  12172. /**
  12173. * Checks if `value` is the
  12174. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12175. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12176. *
  12177. * @static
  12178. * @memberOf _
  12179. * @since 0.1.0
  12180. * @category Lang
  12181. * @param {*} value The value to check.
  12182. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12183. * @example
  12184. *
  12185. * _.isObject({});
  12186. * // => true
  12187. *
  12188. * _.isObject([1, 2, 3]);
  12189. * // => true
  12190. *
  12191. * _.isObject(_.noop);
  12192. * // => true
  12193. *
  12194. * _.isObject(null);
  12195. * // => false
  12196. */
  12197. function isObject(value) {
  12198. var type = typeof value;
  12199. return value != null && (type == 'object' || type == 'function');
  12200. }
  12201. /**
  12202. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12203. * and has a `typeof` result of "object".
  12204. *
  12205. * @static
  12206. * @memberOf _
  12207. * @since 4.0.0
  12208. * @category Lang
  12209. * @param {*} value The value to check.
  12210. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12211. * @example
  12212. *
  12213. * _.isObjectLike({});
  12214. * // => true
  12215. *
  12216. * _.isObjectLike([1, 2, 3]);
  12217. * // => true
  12218. *
  12219. * _.isObjectLike(_.noop);
  12220. * // => false
  12221. *
  12222. * _.isObjectLike(null);
  12223. * // => false
  12224. */
  12225. function isObjectLike(value) {
  12226. return value != null && typeof value == 'object';
  12227. }
  12228. /**
  12229. * Checks if `value` is classified as a `Map` object.
  12230. *
  12231. * @static
  12232. * @memberOf _
  12233. * @since 4.3.0
  12234. * @category Lang
  12235. * @param {*} value The value to check.
  12236. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12237. * @example
  12238. *
  12239. * _.isMap(new Map);
  12240. * // => true
  12241. *
  12242. * _.isMap(new WeakMap);
  12243. * // => false
  12244. */
  12245. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12246. /**
  12247. * Performs a partial deep comparison between `object` and `source` to
  12248. * determine if `object` contains equivalent property values.
  12249. *
  12250. * **Note:** This method is equivalent to `_.matches` when `source` is
  12251. * partially applied.
  12252. *
  12253. * Partial comparisons will match empty array and empty object `source`
  12254. * values against any array or object value, respectively. See `_.isEqual`
  12255. * for a list of supported value comparisons.
  12256. *
  12257. * @static
  12258. * @memberOf _
  12259. * @since 3.0.0
  12260. * @category Lang
  12261. * @param {Object} object The object to inspect.
  12262. * @param {Object} source The object of property values to match.
  12263. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12264. * @example
  12265. *
  12266. * var object = { 'a': 1, 'b': 2 };
  12267. *
  12268. * _.isMatch(object, { 'b': 2 });
  12269. * // => true
  12270. *
  12271. * _.isMatch(object, { 'b': 1 });
  12272. * // => false
  12273. */
  12274. function isMatch(object, source) {
  12275. return object === source || baseIsMatch(object, source, getMatchData(source));
  12276. }
  12277. /**
  12278. * This method is like `_.isMatch` except that it accepts `customizer` which
  12279. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12280. * are handled by the method instead. The `customizer` is invoked with five
  12281. * arguments: (objValue, srcValue, index|key, object, source).
  12282. *
  12283. * @static
  12284. * @memberOf _
  12285. * @since 4.0.0
  12286. * @category Lang
  12287. * @param {Object} object The object to inspect.
  12288. * @param {Object} source The object of property values to match.
  12289. * @param {Function} [customizer] The function to customize comparisons.
  12290. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12291. * @example
  12292. *
  12293. * function isGreeting(value) {
  12294. * return /^h(?:i|ello)$/.test(value);
  12295. * }
  12296. *
  12297. * function customizer(objValue, srcValue) {
  12298. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12299. * return true;
  12300. * }
  12301. * }
  12302. *
  12303. * var object = { 'greeting': 'hello' };
  12304. * var source = { 'greeting': 'hi' };
  12305. *
  12306. * _.isMatchWith(object, source, customizer);
  12307. * // => true
  12308. */
  12309. function isMatchWith(object, source, customizer) {
  12310. customizer = typeof customizer == 'function' ? customizer : undefined;
  12311. return baseIsMatch(object, source, getMatchData(source), customizer);
  12312. }
  12313. /**
  12314. * Checks if `value` is `NaN`.
  12315. *
  12316. * **Note:** This method is based on
  12317. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12318. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12319. * `undefined` and other non-number values.
  12320. *
  12321. * @static
  12322. * @memberOf _
  12323. * @since 0.1.0
  12324. * @category Lang
  12325. * @param {*} value The value to check.
  12326. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12327. * @example
  12328. *
  12329. * _.isNaN(NaN);
  12330. * // => true
  12331. *
  12332. * _.isNaN(new Number(NaN));
  12333. * // => true
  12334. *
  12335. * isNaN(undefined);
  12336. * // => true
  12337. *
  12338. * _.isNaN(undefined);
  12339. * // => false
  12340. */
  12341. function isNaN(value) {
  12342. // An `NaN` primitive is the only value that is not equal to itself.
  12343. // Perform the `toStringTag` check first to avoid errors with some
  12344. // ActiveX objects in IE.
  12345. return isNumber(value) && value != +value;
  12346. }
  12347. /**
  12348. * Checks if `value` is a pristine native function.
  12349. *
  12350. * **Note:** This method can't reliably detect native functions in the presence
  12351. * of the core-js package because core-js circumvents this kind of detection.
  12352. * Despite multiple requests, the core-js maintainer has made it clear: any
  12353. * attempt to fix the detection will be obstructed. As a result, we're left
  12354. * with little choice but to throw an error. Unfortunately, this also affects
  12355. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12356. * which rely on core-js.
  12357. *
  12358. * @static
  12359. * @memberOf _
  12360. * @since 3.0.0
  12361. * @category Lang
  12362. * @param {*} value The value to check.
  12363. * @returns {boolean} Returns `true` if `value` is a native function,
  12364. * else `false`.
  12365. * @example
  12366. *
  12367. * _.isNative(Array.prototype.push);
  12368. * // => true
  12369. *
  12370. * _.isNative(_);
  12371. * // => false
  12372. */
  12373. function isNative(value) {
  12374. if (isMaskable(value)) {
  12375. throw new Error(CORE_ERROR_TEXT);
  12376. }
  12377. return baseIsNative(value);
  12378. }
  12379. /**
  12380. * Checks if `value` is `null`.
  12381. *
  12382. * @static
  12383. * @memberOf _
  12384. * @since 0.1.0
  12385. * @category Lang
  12386. * @param {*} value The value to check.
  12387. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12388. * @example
  12389. *
  12390. * _.isNull(null);
  12391. * // => true
  12392. *
  12393. * _.isNull(void 0);
  12394. * // => false
  12395. */
  12396. function isNull(value) {
  12397. return value === null;
  12398. }
  12399. /**
  12400. * Checks if `value` is `null` or `undefined`.
  12401. *
  12402. * @static
  12403. * @memberOf _
  12404. * @since 4.0.0
  12405. * @category Lang
  12406. * @param {*} value The value to check.
  12407. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12408. * @example
  12409. *
  12410. * _.isNil(null);
  12411. * // => true
  12412. *
  12413. * _.isNil(void 0);
  12414. * // => true
  12415. *
  12416. * _.isNil(NaN);
  12417. * // => false
  12418. */
  12419. function isNil(value) {
  12420. return value == null;
  12421. }
  12422. /**
  12423. * Checks if `value` is classified as a `Number` primitive or object.
  12424. *
  12425. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12426. * classified as numbers, use the `_.isFinite` method.
  12427. *
  12428. * @static
  12429. * @memberOf _
  12430. * @since 0.1.0
  12431. * @category Lang
  12432. * @param {*} value The value to check.
  12433. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12434. * @example
  12435. *
  12436. * _.isNumber(3);
  12437. * // => true
  12438. *
  12439. * _.isNumber(Number.MIN_VALUE);
  12440. * // => true
  12441. *
  12442. * _.isNumber(Infinity);
  12443. * // => true
  12444. *
  12445. * _.isNumber('3');
  12446. * // => false
  12447. */
  12448. function isNumber(value) {
  12449. return typeof value == 'number' ||
  12450. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12451. }
  12452. /**
  12453. * Checks if `value` is a plain object, that is, an object created by the
  12454. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12455. *
  12456. * @static
  12457. * @memberOf _
  12458. * @since 0.8.0
  12459. * @category Lang
  12460. * @param {*} value The value to check.
  12461. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12462. * @example
  12463. *
  12464. * function Foo() {
  12465. * this.a = 1;
  12466. * }
  12467. *
  12468. * _.isPlainObject(new Foo);
  12469. * // => false
  12470. *
  12471. * _.isPlainObject([1, 2, 3]);
  12472. * // => false
  12473. *
  12474. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12475. * // => true
  12476. *
  12477. * _.isPlainObject(Object.create(null));
  12478. * // => true
  12479. */
  12480. function isPlainObject(value) {
  12481. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12482. return false;
  12483. }
  12484. var proto = getPrototype(value);
  12485. if (proto === null) {
  12486. return true;
  12487. }
  12488. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12489. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12490. funcToString.call(Ctor) == objectCtorString;
  12491. }
  12492. /**
  12493. * Checks if `value` is classified as a `RegExp` object.
  12494. *
  12495. * @static
  12496. * @memberOf _
  12497. * @since 0.1.0
  12498. * @category Lang
  12499. * @param {*} value The value to check.
  12500. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12501. * @example
  12502. *
  12503. * _.isRegExp(/abc/);
  12504. * // => true
  12505. *
  12506. * _.isRegExp('/abc/');
  12507. * // => false
  12508. */
  12509. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12510. /**
  12511. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12512. * double precision number which isn't the result of a rounded unsafe integer.
  12513. *
  12514. * **Note:** This method is based on
  12515. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12516. *
  12517. * @static
  12518. * @memberOf _
  12519. * @since 4.0.0
  12520. * @category Lang
  12521. * @param {*} value The value to check.
  12522. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12523. * @example
  12524. *
  12525. * _.isSafeInteger(3);
  12526. * // => true
  12527. *
  12528. * _.isSafeInteger(Number.MIN_VALUE);
  12529. * // => false
  12530. *
  12531. * _.isSafeInteger(Infinity);
  12532. * // => false
  12533. *
  12534. * _.isSafeInteger('3');
  12535. * // => false
  12536. */
  12537. function isSafeInteger(value) {
  12538. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12539. }
  12540. /**
  12541. * Checks if `value` is classified as a `Set` object.
  12542. *
  12543. * @static
  12544. * @memberOf _
  12545. * @since 4.3.0
  12546. * @category Lang
  12547. * @param {*} value The value to check.
  12548. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12549. * @example
  12550. *
  12551. * _.isSet(new Set);
  12552. * // => true
  12553. *
  12554. * _.isSet(new WeakSet);
  12555. * // => false
  12556. */
  12557. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12558. /**
  12559. * Checks if `value` is classified as a `String` primitive or object.
  12560. *
  12561. * @static
  12562. * @since 0.1.0
  12563. * @memberOf _
  12564. * @category Lang
  12565. * @param {*} value The value to check.
  12566. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12567. * @example
  12568. *
  12569. * _.isString('abc');
  12570. * // => true
  12571. *
  12572. * _.isString(1);
  12573. * // => false
  12574. */
  12575. function isString(value) {
  12576. return typeof value == 'string' ||
  12577. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12578. }
  12579. /**
  12580. * Checks if `value` is classified as a `Symbol` primitive or object.
  12581. *
  12582. * @static
  12583. * @memberOf _
  12584. * @since 4.0.0
  12585. * @category Lang
  12586. * @param {*} value The value to check.
  12587. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12588. * @example
  12589. *
  12590. * _.isSymbol(Symbol.iterator);
  12591. * // => true
  12592. *
  12593. * _.isSymbol('abc');
  12594. * // => false
  12595. */
  12596. function isSymbol(value) {
  12597. return typeof value == 'symbol' ||
  12598. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12599. }
  12600. /**
  12601. * Checks if `value` is classified as a typed array.
  12602. *
  12603. * @static
  12604. * @memberOf _
  12605. * @since 3.0.0
  12606. * @category Lang
  12607. * @param {*} value The value to check.
  12608. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12609. * @example
  12610. *
  12611. * _.isTypedArray(new Uint8Array);
  12612. * // => true
  12613. *
  12614. * _.isTypedArray([]);
  12615. * // => false
  12616. */
  12617. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12618. /**
  12619. * Checks if `value` is `undefined`.
  12620. *
  12621. * @static
  12622. * @since 0.1.0
  12623. * @memberOf _
  12624. * @category Lang
  12625. * @param {*} value The value to check.
  12626. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12627. * @example
  12628. *
  12629. * _.isUndefined(void 0);
  12630. * // => true
  12631. *
  12632. * _.isUndefined(null);
  12633. * // => false
  12634. */
  12635. function isUndefined(value) {
  12636. return value === undefined;
  12637. }
  12638. /**
  12639. * Checks if `value` is classified as a `WeakMap` object.
  12640. *
  12641. * @static
  12642. * @memberOf _
  12643. * @since 4.3.0
  12644. * @category Lang
  12645. * @param {*} value The value to check.
  12646. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12647. * @example
  12648. *
  12649. * _.isWeakMap(new WeakMap);
  12650. * // => true
  12651. *
  12652. * _.isWeakMap(new Map);
  12653. * // => false
  12654. */
  12655. function isWeakMap(value) {
  12656. return isObjectLike(value) && getTag(value) == weakMapTag;
  12657. }
  12658. /**
  12659. * Checks if `value` is classified as a `WeakSet` object.
  12660. *
  12661. * @static
  12662. * @memberOf _
  12663. * @since 4.3.0
  12664. * @category Lang
  12665. * @param {*} value The value to check.
  12666. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12667. * @example
  12668. *
  12669. * _.isWeakSet(new WeakSet);
  12670. * // => true
  12671. *
  12672. * _.isWeakSet(new Set);
  12673. * // => false
  12674. */
  12675. function isWeakSet(value) {
  12676. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12677. }
  12678. /**
  12679. * Checks if `value` is less than `other`.
  12680. *
  12681. * @static
  12682. * @memberOf _
  12683. * @since 3.9.0
  12684. * @category Lang
  12685. * @param {*} value The value to compare.
  12686. * @param {*} other The other value to compare.
  12687. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12688. * else `false`.
  12689. * @see _.gt
  12690. * @example
  12691. *
  12692. * _.lt(1, 3);
  12693. * // => true
  12694. *
  12695. * _.lt(3, 3);
  12696. * // => false
  12697. *
  12698. * _.lt(3, 1);
  12699. * // => false
  12700. */
  12701. var lt = createRelationalOperation(baseLt);
  12702. /**
  12703. * Checks if `value` is less than or equal to `other`.
  12704. *
  12705. * @static
  12706. * @memberOf _
  12707. * @since 3.9.0
  12708. * @category Lang
  12709. * @param {*} value The value to compare.
  12710. * @param {*} other The other value to compare.
  12711. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12712. * `other`, else `false`.
  12713. * @see _.gte
  12714. * @example
  12715. *
  12716. * _.lte(1, 3);
  12717. * // => true
  12718. *
  12719. * _.lte(3, 3);
  12720. * // => true
  12721. *
  12722. * _.lte(3, 1);
  12723. * // => false
  12724. */
  12725. var lte = createRelationalOperation(function(value, other) {
  12726. return value <= other;
  12727. });
  12728. /**
  12729. * Converts `value` to an array.
  12730. *
  12731. * @static
  12732. * @since 0.1.0
  12733. * @memberOf _
  12734. * @category Lang
  12735. * @param {*} value The value to convert.
  12736. * @returns {Array} Returns the converted array.
  12737. * @example
  12738. *
  12739. * _.toArray({ 'a': 1, 'b': 2 });
  12740. * // => [1, 2]
  12741. *
  12742. * _.toArray('abc');
  12743. * // => ['a', 'b', 'c']
  12744. *
  12745. * _.toArray(1);
  12746. * // => []
  12747. *
  12748. * _.toArray(null);
  12749. * // => []
  12750. */
  12751. function toArray(value) {
  12752. if (!value) {
  12753. return [];
  12754. }
  12755. if (isArrayLike(value)) {
  12756. return isString(value) ? stringToArray(value) : copyArray(value);
  12757. }
  12758. if (symIterator && value[symIterator]) {
  12759. return iteratorToArray(value[symIterator]());
  12760. }
  12761. var tag = getTag(value),
  12762. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12763. return func(value);
  12764. }
  12765. /**
  12766. * Converts `value` to a finite number.
  12767. *
  12768. * @static
  12769. * @memberOf _
  12770. * @since 4.12.0
  12771. * @category Lang
  12772. * @param {*} value The value to convert.
  12773. * @returns {number} Returns the converted number.
  12774. * @example
  12775. *
  12776. * _.toFinite(3.2);
  12777. * // => 3.2
  12778. *
  12779. * _.toFinite(Number.MIN_VALUE);
  12780. * // => 5e-324
  12781. *
  12782. * _.toFinite(Infinity);
  12783. * // => 1.7976931348623157e+308
  12784. *
  12785. * _.toFinite('3.2');
  12786. * // => 3.2
  12787. */
  12788. function toFinite(value) {
  12789. if (!value) {
  12790. return value === 0 ? value : 0;
  12791. }
  12792. value = toNumber(value);
  12793. if (value === INFINITY || value === -INFINITY) {
  12794. var sign = (value < 0 ? -1 : 1);
  12795. return sign * MAX_INTEGER;
  12796. }
  12797. return value === value ? value : 0;
  12798. }
  12799. /**
  12800. * Converts `value` to an integer.
  12801. *
  12802. * **Note:** This method is loosely based on
  12803. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12804. *
  12805. * @static
  12806. * @memberOf _
  12807. * @since 4.0.0
  12808. * @category Lang
  12809. * @param {*} value The value to convert.
  12810. * @returns {number} Returns the converted integer.
  12811. * @example
  12812. *
  12813. * _.toInteger(3.2);
  12814. * // => 3
  12815. *
  12816. * _.toInteger(Number.MIN_VALUE);
  12817. * // => 0
  12818. *
  12819. * _.toInteger(Infinity);
  12820. * // => 1.7976931348623157e+308
  12821. *
  12822. * _.toInteger('3.2');
  12823. * // => 3
  12824. */
  12825. function toInteger(value) {
  12826. var result = toFinite(value),
  12827. remainder = result % 1;
  12828. return result === result ? (remainder ? result - remainder : result) : 0;
  12829. }
  12830. /**
  12831. * Converts `value` to an integer suitable for use as the length of an
  12832. * array-like object.
  12833. *
  12834. * **Note:** This method is based on
  12835. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12836. *
  12837. * @static
  12838. * @memberOf _
  12839. * @since 4.0.0
  12840. * @category Lang
  12841. * @param {*} value The value to convert.
  12842. * @returns {number} Returns the converted integer.
  12843. * @example
  12844. *
  12845. * _.toLength(3.2);
  12846. * // => 3
  12847. *
  12848. * _.toLength(Number.MIN_VALUE);
  12849. * // => 0
  12850. *
  12851. * _.toLength(Infinity);
  12852. * // => 4294967295
  12853. *
  12854. * _.toLength('3.2');
  12855. * // => 3
  12856. */
  12857. function toLength(value) {
  12858. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12859. }
  12860. /**
  12861. * Converts `value` to a number.
  12862. *
  12863. * @static
  12864. * @memberOf _
  12865. * @since 4.0.0
  12866. * @category Lang
  12867. * @param {*} value The value to process.
  12868. * @returns {number} Returns the number.
  12869. * @example
  12870. *
  12871. * _.toNumber(3.2);
  12872. * // => 3.2
  12873. *
  12874. * _.toNumber(Number.MIN_VALUE);
  12875. * // => 5e-324
  12876. *
  12877. * _.toNumber(Infinity);
  12878. * // => Infinity
  12879. *
  12880. * _.toNumber('3.2');
  12881. * // => 3.2
  12882. */
  12883. function toNumber(value) {
  12884. if (typeof value == 'number') {
  12885. return value;
  12886. }
  12887. if (isSymbol(value)) {
  12888. return NAN;
  12889. }
  12890. if (isObject(value)) {
  12891. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12892. value = isObject(other) ? (other + '') : other;
  12893. }
  12894. if (typeof value != 'string') {
  12895. return value === 0 ? value : +value;
  12896. }
  12897. value = baseTrim(value);
  12898. var isBinary = reIsBinary.test(value);
  12899. return (isBinary || reIsOctal.test(value))
  12900. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12901. : (reIsBadHex.test(value) ? NAN : +value);
  12902. }
  12903. /**
  12904. * Converts `value` to a plain object flattening inherited enumerable string
  12905. * keyed properties of `value` to own properties of the plain object.
  12906. *
  12907. * @static
  12908. * @memberOf _
  12909. * @since 3.0.0
  12910. * @category Lang
  12911. * @param {*} value The value to convert.
  12912. * @returns {Object} Returns the converted plain object.
  12913. * @example
  12914. *
  12915. * function Foo() {
  12916. * this.b = 2;
  12917. * }
  12918. *
  12919. * Foo.prototype.c = 3;
  12920. *
  12921. * _.assign({ 'a': 1 }, new Foo);
  12922. * // => { 'a': 1, 'b': 2 }
  12923. *
  12924. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12925. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12926. */
  12927. function toPlainObject(value) {
  12928. return copyObject(value, keysIn(value));
  12929. }
  12930. /**
  12931. * Converts `value` to a safe integer. A safe integer can be compared and
  12932. * represented correctly.
  12933. *
  12934. * @static
  12935. * @memberOf _
  12936. * @since 4.0.0
  12937. * @category Lang
  12938. * @param {*} value The value to convert.
  12939. * @returns {number} Returns the converted integer.
  12940. * @example
  12941. *
  12942. * _.toSafeInteger(3.2);
  12943. * // => 3
  12944. *
  12945. * _.toSafeInteger(Number.MIN_VALUE);
  12946. * // => 0
  12947. *
  12948. * _.toSafeInteger(Infinity);
  12949. * // => 9007199254740991
  12950. *
  12951. * _.toSafeInteger('3.2');
  12952. * // => 3
  12953. */
  12954. function toSafeInteger(value) {
  12955. return value
  12956. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12957. : (value === 0 ? value : 0);
  12958. }
  12959. /**
  12960. * Converts `value` to a string. An empty string is returned for `null`
  12961. * and `undefined` values. The sign of `-0` is preserved.
  12962. *
  12963. * @static
  12964. * @memberOf _
  12965. * @since 4.0.0
  12966. * @category Lang
  12967. * @param {*} value The value to convert.
  12968. * @returns {string} Returns the converted string.
  12969. * @example
  12970. *
  12971. * _.toString(null);
  12972. * // => ''
  12973. *
  12974. * _.toString(-0);
  12975. * // => '-0'
  12976. *
  12977. * _.toString([1, 2, 3]);
  12978. * // => '1,2,3'
  12979. */
  12980. function toString(value) {
  12981. return value == null ? '' : baseToString(value);
  12982. }
  12983. /*------------------------------------------------------------------------*/
  12984. /**
  12985. * Assigns own enumerable string keyed properties of source objects to the
  12986. * destination object. Source objects are applied from left to right.
  12987. * Subsequent sources overwrite property assignments of previous sources.
  12988. *
  12989. * **Note:** This method mutates `object` and is loosely based on
  12990. * [`Object.assign`](https://mdn.io/Object/assign).
  12991. *
  12992. * @static
  12993. * @memberOf _
  12994. * @since 0.10.0
  12995. * @category Object
  12996. * @param {Object} object The destination object.
  12997. * @param {...Object} [sources] The source objects.
  12998. * @returns {Object} Returns `object`.
  12999. * @see _.assignIn
  13000. * @example
  13001. *
  13002. * function Foo() {
  13003. * this.a = 1;
  13004. * }
  13005. *
  13006. * function Bar() {
  13007. * this.c = 3;
  13008. * }
  13009. *
  13010. * Foo.prototype.b = 2;
  13011. * Bar.prototype.d = 4;
  13012. *
  13013. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13014. * // => { 'a': 1, 'c': 3 }
  13015. */
  13016. var assign = createAssigner(function(object, source) {
  13017. if (isPrototype(source) || isArrayLike(source)) {
  13018. copyObject(source, keys(source), object);
  13019. return;
  13020. }
  13021. for (var key in source) {
  13022. if (hasOwnProperty.call(source, key)) {
  13023. assignValue(object, key, source[key]);
  13024. }
  13025. }
  13026. });
  13027. /**
  13028. * This method is like `_.assign` except that it iterates over own and
  13029. * inherited source properties.
  13030. *
  13031. * **Note:** This method mutates `object`.
  13032. *
  13033. * @static
  13034. * @memberOf _
  13035. * @since 4.0.0
  13036. * @alias extend
  13037. * @category Object
  13038. * @param {Object} object The destination object.
  13039. * @param {...Object} [sources] The source objects.
  13040. * @returns {Object} Returns `object`.
  13041. * @see _.assign
  13042. * @example
  13043. *
  13044. * function Foo() {
  13045. * this.a = 1;
  13046. * }
  13047. *
  13048. * function Bar() {
  13049. * this.c = 3;
  13050. * }
  13051. *
  13052. * Foo.prototype.b = 2;
  13053. * Bar.prototype.d = 4;
  13054. *
  13055. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13056. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13057. */
  13058. var assignIn = createAssigner(function(object, source) {
  13059. copyObject(source, keysIn(source), object);
  13060. });
  13061. /**
  13062. * This method is like `_.assignIn` except that it accepts `customizer`
  13063. * which is invoked to produce the assigned values. If `customizer` returns
  13064. * `undefined`, assignment is handled by the method instead. The `customizer`
  13065. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13066. *
  13067. * **Note:** This method mutates `object`.
  13068. *
  13069. * @static
  13070. * @memberOf _
  13071. * @since 4.0.0
  13072. * @alias extendWith
  13073. * @category Object
  13074. * @param {Object} object The destination object.
  13075. * @param {...Object} sources The source objects.
  13076. * @param {Function} [customizer] The function to customize assigned values.
  13077. * @returns {Object} Returns `object`.
  13078. * @see _.assignWith
  13079. * @example
  13080. *
  13081. * function customizer(objValue, srcValue) {
  13082. * return _.isUndefined(objValue) ? srcValue : objValue;
  13083. * }
  13084. *
  13085. * var defaults = _.partialRight(_.assignInWith, customizer);
  13086. *
  13087. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13088. * // => { 'a': 1, 'b': 2 }
  13089. */
  13090. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13091. copyObject(source, keysIn(source), object, customizer);
  13092. });
  13093. /**
  13094. * This method is like `_.assign` except that it accepts `customizer`
  13095. * which is invoked to produce the assigned values. If `customizer` returns
  13096. * `undefined`, assignment is handled by the method instead. The `customizer`
  13097. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13098. *
  13099. * **Note:** This method mutates `object`.
  13100. *
  13101. * @static
  13102. * @memberOf _
  13103. * @since 4.0.0
  13104. * @category Object
  13105. * @param {Object} object The destination object.
  13106. * @param {...Object} sources The source objects.
  13107. * @param {Function} [customizer] The function to customize assigned values.
  13108. * @returns {Object} Returns `object`.
  13109. * @see _.assignInWith
  13110. * @example
  13111. *
  13112. * function customizer(objValue, srcValue) {
  13113. * return _.isUndefined(objValue) ? srcValue : objValue;
  13114. * }
  13115. *
  13116. * var defaults = _.partialRight(_.assignWith, customizer);
  13117. *
  13118. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13119. * // => { 'a': 1, 'b': 2 }
  13120. */
  13121. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13122. copyObject(source, keys(source), object, customizer);
  13123. });
  13124. /**
  13125. * Creates an array of values corresponding to `paths` of `object`.
  13126. *
  13127. * @static
  13128. * @memberOf _
  13129. * @since 1.0.0
  13130. * @category Object
  13131. * @param {Object} object The object to iterate over.
  13132. * @param {...(string|string[])} [paths] The property paths to pick.
  13133. * @returns {Array} Returns the picked values.
  13134. * @example
  13135. *
  13136. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13137. *
  13138. * _.at(object, ['a[0].b.c', 'a[1]']);
  13139. * // => [3, 4]
  13140. */
  13141. var at = flatRest(baseAt);
  13142. /**
  13143. * Creates an object that inherits from the `prototype` object. If a
  13144. * `properties` object is given, its own enumerable string keyed properties
  13145. * are assigned to the created object.
  13146. *
  13147. * @static
  13148. * @memberOf _
  13149. * @since 2.3.0
  13150. * @category Object
  13151. * @param {Object} prototype The object to inherit from.
  13152. * @param {Object} [properties] The properties to assign to the object.
  13153. * @returns {Object} Returns the new object.
  13154. * @example
  13155. *
  13156. * function Shape() {
  13157. * this.x = 0;
  13158. * this.y = 0;
  13159. * }
  13160. *
  13161. * function Circle() {
  13162. * Shape.call(this);
  13163. * }
  13164. *
  13165. * Circle.prototype = _.create(Shape.prototype, {
  13166. * 'constructor': Circle
  13167. * });
  13168. *
  13169. * var circle = new Circle;
  13170. * circle instanceof Circle;
  13171. * // => true
  13172. *
  13173. * circle instanceof Shape;
  13174. * // => true
  13175. */
  13176. function create(prototype, properties) {
  13177. var result = baseCreate(prototype);
  13178. return properties == null ? result : baseAssign(result, properties);
  13179. }
  13180. /**
  13181. * Assigns own and inherited enumerable string keyed properties of source
  13182. * objects to the destination object for all destination properties that
  13183. * resolve to `undefined`. Source objects are applied from left to right.
  13184. * Once a property is set, additional values of the same property are ignored.
  13185. *
  13186. * **Note:** This method mutates `object`.
  13187. *
  13188. * @static
  13189. * @since 0.1.0
  13190. * @memberOf _
  13191. * @category Object
  13192. * @param {Object} object The destination object.
  13193. * @param {...Object} [sources] The source objects.
  13194. * @returns {Object} Returns `object`.
  13195. * @see _.defaultsDeep
  13196. * @example
  13197. *
  13198. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13199. * // => { 'a': 1, 'b': 2 }
  13200. */
  13201. var defaults = baseRest(function(object, sources) {
  13202. object = Object(object);
  13203. var index = -1;
  13204. var length = sources.length;
  13205. var guard = length > 2 ? sources[2] : undefined;
  13206. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13207. length = 1;
  13208. }
  13209. while (++index < length) {
  13210. var source = sources[index];
  13211. var props = keysIn(source);
  13212. var propsIndex = -1;
  13213. var propsLength = props.length;
  13214. while (++propsIndex < propsLength) {
  13215. var key = props[propsIndex];
  13216. var value = object[key];
  13217. if (value === undefined ||
  13218. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13219. object[key] = source[key];
  13220. }
  13221. }
  13222. }
  13223. return object;
  13224. });
  13225. /**
  13226. * This method is like `_.defaults` except that it recursively assigns
  13227. * default properties.
  13228. *
  13229. * **Note:** This method mutates `object`.
  13230. *
  13231. * @static
  13232. * @memberOf _
  13233. * @since 3.10.0
  13234. * @category Object
  13235. * @param {Object} object The destination object.
  13236. * @param {...Object} [sources] The source objects.
  13237. * @returns {Object} Returns `object`.
  13238. * @see _.defaults
  13239. * @example
  13240. *
  13241. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13242. * // => { 'a': { 'b': 2, 'c': 3 } }
  13243. */
  13244. var defaultsDeep = baseRest(function(args) {
  13245. args.push(undefined, customDefaultsMerge);
  13246. return apply(mergeWith, undefined, args);
  13247. });
  13248. /**
  13249. * This method is like `_.find` except that it returns the key of the first
  13250. * element `predicate` returns truthy for instead of the element itself.
  13251. *
  13252. * @static
  13253. * @memberOf _
  13254. * @since 1.1.0
  13255. * @category Object
  13256. * @param {Object} object The object to inspect.
  13257. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13258. * @returns {string|undefined} Returns the key of the matched element,
  13259. * else `undefined`.
  13260. * @example
  13261. *
  13262. * var users = {
  13263. * 'barney': { 'age': 36, 'active': true },
  13264. * 'fred': { 'age': 40, 'active': false },
  13265. * 'pebbles': { 'age': 1, 'active': true }
  13266. * };
  13267. *
  13268. * _.findKey(users, function(o) { return o.age < 40; });
  13269. * // => 'barney' (iteration order is not guaranteed)
  13270. *
  13271. * // The `_.matches` iteratee shorthand.
  13272. * _.findKey(users, { 'age': 1, 'active': true });
  13273. * // => 'pebbles'
  13274. *
  13275. * // The `_.matchesProperty` iteratee shorthand.
  13276. * _.findKey(users, ['active', false]);
  13277. * // => 'fred'
  13278. *
  13279. * // The `_.property` iteratee shorthand.
  13280. * _.findKey(users, 'active');
  13281. * // => 'barney'
  13282. */
  13283. function findKey(object, predicate) {
  13284. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13285. }
  13286. /**
  13287. * This method is like `_.findKey` except that it iterates over elements of
  13288. * a collection in the opposite order.
  13289. *
  13290. * @static
  13291. * @memberOf _
  13292. * @since 2.0.0
  13293. * @category Object
  13294. * @param {Object} object The object to inspect.
  13295. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13296. * @returns {string|undefined} Returns the key of the matched element,
  13297. * else `undefined`.
  13298. * @example
  13299. *
  13300. * var users = {
  13301. * 'barney': { 'age': 36, 'active': true },
  13302. * 'fred': { 'age': 40, 'active': false },
  13303. * 'pebbles': { 'age': 1, 'active': true }
  13304. * };
  13305. *
  13306. * _.findLastKey(users, function(o) { return o.age < 40; });
  13307. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13308. *
  13309. * // The `_.matches` iteratee shorthand.
  13310. * _.findLastKey(users, { 'age': 36, 'active': true });
  13311. * // => 'barney'
  13312. *
  13313. * // The `_.matchesProperty` iteratee shorthand.
  13314. * _.findLastKey(users, ['active', false]);
  13315. * // => 'fred'
  13316. *
  13317. * // The `_.property` iteratee shorthand.
  13318. * _.findLastKey(users, 'active');
  13319. * // => 'pebbles'
  13320. */
  13321. function findLastKey(object, predicate) {
  13322. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13323. }
  13324. /**
  13325. * Iterates over own and inherited enumerable string keyed properties of an
  13326. * object and invokes `iteratee` for each property. The iteratee is invoked
  13327. * with three arguments: (value, key, object). Iteratee functions may exit
  13328. * iteration early by explicitly returning `false`.
  13329. *
  13330. * @static
  13331. * @memberOf _
  13332. * @since 0.3.0
  13333. * @category Object
  13334. * @param {Object} object The object to iterate over.
  13335. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13336. * @returns {Object} Returns `object`.
  13337. * @see _.forInRight
  13338. * @example
  13339. *
  13340. * function Foo() {
  13341. * this.a = 1;
  13342. * this.b = 2;
  13343. * }
  13344. *
  13345. * Foo.prototype.c = 3;
  13346. *
  13347. * _.forIn(new Foo, function(value, key) {
  13348. * console.log(key);
  13349. * });
  13350. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13351. */
  13352. function forIn(object, iteratee) {
  13353. return object == null
  13354. ? object
  13355. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13356. }
  13357. /**
  13358. * This method is like `_.forIn` except that it iterates over properties of
  13359. * `object` in the opposite order.
  13360. *
  13361. * @static
  13362. * @memberOf _
  13363. * @since 2.0.0
  13364. * @category Object
  13365. * @param {Object} object The object to iterate over.
  13366. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13367. * @returns {Object} Returns `object`.
  13368. * @see _.forIn
  13369. * @example
  13370. *
  13371. * function Foo() {
  13372. * this.a = 1;
  13373. * this.b = 2;
  13374. * }
  13375. *
  13376. * Foo.prototype.c = 3;
  13377. *
  13378. * _.forInRight(new Foo, function(value, key) {
  13379. * console.log(key);
  13380. * });
  13381. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13382. */
  13383. function forInRight(object, iteratee) {
  13384. return object == null
  13385. ? object
  13386. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13387. }
  13388. /**
  13389. * Iterates over own enumerable string keyed properties of an object and
  13390. * invokes `iteratee` for each property. The iteratee is invoked with three
  13391. * arguments: (value, key, object). Iteratee functions may exit iteration
  13392. * early by explicitly returning `false`.
  13393. *
  13394. * @static
  13395. * @memberOf _
  13396. * @since 0.3.0
  13397. * @category Object
  13398. * @param {Object} object The object to iterate over.
  13399. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13400. * @returns {Object} Returns `object`.
  13401. * @see _.forOwnRight
  13402. * @example
  13403. *
  13404. * function Foo() {
  13405. * this.a = 1;
  13406. * this.b = 2;
  13407. * }
  13408. *
  13409. * Foo.prototype.c = 3;
  13410. *
  13411. * _.forOwn(new Foo, function(value, key) {
  13412. * console.log(key);
  13413. * });
  13414. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13415. */
  13416. function forOwn(object, iteratee) {
  13417. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13418. }
  13419. /**
  13420. * This method is like `_.forOwn` except that it iterates over properties of
  13421. * `object` in the opposite order.
  13422. *
  13423. * @static
  13424. * @memberOf _
  13425. * @since 2.0.0
  13426. * @category Object
  13427. * @param {Object} object The object to iterate over.
  13428. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13429. * @returns {Object} Returns `object`.
  13430. * @see _.forOwn
  13431. * @example
  13432. *
  13433. * function Foo() {
  13434. * this.a = 1;
  13435. * this.b = 2;
  13436. * }
  13437. *
  13438. * Foo.prototype.c = 3;
  13439. *
  13440. * _.forOwnRight(new Foo, function(value, key) {
  13441. * console.log(key);
  13442. * });
  13443. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13444. */
  13445. function forOwnRight(object, iteratee) {
  13446. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13447. }
  13448. /**
  13449. * Creates an array of function property names from own enumerable properties
  13450. * of `object`.
  13451. *
  13452. * @static
  13453. * @since 0.1.0
  13454. * @memberOf _
  13455. * @category Object
  13456. * @param {Object} object The object to inspect.
  13457. * @returns {Array} Returns the function names.
  13458. * @see _.functionsIn
  13459. * @example
  13460. *
  13461. * function Foo() {
  13462. * this.a = _.constant('a');
  13463. * this.b = _.constant('b');
  13464. * }
  13465. *
  13466. * Foo.prototype.c = _.constant('c');
  13467. *
  13468. * _.functions(new Foo);
  13469. * // => ['a', 'b']
  13470. */
  13471. function functions(object) {
  13472. return object == null ? [] : baseFunctions(object, keys(object));
  13473. }
  13474. /**
  13475. * Creates an array of function property names from own and inherited
  13476. * enumerable properties of `object`.
  13477. *
  13478. * @static
  13479. * @memberOf _
  13480. * @since 4.0.0
  13481. * @category Object
  13482. * @param {Object} object The object to inspect.
  13483. * @returns {Array} Returns the function names.
  13484. * @see _.functions
  13485. * @example
  13486. *
  13487. * function Foo() {
  13488. * this.a = _.constant('a');
  13489. * this.b = _.constant('b');
  13490. * }
  13491. *
  13492. * Foo.prototype.c = _.constant('c');
  13493. *
  13494. * _.functionsIn(new Foo);
  13495. * // => ['a', 'b', 'c']
  13496. */
  13497. function functionsIn(object) {
  13498. return object == null ? [] : baseFunctions(object, keysIn(object));
  13499. }
  13500. /**
  13501. * Gets the value at `path` of `object`. If the resolved value is
  13502. * `undefined`, the `defaultValue` is returned in its place.
  13503. *
  13504. * @static
  13505. * @memberOf _
  13506. * @since 3.7.0
  13507. * @category Object
  13508. * @param {Object} object The object to query.
  13509. * @param {Array|string} path The path of the property to get.
  13510. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13511. * @returns {*} Returns the resolved value.
  13512. * @example
  13513. *
  13514. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13515. *
  13516. * _.get(object, 'a[0].b.c');
  13517. * // => 3
  13518. *
  13519. * _.get(object, ['a', '0', 'b', 'c']);
  13520. * // => 3
  13521. *
  13522. * _.get(object, 'a.b.c', 'default');
  13523. * // => 'default'
  13524. */
  13525. function get(object, path, defaultValue) {
  13526. var result = object == null ? undefined : baseGet(object, path);
  13527. return result === undefined ? defaultValue : result;
  13528. }
  13529. /**
  13530. * Checks if `path` is a direct property of `object`.
  13531. *
  13532. * @static
  13533. * @since 0.1.0
  13534. * @memberOf _
  13535. * @category Object
  13536. * @param {Object} object The object to query.
  13537. * @param {Array|string} path The path to check.
  13538. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13539. * @example
  13540. *
  13541. * var object = { 'a': { 'b': 2 } };
  13542. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13543. *
  13544. * _.has(object, 'a');
  13545. * // => true
  13546. *
  13547. * _.has(object, 'a.b');
  13548. * // => true
  13549. *
  13550. * _.has(object, ['a', 'b']);
  13551. * // => true
  13552. *
  13553. * _.has(other, 'a');
  13554. * // => false
  13555. */
  13556. function has(object, path) {
  13557. return object != null && hasPath(object, path, baseHas);
  13558. }
  13559. /**
  13560. * Checks if `path` is a direct or inherited property of `object`.
  13561. *
  13562. * @static
  13563. * @memberOf _
  13564. * @since 4.0.0
  13565. * @category Object
  13566. * @param {Object} object The object to query.
  13567. * @param {Array|string} path The path to check.
  13568. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13569. * @example
  13570. *
  13571. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13572. *
  13573. * _.hasIn(object, 'a');
  13574. * // => true
  13575. *
  13576. * _.hasIn(object, 'a.b');
  13577. * // => true
  13578. *
  13579. * _.hasIn(object, ['a', 'b']);
  13580. * // => true
  13581. *
  13582. * _.hasIn(object, 'b');
  13583. * // => false
  13584. */
  13585. function hasIn(object, path) {
  13586. return object != null && hasPath(object, path, baseHasIn);
  13587. }
  13588. /**
  13589. * Creates an object composed of the inverted keys and values of `object`.
  13590. * If `object` contains duplicate values, subsequent values overwrite
  13591. * property assignments of previous values.
  13592. *
  13593. * @static
  13594. * @memberOf _
  13595. * @since 0.7.0
  13596. * @category Object
  13597. * @param {Object} object The object to invert.
  13598. * @returns {Object} Returns the new inverted object.
  13599. * @example
  13600. *
  13601. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13602. *
  13603. * _.invert(object);
  13604. * // => { '1': 'c', '2': 'b' }
  13605. */
  13606. var invert = createInverter(function(result, value, key) {
  13607. if (value != null &&
  13608. typeof value.toString != 'function') {
  13609. value = nativeObjectToString.call(value);
  13610. }
  13611. result[value] = key;
  13612. }, constant(identity));
  13613. /**
  13614. * This method is like `_.invert` except that the inverted object is generated
  13615. * from the results of running each element of `object` thru `iteratee`. The
  13616. * corresponding inverted value of each inverted key is an array of keys
  13617. * responsible for generating the inverted value. The iteratee is invoked
  13618. * with one argument: (value).
  13619. *
  13620. * @static
  13621. * @memberOf _
  13622. * @since 4.1.0
  13623. * @category Object
  13624. * @param {Object} object The object to invert.
  13625. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13626. * @returns {Object} Returns the new inverted object.
  13627. * @example
  13628. *
  13629. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13630. *
  13631. * _.invertBy(object);
  13632. * // => { '1': ['a', 'c'], '2': ['b'] }
  13633. *
  13634. * _.invertBy(object, function(value) {
  13635. * return 'group' + value;
  13636. * });
  13637. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13638. */
  13639. var invertBy = createInverter(function(result, value, key) {
  13640. if (value != null &&
  13641. typeof value.toString != 'function') {
  13642. value = nativeObjectToString.call(value);
  13643. }
  13644. if (hasOwnProperty.call(result, value)) {
  13645. result[value].push(key);
  13646. } else {
  13647. result[value] = [key];
  13648. }
  13649. }, getIteratee);
  13650. /**
  13651. * Invokes the method at `path` of `object`.
  13652. *
  13653. * @static
  13654. * @memberOf _
  13655. * @since 4.0.0
  13656. * @category Object
  13657. * @param {Object} object The object to query.
  13658. * @param {Array|string} path The path of the method to invoke.
  13659. * @param {...*} [args] The arguments to invoke the method with.
  13660. * @returns {*} Returns the result of the invoked method.
  13661. * @example
  13662. *
  13663. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13664. *
  13665. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13666. * // => [2, 3]
  13667. */
  13668. var invoke = baseRest(baseInvoke);
  13669. /**
  13670. * Creates an array of the own enumerable property names of `object`.
  13671. *
  13672. * **Note:** Non-object values are coerced to objects. See the
  13673. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13674. * for more details.
  13675. *
  13676. * @static
  13677. * @since 0.1.0
  13678. * @memberOf _
  13679. * @category Object
  13680. * @param {Object} object The object to query.
  13681. * @returns {Array} Returns the array of property names.
  13682. * @example
  13683. *
  13684. * function Foo() {
  13685. * this.a = 1;
  13686. * this.b = 2;
  13687. * }
  13688. *
  13689. * Foo.prototype.c = 3;
  13690. *
  13691. * _.keys(new Foo);
  13692. * // => ['a', 'b'] (iteration order is not guaranteed)
  13693. *
  13694. * _.keys('hi');
  13695. * // => ['0', '1']
  13696. */
  13697. function keys(object) {
  13698. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13699. }
  13700. /**
  13701. * Creates an array of the own and inherited enumerable property names of `object`.
  13702. *
  13703. * **Note:** Non-object values are coerced to objects.
  13704. *
  13705. * @static
  13706. * @memberOf _
  13707. * @since 3.0.0
  13708. * @category Object
  13709. * @param {Object} object The object to query.
  13710. * @returns {Array} Returns the array of property names.
  13711. * @example
  13712. *
  13713. * function Foo() {
  13714. * this.a = 1;
  13715. * this.b = 2;
  13716. * }
  13717. *
  13718. * Foo.prototype.c = 3;
  13719. *
  13720. * _.keysIn(new Foo);
  13721. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13722. */
  13723. function keysIn(object) {
  13724. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13725. }
  13726. /**
  13727. * The opposite of `_.mapValues`; this method creates an object with the
  13728. * same values as `object` and keys generated by running each own enumerable
  13729. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13730. * with three arguments: (value, key, object).
  13731. *
  13732. * @static
  13733. * @memberOf _
  13734. * @since 3.8.0
  13735. * @category Object
  13736. * @param {Object} object The object to iterate over.
  13737. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13738. * @returns {Object} Returns the new mapped object.
  13739. * @see _.mapValues
  13740. * @example
  13741. *
  13742. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13743. * return key + value;
  13744. * });
  13745. * // => { 'a1': 1, 'b2': 2 }
  13746. */
  13747. function mapKeys(object, iteratee) {
  13748. var result = {};
  13749. iteratee = getIteratee(iteratee, 3);
  13750. baseForOwn(object, function(value, key, object) {
  13751. baseAssignValue(result, iteratee(value, key, object), value);
  13752. });
  13753. return result;
  13754. }
  13755. /**
  13756. * Creates an object with the same keys as `object` and values generated
  13757. * by running each own enumerable string keyed property of `object` thru
  13758. * `iteratee`. The iteratee is invoked with three arguments:
  13759. * (value, key, object).
  13760. *
  13761. * @static
  13762. * @memberOf _
  13763. * @since 2.4.0
  13764. * @category Object
  13765. * @param {Object} object The object to iterate over.
  13766. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13767. * @returns {Object} Returns the new mapped object.
  13768. * @see _.mapKeys
  13769. * @example
  13770. *
  13771. * var users = {
  13772. * 'fred': { 'user': 'fred', 'age': 40 },
  13773. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13774. * };
  13775. *
  13776. * _.mapValues(users, function(o) { return o.age; });
  13777. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13778. *
  13779. * // The `_.property` iteratee shorthand.
  13780. * _.mapValues(users, 'age');
  13781. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13782. */
  13783. function mapValues(object, iteratee) {
  13784. var result = {};
  13785. iteratee = getIteratee(iteratee, 3);
  13786. baseForOwn(object, function(value, key, object) {
  13787. baseAssignValue(result, key, iteratee(value, key, object));
  13788. });
  13789. return result;
  13790. }
  13791. /**
  13792. * This method is like `_.assign` except that it recursively merges own and
  13793. * inherited enumerable string keyed properties of source objects into the
  13794. * destination object. Source properties that resolve to `undefined` are
  13795. * skipped if a destination value exists. Array and plain object properties
  13796. * are merged recursively. Other objects and value types are overridden by
  13797. * assignment. Source objects are applied from left to right. Subsequent
  13798. * sources overwrite property assignments of previous sources.
  13799. *
  13800. * **Note:** This method mutates `object`.
  13801. *
  13802. * @static
  13803. * @memberOf _
  13804. * @since 0.5.0
  13805. * @category Object
  13806. * @param {Object} object The destination object.
  13807. * @param {...Object} [sources] The source objects.
  13808. * @returns {Object} Returns `object`.
  13809. * @example
  13810. *
  13811. * var object = {
  13812. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13813. * };
  13814. *
  13815. * var other = {
  13816. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13817. * };
  13818. *
  13819. * _.merge(object, other);
  13820. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13821. */
  13822. var merge = createAssigner(function(object, source, srcIndex) {
  13823. baseMerge(object, source, srcIndex);
  13824. });
  13825. /**
  13826. * This method is like `_.merge` except that it accepts `customizer` which
  13827. * is invoked to produce the merged values of the destination and source
  13828. * properties. If `customizer` returns `undefined`, merging is handled by the
  13829. * method instead. The `customizer` is invoked with six arguments:
  13830. * (objValue, srcValue, key, object, source, stack).
  13831. *
  13832. * **Note:** This method mutates `object`.
  13833. *
  13834. * @static
  13835. * @memberOf _
  13836. * @since 4.0.0
  13837. * @category Object
  13838. * @param {Object} object The destination object.
  13839. * @param {...Object} sources The source objects.
  13840. * @param {Function} customizer The function to customize assigned values.
  13841. * @returns {Object} Returns `object`.
  13842. * @example
  13843. *
  13844. * function customizer(objValue, srcValue) {
  13845. * if (_.isArray(objValue)) {
  13846. * return objValue.concat(srcValue);
  13847. * }
  13848. * }
  13849. *
  13850. * var object = { 'a': [1], 'b': [2] };
  13851. * var other = { 'a': [3], 'b': [4] };
  13852. *
  13853. * _.mergeWith(object, other, customizer);
  13854. * // => { 'a': [1, 3], 'b': [2, 4] }
  13855. */
  13856. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13857. baseMerge(object, source, srcIndex, customizer);
  13858. });
  13859. /**
  13860. * The opposite of `_.pick`; this method creates an object composed of the
  13861. * own and inherited enumerable property paths of `object` that are not omitted.
  13862. *
  13863. * **Note:** This method is considerably slower than `_.pick`.
  13864. *
  13865. * @static
  13866. * @since 0.1.0
  13867. * @memberOf _
  13868. * @category Object
  13869. * @param {Object} object The source object.
  13870. * @param {...(string|string[])} [paths] The property paths to omit.
  13871. * @returns {Object} Returns the new object.
  13872. * @example
  13873. *
  13874. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13875. *
  13876. * _.omit(object, ['a', 'c']);
  13877. * // => { 'b': '2' }
  13878. */
  13879. var omit = flatRest(function(object, paths) {
  13880. var result = {};
  13881. if (object == null) {
  13882. return result;
  13883. }
  13884. var isDeep = false;
  13885. paths = arrayMap(paths, function(path) {
  13886. path = castPath(path, object);
  13887. isDeep || (isDeep = path.length > 1);
  13888. return path;
  13889. });
  13890. copyObject(object, getAllKeysIn(object), result);
  13891. if (isDeep) {
  13892. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13893. }
  13894. var length = paths.length;
  13895. while (length--) {
  13896. baseUnset(result, paths[length]);
  13897. }
  13898. return result;
  13899. });
  13900. /**
  13901. * The opposite of `_.pickBy`; this method creates an object composed of
  13902. * the own and inherited enumerable string keyed properties of `object` that
  13903. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13904. * arguments: (value, key).
  13905. *
  13906. * @static
  13907. * @memberOf _
  13908. * @since 4.0.0
  13909. * @category Object
  13910. * @param {Object} object The source object.
  13911. * @param {Function} [predicate=_.identity] The function invoked per property.
  13912. * @returns {Object} Returns the new object.
  13913. * @example
  13914. *
  13915. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13916. *
  13917. * _.omitBy(object, _.isNumber);
  13918. * // => { 'b': '2' }
  13919. */
  13920. function omitBy(object, predicate) {
  13921. return pickBy(object, negate(getIteratee(predicate)));
  13922. }
  13923. /**
  13924. * Creates an object composed of the picked `object` properties.
  13925. *
  13926. * @static
  13927. * @since 0.1.0
  13928. * @memberOf _
  13929. * @category Object
  13930. * @param {Object} object The source object.
  13931. * @param {...(string|string[])} [paths] The property paths to pick.
  13932. * @returns {Object} Returns the new object.
  13933. * @example
  13934. *
  13935. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13936. *
  13937. * _.pick(object, ['a', 'c']);
  13938. * // => { 'a': 1, 'c': 3 }
  13939. */
  13940. var pick = flatRest(function(object, paths) {
  13941. return object == null ? {} : basePick(object, paths);
  13942. });
  13943. /**
  13944. * Creates an object composed of the `object` properties `predicate` returns
  13945. * truthy for. The predicate is invoked with two arguments: (value, key).
  13946. *
  13947. * @static
  13948. * @memberOf _
  13949. * @since 4.0.0
  13950. * @category Object
  13951. * @param {Object} object The source object.
  13952. * @param {Function} [predicate=_.identity] The function invoked per property.
  13953. * @returns {Object} Returns the new object.
  13954. * @example
  13955. *
  13956. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13957. *
  13958. * _.pickBy(object, _.isNumber);
  13959. * // => { 'a': 1, 'c': 3 }
  13960. */
  13961. function pickBy(object, predicate) {
  13962. if (object == null) {
  13963. return {};
  13964. }
  13965. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13966. return [prop];
  13967. });
  13968. predicate = getIteratee(predicate);
  13969. return basePickBy(object, props, function(value, path) {
  13970. return predicate(value, path[0]);
  13971. });
  13972. }
  13973. /**
  13974. * This method is like `_.get` except that if the resolved value is a
  13975. * function it's invoked with the `this` binding of its parent object and
  13976. * its result is returned.
  13977. *
  13978. * @static
  13979. * @since 0.1.0
  13980. * @memberOf _
  13981. * @category Object
  13982. * @param {Object} object The object to query.
  13983. * @param {Array|string} path The path of the property to resolve.
  13984. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13985. * @returns {*} Returns the resolved value.
  13986. * @example
  13987. *
  13988. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13989. *
  13990. * _.result(object, 'a[0].b.c1');
  13991. * // => 3
  13992. *
  13993. * _.result(object, 'a[0].b.c2');
  13994. * // => 4
  13995. *
  13996. * _.result(object, 'a[0].b.c3', 'default');
  13997. * // => 'default'
  13998. *
  13999. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14000. * // => 'default'
  14001. */
  14002. function result(object, path, defaultValue) {
  14003. path = castPath(path, object);
  14004. var index = -1,
  14005. length = path.length;
  14006. // Ensure the loop is entered when path is empty.
  14007. if (!length) {
  14008. length = 1;
  14009. object = undefined;
  14010. }
  14011. while (++index < length) {
  14012. var value = object == null ? undefined : object[toKey(path[index])];
  14013. if (value === undefined) {
  14014. index = length;
  14015. value = defaultValue;
  14016. }
  14017. object = isFunction(value) ? value.call(object) : value;
  14018. }
  14019. return object;
  14020. }
  14021. /**
  14022. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14023. * it's created. Arrays are created for missing index properties while objects
  14024. * are created for all other missing properties. Use `_.setWith` to customize
  14025. * `path` creation.
  14026. *
  14027. * **Note:** This method mutates `object`.
  14028. *
  14029. * @static
  14030. * @memberOf _
  14031. * @since 3.7.0
  14032. * @category Object
  14033. * @param {Object} object The object to modify.
  14034. * @param {Array|string} path The path of the property to set.
  14035. * @param {*} value The value to set.
  14036. * @returns {Object} Returns `object`.
  14037. * @example
  14038. *
  14039. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14040. *
  14041. * _.set(object, 'a[0].b.c', 4);
  14042. * console.log(object.a[0].b.c);
  14043. * // => 4
  14044. *
  14045. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14046. * console.log(object.x[0].y.z);
  14047. * // => 5
  14048. */
  14049. function set(object, path, value) {
  14050. return object == null ? object : baseSet(object, path, value);
  14051. }
  14052. /**
  14053. * This method is like `_.set` except that it accepts `customizer` which is
  14054. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14055. * path creation is handled by the method instead. The `customizer` is invoked
  14056. * with three arguments: (nsValue, key, nsObject).
  14057. *
  14058. * **Note:** This method mutates `object`.
  14059. *
  14060. * @static
  14061. * @memberOf _
  14062. * @since 4.0.0
  14063. * @category Object
  14064. * @param {Object} object The object to modify.
  14065. * @param {Array|string} path The path of the property to set.
  14066. * @param {*} value The value to set.
  14067. * @param {Function} [customizer] The function to customize assigned values.
  14068. * @returns {Object} Returns `object`.
  14069. * @example
  14070. *
  14071. * var object = {};
  14072. *
  14073. * _.setWith(object, '[0][1]', 'a', Object);
  14074. * // => { '0': { '1': 'a' } }
  14075. */
  14076. function setWith(object, path, value, customizer) {
  14077. customizer = typeof customizer == 'function' ? customizer : undefined;
  14078. return object == null ? object : baseSet(object, path, value, customizer);
  14079. }
  14080. /**
  14081. * Creates an array of own enumerable string keyed-value pairs for `object`
  14082. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14083. * entries are returned.
  14084. *
  14085. * @static
  14086. * @memberOf _
  14087. * @since 4.0.0
  14088. * @alias entries
  14089. * @category Object
  14090. * @param {Object} object The object to query.
  14091. * @returns {Array} Returns the key-value pairs.
  14092. * @example
  14093. *
  14094. * function Foo() {
  14095. * this.a = 1;
  14096. * this.b = 2;
  14097. * }
  14098. *
  14099. * Foo.prototype.c = 3;
  14100. *
  14101. * _.toPairs(new Foo);
  14102. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14103. */
  14104. var toPairs = createToPairs(keys);
  14105. /**
  14106. * Creates an array of own and inherited enumerable string keyed-value pairs
  14107. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14108. * or set, its entries are returned.
  14109. *
  14110. * @static
  14111. * @memberOf _
  14112. * @since 4.0.0
  14113. * @alias entriesIn
  14114. * @category Object
  14115. * @param {Object} object The object to query.
  14116. * @returns {Array} Returns the key-value pairs.
  14117. * @example
  14118. *
  14119. * function Foo() {
  14120. * this.a = 1;
  14121. * this.b = 2;
  14122. * }
  14123. *
  14124. * Foo.prototype.c = 3;
  14125. *
  14126. * _.toPairsIn(new Foo);
  14127. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14128. */
  14129. var toPairsIn = createToPairs(keysIn);
  14130. /**
  14131. * An alternative to `_.reduce`; this method transforms `object` to a new
  14132. * `accumulator` object which is the result of running each of its own
  14133. * enumerable string keyed properties thru `iteratee`, with each invocation
  14134. * potentially mutating the `accumulator` object. If `accumulator` is not
  14135. * provided, a new object with the same `[[Prototype]]` will be used. The
  14136. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14137. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14138. *
  14139. * @static
  14140. * @memberOf _
  14141. * @since 1.3.0
  14142. * @category Object
  14143. * @param {Object} object The object to iterate over.
  14144. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14145. * @param {*} [accumulator] The custom accumulator value.
  14146. * @returns {*} Returns the accumulated value.
  14147. * @example
  14148. *
  14149. * _.transform([2, 3, 4], function(result, n) {
  14150. * result.push(n *= n);
  14151. * return n % 2 == 0;
  14152. * }, []);
  14153. * // => [4, 9]
  14154. *
  14155. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14156. * (result[value] || (result[value] = [])).push(key);
  14157. * }, {});
  14158. * // => { '1': ['a', 'c'], '2': ['b'] }
  14159. */
  14160. function transform(object, iteratee, accumulator) {
  14161. var isArr = isArray(object),
  14162. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14163. iteratee = getIteratee(iteratee, 4);
  14164. if (accumulator == null) {
  14165. var Ctor = object && object.constructor;
  14166. if (isArrLike) {
  14167. accumulator = isArr ? new Ctor : [];
  14168. }
  14169. else if (isObject(object)) {
  14170. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14171. }
  14172. else {
  14173. accumulator = {};
  14174. }
  14175. }
  14176. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14177. return iteratee(accumulator, value, index, object);
  14178. });
  14179. return accumulator;
  14180. }
  14181. /**
  14182. * Removes the property at `path` of `object`.
  14183. *
  14184. * **Note:** This method mutates `object`.
  14185. *
  14186. * @static
  14187. * @memberOf _
  14188. * @since 4.0.0
  14189. * @category Object
  14190. * @param {Object} object The object to modify.
  14191. * @param {Array|string} path The path of the property to unset.
  14192. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14193. * @example
  14194. *
  14195. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14196. * _.unset(object, 'a[0].b.c');
  14197. * // => true
  14198. *
  14199. * console.log(object);
  14200. * // => { 'a': [{ 'b': {} }] };
  14201. *
  14202. * _.unset(object, ['a', '0', 'b', 'c']);
  14203. * // => true
  14204. *
  14205. * console.log(object);
  14206. * // => { 'a': [{ 'b': {} }] };
  14207. */
  14208. function unset(object, path) {
  14209. return object == null ? true : baseUnset(object, path);
  14210. }
  14211. /**
  14212. * This method is like `_.set` except that accepts `updater` to produce the
  14213. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14214. * is invoked with one argument: (value).
  14215. *
  14216. * **Note:** This method mutates `object`.
  14217. *
  14218. * @static
  14219. * @memberOf _
  14220. * @since 4.6.0
  14221. * @category Object
  14222. * @param {Object} object The object to modify.
  14223. * @param {Array|string} path The path of the property to set.
  14224. * @param {Function} updater The function to produce the updated value.
  14225. * @returns {Object} Returns `object`.
  14226. * @example
  14227. *
  14228. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14229. *
  14230. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14231. * console.log(object.a[0].b.c);
  14232. * // => 9
  14233. *
  14234. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14235. * console.log(object.x[0].y.z);
  14236. * // => 0
  14237. */
  14238. function update(object, path, updater) {
  14239. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14240. }
  14241. /**
  14242. * This method is like `_.update` except that it accepts `customizer` which is
  14243. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14244. * path creation is handled by the method instead. The `customizer` is invoked
  14245. * with three arguments: (nsValue, key, nsObject).
  14246. *
  14247. * **Note:** This method mutates `object`.
  14248. *
  14249. * @static
  14250. * @memberOf _
  14251. * @since 4.6.0
  14252. * @category Object
  14253. * @param {Object} object The object to modify.
  14254. * @param {Array|string} path The path of the property to set.
  14255. * @param {Function} updater The function to produce the updated value.
  14256. * @param {Function} [customizer] The function to customize assigned values.
  14257. * @returns {Object} Returns `object`.
  14258. * @example
  14259. *
  14260. * var object = {};
  14261. *
  14262. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14263. * // => { '0': { '1': 'a' } }
  14264. */
  14265. function updateWith(object, path, updater, customizer) {
  14266. customizer = typeof customizer == 'function' ? customizer : undefined;
  14267. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14268. }
  14269. /**
  14270. * Creates an array of the own enumerable string keyed property values of `object`.
  14271. *
  14272. * **Note:** Non-object values are coerced to objects.
  14273. *
  14274. * @static
  14275. * @since 0.1.0
  14276. * @memberOf _
  14277. * @category Object
  14278. * @param {Object} object The object to query.
  14279. * @returns {Array} Returns the array of property values.
  14280. * @example
  14281. *
  14282. * function Foo() {
  14283. * this.a = 1;
  14284. * this.b = 2;
  14285. * }
  14286. *
  14287. * Foo.prototype.c = 3;
  14288. *
  14289. * _.values(new Foo);
  14290. * // => [1, 2] (iteration order is not guaranteed)
  14291. *
  14292. * _.values('hi');
  14293. * // => ['h', 'i']
  14294. */
  14295. function values(object) {
  14296. return object == null ? [] : baseValues(object, keys(object));
  14297. }
  14298. /**
  14299. * Creates an array of the own and inherited enumerable string keyed property
  14300. * values of `object`.
  14301. *
  14302. * **Note:** Non-object values are coerced to objects.
  14303. *
  14304. * @static
  14305. * @memberOf _
  14306. * @since 3.0.0
  14307. * @category Object
  14308. * @param {Object} object The object to query.
  14309. * @returns {Array} Returns the array of property values.
  14310. * @example
  14311. *
  14312. * function Foo() {
  14313. * this.a = 1;
  14314. * this.b = 2;
  14315. * }
  14316. *
  14317. * Foo.prototype.c = 3;
  14318. *
  14319. * _.valuesIn(new Foo);
  14320. * // => [1, 2, 3] (iteration order is not guaranteed)
  14321. */
  14322. function valuesIn(object) {
  14323. return object == null ? [] : baseValues(object, keysIn(object));
  14324. }
  14325. /*------------------------------------------------------------------------*/
  14326. /**
  14327. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14328. *
  14329. * @static
  14330. * @memberOf _
  14331. * @since 4.0.0
  14332. * @category Number
  14333. * @param {number} number The number to clamp.
  14334. * @param {number} [lower] The lower bound.
  14335. * @param {number} upper The upper bound.
  14336. * @returns {number} Returns the clamped number.
  14337. * @example
  14338. *
  14339. * _.clamp(-10, -5, 5);
  14340. * // => -5
  14341. *
  14342. * _.clamp(10, -5, 5);
  14343. * // => 5
  14344. */
  14345. function clamp(number, lower, upper) {
  14346. if (upper === undefined) {
  14347. upper = lower;
  14348. lower = undefined;
  14349. }
  14350. if (upper !== undefined) {
  14351. upper = toNumber(upper);
  14352. upper = upper === upper ? upper : 0;
  14353. }
  14354. if (lower !== undefined) {
  14355. lower = toNumber(lower);
  14356. lower = lower === lower ? lower : 0;
  14357. }
  14358. return baseClamp(toNumber(number), lower, upper);
  14359. }
  14360. /**
  14361. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14362. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14363. * If `start` is greater than `end` the params are swapped to support
  14364. * negative ranges.
  14365. *
  14366. * @static
  14367. * @memberOf _
  14368. * @since 3.3.0
  14369. * @category Number
  14370. * @param {number} number The number to check.
  14371. * @param {number} [start=0] The start of the range.
  14372. * @param {number} end The end of the range.
  14373. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14374. * @see _.range, _.rangeRight
  14375. * @example
  14376. *
  14377. * _.inRange(3, 2, 4);
  14378. * // => true
  14379. *
  14380. * _.inRange(4, 8);
  14381. * // => true
  14382. *
  14383. * _.inRange(4, 2);
  14384. * // => false
  14385. *
  14386. * _.inRange(2, 2);
  14387. * // => false
  14388. *
  14389. * _.inRange(1.2, 2);
  14390. * // => true
  14391. *
  14392. * _.inRange(5.2, 4);
  14393. * // => false
  14394. *
  14395. * _.inRange(-3, -2, -6);
  14396. * // => true
  14397. */
  14398. function inRange(number, start, end) {
  14399. start = toFinite(start);
  14400. if (end === undefined) {
  14401. end = start;
  14402. start = 0;
  14403. } else {
  14404. end = toFinite(end);
  14405. }
  14406. number = toNumber(number);
  14407. return baseInRange(number, start, end);
  14408. }
  14409. /**
  14410. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14411. * If only one argument is provided a number between `0` and the given number
  14412. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14413. * floats, a floating-point number is returned instead of an integer.
  14414. *
  14415. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14416. * floating-point values which can produce unexpected results.
  14417. *
  14418. * @static
  14419. * @memberOf _
  14420. * @since 0.7.0
  14421. * @category Number
  14422. * @param {number} [lower=0] The lower bound.
  14423. * @param {number} [upper=1] The upper bound.
  14424. * @param {boolean} [floating] Specify returning a floating-point number.
  14425. * @returns {number} Returns the random number.
  14426. * @example
  14427. *
  14428. * _.random(0, 5);
  14429. * // => an integer between 0 and 5
  14430. *
  14431. * _.random(5);
  14432. * // => also an integer between 0 and 5
  14433. *
  14434. * _.random(5, true);
  14435. * // => a floating-point number between 0 and 5
  14436. *
  14437. * _.random(1.2, 5.2);
  14438. * // => a floating-point number between 1.2 and 5.2
  14439. */
  14440. function random(lower, upper, floating) {
  14441. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14442. upper = floating = undefined;
  14443. }
  14444. if (floating === undefined) {
  14445. if (typeof upper == 'boolean') {
  14446. floating = upper;
  14447. upper = undefined;
  14448. }
  14449. else if (typeof lower == 'boolean') {
  14450. floating = lower;
  14451. lower = undefined;
  14452. }
  14453. }
  14454. if (lower === undefined && upper === undefined) {
  14455. lower = 0;
  14456. upper = 1;
  14457. }
  14458. else {
  14459. lower = toFinite(lower);
  14460. if (upper === undefined) {
  14461. upper = lower;
  14462. lower = 0;
  14463. } else {
  14464. upper = toFinite(upper);
  14465. }
  14466. }
  14467. if (lower > upper) {
  14468. var temp = lower;
  14469. lower = upper;
  14470. upper = temp;
  14471. }
  14472. if (floating || lower % 1 || upper % 1) {
  14473. var rand = nativeRandom();
  14474. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14475. }
  14476. return baseRandom(lower, upper);
  14477. }
  14478. /*------------------------------------------------------------------------*/
  14479. /**
  14480. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14481. *
  14482. * @static
  14483. * @memberOf _
  14484. * @since 3.0.0
  14485. * @category String
  14486. * @param {string} [string=''] The string to convert.
  14487. * @returns {string} Returns the camel cased string.
  14488. * @example
  14489. *
  14490. * _.camelCase('Foo Bar');
  14491. * // => 'fooBar'
  14492. *
  14493. * _.camelCase('--foo-bar--');
  14494. * // => 'fooBar'
  14495. *
  14496. * _.camelCase('__FOO_BAR__');
  14497. * // => 'fooBar'
  14498. */
  14499. var camelCase = createCompounder(function(result, word, index) {
  14500. word = word.toLowerCase();
  14501. return result + (index ? capitalize(word) : word);
  14502. });
  14503. /**
  14504. * Converts the first character of `string` to upper case and the remaining
  14505. * to lower case.
  14506. *
  14507. * @static
  14508. * @memberOf _
  14509. * @since 3.0.0
  14510. * @category String
  14511. * @param {string} [string=''] The string to capitalize.
  14512. * @returns {string} Returns the capitalized string.
  14513. * @example
  14514. *
  14515. * _.capitalize('FRED');
  14516. * // => 'Fred'
  14517. */
  14518. function capitalize(string) {
  14519. return upperFirst(toString(string).toLowerCase());
  14520. }
  14521. /**
  14522. * Deburrs `string` by converting
  14523. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14524. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14525. * letters to basic Latin letters and removing
  14526. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14527. *
  14528. * @static
  14529. * @memberOf _
  14530. * @since 3.0.0
  14531. * @category String
  14532. * @param {string} [string=''] The string to deburr.
  14533. * @returns {string} Returns the deburred string.
  14534. * @example
  14535. *
  14536. * _.deburr('déjà vu');
  14537. * // => 'deja vu'
  14538. */
  14539. function deburr(string) {
  14540. string = toString(string);
  14541. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14542. }
  14543. /**
  14544. * Checks if `string` ends with the given target string.
  14545. *
  14546. * @static
  14547. * @memberOf _
  14548. * @since 3.0.0
  14549. * @category String
  14550. * @param {string} [string=''] The string to inspect.
  14551. * @param {string} [target] The string to search for.
  14552. * @param {number} [position=string.length] The position to search up to.
  14553. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14554. * else `false`.
  14555. * @example
  14556. *
  14557. * _.endsWith('abc', 'c');
  14558. * // => true
  14559. *
  14560. * _.endsWith('abc', 'b');
  14561. * // => false
  14562. *
  14563. * _.endsWith('abc', 'b', 2);
  14564. * // => true
  14565. */
  14566. function endsWith(string, target, position) {
  14567. string = toString(string);
  14568. target = baseToString(target);
  14569. var length = string.length;
  14570. position = position === undefined
  14571. ? length
  14572. : baseClamp(toInteger(position), 0, length);
  14573. var end = position;
  14574. position -= target.length;
  14575. return position >= 0 && string.slice(position, end) == target;
  14576. }
  14577. /**
  14578. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14579. * corresponding HTML entities.
  14580. *
  14581. * **Note:** No other characters are escaped. To escape additional
  14582. * characters use a third-party library like [_he_](https://mths.be/he).
  14583. *
  14584. * Though the ">" character is escaped for symmetry, characters like
  14585. * ">" and "/" don't need escaping in HTML and have no special meaning
  14586. * unless they're part of a tag or unquoted attribute value. See
  14587. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14588. * (under "semi-related fun fact") for more details.
  14589. *
  14590. * When working with HTML you should always
  14591. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14592. * XSS vectors.
  14593. *
  14594. * @static
  14595. * @since 0.1.0
  14596. * @memberOf _
  14597. * @category String
  14598. * @param {string} [string=''] The string to escape.
  14599. * @returns {string} Returns the escaped string.
  14600. * @example
  14601. *
  14602. * _.escape('fred, barney, & pebbles');
  14603. * // => 'fred, barney, &amp; pebbles'
  14604. */
  14605. function escape(string) {
  14606. string = toString(string);
  14607. return (string && reHasUnescapedHtml.test(string))
  14608. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14609. : string;
  14610. }
  14611. /**
  14612. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14613. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14614. *
  14615. * @static
  14616. * @memberOf _
  14617. * @since 3.0.0
  14618. * @category String
  14619. * @param {string} [string=''] The string to escape.
  14620. * @returns {string} Returns the escaped string.
  14621. * @example
  14622. *
  14623. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14624. * // => '\[lodash\]\(https://lodash\.com/\)'
  14625. */
  14626. function escapeRegExp(string) {
  14627. string = toString(string);
  14628. return (string && reHasRegExpChar.test(string))
  14629. ? string.replace(reRegExpChar, '\\$&')
  14630. : string;
  14631. }
  14632. /**
  14633. * Converts `string` to
  14634. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14635. *
  14636. * @static
  14637. * @memberOf _
  14638. * @since 3.0.0
  14639. * @category String
  14640. * @param {string} [string=''] The string to convert.
  14641. * @returns {string} Returns the kebab cased string.
  14642. * @example
  14643. *
  14644. * _.kebabCase('Foo Bar');
  14645. * // => 'foo-bar'
  14646. *
  14647. * _.kebabCase('fooBar');
  14648. * // => 'foo-bar'
  14649. *
  14650. * _.kebabCase('__FOO_BAR__');
  14651. * // => 'foo-bar'
  14652. */
  14653. var kebabCase = createCompounder(function(result, word, index) {
  14654. return result + (index ? '-' : '') + word.toLowerCase();
  14655. });
  14656. /**
  14657. * Converts `string`, as space separated words, to lower case.
  14658. *
  14659. * @static
  14660. * @memberOf _
  14661. * @since 4.0.0
  14662. * @category String
  14663. * @param {string} [string=''] The string to convert.
  14664. * @returns {string} Returns the lower cased string.
  14665. * @example
  14666. *
  14667. * _.lowerCase('--Foo-Bar--');
  14668. * // => 'foo bar'
  14669. *
  14670. * _.lowerCase('fooBar');
  14671. * // => 'foo bar'
  14672. *
  14673. * _.lowerCase('__FOO_BAR__');
  14674. * // => 'foo bar'
  14675. */
  14676. var lowerCase = createCompounder(function(result, word, index) {
  14677. return result + (index ? ' ' : '') + word.toLowerCase();
  14678. });
  14679. /**
  14680. * Converts the first character of `string` to lower case.
  14681. *
  14682. * @static
  14683. * @memberOf _
  14684. * @since 4.0.0
  14685. * @category String
  14686. * @param {string} [string=''] The string to convert.
  14687. * @returns {string} Returns the converted string.
  14688. * @example
  14689. *
  14690. * _.lowerFirst('Fred');
  14691. * // => 'fred'
  14692. *
  14693. * _.lowerFirst('FRED');
  14694. * // => 'fRED'
  14695. */
  14696. var lowerFirst = createCaseFirst('toLowerCase');
  14697. /**
  14698. * Pads `string` on the left and right sides if it's shorter than `length`.
  14699. * Padding characters are truncated if they can't be evenly divided by `length`.
  14700. *
  14701. * @static
  14702. * @memberOf _
  14703. * @since 3.0.0
  14704. * @category String
  14705. * @param {string} [string=''] The string to pad.
  14706. * @param {number} [length=0] The padding length.
  14707. * @param {string} [chars=' '] The string used as padding.
  14708. * @returns {string} Returns the padded string.
  14709. * @example
  14710. *
  14711. * _.pad('abc', 8);
  14712. * // => ' abc '
  14713. *
  14714. * _.pad('abc', 8, '_-');
  14715. * // => '_-abc_-_'
  14716. *
  14717. * _.pad('abc', 3);
  14718. * // => 'abc'
  14719. */
  14720. function pad(string, length, chars) {
  14721. string = toString(string);
  14722. length = toInteger(length);
  14723. var strLength = length ? stringSize(string) : 0;
  14724. if (!length || strLength >= length) {
  14725. return string;
  14726. }
  14727. var mid = (length - strLength) / 2;
  14728. return (
  14729. createPadding(nativeFloor(mid), chars) +
  14730. string +
  14731. createPadding(nativeCeil(mid), chars)
  14732. );
  14733. }
  14734. /**
  14735. * Pads `string` on the right side if it's shorter than `length`. Padding
  14736. * characters are truncated if they exceed `length`.
  14737. *
  14738. * @static
  14739. * @memberOf _
  14740. * @since 4.0.0
  14741. * @category String
  14742. * @param {string} [string=''] The string to pad.
  14743. * @param {number} [length=0] The padding length.
  14744. * @param {string} [chars=' '] The string used as padding.
  14745. * @returns {string} Returns the padded string.
  14746. * @example
  14747. *
  14748. * _.padEnd('abc', 6);
  14749. * // => 'abc '
  14750. *
  14751. * _.padEnd('abc', 6, '_-');
  14752. * // => 'abc_-_'
  14753. *
  14754. * _.padEnd('abc', 3);
  14755. * // => 'abc'
  14756. */
  14757. function padEnd(string, length, chars) {
  14758. string = toString(string);
  14759. length = toInteger(length);
  14760. var strLength = length ? stringSize(string) : 0;
  14761. return (length && strLength < length)
  14762. ? (string + createPadding(length - strLength, chars))
  14763. : string;
  14764. }
  14765. /**
  14766. * Pads `string` on the left side if it's shorter than `length`. Padding
  14767. * characters are truncated if they exceed `length`.
  14768. *
  14769. * @static
  14770. * @memberOf _
  14771. * @since 4.0.0
  14772. * @category String
  14773. * @param {string} [string=''] The string to pad.
  14774. * @param {number} [length=0] The padding length.
  14775. * @param {string} [chars=' '] The string used as padding.
  14776. * @returns {string} Returns the padded string.
  14777. * @example
  14778. *
  14779. * _.padStart('abc', 6);
  14780. * // => ' abc'
  14781. *
  14782. * _.padStart('abc', 6, '_-');
  14783. * // => '_-_abc'
  14784. *
  14785. * _.padStart('abc', 3);
  14786. * // => 'abc'
  14787. */
  14788. function padStart(string, length, chars) {
  14789. string = toString(string);
  14790. length = toInteger(length);
  14791. var strLength = length ? stringSize(string) : 0;
  14792. return (length && strLength < length)
  14793. ? (createPadding(length - strLength, chars) + string)
  14794. : string;
  14795. }
  14796. /**
  14797. * Converts `string` to an integer of the specified radix. If `radix` is
  14798. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14799. * hexadecimal, in which case a `radix` of `16` is used.
  14800. *
  14801. * **Note:** This method aligns with the
  14802. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14803. *
  14804. * @static
  14805. * @memberOf _
  14806. * @since 1.1.0
  14807. * @category String
  14808. * @param {string} string The string to convert.
  14809. * @param {number} [radix=10] The radix to interpret `value` by.
  14810. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14811. * @returns {number} Returns the converted integer.
  14812. * @example
  14813. *
  14814. * _.parseInt('08');
  14815. * // => 8
  14816. *
  14817. * _.map(['6', '08', '10'], _.parseInt);
  14818. * // => [6, 8, 10]
  14819. */
  14820. function parseInt(string, radix, guard) {
  14821. if (guard || radix == null) {
  14822. radix = 0;
  14823. } else if (radix) {
  14824. radix = +radix;
  14825. }
  14826. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14827. }
  14828. /**
  14829. * Repeats the given string `n` times.
  14830. *
  14831. * @static
  14832. * @memberOf _
  14833. * @since 3.0.0
  14834. * @category String
  14835. * @param {string} [string=''] The string to repeat.
  14836. * @param {number} [n=1] The number of times to repeat the string.
  14837. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14838. * @returns {string} Returns the repeated string.
  14839. * @example
  14840. *
  14841. * _.repeat('*', 3);
  14842. * // => '***'
  14843. *
  14844. * _.repeat('abc', 2);
  14845. * // => 'abcabc'
  14846. *
  14847. * _.repeat('abc', 0);
  14848. * // => ''
  14849. */
  14850. function repeat(string, n, guard) {
  14851. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14852. n = 1;
  14853. } else {
  14854. n = toInteger(n);
  14855. }
  14856. return baseRepeat(toString(string), n);
  14857. }
  14858. /**
  14859. * Replaces matches for `pattern` in `string` with `replacement`.
  14860. *
  14861. * **Note:** This method is based on
  14862. * [`String#replace`](https://mdn.io/String/replace).
  14863. *
  14864. * @static
  14865. * @memberOf _
  14866. * @since 4.0.0
  14867. * @category String
  14868. * @param {string} [string=''] The string to modify.
  14869. * @param {RegExp|string} pattern The pattern to replace.
  14870. * @param {Function|string} replacement The match replacement.
  14871. * @returns {string} Returns the modified string.
  14872. * @example
  14873. *
  14874. * _.replace('Hi Fred', 'Fred', 'Barney');
  14875. * // => 'Hi Barney'
  14876. */
  14877. function replace() {
  14878. var args = arguments,
  14879. string = toString(args[0]);
  14880. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14881. }
  14882. /**
  14883. * Converts `string` to
  14884. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14885. *
  14886. * @static
  14887. * @memberOf _
  14888. * @since 3.0.0
  14889. * @category String
  14890. * @param {string} [string=''] The string to convert.
  14891. * @returns {string} Returns the snake cased string.
  14892. * @example
  14893. *
  14894. * _.snakeCase('Foo Bar');
  14895. * // => 'foo_bar'
  14896. *
  14897. * _.snakeCase('fooBar');
  14898. * // => 'foo_bar'
  14899. *
  14900. * _.snakeCase('--FOO-BAR--');
  14901. * // => 'foo_bar'
  14902. */
  14903. var snakeCase = createCompounder(function(result, word, index) {
  14904. return result + (index ? '_' : '') + word.toLowerCase();
  14905. });
  14906. /**
  14907. * Splits `string` by `separator`.
  14908. *
  14909. * **Note:** This method is based on
  14910. * [`String#split`](https://mdn.io/String/split).
  14911. *
  14912. * @static
  14913. * @memberOf _
  14914. * @since 4.0.0
  14915. * @category String
  14916. * @param {string} [string=''] The string to split.
  14917. * @param {RegExp|string} separator The separator pattern to split by.
  14918. * @param {number} [limit] The length to truncate results to.
  14919. * @returns {Array} Returns the string segments.
  14920. * @example
  14921. *
  14922. * _.split('a-b-c', '-', 2);
  14923. * // => ['a', 'b']
  14924. */
  14925. function split(string, separator, limit) {
  14926. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14927. separator = limit = undefined;
  14928. }
  14929. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14930. if (!limit) {
  14931. return [];
  14932. }
  14933. string = toString(string);
  14934. if (string && (
  14935. typeof separator == 'string' ||
  14936. (separator != null && !isRegExp(separator))
  14937. )) {
  14938. separator = baseToString(separator);
  14939. if (!separator && hasUnicode(string)) {
  14940. return castSlice(stringToArray(string), 0, limit);
  14941. }
  14942. }
  14943. return string.split(separator, limit);
  14944. }
  14945. /**
  14946. * Converts `string` to
  14947. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14948. *
  14949. * @static
  14950. * @memberOf _
  14951. * @since 3.1.0
  14952. * @category String
  14953. * @param {string} [string=''] The string to convert.
  14954. * @returns {string} Returns the start cased string.
  14955. * @example
  14956. *
  14957. * _.startCase('--foo-bar--');
  14958. * // => 'Foo Bar'
  14959. *
  14960. * _.startCase('fooBar');
  14961. * // => 'Foo Bar'
  14962. *
  14963. * _.startCase('__FOO_BAR__');
  14964. * // => 'FOO BAR'
  14965. */
  14966. var startCase = createCompounder(function(result, word, index) {
  14967. return result + (index ? ' ' : '') + upperFirst(word);
  14968. });
  14969. /**
  14970. * Checks if `string` starts with the given target string.
  14971. *
  14972. * @static
  14973. * @memberOf _
  14974. * @since 3.0.0
  14975. * @category String
  14976. * @param {string} [string=''] The string to inspect.
  14977. * @param {string} [target] The string to search for.
  14978. * @param {number} [position=0] The position to search from.
  14979. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14980. * else `false`.
  14981. * @example
  14982. *
  14983. * _.startsWith('abc', 'a');
  14984. * // => true
  14985. *
  14986. * _.startsWith('abc', 'b');
  14987. * // => false
  14988. *
  14989. * _.startsWith('abc', 'b', 1);
  14990. * // => true
  14991. */
  14992. function startsWith(string, target, position) {
  14993. string = toString(string);
  14994. position = position == null
  14995. ? 0
  14996. : baseClamp(toInteger(position), 0, string.length);
  14997. target = baseToString(target);
  14998. return string.slice(position, position + target.length) == target;
  14999. }
  15000. /**
  15001. * Creates a compiled template function that can interpolate data properties
  15002. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15003. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15004. * properties may be accessed as free variables in the template. If a setting
  15005. * object is given, it takes precedence over `_.templateSettings` values.
  15006. *
  15007. * **Note:** In the development build `_.template` utilizes
  15008. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15009. * for easier debugging.
  15010. *
  15011. * For more information on precompiling templates see
  15012. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15013. *
  15014. * For more information on Chrome extension sandboxes see
  15015. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15016. *
  15017. * @static
  15018. * @since 0.1.0
  15019. * @memberOf _
  15020. * @category String
  15021. * @param {string} [string=''] The template string.
  15022. * @param {Object} [options={}] The options object.
  15023. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15024. * The HTML "escape" delimiter.
  15025. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15026. * The "evaluate" delimiter.
  15027. * @param {Object} [options.imports=_.templateSettings.imports]
  15028. * An object to import into the template as free variables.
  15029. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15030. * The "interpolate" delimiter.
  15031. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15032. * The sourceURL of the compiled template.
  15033. * @param {string} [options.variable='obj']
  15034. * The data object variable name.
  15035. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15036. * @returns {Function} Returns the compiled template function.
  15037. * @example
  15038. *
  15039. * // Use the "interpolate" delimiter to create a compiled template.
  15040. * var compiled = _.template('hello <%= user %>!');
  15041. * compiled({ 'user': 'fred' });
  15042. * // => 'hello fred!'
  15043. *
  15044. * // Use the HTML "escape" delimiter to escape data property values.
  15045. * var compiled = _.template('<b><%- value %></b>');
  15046. * compiled({ 'value': '<script>' });
  15047. * // => '<b>&lt;script&gt;</b>'
  15048. *
  15049. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15050. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15051. * compiled({ 'users': ['fred', 'barney'] });
  15052. * // => '<li>fred</li><li>barney</li>'
  15053. *
  15054. * // Use the internal `print` function in "evaluate" delimiters.
  15055. * var compiled = _.template('<% print("hello " + user); %>!');
  15056. * compiled({ 'user': 'barney' });
  15057. * // => 'hello barney!'
  15058. *
  15059. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15060. * // Disable support by replacing the "interpolate" delimiter.
  15061. * var compiled = _.template('hello ${ user }!');
  15062. * compiled({ 'user': 'pebbles' });
  15063. * // => 'hello pebbles!'
  15064. *
  15065. * // Use backslashes to treat delimiters as plain text.
  15066. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15067. * compiled({ 'value': 'ignored' });
  15068. * // => '<%- value %>'
  15069. *
  15070. * // Use the `imports` option to import `jQuery` as `jq`.
  15071. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15072. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15073. * compiled({ 'users': ['fred', 'barney'] });
  15074. * // => '<li>fred</li><li>barney</li>'
  15075. *
  15076. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15077. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15078. * compiled(data);
  15079. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15080. *
  15081. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15082. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15083. * compiled.source;
  15084. * // => function(data) {
  15085. * // var __t, __p = '';
  15086. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15087. * // return __p;
  15088. * // }
  15089. *
  15090. * // Use custom template delimiters.
  15091. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15092. * var compiled = _.template('hello {{ user }}!');
  15093. * compiled({ 'user': 'mustache' });
  15094. * // => 'hello mustache!'
  15095. *
  15096. * // Use the `source` property to inline compiled templates for meaningful
  15097. * // line numbers in error messages and stack traces.
  15098. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15099. * var JST = {\
  15100. * "main": ' + _.template(mainText).source + '\
  15101. * };\
  15102. * ');
  15103. */
  15104. function template(string, options, guard) {
  15105. // Based on John Resig's `tmpl` implementation
  15106. // (http://ejohn.org/blog/javascript-micro-templating/)
  15107. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15108. var settings = lodash.templateSettings;
  15109. if (guard && isIterateeCall(string, options, guard)) {
  15110. options = undefined;
  15111. }
  15112. string = toString(string);
  15113. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15114. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15115. importsKeys = keys(imports),
  15116. importsValues = baseValues(imports, importsKeys);
  15117. var isEscaping,
  15118. isEvaluating,
  15119. index = 0,
  15120. interpolate = options.interpolate || reNoMatch,
  15121. source = "__p += '";
  15122. // Compile the regexp to match each delimiter.
  15123. var reDelimiters = RegExp(
  15124. (options.escape || reNoMatch).source + '|' +
  15125. interpolate.source + '|' +
  15126. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15127. (options.evaluate || reNoMatch).source + '|$'
  15128. , 'g');
  15129. // Use a sourceURL for easier debugging.
  15130. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15131. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15132. // and escape the comment, thus injecting code that gets evaled.
  15133. var sourceURL = '//# sourceURL=' +
  15134. (hasOwnProperty.call(options, 'sourceURL')
  15135. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15136. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15137. ) + '\n';
  15138. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15139. interpolateValue || (interpolateValue = esTemplateValue);
  15140. // Escape characters that can't be included in string literals.
  15141. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15142. // Replace delimiters with snippets.
  15143. if (escapeValue) {
  15144. isEscaping = true;
  15145. source += "' +\n__e(" + escapeValue + ") +\n'";
  15146. }
  15147. if (evaluateValue) {
  15148. isEvaluating = true;
  15149. source += "';\n" + evaluateValue + ";\n__p += '";
  15150. }
  15151. if (interpolateValue) {
  15152. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15153. }
  15154. index = offset + match.length;
  15155. // The JS engine embedded in Adobe products needs `match` returned in
  15156. // order to produce the correct `offset` value.
  15157. return match;
  15158. });
  15159. source += "';\n";
  15160. // If `variable` is not specified wrap a with-statement around the generated
  15161. // code to add the data object to the top of the scope chain.
  15162. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15163. if (!variable) {
  15164. source = 'with (obj) {\n' + source + '\n}\n';
  15165. }
  15166. // Throw an error if a forbidden character was found in `variable`, to prevent
  15167. // potential command injection attacks.
  15168. else if (reForbiddenIdentifierChars.test(variable)) {
  15169. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15170. }
  15171. // Cleanup code by stripping empty strings.
  15172. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15173. .replace(reEmptyStringMiddle, '$1')
  15174. .replace(reEmptyStringTrailing, '$1;');
  15175. // Frame code as the function body.
  15176. source = 'function(' + (variable || 'obj') + ') {\n' +
  15177. (variable
  15178. ? ''
  15179. : 'obj || (obj = {});\n'
  15180. ) +
  15181. "var __t, __p = ''" +
  15182. (isEscaping
  15183. ? ', __e = _.escape'
  15184. : ''
  15185. ) +
  15186. (isEvaluating
  15187. ? ', __j = Array.prototype.join;\n' +
  15188. "function print() { __p += __j.call(arguments, '') }\n"
  15189. : ';\n'
  15190. ) +
  15191. source +
  15192. 'return __p\n}';
  15193. var result = attempt(function() {
  15194. return Function(importsKeys, sourceURL + 'return ' + source)
  15195. .apply(undefined, importsValues);
  15196. });
  15197. // Provide the compiled function's source by its `toString` method or
  15198. // the `source` property as a convenience for inlining compiled templates.
  15199. result.source = source;
  15200. if (isError(result)) {
  15201. throw result;
  15202. }
  15203. return result;
  15204. }
  15205. /**
  15206. * Converts `string`, as a whole, to lower case just like
  15207. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15208. *
  15209. * @static
  15210. * @memberOf _
  15211. * @since 4.0.0
  15212. * @category String
  15213. * @param {string} [string=''] The string to convert.
  15214. * @returns {string} Returns the lower cased string.
  15215. * @example
  15216. *
  15217. * _.toLower('--Foo-Bar--');
  15218. * // => '--foo-bar--'
  15219. *
  15220. * _.toLower('fooBar');
  15221. * // => 'foobar'
  15222. *
  15223. * _.toLower('__FOO_BAR__');
  15224. * // => '__foo_bar__'
  15225. */
  15226. function toLower(value) {
  15227. return toString(value).toLowerCase();
  15228. }
  15229. /**
  15230. * Converts `string`, as a whole, to upper case just like
  15231. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15232. *
  15233. * @static
  15234. * @memberOf _
  15235. * @since 4.0.0
  15236. * @category String
  15237. * @param {string} [string=''] The string to convert.
  15238. * @returns {string} Returns the upper cased string.
  15239. * @example
  15240. *
  15241. * _.toUpper('--foo-bar--');
  15242. * // => '--FOO-BAR--'
  15243. *
  15244. * _.toUpper('fooBar');
  15245. * // => 'FOOBAR'
  15246. *
  15247. * _.toUpper('__foo_bar__');
  15248. * // => '__FOO_BAR__'
  15249. */
  15250. function toUpper(value) {
  15251. return toString(value).toUpperCase();
  15252. }
  15253. /**
  15254. * Removes leading and trailing whitespace or specified characters from `string`.
  15255. *
  15256. * @static
  15257. * @memberOf _
  15258. * @since 3.0.0
  15259. * @category String
  15260. * @param {string} [string=''] The string to trim.
  15261. * @param {string} [chars=whitespace] The characters to trim.
  15262. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15263. * @returns {string} Returns the trimmed string.
  15264. * @example
  15265. *
  15266. * _.trim(' abc ');
  15267. * // => 'abc'
  15268. *
  15269. * _.trim('-_-abc-_-', '_-');
  15270. * // => 'abc'
  15271. *
  15272. * _.map([' foo ', ' bar '], _.trim);
  15273. * // => ['foo', 'bar']
  15274. */
  15275. function trim(string, chars, guard) {
  15276. string = toString(string);
  15277. if (string && (guard || chars === undefined)) {
  15278. return baseTrim(string);
  15279. }
  15280. if (!string || !(chars = baseToString(chars))) {
  15281. return string;
  15282. }
  15283. var strSymbols = stringToArray(string),
  15284. chrSymbols = stringToArray(chars),
  15285. start = charsStartIndex(strSymbols, chrSymbols),
  15286. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15287. return castSlice(strSymbols, start, end).join('');
  15288. }
  15289. /**
  15290. * Removes trailing whitespace or specified characters from `string`.
  15291. *
  15292. * @static
  15293. * @memberOf _
  15294. * @since 4.0.0
  15295. * @category String
  15296. * @param {string} [string=''] The string to trim.
  15297. * @param {string} [chars=whitespace] The characters to trim.
  15298. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15299. * @returns {string} Returns the trimmed string.
  15300. * @example
  15301. *
  15302. * _.trimEnd(' abc ');
  15303. * // => ' abc'
  15304. *
  15305. * _.trimEnd('-_-abc-_-', '_-');
  15306. * // => '-_-abc'
  15307. */
  15308. function trimEnd(string, chars, guard) {
  15309. string = toString(string);
  15310. if (string && (guard || chars === undefined)) {
  15311. return string.slice(0, trimmedEndIndex(string) + 1);
  15312. }
  15313. if (!string || !(chars = baseToString(chars))) {
  15314. return string;
  15315. }
  15316. var strSymbols = stringToArray(string),
  15317. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15318. return castSlice(strSymbols, 0, end).join('');
  15319. }
  15320. /**
  15321. * Removes leading whitespace or specified characters from `string`.
  15322. *
  15323. * @static
  15324. * @memberOf _
  15325. * @since 4.0.0
  15326. * @category String
  15327. * @param {string} [string=''] The string to trim.
  15328. * @param {string} [chars=whitespace] The characters to trim.
  15329. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15330. * @returns {string} Returns the trimmed string.
  15331. * @example
  15332. *
  15333. * _.trimStart(' abc ');
  15334. * // => 'abc '
  15335. *
  15336. * _.trimStart('-_-abc-_-', '_-');
  15337. * // => 'abc-_-'
  15338. */
  15339. function trimStart(string, chars, guard) {
  15340. string = toString(string);
  15341. if (string && (guard || chars === undefined)) {
  15342. return string.replace(reTrimStart, '');
  15343. }
  15344. if (!string || !(chars = baseToString(chars))) {
  15345. return string;
  15346. }
  15347. var strSymbols = stringToArray(string),
  15348. start = charsStartIndex(strSymbols, stringToArray(chars));
  15349. return castSlice(strSymbols, start).join('');
  15350. }
  15351. /**
  15352. * Truncates `string` if it's longer than the given maximum string length.
  15353. * The last characters of the truncated string are replaced with the omission
  15354. * string which defaults to "...".
  15355. *
  15356. * @static
  15357. * @memberOf _
  15358. * @since 4.0.0
  15359. * @category String
  15360. * @param {string} [string=''] The string to truncate.
  15361. * @param {Object} [options={}] The options object.
  15362. * @param {number} [options.length=30] The maximum string length.
  15363. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15364. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15365. * @returns {string} Returns the truncated string.
  15366. * @example
  15367. *
  15368. * _.truncate('hi-diddly-ho there, neighborino');
  15369. * // => 'hi-diddly-ho there, neighbo...'
  15370. *
  15371. * _.truncate('hi-diddly-ho there, neighborino', {
  15372. * 'length': 24,
  15373. * 'separator': ' '
  15374. * });
  15375. * // => 'hi-diddly-ho there,...'
  15376. *
  15377. * _.truncate('hi-diddly-ho there, neighborino', {
  15378. * 'length': 24,
  15379. * 'separator': /,? +/
  15380. * });
  15381. * // => 'hi-diddly-ho there...'
  15382. *
  15383. * _.truncate('hi-diddly-ho there, neighborino', {
  15384. * 'omission': ' [...]'
  15385. * });
  15386. * // => 'hi-diddly-ho there, neig [...]'
  15387. */
  15388. function truncate(string, options) {
  15389. var length = DEFAULT_TRUNC_LENGTH,
  15390. omission = DEFAULT_TRUNC_OMISSION;
  15391. if (isObject(options)) {
  15392. var separator = 'separator' in options ? options.separator : separator;
  15393. length = 'length' in options ? toInteger(options.length) : length;
  15394. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15395. }
  15396. string = toString(string);
  15397. var strLength = string.length;
  15398. if (hasUnicode(string)) {
  15399. var strSymbols = stringToArray(string);
  15400. strLength = strSymbols.length;
  15401. }
  15402. if (length >= strLength) {
  15403. return string;
  15404. }
  15405. var end = length - stringSize(omission);
  15406. if (end < 1) {
  15407. return omission;
  15408. }
  15409. var result = strSymbols
  15410. ? castSlice(strSymbols, 0, end).join('')
  15411. : string.slice(0, end);
  15412. if (separator === undefined) {
  15413. return result + omission;
  15414. }
  15415. if (strSymbols) {
  15416. end += (result.length - end);
  15417. }
  15418. if (isRegExp(separator)) {
  15419. if (string.slice(end).search(separator)) {
  15420. var match,
  15421. substring = result;
  15422. if (!separator.global) {
  15423. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15424. }
  15425. separator.lastIndex = 0;
  15426. while ((match = separator.exec(substring))) {
  15427. var newEnd = match.index;
  15428. }
  15429. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15430. }
  15431. } else if (string.indexOf(baseToString(separator), end) != end) {
  15432. var index = result.lastIndexOf(separator);
  15433. if (index > -1) {
  15434. result = result.slice(0, index);
  15435. }
  15436. }
  15437. return result + omission;
  15438. }
  15439. /**
  15440. * The inverse of `_.escape`; this method converts the HTML entities
  15441. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15442. * their corresponding characters.
  15443. *
  15444. * **Note:** No other HTML entities are unescaped. To unescape additional
  15445. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15446. *
  15447. * @static
  15448. * @memberOf _
  15449. * @since 0.6.0
  15450. * @category String
  15451. * @param {string} [string=''] The string to unescape.
  15452. * @returns {string} Returns the unescaped string.
  15453. * @example
  15454. *
  15455. * _.unescape('fred, barney, &amp; pebbles');
  15456. * // => 'fred, barney, & pebbles'
  15457. */
  15458. function unescape(string) {
  15459. string = toString(string);
  15460. return (string && reHasEscapedHtml.test(string))
  15461. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15462. : string;
  15463. }
  15464. /**
  15465. * Converts `string`, as space separated words, to upper case.
  15466. *
  15467. * @static
  15468. * @memberOf _
  15469. * @since 4.0.0
  15470. * @category String
  15471. * @param {string} [string=''] The string to convert.
  15472. * @returns {string} Returns the upper cased string.
  15473. * @example
  15474. *
  15475. * _.upperCase('--foo-bar');
  15476. * // => 'FOO BAR'
  15477. *
  15478. * _.upperCase('fooBar');
  15479. * // => 'FOO BAR'
  15480. *
  15481. * _.upperCase('__foo_bar__');
  15482. * // => 'FOO BAR'
  15483. */
  15484. var upperCase = createCompounder(function(result, word, index) {
  15485. return result + (index ? ' ' : '') + word.toUpperCase();
  15486. });
  15487. /**
  15488. * Converts the first character of `string` to upper case.
  15489. *
  15490. * @static
  15491. * @memberOf _
  15492. * @since 4.0.0
  15493. * @category String
  15494. * @param {string} [string=''] The string to convert.
  15495. * @returns {string} Returns the converted string.
  15496. * @example
  15497. *
  15498. * _.upperFirst('fred');
  15499. * // => 'Fred'
  15500. *
  15501. * _.upperFirst('FRED');
  15502. * // => 'FRED'
  15503. */
  15504. var upperFirst = createCaseFirst('toUpperCase');
  15505. /**
  15506. * Splits `string` into an array of its words.
  15507. *
  15508. * @static
  15509. * @memberOf _
  15510. * @since 3.0.0
  15511. * @category String
  15512. * @param {string} [string=''] The string to inspect.
  15513. * @param {RegExp|string} [pattern] The pattern to match words.
  15514. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15515. * @returns {Array} Returns the words of `string`.
  15516. * @example
  15517. *
  15518. * _.words('fred, barney, & pebbles');
  15519. * // => ['fred', 'barney', 'pebbles']
  15520. *
  15521. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15522. * // => ['fred', 'barney', '&', 'pebbles']
  15523. */
  15524. function words(string, pattern, guard) {
  15525. string = toString(string);
  15526. pattern = guard ? undefined : pattern;
  15527. if (pattern === undefined) {
  15528. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15529. }
  15530. return string.match(pattern) || [];
  15531. }
  15532. /*------------------------------------------------------------------------*/
  15533. /**
  15534. * Attempts to invoke `func`, returning either the result or the caught error
  15535. * object. Any additional arguments are provided to `func` when it's invoked.
  15536. *
  15537. * @static
  15538. * @memberOf _
  15539. * @since 3.0.0
  15540. * @category Util
  15541. * @param {Function} func The function to attempt.
  15542. * @param {...*} [args] The arguments to invoke `func` with.
  15543. * @returns {*} Returns the `func` result or error object.
  15544. * @example
  15545. *
  15546. * // Avoid throwing errors for invalid selectors.
  15547. * var elements = _.attempt(function(selector) {
  15548. * return document.querySelectorAll(selector);
  15549. * }, '>_>');
  15550. *
  15551. * if (_.isError(elements)) {
  15552. * elements = [];
  15553. * }
  15554. */
  15555. var attempt = baseRest(function(func, args) {
  15556. try {
  15557. return apply(func, undefined, args);
  15558. } catch (e) {
  15559. return isError(e) ? e : new Error(e);
  15560. }
  15561. });
  15562. /**
  15563. * Binds methods of an object to the object itself, overwriting the existing
  15564. * method.
  15565. *
  15566. * **Note:** This method doesn't set the "length" property of bound functions.
  15567. *
  15568. * @static
  15569. * @since 0.1.0
  15570. * @memberOf _
  15571. * @category Util
  15572. * @param {Object} object The object to bind and assign the bound methods to.
  15573. * @param {...(string|string[])} methodNames The object method names to bind.
  15574. * @returns {Object} Returns `object`.
  15575. * @example
  15576. *
  15577. * var view = {
  15578. * 'label': 'docs',
  15579. * 'click': function() {
  15580. * console.log('clicked ' + this.label);
  15581. * }
  15582. * };
  15583. *
  15584. * _.bindAll(view, ['click']);
  15585. * jQuery(element).on('click', view.click);
  15586. * // => Logs 'clicked docs' when clicked.
  15587. */
  15588. var bindAll = flatRest(function(object, methodNames) {
  15589. arrayEach(methodNames, function(key) {
  15590. key = toKey(key);
  15591. baseAssignValue(object, key, bind(object[key], object));
  15592. });
  15593. return object;
  15594. });
  15595. /**
  15596. * Creates a function that iterates over `pairs` and invokes the corresponding
  15597. * function of the first predicate to return truthy. The predicate-function
  15598. * pairs are invoked with the `this` binding and arguments of the created
  15599. * function.
  15600. *
  15601. * @static
  15602. * @memberOf _
  15603. * @since 4.0.0
  15604. * @category Util
  15605. * @param {Array} pairs The predicate-function pairs.
  15606. * @returns {Function} Returns the new composite function.
  15607. * @example
  15608. *
  15609. * var func = _.cond([
  15610. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15611. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15612. * [_.stubTrue, _.constant('no match')]
  15613. * ]);
  15614. *
  15615. * func({ 'a': 1, 'b': 2 });
  15616. * // => 'matches A'
  15617. *
  15618. * func({ 'a': 0, 'b': 1 });
  15619. * // => 'matches B'
  15620. *
  15621. * func({ 'a': '1', 'b': '2' });
  15622. * // => 'no match'
  15623. */
  15624. function cond(pairs) {
  15625. var length = pairs == null ? 0 : pairs.length,
  15626. toIteratee = getIteratee();
  15627. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15628. if (typeof pair[1] != 'function') {
  15629. throw new TypeError(FUNC_ERROR_TEXT);
  15630. }
  15631. return [toIteratee(pair[0]), pair[1]];
  15632. });
  15633. return baseRest(function(args) {
  15634. var index = -1;
  15635. while (++index < length) {
  15636. var pair = pairs[index];
  15637. if (apply(pair[0], this, args)) {
  15638. return apply(pair[1], this, args);
  15639. }
  15640. }
  15641. });
  15642. }
  15643. /**
  15644. * Creates a function that invokes the predicate properties of `source` with
  15645. * the corresponding property values of a given object, returning `true` if
  15646. * all predicates return truthy, else `false`.
  15647. *
  15648. * **Note:** The created function is equivalent to `_.conformsTo` with
  15649. * `source` partially applied.
  15650. *
  15651. * @static
  15652. * @memberOf _
  15653. * @since 4.0.0
  15654. * @category Util
  15655. * @param {Object} source The object of property predicates to conform to.
  15656. * @returns {Function} Returns the new spec function.
  15657. * @example
  15658. *
  15659. * var objects = [
  15660. * { 'a': 2, 'b': 1 },
  15661. * { 'a': 1, 'b': 2 }
  15662. * ];
  15663. *
  15664. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15665. * // => [{ 'a': 1, 'b': 2 }]
  15666. */
  15667. function conforms(source) {
  15668. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15669. }
  15670. /**
  15671. * Creates a function that returns `value`.
  15672. *
  15673. * @static
  15674. * @memberOf _
  15675. * @since 2.4.0
  15676. * @category Util
  15677. * @param {*} value The value to return from the new function.
  15678. * @returns {Function} Returns the new constant function.
  15679. * @example
  15680. *
  15681. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15682. *
  15683. * console.log(objects);
  15684. * // => [{ 'a': 1 }, { 'a': 1 }]
  15685. *
  15686. * console.log(objects[0] === objects[1]);
  15687. * // => true
  15688. */
  15689. function constant(value) {
  15690. return function() {
  15691. return value;
  15692. };
  15693. }
  15694. /**
  15695. * Checks `value` to determine whether a default value should be returned in
  15696. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15697. * or `undefined`.
  15698. *
  15699. * @static
  15700. * @memberOf _
  15701. * @since 4.14.0
  15702. * @category Util
  15703. * @param {*} value The value to check.
  15704. * @param {*} defaultValue The default value.
  15705. * @returns {*} Returns the resolved value.
  15706. * @example
  15707. *
  15708. * _.defaultTo(1, 10);
  15709. * // => 1
  15710. *
  15711. * _.defaultTo(undefined, 10);
  15712. * // => 10
  15713. */
  15714. function defaultTo(value, defaultValue) {
  15715. return (value == null || value !== value) ? defaultValue : value;
  15716. }
  15717. /**
  15718. * Creates a function that returns the result of invoking the given functions
  15719. * with the `this` binding of the created function, where each successive
  15720. * invocation is supplied the return value of the previous.
  15721. *
  15722. * @static
  15723. * @memberOf _
  15724. * @since 3.0.0
  15725. * @category Util
  15726. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15727. * @returns {Function} Returns the new composite function.
  15728. * @see _.flowRight
  15729. * @example
  15730. *
  15731. * function square(n) {
  15732. * return n * n;
  15733. * }
  15734. *
  15735. * var addSquare = _.flow([_.add, square]);
  15736. * addSquare(1, 2);
  15737. * // => 9
  15738. */
  15739. var flow = createFlow();
  15740. /**
  15741. * This method is like `_.flow` except that it creates a function that
  15742. * invokes the given functions from right to left.
  15743. *
  15744. * @static
  15745. * @since 3.0.0
  15746. * @memberOf _
  15747. * @category Util
  15748. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15749. * @returns {Function} Returns the new composite function.
  15750. * @see _.flow
  15751. * @example
  15752. *
  15753. * function square(n) {
  15754. * return n * n;
  15755. * }
  15756. *
  15757. * var addSquare = _.flowRight([square, _.add]);
  15758. * addSquare(1, 2);
  15759. * // => 9
  15760. */
  15761. var flowRight = createFlow(true);
  15762. /**
  15763. * This method returns the first argument it receives.
  15764. *
  15765. * @static
  15766. * @since 0.1.0
  15767. * @memberOf _
  15768. * @category Util
  15769. * @param {*} value Any value.
  15770. * @returns {*} Returns `value`.
  15771. * @example
  15772. *
  15773. * var object = { 'a': 1 };
  15774. *
  15775. * console.log(_.identity(object) === object);
  15776. * // => true
  15777. */
  15778. function identity(value) {
  15779. return value;
  15780. }
  15781. /**
  15782. * Creates a function that invokes `func` with the arguments of the created
  15783. * function. If `func` is a property name, the created function returns the
  15784. * property value for a given element. If `func` is an array or object, the
  15785. * created function returns `true` for elements that contain the equivalent
  15786. * source properties, otherwise it returns `false`.
  15787. *
  15788. * @static
  15789. * @since 4.0.0
  15790. * @memberOf _
  15791. * @category Util
  15792. * @param {*} [func=_.identity] The value to convert to a callback.
  15793. * @returns {Function} Returns the callback.
  15794. * @example
  15795. *
  15796. * var users = [
  15797. * { 'user': 'barney', 'age': 36, 'active': true },
  15798. * { 'user': 'fred', 'age': 40, 'active': false }
  15799. * ];
  15800. *
  15801. * // The `_.matches` iteratee shorthand.
  15802. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15803. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15804. *
  15805. * // The `_.matchesProperty` iteratee shorthand.
  15806. * _.filter(users, _.iteratee(['user', 'fred']));
  15807. * // => [{ 'user': 'fred', 'age': 40 }]
  15808. *
  15809. * // The `_.property` iteratee shorthand.
  15810. * _.map(users, _.iteratee('user'));
  15811. * // => ['barney', 'fred']
  15812. *
  15813. * // Create custom iteratee shorthands.
  15814. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15815. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15816. * return func.test(string);
  15817. * };
  15818. * });
  15819. *
  15820. * _.filter(['abc', 'def'], /ef/);
  15821. * // => ['def']
  15822. */
  15823. function iteratee(func) {
  15824. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15825. }
  15826. /**
  15827. * Creates a function that performs a partial deep comparison between a given
  15828. * object and `source`, returning `true` if the given object has equivalent
  15829. * property values, else `false`.
  15830. *
  15831. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15832. * partially applied.
  15833. *
  15834. * Partial comparisons will match empty array and empty object `source`
  15835. * values against any array or object value, respectively. See `_.isEqual`
  15836. * for a list of supported value comparisons.
  15837. *
  15838. * **Note:** Multiple values can be checked by combining several matchers
  15839. * using `_.overSome`
  15840. *
  15841. * @static
  15842. * @memberOf _
  15843. * @since 3.0.0
  15844. * @category Util
  15845. * @param {Object} source The object of property values to match.
  15846. * @returns {Function} Returns the new spec function.
  15847. * @example
  15848. *
  15849. * var objects = [
  15850. * { 'a': 1, 'b': 2, 'c': 3 },
  15851. * { 'a': 4, 'b': 5, 'c': 6 }
  15852. * ];
  15853. *
  15854. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15855. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15856. *
  15857. * // Checking for several possible values
  15858. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15859. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15860. */
  15861. function matches(source) {
  15862. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15863. }
  15864. /**
  15865. * Creates a function that performs a partial deep comparison between the
  15866. * value at `path` of a given object to `srcValue`, returning `true` if the
  15867. * object value is equivalent, else `false`.
  15868. *
  15869. * **Note:** Partial comparisons will match empty array and empty object
  15870. * `srcValue` values against any array or object value, respectively. See
  15871. * `_.isEqual` for a list of supported value comparisons.
  15872. *
  15873. * **Note:** Multiple values can be checked by combining several matchers
  15874. * using `_.overSome`
  15875. *
  15876. * @static
  15877. * @memberOf _
  15878. * @since 3.2.0
  15879. * @category Util
  15880. * @param {Array|string} path The path of the property to get.
  15881. * @param {*} srcValue The value to match.
  15882. * @returns {Function} Returns the new spec function.
  15883. * @example
  15884. *
  15885. * var objects = [
  15886. * { 'a': 1, 'b': 2, 'c': 3 },
  15887. * { 'a': 4, 'b': 5, 'c': 6 }
  15888. * ];
  15889. *
  15890. * _.find(objects, _.matchesProperty('a', 4));
  15891. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15892. *
  15893. * // Checking for several possible values
  15894. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15895. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15896. */
  15897. function matchesProperty(path, srcValue) {
  15898. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15899. }
  15900. /**
  15901. * Creates a function that invokes the method at `path` of a given object.
  15902. * Any additional arguments are provided to the invoked method.
  15903. *
  15904. * @static
  15905. * @memberOf _
  15906. * @since 3.7.0
  15907. * @category Util
  15908. * @param {Array|string} path The path of the method to invoke.
  15909. * @param {...*} [args] The arguments to invoke the method with.
  15910. * @returns {Function} Returns the new invoker function.
  15911. * @example
  15912. *
  15913. * var objects = [
  15914. * { 'a': { 'b': _.constant(2) } },
  15915. * { 'a': { 'b': _.constant(1) } }
  15916. * ];
  15917. *
  15918. * _.map(objects, _.method('a.b'));
  15919. * // => [2, 1]
  15920. *
  15921. * _.map(objects, _.method(['a', 'b']));
  15922. * // => [2, 1]
  15923. */
  15924. var method = baseRest(function(path, args) {
  15925. return function(object) {
  15926. return baseInvoke(object, path, args);
  15927. };
  15928. });
  15929. /**
  15930. * The opposite of `_.method`; this method creates a function that invokes
  15931. * the method at a given path of `object`. Any additional arguments are
  15932. * provided to the invoked method.
  15933. *
  15934. * @static
  15935. * @memberOf _
  15936. * @since 3.7.0
  15937. * @category Util
  15938. * @param {Object} object The object to query.
  15939. * @param {...*} [args] The arguments to invoke the method with.
  15940. * @returns {Function} Returns the new invoker function.
  15941. * @example
  15942. *
  15943. * var array = _.times(3, _.constant),
  15944. * object = { 'a': array, 'b': array, 'c': array };
  15945. *
  15946. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15947. * // => [2, 0]
  15948. *
  15949. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15950. * // => [2, 0]
  15951. */
  15952. var methodOf = baseRest(function(object, args) {
  15953. return function(path) {
  15954. return baseInvoke(object, path, args);
  15955. };
  15956. });
  15957. /**
  15958. * Adds all own enumerable string keyed function properties of a source
  15959. * object to the destination object. If `object` is a function, then methods
  15960. * are added to its prototype as well.
  15961. *
  15962. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15963. * avoid conflicts caused by modifying the original.
  15964. *
  15965. * @static
  15966. * @since 0.1.0
  15967. * @memberOf _
  15968. * @category Util
  15969. * @param {Function|Object} [object=lodash] The destination object.
  15970. * @param {Object} source The object of functions to add.
  15971. * @param {Object} [options={}] The options object.
  15972. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15973. * @returns {Function|Object} Returns `object`.
  15974. * @example
  15975. *
  15976. * function vowels(string) {
  15977. * return _.filter(string, function(v) {
  15978. * return /[aeiou]/i.test(v);
  15979. * });
  15980. * }
  15981. *
  15982. * _.mixin({ 'vowels': vowels });
  15983. * _.vowels('fred');
  15984. * // => ['e']
  15985. *
  15986. * _('fred').vowels().value();
  15987. * // => ['e']
  15988. *
  15989. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15990. * _('fred').vowels();
  15991. * // => ['e']
  15992. */
  15993. function mixin(object, source, options) {
  15994. var props = keys(source),
  15995. methodNames = baseFunctions(source, props);
  15996. if (options == null &&
  15997. !(isObject(source) && (methodNames.length || !props.length))) {
  15998. options = source;
  15999. source = object;
  16000. object = this;
  16001. methodNames = baseFunctions(source, keys(source));
  16002. }
  16003. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16004. isFunc = isFunction(object);
  16005. arrayEach(methodNames, function(methodName) {
  16006. var func = source[methodName];
  16007. object[methodName] = func;
  16008. if (isFunc) {
  16009. object.prototype[methodName] = function() {
  16010. var chainAll = this.__chain__;
  16011. if (chain || chainAll) {
  16012. var result = object(this.__wrapped__),
  16013. actions = result.__actions__ = copyArray(this.__actions__);
  16014. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16015. result.__chain__ = chainAll;
  16016. return result;
  16017. }
  16018. return func.apply(object, arrayPush([this.value()], arguments));
  16019. };
  16020. }
  16021. });
  16022. return object;
  16023. }
  16024. /**
  16025. * Reverts the `_` variable to its previous value and returns a reference to
  16026. * the `lodash` function.
  16027. *
  16028. * @static
  16029. * @since 0.1.0
  16030. * @memberOf _
  16031. * @category Util
  16032. * @returns {Function} Returns the `lodash` function.
  16033. * @example
  16034. *
  16035. * var lodash = _.noConflict();
  16036. */
  16037. function noConflict() {
  16038. if (root._ === this) {
  16039. root._ = oldDash;
  16040. }
  16041. return this;
  16042. }
  16043. /**
  16044. * This method returns `undefined`.
  16045. *
  16046. * @static
  16047. * @memberOf _
  16048. * @since 2.3.0
  16049. * @category Util
  16050. * @example
  16051. *
  16052. * _.times(2, _.noop);
  16053. * // => [undefined, undefined]
  16054. */
  16055. function noop() {
  16056. // No operation performed.
  16057. }
  16058. /**
  16059. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16060. * the nth argument from the end is returned.
  16061. *
  16062. * @static
  16063. * @memberOf _
  16064. * @since 4.0.0
  16065. * @category Util
  16066. * @param {number} [n=0] The index of the argument to return.
  16067. * @returns {Function} Returns the new pass-thru function.
  16068. * @example
  16069. *
  16070. * var func = _.nthArg(1);
  16071. * func('a', 'b', 'c', 'd');
  16072. * // => 'b'
  16073. *
  16074. * var func = _.nthArg(-2);
  16075. * func('a', 'b', 'c', 'd');
  16076. * // => 'c'
  16077. */
  16078. function nthArg(n) {
  16079. n = toInteger(n);
  16080. return baseRest(function(args) {
  16081. return baseNth(args, n);
  16082. });
  16083. }
  16084. /**
  16085. * Creates a function that invokes `iteratees` with the arguments it receives
  16086. * and returns their results.
  16087. *
  16088. * @static
  16089. * @memberOf _
  16090. * @since 4.0.0
  16091. * @category Util
  16092. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16093. * The iteratees to invoke.
  16094. * @returns {Function} Returns the new function.
  16095. * @example
  16096. *
  16097. * var func = _.over([Math.max, Math.min]);
  16098. *
  16099. * func(1, 2, 3, 4);
  16100. * // => [4, 1]
  16101. */
  16102. var over = createOver(arrayMap);
  16103. /**
  16104. * Creates a function that checks if **all** of the `predicates` return
  16105. * truthy when invoked with the arguments it receives.
  16106. *
  16107. * Following shorthands are possible for providing predicates.
  16108. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16109. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16110. *
  16111. * @static
  16112. * @memberOf _
  16113. * @since 4.0.0
  16114. * @category Util
  16115. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16116. * The predicates to check.
  16117. * @returns {Function} Returns the new function.
  16118. * @example
  16119. *
  16120. * var func = _.overEvery([Boolean, isFinite]);
  16121. *
  16122. * func('1');
  16123. * // => true
  16124. *
  16125. * func(null);
  16126. * // => false
  16127. *
  16128. * func(NaN);
  16129. * // => false
  16130. */
  16131. var overEvery = createOver(arrayEvery);
  16132. /**
  16133. * Creates a function that checks if **any** of the `predicates` return
  16134. * truthy when invoked with the arguments it receives.
  16135. *
  16136. * Following shorthands are possible for providing predicates.
  16137. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16138. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16139. *
  16140. * @static
  16141. * @memberOf _
  16142. * @since 4.0.0
  16143. * @category Util
  16144. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16145. * The predicates to check.
  16146. * @returns {Function} Returns the new function.
  16147. * @example
  16148. *
  16149. * var func = _.overSome([Boolean, isFinite]);
  16150. *
  16151. * func('1');
  16152. * // => true
  16153. *
  16154. * func(null);
  16155. * // => true
  16156. *
  16157. * func(NaN);
  16158. * // => false
  16159. *
  16160. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16161. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16162. */
  16163. var overSome = createOver(arraySome);
  16164. /**
  16165. * Creates a function that returns the value at `path` of a given object.
  16166. *
  16167. * @static
  16168. * @memberOf _
  16169. * @since 2.4.0
  16170. * @category Util
  16171. * @param {Array|string} path The path of the property to get.
  16172. * @returns {Function} Returns the new accessor function.
  16173. * @example
  16174. *
  16175. * var objects = [
  16176. * { 'a': { 'b': 2 } },
  16177. * { 'a': { 'b': 1 } }
  16178. * ];
  16179. *
  16180. * _.map(objects, _.property('a.b'));
  16181. * // => [2, 1]
  16182. *
  16183. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16184. * // => [1, 2]
  16185. */
  16186. function property(path) {
  16187. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16188. }
  16189. /**
  16190. * The opposite of `_.property`; this method creates a function that returns
  16191. * the value at a given path of `object`.
  16192. *
  16193. * @static
  16194. * @memberOf _
  16195. * @since 3.0.0
  16196. * @category Util
  16197. * @param {Object} object The object to query.
  16198. * @returns {Function} Returns the new accessor function.
  16199. * @example
  16200. *
  16201. * var array = [0, 1, 2],
  16202. * object = { 'a': array, 'b': array, 'c': array };
  16203. *
  16204. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16205. * // => [2, 0]
  16206. *
  16207. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16208. * // => [2, 0]
  16209. */
  16210. function propertyOf(object) {
  16211. return function(path) {
  16212. return object == null ? undefined : baseGet(object, path);
  16213. };
  16214. }
  16215. /**
  16216. * Creates an array of numbers (positive and/or negative) progressing from
  16217. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16218. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16219. * it's set to `start` with `start` then set to `0`.
  16220. *
  16221. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16222. * floating-point values which can produce unexpected results.
  16223. *
  16224. * @static
  16225. * @since 0.1.0
  16226. * @memberOf _
  16227. * @category Util
  16228. * @param {number} [start=0] The start of the range.
  16229. * @param {number} end The end of the range.
  16230. * @param {number} [step=1] The value to increment or decrement by.
  16231. * @returns {Array} Returns the range of numbers.
  16232. * @see _.inRange, _.rangeRight
  16233. * @example
  16234. *
  16235. * _.range(4);
  16236. * // => [0, 1, 2, 3]
  16237. *
  16238. * _.range(-4);
  16239. * // => [0, -1, -2, -3]
  16240. *
  16241. * _.range(1, 5);
  16242. * // => [1, 2, 3, 4]
  16243. *
  16244. * _.range(0, 20, 5);
  16245. * // => [0, 5, 10, 15]
  16246. *
  16247. * _.range(0, -4, -1);
  16248. * // => [0, -1, -2, -3]
  16249. *
  16250. * _.range(1, 4, 0);
  16251. * // => [1, 1, 1]
  16252. *
  16253. * _.range(0);
  16254. * // => []
  16255. */
  16256. var range = createRange();
  16257. /**
  16258. * This method is like `_.range` except that it populates values in
  16259. * descending order.
  16260. *
  16261. * @static
  16262. * @memberOf _
  16263. * @since 4.0.0
  16264. * @category Util
  16265. * @param {number} [start=0] The start of the range.
  16266. * @param {number} end The end of the range.
  16267. * @param {number} [step=1] The value to increment or decrement by.
  16268. * @returns {Array} Returns the range of numbers.
  16269. * @see _.inRange, _.range
  16270. * @example
  16271. *
  16272. * _.rangeRight(4);
  16273. * // => [3, 2, 1, 0]
  16274. *
  16275. * _.rangeRight(-4);
  16276. * // => [-3, -2, -1, 0]
  16277. *
  16278. * _.rangeRight(1, 5);
  16279. * // => [4, 3, 2, 1]
  16280. *
  16281. * _.rangeRight(0, 20, 5);
  16282. * // => [15, 10, 5, 0]
  16283. *
  16284. * _.rangeRight(0, -4, -1);
  16285. * // => [-3, -2, -1, 0]
  16286. *
  16287. * _.rangeRight(1, 4, 0);
  16288. * // => [1, 1, 1]
  16289. *
  16290. * _.rangeRight(0);
  16291. * // => []
  16292. */
  16293. var rangeRight = createRange(true);
  16294. /**
  16295. * This method returns a new empty array.
  16296. *
  16297. * @static
  16298. * @memberOf _
  16299. * @since 4.13.0
  16300. * @category Util
  16301. * @returns {Array} Returns the new empty array.
  16302. * @example
  16303. *
  16304. * var arrays = _.times(2, _.stubArray);
  16305. *
  16306. * console.log(arrays);
  16307. * // => [[], []]
  16308. *
  16309. * console.log(arrays[0] === arrays[1]);
  16310. * // => false
  16311. */
  16312. function stubArray() {
  16313. return [];
  16314. }
  16315. /**
  16316. * This method returns `false`.
  16317. *
  16318. * @static
  16319. * @memberOf _
  16320. * @since 4.13.0
  16321. * @category Util
  16322. * @returns {boolean} Returns `false`.
  16323. * @example
  16324. *
  16325. * _.times(2, _.stubFalse);
  16326. * // => [false, false]
  16327. */
  16328. function stubFalse() {
  16329. return false;
  16330. }
  16331. /**
  16332. * This method returns a new empty object.
  16333. *
  16334. * @static
  16335. * @memberOf _
  16336. * @since 4.13.0
  16337. * @category Util
  16338. * @returns {Object} Returns the new empty object.
  16339. * @example
  16340. *
  16341. * var objects = _.times(2, _.stubObject);
  16342. *
  16343. * console.log(objects);
  16344. * // => [{}, {}]
  16345. *
  16346. * console.log(objects[0] === objects[1]);
  16347. * // => false
  16348. */
  16349. function stubObject() {
  16350. return {};
  16351. }
  16352. /**
  16353. * This method returns an empty string.
  16354. *
  16355. * @static
  16356. * @memberOf _
  16357. * @since 4.13.0
  16358. * @category Util
  16359. * @returns {string} Returns the empty string.
  16360. * @example
  16361. *
  16362. * _.times(2, _.stubString);
  16363. * // => ['', '']
  16364. */
  16365. function stubString() {
  16366. return '';
  16367. }
  16368. /**
  16369. * This method returns `true`.
  16370. *
  16371. * @static
  16372. * @memberOf _
  16373. * @since 4.13.0
  16374. * @category Util
  16375. * @returns {boolean} Returns `true`.
  16376. * @example
  16377. *
  16378. * _.times(2, _.stubTrue);
  16379. * // => [true, true]
  16380. */
  16381. function stubTrue() {
  16382. return true;
  16383. }
  16384. /**
  16385. * Invokes the iteratee `n` times, returning an array of the results of
  16386. * each invocation. The iteratee is invoked with one argument; (index).
  16387. *
  16388. * @static
  16389. * @since 0.1.0
  16390. * @memberOf _
  16391. * @category Util
  16392. * @param {number} n The number of times to invoke `iteratee`.
  16393. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16394. * @returns {Array} Returns the array of results.
  16395. * @example
  16396. *
  16397. * _.times(3, String);
  16398. * // => ['0', '1', '2']
  16399. *
  16400. * _.times(4, _.constant(0));
  16401. * // => [0, 0, 0, 0]
  16402. */
  16403. function times(n, iteratee) {
  16404. n = toInteger(n);
  16405. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16406. return [];
  16407. }
  16408. var index = MAX_ARRAY_LENGTH,
  16409. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16410. iteratee = getIteratee(iteratee);
  16411. n -= MAX_ARRAY_LENGTH;
  16412. var result = baseTimes(length, iteratee);
  16413. while (++index < n) {
  16414. iteratee(index);
  16415. }
  16416. return result;
  16417. }
  16418. /**
  16419. * Converts `value` to a property path array.
  16420. *
  16421. * @static
  16422. * @memberOf _
  16423. * @since 4.0.0
  16424. * @category Util
  16425. * @param {*} value The value to convert.
  16426. * @returns {Array} Returns the new property path array.
  16427. * @example
  16428. *
  16429. * _.toPath('a.b.c');
  16430. * // => ['a', 'b', 'c']
  16431. *
  16432. * _.toPath('a[0].b.c');
  16433. * // => ['a', '0', 'b', 'c']
  16434. */
  16435. function toPath(value) {
  16436. if (isArray(value)) {
  16437. return arrayMap(value, toKey);
  16438. }
  16439. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16440. }
  16441. /**
  16442. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16443. *
  16444. * @static
  16445. * @since 0.1.0
  16446. * @memberOf _
  16447. * @category Util
  16448. * @param {string} [prefix=''] The value to prefix the ID with.
  16449. * @returns {string} Returns the unique ID.
  16450. * @example
  16451. *
  16452. * _.uniqueId('contact_');
  16453. * // => 'contact_104'
  16454. *
  16455. * _.uniqueId();
  16456. * // => '105'
  16457. */
  16458. function uniqueId(prefix) {
  16459. var id = ++idCounter;
  16460. return toString(prefix) + id;
  16461. }
  16462. /*------------------------------------------------------------------------*/
  16463. /**
  16464. * Adds two numbers.
  16465. *
  16466. * @static
  16467. * @memberOf _
  16468. * @since 3.4.0
  16469. * @category Math
  16470. * @param {number} augend The first number in an addition.
  16471. * @param {number} addend The second number in an addition.
  16472. * @returns {number} Returns the total.
  16473. * @example
  16474. *
  16475. * _.add(6, 4);
  16476. * // => 10
  16477. */
  16478. var add = createMathOperation(function(augend, addend) {
  16479. return augend + addend;
  16480. }, 0);
  16481. /**
  16482. * Computes `number` rounded up to `precision`.
  16483. *
  16484. * @static
  16485. * @memberOf _
  16486. * @since 3.10.0
  16487. * @category Math
  16488. * @param {number} number The number to round up.
  16489. * @param {number} [precision=0] The precision to round up to.
  16490. * @returns {number} Returns the rounded up number.
  16491. * @example
  16492. *
  16493. * _.ceil(4.006);
  16494. * // => 5
  16495. *
  16496. * _.ceil(6.004, 2);
  16497. * // => 6.01
  16498. *
  16499. * _.ceil(6040, -2);
  16500. * // => 6100
  16501. */
  16502. var ceil = createRound('ceil');
  16503. /**
  16504. * Divide two numbers.
  16505. *
  16506. * @static
  16507. * @memberOf _
  16508. * @since 4.7.0
  16509. * @category Math
  16510. * @param {number} dividend The first number in a division.
  16511. * @param {number} divisor The second number in a division.
  16512. * @returns {number} Returns the quotient.
  16513. * @example
  16514. *
  16515. * _.divide(6, 4);
  16516. * // => 1.5
  16517. */
  16518. var divide = createMathOperation(function(dividend, divisor) {
  16519. return dividend / divisor;
  16520. }, 1);
  16521. /**
  16522. * Computes `number` rounded down to `precision`.
  16523. *
  16524. * @static
  16525. * @memberOf _
  16526. * @since 3.10.0
  16527. * @category Math
  16528. * @param {number} number The number to round down.
  16529. * @param {number} [precision=0] The precision to round down to.
  16530. * @returns {number} Returns the rounded down number.
  16531. * @example
  16532. *
  16533. * _.floor(4.006);
  16534. * // => 4
  16535. *
  16536. * _.floor(0.046, 2);
  16537. * // => 0.04
  16538. *
  16539. * _.floor(4060, -2);
  16540. * // => 4000
  16541. */
  16542. var floor = createRound('floor');
  16543. /**
  16544. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16545. * `undefined` is returned.
  16546. *
  16547. * @static
  16548. * @since 0.1.0
  16549. * @memberOf _
  16550. * @category Math
  16551. * @param {Array} array The array to iterate over.
  16552. * @returns {*} Returns the maximum value.
  16553. * @example
  16554. *
  16555. * _.max([4, 2, 8, 6]);
  16556. * // => 8
  16557. *
  16558. * _.max([]);
  16559. * // => undefined
  16560. */
  16561. function max(array) {
  16562. return (array && array.length)
  16563. ? baseExtremum(array, identity, baseGt)
  16564. : undefined;
  16565. }
  16566. /**
  16567. * This method is like `_.max` except that it accepts `iteratee` which is
  16568. * invoked for each element in `array` to generate the criterion by which
  16569. * the value is ranked. The iteratee is invoked with one argument: (value).
  16570. *
  16571. * @static
  16572. * @memberOf _
  16573. * @since 4.0.0
  16574. * @category Math
  16575. * @param {Array} array The array to iterate over.
  16576. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16577. * @returns {*} Returns the maximum value.
  16578. * @example
  16579. *
  16580. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16581. *
  16582. * _.maxBy(objects, function(o) { return o.n; });
  16583. * // => { 'n': 2 }
  16584. *
  16585. * // The `_.property` iteratee shorthand.
  16586. * _.maxBy(objects, 'n');
  16587. * // => { 'n': 2 }
  16588. */
  16589. function maxBy(array, iteratee) {
  16590. return (array && array.length)
  16591. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16592. : undefined;
  16593. }
  16594. /**
  16595. * Computes the mean of the values in `array`.
  16596. *
  16597. * @static
  16598. * @memberOf _
  16599. * @since 4.0.0
  16600. * @category Math
  16601. * @param {Array} array The array to iterate over.
  16602. * @returns {number} Returns the mean.
  16603. * @example
  16604. *
  16605. * _.mean([4, 2, 8, 6]);
  16606. * // => 5
  16607. */
  16608. function mean(array) {
  16609. return baseMean(array, identity);
  16610. }
  16611. /**
  16612. * This method is like `_.mean` except that it accepts `iteratee` which is
  16613. * invoked for each element in `array` to generate the value to be averaged.
  16614. * The iteratee is invoked with one argument: (value).
  16615. *
  16616. * @static
  16617. * @memberOf _
  16618. * @since 4.7.0
  16619. * @category Math
  16620. * @param {Array} array The array to iterate over.
  16621. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16622. * @returns {number} Returns the mean.
  16623. * @example
  16624. *
  16625. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16626. *
  16627. * _.meanBy(objects, function(o) { return o.n; });
  16628. * // => 5
  16629. *
  16630. * // The `_.property` iteratee shorthand.
  16631. * _.meanBy(objects, 'n');
  16632. * // => 5
  16633. */
  16634. function meanBy(array, iteratee) {
  16635. return baseMean(array, getIteratee(iteratee, 2));
  16636. }
  16637. /**
  16638. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16639. * `undefined` is returned.
  16640. *
  16641. * @static
  16642. * @since 0.1.0
  16643. * @memberOf _
  16644. * @category Math
  16645. * @param {Array} array The array to iterate over.
  16646. * @returns {*} Returns the minimum value.
  16647. * @example
  16648. *
  16649. * _.min([4, 2, 8, 6]);
  16650. * // => 2
  16651. *
  16652. * _.min([]);
  16653. * // => undefined
  16654. */
  16655. function min(array) {
  16656. return (array && array.length)
  16657. ? baseExtremum(array, identity, baseLt)
  16658. : undefined;
  16659. }
  16660. /**
  16661. * This method is like `_.min` except that it accepts `iteratee` which is
  16662. * invoked for each element in `array` to generate the criterion by which
  16663. * the value is ranked. The iteratee is invoked with one argument: (value).
  16664. *
  16665. * @static
  16666. * @memberOf _
  16667. * @since 4.0.0
  16668. * @category Math
  16669. * @param {Array} array The array to iterate over.
  16670. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16671. * @returns {*} Returns the minimum value.
  16672. * @example
  16673. *
  16674. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16675. *
  16676. * _.minBy(objects, function(o) { return o.n; });
  16677. * // => { 'n': 1 }
  16678. *
  16679. * // The `_.property` iteratee shorthand.
  16680. * _.minBy(objects, 'n');
  16681. * // => { 'n': 1 }
  16682. */
  16683. function minBy(array, iteratee) {
  16684. return (array && array.length)
  16685. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16686. : undefined;
  16687. }
  16688. /**
  16689. * Multiply two numbers.
  16690. *
  16691. * @static
  16692. * @memberOf _
  16693. * @since 4.7.0
  16694. * @category Math
  16695. * @param {number} multiplier The first number in a multiplication.
  16696. * @param {number} multiplicand The second number in a multiplication.
  16697. * @returns {number} Returns the product.
  16698. * @example
  16699. *
  16700. * _.multiply(6, 4);
  16701. * // => 24
  16702. */
  16703. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16704. return multiplier * multiplicand;
  16705. }, 1);
  16706. /**
  16707. * Computes `number` rounded to `precision`.
  16708. *
  16709. * @static
  16710. * @memberOf _
  16711. * @since 3.10.0
  16712. * @category Math
  16713. * @param {number} number The number to round.
  16714. * @param {number} [precision=0] The precision to round to.
  16715. * @returns {number} Returns the rounded number.
  16716. * @example
  16717. *
  16718. * _.round(4.006);
  16719. * // => 4
  16720. *
  16721. * _.round(4.006, 2);
  16722. * // => 4.01
  16723. *
  16724. * _.round(4060, -2);
  16725. * // => 4100
  16726. */
  16727. var round = createRound('round');
  16728. /**
  16729. * Subtract two numbers.
  16730. *
  16731. * @static
  16732. * @memberOf _
  16733. * @since 4.0.0
  16734. * @category Math
  16735. * @param {number} minuend The first number in a subtraction.
  16736. * @param {number} subtrahend The second number in a subtraction.
  16737. * @returns {number} Returns the difference.
  16738. * @example
  16739. *
  16740. * _.subtract(6, 4);
  16741. * // => 2
  16742. */
  16743. var subtract = createMathOperation(function(minuend, subtrahend) {
  16744. return minuend - subtrahend;
  16745. }, 0);
  16746. /**
  16747. * Computes the sum of the values in `array`.
  16748. *
  16749. * @static
  16750. * @memberOf _
  16751. * @since 3.4.0
  16752. * @category Math
  16753. * @param {Array} array The array to iterate over.
  16754. * @returns {number} Returns the sum.
  16755. * @example
  16756. *
  16757. * _.sum([4, 2, 8, 6]);
  16758. * // => 20
  16759. */
  16760. function sum(array) {
  16761. return (array && array.length)
  16762. ? baseSum(array, identity)
  16763. : 0;
  16764. }
  16765. /**
  16766. * This method is like `_.sum` except that it accepts `iteratee` which is
  16767. * invoked for each element in `array` to generate the value to be summed.
  16768. * The iteratee is invoked with one argument: (value).
  16769. *
  16770. * @static
  16771. * @memberOf _
  16772. * @since 4.0.0
  16773. * @category Math
  16774. * @param {Array} array The array to iterate over.
  16775. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16776. * @returns {number} Returns the sum.
  16777. * @example
  16778. *
  16779. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16780. *
  16781. * _.sumBy(objects, function(o) { return o.n; });
  16782. * // => 20
  16783. *
  16784. * // The `_.property` iteratee shorthand.
  16785. * _.sumBy(objects, 'n');
  16786. * // => 20
  16787. */
  16788. function sumBy(array, iteratee) {
  16789. return (array && array.length)
  16790. ? baseSum(array, getIteratee(iteratee, 2))
  16791. : 0;
  16792. }
  16793. /*------------------------------------------------------------------------*/
  16794. // Add methods that return wrapped values in chain sequences.
  16795. lodash.after = after;
  16796. lodash.ary = ary;
  16797. lodash.assign = assign;
  16798. lodash.assignIn = assignIn;
  16799. lodash.assignInWith = assignInWith;
  16800. lodash.assignWith = assignWith;
  16801. lodash.at = at;
  16802. lodash.before = before;
  16803. lodash.bind = bind;
  16804. lodash.bindAll = bindAll;
  16805. lodash.bindKey = bindKey;
  16806. lodash.castArray = castArray;
  16807. lodash.chain = chain;
  16808. lodash.chunk = chunk;
  16809. lodash.compact = compact;
  16810. lodash.concat = concat;
  16811. lodash.cond = cond;
  16812. lodash.conforms = conforms;
  16813. lodash.constant = constant;
  16814. lodash.countBy = countBy;
  16815. lodash.create = create;
  16816. lodash.curry = curry;
  16817. lodash.curryRight = curryRight;
  16818. lodash.debounce = debounce;
  16819. lodash.defaults = defaults;
  16820. lodash.defaultsDeep = defaultsDeep;
  16821. lodash.defer = defer;
  16822. lodash.delay = delay;
  16823. lodash.difference = difference;
  16824. lodash.differenceBy = differenceBy;
  16825. lodash.differenceWith = differenceWith;
  16826. lodash.drop = drop;
  16827. lodash.dropRight = dropRight;
  16828. lodash.dropRightWhile = dropRightWhile;
  16829. lodash.dropWhile = dropWhile;
  16830. lodash.fill = fill;
  16831. lodash.filter = filter;
  16832. lodash.flatMap = flatMap;
  16833. lodash.flatMapDeep = flatMapDeep;
  16834. lodash.flatMapDepth = flatMapDepth;
  16835. lodash.flatten = flatten;
  16836. lodash.flattenDeep = flattenDeep;
  16837. lodash.flattenDepth = flattenDepth;
  16838. lodash.flip = flip;
  16839. lodash.flow = flow;
  16840. lodash.flowRight = flowRight;
  16841. lodash.fromPairs = fromPairs;
  16842. lodash.functions = functions;
  16843. lodash.functionsIn = functionsIn;
  16844. lodash.groupBy = groupBy;
  16845. lodash.initial = initial;
  16846. lodash.intersection = intersection;
  16847. lodash.intersectionBy = intersectionBy;
  16848. lodash.intersectionWith = intersectionWith;
  16849. lodash.invert = invert;
  16850. lodash.invertBy = invertBy;
  16851. lodash.invokeMap = invokeMap;
  16852. lodash.iteratee = iteratee;
  16853. lodash.keyBy = keyBy;
  16854. lodash.keys = keys;
  16855. lodash.keysIn = keysIn;
  16856. lodash.map = map;
  16857. lodash.mapKeys = mapKeys;
  16858. lodash.mapValues = mapValues;
  16859. lodash.matches = matches;
  16860. lodash.matchesProperty = matchesProperty;
  16861. lodash.memoize = memoize;
  16862. lodash.merge = merge;
  16863. lodash.mergeWith = mergeWith;
  16864. lodash.method = method;
  16865. lodash.methodOf = methodOf;
  16866. lodash.mixin = mixin;
  16867. lodash.negate = negate;
  16868. lodash.nthArg = nthArg;
  16869. lodash.omit = omit;
  16870. lodash.omitBy = omitBy;
  16871. lodash.once = once;
  16872. lodash.orderBy = orderBy;
  16873. lodash.over = over;
  16874. lodash.overArgs = overArgs;
  16875. lodash.overEvery = overEvery;
  16876. lodash.overSome = overSome;
  16877. lodash.partial = partial;
  16878. lodash.partialRight = partialRight;
  16879. lodash.partition = partition;
  16880. lodash.pick = pick;
  16881. lodash.pickBy = pickBy;
  16882. lodash.property = property;
  16883. lodash.propertyOf = propertyOf;
  16884. lodash.pull = pull;
  16885. lodash.pullAll = pullAll;
  16886. lodash.pullAllBy = pullAllBy;
  16887. lodash.pullAllWith = pullAllWith;
  16888. lodash.pullAt = pullAt;
  16889. lodash.range = range;
  16890. lodash.rangeRight = rangeRight;
  16891. lodash.rearg = rearg;
  16892. lodash.reject = reject;
  16893. lodash.remove = remove;
  16894. lodash.rest = rest;
  16895. lodash.reverse = reverse;
  16896. lodash.sampleSize = sampleSize;
  16897. lodash.set = set;
  16898. lodash.setWith = setWith;
  16899. lodash.shuffle = shuffle;
  16900. lodash.slice = slice;
  16901. lodash.sortBy = sortBy;
  16902. lodash.sortedUniq = sortedUniq;
  16903. lodash.sortedUniqBy = sortedUniqBy;
  16904. lodash.split = split;
  16905. lodash.spread = spread;
  16906. lodash.tail = tail;
  16907. lodash.take = take;
  16908. lodash.takeRight = takeRight;
  16909. lodash.takeRightWhile = takeRightWhile;
  16910. lodash.takeWhile = takeWhile;
  16911. lodash.tap = tap;
  16912. lodash.throttle = throttle;
  16913. lodash.thru = thru;
  16914. lodash.toArray = toArray;
  16915. lodash.toPairs = toPairs;
  16916. lodash.toPairsIn = toPairsIn;
  16917. lodash.toPath = toPath;
  16918. lodash.toPlainObject = toPlainObject;
  16919. lodash.transform = transform;
  16920. lodash.unary = unary;
  16921. lodash.union = union;
  16922. lodash.unionBy = unionBy;
  16923. lodash.unionWith = unionWith;
  16924. lodash.uniq = uniq;
  16925. lodash.uniqBy = uniqBy;
  16926. lodash.uniqWith = uniqWith;
  16927. lodash.unset = unset;
  16928. lodash.unzip = unzip;
  16929. lodash.unzipWith = unzipWith;
  16930. lodash.update = update;
  16931. lodash.updateWith = updateWith;
  16932. lodash.values = values;
  16933. lodash.valuesIn = valuesIn;
  16934. lodash.without = without;
  16935. lodash.words = words;
  16936. lodash.wrap = wrap;
  16937. lodash.xor = xor;
  16938. lodash.xorBy = xorBy;
  16939. lodash.xorWith = xorWith;
  16940. lodash.zip = zip;
  16941. lodash.zipObject = zipObject;
  16942. lodash.zipObjectDeep = zipObjectDeep;
  16943. lodash.zipWith = zipWith;
  16944. // Add aliases.
  16945. lodash.entries = toPairs;
  16946. lodash.entriesIn = toPairsIn;
  16947. lodash.extend = assignIn;
  16948. lodash.extendWith = assignInWith;
  16949. // Add methods to `lodash.prototype`.
  16950. mixin(lodash, lodash);
  16951. /*------------------------------------------------------------------------*/
  16952. // Add methods that return unwrapped values in chain sequences.
  16953. lodash.add = add;
  16954. lodash.attempt = attempt;
  16955. lodash.camelCase = camelCase;
  16956. lodash.capitalize = capitalize;
  16957. lodash.ceil = ceil;
  16958. lodash.clamp = clamp;
  16959. lodash.clone = clone;
  16960. lodash.cloneDeep = cloneDeep;
  16961. lodash.cloneDeepWith = cloneDeepWith;
  16962. lodash.cloneWith = cloneWith;
  16963. lodash.conformsTo = conformsTo;
  16964. lodash.deburr = deburr;
  16965. lodash.defaultTo = defaultTo;
  16966. lodash.divide = divide;
  16967. lodash.endsWith = endsWith;
  16968. lodash.eq = eq;
  16969. lodash.escape = escape;
  16970. lodash.escapeRegExp = escapeRegExp;
  16971. lodash.every = every;
  16972. lodash.find = find;
  16973. lodash.findIndex = findIndex;
  16974. lodash.findKey = findKey;
  16975. lodash.findLast = findLast;
  16976. lodash.findLastIndex = findLastIndex;
  16977. lodash.findLastKey = findLastKey;
  16978. lodash.floor = floor;
  16979. lodash.forEach = forEach;
  16980. lodash.forEachRight = forEachRight;
  16981. lodash.forIn = forIn;
  16982. lodash.forInRight = forInRight;
  16983. lodash.forOwn = forOwn;
  16984. lodash.forOwnRight = forOwnRight;
  16985. lodash.get = get;
  16986. lodash.gt = gt;
  16987. lodash.gte = gte;
  16988. lodash.has = has;
  16989. lodash.hasIn = hasIn;
  16990. lodash.head = head;
  16991. lodash.identity = identity;
  16992. lodash.includes = includes;
  16993. lodash.indexOf = indexOf;
  16994. lodash.inRange = inRange;
  16995. lodash.invoke = invoke;
  16996. lodash.isArguments = isArguments;
  16997. lodash.isArray = isArray;
  16998. lodash.isArrayBuffer = isArrayBuffer;
  16999. lodash.isArrayLike = isArrayLike;
  17000. lodash.isArrayLikeObject = isArrayLikeObject;
  17001. lodash.isBoolean = isBoolean;
  17002. lodash.isBuffer = isBuffer;
  17003. lodash.isDate = isDate;
  17004. lodash.isElement = isElement;
  17005. lodash.isEmpty = isEmpty;
  17006. lodash.isEqual = isEqual;
  17007. lodash.isEqualWith = isEqualWith;
  17008. lodash.isError = isError;
  17009. lodash.isFinite = isFinite;
  17010. lodash.isFunction = isFunction;
  17011. lodash.isInteger = isInteger;
  17012. lodash.isLength = isLength;
  17013. lodash.isMap = isMap;
  17014. lodash.isMatch = isMatch;
  17015. lodash.isMatchWith = isMatchWith;
  17016. lodash.isNaN = isNaN;
  17017. lodash.isNative = isNative;
  17018. lodash.isNil = isNil;
  17019. lodash.isNull = isNull;
  17020. lodash.isNumber = isNumber;
  17021. lodash.isObject = isObject;
  17022. lodash.isObjectLike = isObjectLike;
  17023. lodash.isPlainObject = isPlainObject;
  17024. lodash.isRegExp = isRegExp;
  17025. lodash.isSafeInteger = isSafeInteger;
  17026. lodash.isSet = isSet;
  17027. lodash.isString = isString;
  17028. lodash.isSymbol = isSymbol;
  17029. lodash.isTypedArray = isTypedArray;
  17030. lodash.isUndefined = isUndefined;
  17031. lodash.isWeakMap = isWeakMap;
  17032. lodash.isWeakSet = isWeakSet;
  17033. lodash.join = join;
  17034. lodash.kebabCase = kebabCase;
  17035. lodash.last = last;
  17036. lodash.lastIndexOf = lastIndexOf;
  17037. lodash.lowerCase = lowerCase;
  17038. lodash.lowerFirst = lowerFirst;
  17039. lodash.lt = lt;
  17040. lodash.lte = lte;
  17041. lodash.max = max;
  17042. lodash.maxBy = maxBy;
  17043. lodash.mean = mean;
  17044. lodash.meanBy = meanBy;
  17045. lodash.min = min;
  17046. lodash.minBy = minBy;
  17047. lodash.stubArray = stubArray;
  17048. lodash.stubFalse = stubFalse;
  17049. lodash.stubObject = stubObject;
  17050. lodash.stubString = stubString;
  17051. lodash.stubTrue = stubTrue;
  17052. lodash.multiply = multiply;
  17053. lodash.nth = nth;
  17054. lodash.noConflict = noConflict;
  17055. lodash.noop = noop;
  17056. lodash.now = now;
  17057. lodash.pad = pad;
  17058. lodash.padEnd = padEnd;
  17059. lodash.padStart = padStart;
  17060. lodash.parseInt = parseInt;
  17061. lodash.random = random;
  17062. lodash.reduce = reduce;
  17063. lodash.reduceRight = reduceRight;
  17064. lodash.repeat = repeat;
  17065. lodash.replace = replace;
  17066. lodash.result = result;
  17067. lodash.round = round;
  17068. lodash.runInContext = runInContext;
  17069. lodash.sample = sample;
  17070. lodash.size = size;
  17071. lodash.snakeCase = snakeCase;
  17072. lodash.some = some;
  17073. lodash.sortedIndex = sortedIndex;
  17074. lodash.sortedIndexBy = sortedIndexBy;
  17075. lodash.sortedIndexOf = sortedIndexOf;
  17076. lodash.sortedLastIndex = sortedLastIndex;
  17077. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17078. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17079. lodash.startCase = startCase;
  17080. lodash.startsWith = startsWith;
  17081. lodash.subtract = subtract;
  17082. lodash.sum = sum;
  17083. lodash.sumBy = sumBy;
  17084. lodash.template = template;
  17085. lodash.times = times;
  17086. lodash.toFinite = toFinite;
  17087. lodash.toInteger = toInteger;
  17088. lodash.toLength = toLength;
  17089. lodash.toLower = toLower;
  17090. lodash.toNumber = toNumber;
  17091. lodash.toSafeInteger = toSafeInteger;
  17092. lodash.toString = toString;
  17093. lodash.toUpper = toUpper;
  17094. lodash.trim = trim;
  17095. lodash.trimEnd = trimEnd;
  17096. lodash.trimStart = trimStart;
  17097. lodash.truncate = truncate;
  17098. lodash.unescape = unescape;
  17099. lodash.uniqueId = uniqueId;
  17100. lodash.upperCase = upperCase;
  17101. lodash.upperFirst = upperFirst;
  17102. // Add aliases.
  17103. lodash.each = forEach;
  17104. lodash.eachRight = forEachRight;
  17105. lodash.first = head;
  17106. mixin(lodash, (function() {
  17107. var source = {};
  17108. baseForOwn(lodash, function(func, methodName) {
  17109. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17110. source[methodName] = func;
  17111. }
  17112. });
  17113. return source;
  17114. }()), { 'chain': false });
  17115. /*------------------------------------------------------------------------*/
  17116. /**
  17117. * The semantic version number.
  17118. *
  17119. * @static
  17120. * @memberOf _
  17121. * @type {string}
  17122. */
  17123. lodash.VERSION = VERSION;
  17124. // Assign default placeholders.
  17125. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17126. lodash[methodName].placeholder = lodash;
  17127. });
  17128. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17129. arrayEach(['drop', 'take'], function(methodName, index) {
  17130. LazyWrapper.prototype[methodName] = function(n) {
  17131. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17132. var result = (this.__filtered__ && !index)
  17133. ? new LazyWrapper(this)
  17134. : this.clone();
  17135. if (result.__filtered__) {
  17136. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17137. } else {
  17138. result.__views__.push({
  17139. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17140. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17141. });
  17142. }
  17143. return result;
  17144. };
  17145. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17146. return this.reverse()[methodName](n).reverse();
  17147. };
  17148. });
  17149. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17150. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17151. var type = index + 1,
  17152. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17153. LazyWrapper.prototype[methodName] = function(iteratee) {
  17154. var result = this.clone();
  17155. result.__iteratees__.push({
  17156. 'iteratee': getIteratee(iteratee, 3),
  17157. 'type': type
  17158. });
  17159. result.__filtered__ = result.__filtered__ || isFilter;
  17160. return result;
  17161. };
  17162. });
  17163. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17164. arrayEach(['head', 'last'], function(methodName, index) {
  17165. var takeName = 'take' + (index ? 'Right' : '');
  17166. LazyWrapper.prototype[methodName] = function() {
  17167. return this[takeName](1).value()[0];
  17168. };
  17169. });
  17170. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17171. arrayEach(['initial', 'tail'], function(methodName, index) {
  17172. var dropName = 'drop' + (index ? '' : 'Right');
  17173. LazyWrapper.prototype[methodName] = function() {
  17174. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17175. };
  17176. });
  17177. LazyWrapper.prototype.compact = function() {
  17178. return this.filter(identity);
  17179. };
  17180. LazyWrapper.prototype.find = function(predicate) {
  17181. return this.filter(predicate).head();
  17182. };
  17183. LazyWrapper.prototype.findLast = function(predicate) {
  17184. return this.reverse().find(predicate);
  17185. };
  17186. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17187. if (typeof path == 'function') {
  17188. return new LazyWrapper(this);
  17189. }
  17190. return this.map(function(value) {
  17191. return baseInvoke(value, path, args);
  17192. });
  17193. });
  17194. LazyWrapper.prototype.reject = function(predicate) {
  17195. return this.filter(negate(getIteratee(predicate)));
  17196. };
  17197. LazyWrapper.prototype.slice = function(start, end) {
  17198. start = toInteger(start);
  17199. var result = this;
  17200. if (result.__filtered__ && (start > 0 || end < 0)) {
  17201. return new LazyWrapper(result);
  17202. }
  17203. if (start < 0) {
  17204. result = result.takeRight(-start);
  17205. } else if (start) {
  17206. result = result.drop(start);
  17207. }
  17208. if (end !== undefined) {
  17209. end = toInteger(end);
  17210. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17211. }
  17212. return result;
  17213. };
  17214. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17215. return this.reverse().takeWhile(predicate).reverse();
  17216. };
  17217. LazyWrapper.prototype.toArray = function() {
  17218. return this.take(MAX_ARRAY_LENGTH);
  17219. };
  17220. // Add `LazyWrapper` methods to `lodash.prototype`.
  17221. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17222. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17223. isTaker = /^(?:head|last)$/.test(methodName),
  17224. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17225. retUnwrapped = isTaker || /^find/.test(methodName);
  17226. if (!lodashFunc) {
  17227. return;
  17228. }
  17229. lodash.prototype[methodName] = function() {
  17230. var value = this.__wrapped__,
  17231. args = isTaker ? [1] : arguments,
  17232. isLazy = value instanceof LazyWrapper,
  17233. iteratee = args[0],
  17234. useLazy = isLazy || isArray(value);
  17235. var interceptor = function(value) {
  17236. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17237. return (isTaker && chainAll) ? result[0] : result;
  17238. };
  17239. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17240. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17241. isLazy = useLazy = false;
  17242. }
  17243. var chainAll = this.__chain__,
  17244. isHybrid = !!this.__actions__.length,
  17245. isUnwrapped = retUnwrapped && !chainAll,
  17246. onlyLazy = isLazy && !isHybrid;
  17247. if (!retUnwrapped && useLazy) {
  17248. value = onlyLazy ? value : new LazyWrapper(this);
  17249. var result = func.apply(value, args);
  17250. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17251. return new LodashWrapper(result, chainAll);
  17252. }
  17253. if (isUnwrapped && onlyLazy) {
  17254. return func.apply(this, args);
  17255. }
  17256. result = this.thru(interceptor);
  17257. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17258. };
  17259. });
  17260. // Add `Array` methods to `lodash.prototype`.
  17261. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17262. var func = arrayProto[methodName],
  17263. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17264. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17265. lodash.prototype[methodName] = function() {
  17266. var args = arguments;
  17267. if (retUnwrapped && !this.__chain__) {
  17268. var value = this.value();
  17269. return func.apply(isArray(value) ? value : [], args);
  17270. }
  17271. return this[chainName](function(value) {
  17272. return func.apply(isArray(value) ? value : [], args);
  17273. });
  17274. };
  17275. });
  17276. // Map minified method names to their real names.
  17277. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17278. var lodashFunc = lodash[methodName];
  17279. if (lodashFunc) {
  17280. var key = lodashFunc.name + '';
  17281. if (!hasOwnProperty.call(realNames, key)) {
  17282. realNames[key] = [];
  17283. }
  17284. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17285. }
  17286. });
  17287. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17288. 'name': 'wrapper',
  17289. 'func': undefined
  17290. }];
  17291. // Add methods to `LazyWrapper`.
  17292. LazyWrapper.prototype.clone = lazyClone;
  17293. LazyWrapper.prototype.reverse = lazyReverse;
  17294. LazyWrapper.prototype.value = lazyValue;
  17295. // Add chain sequence methods to the `lodash` wrapper.
  17296. lodash.prototype.at = wrapperAt;
  17297. lodash.prototype.chain = wrapperChain;
  17298. lodash.prototype.commit = wrapperCommit;
  17299. lodash.prototype.next = wrapperNext;
  17300. lodash.prototype.plant = wrapperPlant;
  17301. lodash.prototype.reverse = wrapperReverse;
  17302. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17303. // Add lazy aliases.
  17304. lodash.prototype.first = lodash.prototype.head;
  17305. if (symIterator) {
  17306. lodash.prototype[symIterator] = wrapperToIterator;
  17307. }
  17308. return lodash;
  17309. });
  17310. /*--------------------------------------------------------------------------*/
  17311. // Export lodash.
  17312. var _ = runInContext();
  17313. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17314. if (true) {
  17315. // Expose Lodash on the global object to prevent errors when Lodash is
  17316. // loaded by a script tag in the presence of an AMD loader.
  17317. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17318. // Use `_.noConflict` to remove Lodash from the global object.
  17319. root._ = _;
  17320. // Define as an anonymous module so, through path mapping, it can be
  17321. // referenced as the "underscore" module.
  17322. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17323. return _;
  17324. }).call(exports, __webpack_require__, exports, module),
  17325. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17326. }
  17327. // Check for `exports` after `define` in case a build optimizer adds it.
  17328. else {}
  17329. }.call(this));
  17330. /***/ }),
  17331. /***/ "./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":
  17332. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17333. !*** ./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 ***!
  17334. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17335. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17336. "use strict";
  17337. __webpack_require__.r(__webpack_exports__);
  17338. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17339. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17340. /* harmony export */ });
  17341. /* 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");
  17342. /* 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__);
  17343. /* 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");
  17344. var options = {};
  17345. options.insert = "head";
  17346. options.singleton = false;
  17347. 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);
  17348. /* 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 || {});
  17349. /***/ }),
  17350. /***/ "./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":
  17351. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17352. !*** ./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 ***!
  17353. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17354. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17355. "use strict";
  17356. __webpack_require__.r(__webpack_exports__);
  17357. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17358. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17359. /* harmony export */ });
  17360. /* 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");
  17361. /* 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__);
  17362. /* 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");
  17363. var options = {};
  17364. options.insert = "head";
  17365. options.singleton = false;
  17366. 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);
  17367. /* 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 || {});
  17368. /***/ }),
  17369. /***/ "./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":
  17370. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17371. !*** ./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 ***!
  17372. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17373. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17374. "use strict";
  17375. __webpack_require__.r(__webpack_exports__);
  17376. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17377. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17378. /* harmony export */ });
  17379. /* 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");
  17380. /* 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__);
  17381. /* 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");
  17382. var options = {};
  17383. options.insert = "head";
  17384. options.singleton = false;
  17385. 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);
  17386. /* 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 || {});
  17387. /***/ }),
  17388. /***/ "./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":
  17389. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17390. !*** ./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 ***!
  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 _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");
  17399. /* 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__);
  17400. /* 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");
  17401. var options = {};
  17402. options.insert = "head";
  17403. options.singleton = false;
  17404. 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);
  17405. /* 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 || {});
  17406. /***/ }),
  17407. /***/ "./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":
  17408. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17409. !*** ./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 ***!
  17410. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17411. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17412. "use strict";
  17413. __webpack_require__.r(__webpack_exports__);
  17414. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17415. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17416. /* harmony export */ });
  17417. /* 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");
  17418. /* 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__);
  17419. /* 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");
  17420. var options = {};
  17421. options.insert = "head";
  17422. options.singleton = false;
  17423. 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);
  17424. /* 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 || {});
  17425. /***/ }),
  17426. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17427. /*!******************************************************!*\
  17428. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17429. \******************************************************/
  17430. /***/ ((__unused_webpack_module, exports) => {
  17431. "use strict";
  17432. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17433. // runtime helper for setting properties on components
  17434. // in a tree-shakable way
  17435. exports["default"] = (sfc, props) => {
  17436. const target = sfc.__vccOpts || sfc;
  17437. for (const [key, val] of props) {
  17438. target[key] = val;
  17439. }
  17440. return target;
  17441. };
  17442. /***/ }),
  17443. /***/ "./resources/js/components/AppButtonLink.vue":
  17444. /*!***************************************************!*\
  17445. !*** ./resources/js/components/AppButtonLink.vue ***!
  17446. \***************************************************/
  17447. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17448. "use strict";
  17449. __webpack_require__.r(__webpack_exports__);
  17450. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17451. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17452. /* harmony export */ });
  17453. /* harmony import */ var _AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17454. /* harmony import */ var _AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17455. /* 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");
  17456. ;
  17457. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17458. /* hot reload */
  17459. if (false) {}
  17460. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17461. /***/ }),
  17462. /***/ "./resources/js/components/AppFooter.vue":
  17463. /*!***********************************************!*\
  17464. !*** ./resources/js/components/AppFooter.vue ***!
  17465. \***********************************************/
  17466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17467. "use strict";
  17468. __webpack_require__.r(__webpack_exports__);
  17469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17470. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17471. /* harmony export */ });
  17472. /* 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");
  17473. /* 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");
  17474. /* 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");
  17475. const script = {}
  17476. ;
  17477. 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"]])
  17478. /* hot reload */
  17479. if (false) {}
  17480. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17481. /***/ }),
  17482. /***/ "./resources/js/components/AppMessage.vue":
  17483. /*!************************************************!*\
  17484. !*** ./resources/js/components/AppMessage.vue ***!
  17485. \************************************************/
  17486. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17487. "use strict";
  17488. __webpack_require__.r(__webpack_exports__);
  17489. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17490. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17491. /* harmony export */ });
  17492. /* 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");
  17493. /* 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");
  17494. /* 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");
  17495. ;
  17496. 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"]])
  17497. /* hot reload */
  17498. if (false) {}
  17499. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17500. /***/ }),
  17501. /***/ "./resources/js/components/AppPagination.vue":
  17502. /*!***************************************************!*\
  17503. !*** ./resources/js/components/AppPagination.vue ***!
  17504. \***************************************************/
  17505. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17506. "use strict";
  17507. __webpack_require__.r(__webpack_exports__);
  17508. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17509. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17510. /* harmony export */ });
  17511. /* harmony import */ var _AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17512. /* harmony import */ var _AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17513. /* 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");
  17514. ;
  17515. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17516. /* hot reload */
  17517. if (false) {}
  17518. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17519. /***/ }),
  17520. /***/ "./resources/js/components/AppSidebar.vue":
  17521. /*!************************************************!*\
  17522. !*** ./resources/js/components/AppSidebar.vue ***!
  17523. \************************************************/
  17524. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17525. "use strict";
  17526. __webpack_require__.r(__webpack_exports__);
  17527. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17528. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17529. /* harmony export */ });
  17530. /* 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");
  17531. /* 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");
  17532. /* 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");
  17533. /* 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");
  17534. ;
  17535. 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"]])
  17536. /* hot reload */
  17537. if (false) {}
  17538. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17539. /***/ }),
  17540. /***/ "./resources/js/components/AppSubSidebar.vue":
  17541. /*!***************************************************!*\
  17542. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17543. \***************************************************/
  17544. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17545. "use strict";
  17546. __webpack_require__.r(__webpack_exports__);
  17547. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17548. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17549. /* harmony export */ });
  17550. /* 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");
  17551. /* 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");
  17552. /* 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");
  17553. /* 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");
  17554. ;
  17555. 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"]])
  17556. /* hot reload */
  17557. if (false) {}
  17558. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17559. /***/ }),
  17560. /***/ "./resources/js/components/AppTopBar.vue":
  17561. /*!***********************************************!*\
  17562. !*** ./resources/js/components/AppTopBar.vue ***!
  17563. \***********************************************/
  17564. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17565. "use strict";
  17566. __webpack_require__.r(__webpack_exports__);
  17567. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17568. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17569. /* harmony export */ });
  17570. /* 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");
  17571. /* 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");
  17572. /* 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");
  17573. /* 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");
  17574. ;
  17575. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_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"]])
  17576. /* hot reload */
  17577. if (false) {}
  17578. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17579. /***/ }),
  17580. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17581. /*!**************************************************!*\
  17582. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17583. \**************************************************/
  17584. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17585. "use strict";
  17586. __webpack_require__.r(__webpack_exports__);
  17587. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17588. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17589. /* harmony export */ });
  17590. /* harmony import */ var _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");
  17591. /* 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");
  17592. /* 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");
  17593. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17594. ;
  17595. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_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"]])
  17596. /* hot reload */
  17597. if (false) {}
  17598. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17599. /***/ }),
  17600. /***/ "./resources/js/pages/user/Index.vue":
  17601. /*!*******************************************!*\
  17602. !*** ./resources/js/pages/user/Index.vue ***!
  17603. \*******************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17608. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17609. /* harmony export */ });
  17610. /* harmony import */ var _Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=3aca4497 */ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497");
  17611. /* 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/user/Index.vue?vue&type=script&setup=true&lang=js");
  17612. /* 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");
  17613. ;
  17614. 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_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/user/Index.vue"]])
  17615. /* hot reload */
  17616. if (false) {}
  17617. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17618. /***/ }),
  17619. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17620. /*!**************************************************************************************!*\
  17621. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17622. \**************************************************************************************/
  17623. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17624. "use strict";
  17625. __webpack_require__.r(__webpack_exports__);
  17626. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17627. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17628. /* harmony export */ });
  17629. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17630. /***/ }),
  17631. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17632. /*!***********************************************************************************!*\
  17633. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17634. \***********************************************************************************/
  17635. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17636. "use strict";
  17637. __webpack_require__.r(__webpack_exports__);
  17638. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17639. /* 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"])
  17640. /* harmony export */ });
  17641. /* 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");
  17642. /***/ }),
  17643. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17644. /*!**************************************************************************************!*\
  17645. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17646. \**************************************************************************************/
  17647. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17648. "use strict";
  17649. __webpack_require__.r(__webpack_exports__);
  17650. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17651. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17652. /* harmony export */ });
  17653. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17654. /***/ }),
  17655. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17656. /*!***********************************************************************************!*\
  17657. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17658. \***********************************************************************************/
  17659. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17660. "use strict";
  17661. __webpack_require__.r(__webpack_exports__);
  17662. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17663. /* 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"])
  17664. /* harmony export */ });
  17665. /* 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");
  17666. /***/ }),
  17667. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17668. /*!**************************************************************************************!*\
  17669. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17670. \**************************************************************************************/
  17671. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17672. "use strict";
  17673. __webpack_require__.r(__webpack_exports__);
  17674. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17675. /* 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"])
  17676. /* harmony export */ });
  17677. /* 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");
  17678. /***/ }),
  17679. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17680. /*!**********************************************************************************!*\
  17681. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17682. \**********************************************************************************/
  17683. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17684. "use strict";
  17685. __webpack_require__.r(__webpack_exports__);
  17686. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17687. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17688. /* harmony export */ });
  17689. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17690. /***/ }),
  17691. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17692. /*!*************************************************************************************!*\
  17693. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17694. \*************************************************************************************/
  17695. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17696. "use strict";
  17697. __webpack_require__.r(__webpack_exports__);
  17698. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17699. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17700. /* harmony export */ });
  17701. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17702. /***/ }),
  17703. /***/ "./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  17704. /*!******************************************************************************!*\
  17705. !*** ./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  17706. \******************************************************************************/
  17707. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17708. "use strict";
  17709. __webpack_require__.r(__webpack_exports__);
  17710. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17711. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17712. /* harmony export */ });
  17713. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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/user/Index.vue?vue&type=script&setup=true&lang=js");
  17714. /***/ }),
  17715. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17716. /*!*********************************************************************************!*\
  17717. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17718. \*********************************************************************************/
  17719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17720. "use strict";
  17721. __webpack_require__.r(__webpack_exports__);
  17722. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17723. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17724. /* harmony export */ });
  17725. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17726. /***/ }),
  17727. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17728. /*!*****************************************************************************************!*\
  17729. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17730. \*****************************************************************************************/
  17731. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17732. "use strict";
  17733. __webpack_require__.r(__webpack_exports__);
  17734. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17735. /* harmony export */ "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)
  17736. /* harmony export */ });
  17737. /* 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");
  17738. /***/ }),
  17739. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17740. /*!******************************************************************************!*\
  17741. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17742. \******************************************************************************/
  17743. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17744. "use strict";
  17745. __webpack_require__.r(__webpack_exports__);
  17746. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17747. /* harmony export */ "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)
  17748. /* harmony export */ });
  17749. /* 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");
  17750. /***/ }),
  17751. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17752. /*!*********************************************************************************!*\
  17753. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17754. \*********************************************************************************/
  17755. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17756. "use strict";
  17757. __webpack_require__.r(__webpack_exports__);
  17758. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17759. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17760. /* harmony export */ });
  17761. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17762. /***/ }),
  17763. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17764. /*!******************************************************************************************!*\
  17765. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17766. \******************************************************************************************/
  17767. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17768. "use strict";
  17769. __webpack_require__.r(__webpack_exports__);
  17770. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17771. /* harmony export */ "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)
  17772. /* harmony export */ });
  17773. /* 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");
  17774. /***/ }),
  17775. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17776. /*!*********************************************************************************************!*\
  17777. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17778. \*********************************************************************************************/
  17779. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17780. "use strict";
  17781. __webpack_require__.r(__webpack_exports__);
  17782. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17783. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17784. /* harmony export */ });
  17785. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17786. /***/ }),
  17787. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17788. /*!*****************************************************************************************!*\
  17789. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17790. \*****************************************************************************************/
  17791. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17792. "use strict";
  17793. __webpack_require__.r(__webpack_exports__);
  17794. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17795. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17796. /* harmony export */ });
  17797. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17798. /***/ }),
  17799. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17800. /*!********************************************************************************************!*\
  17801. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17802. \********************************************************************************************/
  17803. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17804. "use strict";
  17805. __webpack_require__.r(__webpack_exports__);
  17806. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17807. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17808. /* harmony export */ });
  17809. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17810. /***/ }),
  17811. /***/ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  17812. /*!*************************************************************************!*\
  17813. !*** ./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  17814. \*************************************************************************/
  17815. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17816. "use strict";
  17817. __webpack_require__.r(__webpack_exports__);
  17818. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17819. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3aca4497__WEBPACK_IMPORTED_MODULE_0__.render)
  17820. /* harmony export */ });
  17821. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_3aca4497__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=3aca4497 */ "./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/user/Index.vue?vue&type=template&id=3aca4497");
  17822. /***/ }),
  17823. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17824. /*!********************************************************************************************************!*\
  17825. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17826. \********************************************************************************************************/
  17827. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17828. "use strict";
  17829. __webpack_require__.r(__webpack_exports__);
  17830. /* 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");
  17831. /***/ }),
  17832. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17833. /*!*********************************************************************************************************!*\
  17834. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17835. \*********************************************************************************************************/
  17836. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17837. "use strict";
  17838. __webpack_require__.r(__webpack_exports__);
  17839. /* 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");
  17840. /***/ }),
  17841. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17842. /*!************************************************************************************************************!*\
  17843. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17844. \************************************************************************************************************/
  17845. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17846. "use strict";
  17847. __webpack_require__.r(__webpack_exports__);
  17848. /* 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");
  17849. /***/ }),
  17850. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17851. /*!********************************************************************************************************!*\
  17852. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17853. \********************************************************************************************************/
  17854. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17855. "use strict";
  17856. __webpack_require__.r(__webpack_exports__);
  17857. /* 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");
  17858. /***/ }),
  17859. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17860. /*!***********************************************************************************************************!*\
  17861. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17862. \***********************************************************************************************************/
  17863. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17864. "use strict";
  17865. __webpack_require__.r(__webpack_exports__);
  17866. /* 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");
  17867. /***/ })
  17868. }]);