resources_js_pages_user_Index_vue.js 693KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313
  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, "Profil Saya", -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, "Sign Out", -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. 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"], {
  710. href: "/",
  711. "class": "layout-topbar-logo"
  712. }, {
  713. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  714. return [_hoisted_2, _hoisted_3];
  715. }),
  716. _: 1
  717. /* STABLE */
  718. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  719. "class": "p-link layout-menu-button layout-topbar-button",
  720. onClick: _cache[0] || (_cache[0] = function ($event) {
  721. return _ctx.$emit('menu-toggle', $event);
  722. })
  723. }, _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, {
  724. selector: '@next',
  725. enterClass: 'hidden',
  726. enterActiveClass: 'scalein',
  727. leaveToClass: 'hidden',
  728. leaveActiveClass: 'fadeout',
  729. hideOnOutsideClick: true
  730. }]]), (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
  731. /* TEXT */
  732. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  733. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  734. "class": "p-link layout-topbar-button"
  735. }, {
  736. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  737. return [_hoisted_12, _hoisted_13];
  738. }),
  739. _: 1
  740. /* STABLE */
  741. }, 8
  742. /* PROPS */
  743. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  744. href: _ctx.route('logout'),
  745. as: "button",
  746. method: "post",
  747. "class": "p-link layout-topbar-button"
  748. }, {
  749. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  750. return [_hoisted_14, _hoisted_15];
  751. }),
  752. _: 1
  753. /* STABLE */
  754. }, 8
  755. /* PROPS */
  756. , ["href"])])])]);
  757. }
  758. /***/ }),
  759. /***/ "./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":
  760. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  761. !*** ./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 ***!
  762. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  763. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  764. "use strict";
  765. __webpack_require__.r(__webpack_exports__);
  766. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  767. /* harmony export */ "render": () => (/* binding */ render)
  768. /* harmony export */ });
  769. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  770. var _withScopeId = function _withScopeId(n) {
  771. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  772. };
  773. var _hoisted_1 = {
  774. "class": "layout-sidebar"
  775. };
  776. var _hoisted_2 = {
  777. "class": "layout-main-container"
  778. };
  779. var _hoisted_3 = {
  780. "class": "layout-main"
  781. };
  782. var _hoisted_4 = {
  783. key: 0,
  784. "class": "layout-mask p-component-overlay"
  785. };
  786. function render(_ctx, _cache, $props, $setup, $data, $options) {
  787. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  788. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  789. onClick: $setup.onWrapperClick
  790. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  791. onMenuToggle: $setup.onMenuToggle
  792. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  793. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  794. }, null, 8
  795. /* PROPS */
  796. , ["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, {
  797. name: "layout-mask"
  798. }, {
  799. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  800. 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)];
  801. }),
  802. _: 1
  803. /* STABLE */
  804. })], 2
  805. /* CLASS */
  806. );
  807. }
  808. /***/ }),
  809. /***/ "./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":
  810. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  811. !*** ./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 ***!
  812. \***************************************************************************************************************************************************************************************************************************************************************************/
  813. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  814. "use strict";
  815. __webpack_require__.r(__webpack_exports__);
  816. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  817. /* harmony export */ "render": () => (/* binding */ render)
  818. /* harmony export */ });
  819. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  820. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  821. /* HOISTED */
  822. );
  823. var _hoisted_2 = {
  824. "class": "grid"
  825. };
  826. var _hoisted_3 = {
  827. "class": "col-12 md:col-8"
  828. };
  829. var _hoisted_4 = {
  830. "class": "flex align-items-center"
  831. };
  832. var _hoisted_5 = {
  833. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  834. };
  835. function render(_ctx, _cache, $props, $setup, $data, $options) {
  836. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  837. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  838. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  839. 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"], {
  840. title: "Daftar User"
  841. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  842. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  843. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  844. responsiveLayout: "scroll",
  845. columnResizeMode: "expand",
  846. value: $props.users.data,
  847. rowHover: true,
  848. stripedRows: true
  849. }, {
  850. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  851. 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, {
  852. "class": "w-full md:w-27rem",
  853. placeholder: "cari, contoh: tina, tina@xx.com",
  854. modelValue: $setup.search,
  855. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  856. return $setup.search = $event;
  857. })
  858. }, null, 8
  859. /* PROPS */
  860. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  861. label: "Tambah User",
  862. icon: "pi pi-pencil",
  863. "class": "p-button-outlined",
  864. href: _ctx.route('users.create')
  865. }, null, 8
  866. /* PROPS */
  867. , ["href"])])])];
  868. }),
  869. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. 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) {
  871. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  872. field: value.field,
  873. header: value.header,
  874. key: value.field
  875. }, null, 8
  876. /* PROPS */
  877. , ["field", "header"]);
  878. }), 128
  879. /* KEYED_FRAGMENT */
  880. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  881. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  882. var data = _ref.data;
  883. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  884. icon: "pi pi-pencil",
  885. "class": "p-button-icon-only p-button-rounded p-button-text",
  886. href: _ctx.route('users.edit', data.id)
  887. }, null, 8
  888. /* PROPS */
  889. , ["href"])];
  890. }),
  891. _: 1
  892. /* STABLE */
  893. })];
  894. }),
  895. _: 1
  896. /* STABLE */
  897. }, 8
  898. /* PROPS */
  899. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  900. links: $props.users.links
  901. }, null, 8
  902. /* PROPS */
  903. , ["links"])];
  904. }),
  905. _: 1
  906. /* STABLE */
  907. })], 64
  908. /* STABLE_FRAGMENT */
  909. );
  910. }
  911. /***/ }),
  912. /***/ "./resources/js/components/useSearchText.js":
  913. /*!**************************************************!*\
  914. !*** ./resources/js/components/useSearchText.js ***!
  915. \**************************************************/
  916. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  917. "use strict";
  918. __webpack_require__.r(__webpack_exports__);
  919. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  920. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  921. /* harmony export */ });
  922. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  923. function useSearchText(props) {
  924. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  925. return {
  926. search: search
  927. };
  928. }
  929. /***/ }),
  930. /***/ "./resources/js/pages/user/tableHeader.js":
  931. /*!************************************************!*\
  932. !*** ./resources/js/pages/user/tableHeader.js ***!
  933. \************************************************/
  934. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  935. "use strict";
  936. __webpack_require__.r(__webpack_exports__);
  937. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  938. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  939. /* harmony export */ });
  940. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  941. field: 'name',
  942. header: 'Nama'
  943. }, {
  944. field: 'email',
  945. header: 'Email'
  946. }, {
  947. field: 'role',
  948. header: 'Hak Akses'
  949. }, {
  950. field: 'status',
  951. header: 'Status'
  952. }]);
  953. /***/ }),
  954. /***/ "./resources/js/utils/menu.js":
  955. /*!************************************!*\
  956. !*** ./resources/js/utils/menu.js ***!
  957. \************************************/
  958. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  959. "use strict";
  960. __webpack_require__.r(__webpack_exports__);
  961. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  962. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  963. /* harmony export */ });
  964. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  965. // Admin
  966. 1: [{
  967. label: 'Home',
  968. items: [{
  969. label: 'Dashboard',
  970. icon: 'pi pi-home',
  971. to: '/dashboards',
  972. component: 'home/Index'
  973. }]
  974. }, {
  975. label: 'Master',
  976. items: [{
  977. label: 'User',
  978. icon: 'pi pi-user',
  979. to: '/users',
  980. component: 'user/Index'
  981. }]
  982. }],
  983. // Supervisor
  984. 2: [{
  985. label: 'Home',
  986. items: [{
  987. label: 'Dashboard',
  988. icon: 'pi pi-home',
  989. to: '/dashboards',
  990. component: 'home/Index'
  991. }]
  992. }, {
  993. label: 'Menu',
  994. items: [{
  995. label: 'Pengeluaran',
  996. icon: 'pi pi-wallet',
  997. to: '/expenses',
  998. component: 'expense/Index'
  999. }, {
  1000. label: 'Laporan',
  1001. icon: 'pi pi-book',
  1002. items: [{
  1003. label: 'Mutasi',
  1004. icon: 'pi pi-circle',
  1005. to: '/reports/mutations',
  1006. component: 'mutation/Report'
  1007. }]
  1008. }]
  1009. }, {
  1010. label: 'Master',
  1011. items: [{
  1012. label: 'Jenis Kendaraan',
  1013. icon: 'pi pi-car',
  1014. to: '/type-vehicles',
  1015. component: 'typevehicle/Index'
  1016. }, {
  1017. label: 'Jenis Member',
  1018. icon: 'pi pi-id-card',
  1019. to: '/type-members',
  1020. component: 'typemember/Index'
  1021. }]
  1022. }, {
  1023. label: 'Pengaturan',
  1024. items: [{
  1025. label: 'Tarif Parkir',
  1026. icon: 'pi pi-car',
  1027. to: '/parking-fees/create',
  1028. component: 'parkingfee/Create'
  1029. }]
  1030. }],
  1031. // Operator
  1032. 3: [{
  1033. label: 'Home',
  1034. items: [{
  1035. label: 'Dashboard',
  1036. icon: 'pi pi-home',
  1037. to: '/dashboards',
  1038. component: 'home/Index'
  1039. }]
  1040. }, {
  1041. label: 'Menu',
  1042. items: [{
  1043. label: 'Pengeluaran',
  1044. icon: 'pi pi-wallet',
  1045. to: '/expenses',
  1046. component: 'expense/Index'
  1047. }, {
  1048. label: 'Member',
  1049. icon: 'pi pi-id-card',
  1050. to: '/members',
  1051. component: 'member/Index'
  1052. }, {
  1053. label: 'Top Up',
  1054. icon: 'pi pi-car',
  1055. to: '/top-ups',
  1056. component: 'topup/Index'
  1057. }]
  1058. }]
  1059. });
  1060. /***/ }),
  1061. /***/ "./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":
  1062. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1063. !*** ./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 ***!
  1064. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1065. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1066. "use strict";
  1067. __webpack_require__.r(__webpack_exports__);
  1068. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1069. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1070. /* harmony export */ });
  1071. /* 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");
  1072. /* 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__);
  1073. // Imports
  1074. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1075. // Module
  1076. ___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}", ""]);
  1077. // Exports
  1078. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1079. /***/ }),
  1080. /***/ "./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":
  1081. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1082. !*** ./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 ***!
  1083. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1084. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1085. "use strict";
  1086. __webpack_require__.r(__webpack_exports__);
  1087. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1088. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1089. /* harmony export */ });
  1090. /* 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");
  1091. /* 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__);
  1092. // Imports
  1093. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1094. // Module
  1095. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1096. // Exports
  1097. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1098. /***/ }),
  1099. /***/ "./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":
  1100. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1101. !*** ./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 ***!
  1102. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1103. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1104. "use strict";
  1105. __webpack_require__.r(__webpack_exports__);
  1106. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1107. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1108. /* harmony export */ });
  1109. /* 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");
  1110. /* 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__);
  1111. // Imports
  1112. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1113. // Module
  1114. ___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}", ""]);
  1115. // Exports
  1116. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1117. /***/ }),
  1118. /***/ "./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":
  1119. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1120. !*** ./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 ***!
  1121. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1122. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1123. "use strict";
  1124. __webpack_require__.r(__webpack_exports__);
  1125. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1126. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1127. /* harmony export */ });
  1128. /* 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");
  1129. /* 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__);
  1130. // Imports
  1131. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1132. // Module
  1133. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 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}", ""]);
  1134. // Exports
  1135. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1136. /***/ }),
  1137. /***/ "./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":
  1138. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1139. !*** ./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 ***!
  1140. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1141. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1142. "use strict";
  1143. __webpack_require__.r(__webpack_exports__);
  1144. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1145. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1146. /* harmony export */ });
  1147. /* 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");
  1148. /* 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__);
  1149. // Imports
  1150. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1151. // Module
  1152. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1153. // Exports
  1154. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1155. /***/ }),
  1156. /***/ "./node_modules/lodash/lodash.js":
  1157. /*!***************************************!*\
  1158. !*** ./node_modules/lodash/lodash.js ***!
  1159. \***************************************/
  1160. /***/ (function(module, exports, __webpack_require__) {
  1161. /* module decorator */ module = __webpack_require__.nmd(module);
  1162. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1163. * @license
  1164. * Lodash <https://lodash.com/>
  1165. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1166. * Released under MIT license <https://lodash.com/license>
  1167. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1168. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1169. */
  1170. ;(function() {
  1171. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1172. var undefined;
  1173. /** Used as the semantic version number. */
  1174. var VERSION = '4.17.21';
  1175. /** Used as the size to enable large array optimizations. */
  1176. var LARGE_ARRAY_SIZE = 200;
  1177. /** Error message constants. */
  1178. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1179. FUNC_ERROR_TEXT = 'Expected a function',
  1180. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1181. /** Used to stand-in for `undefined` hash values. */
  1182. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1183. /** Used as the maximum memoize cache size. */
  1184. var MAX_MEMOIZE_SIZE = 500;
  1185. /** Used as the internal argument placeholder. */
  1186. var PLACEHOLDER = '__lodash_placeholder__';
  1187. /** Used to compose bitmasks for cloning. */
  1188. var CLONE_DEEP_FLAG = 1,
  1189. CLONE_FLAT_FLAG = 2,
  1190. CLONE_SYMBOLS_FLAG = 4;
  1191. /** Used to compose bitmasks for value comparisons. */
  1192. var COMPARE_PARTIAL_FLAG = 1,
  1193. COMPARE_UNORDERED_FLAG = 2;
  1194. /** Used to compose bitmasks for function metadata. */
  1195. var WRAP_BIND_FLAG = 1,
  1196. WRAP_BIND_KEY_FLAG = 2,
  1197. WRAP_CURRY_BOUND_FLAG = 4,
  1198. WRAP_CURRY_FLAG = 8,
  1199. WRAP_CURRY_RIGHT_FLAG = 16,
  1200. WRAP_PARTIAL_FLAG = 32,
  1201. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1202. WRAP_ARY_FLAG = 128,
  1203. WRAP_REARG_FLAG = 256,
  1204. WRAP_FLIP_FLAG = 512;
  1205. /** Used as default options for `_.truncate`. */
  1206. var DEFAULT_TRUNC_LENGTH = 30,
  1207. DEFAULT_TRUNC_OMISSION = '...';
  1208. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1209. var HOT_COUNT = 800,
  1210. HOT_SPAN = 16;
  1211. /** Used to indicate the type of lazy iteratees. */
  1212. var LAZY_FILTER_FLAG = 1,
  1213. LAZY_MAP_FLAG = 2,
  1214. LAZY_WHILE_FLAG = 3;
  1215. /** Used as references for various `Number` constants. */
  1216. var INFINITY = 1 / 0,
  1217. MAX_SAFE_INTEGER = 9007199254740991,
  1218. MAX_INTEGER = 1.7976931348623157e+308,
  1219. NAN = 0 / 0;
  1220. /** Used as references for the maximum length and index of an array. */
  1221. var MAX_ARRAY_LENGTH = 4294967295,
  1222. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1223. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1224. /** Used to associate wrap methods with their bit flags. */
  1225. var wrapFlags = [
  1226. ['ary', WRAP_ARY_FLAG],
  1227. ['bind', WRAP_BIND_FLAG],
  1228. ['bindKey', WRAP_BIND_KEY_FLAG],
  1229. ['curry', WRAP_CURRY_FLAG],
  1230. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1231. ['flip', WRAP_FLIP_FLAG],
  1232. ['partial', WRAP_PARTIAL_FLAG],
  1233. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1234. ['rearg', WRAP_REARG_FLAG]
  1235. ];
  1236. /** `Object#toString` result references. */
  1237. var argsTag = '[object Arguments]',
  1238. arrayTag = '[object Array]',
  1239. asyncTag = '[object AsyncFunction]',
  1240. boolTag = '[object Boolean]',
  1241. dateTag = '[object Date]',
  1242. domExcTag = '[object DOMException]',
  1243. errorTag = '[object Error]',
  1244. funcTag = '[object Function]',
  1245. genTag = '[object GeneratorFunction]',
  1246. mapTag = '[object Map]',
  1247. numberTag = '[object Number]',
  1248. nullTag = '[object Null]',
  1249. objectTag = '[object Object]',
  1250. promiseTag = '[object Promise]',
  1251. proxyTag = '[object Proxy]',
  1252. regexpTag = '[object RegExp]',
  1253. setTag = '[object Set]',
  1254. stringTag = '[object String]',
  1255. symbolTag = '[object Symbol]',
  1256. undefinedTag = '[object Undefined]',
  1257. weakMapTag = '[object WeakMap]',
  1258. weakSetTag = '[object WeakSet]';
  1259. var arrayBufferTag = '[object ArrayBuffer]',
  1260. dataViewTag = '[object DataView]',
  1261. float32Tag = '[object Float32Array]',
  1262. float64Tag = '[object Float64Array]',
  1263. int8Tag = '[object Int8Array]',
  1264. int16Tag = '[object Int16Array]',
  1265. int32Tag = '[object Int32Array]',
  1266. uint8Tag = '[object Uint8Array]',
  1267. uint8ClampedTag = '[object Uint8ClampedArray]',
  1268. uint16Tag = '[object Uint16Array]',
  1269. uint32Tag = '[object Uint32Array]';
  1270. /** Used to match empty string literals in compiled template source. */
  1271. var reEmptyStringLeading = /\b__p \+= '';/g,
  1272. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1273. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1274. /** Used to match HTML entities and HTML characters. */
  1275. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1276. reUnescapedHtml = /[&<>"']/g,
  1277. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1278. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1279. /** Used to match template delimiters. */
  1280. var reEscape = /<%-([\s\S]+?)%>/g,
  1281. reEvaluate = /<%([\s\S]+?)%>/g,
  1282. reInterpolate = /<%=([\s\S]+?)%>/g;
  1283. /** Used to match property names within property paths. */
  1284. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1285. reIsPlainProp = /^\w*$/,
  1286. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1287. /**
  1288. * Used to match `RegExp`
  1289. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1290. */
  1291. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1292. reHasRegExpChar = RegExp(reRegExpChar.source);
  1293. /** Used to match leading whitespace. */
  1294. var reTrimStart = /^\s+/;
  1295. /** Used to match a single whitespace character. */
  1296. var reWhitespace = /\s/;
  1297. /** Used to match wrap detail comments. */
  1298. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1299. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1300. reSplitDetails = /,? & /;
  1301. /** Used to match words composed of alphanumeric characters. */
  1302. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1303. /**
  1304. * Used to validate the `validate` option in `_.template` variable.
  1305. *
  1306. * Forbids characters which could potentially change the meaning of the function argument definition:
  1307. * - "()," (modification of function parameters)
  1308. * - "=" (default value)
  1309. * - "[]{}" (destructuring of function parameters)
  1310. * - "/" (beginning of a comment)
  1311. * - whitespace
  1312. */
  1313. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1314. /** Used to match backslashes in property paths. */
  1315. var reEscapeChar = /\\(\\)?/g;
  1316. /**
  1317. * Used to match
  1318. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1319. */
  1320. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1321. /** Used to match `RegExp` flags from their coerced string values. */
  1322. var reFlags = /\w*$/;
  1323. /** Used to detect bad signed hexadecimal string values. */
  1324. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1325. /** Used to detect binary string values. */
  1326. var reIsBinary = /^0b[01]+$/i;
  1327. /** Used to detect host constructors (Safari). */
  1328. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1329. /** Used to detect octal string values. */
  1330. var reIsOctal = /^0o[0-7]+$/i;
  1331. /** Used to detect unsigned integer values. */
  1332. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1333. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1334. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1335. /** Used to ensure capturing order of template delimiters. */
  1336. var reNoMatch = /($^)/;
  1337. /** Used to match unescaped characters in compiled string literals. */
  1338. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1339. /** Used to compose unicode character classes. */
  1340. var rsAstralRange = '\\ud800-\\udfff',
  1341. rsComboMarksRange = '\\u0300-\\u036f',
  1342. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1343. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1344. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1345. rsDingbatRange = '\\u2700-\\u27bf',
  1346. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1347. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1348. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1349. rsPunctuationRange = '\\u2000-\\u206f',
  1350. 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',
  1351. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1352. rsVarRange = '\\ufe0e\\ufe0f',
  1353. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1354. /** Used to compose unicode capture groups. */
  1355. var rsApos = "['\u2019]",
  1356. rsAstral = '[' + rsAstralRange + ']',
  1357. rsBreak = '[' + rsBreakRange + ']',
  1358. rsCombo = '[' + rsComboRange + ']',
  1359. rsDigits = '\\d+',
  1360. rsDingbat = '[' + rsDingbatRange + ']',
  1361. rsLower = '[' + rsLowerRange + ']',
  1362. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1363. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1364. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1365. rsNonAstral = '[^' + rsAstralRange + ']',
  1366. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1367. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1368. rsUpper = '[' + rsUpperRange + ']',
  1369. rsZWJ = '\\u200d';
  1370. /** Used to compose unicode regexes. */
  1371. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1372. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1373. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1374. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1375. reOptMod = rsModifier + '?',
  1376. rsOptVar = '[' + rsVarRange + ']?',
  1377. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1378. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1379. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1380. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1381. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1382. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1383. /** Used to match apostrophes. */
  1384. var reApos = RegExp(rsApos, 'g');
  1385. /**
  1386. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1387. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1388. */
  1389. var reComboMark = RegExp(rsCombo, 'g');
  1390. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1391. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1392. /** Used to match complex or compound words. */
  1393. var reUnicodeWord = RegExp([
  1394. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1395. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1396. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1397. rsUpper + '+' + rsOptContrUpper,
  1398. rsOrdUpper,
  1399. rsOrdLower,
  1400. rsDigits,
  1401. rsEmoji
  1402. ].join('|'), 'g');
  1403. /** 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/). */
  1404. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1405. /** Used to detect strings that need a more robust regexp to match words. */
  1406. 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 ]/;
  1407. /** Used to assign default `context` object properties. */
  1408. var contextProps = [
  1409. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1410. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1411. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1412. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1413. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1414. ];
  1415. /** Used to make template sourceURLs easier to identify. */
  1416. var templateCounter = -1;
  1417. /** Used to identify `toStringTag` values of typed arrays. */
  1418. var typedArrayTags = {};
  1419. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1420. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1421. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1422. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1423. typedArrayTags[uint32Tag] = true;
  1424. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1425. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1426. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1427. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1428. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1429. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1430. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1431. typedArrayTags[weakMapTag] = false;
  1432. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1433. var cloneableTags = {};
  1434. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1435. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1436. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1437. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1438. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1439. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1440. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1441. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1442. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1443. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1444. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1445. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1446. cloneableTags[weakMapTag] = false;
  1447. /** Used to map Latin Unicode letters to basic Latin letters. */
  1448. var deburredLetters = {
  1449. // Latin-1 Supplement block.
  1450. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1451. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1452. '\xc7': 'C', '\xe7': 'c',
  1453. '\xd0': 'D', '\xf0': 'd',
  1454. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1455. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1456. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1457. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1458. '\xd1': 'N', '\xf1': 'n',
  1459. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1460. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1461. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1462. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1463. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1464. '\xc6': 'Ae', '\xe6': 'ae',
  1465. '\xde': 'Th', '\xfe': 'th',
  1466. '\xdf': 'ss',
  1467. // Latin Extended-A block.
  1468. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1469. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1470. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1471. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1472. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1473. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1474. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1475. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1476. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1477. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1478. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1479. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1480. '\u0134': 'J', '\u0135': 'j',
  1481. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1482. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1483. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1484. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1485. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1486. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1487. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1488. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1489. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1490. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1491. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1492. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1493. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1494. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1495. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1496. '\u0174': 'W', '\u0175': 'w',
  1497. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1498. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1499. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1500. '\u0132': 'IJ', '\u0133': 'ij',
  1501. '\u0152': 'Oe', '\u0153': 'oe',
  1502. '\u0149': "'n", '\u017f': 's'
  1503. };
  1504. /** Used to map characters to HTML entities. */
  1505. var htmlEscapes = {
  1506. '&': '&amp;',
  1507. '<': '&lt;',
  1508. '>': '&gt;',
  1509. '"': '&quot;',
  1510. "'": '&#39;'
  1511. };
  1512. /** Used to map HTML entities to characters. */
  1513. var htmlUnescapes = {
  1514. '&amp;': '&',
  1515. '&lt;': '<',
  1516. '&gt;': '>',
  1517. '&quot;': '"',
  1518. '&#39;': "'"
  1519. };
  1520. /** Used to escape characters for inclusion in compiled string literals. */
  1521. var stringEscapes = {
  1522. '\\': '\\',
  1523. "'": "'",
  1524. '\n': 'n',
  1525. '\r': 'r',
  1526. '\u2028': 'u2028',
  1527. '\u2029': 'u2029'
  1528. };
  1529. /** Built-in method references without a dependency on `root`. */
  1530. var freeParseFloat = parseFloat,
  1531. freeParseInt = parseInt;
  1532. /** Detect free variable `global` from Node.js. */
  1533. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1534. /** Detect free variable `self`. */
  1535. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1536. /** Used as a reference to the global object. */
  1537. var root = freeGlobal || freeSelf || Function('return this')();
  1538. /** Detect free variable `exports`. */
  1539. var freeExports = true && exports && !exports.nodeType && exports;
  1540. /** Detect free variable `module`. */
  1541. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1542. /** Detect the popular CommonJS extension `module.exports`. */
  1543. var moduleExports = freeModule && freeModule.exports === freeExports;
  1544. /** Detect free variable `process` from Node.js. */
  1545. var freeProcess = moduleExports && freeGlobal.process;
  1546. /** Used to access faster Node.js helpers. */
  1547. var nodeUtil = (function() {
  1548. try {
  1549. // Use `util.types` for Node.js 10+.
  1550. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1551. if (types) {
  1552. return types;
  1553. }
  1554. // Legacy `process.binding('util')` for Node.js < 10.
  1555. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1556. } catch (e) {}
  1557. }());
  1558. /* Node.js helper references. */
  1559. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1560. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1561. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1562. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1563. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1564. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1565. /*--------------------------------------------------------------------------*/
  1566. /**
  1567. * A faster alternative to `Function#apply`, this function invokes `func`
  1568. * with the `this` binding of `thisArg` and the arguments of `args`.
  1569. *
  1570. * @private
  1571. * @param {Function} func The function to invoke.
  1572. * @param {*} thisArg The `this` binding of `func`.
  1573. * @param {Array} args The arguments to invoke `func` with.
  1574. * @returns {*} Returns the result of `func`.
  1575. */
  1576. function apply(func, thisArg, args) {
  1577. switch (args.length) {
  1578. case 0: return func.call(thisArg);
  1579. case 1: return func.call(thisArg, args[0]);
  1580. case 2: return func.call(thisArg, args[0], args[1]);
  1581. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1582. }
  1583. return func.apply(thisArg, args);
  1584. }
  1585. /**
  1586. * A specialized version of `baseAggregator` for arrays.
  1587. *
  1588. * @private
  1589. * @param {Array} [array] The array to iterate over.
  1590. * @param {Function} setter The function to set `accumulator` values.
  1591. * @param {Function} iteratee The iteratee to transform keys.
  1592. * @param {Object} accumulator The initial aggregated object.
  1593. * @returns {Function} Returns `accumulator`.
  1594. */
  1595. function arrayAggregator(array, setter, iteratee, accumulator) {
  1596. var index = -1,
  1597. length = array == null ? 0 : array.length;
  1598. while (++index < length) {
  1599. var value = array[index];
  1600. setter(accumulator, value, iteratee(value), array);
  1601. }
  1602. return accumulator;
  1603. }
  1604. /**
  1605. * A specialized version of `_.forEach` for arrays without support for
  1606. * iteratee shorthands.
  1607. *
  1608. * @private
  1609. * @param {Array} [array] The array to iterate over.
  1610. * @param {Function} iteratee The function invoked per iteration.
  1611. * @returns {Array} Returns `array`.
  1612. */
  1613. function arrayEach(array, iteratee) {
  1614. var index = -1,
  1615. length = array == null ? 0 : array.length;
  1616. while (++index < length) {
  1617. if (iteratee(array[index], index, array) === false) {
  1618. break;
  1619. }
  1620. }
  1621. return array;
  1622. }
  1623. /**
  1624. * A specialized version of `_.forEachRight` for arrays without support for
  1625. * iteratee shorthands.
  1626. *
  1627. * @private
  1628. * @param {Array} [array] The array to iterate over.
  1629. * @param {Function} iteratee The function invoked per iteration.
  1630. * @returns {Array} Returns `array`.
  1631. */
  1632. function arrayEachRight(array, iteratee) {
  1633. var length = array == null ? 0 : array.length;
  1634. while (length--) {
  1635. if (iteratee(array[length], length, array) === false) {
  1636. break;
  1637. }
  1638. }
  1639. return array;
  1640. }
  1641. /**
  1642. * A specialized version of `_.every` for arrays without support for
  1643. * iteratee shorthands.
  1644. *
  1645. * @private
  1646. * @param {Array} [array] The array to iterate over.
  1647. * @param {Function} predicate The function invoked per iteration.
  1648. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1649. * else `false`.
  1650. */
  1651. function arrayEvery(array, predicate) {
  1652. var index = -1,
  1653. length = array == null ? 0 : array.length;
  1654. while (++index < length) {
  1655. if (!predicate(array[index], index, array)) {
  1656. return false;
  1657. }
  1658. }
  1659. return true;
  1660. }
  1661. /**
  1662. * A specialized version of `_.filter` for arrays without support for
  1663. * iteratee shorthands.
  1664. *
  1665. * @private
  1666. * @param {Array} [array] The array to iterate over.
  1667. * @param {Function} predicate The function invoked per iteration.
  1668. * @returns {Array} Returns the new filtered array.
  1669. */
  1670. function arrayFilter(array, predicate) {
  1671. var index = -1,
  1672. length = array == null ? 0 : array.length,
  1673. resIndex = 0,
  1674. result = [];
  1675. while (++index < length) {
  1676. var value = array[index];
  1677. if (predicate(value, index, array)) {
  1678. result[resIndex++] = value;
  1679. }
  1680. }
  1681. return result;
  1682. }
  1683. /**
  1684. * A specialized version of `_.includes` for arrays without support for
  1685. * specifying an index to search from.
  1686. *
  1687. * @private
  1688. * @param {Array} [array] The array to inspect.
  1689. * @param {*} target The value to search for.
  1690. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1691. */
  1692. function arrayIncludes(array, value) {
  1693. var length = array == null ? 0 : array.length;
  1694. return !!length && baseIndexOf(array, value, 0) > -1;
  1695. }
  1696. /**
  1697. * This function is like `arrayIncludes` except that it accepts a comparator.
  1698. *
  1699. * @private
  1700. * @param {Array} [array] The array to inspect.
  1701. * @param {*} target The value to search for.
  1702. * @param {Function} comparator The comparator invoked per element.
  1703. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1704. */
  1705. function arrayIncludesWith(array, value, comparator) {
  1706. var index = -1,
  1707. length = array == null ? 0 : array.length;
  1708. while (++index < length) {
  1709. if (comparator(value, array[index])) {
  1710. return true;
  1711. }
  1712. }
  1713. return false;
  1714. }
  1715. /**
  1716. * A specialized version of `_.map` for arrays without support for iteratee
  1717. * shorthands.
  1718. *
  1719. * @private
  1720. * @param {Array} [array] The array to iterate over.
  1721. * @param {Function} iteratee The function invoked per iteration.
  1722. * @returns {Array} Returns the new mapped array.
  1723. */
  1724. function arrayMap(array, iteratee) {
  1725. var index = -1,
  1726. length = array == null ? 0 : array.length,
  1727. result = Array(length);
  1728. while (++index < length) {
  1729. result[index] = iteratee(array[index], index, array);
  1730. }
  1731. return result;
  1732. }
  1733. /**
  1734. * Appends the elements of `values` to `array`.
  1735. *
  1736. * @private
  1737. * @param {Array} array The array to modify.
  1738. * @param {Array} values The values to append.
  1739. * @returns {Array} Returns `array`.
  1740. */
  1741. function arrayPush(array, values) {
  1742. var index = -1,
  1743. length = values.length,
  1744. offset = array.length;
  1745. while (++index < length) {
  1746. array[offset + index] = values[index];
  1747. }
  1748. return array;
  1749. }
  1750. /**
  1751. * A specialized version of `_.reduce` for arrays without support for
  1752. * iteratee shorthands.
  1753. *
  1754. * @private
  1755. * @param {Array} [array] The array to iterate over.
  1756. * @param {Function} iteratee The function invoked per iteration.
  1757. * @param {*} [accumulator] The initial value.
  1758. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1759. * the initial value.
  1760. * @returns {*} Returns the accumulated value.
  1761. */
  1762. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1763. var index = -1,
  1764. length = array == null ? 0 : array.length;
  1765. if (initAccum && length) {
  1766. accumulator = array[++index];
  1767. }
  1768. while (++index < length) {
  1769. accumulator = iteratee(accumulator, array[index], index, array);
  1770. }
  1771. return accumulator;
  1772. }
  1773. /**
  1774. * A specialized version of `_.reduceRight` for arrays without support for
  1775. * iteratee shorthands.
  1776. *
  1777. * @private
  1778. * @param {Array} [array] The array to iterate over.
  1779. * @param {Function} iteratee The function invoked per iteration.
  1780. * @param {*} [accumulator] The initial value.
  1781. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1782. * the initial value.
  1783. * @returns {*} Returns the accumulated value.
  1784. */
  1785. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1786. var length = array == null ? 0 : array.length;
  1787. if (initAccum && length) {
  1788. accumulator = array[--length];
  1789. }
  1790. while (length--) {
  1791. accumulator = iteratee(accumulator, array[length], length, array);
  1792. }
  1793. return accumulator;
  1794. }
  1795. /**
  1796. * A specialized version of `_.some` for arrays without support for iteratee
  1797. * shorthands.
  1798. *
  1799. * @private
  1800. * @param {Array} [array] The array to iterate over.
  1801. * @param {Function} predicate The function invoked per iteration.
  1802. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1803. * else `false`.
  1804. */
  1805. function arraySome(array, predicate) {
  1806. var index = -1,
  1807. length = array == null ? 0 : array.length;
  1808. while (++index < length) {
  1809. if (predicate(array[index], index, array)) {
  1810. return true;
  1811. }
  1812. }
  1813. return false;
  1814. }
  1815. /**
  1816. * Gets the size of an ASCII `string`.
  1817. *
  1818. * @private
  1819. * @param {string} string The string inspect.
  1820. * @returns {number} Returns the string size.
  1821. */
  1822. var asciiSize = baseProperty('length');
  1823. /**
  1824. * Converts an ASCII `string` to an array.
  1825. *
  1826. * @private
  1827. * @param {string} string The string to convert.
  1828. * @returns {Array} Returns the converted array.
  1829. */
  1830. function asciiToArray(string) {
  1831. return string.split('');
  1832. }
  1833. /**
  1834. * Splits an ASCII `string` into an array of its words.
  1835. *
  1836. * @private
  1837. * @param {string} The string to inspect.
  1838. * @returns {Array} Returns the words of `string`.
  1839. */
  1840. function asciiWords(string) {
  1841. return string.match(reAsciiWord) || [];
  1842. }
  1843. /**
  1844. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1845. * without support for iteratee shorthands, which iterates over `collection`
  1846. * using `eachFunc`.
  1847. *
  1848. * @private
  1849. * @param {Array|Object} collection The collection to inspect.
  1850. * @param {Function} predicate The function invoked per iteration.
  1851. * @param {Function} eachFunc The function to iterate over `collection`.
  1852. * @returns {*} Returns the found element or its key, else `undefined`.
  1853. */
  1854. function baseFindKey(collection, predicate, eachFunc) {
  1855. var result;
  1856. eachFunc(collection, function(value, key, collection) {
  1857. if (predicate(value, key, collection)) {
  1858. result = key;
  1859. return false;
  1860. }
  1861. });
  1862. return result;
  1863. }
  1864. /**
  1865. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1866. * support for iteratee shorthands.
  1867. *
  1868. * @private
  1869. * @param {Array} array The array to inspect.
  1870. * @param {Function} predicate The function invoked per iteration.
  1871. * @param {number} fromIndex The index to search from.
  1872. * @param {boolean} [fromRight] Specify iterating from right to left.
  1873. * @returns {number} Returns the index of the matched value, else `-1`.
  1874. */
  1875. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1876. var length = array.length,
  1877. index = fromIndex + (fromRight ? 1 : -1);
  1878. while ((fromRight ? index-- : ++index < length)) {
  1879. if (predicate(array[index], index, array)) {
  1880. return index;
  1881. }
  1882. }
  1883. return -1;
  1884. }
  1885. /**
  1886. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1887. *
  1888. * @private
  1889. * @param {Array} array The array to inspect.
  1890. * @param {*} value The value to search for.
  1891. * @param {number} fromIndex The index to search from.
  1892. * @returns {number} Returns the index of the matched value, else `-1`.
  1893. */
  1894. function baseIndexOf(array, value, fromIndex) {
  1895. return value === value
  1896. ? strictIndexOf(array, value, fromIndex)
  1897. : baseFindIndex(array, baseIsNaN, fromIndex);
  1898. }
  1899. /**
  1900. * This function is like `baseIndexOf` except that it accepts a comparator.
  1901. *
  1902. * @private
  1903. * @param {Array} array The array to inspect.
  1904. * @param {*} value The value to search for.
  1905. * @param {number} fromIndex The index to search from.
  1906. * @param {Function} comparator The comparator invoked per element.
  1907. * @returns {number} Returns the index of the matched value, else `-1`.
  1908. */
  1909. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1910. var index = fromIndex - 1,
  1911. length = array.length;
  1912. while (++index < length) {
  1913. if (comparator(array[index], value)) {
  1914. return index;
  1915. }
  1916. }
  1917. return -1;
  1918. }
  1919. /**
  1920. * The base implementation of `_.isNaN` without support for number objects.
  1921. *
  1922. * @private
  1923. * @param {*} value The value to check.
  1924. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1925. */
  1926. function baseIsNaN(value) {
  1927. return value !== value;
  1928. }
  1929. /**
  1930. * The base implementation of `_.mean` and `_.meanBy` without support for
  1931. * iteratee shorthands.
  1932. *
  1933. * @private
  1934. * @param {Array} array The array to iterate over.
  1935. * @param {Function} iteratee The function invoked per iteration.
  1936. * @returns {number} Returns the mean.
  1937. */
  1938. function baseMean(array, iteratee) {
  1939. var length = array == null ? 0 : array.length;
  1940. return length ? (baseSum(array, iteratee) / length) : NAN;
  1941. }
  1942. /**
  1943. * The base implementation of `_.property` without support for deep paths.
  1944. *
  1945. * @private
  1946. * @param {string} key The key of the property to get.
  1947. * @returns {Function} Returns the new accessor function.
  1948. */
  1949. function baseProperty(key) {
  1950. return function(object) {
  1951. return object == null ? undefined : object[key];
  1952. };
  1953. }
  1954. /**
  1955. * The base implementation of `_.propertyOf` without support for deep paths.
  1956. *
  1957. * @private
  1958. * @param {Object} object The object to query.
  1959. * @returns {Function} Returns the new accessor function.
  1960. */
  1961. function basePropertyOf(object) {
  1962. return function(key) {
  1963. return object == null ? undefined : object[key];
  1964. };
  1965. }
  1966. /**
  1967. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1968. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1969. *
  1970. * @private
  1971. * @param {Array|Object} collection The collection to iterate over.
  1972. * @param {Function} iteratee The function invoked per iteration.
  1973. * @param {*} accumulator The initial value.
  1974. * @param {boolean} initAccum Specify using the first or last element of
  1975. * `collection` as the initial value.
  1976. * @param {Function} eachFunc The function to iterate over `collection`.
  1977. * @returns {*} Returns the accumulated value.
  1978. */
  1979. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1980. eachFunc(collection, function(value, index, collection) {
  1981. accumulator = initAccum
  1982. ? (initAccum = false, value)
  1983. : iteratee(accumulator, value, index, collection);
  1984. });
  1985. return accumulator;
  1986. }
  1987. /**
  1988. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1989. * sort order of `array` and replaces criteria objects with their corresponding
  1990. * values.
  1991. *
  1992. * @private
  1993. * @param {Array} array The array to sort.
  1994. * @param {Function} comparer The function to define sort order.
  1995. * @returns {Array} Returns `array`.
  1996. */
  1997. function baseSortBy(array, comparer) {
  1998. var length = array.length;
  1999. array.sort(comparer);
  2000. while (length--) {
  2001. array[length] = array[length].value;
  2002. }
  2003. return array;
  2004. }
  2005. /**
  2006. * The base implementation of `_.sum` and `_.sumBy` without support for
  2007. * iteratee shorthands.
  2008. *
  2009. * @private
  2010. * @param {Array} array The array to iterate over.
  2011. * @param {Function} iteratee The function invoked per iteration.
  2012. * @returns {number} Returns the sum.
  2013. */
  2014. function baseSum(array, iteratee) {
  2015. var result,
  2016. index = -1,
  2017. length = array.length;
  2018. while (++index < length) {
  2019. var current = iteratee(array[index]);
  2020. if (current !== undefined) {
  2021. result = result === undefined ? current : (result + current);
  2022. }
  2023. }
  2024. return result;
  2025. }
  2026. /**
  2027. * The base implementation of `_.times` without support for iteratee shorthands
  2028. * or max array length checks.
  2029. *
  2030. * @private
  2031. * @param {number} n The number of times to invoke `iteratee`.
  2032. * @param {Function} iteratee The function invoked per iteration.
  2033. * @returns {Array} Returns the array of results.
  2034. */
  2035. function baseTimes(n, iteratee) {
  2036. var index = -1,
  2037. result = Array(n);
  2038. while (++index < n) {
  2039. result[index] = iteratee(index);
  2040. }
  2041. return result;
  2042. }
  2043. /**
  2044. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2045. * of key-value pairs for `object` corresponding to the property names of `props`.
  2046. *
  2047. * @private
  2048. * @param {Object} object The object to query.
  2049. * @param {Array} props The property names to get values for.
  2050. * @returns {Object} Returns the key-value pairs.
  2051. */
  2052. function baseToPairs(object, props) {
  2053. return arrayMap(props, function(key) {
  2054. return [key, object[key]];
  2055. });
  2056. }
  2057. /**
  2058. * The base implementation of `_.trim`.
  2059. *
  2060. * @private
  2061. * @param {string} string The string to trim.
  2062. * @returns {string} Returns the trimmed string.
  2063. */
  2064. function baseTrim(string) {
  2065. return string
  2066. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2067. : string;
  2068. }
  2069. /**
  2070. * The base implementation of `_.unary` without support for storing metadata.
  2071. *
  2072. * @private
  2073. * @param {Function} func The function to cap arguments for.
  2074. * @returns {Function} Returns the new capped function.
  2075. */
  2076. function baseUnary(func) {
  2077. return function(value) {
  2078. return func(value);
  2079. };
  2080. }
  2081. /**
  2082. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2083. * array of `object` property values corresponding to the property names
  2084. * of `props`.
  2085. *
  2086. * @private
  2087. * @param {Object} object The object to query.
  2088. * @param {Array} props The property names to get values for.
  2089. * @returns {Object} Returns the array of property values.
  2090. */
  2091. function baseValues(object, props) {
  2092. return arrayMap(props, function(key) {
  2093. return object[key];
  2094. });
  2095. }
  2096. /**
  2097. * Checks if a `cache` value for `key` exists.
  2098. *
  2099. * @private
  2100. * @param {Object} cache The cache to query.
  2101. * @param {string} key The key of the entry to check.
  2102. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2103. */
  2104. function cacheHas(cache, key) {
  2105. return cache.has(key);
  2106. }
  2107. /**
  2108. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2109. * that is not found in the character symbols.
  2110. *
  2111. * @private
  2112. * @param {Array} strSymbols The string symbols to inspect.
  2113. * @param {Array} chrSymbols The character symbols to find.
  2114. * @returns {number} Returns the index of the first unmatched string symbol.
  2115. */
  2116. function charsStartIndex(strSymbols, chrSymbols) {
  2117. var index = -1,
  2118. length = strSymbols.length;
  2119. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2120. return index;
  2121. }
  2122. /**
  2123. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2124. * that is not found in the character symbols.
  2125. *
  2126. * @private
  2127. * @param {Array} strSymbols The string symbols to inspect.
  2128. * @param {Array} chrSymbols The character symbols to find.
  2129. * @returns {number} Returns the index of the last unmatched string symbol.
  2130. */
  2131. function charsEndIndex(strSymbols, chrSymbols) {
  2132. var index = strSymbols.length;
  2133. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2134. return index;
  2135. }
  2136. /**
  2137. * Gets the number of `placeholder` occurrences in `array`.
  2138. *
  2139. * @private
  2140. * @param {Array} array The array to inspect.
  2141. * @param {*} placeholder The placeholder to search for.
  2142. * @returns {number} Returns the placeholder count.
  2143. */
  2144. function countHolders(array, placeholder) {
  2145. var length = array.length,
  2146. result = 0;
  2147. while (length--) {
  2148. if (array[length] === placeholder) {
  2149. ++result;
  2150. }
  2151. }
  2152. return result;
  2153. }
  2154. /**
  2155. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2156. * letters to basic Latin letters.
  2157. *
  2158. * @private
  2159. * @param {string} letter The matched letter to deburr.
  2160. * @returns {string} Returns the deburred letter.
  2161. */
  2162. var deburrLetter = basePropertyOf(deburredLetters);
  2163. /**
  2164. * Used by `_.escape` to convert characters to HTML entities.
  2165. *
  2166. * @private
  2167. * @param {string} chr The matched character to escape.
  2168. * @returns {string} Returns the escaped character.
  2169. */
  2170. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2171. /**
  2172. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2173. *
  2174. * @private
  2175. * @param {string} chr The matched character to escape.
  2176. * @returns {string} Returns the escaped character.
  2177. */
  2178. function escapeStringChar(chr) {
  2179. return '\\' + stringEscapes[chr];
  2180. }
  2181. /**
  2182. * Gets the value at `key` of `object`.
  2183. *
  2184. * @private
  2185. * @param {Object} [object] The object to query.
  2186. * @param {string} key The key of the property to get.
  2187. * @returns {*} Returns the property value.
  2188. */
  2189. function getValue(object, key) {
  2190. return object == null ? undefined : object[key];
  2191. }
  2192. /**
  2193. * Checks if `string` contains Unicode symbols.
  2194. *
  2195. * @private
  2196. * @param {string} string The string to inspect.
  2197. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2198. */
  2199. function hasUnicode(string) {
  2200. return reHasUnicode.test(string);
  2201. }
  2202. /**
  2203. * Checks if `string` contains a word composed of Unicode symbols.
  2204. *
  2205. * @private
  2206. * @param {string} string The string to inspect.
  2207. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2208. */
  2209. function hasUnicodeWord(string) {
  2210. return reHasUnicodeWord.test(string);
  2211. }
  2212. /**
  2213. * Converts `iterator` to an array.
  2214. *
  2215. * @private
  2216. * @param {Object} iterator The iterator to convert.
  2217. * @returns {Array} Returns the converted array.
  2218. */
  2219. function iteratorToArray(iterator) {
  2220. var data,
  2221. result = [];
  2222. while (!(data = iterator.next()).done) {
  2223. result.push(data.value);
  2224. }
  2225. return result;
  2226. }
  2227. /**
  2228. * Converts `map` to its key-value pairs.
  2229. *
  2230. * @private
  2231. * @param {Object} map The map to convert.
  2232. * @returns {Array} Returns the key-value pairs.
  2233. */
  2234. function mapToArray(map) {
  2235. var index = -1,
  2236. result = Array(map.size);
  2237. map.forEach(function(value, key) {
  2238. result[++index] = [key, value];
  2239. });
  2240. return result;
  2241. }
  2242. /**
  2243. * Creates a unary function that invokes `func` with its argument transformed.
  2244. *
  2245. * @private
  2246. * @param {Function} func The function to wrap.
  2247. * @param {Function} transform The argument transform.
  2248. * @returns {Function} Returns the new function.
  2249. */
  2250. function overArg(func, transform) {
  2251. return function(arg) {
  2252. return func(transform(arg));
  2253. };
  2254. }
  2255. /**
  2256. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2257. * and returns an array of their indexes.
  2258. *
  2259. * @private
  2260. * @param {Array} array The array to modify.
  2261. * @param {*} placeholder The placeholder to replace.
  2262. * @returns {Array} Returns the new array of placeholder indexes.
  2263. */
  2264. function replaceHolders(array, placeholder) {
  2265. var index = -1,
  2266. length = array.length,
  2267. resIndex = 0,
  2268. result = [];
  2269. while (++index < length) {
  2270. var value = array[index];
  2271. if (value === placeholder || value === PLACEHOLDER) {
  2272. array[index] = PLACEHOLDER;
  2273. result[resIndex++] = index;
  2274. }
  2275. }
  2276. return result;
  2277. }
  2278. /**
  2279. * Converts `set` to an array of its values.
  2280. *
  2281. * @private
  2282. * @param {Object} set The set to convert.
  2283. * @returns {Array} Returns the values.
  2284. */
  2285. function setToArray(set) {
  2286. var index = -1,
  2287. result = Array(set.size);
  2288. set.forEach(function(value) {
  2289. result[++index] = value;
  2290. });
  2291. return result;
  2292. }
  2293. /**
  2294. * Converts `set` to its value-value pairs.
  2295. *
  2296. * @private
  2297. * @param {Object} set The set to convert.
  2298. * @returns {Array} Returns the value-value pairs.
  2299. */
  2300. function setToPairs(set) {
  2301. var index = -1,
  2302. result = Array(set.size);
  2303. set.forEach(function(value) {
  2304. result[++index] = [value, value];
  2305. });
  2306. return result;
  2307. }
  2308. /**
  2309. * A specialized version of `_.indexOf` which performs strict equality
  2310. * comparisons of values, i.e. `===`.
  2311. *
  2312. * @private
  2313. * @param {Array} array The array to inspect.
  2314. * @param {*} value The value to search for.
  2315. * @param {number} fromIndex The index to search from.
  2316. * @returns {number} Returns the index of the matched value, else `-1`.
  2317. */
  2318. function strictIndexOf(array, value, fromIndex) {
  2319. var index = fromIndex - 1,
  2320. length = array.length;
  2321. while (++index < length) {
  2322. if (array[index] === value) {
  2323. return index;
  2324. }
  2325. }
  2326. return -1;
  2327. }
  2328. /**
  2329. * A specialized version of `_.lastIndexOf` which performs strict equality
  2330. * comparisons of values, i.e. `===`.
  2331. *
  2332. * @private
  2333. * @param {Array} array The array to inspect.
  2334. * @param {*} value The value to search for.
  2335. * @param {number} fromIndex The index to search from.
  2336. * @returns {number} Returns the index of the matched value, else `-1`.
  2337. */
  2338. function strictLastIndexOf(array, value, fromIndex) {
  2339. var index = fromIndex + 1;
  2340. while (index--) {
  2341. if (array[index] === value) {
  2342. return index;
  2343. }
  2344. }
  2345. return index;
  2346. }
  2347. /**
  2348. * Gets the number of symbols in `string`.
  2349. *
  2350. * @private
  2351. * @param {string} string The string to inspect.
  2352. * @returns {number} Returns the string size.
  2353. */
  2354. function stringSize(string) {
  2355. return hasUnicode(string)
  2356. ? unicodeSize(string)
  2357. : asciiSize(string);
  2358. }
  2359. /**
  2360. * Converts `string` to an array.
  2361. *
  2362. * @private
  2363. * @param {string} string The string to convert.
  2364. * @returns {Array} Returns the converted array.
  2365. */
  2366. function stringToArray(string) {
  2367. return hasUnicode(string)
  2368. ? unicodeToArray(string)
  2369. : asciiToArray(string);
  2370. }
  2371. /**
  2372. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2373. * character of `string`.
  2374. *
  2375. * @private
  2376. * @param {string} string The string to inspect.
  2377. * @returns {number} Returns the index of the last non-whitespace character.
  2378. */
  2379. function trimmedEndIndex(string) {
  2380. var index = string.length;
  2381. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2382. return index;
  2383. }
  2384. /**
  2385. * Used by `_.unescape` to convert HTML entities to characters.
  2386. *
  2387. * @private
  2388. * @param {string} chr The matched character to unescape.
  2389. * @returns {string} Returns the unescaped character.
  2390. */
  2391. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2392. /**
  2393. * Gets the size of a Unicode `string`.
  2394. *
  2395. * @private
  2396. * @param {string} string The string inspect.
  2397. * @returns {number} Returns the string size.
  2398. */
  2399. function unicodeSize(string) {
  2400. var result = reUnicode.lastIndex = 0;
  2401. while (reUnicode.test(string)) {
  2402. ++result;
  2403. }
  2404. return result;
  2405. }
  2406. /**
  2407. * Converts a Unicode `string` to an array.
  2408. *
  2409. * @private
  2410. * @param {string} string The string to convert.
  2411. * @returns {Array} Returns the converted array.
  2412. */
  2413. function unicodeToArray(string) {
  2414. return string.match(reUnicode) || [];
  2415. }
  2416. /**
  2417. * Splits a Unicode `string` into an array of its words.
  2418. *
  2419. * @private
  2420. * @param {string} The string to inspect.
  2421. * @returns {Array} Returns the words of `string`.
  2422. */
  2423. function unicodeWords(string) {
  2424. return string.match(reUnicodeWord) || [];
  2425. }
  2426. /*--------------------------------------------------------------------------*/
  2427. /**
  2428. * Create a new pristine `lodash` function using the `context` object.
  2429. *
  2430. * @static
  2431. * @memberOf _
  2432. * @since 1.1.0
  2433. * @category Util
  2434. * @param {Object} [context=root] The context object.
  2435. * @returns {Function} Returns a new `lodash` function.
  2436. * @example
  2437. *
  2438. * _.mixin({ 'foo': _.constant('foo') });
  2439. *
  2440. * var lodash = _.runInContext();
  2441. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2442. *
  2443. * _.isFunction(_.foo);
  2444. * // => true
  2445. * _.isFunction(_.bar);
  2446. * // => false
  2447. *
  2448. * lodash.isFunction(lodash.foo);
  2449. * // => false
  2450. * lodash.isFunction(lodash.bar);
  2451. * // => true
  2452. *
  2453. * // Create a suped-up `defer` in Node.js.
  2454. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2455. */
  2456. var runInContext = (function runInContext(context) {
  2457. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2458. /** Built-in constructor references. */
  2459. var Array = context.Array,
  2460. Date = context.Date,
  2461. Error = context.Error,
  2462. Function = context.Function,
  2463. Math = context.Math,
  2464. Object = context.Object,
  2465. RegExp = context.RegExp,
  2466. String = context.String,
  2467. TypeError = context.TypeError;
  2468. /** Used for built-in method references. */
  2469. var arrayProto = Array.prototype,
  2470. funcProto = Function.prototype,
  2471. objectProto = Object.prototype;
  2472. /** Used to detect overreaching core-js shims. */
  2473. var coreJsData = context['__core-js_shared__'];
  2474. /** Used to resolve the decompiled source of functions. */
  2475. var funcToString = funcProto.toString;
  2476. /** Used to check objects for own properties. */
  2477. var hasOwnProperty = objectProto.hasOwnProperty;
  2478. /** Used to generate unique IDs. */
  2479. var idCounter = 0;
  2480. /** Used to detect methods masquerading as native. */
  2481. var maskSrcKey = (function() {
  2482. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2483. return uid ? ('Symbol(src)_1.' + uid) : '';
  2484. }());
  2485. /**
  2486. * Used to resolve the
  2487. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2488. * of values.
  2489. */
  2490. var nativeObjectToString = objectProto.toString;
  2491. /** Used to infer the `Object` constructor. */
  2492. var objectCtorString = funcToString.call(Object);
  2493. /** Used to restore the original `_` reference in `_.noConflict`. */
  2494. var oldDash = root._;
  2495. /** Used to detect if a method is native. */
  2496. var reIsNative = RegExp('^' +
  2497. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2498. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2499. );
  2500. /** Built-in value references. */
  2501. var Buffer = moduleExports ? context.Buffer : undefined,
  2502. Symbol = context.Symbol,
  2503. Uint8Array = context.Uint8Array,
  2504. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2505. getPrototype = overArg(Object.getPrototypeOf, Object),
  2506. objectCreate = Object.create,
  2507. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2508. splice = arrayProto.splice,
  2509. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2510. symIterator = Symbol ? Symbol.iterator : undefined,
  2511. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2512. var defineProperty = (function() {
  2513. try {
  2514. var func = getNative(Object, 'defineProperty');
  2515. func({}, '', {});
  2516. return func;
  2517. } catch (e) {}
  2518. }());
  2519. /** Mocked built-ins. */
  2520. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2521. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2522. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2523. /* Built-in method references for those with the same name as other `lodash` methods. */
  2524. var nativeCeil = Math.ceil,
  2525. nativeFloor = Math.floor,
  2526. nativeGetSymbols = Object.getOwnPropertySymbols,
  2527. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2528. nativeIsFinite = context.isFinite,
  2529. nativeJoin = arrayProto.join,
  2530. nativeKeys = overArg(Object.keys, Object),
  2531. nativeMax = Math.max,
  2532. nativeMin = Math.min,
  2533. nativeNow = Date.now,
  2534. nativeParseInt = context.parseInt,
  2535. nativeRandom = Math.random,
  2536. nativeReverse = arrayProto.reverse;
  2537. /* Built-in method references that are verified to be native. */
  2538. var DataView = getNative(context, 'DataView'),
  2539. Map = getNative(context, 'Map'),
  2540. Promise = getNative(context, 'Promise'),
  2541. Set = getNative(context, 'Set'),
  2542. WeakMap = getNative(context, 'WeakMap'),
  2543. nativeCreate = getNative(Object, 'create');
  2544. /** Used to store function metadata. */
  2545. var metaMap = WeakMap && new WeakMap;
  2546. /** Used to lookup unminified function names. */
  2547. var realNames = {};
  2548. /** Used to detect maps, sets, and weakmaps. */
  2549. var dataViewCtorString = toSource(DataView),
  2550. mapCtorString = toSource(Map),
  2551. promiseCtorString = toSource(Promise),
  2552. setCtorString = toSource(Set),
  2553. weakMapCtorString = toSource(WeakMap);
  2554. /** Used to convert symbols to primitives and strings. */
  2555. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2556. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2557. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2558. /*------------------------------------------------------------------------*/
  2559. /**
  2560. * Creates a `lodash` object which wraps `value` to enable implicit method
  2561. * chain sequences. Methods that operate on and return arrays, collections,
  2562. * and functions can be chained together. Methods that retrieve a single value
  2563. * or may return a primitive value will automatically end the chain sequence
  2564. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2565. * with `_#value`.
  2566. *
  2567. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2568. * enabled using `_.chain`.
  2569. *
  2570. * The execution of chained methods is lazy, that is, it's deferred until
  2571. * `_#value` is implicitly or explicitly called.
  2572. *
  2573. * Lazy evaluation allows several methods to support shortcut fusion.
  2574. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2575. * the creation of intermediate arrays and can greatly reduce the number of
  2576. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2577. * fusion if the section is applied to an array and iteratees accept only
  2578. * one argument. The heuristic for whether a section qualifies for shortcut
  2579. * fusion is subject to change.
  2580. *
  2581. * Chaining is supported in custom builds as long as the `_#value` method is
  2582. * directly or indirectly included in the build.
  2583. *
  2584. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2585. *
  2586. * The wrapper `Array` methods are:
  2587. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2588. *
  2589. * The wrapper `String` methods are:
  2590. * `replace` and `split`
  2591. *
  2592. * The wrapper methods that support shortcut fusion are:
  2593. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2594. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2595. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2596. *
  2597. * The chainable wrapper methods are:
  2598. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2599. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2600. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2601. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2602. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2603. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2604. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2605. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2606. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2607. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2608. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2609. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2610. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2611. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2612. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2613. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2614. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2615. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2616. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2617. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2618. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2619. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2620. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2621. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2622. *
  2623. * The wrapper methods that are **not** chainable by default are:
  2624. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2625. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2626. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2627. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2628. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2629. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2630. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2631. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2632. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2633. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2634. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2635. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2636. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2637. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2638. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2639. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2640. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2641. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2642. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2643. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2644. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2645. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2646. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2647. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2648. * `upperFirst`, `value`, and `words`
  2649. *
  2650. * @name _
  2651. * @constructor
  2652. * @category Seq
  2653. * @param {*} value The value to wrap in a `lodash` instance.
  2654. * @returns {Object} Returns the new `lodash` wrapper instance.
  2655. * @example
  2656. *
  2657. * function square(n) {
  2658. * return n * n;
  2659. * }
  2660. *
  2661. * var wrapped = _([1, 2, 3]);
  2662. *
  2663. * // Returns an unwrapped value.
  2664. * wrapped.reduce(_.add);
  2665. * // => 6
  2666. *
  2667. * // Returns a wrapped value.
  2668. * var squares = wrapped.map(square);
  2669. *
  2670. * _.isArray(squares);
  2671. * // => false
  2672. *
  2673. * _.isArray(squares.value());
  2674. * // => true
  2675. */
  2676. function lodash(value) {
  2677. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2678. if (value instanceof LodashWrapper) {
  2679. return value;
  2680. }
  2681. if (hasOwnProperty.call(value, '__wrapped__')) {
  2682. return wrapperClone(value);
  2683. }
  2684. }
  2685. return new LodashWrapper(value);
  2686. }
  2687. /**
  2688. * The base implementation of `_.create` without support for assigning
  2689. * properties to the created object.
  2690. *
  2691. * @private
  2692. * @param {Object} proto The object to inherit from.
  2693. * @returns {Object} Returns the new object.
  2694. */
  2695. var baseCreate = (function() {
  2696. function object() {}
  2697. return function(proto) {
  2698. if (!isObject(proto)) {
  2699. return {};
  2700. }
  2701. if (objectCreate) {
  2702. return objectCreate(proto);
  2703. }
  2704. object.prototype = proto;
  2705. var result = new object;
  2706. object.prototype = undefined;
  2707. return result;
  2708. };
  2709. }());
  2710. /**
  2711. * The function whose prototype chain sequence wrappers inherit from.
  2712. *
  2713. * @private
  2714. */
  2715. function baseLodash() {
  2716. // No operation performed.
  2717. }
  2718. /**
  2719. * The base constructor for creating `lodash` wrapper objects.
  2720. *
  2721. * @private
  2722. * @param {*} value The value to wrap.
  2723. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2724. */
  2725. function LodashWrapper(value, chainAll) {
  2726. this.__wrapped__ = value;
  2727. this.__actions__ = [];
  2728. this.__chain__ = !!chainAll;
  2729. this.__index__ = 0;
  2730. this.__values__ = undefined;
  2731. }
  2732. /**
  2733. * By default, the template delimiters used by lodash are like those in
  2734. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2735. * following template settings to use alternative delimiters.
  2736. *
  2737. * @static
  2738. * @memberOf _
  2739. * @type {Object}
  2740. */
  2741. lodash.templateSettings = {
  2742. /**
  2743. * Used to detect `data` property values to be HTML-escaped.
  2744. *
  2745. * @memberOf _.templateSettings
  2746. * @type {RegExp}
  2747. */
  2748. 'escape': reEscape,
  2749. /**
  2750. * Used to detect code to be evaluated.
  2751. *
  2752. * @memberOf _.templateSettings
  2753. * @type {RegExp}
  2754. */
  2755. 'evaluate': reEvaluate,
  2756. /**
  2757. * Used to detect `data` property values to inject.
  2758. *
  2759. * @memberOf _.templateSettings
  2760. * @type {RegExp}
  2761. */
  2762. 'interpolate': reInterpolate,
  2763. /**
  2764. * Used to reference the data object in the template text.
  2765. *
  2766. * @memberOf _.templateSettings
  2767. * @type {string}
  2768. */
  2769. 'variable': '',
  2770. /**
  2771. * Used to import variables into the compiled template.
  2772. *
  2773. * @memberOf _.templateSettings
  2774. * @type {Object}
  2775. */
  2776. 'imports': {
  2777. /**
  2778. * A reference to the `lodash` function.
  2779. *
  2780. * @memberOf _.templateSettings.imports
  2781. * @type {Function}
  2782. */
  2783. '_': lodash
  2784. }
  2785. };
  2786. // Ensure wrappers are instances of `baseLodash`.
  2787. lodash.prototype = baseLodash.prototype;
  2788. lodash.prototype.constructor = lodash;
  2789. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2790. LodashWrapper.prototype.constructor = LodashWrapper;
  2791. /*------------------------------------------------------------------------*/
  2792. /**
  2793. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2794. *
  2795. * @private
  2796. * @constructor
  2797. * @param {*} value The value to wrap.
  2798. */
  2799. function LazyWrapper(value) {
  2800. this.__wrapped__ = value;
  2801. this.__actions__ = [];
  2802. this.__dir__ = 1;
  2803. this.__filtered__ = false;
  2804. this.__iteratees__ = [];
  2805. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2806. this.__views__ = [];
  2807. }
  2808. /**
  2809. * Creates a clone of the lazy wrapper object.
  2810. *
  2811. * @private
  2812. * @name clone
  2813. * @memberOf LazyWrapper
  2814. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2815. */
  2816. function lazyClone() {
  2817. var result = new LazyWrapper(this.__wrapped__);
  2818. result.__actions__ = copyArray(this.__actions__);
  2819. result.__dir__ = this.__dir__;
  2820. result.__filtered__ = this.__filtered__;
  2821. result.__iteratees__ = copyArray(this.__iteratees__);
  2822. result.__takeCount__ = this.__takeCount__;
  2823. result.__views__ = copyArray(this.__views__);
  2824. return result;
  2825. }
  2826. /**
  2827. * Reverses the direction of lazy iteration.
  2828. *
  2829. * @private
  2830. * @name reverse
  2831. * @memberOf LazyWrapper
  2832. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2833. */
  2834. function lazyReverse() {
  2835. if (this.__filtered__) {
  2836. var result = new LazyWrapper(this);
  2837. result.__dir__ = -1;
  2838. result.__filtered__ = true;
  2839. } else {
  2840. result = this.clone();
  2841. result.__dir__ *= -1;
  2842. }
  2843. return result;
  2844. }
  2845. /**
  2846. * Extracts the unwrapped value from its lazy wrapper.
  2847. *
  2848. * @private
  2849. * @name value
  2850. * @memberOf LazyWrapper
  2851. * @returns {*} Returns the unwrapped value.
  2852. */
  2853. function lazyValue() {
  2854. var array = this.__wrapped__.value(),
  2855. dir = this.__dir__,
  2856. isArr = isArray(array),
  2857. isRight = dir < 0,
  2858. arrLength = isArr ? array.length : 0,
  2859. view = getView(0, arrLength, this.__views__),
  2860. start = view.start,
  2861. end = view.end,
  2862. length = end - start,
  2863. index = isRight ? end : (start - 1),
  2864. iteratees = this.__iteratees__,
  2865. iterLength = iteratees.length,
  2866. resIndex = 0,
  2867. takeCount = nativeMin(length, this.__takeCount__);
  2868. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2869. return baseWrapperValue(array, this.__actions__);
  2870. }
  2871. var result = [];
  2872. outer:
  2873. while (length-- && resIndex < takeCount) {
  2874. index += dir;
  2875. var iterIndex = -1,
  2876. value = array[index];
  2877. while (++iterIndex < iterLength) {
  2878. var data = iteratees[iterIndex],
  2879. iteratee = data.iteratee,
  2880. type = data.type,
  2881. computed = iteratee(value);
  2882. if (type == LAZY_MAP_FLAG) {
  2883. value = computed;
  2884. } else if (!computed) {
  2885. if (type == LAZY_FILTER_FLAG) {
  2886. continue outer;
  2887. } else {
  2888. break outer;
  2889. }
  2890. }
  2891. }
  2892. result[resIndex++] = value;
  2893. }
  2894. return result;
  2895. }
  2896. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2897. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2898. LazyWrapper.prototype.constructor = LazyWrapper;
  2899. /*------------------------------------------------------------------------*/
  2900. /**
  2901. * Creates a hash object.
  2902. *
  2903. * @private
  2904. * @constructor
  2905. * @param {Array} [entries] The key-value pairs to cache.
  2906. */
  2907. function Hash(entries) {
  2908. var index = -1,
  2909. length = entries == null ? 0 : entries.length;
  2910. this.clear();
  2911. while (++index < length) {
  2912. var entry = entries[index];
  2913. this.set(entry[0], entry[1]);
  2914. }
  2915. }
  2916. /**
  2917. * Removes all key-value entries from the hash.
  2918. *
  2919. * @private
  2920. * @name clear
  2921. * @memberOf Hash
  2922. */
  2923. function hashClear() {
  2924. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2925. this.size = 0;
  2926. }
  2927. /**
  2928. * Removes `key` and its value from the hash.
  2929. *
  2930. * @private
  2931. * @name delete
  2932. * @memberOf Hash
  2933. * @param {Object} hash The hash to modify.
  2934. * @param {string} key The key of the value to remove.
  2935. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2936. */
  2937. function hashDelete(key) {
  2938. var result = this.has(key) && delete this.__data__[key];
  2939. this.size -= result ? 1 : 0;
  2940. return result;
  2941. }
  2942. /**
  2943. * Gets the hash value for `key`.
  2944. *
  2945. * @private
  2946. * @name get
  2947. * @memberOf Hash
  2948. * @param {string} key The key of the value to get.
  2949. * @returns {*} Returns the entry value.
  2950. */
  2951. function hashGet(key) {
  2952. var data = this.__data__;
  2953. if (nativeCreate) {
  2954. var result = data[key];
  2955. return result === HASH_UNDEFINED ? undefined : result;
  2956. }
  2957. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2958. }
  2959. /**
  2960. * Checks if a hash value for `key` exists.
  2961. *
  2962. * @private
  2963. * @name has
  2964. * @memberOf Hash
  2965. * @param {string} key The key of the entry to check.
  2966. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2967. */
  2968. function hashHas(key) {
  2969. var data = this.__data__;
  2970. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2971. }
  2972. /**
  2973. * Sets the hash `key` to `value`.
  2974. *
  2975. * @private
  2976. * @name set
  2977. * @memberOf Hash
  2978. * @param {string} key The key of the value to set.
  2979. * @param {*} value The value to set.
  2980. * @returns {Object} Returns the hash instance.
  2981. */
  2982. function hashSet(key, value) {
  2983. var data = this.__data__;
  2984. this.size += this.has(key) ? 0 : 1;
  2985. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2986. return this;
  2987. }
  2988. // Add methods to `Hash`.
  2989. Hash.prototype.clear = hashClear;
  2990. Hash.prototype['delete'] = hashDelete;
  2991. Hash.prototype.get = hashGet;
  2992. Hash.prototype.has = hashHas;
  2993. Hash.prototype.set = hashSet;
  2994. /*------------------------------------------------------------------------*/
  2995. /**
  2996. * Creates an list cache object.
  2997. *
  2998. * @private
  2999. * @constructor
  3000. * @param {Array} [entries] The key-value pairs to cache.
  3001. */
  3002. function ListCache(entries) {
  3003. var index = -1,
  3004. length = entries == null ? 0 : entries.length;
  3005. this.clear();
  3006. while (++index < length) {
  3007. var entry = entries[index];
  3008. this.set(entry[0], entry[1]);
  3009. }
  3010. }
  3011. /**
  3012. * Removes all key-value entries from the list cache.
  3013. *
  3014. * @private
  3015. * @name clear
  3016. * @memberOf ListCache
  3017. */
  3018. function listCacheClear() {
  3019. this.__data__ = [];
  3020. this.size = 0;
  3021. }
  3022. /**
  3023. * Removes `key` and its value from the list cache.
  3024. *
  3025. * @private
  3026. * @name delete
  3027. * @memberOf ListCache
  3028. * @param {string} key The key of the value to remove.
  3029. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3030. */
  3031. function listCacheDelete(key) {
  3032. var data = this.__data__,
  3033. index = assocIndexOf(data, key);
  3034. if (index < 0) {
  3035. return false;
  3036. }
  3037. var lastIndex = data.length - 1;
  3038. if (index == lastIndex) {
  3039. data.pop();
  3040. } else {
  3041. splice.call(data, index, 1);
  3042. }
  3043. --this.size;
  3044. return true;
  3045. }
  3046. /**
  3047. * Gets the list cache value for `key`.
  3048. *
  3049. * @private
  3050. * @name get
  3051. * @memberOf ListCache
  3052. * @param {string} key The key of the value to get.
  3053. * @returns {*} Returns the entry value.
  3054. */
  3055. function listCacheGet(key) {
  3056. var data = this.__data__,
  3057. index = assocIndexOf(data, key);
  3058. return index < 0 ? undefined : data[index][1];
  3059. }
  3060. /**
  3061. * Checks if a list cache value for `key` exists.
  3062. *
  3063. * @private
  3064. * @name has
  3065. * @memberOf ListCache
  3066. * @param {string} key The key of the entry to check.
  3067. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3068. */
  3069. function listCacheHas(key) {
  3070. return assocIndexOf(this.__data__, key) > -1;
  3071. }
  3072. /**
  3073. * Sets the list cache `key` to `value`.
  3074. *
  3075. * @private
  3076. * @name set
  3077. * @memberOf ListCache
  3078. * @param {string} key The key of the value to set.
  3079. * @param {*} value The value to set.
  3080. * @returns {Object} Returns the list cache instance.
  3081. */
  3082. function listCacheSet(key, value) {
  3083. var data = this.__data__,
  3084. index = assocIndexOf(data, key);
  3085. if (index < 0) {
  3086. ++this.size;
  3087. data.push([key, value]);
  3088. } else {
  3089. data[index][1] = value;
  3090. }
  3091. return this;
  3092. }
  3093. // Add methods to `ListCache`.
  3094. ListCache.prototype.clear = listCacheClear;
  3095. ListCache.prototype['delete'] = listCacheDelete;
  3096. ListCache.prototype.get = listCacheGet;
  3097. ListCache.prototype.has = listCacheHas;
  3098. ListCache.prototype.set = listCacheSet;
  3099. /*------------------------------------------------------------------------*/
  3100. /**
  3101. * Creates a map cache object to store key-value pairs.
  3102. *
  3103. * @private
  3104. * @constructor
  3105. * @param {Array} [entries] The key-value pairs to cache.
  3106. */
  3107. function MapCache(entries) {
  3108. var index = -1,
  3109. length = entries == null ? 0 : entries.length;
  3110. this.clear();
  3111. while (++index < length) {
  3112. var entry = entries[index];
  3113. this.set(entry[0], entry[1]);
  3114. }
  3115. }
  3116. /**
  3117. * Removes all key-value entries from the map.
  3118. *
  3119. * @private
  3120. * @name clear
  3121. * @memberOf MapCache
  3122. */
  3123. function mapCacheClear() {
  3124. this.size = 0;
  3125. this.__data__ = {
  3126. 'hash': new Hash,
  3127. 'map': new (Map || ListCache),
  3128. 'string': new Hash
  3129. };
  3130. }
  3131. /**
  3132. * Removes `key` and its value from the map.
  3133. *
  3134. * @private
  3135. * @name delete
  3136. * @memberOf MapCache
  3137. * @param {string} key The key of the value to remove.
  3138. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3139. */
  3140. function mapCacheDelete(key) {
  3141. var result = getMapData(this, key)['delete'](key);
  3142. this.size -= result ? 1 : 0;
  3143. return result;
  3144. }
  3145. /**
  3146. * Gets the map value for `key`.
  3147. *
  3148. * @private
  3149. * @name get
  3150. * @memberOf MapCache
  3151. * @param {string} key The key of the value to get.
  3152. * @returns {*} Returns the entry value.
  3153. */
  3154. function mapCacheGet(key) {
  3155. return getMapData(this, key).get(key);
  3156. }
  3157. /**
  3158. * Checks if a map value for `key` exists.
  3159. *
  3160. * @private
  3161. * @name has
  3162. * @memberOf MapCache
  3163. * @param {string} key The key of the entry to check.
  3164. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3165. */
  3166. function mapCacheHas(key) {
  3167. return getMapData(this, key).has(key);
  3168. }
  3169. /**
  3170. * Sets the map `key` to `value`.
  3171. *
  3172. * @private
  3173. * @name set
  3174. * @memberOf MapCache
  3175. * @param {string} key The key of the value to set.
  3176. * @param {*} value The value to set.
  3177. * @returns {Object} Returns the map cache instance.
  3178. */
  3179. function mapCacheSet(key, value) {
  3180. var data = getMapData(this, key),
  3181. size = data.size;
  3182. data.set(key, value);
  3183. this.size += data.size == size ? 0 : 1;
  3184. return this;
  3185. }
  3186. // Add methods to `MapCache`.
  3187. MapCache.prototype.clear = mapCacheClear;
  3188. MapCache.prototype['delete'] = mapCacheDelete;
  3189. MapCache.prototype.get = mapCacheGet;
  3190. MapCache.prototype.has = mapCacheHas;
  3191. MapCache.prototype.set = mapCacheSet;
  3192. /*------------------------------------------------------------------------*/
  3193. /**
  3194. *
  3195. * Creates an array cache object to store unique values.
  3196. *
  3197. * @private
  3198. * @constructor
  3199. * @param {Array} [values] The values to cache.
  3200. */
  3201. function SetCache(values) {
  3202. var index = -1,
  3203. length = values == null ? 0 : values.length;
  3204. this.__data__ = new MapCache;
  3205. while (++index < length) {
  3206. this.add(values[index]);
  3207. }
  3208. }
  3209. /**
  3210. * Adds `value` to the array cache.
  3211. *
  3212. * @private
  3213. * @name add
  3214. * @memberOf SetCache
  3215. * @alias push
  3216. * @param {*} value The value to cache.
  3217. * @returns {Object} Returns the cache instance.
  3218. */
  3219. function setCacheAdd(value) {
  3220. this.__data__.set(value, HASH_UNDEFINED);
  3221. return this;
  3222. }
  3223. /**
  3224. * Checks if `value` is in the array cache.
  3225. *
  3226. * @private
  3227. * @name has
  3228. * @memberOf SetCache
  3229. * @param {*} value The value to search for.
  3230. * @returns {number} Returns `true` if `value` is found, else `false`.
  3231. */
  3232. function setCacheHas(value) {
  3233. return this.__data__.has(value);
  3234. }
  3235. // Add methods to `SetCache`.
  3236. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3237. SetCache.prototype.has = setCacheHas;
  3238. /*------------------------------------------------------------------------*/
  3239. /**
  3240. * Creates a stack cache object to store key-value pairs.
  3241. *
  3242. * @private
  3243. * @constructor
  3244. * @param {Array} [entries] The key-value pairs to cache.
  3245. */
  3246. function Stack(entries) {
  3247. var data = this.__data__ = new ListCache(entries);
  3248. this.size = data.size;
  3249. }
  3250. /**
  3251. * Removes all key-value entries from the stack.
  3252. *
  3253. * @private
  3254. * @name clear
  3255. * @memberOf Stack
  3256. */
  3257. function stackClear() {
  3258. this.__data__ = new ListCache;
  3259. this.size = 0;
  3260. }
  3261. /**
  3262. * Removes `key` and its value from the stack.
  3263. *
  3264. * @private
  3265. * @name delete
  3266. * @memberOf Stack
  3267. * @param {string} key The key of the value to remove.
  3268. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3269. */
  3270. function stackDelete(key) {
  3271. var data = this.__data__,
  3272. result = data['delete'](key);
  3273. this.size = data.size;
  3274. return result;
  3275. }
  3276. /**
  3277. * Gets the stack value for `key`.
  3278. *
  3279. * @private
  3280. * @name get
  3281. * @memberOf Stack
  3282. * @param {string} key The key of the value to get.
  3283. * @returns {*} Returns the entry value.
  3284. */
  3285. function stackGet(key) {
  3286. return this.__data__.get(key);
  3287. }
  3288. /**
  3289. * Checks if a stack value for `key` exists.
  3290. *
  3291. * @private
  3292. * @name has
  3293. * @memberOf Stack
  3294. * @param {string} key The key of the entry to check.
  3295. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3296. */
  3297. function stackHas(key) {
  3298. return this.__data__.has(key);
  3299. }
  3300. /**
  3301. * Sets the stack `key` to `value`.
  3302. *
  3303. * @private
  3304. * @name set
  3305. * @memberOf Stack
  3306. * @param {string} key The key of the value to set.
  3307. * @param {*} value The value to set.
  3308. * @returns {Object} Returns the stack cache instance.
  3309. */
  3310. function stackSet(key, value) {
  3311. var data = this.__data__;
  3312. if (data instanceof ListCache) {
  3313. var pairs = data.__data__;
  3314. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3315. pairs.push([key, value]);
  3316. this.size = ++data.size;
  3317. return this;
  3318. }
  3319. data = this.__data__ = new MapCache(pairs);
  3320. }
  3321. data.set(key, value);
  3322. this.size = data.size;
  3323. return this;
  3324. }
  3325. // Add methods to `Stack`.
  3326. Stack.prototype.clear = stackClear;
  3327. Stack.prototype['delete'] = stackDelete;
  3328. Stack.prototype.get = stackGet;
  3329. Stack.prototype.has = stackHas;
  3330. Stack.prototype.set = stackSet;
  3331. /*------------------------------------------------------------------------*/
  3332. /**
  3333. * Creates an array of the enumerable property names of the array-like `value`.
  3334. *
  3335. * @private
  3336. * @param {*} value The value to query.
  3337. * @param {boolean} inherited Specify returning inherited property names.
  3338. * @returns {Array} Returns the array of property names.
  3339. */
  3340. function arrayLikeKeys(value, inherited) {
  3341. var isArr = isArray(value),
  3342. isArg = !isArr && isArguments(value),
  3343. isBuff = !isArr && !isArg && isBuffer(value),
  3344. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3345. skipIndexes = isArr || isArg || isBuff || isType,
  3346. result = skipIndexes ? baseTimes(value.length, String) : [],
  3347. length = result.length;
  3348. for (var key in value) {
  3349. if ((inherited || hasOwnProperty.call(value, key)) &&
  3350. !(skipIndexes && (
  3351. // Safari 9 has enumerable `arguments.length` in strict mode.
  3352. key == 'length' ||
  3353. // Node.js 0.10 has enumerable non-index properties on buffers.
  3354. (isBuff && (key == 'offset' || key == 'parent')) ||
  3355. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3356. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3357. // Skip index properties.
  3358. isIndex(key, length)
  3359. ))) {
  3360. result.push(key);
  3361. }
  3362. }
  3363. return result;
  3364. }
  3365. /**
  3366. * A specialized version of `_.sample` for arrays.
  3367. *
  3368. * @private
  3369. * @param {Array} array The array to sample.
  3370. * @returns {*} Returns the random element.
  3371. */
  3372. function arraySample(array) {
  3373. var length = array.length;
  3374. return length ? array[baseRandom(0, length - 1)] : undefined;
  3375. }
  3376. /**
  3377. * A specialized version of `_.sampleSize` for arrays.
  3378. *
  3379. * @private
  3380. * @param {Array} array The array to sample.
  3381. * @param {number} n The number of elements to sample.
  3382. * @returns {Array} Returns the random elements.
  3383. */
  3384. function arraySampleSize(array, n) {
  3385. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3386. }
  3387. /**
  3388. * A specialized version of `_.shuffle` for arrays.
  3389. *
  3390. * @private
  3391. * @param {Array} array The array to shuffle.
  3392. * @returns {Array} Returns the new shuffled array.
  3393. */
  3394. function arrayShuffle(array) {
  3395. return shuffleSelf(copyArray(array));
  3396. }
  3397. /**
  3398. * This function is like `assignValue` except that it doesn't assign
  3399. * `undefined` values.
  3400. *
  3401. * @private
  3402. * @param {Object} object The object to modify.
  3403. * @param {string} key The key of the property to assign.
  3404. * @param {*} value The value to assign.
  3405. */
  3406. function assignMergeValue(object, key, value) {
  3407. if ((value !== undefined && !eq(object[key], value)) ||
  3408. (value === undefined && !(key in object))) {
  3409. baseAssignValue(object, key, value);
  3410. }
  3411. }
  3412. /**
  3413. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3414. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3415. * for equality comparisons.
  3416. *
  3417. * @private
  3418. * @param {Object} object The object to modify.
  3419. * @param {string} key The key of the property to assign.
  3420. * @param {*} value The value to assign.
  3421. */
  3422. function assignValue(object, key, value) {
  3423. var objValue = object[key];
  3424. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3425. (value === undefined && !(key in object))) {
  3426. baseAssignValue(object, key, value);
  3427. }
  3428. }
  3429. /**
  3430. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3431. *
  3432. * @private
  3433. * @param {Array} array The array to inspect.
  3434. * @param {*} key The key to search for.
  3435. * @returns {number} Returns the index of the matched value, else `-1`.
  3436. */
  3437. function assocIndexOf(array, key) {
  3438. var length = array.length;
  3439. while (length--) {
  3440. if (eq(array[length][0], key)) {
  3441. return length;
  3442. }
  3443. }
  3444. return -1;
  3445. }
  3446. /**
  3447. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3448. * by `iteratee` and values set by `setter`.
  3449. *
  3450. * @private
  3451. * @param {Array|Object} collection The collection to iterate over.
  3452. * @param {Function} setter The function to set `accumulator` values.
  3453. * @param {Function} iteratee The iteratee to transform keys.
  3454. * @param {Object} accumulator The initial aggregated object.
  3455. * @returns {Function} Returns `accumulator`.
  3456. */
  3457. function baseAggregator(collection, setter, iteratee, accumulator) {
  3458. baseEach(collection, function(value, key, collection) {
  3459. setter(accumulator, value, iteratee(value), collection);
  3460. });
  3461. return accumulator;
  3462. }
  3463. /**
  3464. * The base implementation of `_.assign` without support for multiple sources
  3465. * or `customizer` functions.
  3466. *
  3467. * @private
  3468. * @param {Object} object The destination object.
  3469. * @param {Object} source The source object.
  3470. * @returns {Object} Returns `object`.
  3471. */
  3472. function baseAssign(object, source) {
  3473. return object && copyObject(source, keys(source), object);
  3474. }
  3475. /**
  3476. * The base implementation of `_.assignIn` without support for multiple sources
  3477. * or `customizer` functions.
  3478. *
  3479. * @private
  3480. * @param {Object} object The destination object.
  3481. * @param {Object} source The source object.
  3482. * @returns {Object} Returns `object`.
  3483. */
  3484. function baseAssignIn(object, source) {
  3485. return object && copyObject(source, keysIn(source), object);
  3486. }
  3487. /**
  3488. * The base implementation of `assignValue` and `assignMergeValue` without
  3489. * value checks.
  3490. *
  3491. * @private
  3492. * @param {Object} object The object to modify.
  3493. * @param {string} key The key of the property to assign.
  3494. * @param {*} value The value to assign.
  3495. */
  3496. function baseAssignValue(object, key, value) {
  3497. if (key == '__proto__' && defineProperty) {
  3498. defineProperty(object, key, {
  3499. 'configurable': true,
  3500. 'enumerable': true,
  3501. 'value': value,
  3502. 'writable': true
  3503. });
  3504. } else {
  3505. object[key] = value;
  3506. }
  3507. }
  3508. /**
  3509. * The base implementation of `_.at` without support for individual paths.
  3510. *
  3511. * @private
  3512. * @param {Object} object The object to iterate over.
  3513. * @param {string[]} paths The property paths to pick.
  3514. * @returns {Array} Returns the picked elements.
  3515. */
  3516. function baseAt(object, paths) {
  3517. var index = -1,
  3518. length = paths.length,
  3519. result = Array(length),
  3520. skip = object == null;
  3521. while (++index < length) {
  3522. result[index] = skip ? undefined : get(object, paths[index]);
  3523. }
  3524. return result;
  3525. }
  3526. /**
  3527. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3528. *
  3529. * @private
  3530. * @param {number} number The number to clamp.
  3531. * @param {number} [lower] The lower bound.
  3532. * @param {number} upper The upper bound.
  3533. * @returns {number} Returns the clamped number.
  3534. */
  3535. function baseClamp(number, lower, upper) {
  3536. if (number === number) {
  3537. if (upper !== undefined) {
  3538. number = number <= upper ? number : upper;
  3539. }
  3540. if (lower !== undefined) {
  3541. number = number >= lower ? number : lower;
  3542. }
  3543. }
  3544. return number;
  3545. }
  3546. /**
  3547. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3548. * traversed objects.
  3549. *
  3550. * @private
  3551. * @param {*} value The value to clone.
  3552. * @param {boolean} bitmask The bitmask flags.
  3553. * 1 - Deep clone
  3554. * 2 - Flatten inherited properties
  3555. * 4 - Clone symbols
  3556. * @param {Function} [customizer] The function to customize cloning.
  3557. * @param {string} [key] The key of `value`.
  3558. * @param {Object} [object] The parent object of `value`.
  3559. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3560. * @returns {*} Returns the cloned value.
  3561. */
  3562. function baseClone(value, bitmask, customizer, key, object, stack) {
  3563. var result,
  3564. isDeep = bitmask & CLONE_DEEP_FLAG,
  3565. isFlat = bitmask & CLONE_FLAT_FLAG,
  3566. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3567. if (customizer) {
  3568. result = object ? customizer(value, key, object, stack) : customizer(value);
  3569. }
  3570. if (result !== undefined) {
  3571. return result;
  3572. }
  3573. if (!isObject(value)) {
  3574. return value;
  3575. }
  3576. var isArr = isArray(value);
  3577. if (isArr) {
  3578. result = initCloneArray(value);
  3579. if (!isDeep) {
  3580. return copyArray(value, result);
  3581. }
  3582. } else {
  3583. var tag = getTag(value),
  3584. isFunc = tag == funcTag || tag == genTag;
  3585. if (isBuffer(value)) {
  3586. return cloneBuffer(value, isDeep);
  3587. }
  3588. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3589. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3590. if (!isDeep) {
  3591. return isFlat
  3592. ? copySymbolsIn(value, baseAssignIn(result, value))
  3593. : copySymbols(value, baseAssign(result, value));
  3594. }
  3595. } else {
  3596. if (!cloneableTags[tag]) {
  3597. return object ? value : {};
  3598. }
  3599. result = initCloneByTag(value, tag, isDeep);
  3600. }
  3601. }
  3602. // Check for circular references and return its corresponding clone.
  3603. stack || (stack = new Stack);
  3604. var stacked = stack.get(value);
  3605. if (stacked) {
  3606. return stacked;
  3607. }
  3608. stack.set(value, result);
  3609. if (isSet(value)) {
  3610. value.forEach(function(subValue) {
  3611. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3612. });
  3613. } else if (isMap(value)) {
  3614. value.forEach(function(subValue, key) {
  3615. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3616. });
  3617. }
  3618. var keysFunc = isFull
  3619. ? (isFlat ? getAllKeysIn : getAllKeys)
  3620. : (isFlat ? keysIn : keys);
  3621. var props = isArr ? undefined : keysFunc(value);
  3622. arrayEach(props || value, function(subValue, key) {
  3623. if (props) {
  3624. key = subValue;
  3625. subValue = value[key];
  3626. }
  3627. // Recursively populate clone (susceptible to call stack limits).
  3628. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3629. });
  3630. return result;
  3631. }
  3632. /**
  3633. * The base implementation of `_.conforms` which doesn't clone `source`.
  3634. *
  3635. * @private
  3636. * @param {Object} source The object of property predicates to conform to.
  3637. * @returns {Function} Returns the new spec function.
  3638. */
  3639. function baseConforms(source) {
  3640. var props = keys(source);
  3641. return function(object) {
  3642. return baseConformsTo(object, source, props);
  3643. };
  3644. }
  3645. /**
  3646. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3647. *
  3648. * @private
  3649. * @param {Object} object The object to inspect.
  3650. * @param {Object} source The object of property predicates to conform to.
  3651. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3652. */
  3653. function baseConformsTo(object, source, props) {
  3654. var length = props.length;
  3655. if (object == null) {
  3656. return !length;
  3657. }
  3658. object = Object(object);
  3659. while (length--) {
  3660. var key = props[length],
  3661. predicate = source[key],
  3662. value = object[key];
  3663. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3664. return false;
  3665. }
  3666. }
  3667. return true;
  3668. }
  3669. /**
  3670. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3671. * to provide to `func`.
  3672. *
  3673. * @private
  3674. * @param {Function} func The function to delay.
  3675. * @param {number} wait The number of milliseconds to delay invocation.
  3676. * @param {Array} args The arguments to provide to `func`.
  3677. * @returns {number|Object} Returns the timer id or timeout object.
  3678. */
  3679. function baseDelay(func, wait, args) {
  3680. if (typeof func != 'function') {
  3681. throw new TypeError(FUNC_ERROR_TEXT);
  3682. }
  3683. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3684. }
  3685. /**
  3686. * The base implementation of methods like `_.difference` without support
  3687. * for excluding multiple arrays or iteratee shorthands.
  3688. *
  3689. * @private
  3690. * @param {Array} array The array to inspect.
  3691. * @param {Array} values The values to exclude.
  3692. * @param {Function} [iteratee] The iteratee invoked per element.
  3693. * @param {Function} [comparator] The comparator invoked per element.
  3694. * @returns {Array} Returns the new array of filtered values.
  3695. */
  3696. function baseDifference(array, values, iteratee, comparator) {
  3697. var index = -1,
  3698. includes = arrayIncludes,
  3699. isCommon = true,
  3700. length = array.length,
  3701. result = [],
  3702. valuesLength = values.length;
  3703. if (!length) {
  3704. return result;
  3705. }
  3706. if (iteratee) {
  3707. values = arrayMap(values, baseUnary(iteratee));
  3708. }
  3709. if (comparator) {
  3710. includes = arrayIncludesWith;
  3711. isCommon = false;
  3712. }
  3713. else if (values.length >= LARGE_ARRAY_SIZE) {
  3714. includes = cacheHas;
  3715. isCommon = false;
  3716. values = new SetCache(values);
  3717. }
  3718. outer:
  3719. while (++index < length) {
  3720. var value = array[index],
  3721. computed = iteratee == null ? value : iteratee(value);
  3722. value = (comparator || value !== 0) ? value : 0;
  3723. if (isCommon && computed === computed) {
  3724. var valuesIndex = valuesLength;
  3725. while (valuesIndex--) {
  3726. if (values[valuesIndex] === computed) {
  3727. continue outer;
  3728. }
  3729. }
  3730. result.push(value);
  3731. }
  3732. else if (!includes(values, computed, comparator)) {
  3733. result.push(value);
  3734. }
  3735. }
  3736. return result;
  3737. }
  3738. /**
  3739. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3740. *
  3741. * @private
  3742. * @param {Array|Object} collection The collection to iterate over.
  3743. * @param {Function} iteratee The function invoked per iteration.
  3744. * @returns {Array|Object} Returns `collection`.
  3745. */
  3746. var baseEach = createBaseEach(baseForOwn);
  3747. /**
  3748. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3749. *
  3750. * @private
  3751. * @param {Array|Object} collection The collection to iterate over.
  3752. * @param {Function} iteratee The function invoked per iteration.
  3753. * @returns {Array|Object} Returns `collection`.
  3754. */
  3755. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3756. /**
  3757. * The base implementation of `_.every` without support for iteratee shorthands.
  3758. *
  3759. * @private
  3760. * @param {Array|Object} collection The collection to iterate over.
  3761. * @param {Function} predicate The function invoked per iteration.
  3762. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3763. * else `false`
  3764. */
  3765. function baseEvery(collection, predicate) {
  3766. var result = true;
  3767. baseEach(collection, function(value, index, collection) {
  3768. result = !!predicate(value, index, collection);
  3769. return result;
  3770. });
  3771. return result;
  3772. }
  3773. /**
  3774. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3775. * `comparator` to determine the extremum value.
  3776. *
  3777. * @private
  3778. * @param {Array} array The array to iterate over.
  3779. * @param {Function} iteratee The iteratee invoked per iteration.
  3780. * @param {Function} comparator The comparator used to compare values.
  3781. * @returns {*} Returns the extremum value.
  3782. */
  3783. function baseExtremum(array, iteratee, comparator) {
  3784. var index = -1,
  3785. length = array.length;
  3786. while (++index < length) {
  3787. var value = array[index],
  3788. current = iteratee(value);
  3789. if (current != null && (computed === undefined
  3790. ? (current === current && !isSymbol(current))
  3791. : comparator(current, computed)
  3792. )) {
  3793. var computed = current,
  3794. result = value;
  3795. }
  3796. }
  3797. return result;
  3798. }
  3799. /**
  3800. * The base implementation of `_.fill` without an iteratee call guard.
  3801. *
  3802. * @private
  3803. * @param {Array} array The array to fill.
  3804. * @param {*} value The value to fill `array` with.
  3805. * @param {number} [start=0] The start position.
  3806. * @param {number} [end=array.length] The end position.
  3807. * @returns {Array} Returns `array`.
  3808. */
  3809. function baseFill(array, value, start, end) {
  3810. var length = array.length;
  3811. start = toInteger(start);
  3812. if (start < 0) {
  3813. start = -start > length ? 0 : (length + start);
  3814. }
  3815. end = (end === undefined || end > length) ? length : toInteger(end);
  3816. if (end < 0) {
  3817. end += length;
  3818. }
  3819. end = start > end ? 0 : toLength(end);
  3820. while (start < end) {
  3821. array[start++] = value;
  3822. }
  3823. return array;
  3824. }
  3825. /**
  3826. * The base implementation of `_.filter` without support for iteratee shorthands.
  3827. *
  3828. * @private
  3829. * @param {Array|Object} collection The collection to iterate over.
  3830. * @param {Function} predicate The function invoked per iteration.
  3831. * @returns {Array} Returns the new filtered array.
  3832. */
  3833. function baseFilter(collection, predicate) {
  3834. var result = [];
  3835. baseEach(collection, function(value, index, collection) {
  3836. if (predicate(value, index, collection)) {
  3837. result.push(value);
  3838. }
  3839. });
  3840. return result;
  3841. }
  3842. /**
  3843. * The base implementation of `_.flatten` with support for restricting flattening.
  3844. *
  3845. * @private
  3846. * @param {Array} array The array to flatten.
  3847. * @param {number} depth The maximum recursion depth.
  3848. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3849. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3850. * @param {Array} [result=[]] The initial result value.
  3851. * @returns {Array} Returns the new flattened array.
  3852. */
  3853. function baseFlatten(array, depth, predicate, isStrict, result) {
  3854. var index = -1,
  3855. length = array.length;
  3856. predicate || (predicate = isFlattenable);
  3857. result || (result = []);
  3858. while (++index < length) {
  3859. var value = array[index];
  3860. if (depth > 0 && predicate(value)) {
  3861. if (depth > 1) {
  3862. // Recursively flatten arrays (susceptible to call stack limits).
  3863. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3864. } else {
  3865. arrayPush(result, value);
  3866. }
  3867. } else if (!isStrict) {
  3868. result[result.length] = value;
  3869. }
  3870. }
  3871. return result;
  3872. }
  3873. /**
  3874. * The base implementation of `baseForOwn` which iterates over `object`
  3875. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3876. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3877. *
  3878. * @private
  3879. * @param {Object} object The object to iterate over.
  3880. * @param {Function} iteratee The function invoked per iteration.
  3881. * @param {Function} keysFunc The function to get the keys of `object`.
  3882. * @returns {Object} Returns `object`.
  3883. */
  3884. var baseFor = createBaseFor();
  3885. /**
  3886. * This function is like `baseFor` except that it iterates over properties
  3887. * in the opposite order.
  3888. *
  3889. * @private
  3890. * @param {Object} object The object to iterate over.
  3891. * @param {Function} iteratee The function invoked per iteration.
  3892. * @param {Function} keysFunc The function to get the keys of `object`.
  3893. * @returns {Object} Returns `object`.
  3894. */
  3895. var baseForRight = createBaseFor(true);
  3896. /**
  3897. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3898. *
  3899. * @private
  3900. * @param {Object} object The object to iterate over.
  3901. * @param {Function} iteratee The function invoked per iteration.
  3902. * @returns {Object} Returns `object`.
  3903. */
  3904. function baseForOwn(object, iteratee) {
  3905. return object && baseFor(object, iteratee, keys);
  3906. }
  3907. /**
  3908. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3909. *
  3910. * @private
  3911. * @param {Object} object The object to iterate over.
  3912. * @param {Function} iteratee The function invoked per iteration.
  3913. * @returns {Object} Returns `object`.
  3914. */
  3915. function baseForOwnRight(object, iteratee) {
  3916. return object && baseForRight(object, iteratee, keys);
  3917. }
  3918. /**
  3919. * The base implementation of `_.functions` which creates an array of
  3920. * `object` function property names filtered from `props`.
  3921. *
  3922. * @private
  3923. * @param {Object} object The object to inspect.
  3924. * @param {Array} props The property names to filter.
  3925. * @returns {Array} Returns the function names.
  3926. */
  3927. function baseFunctions(object, props) {
  3928. return arrayFilter(props, function(key) {
  3929. return isFunction(object[key]);
  3930. });
  3931. }
  3932. /**
  3933. * The base implementation of `_.get` without support for default values.
  3934. *
  3935. * @private
  3936. * @param {Object} object The object to query.
  3937. * @param {Array|string} path The path of the property to get.
  3938. * @returns {*} Returns the resolved value.
  3939. */
  3940. function baseGet(object, path) {
  3941. path = castPath(path, object);
  3942. var index = 0,
  3943. length = path.length;
  3944. while (object != null && index < length) {
  3945. object = object[toKey(path[index++])];
  3946. }
  3947. return (index && index == length) ? object : undefined;
  3948. }
  3949. /**
  3950. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3951. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3952. * symbols of `object`.
  3953. *
  3954. * @private
  3955. * @param {Object} object The object to query.
  3956. * @param {Function} keysFunc The function to get the keys of `object`.
  3957. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3958. * @returns {Array} Returns the array of property names and symbols.
  3959. */
  3960. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3961. var result = keysFunc(object);
  3962. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3963. }
  3964. /**
  3965. * The base implementation of `getTag` without fallbacks for buggy environments.
  3966. *
  3967. * @private
  3968. * @param {*} value The value to query.
  3969. * @returns {string} Returns the `toStringTag`.
  3970. */
  3971. function baseGetTag(value) {
  3972. if (value == null) {
  3973. return value === undefined ? undefinedTag : nullTag;
  3974. }
  3975. return (symToStringTag && symToStringTag in Object(value))
  3976. ? getRawTag(value)
  3977. : objectToString(value);
  3978. }
  3979. /**
  3980. * The base implementation of `_.gt` which doesn't coerce arguments.
  3981. *
  3982. * @private
  3983. * @param {*} value The value to compare.
  3984. * @param {*} other The other value to compare.
  3985. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3986. * else `false`.
  3987. */
  3988. function baseGt(value, other) {
  3989. return value > other;
  3990. }
  3991. /**
  3992. * The base implementation of `_.has` without support for deep paths.
  3993. *
  3994. * @private
  3995. * @param {Object} [object] The object to query.
  3996. * @param {Array|string} key The key to check.
  3997. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3998. */
  3999. function baseHas(object, key) {
  4000. return object != null && hasOwnProperty.call(object, key);
  4001. }
  4002. /**
  4003. * The base implementation of `_.hasIn` without support for deep paths.
  4004. *
  4005. * @private
  4006. * @param {Object} [object] The object to query.
  4007. * @param {Array|string} key The key to check.
  4008. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4009. */
  4010. function baseHasIn(object, key) {
  4011. return object != null && key in Object(object);
  4012. }
  4013. /**
  4014. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4015. *
  4016. * @private
  4017. * @param {number} number The number to check.
  4018. * @param {number} start The start of the range.
  4019. * @param {number} end The end of the range.
  4020. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4021. */
  4022. function baseInRange(number, start, end) {
  4023. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4024. }
  4025. /**
  4026. * The base implementation of methods like `_.intersection`, without support
  4027. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4028. *
  4029. * @private
  4030. * @param {Array} arrays The arrays to inspect.
  4031. * @param {Function} [iteratee] The iteratee invoked per element.
  4032. * @param {Function} [comparator] The comparator invoked per element.
  4033. * @returns {Array} Returns the new array of shared values.
  4034. */
  4035. function baseIntersection(arrays, iteratee, comparator) {
  4036. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4037. length = arrays[0].length,
  4038. othLength = arrays.length,
  4039. othIndex = othLength,
  4040. caches = Array(othLength),
  4041. maxLength = Infinity,
  4042. result = [];
  4043. while (othIndex--) {
  4044. var array = arrays[othIndex];
  4045. if (othIndex && iteratee) {
  4046. array = arrayMap(array, baseUnary(iteratee));
  4047. }
  4048. maxLength = nativeMin(array.length, maxLength);
  4049. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4050. ? new SetCache(othIndex && array)
  4051. : undefined;
  4052. }
  4053. array = arrays[0];
  4054. var index = -1,
  4055. seen = caches[0];
  4056. outer:
  4057. while (++index < length && result.length < maxLength) {
  4058. var value = array[index],
  4059. computed = iteratee ? iteratee(value) : value;
  4060. value = (comparator || value !== 0) ? value : 0;
  4061. if (!(seen
  4062. ? cacheHas(seen, computed)
  4063. : includes(result, computed, comparator)
  4064. )) {
  4065. othIndex = othLength;
  4066. while (--othIndex) {
  4067. var cache = caches[othIndex];
  4068. if (!(cache
  4069. ? cacheHas(cache, computed)
  4070. : includes(arrays[othIndex], computed, comparator))
  4071. ) {
  4072. continue outer;
  4073. }
  4074. }
  4075. if (seen) {
  4076. seen.push(computed);
  4077. }
  4078. result.push(value);
  4079. }
  4080. }
  4081. return result;
  4082. }
  4083. /**
  4084. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4085. * `object` with values transformed by `iteratee` and set by `setter`.
  4086. *
  4087. * @private
  4088. * @param {Object} object The object to iterate over.
  4089. * @param {Function} setter The function to set `accumulator` values.
  4090. * @param {Function} iteratee The iteratee to transform values.
  4091. * @param {Object} accumulator The initial inverted object.
  4092. * @returns {Function} Returns `accumulator`.
  4093. */
  4094. function baseInverter(object, setter, iteratee, accumulator) {
  4095. baseForOwn(object, function(value, key, object) {
  4096. setter(accumulator, iteratee(value), key, object);
  4097. });
  4098. return accumulator;
  4099. }
  4100. /**
  4101. * The base implementation of `_.invoke` without support for individual
  4102. * method arguments.
  4103. *
  4104. * @private
  4105. * @param {Object} object The object to query.
  4106. * @param {Array|string} path The path of the method to invoke.
  4107. * @param {Array} args The arguments to invoke the method with.
  4108. * @returns {*} Returns the result of the invoked method.
  4109. */
  4110. function baseInvoke(object, path, args) {
  4111. path = castPath(path, object);
  4112. object = parent(object, path);
  4113. var func = object == null ? object : object[toKey(last(path))];
  4114. return func == null ? undefined : apply(func, object, args);
  4115. }
  4116. /**
  4117. * The base implementation of `_.isArguments`.
  4118. *
  4119. * @private
  4120. * @param {*} value The value to check.
  4121. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4122. */
  4123. function baseIsArguments(value) {
  4124. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4125. }
  4126. /**
  4127. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4128. *
  4129. * @private
  4130. * @param {*} value The value to check.
  4131. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4132. */
  4133. function baseIsArrayBuffer(value) {
  4134. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4135. }
  4136. /**
  4137. * The base implementation of `_.isDate` without Node.js optimizations.
  4138. *
  4139. * @private
  4140. * @param {*} value The value to check.
  4141. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4142. */
  4143. function baseIsDate(value) {
  4144. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4145. }
  4146. /**
  4147. * The base implementation of `_.isEqual` which supports partial comparisons
  4148. * and tracks traversed objects.
  4149. *
  4150. * @private
  4151. * @param {*} value The value to compare.
  4152. * @param {*} other The other value to compare.
  4153. * @param {boolean} bitmask The bitmask flags.
  4154. * 1 - Unordered comparison
  4155. * 2 - Partial comparison
  4156. * @param {Function} [customizer] The function to customize comparisons.
  4157. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4158. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4159. */
  4160. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4161. if (value === other) {
  4162. return true;
  4163. }
  4164. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4165. return value !== value && other !== other;
  4166. }
  4167. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4168. }
  4169. /**
  4170. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4171. * deep comparisons and tracks traversed objects enabling objects with circular
  4172. * references to be compared.
  4173. *
  4174. * @private
  4175. * @param {Object} object The object to compare.
  4176. * @param {Object} other The other object to compare.
  4177. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4178. * @param {Function} customizer The function to customize comparisons.
  4179. * @param {Function} equalFunc The function to determine equivalents of values.
  4180. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4181. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4182. */
  4183. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4184. var objIsArr = isArray(object),
  4185. othIsArr = isArray(other),
  4186. objTag = objIsArr ? arrayTag : getTag(object),
  4187. othTag = othIsArr ? arrayTag : getTag(other);
  4188. objTag = objTag == argsTag ? objectTag : objTag;
  4189. othTag = othTag == argsTag ? objectTag : othTag;
  4190. var objIsObj = objTag == objectTag,
  4191. othIsObj = othTag == objectTag,
  4192. isSameTag = objTag == othTag;
  4193. if (isSameTag && isBuffer(object)) {
  4194. if (!isBuffer(other)) {
  4195. return false;
  4196. }
  4197. objIsArr = true;
  4198. objIsObj = false;
  4199. }
  4200. if (isSameTag && !objIsObj) {
  4201. stack || (stack = new Stack);
  4202. return (objIsArr || isTypedArray(object))
  4203. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4204. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4205. }
  4206. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4207. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4208. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4209. if (objIsWrapped || othIsWrapped) {
  4210. var objUnwrapped = objIsWrapped ? object.value() : object,
  4211. othUnwrapped = othIsWrapped ? other.value() : other;
  4212. stack || (stack = new Stack);
  4213. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4214. }
  4215. }
  4216. if (!isSameTag) {
  4217. return false;
  4218. }
  4219. stack || (stack = new Stack);
  4220. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4221. }
  4222. /**
  4223. * The base implementation of `_.isMap` without Node.js optimizations.
  4224. *
  4225. * @private
  4226. * @param {*} value The value to check.
  4227. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4228. */
  4229. function baseIsMap(value) {
  4230. return isObjectLike(value) && getTag(value) == mapTag;
  4231. }
  4232. /**
  4233. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4234. *
  4235. * @private
  4236. * @param {Object} object The object to inspect.
  4237. * @param {Object} source The object of property values to match.
  4238. * @param {Array} matchData The property names, values, and compare flags to match.
  4239. * @param {Function} [customizer] The function to customize comparisons.
  4240. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4241. */
  4242. function baseIsMatch(object, source, matchData, customizer) {
  4243. var index = matchData.length,
  4244. length = index,
  4245. noCustomizer = !customizer;
  4246. if (object == null) {
  4247. return !length;
  4248. }
  4249. object = Object(object);
  4250. while (index--) {
  4251. var data = matchData[index];
  4252. if ((noCustomizer && data[2])
  4253. ? data[1] !== object[data[0]]
  4254. : !(data[0] in object)
  4255. ) {
  4256. return false;
  4257. }
  4258. }
  4259. while (++index < length) {
  4260. data = matchData[index];
  4261. var key = data[0],
  4262. objValue = object[key],
  4263. srcValue = data[1];
  4264. if (noCustomizer && data[2]) {
  4265. if (objValue === undefined && !(key in object)) {
  4266. return false;
  4267. }
  4268. } else {
  4269. var stack = new Stack;
  4270. if (customizer) {
  4271. var result = customizer(objValue, srcValue, key, object, source, stack);
  4272. }
  4273. if (!(result === undefined
  4274. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4275. : result
  4276. )) {
  4277. return false;
  4278. }
  4279. }
  4280. }
  4281. return true;
  4282. }
  4283. /**
  4284. * The base implementation of `_.isNative` without bad shim checks.
  4285. *
  4286. * @private
  4287. * @param {*} value The value to check.
  4288. * @returns {boolean} Returns `true` if `value` is a native function,
  4289. * else `false`.
  4290. */
  4291. function baseIsNative(value) {
  4292. if (!isObject(value) || isMasked(value)) {
  4293. return false;
  4294. }
  4295. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4296. return pattern.test(toSource(value));
  4297. }
  4298. /**
  4299. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4300. *
  4301. * @private
  4302. * @param {*} value The value to check.
  4303. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4304. */
  4305. function baseIsRegExp(value) {
  4306. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4307. }
  4308. /**
  4309. * The base implementation of `_.isSet` without Node.js optimizations.
  4310. *
  4311. * @private
  4312. * @param {*} value The value to check.
  4313. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4314. */
  4315. function baseIsSet(value) {
  4316. return isObjectLike(value) && getTag(value) == setTag;
  4317. }
  4318. /**
  4319. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4320. *
  4321. * @private
  4322. * @param {*} value The value to check.
  4323. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4324. */
  4325. function baseIsTypedArray(value) {
  4326. return isObjectLike(value) &&
  4327. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4328. }
  4329. /**
  4330. * The base implementation of `_.iteratee`.
  4331. *
  4332. * @private
  4333. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4334. * @returns {Function} Returns the iteratee.
  4335. */
  4336. function baseIteratee(value) {
  4337. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4338. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4339. if (typeof value == 'function') {
  4340. return value;
  4341. }
  4342. if (value == null) {
  4343. return identity;
  4344. }
  4345. if (typeof value == 'object') {
  4346. return isArray(value)
  4347. ? baseMatchesProperty(value[0], value[1])
  4348. : baseMatches(value);
  4349. }
  4350. return property(value);
  4351. }
  4352. /**
  4353. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4354. *
  4355. * @private
  4356. * @param {Object} object The object to query.
  4357. * @returns {Array} Returns the array of property names.
  4358. */
  4359. function baseKeys(object) {
  4360. if (!isPrototype(object)) {
  4361. return nativeKeys(object);
  4362. }
  4363. var result = [];
  4364. for (var key in Object(object)) {
  4365. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4366. result.push(key);
  4367. }
  4368. }
  4369. return result;
  4370. }
  4371. /**
  4372. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4373. *
  4374. * @private
  4375. * @param {Object} object The object to query.
  4376. * @returns {Array} Returns the array of property names.
  4377. */
  4378. function baseKeysIn(object) {
  4379. if (!isObject(object)) {
  4380. return nativeKeysIn(object);
  4381. }
  4382. var isProto = isPrototype(object),
  4383. result = [];
  4384. for (var key in object) {
  4385. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4386. result.push(key);
  4387. }
  4388. }
  4389. return result;
  4390. }
  4391. /**
  4392. * The base implementation of `_.lt` which doesn't coerce arguments.
  4393. *
  4394. * @private
  4395. * @param {*} value The value to compare.
  4396. * @param {*} other The other value to compare.
  4397. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4398. * else `false`.
  4399. */
  4400. function baseLt(value, other) {
  4401. return value < other;
  4402. }
  4403. /**
  4404. * The base implementation of `_.map` without support for iteratee shorthands.
  4405. *
  4406. * @private
  4407. * @param {Array|Object} collection The collection to iterate over.
  4408. * @param {Function} iteratee The function invoked per iteration.
  4409. * @returns {Array} Returns the new mapped array.
  4410. */
  4411. function baseMap(collection, iteratee) {
  4412. var index = -1,
  4413. result = isArrayLike(collection) ? Array(collection.length) : [];
  4414. baseEach(collection, function(value, key, collection) {
  4415. result[++index] = iteratee(value, key, collection);
  4416. });
  4417. return result;
  4418. }
  4419. /**
  4420. * The base implementation of `_.matches` which doesn't clone `source`.
  4421. *
  4422. * @private
  4423. * @param {Object} source The object of property values to match.
  4424. * @returns {Function} Returns the new spec function.
  4425. */
  4426. function baseMatches(source) {
  4427. var matchData = getMatchData(source);
  4428. if (matchData.length == 1 && matchData[0][2]) {
  4429. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4430. }
  4431. return function(object) {
  4432. return object === source || baseIsMatch(object, source, matchData);
  4433. };
  4434. }
  4435. /**
  4436. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4437. *
  4438. * @private
  4439. * @param {string} path The path of the property to get.
  4440. * @param {*} srcValue The value to match.
  4441. * @returns {Function} Returns the new spec function.
  4442. */
  4443. function baseMatchesProperty(path, srcValue) {
  4444. if (isKey(path) && isStrictComparable(srcValue)) {
  4445. return matchesStrictComparable(toKey(path), srcValue);
  4446. }
  4447. return function(object) {
  4448. var objValue = get(object, path);
  4449. return (objValue === undefined && objValue === srcValue)
  4450. ? hasIn(object, path)
  4451. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4452. };
  4453. }
  4454. /**
  4455. * The base implementation of `_.merge` without support for multiple sources.
  4456. *
  4457. * @private
  4458. * @param {Object} object The destination object.
  4459. * @param {Object} source The source object.
  4460. * @param {number} srcIndex The index of `source`.
  4461. * @param {Function} [customizer] The function to customize merged values.
  4462. * @param {Object} [stack] Tracks traversed source values and their merged
  4463. * counterparts.
  4464. */
  4465. function baseMerge(object, source, srcIndex, customizer, stack) {
  4466. if (object === source) {
  4467. return;
  4468. }
  4469. baseFor(source, function(srcValue, key) {
  4470. stack || (stack = new Stack);
  4471. if (isObject(srcValue)) {
  4472. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4473. }
  4474. else {
  4475. var newValue = customizer
  4476. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4477. : undefined;
  4478. if (newValue === undefined) {
  4479. newValue = srcValue;
  4480. }
  4481. assignMergeValue(object, key, newValue);
  4482. }
  4483. }, keysIn);
  4484. }
  4485. /**
  4486. * A specialized version of `baseMerge` for arrays and objects which performs
  4487. * deep merges and tracks traversed objects enabling objects with circular
  4488. * references to be merged.
  4489. *
  4490. * @private
  4491. * @param {Object} object The destination object.
  4492. * @param {Object} source The source object.
  4493. * @param {string} key The key of the value to merge.
  4494. * @param {number} srcIndex The index of `source`.
  4495. * @param {Function} mergeFunc The function to merge values.
  4496. * @param {Function} [customizer] The function to customize assigned values.
  4497. * @param {Object} [stack] Tracks traversed source values and their merged
  4498. * counterparts.
  4499. */
  4500. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4501. var objValue = safeGet(object, key),
  4502. srcValue = safeGet(source, key),
  4503. stacked = stack.get(srcValue);
  4504. if (stacked) {
  4505. assignMergeValue(object, key, stacked);
  4506. return;
  4507. }
  4508. var newValue = customizer
  4509. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4510. : undefined;
  4511. var isCommon = newValue === undefined;
  4512. if (isCommon) {
  4513. var isArr = isArray(srcValue),
  4514. isBuff = !isArr && isBuffer(srcValue),
  4515. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4516. newValue = srcValue;
  4517. if (isArr || isBuff || isTyped) {
  4518. if (isArray(objValue)) {
  4519. newValue = objValue;
  4520. }
  4521. else if (isArrayLikeObject(objValue)) {
  4522. newValue = copyArray(objValue);
  4523. }
  4524. else if (isBuff) {
  4525. isCommon = false;
  4526. newValue = cloneBuffer(srcValue, true);
  4527. }
  4528. else if (isTyped) {
  4529. isCommon = false;
  4530. newValue = cloneTypedArray(srcValue, true);
  4531. }
  4532. else {
  4533. newValue = [];
  4534. }
  4535. }
  4536. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4537. newValue = objValue;
  4538. if (isArguments(objValue)) {
  4539. newValue = toPlainObject(objValue);
  4540. }
  4541. else if (!isObject(objValue) || isFunction(objValue)) {
  4542. newValue = initCloneObject(srcValue);
  4543. }
  4544. }
  4545. else {
  4546. isCommon = false;
  4547. }
  4548. }
  4549. if (isCommon) {
  4550. // Recursively merge objects and arrays (susceptible to call stack limits).
  4551. stack.set(srcValue, newValue);
  4552. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4553. stack['delete'](srcValue);
  4554. }
  4555. assignMergeValue(object, key, newValue);
  4556. }
  4557. /**
  4558. * The base implementation of `_.nth` which doesn't coerce arguments.
  4559. *
  4560. * @private
  4561. * @param {Array} array The array to query.
  4562. * @param {number} n The index of the element to return.
  4563. * @returns {*} Returns the nth element of `array`.
  4564. */
  4565. function baseNth(array, n) {
  4566. var length = array.length;
  4567. if (!length) {
  4568. return;
  4569. }
  4570. n += n < 0 ? length : 0;
  4571. return isIndex(n, length) ? array[n] : undefined;
  4572. }
  4573. /**
  4574. * The base implementation of `_.orderBy` without param guards.
  4575. *
  4576. * @private
  4577. * @param {Array|Object} collection The collection to iterate over.
  4578. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4579. * @param {string[]} orders The sort orders of `iteratees`.
  4580. * @returns {Array} Returns the new sorted array.
  4581. */
  4582. function baseOrderBy(collection, iteratees, orders) {
  4583. if (iteratees.length) {
  4584. iteratees = arrayMap(iteratees, function(iteratee) {
  4585. if (isArray(iteratee)) {
  4586. return function(value) {
  4587. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4588. }
  4589. }
  4590. return iteratee;
  4591. });
  4592. } else {
  4593. iteratees = [identity];
  4594. }
  4595. var index = -1;
  4596. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4597. var result = baseMap(collection, function(value, key, collection) {
  4598. var criteria = arrayMap(iteratees, function(iteratee) {
  4599. return iteratee(value);
  4600. });
  4601. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4602. });
  4603. return baseSortBy(result, function(object, other) {
  4604. return compareMultiple(object, other, orders);
  4605. });
  4606. }
  4607. /**
  4608. * The base implementation of `_.pick` without support for individual
  4609. * property identifiers.
  4610. *
  4611. * @private
  4612. * @param {Object} object The source object.
  4613. * @param {string[]} paths The property paths to pick.
  4614. * @returns {Object} Returns the new object.
  4615. */
  4616. function basePick(object, paths) {
  4617. return basePickBy(object, paths, function(value, path) {
  4618. return hasIn(object, path);
  4619. });
  4620. }
  4621. /**
  4622. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4623. *
  4624. * @private
  4625. * @param {Object} object The source object.
  4626. * @param {string[]} paths The property paths to pick.
  4627. * @param {Function} predicate The function invoked per property.
  4628. * @returns {Object} Returns the new object.
  4629. */
  4630. function basePickBy(object, paths, predicate) {
  4631. var index = -1,
  4632. length = paths.length,
  4633. result = {};
  4634. while (++index < length) {
  4635. var path = paths[index],
  4636. value = baseGet(object, path);
  4637. if (predicate(value, path)) {
  4638. baseSet(result, castPath(path, object), value);
  4639. }
  4640. }
  4641. return result;
  4642. }
  4643. /**
  4644. * A specialized version of `baseProperty` which supports deep paths.
  4645. *
  4646. * @private
  4647. * @param {Array|string} path The path of the property to get.
  4648. * @returns {Function} Returns the new accessor function.
  4649. */
  4650. function basePropertyDeep(path) {
  4651. return function(object) {
  4652. return baseGet(object, path);
  4653. };
  4654. }
  4655. /**
  4656. * The base implementation of `_.pullAllBy` without support for iteratee
  4657. * shorthands.
  4658. *
  4659. * @private
  4660. * @param {Array} array The array to modify.
  4661. * @param {Array} values The values to remove.
  4662. * @param {Function} [iteratee] The iteratee invoked per element.
  4663. * @param {Function} [comparator] The comparator invoked per element.
  4664. * @returns {Array} Returns `array`.
  4665. */
  4666. function basePullAll(array, values, iteratee, comparator) {
  4667. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4668. index = -1,
  4669. length = values.length,
  4670. seen = array;
  4671. if (array === values) {
  4672. values = copyArray(values);
  4673. }
  4674. if (iteratee) {
  4675. seen = arrayMap(array, baseUnary(iteratee));
  4676. }
  4677. while (++index < length) {
  4678. var fromIndex = 0,
  4679. value = values[index],
  4680. computed = iteratee ? iteratee(value) : value;
  4681. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4682. if (seen !== array) {
  4683. splice.call(seen, fromIndex, 1);
  4684. }
  4685. splice.call(array, fromIndex, 1);
  4686. }
  4687. }
  4688. return array;
  4689. }
  4690. /**
  4691. * The base implementation of `_.pullAt` without support for individual
  4692. * indexes or capturing the removed elements.
  4693. *
  4694. * @private
  4695. * @param {Array} array The array to modify.
  4696. * @param {number[]} indexes The indexes of elements to remove.
  4697. * @returns {Array} Returns `array`.
  4698. */
  4699. function basePullAt(array, indexes) {
  4700. var length = array ? indexes.length : 0,
  4701. lastIndex = length - 1;
  4702. while (length--) {
  4703. var index = indexes[length];
  4704. if (length == lastIndex || index !== previous) {
  4705. var previous = index;
  4706. if (isIndex(index)) {
  4707. splice.call(array, index, 1);
  4708. } else {
  4709. baseUnset(array, index);
  4710. }
  4711. }
  4712. }
  4713. return array;
  4714. }
  4715. /**
  4716. * The base implementation of `_.random` without support for returning
  4717. * floating-point numbers.
  4718. *
  4719. * @private
  4720. * @param {number} lower The lower bound.
  4721. * @param {number} upper The upper bound.
  4722. * @returns {number} Returns the random number.
  4723. */
  4724. function baseRandom(lower, upper) {
  4725. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4726. }
  4727. /**
  4728. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4729. * coerce arguments.
  4730. *
  4731. * @private
  4732. * @param {number} start The start of the range.
  4733. * @param {number} end The end of the range.
  4734. * @param {number} step The value to increment or decrement by.
  4735. * @param {boolean} [fromRight] Specify iterating from right to left.
  4736. * @returns {Array} Returns the range of numbers.
  4737. */
  4738. function baseRange(start, end, step, fromRight) {
  4739. var index = -1,
  4740. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4741. result = Array(length);
  4742. while (length--) {
  4743. result[fromRight ? length : ++index] = start;
  4744. start += step;
  4745. }
  4746. return result;
  4747. }
  4748. /**
  4749. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4750. *
  4751. * @private
  4752. * @param {string} string The string to repeat.
  4753. * @param {number} n The number of times to repeat the string.
  4754. * @returns {string} Returns the repeated string.
  4755. */
  4756. function baseRepeat(string, n) {
  4757. var result = '';
  4758. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4759. return result;
  4760. }
  4761. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4762. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4763. do {
  4764. if (n % 2) {
  4765. result += string;
  4766. }
  4767. n = nativeFloor(n / 2);
  4768. if (n) {
  4769. string += string;
  4770. }
  4771. } while (n);
  4772. return result;
  4773. }
  4774. /**
  4775. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4776. *
  4777. * @private
  4778. * @param {Function} func The function to apply a rest parameter to.
  4779. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4780. * @returns {Function} Returns the new function.
  4781. */
  4782. function baseRest(func, start) {
  4783. return setToString(overRest(func, start, identity), func + '');
  4784. }
  4785. /**
  4786. * The base implementation of `_.sample`.
  4787. *
  4788. * @private
  4789. * @param {Array|Object} collection The collection to sample.
  4790. * @returns {*} Returns the random element.
  4791. */
  4792. function baseSample(collection) {
  4793. return arraySample(values(collection));
  4794. }
  4795. /**
  4796. * The base implementation of `_.sampleSize` without param guards.
  4797. *
  4798. * @private
  4799. * @param {Array|Object} collection The collection to sample.
  4800. * @param {number} n The number of elements to sample.
  4801. * @returns {Array} Returns the random elements.
  4802. */
  4803. function baseSampleSize(collection, n) {
  4804. var array = values(collection);
  4805. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4806. }
  4807. /**
  4808. * The base implementation of `_.set`.
  4809. *
  4810. * @private
  4811. * @param {Object} object The object to modify.
  4812. * @param {Array|string} path The path of the property to set.
  4813. * @param {*} value The value to set.
  4814. * @param {Function} [customizer] The function to customize path creation.
  4815. * @returns {Object} Returns `object`.
  4816. */
  4817. function baseSet(object, path, value, customizer) {
  4818. if (!isObject(object)) {
  4819. return object;
  4820. }
  4821. path = castPath(path, object);
  4822. var index = -1,
  4823. length = path.length,
  4824. lastIndex = length - 1,
  4825. nested = object;
  4826. while (nested != null && ++index < length) {
  4827. var key = toKey(path[index]),
  4828. newValue = value;
  4829. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4830. return object;
  4831. }
  4832. if (index != lastIndex) {
  4833. var objValue = nested[key];
  4834. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4835. if (newValue === undefined) {
  4836. newValue = isObject(objValue)
  4837. ? objValue
  4838. : (isIndex(path[index + 1]) ? [] : {});
  4839. }
  4840. }
  4841. assignValue(nested, key, newValue);
  4842. nested = nested[key];
  4843. }
  4844. return object;
  4845. }
  4846. /**
  4847. * The base implementation of `setData` without support for hot loop shorting.
  4848. *
  4849. * @private
  4850. * @param {Function} func The function to associate metadata with.
  4851. * @param {*} data The metadata.
  4852. * @returns {Function} Returns `func`.
  4853. */
  4854. var baseSetData = !metaMap ? identity : function(func, data) {
  4855. metaMap.set(func, data);
  4856. return func;
  4857. };
  4858. /**
  4859. * The base implementation of `setToString` without support for hot loop shorting.
  4860. *
  4861. * @private
  4862. * @param {Function} func The function to modify.
  4863. * @param {Function} string The `toString` result.
  4864. * @returns {Function} Returns `func`.
  4865. */
  4866. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4867. return defineProperty(func, 'toString', {
  4868. 'configurable': true,
  4869. 'enumerable': false,
  4870. 'value': constant(string),
  4871. 'writable': true
  4872. });
  4873. };
  4874. /**
  4875. * The base implementation of `_.shuffle`.
  4876. *
  4877. * @private
  4878. * @param {Array|Object} collection The collection to shuffle.
  4879. * @returns {Array} Returns the new shuffled array.
  4880. */
  4881. function baseShuffle(collection) {
  4882. return shuffleSelf(values(collection));
  4883. }
  4884. /**
  4885. * The base implementation of `_.slice` without an iteratee call guard.
  4886. *
  4887. * @private
  4888. * @param {Array} array The array to slice.
  4889. * @param {number} [start=0] The start position.
  4890. * @param {number} [end=array.length] The end position.
  4891. * @returns {Array} Returns the slice of `array`.
  4892. */
  4893. function baseSlice(array, start, end) {
  4894. var index = -1,
  4895. length = array.length;
  4896. if (start < 0) {
  4897. start = -start > length ? 0 : (length + start);
  4898. }
  4899. end = end > length ? length : end;
  4900. if (end < 0) {
  4901. end += length;
  4902. }
  4903. length = start > end ? 0 : ((end - start) >>> 0);
  4904. start >>>= 0;
  4905. var result = Array(length);
  4906. while (++index < length) {
  4907. result[index] = array[index + start];
  4908. }
  4909. return result;
  4910. }
  4911. /**
  4912. * The base implementation of `_.some` without support for iteratee shorthands.
  4913. *
  4914. * @private
  4915. * @param {Array|Object} collection The collection to iterate over.
  4916. * @param {Function} predicate The function invoked per iteration.
  4917. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4918. * else `false`.
  4919. */
  4920. function baseSome(collection, predicate) {
  4921. var result;
  4922. baseEach(collection, function(value, index, collection) {
  4923. result = predicate(value, index, collection);
  4924. return !result;
  4925. });
  4926. return !!result;
  4927. }
  4928. /**
  4929. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4930. * performs a binary search of `array` to determine the index at which `value`
  4931. * should be inserted into `array` in order to maintain its sort order.
  4932. *
  4933. * @private
  4934. * @param {Array} array The sorted array to inspect.
  4935. * @param {*} value The value to evaluate.
  4936. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4937. * @returns {number} Returns the index at which `value` should be inserted
  4938. * into `array`.
  4939. */
  4940. function baseSortedIndex(array, value, retHighest) {
  4941. var low = 0,
  4942. high = array == null ? low : array.length;
  4943. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4944. while (low < high) {
  4945. var mid = (low + high) >>> 1,
  4946. computed = array[mid];
  4947. if (computed !== null && !isSymbol(computed) &&
  4948. (retHighest ? (computed <= value) : (computed < value))) {
  4949. low = mid + 1;
  4950. } else {
  4951. high = mid;
  4952. }
  4953. }
  4954. return high;
  4955. }
  4956. return baseSortedIndexBy(array, value, identity, retHighest);
  4957. }
  4958. /**
  4959. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4960. * which invokes `iteratee` for `value` and each element of `array` to compute
  4961. * their sort ranking. The iteratee is invoked with one argument; (value).
  4962. *
  4963. * @private
  4964. * @param {Array} array The sorted array to inspect.
  4965. * @param {*} value The value to evaluate.
  4966. * @param {Function} iteratee The iteratee invoked per element.
  4967. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4968. * @returns {number} Returns the index at which `value` should be inserted
  4969. * into `array`.
  4970. */
  4971. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4972. var low = 0,
  4973. high = array == null ? 0 : array.length;
  4974. if (high === 0) {
  4975. return 0;
  4976. }
  4977. value = iteratee(value);
  4978. var valIsNaN = value !== value,
  4979. valIsNull = value === null,
  4980. valIsSymbol = isSymbol(value),
  4981. valIsUndefined = value === undefined;
  4982. while (low < high) {
  4983. var mid = nativeFloor((low + high) / 2),
  4984. computed = iteratee(array[mid]),
  4985. othIsDefined = computed !== undefined,
  4986. othIsNull = computed === null,
  4987. othIsReflexive = computed === computed,
  4988. othIsSymbol = isSymbol(computed);
  4989. if (valIsNaN) {
  4990. var setLow = retHighest || othIsReflexive;
  4991. } else if (valIsUndefined) {
  4992. setLow = othIsReflexive && (retHighest || othIsDefined);
  4993. } else if (valIsNull) {
  4994. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4995. } else if (valIsSymbol) {
  4996. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4997. } else if (othIsNull || othIsSymbol) {
  4998. setLow = false;
  4999. } else {
  5000. setLow = retHighest ? (computed <= value) : (computed < value);
  5001. }
  5002. if (setLow) {
  5003. low = mid + 1;
  5004. } else {
  5005. high = mid;
  5006. }
  5007. }
  5008. return nativeMin(high, MAX_ARRAY_INDEX);
  5009. }
  5010. /**
  5011. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5012. * support for iteratee shorthands.
  5013. *
  5014. * @private
  5015. * @param {Array} array The array to inspect.
  5016. * @param {Function} [iteratee] The iteratee invoked per element.
  5017. * @returns {Array} Returns the new duplicate free array.
  5018. */
  5019. function baseSortedUniq(array, iteratee) {
  5020. var index = -1,
  5021. length = array.length,
  5022. resIndex = 0,
  5023. result = [];
  5024. while (++index < length) {
  5025. var value = array[index],
  5026. computed = iteratee ? iteratee(value) : value;
  5027. if (!index || !eq(computed, seen)) {
  5028. var seen = computed;
  5029. result[resIndex++] = value === 0 ? 0 : value;
  5030. }
  5031. }
  5032. return result;
  5033. }
  5034. /**
  5035. * The base implementation of `_.toNumber` which doesn't ensure correct
  5036. * conversions of binary, hexadecimal, or octal string values.
  5037. *
  5038. * @private
  5039. * @param {*} value The value to process.
  5040. * @returns {number} Returns the number.
  5041. */
  5042. function baseToNumber(value) {
  5043. if (typeof value == 'number') {
  5044. return value;
  5045. }
  5046. if (isSymbol(value)) {
  5047. return NAN;
  5048. }
  5049. return +value;
  5050. }
  5051. /**
  5052. * The base implementation of `_.toString` which doesn't convert nullish
  5053. * values to empty strings.
  5054. *
  5055. * @private
  5056. * @param {*} value The value to process.
  5057. * @returns {string} Returns the string.
  5058. */
  5059. function baseToString(value) {
  5060. // Exit early for strings to avoid a performance hit in some environments.
  5061. if (typeof value == 'string') {
  5062. return value;
  5063. }
  5064. if (isArray(value)) {
  5065. // Recursively convert values (susceptible to call stack limits).
  5066. return arrayMap(value, baseToString) + '';
  5067. }
  5068. if (isSymbol(value)) {
  5069. return symbolToString ? symbolToString.call(value) : '';
  5070. }
  5071. var result = (value + '');
  5072. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5073. }
  5074. /**
  5075. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5076. *
  5077. * @private
  5078. * @param {Array} array The array to inspect.
  5079. * @param {Function} [iteratee] The iteratee invoked per element.
  5080. * @param {Function} [comparator] The comparator invoked per element.
  5081. * @returns {Array} Returns the new duplicate free array.
  5082. */
  5083. function baseUniq(array, iteratee, comparator) {
  5084. var index = -1,
  5085. includes = arrayIncludes,
  5086. length = array.length,
  5087. isCommon = true,
  5088. result = [],
  5089. seen = result;
  5090. if (comparator) {
  5091. isCommon = false;
  5092. includes = arrayIncludesWith;
  5093. }
  5094. else if (length >= LARGE_ARRAY_SIZE) {
  5095. var set = iteratee ? null : createSet(array);
  5096. if (set) {
  5097. return setToArray(set);
  5098. }
  5099. isCommon = false;
  5100. includes = cacheHas;
  5101. seen = new SetCache;
  5102. }
  5103. else {
  5104. seen = iteratee ? [] : result;
  5105. }
  5106. outer:
  5107. while (++index < length) {
  5108. var value = array[index],
  5109. computed = iteratee ? iteratee(value) : value;
  5110. value = (comparator || value !== 0) ? value : 0;
  5111. if (isCommon && computed === computed) {
  5112. var seenIndex = seen.length;
  5113. while (seenIndex--) {
  5114. if (seen[seenIndex] === computed) {
  5115. continue outer;
  5116. }
  5117. }
  5118. if (iteratee) {
  5119. seen.push(computed);
  5120. }
  5121. result.push(value);
  5122. }
  5123. else if (!includes(seen, computed, comparator)) {
  5124. if (seen !== result) {
  5125. seen.push(computed);
  5126. }
  5127. result.push(value);
  5128. }
  5129. }
  5130. return result;
  5131. }
  5132. /**
  5133. * The base implementation of `_.unset`.
  5134. *
  5135. * @private
  5136. * @param {Object} object The object to modify.
  5137. * @param {Array|string} path The property path to unset.
  5138. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5139. */
  5140. function baseUnset(object, path) {
  5141. path = castPath(path, object);
  5142. object = parent(object, path);
  5143. return object == null || delete object[toKey(last(path))];
  5144. }
  5145. /**
  5146. * The base implementation of `_.update`.
  5147. *
  5148. * @private
  5149. * @param {Object} object The object to modify.
  5150. * @param {Array|string} path The path of the property to update.
  5151. * @param {Function} updater The function to produce the updated value.
  5152. * @param {Function} [customizer] The function to customize path creation.
  5153. * @returns {Object} Returns `object`.
  5154. */
  5155. function baseUpdate(object, path, updater, customizer) {
  5156. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5157. }
  5158. /**
  5159. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5160. * without support for iteratee shorthands.
  5161. *
  5162. * @private
  5163. * @param {Array} array The array to query.
  5164. * @param {Function} predicate The function invoked per iteration.
  5165. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5166. * @param {boolean} [fromRight] Specify iterating from right to left.
  5167. * @returns {Array} Returns the slice of `array`.
  5168. */
  5169. function baseWhile(array, predicate, isDrop, fromRight) {
  5170. var length = array.length,
  5171. index = fromRight ? length : -1;
  5172. while ((fromRight ? index-- : ++index < length) &&
  5173. predicate(array[index], index, array)) {}
  5174. return isDrop
  5175. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5176. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5177. }
  5178. /**
  5179. * The base implementation of `wrapperValue` which returns the result of
  5180. * performing a sequence of actions on the unwrapped `value`, where each
  5181. * successive action is supplied the return value of the previous.
  5182. *
  5183. * @private
  5184. * @param {*} value The unwrapped value.
  5185. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5186. * @returns {*} Returns the resolved value.
  5187. */
  5188. function baseWrapperValue(value, actions) {
  5189. var result = value;
  5190. if (result instanceof LazyWrapper) {
  5191. result = result.value();
  5192. }
  5193. return arrayReduce(actions, function(result, action) {
  5194. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5195. }, result);
  5196. }
  5197. /**
  5198. * The base implementation of methods like `_.xor`, without support for
  5199. * iteratee shorthands, that accepts an array of arrays to inspect.
  5200. *
  5201. * @private
  5202. * @param {Array} arrays The arrays to inspect.
  5203. * @param {Function} [iteratee] The iteratee invoked per element.
  5204. * @param {Function} [comparator] The comparator invoked per element.
  5205. * @returns {Array} Returns the new array of values.
  5206. */
  5207. function baseXor(arrays, iteratee, comparator) {
  5208. var length = arrays.length;
  5209. if (length < 2) {
  5210. return length ? baseUniq(arrays[0]) : [];
  5211. }
  5212. var index = -1,
  5213. result = Array(length);
  5214. while (++index < length) {
  5215. var array = arrays[index],
  5216. othIndex = -1;
  5217. while (++othIndex < length) {
  5218. if (othIndex != index) {
  5219. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5220. }
  5221. }
  5222. }
  5223. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5224. }
  5225. /**
  5226. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5227. *
  5228. * @private
  5229. * @param {Array} props The property identifiers.
  5230. * @param {Array} values The property values.
  5231. * @param {Function} assignFunc The function to assign values.
  5232. * @returns {Object} Returns the new object.
  5233. */
  5234. function baseZipObject(props, values, assignFunc) {
  5235. var index = -1,
  5236. length = props.length,
  5237. valsLength = values.length,
  5238. result = {};
  5239. while (++index < length) {
  5240. var value = index < valsLength ? values[index] : undefined;
  5241. assignFunc(result, props[index], value);
  5242. }
  5243. return result;
  5244. }
  5245. /**
  5246. * Casts `value` to an empty array if it's not an array like object.
  5247. *
  5248. * @private
  5249. * @param {*} value The value to inspect.
  5250. * @returns {Array|Object} Returns the cast array-like object.
  5251. */
  5252. function castArrayLikeObject(value) {
  5253. return isArrayLikeObject(value) ? value : [];
  5254. }
  5255. /**
  5256. * Casts `value` to `identity` if it's not a function.
  5257. *
  5258. * @private
  5259. * @param {*} value The value to inspect.
  5260. * @returns {Function} Returns cast function.
  5261. */
  5262. function castFunction(value) {
  5263. return typeof value == 'function' ? value : identity;
  5264. }
  5265. /**
  5266. * Casts `value` to a path array if it's not one.
  5267. *
  5268. * @private
  5269. * @param {*} value The value to inspect.
  5270. * @param {Object} [object] The object to query keys on.
  5271. * @returns {Array} Returns the cast property path array.
  5272. */
  5273. function castPath(value, object) {
  5274. if (isArray(value)) {
  5275. return value;
  5276. }
  5277. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5278. }
  5279. /**
  5280. * A `baseRest` alias which can be replaced with `identity` by module
  5281. * replacement plugins.
  5282. *
  5283. * @private
  5284. * @type {Function}
  5285. * @param {Function} func The function to apply a rest parameter to.
  5286. * @returns {Function} Returns the new function.
  5287. */
  5288. var castRest = baseRest;
  5289. /**
  5290. * Casts `array` to a slice if it's needed.
  5291. *
  5292. * @private
  5293. * @param {Array} array The array to inspect.
  5294. * @param {number} start The start position.
  5295. * @param {number} [end=array.length] The end position.
  5296. * @returns {Array} Returns the cast slice.
  5297. */
  5298. function castSlice(array, start, end) {
  5299. var length = array.length;
  5300. end = end === undefined ? length : end;
  5301. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5302. }
  5303. /**
  5304. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5305. *
  5306. * @private
  5307. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5308. */
  5309. var clearTimeout = ctxClearTimeout || function(id) {
  5310. return root.clearTimeout(id);
  5311. };
  5312. /**
  5313. * Creates a clone of `buffer`.
  5314. *
  5315. * @private
  5316. * @param {Buffer} buffer The buffer to clone.
  5317. * @param {boolean} [isDeep] Specify a deep clone.
  5318. * @returns {Buffer} Returns the cloned buffer.
  5319. */
  5320. function cloneBuffer(buffer, isDeep) {
  5321. if (isDeep) {
  5322. return buffer.slice();
  5323. }
  5324. var length = buffer.length,
  5325. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5326. buffer.copy(result);
  5327. return result;
  5328. }
  5329. /**
  5330. * Creates a clone of `arrayBuffer`.
  5331. *
  5332. * @private
  5333. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5334. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5335. */
  5336. function cloneArrayBuffer(arrayBuffer) {
  5337. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5338. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5339. return result;
  5340. }
  5341. /**
  5342. * Creates a clone of `dataView`.
  5343. *
  5344. * @private
  5345. * @param {Object} dataView The data view to clone.
  5346. * @param {boolean} [isDeep] Specify a deep clone.
  5347. * @returns {Object} Returns the cloned data view.
  5348. */
  5349. function cloneDataView(dataView, isDeep) {
  5350. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5351. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5352. }
  5353. /**
  5354. * Creates a clone of `regexp`.
  5355. *
  5356. * @private
  5357. * @param {Object} regexp The regexp to clone.
  5358. * @returns {Object} Returns the cloned regexp.
  5359. */
  5360. function cloneRegExp(regexp) {
  5361. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5362. result.lastIndex = regexp.lastIndex;
  5363. return result;
  5364. }
  5365. /**
  5366. * Creates a clone of the `symbol` object.
  5367. *
  5368. * @private
  5369. * @param {Object} symbol The symbol object to clone.
  5370. * @returns {Object} Returns the cloned symbol object.
  5371. */
  5372. function cloneSymbol(symbol) {
  5373. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5374. }
  5375. /**
  5376. * Creates a clone of `typedArray`.
  5377. *
  5378. * @private
  5379. * @param {Object} typedArray The typed array to clone.
  5380. * @param {boolean} [isDeep] Specify a deep clone.
  5381. * @returns {Object} Returns the cloned typed array.
  5382. */
  5383. function cloneTypedArray(typedArray, isDeep) {
  5384. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5385. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5386. }
  5387. /**
  5388. * Compares values to sort them in ascending order.
  5389. *
  5390. * @private
  5391. * @param {*} value The value to compare.
  5392. * @param {*} other The other value to compare.
  5393. * @returns {number} Returns the sort order indicator for `value`.
  5394. */
  5395. function compareAscending(value, other) {
  5396. if (value !== other) {
  5397. var valIsDefined = value !== undefined,
  5398. valIsNull = value === null,
  5399. valIsReflexive = value === value,
  5400. valIsSymbol = isSymbol(value);
  5401. var othIsDefined = other !== undefined,
  5402. othIsNull = other === null,
  5403. othIsReflexive = other === other,
  5404. othIsSymbol = isSymbol(other);
  5405. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5406. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5407. (valIsNull && othIsDefined && othIsReflexive) ||
  5408. (!valIsDefined && othIsReflexive) ||
  5409. !valIsReflexive) {
  5410. return 1;
  5411. }
  5412. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5413. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5414. (othIsNull && valIsDefined && valIsReflexive) ||
  5415. (!othIsDefined && valIsReflexive) ||
  5416. !othIsReflexive) {
  5417. return -1;
  5418. }
  5419. }
  5420. return 0;
  5421. }
  5422. /**
  5423. * Used by `_.orderBy` to compare multiple properties of a value to another
  5424. * and stable sort them.
  5425. *
  5426. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5427. * specify an order of "desc" for descending or "asc" for ascending sort order
  5428. * of corresponding values.
  5429. *
  5430. * @private
  5431. * @param {Object} object The object to compare.
  5432. * @param {Object} other The other object to compare.
  5433. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5434. * @returns {number} Returns the sort order indicator for `object`.
  5435. */
  5436. function compareMultiple(object, other, orders) {
  5437. var index = -1,
  5438. objCriteria = object.criteria,
  5439. othCriteria = other.criteria,
  5440. length = objCriteria.length,
  5441. ordersLength = orders.length;
  5442. while (++index < length) {
  5443. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5444. if (result) {
  5445. if (index >= ordersLength) {
  5446. return result;
  5447. }
  5448. var order = orders[index];
  5449. return result * (order == 'desc' ? -1 : 1);
  5450. }
  5451. }
  5452. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5453. // that causes it, under certain circumstances, to provide the same value for
  5454. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5455. // for more details.
  5456. //
  5457. // This also ensures a stable sort in V8 and other engines.
  5458. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5459. return object.index - other.index;
  5460. }
  5461. /**
  5462. * Creates an array that is the composition of partially applied arguments,
  5463. * placeholders, and provided arguments into a single array of arguments.
  5464. *
  5465. * @private
  5466. * @param {Array} args The provided arguments.
  5467. * @param {Array} partials The arguments to prepend to those provided.
  5468. * @param {Array} holders The `partials` placeholder indexes.
  5469. * @params {boolean} [isCurried] Specify composing for a curried function.
  5470. * @returns {Array} Returns the new array of composed arguments.
  5471. */
  5472. function composeArgs(args, partials, holders, isCurried) {
  5473. var argsIndex = -1,
  5474. argsLength = args.length,
  5475. holdersLength = holders.length,
  5476. leftIndex = -1,
  5477. leftLength = partials.length,
  5478. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5479. result = Array(leftLength + rangeLength),
  5480. isUncurried = !isCurried;
  5481. while (++leftIndex < leftLength) {
  5482. result[leftIndex] = partials[leftIndex];
  5483. }
  5484. while (++argsIndex < holdersLength) {
  5485. if (isUncurried || argsIndex < argsLength) {
  5486. result[holders[argsIndex]] = args[argsIndex];
  5487. }
  5488. }
  5489. while (rangeLength--) {
  5490. result[leftIndex++] = args[argsIndex++];
  5491. }
  5492. return result;
  5493. }
  5494. /**
  5495. * This function is like `composeArgs` except that the arguments composition
  5496. * is tailored for `_.partialRight`.
  5497. *
  5498. * @private
  5499. * @param {Array} args The provided arguments.
  5500. * @param {Array} partials The arguments to append to those provided.
  5501. * @param {Array} holders The `partials` placeholder indexes.
  5502. * @params {boolean} [isCurried] Specify composing for a curried function.
  5503. * @returns {Array} Returns the new array of composed arguments.
  5504. */
  5505. function composeArgsRight(args, partials, holders, isCurried) {
  5506. var argsIndex = -1,
  5507. argsLength = args.length,
  5508. holdersIndex = -1,
  5509. holdersLength = holders.length,
  5510. rightIndex = -1,
  5511. rightLength = partials.length,
  5512. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5513. result = Array(rangeLength + rightLength),
  5514. isUncurried = !isCurried;
  5515. while (++argsIndex < rangeLength) {
  5516. result[argsIndex] = args[argsIndex];
  5517. }
  5518. var offset = argsIndex;
  5519. while (++rightIndex < rightLength) {
  5520. result[offset + rightIndex] = partials[rightIndex];
  5521. }
  5522. while (++holdersIndex < holdersLength) {
  5523. if (isUncurried || argsIndex < argsLength) {
  5524. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5525. }
  5526. }
  5527. return result;
  5528. }
  5529. /**
  5530. * Copies the values of `source` to `array`.
  5531. *
  5532. * @private
  5533. * @param {Array} source The array to copy values from.
  5534. * @param {Array} [array=[]] The array to copy values to.
  5535. * @returns {Array} Returns `array`.
  5536. */
  5537. function copyArray(source, array) {
  5538. var index = -1,
  5539. length = source.length;
  5540. array || (array = Array(length));
  5541. while (++index < length) {
  5542. array[index] = source[index];
  5543. }
  5544. return array;
  5545. }
  5546. /**
  5547. * Copies properties of `source` to `object`.
  5548. *
  5549. * @private
  5550. * @param {Object} source The object to copy properties from.
  5551. * @param {Array} props The property identifiers to copy.
  5552. * @param {Object} [object={}] The object to copy properties to.
  5553. * @param {Function} [customizer] The function to customize copied values.
  5554. * @returns {Object} Returns `object`.
  5555. */
  5556. function copyObject(source, props, object, customizer) {
  5557. var isNew = !object;
  5558. object || (object = {});
  5559. var index = -1,
  5560. length = props.length;
  5561. while (++index < length) {
  5562. var key = props[index];
  5563. var newValue = customizer
  5564. ? customizer(object[key], source[key], key, object, source)
  5565. : undefined;
  5566. if (newValue === undefined) {
  5567. newValue = source[key];
  5568. }
  5569. if (isNew) {
  5570. baseAssignValue(object, key, newValue);
  5571. } else {
  5572. assignValue(object, key, newValue);
  5573. }
  5574. }
  5575. return object;
  5576. }
  5577. /**
  5578. * Copies own symbols of `source` to `object`.
  5579. *
  5580. * @private
  5581. * @param {Object} source The object to copy symbols from.
  5582. * @param {Object} [object={}] The object to copy symbols to.
  5583. * @returns {Object} Returns `object`.
  5584. */
  5585. function copySymbols(source, object) {
  5586. return copyObject(source, getSymbols(source), object);
  5587. }
  5588. /**
  5589. * Copies own and inherited symbols of `source` to `object`.
  5590. *
  5591. * @private
  5592. * @param {Object} source The object to copy symbols from.
  5593. * @param {Object} [object={}] The object to copy symbols to.
  5594. * @returns {Object} Returns `object`.
  5595. */
  5596. function copySymbolsIn(source, object) {
  5597. return copyObject(source, getSymbolsIn(source), object);
  5598. }
  5599. /**
  5600. * Creates a function like `_.groupBy`.
  5601. *
  5602. * @private
  5603. * @param {Function} setter The function to set accumulator values.
  5604. * @param {Function} [initializer] The accumulator object initializer.
  5605. * @returns {Function} Returns the new aggregator function.
  5606. */
  5607. function createAggregator(setter, initializer) {
  5608. return function(collection, iteratee) {
  5609. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5610. accumulator = initializer ? initializer() : {};
  5611. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5612. };
  5613. }
  5614. /**
  5615. * Creates a function like `_.assign`.
  5616. *
  5617. * @private
  5618. * @param {Function} assigner The function to assign values.
  5619. * @returns {Function} Returns the new assigner function.
  5620. */
  5621. function createAssigner(assigner) {
  5622. return baseRest(function(object, sources) {
  5623. var index = -1,
  5624. length = sources.length,
  5625. customizer = length > 1 ? sources[length - 1] : undefined,
  5626. guard = length > 2 ? sources[2] : undefined;
  5627. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5628. ? (length--, customizer)
  5629. : undefined;
  5630. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5631. customizer = length < 3 ? undefined : customizer;
  5632. length = 1;
  5633. }
  5634. object = Object(object);
  5635. while (++index < length) {
  5636. var source = sources[index];
  5637. if (source) {
  5638. assigner(object, source, index, customizer);
  5639. }
  5640. }
  5641. return object;
  5642. });
  5643. }
  5644. /**
  5645. * Creates a `baseEach` or `baseEachRight` function.
  5646. *
  5647. * @private
  5648. * @param {Function} eachFunc The function to iterate over a collection.
  5649. * @param {boolean} [fromRight] Specify iterating from right to left.
  5650. * @returns {Function} Returns the new base function.
  5651. */
  5652. function createBaseEach(eachFunc, fromRight) {
  5653. return function(collection, iteratee) {
  5654. if (collection == null) {
  5655. return collection;
  5656. }
  5657. if (!isArrayLike(collection)) {
  5658. return eachFunc(collection, iteratee);
  5659. }
  5660. var length = collection.length,
  5661. index = fromRight ? length : -1,
  5662. iterable = Object(collection);
  5663. while ((fromRight ? index-- : ++index < length)) {
  5664. if (iteratee(iterable[index], index, iterable) === false) {
  5665. break;
  5666. }
  5667. }
  5668. return collection;
  5669. };
  5670. }
  5671. /**
  5672. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5673. *
  5674. * @private
  5675. * @param {boolean} [fromRight] Specify iterating from right to left.
  5676. * @returns {Function} Returns the new base function.
  5677. */
  5678. function createBaseFor(fromRight) {
  5679. return function(object, iteratee, keysFunc) {
  5680. var index = -1,
  5681. iterable = Object(object),
  5682. props = keysFunc(object),
  5683. length = props.length;
  5684. while (length--) {
  5685. var key = props[fromRight ? length : ++index];
  5686. if (iteratee(iterable[key], key, iterable) === false) {
  5687. break;
  5688. }
  5689. }
  5690. return object;
  5691. };
  5692. }
  5693. /**
  5694. * Creates a function that wraps `func` to invoke it with the optional `this`
  5695. * binding of `thisArg`.
  5696. *
  5697. * @private
  5698. * @param {Function} func The function to wrap.
  5699. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5700. * @param {*} [thisArg] The `this` binding of `func`.
  5701. * @returns {Function} Returns the new wrapped function.
  5702. */
  5703. function createBind(func, bitmask, thisArg) {
  5704. var isBind = bitmask & WRAP_BIND_FLAG,
  5705. Ctor = createCtor(func);
  5706. function wrapper() {
  5707. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5708. return fn.apply(isBind ? thisArg : this, arguments);
  5709. }
  5710. return wrapper;
  5711. }
  5712. /**
  5713. * Creates a function like `_.lowerFirst`.
  5714. *
  5715. * @private
  5716. * @param {string} methodName The name of the `String` case method to use.
  5717. * @returns {Function} Returns the new case function.
  5718. */
  5719. function createCaseFirst(methodName) {
  5720. return function(string) {
  5721. string = toString(string);
  5722. var strSymbols = hasUnicode(string)
  5723. ? stringToArray(string)
  5724. : undefined;
  5725. var chr = strSymbols
  5726. ? strSymbols[0]
  5727. : string.charAt(0);
  5728. var trailing = strSymbols
  5729. ? castSlice(strSymbols, 1).join('')
  5730. : string.slice(1);
  5731. return chr[methodName]() + trailing;
  5732. };
  5733. }
  5734. /**
  5735. * Creates a function like `_.camelCase`.
  5736. *
  5737. * @private
  5738. * @param {Function} callback The function to combine each word.
  5739. * @returns {Function} Returns the new compounder function.
  5740. */
  5741. function createCompounder(callback) {
  5742. return function(string) {
  5743. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5744. };
  5745. }
  5746. /**
  5747. * Creates a function that produces an instance of `Ctor` regardless of
  5748. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5749. *
  5750. * @private
  5751. * @param {Function} Ctor The constructor to wrap.
  5752. * @returns {Function} Returns the new wrapped function.
  5753. */
  5754. function createCtor(Ctor) {
  5755. return function() {
  5756. // Use a `switch` statement to work with class constructors. See
  5757. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5758. // for more details.
  5759. var args = arguments;
  5760. switch (args.length) {
  5761. case 0: return new Ctor;
  5762. case 1: return new Ctor(args[0]);
  5763. case 2: return new Ctor(args[0], args[1]);
  5764. case 3: return new Ctor(args[0], args[1], args[2]);
  5765. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5766. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5767. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5768. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5769. }
  5770. var thisBinding = baseCreate(Ctor.prototype),
  5771. result = Ctor.apply(thisBinding, args);
  5772. // Mimic the constructor's `return` behavior.
  5773. // See https://es5.github.io/#x13.2.2 for more details.
  5774. return isObject(result) ? result : thisBinding;
  5775. };
  5776. }
  5777. /**
  5778. * Creates a function that wraps `func` to enable currying.
  5779. *
  5780. * @private
  5781. * @param {Function} func The function to wrap.
  5782. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5783. * @param {number} arity The arity of `func`.
  5784. * @returns {Function} Returns the new wrapped function.
  5785. */
  5786. function createCurry(func, bitmask, arity) {
  5787. var Ctor = createCtor(func);
  5788. function wrapper() {
  5789. var length = arguments.length,
  5790. args = Array(length),
  5791. index = length,
  5792. placeholder = getHolder(wrapper);
  5793. while (index--) {
  5794. args[index] = arguments[index];
  5795. }
  5796. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5797. ? []
  5798. : replaceHolders(args, placeholder);
  5799. length -= holders.length;
  5800. if (length < arity) {
  5801. return createRecurry(
  5802. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5803. args, holders, undefined, undefined, arity - length);
  5804. }
  5805. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5806. return apply(fn, this, args);
  5807. }
  5808. return wrapper;
  5809. }
  5810. /**
  5811. * Creates a `_.find` or `_.findLast` function.
  5812. *
  5813. * @private
  5814. * @param {Function} findIndexFunc The function to find the collection index.
  5815. * @returns {Function} Returns the new find function.
  5816. */
  5817. function createFind(findIndexFunc) {
  5818. return function(collection, predicate, fromIndex) {
  5819. var iterable = Object(collection);
  5820. if (!isArrayLike(collection)) {
  5821. var iteratee = getIteratee(predicate, 3);
  5822. collection = keys(collection);
  5823. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5824. }
  5825. var index = findIndexFunc(collection, predicate, fromIndex);
  5826. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5827. };
  5828. }
  5829. /**
  5830. * Creates a `_.flow` or `_.flowRight` function.
  5831. *
  5832. * @private
  5833. * @param {boolean} [fromRight] Specify iterating from right to left.
  5834. * @returns {Function} Returns the new flow function.
  5835. */
  5836. function createFlow(fromRight) {
  5837. return flatRest(function(funcs) {
  5838. var length = funcs.length,
  5839. index = length,
  5840. prereq = LodashWrapper.prototype.thru;
  5841. if (fromRight) {
  5842. funcs.reverse();
  5843. }
  5844. while (index--) {
  5845. var func = funcs[index];
  5846. if (typeof func != 'function') {
  5847. throw new TypeError(FUNC_ERROR_TEXT);
  5848. }
  5849. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5850. var wrapper = new LodashWrapper([], true);
  5851. }
  5852. }
  5853. index = wrapper ? index : length;
  5854. while (++index < length) {
  5855. func = funcs[index];
  5856. var funcName = getFuncName(func),
  5857. data = funcName == 'wrapper' ? getData(func) : undefined;
  5858. if (data && isLaziable(data[0]) &&
  5859. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5860. !data[4].length && data[9] == 1
  5861. ) {
  5862. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5863. } else {
  5864. wrapper = (func.length == 1 && isLaziable(func))
  5865. ? wrapper[funcName]()
  5866. : wrapper.thru(func);
  5867. }
  5868. }
  5869. return function() {
  5870. var args = arguments,
  5871. value = args[0];
  5872. if (wrapper && args.length == 1 && isArray(value)) {
  5873. return wrapper.plant(value).value();
  5874. }
  5875. var index = 0,
  5876. result = length ? funcs[index].apply(this, args) : value;
  5877. while (++index < length) {
  5878. result = funcs[index].call(this, result);
  5879. }
  5880. return result;
  5881. };
  5882. });
  5883. }
  5884. /**
  5885. * Creates a function that wraps `func` to invoke it with optional `this`
  5886. * binding of `thisArg`, partial application, and currying.
  5887. *
  5888. * @private
  5889. * @param {Function|string} func The function or method name to wrap.
  5890. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5891. * @param {*} [thisArg] The `this` binding of `func`.
  5892. * @param {Array} [partials] The arguments to prepend to those provided to
  5893. * the new function.
  5894. * @param {Array} [holders] The `partials` placeholder indexes.
  5895. * @param {Array} [partialsRight] The arguments to append to those provided
  5896. * to the new function.
  5897. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5898. * @param {Array} [argPos] The argument positions of the new function.
  5899. * @param {number} [ary] The arity cap of `func`.
  5900. * @param {number} [arity] The arity of `func`.
  5901. * @returns {Function} Returns the new wrapped function.
  5902. */
  5903. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5904. var isAry = bitmask & WRAP_ARY_FLAG,
  5905. isBind = bitmask & WRAP_BIND_FLAG,
  5906. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5907. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5908. isFlip = bitmask & WRAP_FLIP_FLAG,
  5909. Ctor = isBindKey ? undefined : createCtor(func);
  5910. function wrapper() {
  5911. var length = arguments.length,
  5912. args = Array(length),
  5913. index = length;
  5914. while (index--) {
  5915. args[index] = arguments[index];
  5916. }
  5917. if (isCurried) {
  5918. var placeholder = getHolder(wrapper),
  5919. holdersCount = countHolders(args, placeholder);
  5920. }
  5921. if (partials) {
  5922. args = composeArgs(args, partials, holders, isCurried);
  5923. }
  5924. if (partialsRight) {
  5925. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5926. }
  5927. length -= holdersCount;
  5928. if (isCurried && length < arity) {
  5929. var newHolders = replaceHolders(args, placeholder);
  5930. return createRecurry(
  5931. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5932. args, newHolders, argPos, ary, arity - length
  5933. );
  5934. }
  5935. var thisBinding = isBind ? thisArg : this,
  5936. fn = isBindKey ? thisBinding[func] : func;
  5937. length = args.length;
  5938. if (argPos) {
  5939. args = reorder(args, argPos);
  5940. } else if (isFlip && length > 1) {
  5941. args.reverse();
  5942. }
  5943. if (isAry && ary < length) {
  5944. args.length = ary;
  5945. }
  5946. if (this && this !== root && this instanceof wrapper) {
  5947. fn = Ctor || createCtor(fn);
  5948. }
  5949. return fn.apply(thisBinding, args);
  5950. }
  5951. return wrapper;
  5952. }
  5953. /**
  5954. * Creates a function like `_.invertBy`.
  5955. *
  5956. * @private
  5957. * @param {Function} setter The function to set accumulator values.
  5958. * @param {Function} toIteratee The function to resolve iteratees.
  5959. * @returns {Function} Returns the new inverter function.
  5960. */
  5961. function createInverter(setter, toIteratee) {
  5962. return function(object, iteratee) {
  5963. return baseInverter(object, setter, toIteratee(iteratee), {});
  5964. };
  5965. }
  5966. /**
  5967. * Creates a function that performs a mathematical operation on two values.
  5968. *
  5969. * @private
  5970. * @param {Function} operator The function to perform the operation.
  5971. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5972. * @returns {Function} Returns the new mathematical operation function.
  5973. */
  5974. function createMathOperation(operator, defaultValue) {
  5975. return function(value, other) {
  5976. var result;
  5977. if (value === undefined && other === undefined) {
  5978. return defaultValue;
  5979. }
  5980. if (value !== undefined) {
  5981. result = value;
  5982. }
  5983. if (other !== undefined) {
  5984. if (result === undefined) {
  5985. return other;
  5986. }
  5987. if (typeof value == 'string' || typeof other == 'string') {
  5988. value = baseToString(value);
  5989. other = baseToString(other);
  5990. } else {
  5991. value = baseToNumber(value);
  5992. other = baseToNumber(other);
  5993. }
  5994. result = operator(value, other);
  5995. }
  5996. return result;
  5997. };
  5998. }
  5999. /**
  6000. * Creates a function like `_.over`.
  6001. *
  6002. * @private
  6003. * @param {Function} arrayFunc The function to iterate over iteratees.
  6004. * @returns {Function} Returns the new over function.
  6005. */
  6006. function createOver(arrayFunc) {
  6007. return flatRest(function(iteratees) {
  6008. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6009. return baseRest(function(args) {
  6010. var thisArg = this;
  6011. return arrayFunc(iteratees, function(iteratee) {
  6012. return apply(iteratee, thisArg, args);
  6013. });
  6014. });
  6015. });
  6016. }
  6017. /**
  6018. * Creates the padding for `string` based on `length`. The `chars` string
  6019. * is truncated if the number of characters exceeds `length`.
  6020. *
  6021. * @private
  6022. * @param {number} length The padding length.
  6023. * @param {string} [chars=' '] The string used as padding.
  6024. * @returns {string} Returns the padding for `string`.
  6025. */
  6026. function createPadding(length, chars) {
  6027. chars = chars === undefined ? ' ' : baseToString(chars);
  6028. var charsLength = chars.length;
  6029. if (charsLength < 2) {
  6030. return charsLength ? baseRepeat(chars, length) : chars;
  6031. }
  6032. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6033. return hasUnicode(chars)
  6034. ? castSlice(stringToArray(result), 0, length).join('')
  6035. : result.slice(0, length);
  6036. }
  6037. /**
  6038. * Creates a function that wraps `func` to invoke it with the `this` binding
  6039. * of `thisArg` and `partials` prepended to the arguments it receives.
  6040. *
  6041. * @private
  6042. * @param {Function} func The function to wrap.
  6043. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6044. * @param {*} thisArg The `this` binding of `func`.
  6045. * @param {Array} partials The arguments to prepend to those provided to
  6046. * the new function.
  6047. * @returns {Function} Returns the new wrapped function.
  6048. */
  6049. function createPartial(func, bitmask, thisArg, partials) {
  6050. var isBind = bitmask & WRAP_BIND_FLAG,
  6051. Ctor = createCtor(func);
  6052. function wrapper() {
  6053. var argsIndex = -1,
  6054. argsLength = arguments.length,
  6055. leftIndex = -1,
  6056. leftLength = partials.length,
  6057. args = Array(leftLength + argsLength),
  6058. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6059. while (++leftIndex < leftLength) {
  6060. args[leftIndex] = partials[leftIndex];
  6061. }
  6062. while (argsLength--) {
  6063. args[leftIndex++] = arguments[++argsIndex];
  6064. }
  6065. return apply(fn, isBind ? thisArg : this, args);
  6066. }
  6067. return wrapper;
  6068. }
  6069. /**
  6070. * Creates a `_.range` or `_.rangeRight` function.
  6071. *
  6072. * @private
  6073. * @param {boolean} [fromRight] Specify iterating from right to left.
  6074. * @returns {Function} Returns the new range function.
  6075. */
  6076. function createRange(fromRight) {
  6077. return function(start, end, step) {
  6078. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6079. end = step = undefined;
  6080. }
  6081. // Ensure the sign of `-0` is preserved.
  6082. start = toFinite(start);
  6083. if (end === undefined) {
  6084. end = start;
  6085. start = 0;
  6086. } else {
  6087. end = toFinite(end);
  6088. }
  6089. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6090. return baseRange(start, end, step, fromRight);
  6091. };
  6092. }
  6093. /**
  6094. * Creates a function that performs a relational operation on two values.
  6095. *
  6096. * @private
  6097. * @param {Function} operator The function to perform the operation.
  6098. * @returns {Function} Returns the new relational operation function.
  6099. */
  6100. function createRelationalOperation(operator) {
  6101. return function(value, other) {
  6102. if (!(typeof value == 'string' && typeof other == 'string')) {
  6103. value = toNumber(value);
  6104. other = toNumber(other);
  6105. }
  6106. return operator(value, other);
  6107. };
  6108. }
  6109. /**
  6110. * Creates a function that wraps `func` to continue currying.
  6111. *
  6112. * @private
  6113. * @param {Function} func The function to wrap.
  6114. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6115. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6116. * @param {*} placeholder The placeholder value.
  6117. * @param {*} [thisArg] The `this` binding of `func`.
  6118. * @param {Array} [partials] The arguments to prepend to those provided to
  6119. * the new function.
  6120. * @param {Array} [holders] The `partials` placeholder indexes.
  6121. * @param {Array} [argPos] The argument positions of the new function.
  6122. * @param {number} [ary] The arity cap of `func`.
  6123. * @param {number} [arity] The arity of `func`.
  6124. * @returns {Function} Returns the new wrapped function.
  6125. */
  6126. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6127. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6128. newHolders = isCurry ? holders : undefined,
  6129. newHoldersRight = isCurry ? undefined : holders,
  6130. newPartials = isCurry ? partials : undefined,
  6131. newPartialsRight = isCurry ? undefined : partials;
  6132. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6133. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6134. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6135. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6136. }
  6137. var newData = [
  6138. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6139. newHoldersRight, argPos, ary, arity
  6140. ];
  6141. var result = wrapFunc.apply(undefined, newData);
  6142. if (isLaziable(func)) {
  6143. setData(result, newData);
  6144. }
  6145. result.placeholder = placeholder;
  6146. return setWrapToString(result, func, bitmask);
  6147. }
  6148. /**
  6149. * Creates a function like `_.round`.
  6150. *
  6151. * @private
  6152. * @param {string} methodName The name of the `Math` method to use when rounding.
  6153. * @returns {Function} Returns the new round function.
  6154. */
  6155. function createRound(methodName) {
  6156. var func = Math[methodName];
  6157. return function(number, precision) {
  6158. number = toNumber(number);
  6159. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6160. if (precision && nativeIsFinite(number)) {
  6161. // Shift with exponential notation to avoid floating-point issues.
  6162. // See [MDN](https://mdn.io/round#Examples) for more details.
  6163. var pair = (toString(number) + 'e').split('e'),
  6164. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6165. pair = (toString(value) + 'e').split('e');
  6166. return +(pair[0] + 'e' + (+pair[1] - precision));
  6167. }
  6168. return func(number);
  6169. };
  6170. }
  6171. /**
  6172. * Creates a set object of `values`.
  6173. *
  6174. * @private
  6175. * @param {Array} values The values to add to the set.
  6176. * @returns {Object} Returns the new set.
  6177. */
  6178. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6179. return new Set(values);
  6180. };
  6181. /**
  6182. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6183. *
  6184. * @private
  6185. * @param {Function} keysFunc The function to get the keys of a given object.
  6186. * @returns {Function} Returns the new pairs function.
  6187. */
  6188. function createToPairs(keysFunc) {
  6189. return function(object) {
  6190. var tag = getTag(object);
  6191. if (tag == mapTag) {
  6192. return mapToArray(object);
  6193. }
  6194. if (tag == setTag) {
  6195. return setToPairs(object);
  6196. }
  6197. return baseToPairs(object, keysFunc(object));
  6198. };
  6199. }
  6200. /**
  6201. * Creates a function that either curries or invokes `func` with optional
  6202. * `this` binding and partially applied arguments.
  6203. *
  6204. * @private
  6205. * @param {Function|string} func The function or method name to wrap.
  6206. * @param {number} bitmask The bitmask flags.
  6207. * 1 - `_.bind`
  6208. * 2 - `_.bindKey`
  6209. * 4 - `_.curry` or `_.curryRight` of a bound function
  6210. * 8 - `_.curry`
  6211. * 16 - `_.curryRight`
  6212. * 32 - `_.partial`
  6213. * 64 - `_.partialRight`
  6214. * 128 - `_.rearg`
  6215. * 256 - `_.ary`
  6216. * 512 - `_.flip`
  6217. * @param {*} [thisArg] The `this` binding of `func`.
  6218. * @param {Array} [partials] The arguments to be partially applied.
  6219. * @param {Array} [holders] The `partials` placeholder indexes.
  6220. * @param {Array} [argPos] The argument positions of the new function.
  6221. * @param {number} [ary] The arity cap of `func`.
  6222. * @param {number} [arity] The arity of `func`.
  6223. * @returns {Function} Returns the new wrapped function.
  6224. */
  6225. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6226. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6227. if (!isBindKey && typeof func != 'function') {
  6228. throw new TypeError(FUNC_ERROR_TEXT);
  6229. }
  6230. var length = partials ? partials.length : 0;
  6231. if (!length) {
  6232. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6233. partials = holders = undefined;
  6234. }
  6235. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6236. arity = arity === undefined ? arity : toInteger(arity);
  6237. length -= holders ? holders.length : 0;
  6238. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6239. var partialsRight = partials,
  6240. holdersRight = holders;
  6241. partials = holders = undefined;
  6242. }
  6243. var data = isBindKey ? undefined : getData(func);
  6244. var newData = [
  6245. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6246. argPos, ary, arity
  6247. ];
  6248. if (data) {
  6249. mergeData(newData, data);
  6250. }
  6251. func = newData[0];
  6252. bitmask = newData[1];
  6253. thisArg = newData[2];
  6254. partials = newData[3];
  6255. holders = newData[4];
  6256. arity = newData[9] = newData[9] === undefined
  6257. ? (isBindKey ? 0 : func.length)
  6258. : nativeMax(newData[9] - length, 0);
  6259. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6260. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6261. }
  6262. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6263. var result = createBind(func, bitmask, thisArg);
  6264. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6265. result = createCurry(func, bitmask, arity);
  6266. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6267. result = createPartial(func, bitmask, thisArg, partials);
  6268. } else {
  6269. result = createHybrid.apply(undefined, newData);
  6270. }
  6271. var setter = data ? baseSetData : setData;
  6272. return setWrapToString(setter(result, newData), func, bitmask);
  6273. }
  6274. /**
  6275. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6276. * of source objects to the destination object for all destination properties
  6277. * that resolve to `undefined`.
  6278. *
  6279. * @private
  6280. * @param {*} objValue The destination value.
  6281. * @param {*} srcValue The source value.
  6282. * @param {string} key The key of the property to assign.
  6283. * @param {Object} object The parent object of `objValue`.
  6284. * @returns {*} Returns the value to assign.
  6285. */
  6286. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6287. if (objValue === undefined ||
  6288. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6289. return srcValue;
  6290. }
  6291. return objValue;
  6292. }
  6293. /**
  6294. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6295. * objects into destination objects that are passed thru.
  6296. *
  6297. * @private
  6298. * @param {*} objValue The destination value.
  6299. * @param {*} srcValue The source value.
  6300. * @param {string} key The key of the property to merge.
  6301. * @param {Object} object The parent object of `objValue`.
  6302. * @param {Object} source The parent object of `srcValue`.
  6303. * @param {Object} [stack] Tracks traversed source values and their merged
  6304. * counterparts.
  6305. * @returns {*} Returns the value to assign.
  6306. */
  6307. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6308. if (isObject(objValue) && isObject(srcValue)) {
  6309. // Recursively merge objects and arrays (susceptible to call stack limits).
  6310. stack.set(srcValue, objValue);
  6311. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6312. stack['delete'](srcValue);
  6313. }
  6314. return objValue;
  6315. }
  6316. /**
  6317. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6318. * objects.
  6319. *
  6320. * @private
  6321. * @param {*} value The value to inspect.
  6322. * @param {string} key The key of the property to inspect.
  6323. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6324. */
  6325. function customOmitClone(value) {
  6326. return isPlainObject(value) ? undefined : value;
  6327. }
  6328. /**
  6329. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6330. * partial deep comparisons.
  6331. *
  6332. * @private
  6333. * @param {Array} array The array to compare.
  6334. * @param {Array} other The other array to compare.
  6335. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6336. * @param {Function} customizer The function to customize comparisons.
  6337. * @param {Function} equalFunc The function to determine equivalents of values.
  6338. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6339. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6340. */
  6341. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6342. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6343. arrLength = array.length,
  6344. othLength = other.length;
  6345. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6346. return false;
  6347. }
  6348. // Check that cyclic values are equal.
  6349. var arrStacked = stack.get(array);
  6350. var othStacked = stack.get(other);
  6351. if (arrStacked && othStacked) {
  6352. return arrStacked == other && othStacked == array;
  6353. }
  6354. var index = -1,
  6355. result = true,
  6356. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6357. stack.set(array, other);
  6358. stack.set(other, array);
  6359. // Ignore non-index properties.
  6360. while (++index < arrLength) {
  6361. var arrValue = array[index],
  6362. othValue = other[index];
  6363. if (customizer) {
  6364. var compared = isPartial
  6365. ? customizer(othValue, arrValue, index, other, array, stack)
  6366. : customizer(arrValue, othValue, index, array, other, stack);
  6367. }
  6368. if (compared !== undefined) {
  6369. if (compared) {
  6370. continue;
  6371. }
  6372. result = false;
  6373. break;
  6374. }
  6375. // Recursively compare arrays (susceptible to call stack limits).
  6376. if (seen) {
  6377. if (!arraySome(other, function(othValue, othIndex) {
  6378. if (!cacheHas(seen, othIndex) &&
  6379. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6380. return seen.push(othIndex);
  6381. }
  6382. })) {
  6383. result = false;
  6384. break;
  6385. }
  6386. } else if (!(
  6387. arrValue === othValue ||
  6388. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6389. )) {
  6390. result = false;
  6391. break;
  6392. }
  6393. }
  6394. stack['delete'](array);
  6395. stack['delete'](other);
  6396. return result;
  6397. }
  6398. /**
  6399. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6400. * the same `toStringTag`.
  6401. *
  6402. * **Note:** This function only supports comparing values with tags of
  6403. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6404. *
  6405. * @private
  6406. * @param {Object} object The object to compare.
  6407. * @param {Object} other The other object to compare.
  6408. * @param {string} tag The `toStringTag` of the objects to compare.
  6409. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6410. * @param {Function} customizer The function to customize comparisons.
  6411. * @param {Function} equalFunc The function to determine equivalents of values.
  6412. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6413. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6414. */
  6415. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6416. switch (tag) {
  6417. case dataViewTag:
  6418. if ((object.byteLength != other.byteLength) ||
  6419. (object.byteOffset != other.byteOffset)) {
  6420. return false;
  6421. }
  6422. object = object.buffer;
  6423. other = other.buffer;
  6424. case arrayBufferTag:
  6425. if ((object.byteLength != other.byteLength) ||
  6426. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6427. return false;
  6428. }
  6429. return true;
  6430. case boolTag:
  6431. case dateTag:
  6432. case numberTag:
  6433. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6434. // Invalid dates are coerced to `NaN`.
  6435. return eq(+object, +other);
  6436. case errorTag:
  6437. return object.name == other.name && object.message == other.message;
  6438. case regexpTag:
  6439. case stringTag:
  6440. // Coerce regexes to strings and treat strings, primitives and objects,
  6441. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6442. // for more details.
  6443. return object == (other + '');
  6444. case mapTag:
  6445. var convert = mapToArray;
  6446. case setTag:
  6447. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6448. convert || (convert = setToArray);
  6449. if (object.size != other.size && !isPartial) {
  6450. return false;
  6451. }
  6452. // Assume cyclic values are equal.
  6453. var stacked = stack.get(object);
  6454. if (stacked) {
  6455. return stacked == other;
  6456. }
  6457. bitmask |= COMPARE_UNORDERED_FLAG;
  6458. // Recursively compare objects (susceptible to call stack limits).
  6459. stack.set(object, other);
  6460. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6461. stack['delete'](object);
  6462. return result;
  6463. case symbolTag:
  6464. if (symbolValueOf) {
  6465. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6466. }
  6467. }
  6468. return false;
  6469. }
  6470. /**
  6471. * A specialized version of `baseIsEqualDeep` for objects with support for
  6472. * partial deep comparisons.
  6473. *
  6474. * @private
  6475. * @param {Object} object The object to compare.
  6476. * @param {Object} other The other object to compare.
  6477. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6478. * @param {Function} customizer The function to customize comparisons.
  6479. * @param {Function} equalFunc The function to determine equivalents of values.
  6480. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6481. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6482. */
  6483. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6484. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6485. objProps = getAllKeys(object),
  6486. objLength = objProps.length,
  6487. othProps = getAllKeys(other),
  6488. othLength = othProps.length;
  6489. if (objLength != othLength && !isPartial) {
  6490. return false;
  6491. }
  6492. var index = objLength;
  6493. while (index--) {
  6494. var key = objProps[index];
  6495. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6496. return false;
  6497. }
  6498. }
  6499. // Check that cyclic values are equal.
  6500. var objStacked = stack.get(object);
  6501. var othStacked = stack.get(other);
  6502. if (objStacked && othStacked) {
  6503. return objStacked == other && othStacked == object;
  6504. }
  6505. var result = true;
  6506. stack.set(object, other);
  6507. stack.set(other, object);
  6508. var skipCtor = isPartial;
  6509. while (++index < objLength) {
  6510. key = objProps[index];
  6511. var objValue = object[key],
  6512. othValue = other[key];
  6513. if (customizer) {
  6514. var compared = isPartial
  6515. ? customizer(othValue, objValue, key, other, object, stack)
  6516. : customizer(objValue, othValue, key, object, other, stack);
  6517. }
  6518. // Recursively compare objects (susceptible to call stack limits).
  6519. if (!(compared === undefined
  6520. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6521. : compared
  6522. )) {
  6523. result = false;
  6524. break;
  6525. }
  6526. skipCtor || (skipCtor = key == 'constructor');
  6527. }
  6528. if (result && !skipCtor) {
  6529. var objCtor = object.constructor,
  6530. othCtor = other.constructor;
  6531. // Non `Object` object instances with different constructors are not equal.
  6532. if (objCtor != othCtor &&
  6533. ('constructor' in object && 'constructor' in other) &&
  6534. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6535. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6536. result = false;
  6537. }
  6538. }
  6539. stack['delete'](object);
  6540. stack['delete'](other);
  6541. return result;
  6542. }
  6543. /**
  6544. * A specialized version of `baseRest` which flattens the rest array.
  6545. *
  6546. * @private
  6547. * @param {Function} func The function to apply a rest parameter to.
  6548. * @returns {Function} Returns the new function.
  6549. */
  6550. function flatRest(func) {
  6551. return setToString(overRest(func, undefined, flatten), func + '');
  6552. }
  6553. /**
  6554. * Creates an array of own enumerable property names and symbols of `object`.
  6555. *
  6556. * @private
  6557. * @param {Object} object The object to query.
  6558. * @returns {Array} Returns the array of property names and symbols.
  6559. */
  6560. function getAllKeys(object) {
  6561. return baseGetAllKeys(object, keys, getSymbols);
  6562. }
  6563. /**
  6564. * Creates an array of own and inherited enumerable property names and
  6565. * symbols of `object`.
  6566. *
  6567. * @private
  6568. * @param {Object} object The object to query.
  6569. * @returns {Array} Returns the array of property names and symbols.
  6570. */
  6571. function getAllKeysIn(object) {
  6572. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6573. }
  6574. /**
  6575. * Gets metadata for `func`.
  6576. *
  6577. * @private
  6578. * @param {Function} func The function to query.
  6579. * @returns {*} Returns the metadata for `func`.
  6580. */
  6581. var getData = !metaMap ? noop : function(func) {
  6582. return metaMap.get(func);
  6583. };
  6584. /**
  6585. * Gets the name of `func`.
  6586. *
  6587. * @private
  6588. * @param {Function} func The function to query.
  6589. * @returns {string} Returns the function name.
  6590. */
  6591. function getFuncName(func) {
  6592. var result = (func.name + ''),
  6593. array = realNames[result],
  6594. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6595. while (length--) {
  6596. var data = array[length],
  6597. otherFunc = data.func;
  6598. if (otherFunc == null || otherFunc == func) {
  6599. return data.name;
  6600. }
  6601. }
  6602. return result;
  6603. }
  6604. /**
  6605. * Gets the argument placeholder value for `func`.
  6606. *
  6607. * @private
  6608. * @param {Function} func The function to inspect.
  6609. * @returns {*} Returns the placeholder value.
  6610. */
  6611. function getHolder(func) {
  6612. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6613. return object.placeholder;
  6614. }
  6615. /**
  6616. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6617. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6618. * If arguments are provided, the chosen function is invoked with them and
  6619. * its result is returned.
  6620. *
  6621. * @private
  6622. * @param {*} [value] The value to convert to an iteratee.
  6623. * @param {number} [arity] The arity of the created iteratee.
  6624. * @returns {Function} Returns the chosen function or its result.
  6625. */
  6626. function getIteratee() {
  6627. var result = lodash.iteratee || iteratee;
  6628. result = result === iteratee ? baseIteratee : result;
  6629. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6630. }
  6631. /**
  6632. * Gets the data for `map`.
  6633. *
  6634. * @private
  6635. * @param {Object} map The map to query.
  6636. * @param {string} key The reference key.
  6637. * @returns {*} Returns the map data.
  6638. */
  6639. function getMapData(map, key) {
  6640. var data = map.__data__;
  6641. return isKeyable(key)
  6642. ? data[typeof key == 'string' ? 'string' : 'hash']
  6643. : data.map;
  6644. }
  6645. /**
  6646. * Gets the property names, values, and compare flags of `object`.
  6647. *
  6648. * @private
  6649. * @param {Object} object The object to query.
  6650. * @returns {Array} Returns the match data of `object`.
  6651. */
  6652. function getMatchData(object) {
  6653. var result = keys(object),
  6654. length = result.length;
  6655. while (length--) {
  6656. var key = result[length],
  6657. value = object[key];
  6658. result[length] = [key, value, isStrictComparable(value)];
  6659. }
  6660. return result;
  6661. }
  6662. /**
  6663. * Gets the native function at `key` of `object`.
  6664. *
  6665. * @private
  6666. * @param {Object} object The object to query.
  6667. * @param {string} key The key of the method to get.
  6668. * @returns {*} Returns the function if it's native, else `undefined`.
  6669. */
  6670. function getNative(object, key) {
  6671. var value = getValue(object, key);
  6672. return baseIsNative(value) ? value : undefined;
  6673. }
  6674. /**
  6675. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6676. *
  6677. * @private
  6678. * @param {*} value The value to query.
  6679. * @returns {string} Returns the raw `toStringTag`.
  6680. */
  6681. function getRawTag(value) {
  6682. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6683. tag = value[symToStringTag];
  6684. try {
  6685. value[symToStringTag] = undefined;
  6686. var unmasked = true;
  6687. } catch (e) {}
  6688. var result = nativeObjectToString.call(value);
  6689. if (unmasked) {
  6690. if (isOwn) {
  6691. value[symToStringTag] = tag;
  6692. } else {
  6693. delete value[symToStringTag];
  6694. }
  6695. }
  6696. return result;
  6697. }
  6698. /**
  6699. * Creates an array of the own enumerable symbols of `object`.
  6700. *
  6701. * @private
  6702. * @param {Object} object The object to query.
  6703. * @returns {Array} Returns the array of symbols.
  6704. */
  6705. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6706. if (object == null) {
  6707. return [];
  6708. }
  6709. object = Object(object);
  6710. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6711. return propertyIsEnumerable.call(object, symbol);
  6712. });
  6713. };
  6714. /**
  6715. * Creates an array of the own and inherited enumerable symbols of `object`.
  6716. *
  6717. * @private
  6718. * @param {Object} object The object to query.
  6719. * @returns {Array} Returns the array of symbols.
  6720. */
  6721. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6722. var result = [];
  6723. while (object) {
  6724. arrayPush(result, getSymbols(object));
  6725. object = getPrototype(object);
  6726. }
  6727. return result;
  6728. };
  6729. /**
  6730. * Gets the `toStringTag` of `value`.
  6731. *
  6732. * @private
  6733. * @param {*} value The value to query.
  6734. * @returns {string} Returns the `toStringTag`.
  6735. */
  6736. var getTag = baseGetTag;
  6737. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6738. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6739. (Map && getTag(new Map) != mapTag) ||
  6740. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6741. (Set && getTag(new Set) != setTag) ||
  6742. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6743. getTag = function(value) {
  6744. var result = baseGetTag(value),
  6745. Ctor = result == objectTag ? value.constructor : undefined,
  6746. ctorString = Ctor ? toSource(Ctor) : '';
  6747. if (ctorString) {
  6748. switch (ctorString) {
  6749. case dataViewCtorString: return dataViewTag;
  6750. case mapCtorString: return mapTag;
  6751. case promiseCtorString: return promiseTag;
  6752. case setCtorString: return setTag;
  6753. case weakMapCtorString: return weakMapTag;
  6754. }
  6755. }
  6756. return result;
  6757. };
  6758. }
  6759. /**
  6760. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6761. *
  6762. * @private
  6763. * @param {number} start The start of the view.
  6764. * @param {number} end The end of the view.
  6765. * @param {Array} transforms The transformations to apply to the view.
  6766. * @returns {Object} Returns an object containing the `start` and `end`
  6767. * positions of the view.
  6768. */
  6769. function getView(start, end, transforms) {
  6770. var index = -1,
  6771. length = transforms.length;
  6772. while (++index < length) {
  6773. var data = transforms[index],
  6774. size = data.size;
  6775. switch (data.type) {
  6776. case 'drop': start += size; break;
  6777. case 'dropRight': end -= size; break;
  6778. case 'take': end = nativeMin(end, start + size); break;
  6779. case 'takeRight': start = nativeMax(start, end - size); break;
  6780. }
  6781. }
  6782. return { 'start': start, 'end': end };
  6783. }
  6784. /**
  6785. * Extracts wrapper details from the `source` body comment.
  6786. *
  6787. * @private
  6788. * @param {string} source The source to inspect.
  6789. * @returns {Array} Returns the wrapper details.
  6790. */
  6791. function getWrapDetails(source) {
  6792. var match = source.match(reWrapDetails);
  6793. return match ? match[1].split(reSplitDetails) : [];
  6794. }
  6795. /**
  6796. * Checks if `path` exists on `object`.
  6797. *
  6798. * @private
  6799. * @param {Object} object The object to query.
  6800. * @param {Array|string} path The path to check.
  6801. * @param {Function} hasFunc The function to check properties.
  6802. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6803. */
  6804. function hasPath(object, path, hasFunc) {
  6805. path = castPath(path, object);
  6806. var index = -1,
  6807. length = path.length,
  6808. result = false;
  6809. while (++index < length) {
  6810. var key = toKey(path[index]);
  6811. if (!(result = object != null && hasFunc(object, key))) {
  6812. break;
  6813. }
  6814. object = object[key];
  6815. }
  6816. if (result || ++index != length) {
  6817. return result;
  6818. }
  6819. length = object == null ? 0 : object.length;
  6820. return !!length && isLength(length) && isIndex(key, length) &&
  6821. (isArray(object) || isArguments(object));
  6822. }
  6823. /**
  6824. * Initializes an array clone.
  6825. *
  6826. * @private
  6827. * @param {Array} array The array to clone.
  6828. * @returns {Array} Returns the initialized clone.
  6829. */
  6830. function initCloneArray(array) {
  6831. var length = array.length,
  6832. result = new array.constructor(length);
  6833. // Add properties assigned by `RegExp#exec`.
  6834. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6835. result.index = array.index;
  6836. result.input = array.input;
  6837. }
  6838. return result;
  6839. }
  6840. /**
  6841. * Initializes an object clone.
  6842. *
  6843. * @private
  6844. * @param {Object} object The object to clone.
  6845. * @returns {Object} Returns the initialized clone.
  6846. */
  6847. function initCloneObject(object) {
  6848. return (typeof object.constructor == 'function' && !isPrototype(object))
  6849. ? baseCreate(getPrototype(object))
  6850. : {};
  6851. }
  6852. /**
  6853. * Initializes an object clone based on its `toStringTag`.
  6854. *
  6855. * **Note:** This function only supports cloning values with tags of
  6856. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6857. *
  6858. * @private
  6859. * @param {Object} object The object to clone.
  6860. * @param {string} tag The `toStringTag` of the object to clone.
  6861. * @param {boolean} [isDeep] Specify a deep clone.
  6862. * @returns {Object} Returns the initialized clone.
  6863. */
  6864. function initCloneByTag(object, tag, isDeep) {
  6865. var Ctor = object.constructor;
  6866. switch (tag) {
  6867. case arrayBufferTag:
  6868. return cloneArrayBuffer(object);
  6869. case boolTag:
  6870. case dateTag:
  6871. return new Ctor(+object);
  6872. case dataViewTag:
  6873. return cloneDataView(object, isDeep);
  6874. case float32Tag: case float64Tag:
  6875. case int8Tag: case int16Tag: case int32Tag:
  6876. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6877. return cloneTypedArray(object, isDeep);
  6878. case mapTag:
  6879. return new Ctor;
  6880. case numberTag:
  6881. case stringTag:
  6882. return new Ctor(object);
  6883. case regexpTag:
  6884. return cloneRegExp(object);
  6885. case setTag:
  6886. return new Ctor;
  6887. case symbolTag:
  6888. return cloneSymbol(object);
  6889. }
  6890. }
  6891. /**
  6892. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6893. *
  6894. * @private
  6895. * @param {string} source The source to modify.
  6896. * @returns {Array} details The details to insert.
  6897. * @returns {string} Returns the modified source.
  6898. */
  6899. function insertWrapDetails(source, details) {
  6900. var length = details.length;
  6901. if (!length) {
  6902. return source;
  6903. }
  6904. var lastIndex = length - 1;
  6905. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6906. details = details.join(length > 2 ? ', ' : ' ');
  6907. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6908. }
  6909. /**
  6910. * Checks if `value` is a flattenable `arguments` object or array.
  6911. *
  6912. * @private
  6913. * @param {*} value The value to check.
  6914. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6915. */
  6916. function isFlattenable(value) {
  6917. return isArray(value) || isArguments(value) ||
  6918. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6919. }
  6920. /**
  6921. * Checks if `value` is a valid array-like index.
  6922. *
  6923. * @private
  6924. * @param {*} value The value to check.
  6925. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6926. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6927. */
  6928. function isIndex(value, length) {
  6929. var type = typeof value;
  6930. length = length == null ? MAX_SAFE_INTEGER : length;
  6931. return !!length &&
  6932. (type == 'number' ||
  6933. (type != 'symbol' && reIsUint.test(value))) &&
  6934. (value > -1 && value % 1 == 0 && value < length);
  6935. }
  6936. /**
  6937. * Checks if the given arguments are from an iteratee call.
  6938. *
  6939. * @private
  6940. * @param {*} value The potential iteratee value argument.
  6941. * @param {*} index The potential iteratee index or key argument.
  6942. * @param {*} object The potential iteratee object argument.
  6943. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6944. * else `false`.
  6945. */
  6946. function isIterateeCall(value, index, object) {
  6947. if (!isObject(object)) {
  6948. return false;
  6949. }
  6950. var type = typeof index;
  6951. if (type == 'number'
  6952. ? (isArrayLike(object) && isIndex(index, object.length))
  6953. : (type == 'string' && index in object)
  6954. ) {
  6955. return eq(object[index], value);
  6956. }
  6957. return false;
  6958. }
  6959. /**
  6960. * Checks if `value` is a property name and not a property path.
  6961. *
  6962. * @private
  6963. * @param {*} value The value to check.
  6964. * @param {Object} [object] The object to query keys on.
  6965. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6966. */
  6967. function isKey(value, object) {
  6968. if (isArray(value)) {
  6969. return false;
  6970. }
  6971. var type = typeof value;
  6972. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6973. value == null || isSymbol(value)) {
  6974. return true;
  6975. }
  6976. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6977. (object != null && value in Object(object));
  6978. }
  6979. /**
  6980. * Checks if `value` is suitable for use as unique object key.
  6981. *
  6982. * @private
  6983. * @param {*} value The value to check.
  6984. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6985. */
  6986. function isKeyable(value) {
  6987. var type = typeof value;
  6988. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6989. ? (value !== '__proto__')
  6990. : (value === null);
  6991. }
  6992. /**
  6993. * Checks if `func` has a lazy counterpart.
  6994. *
  6995. * @private
  6996. * @param {Function} func The function to check.
  6997. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6998. * else `false`.
  6999. */
  7000. function isLaziable(func) {
  7001. var funcName = getFuncName(func),
  7002. other = lodash[funcName];
  7003. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7004. return false;
  7005. }
  7006. if (func === other) {
  7007. return true;
  7008. }
  7009. var data = getData(other);
  7010. return !!data && func === data[0];
  7011. }
  7012. /**
  7013. * Checks if `func` has its source masked.
  7014. *
  7015. * @private
  7016. * @param {Function} func The function to check.
  7017. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7018. */
  7019. function isMasked(func) {
  7020. return !!maskSrcKey && (maskSrcKey in func);
  7021. }
  7022. /**
  7023. * Checks if `func` is capable of being masked.
  7024. *
  7025. * @private
  7026. * @param {*} value The value to check.
  7027. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7028. */
  7029. var isMaskable = coreJsData ? isFunction : stubFalse;
  7030. /**
  7031. * Checks if `value` is likely a prototype object.
  7032. *
  7033. * @private
  7034. * @param {*} value The value to check.
  7035. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7036. */
  7037. function isPrototype(value) {
  7038. var Ctor = value && value.constructor,
  7039. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7040. return value === proto;
  7041. }
  7042. /**
  7043. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7044. *
  7045. * @private
  7046. * @param {*} value The value to check.
  7047. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7048. * equality comparisons, else `false`.
  7049. */
  7050. function isStrictComparable(value) {
  7051. return value === value && !isObject(value);
  7052. }
  7053. /**
  7054. * A specialized version of `matchesProperty` for source values suitable
  7055. * for strict equality comparisons, i.e. `===`.
  7056. *
  7057. * @private
  7058. * @param {string} key The key of the property to get.
  7059. * @param {*} srcValue The value to match.
  7060. * @returns {Function} Returns the new spec function.
  7061. */
  7062. function matchesStrictComparable(key, srcValue) {
  7063. return function(object) {
  7064. if (object == null) {
  7065. return false;
  7066. }
  7067. return object[key] === srcValue &&
  7068. (srcValue !== undefined || (key in Object(object)));
  7069. };
  7070. }
  7071. /**
  7072. * A specialized version of `_.memoize` which clears the memoized function's
  7073. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7074. *
  7075. * @private
  7076. * @param {Function} func The function to have its output memoized.
  7077. * @returns {Function} Returns the new memoized function.
  7078. */
  7079. function memoizeCapped(func) {
  7080. var result = memoize(func, function(key) {
  7081. if (cache.size === MAX_MEMOIZE_SIZE) {
  7082. cache.clear();
  7083. }
  7084. return key;
  7085. });
  7086. var cache = result.cache;
  7087. return result;
  7088. }
  7089. /**
  7090. * Merges the function metadata of `source` into `data`.
  7091. *
  7092. * Merging metadata reduces the number of wrappers used to invoke a function.
  7093. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7094. * may be applied regardless of execution order. Methods like `_.ary` and
  7095. * `_.rearg` modify function arguments, making the order in which they are
  7096. * executed important, preventing the merging of metadata. However, we make
  7097. * an exception for a safe combined case where curried functions have `_.ary`
  7098. * and or `_.rearg` applied.
  7099. *
  7100. * @private
  7101. * @param {Array} data The destination metadata.
  7102. * @param {Array} source The source metadata.
  7103. * @returns {Array} Returns `data`.
  7104. */
  7105. function mergeData(data, source) {
  7106. var bitmask = data[1],
  7107. srcBitmask = source[1],
  7108. newBitmask = bitmask | srcBitmask,
  7109. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7110. var isCombo =
  7111. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7112. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7113. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7114. // Exit early if metadata can't be merged.
  7115. if (!(isCommon || isCombo)) {
  7116. return data;
  7117. }
  7118. // Use source `thisArg` if available.
  7119. if (srcBitmask & WRAP_BIND_FLAG) {
  7120. data[2] = source[2];
  7121. // Set when currying a bound function.
  7122. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7123. }
  7124. // Compose partial arguments.
  7125. var value = source[3];
  7126. if (value) {
  7127. var partials = data[3];
  7128. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7129. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7130. }
  7131. // Compose partial right arguments.
  7132. value = source[5];
  7133. if (value) {
  7134. partials = data[5];
  7135. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7136. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7137. }
  7138. // Use source `argPos` if available.
  7139. value = source[7];
  7140. if (value) {
  7141. data[7] = value;
  7142. }
  7143. // Use source `ary` if it's smaller.
  7144. if (srcBitmask & WRAP_ARY_FLAG) {
  7145. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7146. }
  7147. // Use source `arity` if one is not provided.
  7148. if (data[9] == null) {
  7149. data[9] = source[9];
  7150. }
  7151. // Use source `func` and merge bitmasks.
  7152. data[0] = source[0];
  7153. data[1] = newBitmask;
  7154. return data;
  7155. }
  7156. /**
  7157. * This function is like
  7158. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7159. * except that it includes inherited enumerable properties.
  7160. *
  7161. * @private
  7162. * @param {Object} object The object to query.
  7163. * @returns {Array} Returns the array of property names.
  7164. */
  7165. function nativeKeysIn(object) {
  7166. var result = [];
  7167. if (object != null) {
  7168. for (var key in Object(object)) {
  7169. result.push(key);
  7170. }
  7171. }
  7172. return result;
  7173. }
  7174. /**
  7175. * Converts `value` to a string using `Object.prototype.toString`.
  7176. *
  7177. * @private
  7178. * @param {*} value The value to convert.
  7179. * @returns {string} Returns the converted string.
  7180. */
  7181. function objectToString(value) {
  7182. return nativeObjectToString.call(value);
  7183. }
  7184. /**
  7185. * A specialized version of `baseRest` which transforms the rest array.
  7186. *
  7187. * @private
  7188. * @param {Function} func The function to apply a rest parameter to.
  7189. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7190. * @param {Function} transform The rest array transform.
  7191. * @returns {Function} Returns the new function.
  7192. */
  7193. function overRest(func, start, transform) {
  7194. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7195. return function() {
  7196. var args = arguments,
  7197. index = -1,
  7198. length = nativeMax(args.length - start, 0),
  7199. array = Array(length);
  7200. while (++index < length) {
  7201. array[index] = args[start + index];
  7202. }
  7203. index = -1;
  7204. var otherArgs = Array(start + 1);
  7205. while (++index < start) {
  7206. otherArgs[index] = args[index];
  7207. }
  7208. otherArgs[start] = transform(array);
  7209. return apply(func, this, otherArgs);
  7210. };
  7211. }
  7212. /**
  7213. * Gets the parent value at `path` of `object`.
  7214. *
  7215. * @private
  7216. * @param {Object} object The object to query.
  7217. * @param {Array} path The path to get the parent value of.
  7218. * @returns {*} Returns the parent value.
  7219. */
  7220. function parent(object, path) {
  7221. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7222. }
  7223. /**
  7224. * Reorder `array` according to the specified indexes where the element at
  7225. * the first index is assigned as the first element, the element at
  7226. * the second index is assigned as the second element, and so on.
  7227. *
  7228. * @private
  7229. * @param {Array} array The array to reorder.
  7230. * @param {Array} indexes The arranged array indexes.
  7231. * @returns {Array} Returns `array`.
  7232. */
  7233. function reorder(array, indexes) {
  7234. var arrLength = array.length,
  7235. length = nativeMin(indexes.length, arrLength),
  7236. oldArray = copyArray(array);
  7237. while (length--) {
  7238. var index = indexes[length];
  7239. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7240. }
  7241. return array;
  7242. }
  7243. /**
  7244. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7245. *
  7246. * @private
  7247. * @param {Object} object The object to query.
  7248. * @param {string} key The key of the property to get.
  7249. * @returns {*} Returns the property value.
  7250. */
  7251. function safeGet(object, key) {
  7252. if (key === 'constructor' && typeof object[key] === 'function') {
  7253. return;
  7254. }
  7255. if (key == '__proto__') {
  7256. return;
  7257. }
  7258. return object[key];
  7259. }
  7260. /**
  7261. * Sets metadata for `func`.
  7262. *
  7263. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7264. * period of time, it will trip its breaker and transition to an identity
  7265. * function to avoid garbage collection pauses in V8. See
  7266. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7267. * for more details.
  7268. *
  7269. * @private
  7270. * @param {Function} func The function to associate metadata with.
  7271. * @param {*} data The metadata.
  7272. * @returns {Function} Returns `func`.
  7273. */
  7274. var setData = shortOut(baseSetData);
  7275. /**
  7276. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7277. *
  7278. * @private
  7279. * @param {Function} func The function to delay.
  7280. * @param {number} wait The number of milliseconds to delay invocation.
  7281. * @returns {number|Object} Returns the timer id or timeout object.
  7282. */
  7283. var setTimeout = ctxSetTimeout || function(func, wait) {
  7284. return root.setTimeout(func, wait);
  7285. };
  7286. /**
  7287. * Sets the `toString` method of `func` to return `string`.
  7288. *
  7289. * @private
  7290. * @param {Function} func The function to modify.
  7291. * @param {Function} string The `toString` result.
  7292. * @returns {Function} Returns `func`.
  7293. */
  7294. var setToString = shortOut(baseSetToString);
  7295. /**
  7296. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7297. * with wrapper details in a comment at the top of the source body.
  7298. *
  7299. * @private
  7300. * @param {Function} wrapper The function to modify.
  7301. * @param {Function} reference The reference function.
  7302. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7303. * @returns {Function} Returns `wrapper`.
  7304. */
  7305. function setWrapToString(wrapper, reference, bitmask) {
  7306. var source = (reference + '');
  7307. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7308. }
  7309. /**
  7310. * Creates a function that'll short out and invoke `identity` instead
  7311. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7312. * milliseconds.
  7313. *
  7314. * @private
  7315. * @param {Function} func The function to restrict.
  7316. * @returns {Function} Returns the new shortable function.
  7317. */
  7318. function shortOut(func) {
  7319. var count = 0,
  7320. lastCalled = 0;
  7321. return function() {
  7322. var stamp = nativeNow(),
  7323. remaining = HOT_SPAN - (stamp - lastCalled);
  7324. lastCalled = stamp;
  7325. if (remaining > 0) {
  7326. if (++count >= HOT_COUNT) {
  7327. return arguments[0];
  7328. }
  7329. } else {
  7330. count = 0;
  7331. }
  7332. return func.apply(undefined, arguments);
  7333. };
  7334. }
  7335. /**
  7336. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7337. *
  7338. * @private
  7339. * @param {Array} array The array to shuffle.
  7340. * @param {number} [size=array.length] The size of `array`.
  7341. * @returns {Array} Returns `array`.
  7342. */
  7343. function shuffleSelf(array, size) {
  7344. var index = -1,
  7345. length = array.length,
  7346. lastIndex = length - 1;
  7347. size = size === undefined ? length : size;
  7348. while (++index < size) {
  7349. var rand = baseRandom(index, lastIndex),
  7350. value = array[rand];
  7351. array[rand] = array[index];
  7352. array[index] = value;
  7353. }
  7354. array.length = size;
  7355. return array;
  7356. }
  7357. /**
  7358. * Converts `string` to a property path array.
  7359. *
  7360. * @private
  7361. * @param {string} string The string to convert.
  7362. * @returns {Array} Returns the property path array.
  7363. */
  7364. var stringToPath = memoizeCapped(function(string) {
  7365. var result = [];
  7366. if (string.charCodeAt(0) === 46 /* . */) {
  7367. result.push('');
  7368. }
  7369. string.replace(rePropName, function(match, number, quote, subString) {
  7370. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7371. });
  7372. return result;
  7373. });
  7374. /**
  7375. * Converts `value` to a string key if it's not a string or symbol.
  7376. *
  7377. * @private
  7378. * @param {*} value The value to inspect.
  7379. * @returns {string|symbol} Returns the key.
  7380. */
  7381. function toKey(value) {
  7382. if (typeof value == 'string' || isSymbol(value)) {
  7383. return value;
  7384. }
  7385. var result = (value + '');
  7386. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7387. }
  7388. /**
  7389. * Converts `func` to its source code.
  7390. *
  7391. * @private
  7392. * @param {Function} func The function to convert.
  7393. * @returns {string} Returns the source code.
  7394. */
  7395. function toSource(func) {
  7396. if (func != null) {
  7397. try {
  7398. return funcToString.call(func);
  7399. } catch (e) {}
  7400. try {
  7401. return (func + '');
  7402. } catch (e) {}
  7403. }
  7404. return '';
  7405. }
  7406. /**
  7407. * Updates wrapper `details` based on `bitmask` flags.
  7408. *
  7409. * @private
  7410. * @returns {Array} details The details to modify.
  7411. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7412. * @returns {Array} Returns `details`.
  7413. */
  7414. function updateWrapDetails(details, bitmask) {
  7415. arrayEach(wrapFlags, function(pair) {
  7416. var value = '_.' + pair[0];
  7417. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7418. details.push(value);
  7419. }
  7420. });
  7421. return details.sort();
  7422. }
  7423. /**
  7424. * Creates a clone of `wrapper`.
  7425. *
  7426. * @private
  7427. * @param {Object} wrapper The wrapper to clone.
  7428. * @returns {Object} Returns the cloned wrapper.
  7429. */
  7430. function wrapperClone(wrapper) {
  7431. if (wrapper instanceof LazyWrapper) {
  7432. return wrapper.clone();
  7433. }
  7434. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7435. result.__actions__ = copyArray(wrapper.__actions__);
  7436. result.__index__ = wrapper.__index__;
  7437. result.__values__ = wrapper.__values__;
  7438. return result;
  7439. }
  7440. /*------------------------------------------------------------------------*/
  7441. /**
  7442. * Creates an array of elements split into groups the length of `size`.
  7443. * If `array` can't be split evenly, the final chunk will be the remaining
  7444. * elements.
  7445. *
  7446. * @static
  7447. * @memberOf _
  7448. * @since 3.0.0
  7449. * @category Array
  7450. * @param {Array} array The array to process.
  7451. * @param {number} [size=1] The length of each chunk
  7452. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7453. * @returns {Array} Returns the new array of chunks.
  7454. * @example
  7455. *
  7456. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7457. * // => [['a', 'b'], ['c', 'd']]
  7458. *
  7459. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7460. * // => [['a', 'b', 'c'], ['d']]
  7461. */
  7462. function chunk(array, size, guard) {
  7463. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7464. size = 1;
  7465. } else {
  7466. size = nativeMax(toInteger(size), 0);
  7467. }
  7468. var length = array == null ? 0 : array.length;
  7469. if (!length || size < 1) {
  7470. return [];
  7471. }
  7472. var index = 0,
  7473. resIndex = 0,
  7474. result = Array(nativeCeil(length / size));
  7475. while (index < length) {
  7476. result[resIndex++] = baseSlice(array, index, (index += size));
  7477. }
  7478. return result;
  7479. }
  7480. /**
  7481. * Creates an array with all falsey values removed. The values `false`, `null`,
  7482. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7483. *
  7484. * @static
  7485. * @memberOf _
  7486. * @since 0.1.0
  7487. * @category Array
  7488. * @param {Array} array The array to compact.
  7489. * @returns {Array} Returns the new array of filtered values.
  7490. * @example
  7491. *
  7492. * _.compact([0, 1, false, 2, '', 3]);
  7493. * // => [1, 2, 3]
  7494. */
  7495. function compact(array) {
  7496. var index = -1,
  7497. length = array == null ? 0 : array.length,
  7498. resIndex = 0,
  7499. result = [];
  7500. while (++index < length) {
  7501. var value = array[index];
  7502. if (value) {
  7503. result[resIndex++] = value;
  7504. }
  7505. }
  7506. return result;
  7507. }
  7508. /**
  7509. * Creates a new array concatenating `array` with any additional arrays
  7510. * and/or values.
  7511. *
  7512. * @static
  7513. * @memberOf _
  7514. * @since 4.0.0
  7515. * @category Array
  7516. * @param {Array} array The array to concatenate.
  7517. * @param {...*} [values] The values to concatenate.
  7518. * @returns {Array} Returns the new concatenated array.
  7519. * @example
  7520. *
  7521. * var array = [1];
  7522. * var other = _.concat(array, 2, [3], [[4]]);
  7523. *
  7524. * console.log(other);
  7525. * // => [1, 2, 3, [4]]
  7526. *
  7527. * console.log(array);
  7528. * // => [1]
  7529. */
  7530. function concat() {
  7531. var length = arguments.length;
  7532. if (!length) {
  7533. return [];
  7534. }
  7535. var args = Array(length - 1),
  7536. array = arguments[0],
  7537. index = length;
  7538. while (index--) {
  7539. args[index - 1] = arguments[index];
  7540. }
  7541. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7542. }
  7543. /**
  7544. * Creates an array of `array` values not included in the other given arrays
  7545. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7546. * for equality comparisons. The order and references of result values are
  7547. * determined by the first array.
  7548. *
  7549. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7550. *
  7551. * @static
  7552. * @memberOf _
  7553. * @since 0.1.0
  7554. * @category Array
  7555. * @param {Array} array The array to inspect.
  7556. * @param {...Array} [values] The values to exclude.
  7557. * @returns {Array} Returns the new array of filtered values.
  7558. * @see _.without, _.xor
  7559. * @example
  7560. *
  7561. * _.difference([2, 1], [2, 3]);
  7562. * // => [1]
  7563. */
  7564. var difference = baseRest(function(array, values) {
  7565. return isArrayLikeObject(array)
  7566. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7567. : [];
  7568. });
  7569. /**
  7570. * This method is like `_.difference` except that it accepts `iteratee` which
  7571. * is invoked for each element of `array` and `values` to generate the criterion
  7572. * by which they're compared. The order and references of result values are
  7573. * determined by the first array. The iteratee is invoked with one argument:
  7574. * (value).
  7575. *
  7576. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7577. *
  7578. * @static
  7579. * @memberOf _
  7580. * @since 4.0.0
  7581. * @category Array
  7582. * @param {Array} array The array to inspect.
  7583. * @param {...Array} [values] The values to exclude.
  7584. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7585. * @returns {Array} Returns the new array of filtered values.
  7586. * @example
  7587. *
  7588. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7589. * // => [1.2]
  7590. *
  7591. * // The `_.property` iteratee shorthand.
  7592. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7593. * // => [{ 'x': 2 }]
  7594. */
  7595. var differenceBy = baseRest(function(array, values) {
  7596. var iteratee = last(values);
  7597. if (isArrayLikeObject(iteratee)) {
  7598. iteratee = undefined;
  7599. }
  7600. return isArrayLikeObject(array)
  7601. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7602. : [];
  7603. });
  7604. /**
  7605. * This method is like `_.difference` except that it accepts `comparator`
  7606. * which is invoked to compare elements of `array` to `values`. The order and
  7607. * references of result values are determined by the first array. The comparator
  7608. * is invoked with two arguments: (arrVal, othVal).
  7609. *
  7610. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7611. *
  7612. * @static
  7613. * @memberOf _
  7614. * @since 4.0.0
  7615. * @category Array
  7616. * @param {Array} array The array to inspect.
  7617. * @param {...Array} [values] The values to exclude.
  7618. * @param {Function} [comparator] The comparator invoked per element.
  7619. * @returns {Array} Returns the new array of filtered values.
  7620. * @example
  7621. *
  7622. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7623. *
  7624. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7625. * // => [{ 'x': 2, 'y': 1 }]
  7626. */
  7627. var differenceWith = baseRest(function(array, values) {
  7628. var comparator = last(values);
  7629. if (isArrayLikeObject(comparator)) {
  7630. comparator = undefined;
  7631. }
  7632. return isArrayLikeObject(array)
  7633. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7634. : [];
  7635. });
  7636. /**
  7637. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7638. *
  7639. * @static
  7640. * @memberOf _
  7641. * @since 0.5.0
  7642. * @category Array
  7643. * @param {Array} array The array to query.
  7644. * @param {number} [n=1] The number of elements to drop.
  7645. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7646. * @returns {Array} Returns the slice of `array`.
  7647. * @example
  7648. *
  7649. * _.drop([1, 2, 3]);
  7650. * // => [2, 3]
  7651. *
  7652. * _.drop([1, 2, 3], 2);
  7653. * // => [3]
  7654. *
  7655. * _.drop([1, 2, 3], 5);
  7656. * // => []
  7657. *
  7658. * _.drop([1, 2, 3], 0);
  7659. * // => [1, 2, 3]
  7660. */
  7661. function drop(array, n, guard) {
  7662. var length = array == null ? 0 : array.length;
  7663. if (!length) {
  7664. return [];
  7665. }
  7666. n = (guard || n === undefined) ? 1 : toInteger(n);
  7667. return baseSlice(array, n < 0 ? 0 : n, length);
  7668. }
  7669. /**
  7670. * Creates a slice of `array` with `n` elements dropped from the end.
  7671. *
  7672. * @static
  7673. * @memberOf _
  7674. * @since 3.0.0
  7675. * @category Array
  7676. * @param {Array} array The array to query.
  7677. * @param {number} [n=1] The number of elements to drop.
  7678. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7679. * @returns {Array} Returns the slice of `array`.
  7680. * @example
  7681. *
  7682. * _.dropRight([1, 2, 3]);
  7683. * // => [1, 2]
  7684. *
  7685. * _.dropRight([1, 2, 3], 2);
  7686. * // => [1]
  7687. *
  7688. * _.dropRight([1, 2, 3], 5);
  7689. * // => []
  7690. *
  7691. * _.dropRight([1, 2, 3], 0);
  7692. * // => [1, 2, 3]
  7693. */
  7694. function dropRight(array, n, guard) {
  7695. var length = array == null ? 0 : array.length;
  7696. if (!length) {
  7697. return [];
  7698. }
  7699. n = (guard || n === undefined) ? 1 : toInteger(n);
  7700. n = length - n;
  7701. return baseSlice(array, 0, n < 0 ? 0 : n);
  7702. }
  7703. /**
  7704. * Creates a slice of `array` excluding elements dropped from the end.
  7705. * Elements are dropped until `predicate` returns falsey. The predicate is
  7706. * invoked with three arguments: (value, index, array).
  7707. *
  7708. * @static
  7709. * @memberOf _
  7710. * @since 3.0.0
  7711. * @category Array
  7712. * @param {Array} array The array to query.
  7713. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7714. * @returns {Array} Returns the slice of `array`.
  7715. * @example
  7716. *
  7717. * var users = [
  7718. * { 'user': 'barney', 'active': true },
  7719. * { 'user': 'fred', 'active': false },
  7720. * { 'user': 'pebbles', 'active': false }
  7721. * ];
  7722. *
  7723. * _.dropRightWhile(users, function(o) { return !o.active; });
  7724. * // => objects for ['barney']
  7725. *
  7726. * // The `_.matches` iteratee shorthand.
  7727. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7728. * // => objects for ['barney', 'fred']
  7729. *
  7730. * // The `_.matchesProperty` iteratee shorthand.
  7731. * _.dropRightWhile(users, ['active', false]);
  7732. * // => objects for ['barney']
  7733. *
  7734. * // The `_.property` iteratee shorthand.
  7735. * _.dropRightWhile(users, 'active');
  7736. * // => objects for ['barney', 'fred', 'pebbles']
  7737. */
  7738. function dropRightWhile(array, predicate) {
  7739. return (array && array.length)
  7740. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7741. : [];
  7742. }
  7743. /**
  7744. * Creates a slice of `array` excluding elements dropped from the beginning.
  7745. * Elements are dropped until `predicate` returns falsey. The predicate is
  7746. * invoked with three arguments: (value, index, array).
  7747. *
  7748. * @static
  7749. * @memberOf _
  7750. * @since 3.0.0
  7751. * @category Array
  7752. * @param {Array} array The array to query.
  7753. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7754. * @returns {Array} Returns the slice of `array`.
  7755. * @example
  7756. *
  7757. * var users = [
  7758. * { 'user': 'barney', 'active': false },
  7759. * { 'user': 'fred', 'active': false },
  7760. * { 'user': 'pebbles', 'active': true }
  7761. * ];
  7762. *
  7763. * _.dropWhile(users, function(o) { return !o.active; });
  7764. * // => objects for ['pebbles']
  7765. *
  7766. * // The `_.matches` iteratee shorthand.
  7767. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7768. * // => objects for ['fred', 'pebbles']
  7769. *
  7770. * // The `_.matchesProperty` iteratee shorthand.
  7771. * _.dropWhile(users, ['active', false]);
  7772. * // => objects for ['pebbles']
  7773. *
  7774. * // The `_.property` iteratee shorthand.
  7775. * _.dropWhile(users, 'active');
  7776. * // => objects for ['barney', 'fred', 'pebbles']
  7777. */
  7778. function dropWhile(array, predicate) {
  7779. return (array && array.length)
  7780. ? baseWhile(array, getIteratee(predicate, 3), true)
  7781. : [];
  7782. }
  7783. /**
  7784. * Fills elements of `array` with `value` from `start` up to, but not
  7785. * including, `end`.
  7786. *
  7787. * **Note:** This method mutates `array`.
  7788. *
  7789. * @static
  7790. * @memberOf _
  7791. * @since 3.2.0
  7792. * @category Array
  7793. * @param {Array} array The array to fill.
  7794. * @param {*} value The value to fill `array` with.
  7795. * @param {number} [start=0] The start position.
  7796. * @param {number} [end=array.length] The end position.
  7797. * @returns {Array} Returns `array`.
  7798. * @example
  7799. *
  7800. * var array = [1, 2, 3];
  7801. *
  7802. * _.fill(array, 'a');
  7803. * console.log(array);
  7804. * // => ['a', 'a', 'a']
  7805. *
  7806. * _.fill(Array(3), 2);
  7807. * // => [2, 2, 2]
  7808. *
  7809. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7810. * // => [4, '*', '*', 10]
  7811. */
  7812. function fill(array, value, start, end) {
  7813. var length = array == null ? 0 : array.length;
  7814. if (!length) {
  7815. return [];
  7816. }
  7817. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7818. start = 0;
  7819. end = length;
  7820. }
  7821. return baseFill(array, value, start, end);
  7822. }
  7823. /**
  7824. * This method is like `_.find` except that it returns the index of the first
  7825. * element `predicate` returns truthy for instead of the element itself.
  7826. *
  7827. * @static
  7828. * @memberOf _
  7829. * @since 1.1.0
  7830. * @category Array
  7831. * @param {Array} array The array to inspect.
  7832. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7833. * @param {number} [fromIndex=0] The index to search from.
  7834. * @returns {number} Returns the index of the found element, else `-1`.
  7835. * @example
  7836. *
  7837. * var users = [
  7838. * { 'user': 'barney', 'active': false },
  7839. * { 'user': 'fred', 'active': false },
  7840. * { 'user': 'pebbles', 'active': true }
  7841. * ];
  7842. *
  7843. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7844. * // => 0
  7845. *
  7846. * // The `_.matches` iteratee shorthand.
  7847. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7848. * // => 1
  7849. *
  7850. * // The `_.matchesProperty` iteratee shorthand.
  7851. * _.findIndex(users, ['active', false]);
  7852. * // => 0
  7853. *
  7854. * // The `_.property` iteratee shorthand.
  7855. * _.findIndex(users, 'active');
  7856. * // => 2
  7857. */
  7858. function findIndex(array, predicate, fromIndex) {
  7859. var length = array == null ? 0 : array.length;
  7860. if (!length) {
  7861. return -1;
  7862. }
  7863. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7864. if (index < 0) {
  7865. index = nativeMax(length + index, 0);
  7866. }
  7867. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7868. }
  7869. /**
  7870. * This method is like `_.findIndex` except that it iterates over elements
  7871. * of `collection` from right to left.
  7872. *
  7873. * @static
  7874. * @memberOf _
  7875. * @since 2.0.0
  7876. * @category Array
  7877. * @param {Array} array The array to inspect.
  7878. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7879. * @param {number} [fromIndex=array.length-1] The index to search from.
  7880. * @returns {number} Returns the index of the found element, else `-1`.
  7881. * @example
  7882. *
  7883. * var users = [
  7884. * { 'user': 'barney', 'active': true },
  7885. * { 'user': 'fred', 'active': false },
  7886. * { 'user': 'pebbles', 'active': false }
  7887. * ];
  7888. *
  7889. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7890. * // => 2
  7891. *
  7892. * // The `_.matches` iteratee shorthand.
  7893. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7894. * // => 0
  7895. *
  7896. * // The `_.matchesProperty` iteratee shorthand.
  7897. * _.findLastIndex(users, ['active', false]);
  7898. * // => 2
  7899. *
  7900. * // The `_.property` iteratee shorthand.
  7901. * _.findLastIndex(users, 'active');
  7902. * // => 0
  7903. */
  7904. function findLastIndex(array, predicate, fromIndex) {
  7905. var length = array == null ? 0 : array.length;
  7906. if (!length) {
  7907. return -1;
  7908. }
  7909. var index = length - 1;
  7910. if (fromIndex !== undefined) {
  7911. index = toInteger(fromIndex);
  7912. index = fromIndex < 0
  7913. ? nativeMax(length + index, 0)
  7914. : nativeMin(index, length - 1);
  7915. }
  7916. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7917. }
  7918. /**
  7919. * Flattens `array` a single level deep.
  7920. *
  7921. * @static
  7922. * @memberOf _
  7923. * @since 0.1.0
  7924. * @category Array
  7925. * @param {Array} array The array to flatten.
  7926. * @returns {Array} Returns the new flattened array.
  7927. * @example
  7928. *
  7929. * _.flatten([1, [2, [3, [4]], 5]]);
  7930. * // => [1, 2, [3, [4]], 5]
  7931. */
  7932. function flatten(array) {
  7933. var length = array == null ? 0 : array.length;
  7934. return length ? baseFlatten(array, 1) : [];
  7935. }
  7936. /**
  7937. * Recursively flattens `array`.
  7938. *
  7939. * @static
  7940. * @memberOf _
  7941. * @since 3.0.0
  7942. * @category Array
  7943. * @param {Array} array The array to flatten.
  7944. * @returns {Array} Returns the new flattened array.
  7945. * @example
  7946. *
  7947. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7948. * // => [1, 2, 3, 4, 5]
  7949. */
  7950. function flattenDeep(array) {
  7951. var length = array == null ? 0 : array.length;
  7952. return length ? baseFlatten(array, INFINITY) : [];
  7953. }
  7954. /**
  7955. * Recursively flatten `array` up to `depth` times.
  7956. *
  7957. * @static
  7958. * @memberOf _
  7959. * @since 4.4.0
  7960. * @category Array
  7961. * @param {Array} array The array to flatten.
  7962. * @param {number} [depth=1] The maximum recursion depth.
  7963. * @returns {Array} Returns the new flattened array.
  7964. * @example
  7965. *
  7966. * var array = [1, [2, [3, [4]], 5]];
  7967. *
  7968. * _.flattenDepth(array, 1);
  7969. * // => [1, 2, [3, [4]], 5]
  7970. *
  7971. * _.flattenDepth(array, 2);
  7972. * // => [1, 2, 3, [4], 5]
  7973. */
  7974. function flattenDepth(array, depth) {
  7975. var length = array == null ? 0 : array.length;
  7976. if (!length) {
  7977. return [];
  7978. }
  7979. depth = depth === undefined ? 1 : toInteger(depth);
  7980. return baseFlatten(array, depth);
  7981. }
  7982. /**
  7983. * The inverse of `_.toPairs`; this method returns an object composed
  7984. * from key-value `pairs`.
  7985. *
  7986. * @static
  7987. * @memberOf _
  7988. * @since 4.0.0
  7989. * @category Array
  7990. * @param {Array} pairs The key-value pairs.
  7991. * @returns {Object} Returns the new object.
  7992. * @example
  7993. *
  7994. * _.fromPairs([['a', 1], ['b', 2]]);
  7995. * // => { 'a': 1, 'b': 2 }
  7996. */
  7997. function fromPairs(pairs) {
  7998. var index = -1,
  7999. length = pairs == null ? 0 : pairs.length,
  8000. result = {};
  8001. while (++index < length) {
  8002. var pair = pairs[index];
  8003. result[pair[0]] = pair[1];
  8004. }
  8005. return result;
  8006. }
  8007. /**
  8008. * Gets the first element of `array`.
  8009. *
  8010. * @static
  8011. * @memberOf _
  8012. * @since 0.1.0
  8013. * @alias first
  8014. * @category Array
  8015. * @param {Array} array The array to query.
  8016. * @returns {*} Returns the first element of `array`.
  8017. * @example
  8018. *
  8019. * _.head([1, 2, 3]);
  8020. * // => 1
  8021. *
  8022. * _.head([]);
  8023. * // => undefined
  8024. */
  8025. function head(array) {
  8026. return (array && array.length) ? array[0] : undefined;
  8027. }
  8028. /**
  8029. * Gets the index at which the first occurrence of `value` is found in `array`
  8030. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8031. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8032. * offset from the end of `array`.
  8033. *
  8034. * @static
  8035. * @memberOf _
  8036. * @since 0.1.0
  8037. * @category Array
  8038. * @param {Array} array The array to inspect.
  8039. * @param {*} value The value to search for.
  8040. * @param {number} [fromIndex=0] The index to search from.
  8041. * @returns {number} Returns the index of the matched value, else `-1`.
  8042. * @example
  8043. *
  8044. * _.indexOf([1, 2, 1, 2], 2);
  8045. * // => 1
  8046. *
  8047. * // Search from the `fromIndex`.
  8048. * _.indexOf([1, 2, 1, 2], 2, 2);
  8049. * // => 3
  8050. */
  8051. function indexOf(array, value, fromIndex) {
  8052. var length = array == null ? 0 : array.length;
  8053. if (!length) {
  8054. return -1;
  8055. }
  8056. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8057. if (index < 0) {
  8058. index = nativeMax(length + index, 0);
  8059. }
  8060. return baseIndexOf(array, value, index);
  8061. }
  8062. /**
  8063. * Gets all but the last element of `array`.
  8064. *
  8065. * @static
  8066. * @memberOf _
  8067. * @since 0.1.0
  8068. * @category Array
  8069. * @param {Array} array The array to query.
  8070. * @returns {Array} Returns the slice of `array`.
  8071. * @example
  8072. *
  8073. * _.initial([1, 2, 3]);
  8074. * // => [1, 2]
  8075. */
  8076. function initial(array) {
  8077. var length = array == null ? 0 : array.length;
  8078. return length ? baseSlice(array, 0, -1) : [];
  8079. }
  8080. /**
  8081. * Creates an array of unique values that are included in all given arrays
  8082. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8083. * for equality comparisons. The order and references of result values are
  8084. * determined by the first array.
  8085. *
  8086. * @static
  8087. * @memberOf _
  8088. * @since 0.1.0
  8089. * @category Array
  8090. * @param {...Array} [arrays] The arrays to inspect.
  8091. * @returns {Array} Returns the new array of intersecting values.
  8092. * @example
  8093. *
  8094. * _.intersection([2, 1], [2, 3]);
  8095. * // => [2]
  8096. */
  8097. var intersection = baseRest(function(arrays) {
  8098. var mapped = arrayMap(arrays, castArrayLikeObject);
  8099. return (mapped.length && mapped[0] === arrays[0])
  8100. ? baseIntersection(mapped)
  8101. : [];
  8102. });
  8103. /**
  8104. * This method is like `_.intersection` except that it accepts `iteratee`
  8105. * which is invoked for each element of each `arrays` to generate the criterion
  8106. * by which they're compared. The order and references of result values are
  8107. * determined by the first array. The iteratee is invoked with one argument:
  8108. * (value).
  8109. *
  8110. * @static
  8111. * @memberOf _
  8112. * @since 4.0.0
  8113. * @category Array
  8114. * @param {...Array} [arrays] The arrays to inspect.
  8115. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8116. * @returns {Array} Returns the new array of intersecting values.
  8117. * @example
  8118. *
  8119. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8120. * // => [2.1]
  8121. *
  8122. * // The `_.property` iteratee shorthand.
  8123. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8124. * // => [{ 'x': 1 }]
  8125. */
  8126. var intersectionBy = baseRest(function(arrays) {
  8127. var iteratee = last(arrays),
  8128. mapped = arrayMap(arrays, castArrayLikeObject);
  8129. if (iteratee === last(mapped)) {
  8130. iteratee = undefined;
  8131. } else {
  8132. mapped.pop();
  8133. }
  8134. return (mapped.length && mapped[0] === arrays[0])
  8135. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8136. : [];
  8137. });
  8138. /**
  8139. * This method is like `_.intersection` except that it accepts `comparator`
  8140. * which is invoked to compare elements of `arrays`. The order and references
  8141. * of result values are determined by the first array. The comparator is
  8142. * invoked with two arguments: (arrVal, othVal).
  8143. *
  8144. * @static
  8145. * @memberOf _
  8146. * @since 4.0.0
  8147. * @category Array
  8148. * @param {...Array} [arrays] The arrays to inspect.
  8149. * @param {Function} [comparator] The comparator invoked per element.
  8150. * @returns {Array} Returns the new array of intersecting values.
  8151. * @example
  8152. *
  8153. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8154. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8155. *
  8156. * _.intersectionWith(objects, others, _.isEqual);
  8157. * // => [{ 'x': 1, 'y': 2 }]
  8158. */
  8159. var intersectionWith = baseRest(function(arrays) {
  8160. var comparator = last(arrays),
  8161. mapped = arrayMap(arrays, castArrayLikeObject);
  8162. comparator = typeof comparator == 'function' ? comparator : undefined;
  8163. if (comparator) {
  8164. mapped.pop();
  8165. }
  8166. return (mapped.length && mapped[0] === arrays[0])
  8167. ? baseIntersection(mapped, undefined, comparator)
  8168. : [];
  8169. });
  8170. /**
  8171. * Converts all elements in `array` into a string separated by `separator`.
  8172. *
  8173. * @static
  8174. * @memberOf _
  8175. * @since 4.0.0
  8176. * @category Array
  8177. * @param {Array} array The array to convert.
  8178. * @param {string} [separator=','] The element separator.
  8179. * @returns {string} Returns the joined string.
  8180. * @example
  8181. *
  8182. * _.join(['a', 'b', 'c'], '~');
  8183. * // => 'a~b~c'
  8184. */
  8185. function join(array, separator) {
  8186. return array == null ? '' : nativeJoin.call(array, separator);
  8187. }
  8188. /**
  8189. * Gets the last element of `array`.
  8190. *
  8191. * @static
  8192. * @memberOf _
  8193. * @since 0.1.0
  8194. * @category Array
  8195. * @param {Array} array The array to query.
  8196. * @returns {*} Returns the last element of `array`.
  8197. * @example
  8198. *
  8199. * _.last([1, 2, 3]);
  8200. * // => 3
  8201. */
  8202. function last(array) {
  8203. var length = array == null ? 0 : array.length;
  8204. return length ? array[length - 1] : undefined;
  8205. }
  8206. /**
  8207. * This method is like `_.indexOf` except that it iterates over elements of
  8208. * `array` from right to left.
  8209. *
  8210. * @static
  8211. * @memberOf _
  8212. * @since 0.1.0
  8213. * @category Array
  8214. * @param {Array} array The array to inspect.
  8215. * @param {*} value The value to search for.
  8216. * @param {number} [fromIndex=array.length-1] The index to search from.
  8217. * @returns {number} Returns the index of the matched value, else `-1`.
  8218. * @example
  8219. *
  8220. * _.lastIndexOf([1, 2, 1, 2], 2);
  8221. * // => 3
  8222. *
  8223. * // Search from the `fromIndex`.
  8224. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8225. * // => 1
  8226. */
  8227. function lastIndexOf(array, value, fromIndex) {
  8228. var length = array == null ? 0 : array.length;
  8229. if (!length) {
  8230. return -1;
  8231. }
  8232. var index = length;
  8233. if (fromIndex !== undefined) {
  8234. index = toInteger(fromIndex);
  8235. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8236. }
  8237. return value === value
  8238. ? strictLastIndexOf(array, value, index)
  8239. : baseFindIndex(array, baseIsNaN, index, true);
  8240. }
  8241. /**
  8242. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8243. * element from the end is returned.
  8244. *
  8245. * @static
  8246. * @memberOf _
  8247. * @since 4.11.0
  8248. * @category Array
  8249. * @param {Array} array The array to query.
  8250. * @param {number} [n=0] The index of the element to return.
  8251. * @returns {*} Returns the nth element of `array`.
  8252. * @example
  8253. *
  8254. * var array = ['a', 'b', 'c', 'd'];
  8255. *
  8256. * _.nth(array, 1);
  8257. * // => 'b'
  8258. *
  8259. * _.nth(array, -2);
  8260. * // => 'c';
  8261. */
  8262. function nth(array, n) {
  8263. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8264. }
  8265. /**
  8266. * Removes all given values from `array` using
  8267. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8268. * for equality comparisons.
  8269. *
  8270. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8271. * to remove elements from an array by predicate.
  8272. *
  8273. * @static
  8274. * @memberOf _
  8275. * @since 2.0.0
  8276. * @category Array
  8277. * @param {Array} array The array to modify.
  8278. * @param {...*} [values] The values to remove.
  8279. * @returns {Array} Returns `array`.
  8280. * @example
  8281. *
  8282. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8283. *
  8284. * _.pull(array, 'a', 'c');
  8285. * console.log(array);
  8286. * // => ['b', 'b']
  8287. */
  8288. var pull = baseRest(pullAll);
  8289. /**
  8290. * This method is like `_.pull` except that it accepts an array of values to remove.
  8291. *
  8292. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8293. *
  8294. * @static
  8295. * @memberOf _
  8296. * @since 4.0.0
  8297. * @category Array
  8298. * @param {Array} array The array to modify.
  8299. * @param {Array} values The values to remove.
  8300. * @returns {Array} Returns `array`.
  8301. * @example
  8302. *
  8303. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8304. *
  8305. * _.pullAll(array, ['a', 'c']);
  8306. * console.log(array);
  8307. * // => ['b', 'b']
  8308. */
  8309. function pullAll(array, values) {
  8310. return (array && array.length && values && values.length)
  8311. ? basePullAll(array, values)
  8312. : array;
  8313. }
  8314. /**
  8315. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8316. * invoked for each element of `array` and `values` to generate the criterion
  8317. * by which they're compared. The iteratee is invoked with one argument: (value).
  8318. *
  8319. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8320. *
  8321. * @static
  8322. * @memberOf _
  8323. * @since 4.0.0
  8324. * @category Array
  8325. * @param {Array} array The array to modify.
  8326. * @param {Array} values The values to remove.
  8327. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8328. * @returns {Array} Returns `array`.
  8329. * @example
  8330. *
  8331. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8332. *
  8333. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8334. * console.log(array);
  8335. * // => [{ 'x': 2 }]
  8336. */
  8337. function pullAllBy(array, values, iteratee) {
  8338. return (array && array.length && values && values.length)
  8339. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8340. : array;
  8341. }
  8342. /**
  8343. * This method is like `_.pullAll` except that it accepts `comparator` which
  8344. * is invoked to compare elements of `array` to `values`. The comparator is
  8345. * invoked with two arguments: (arrVal, othVal).
  8346. *
  8347. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8348. *
  8349. * @static
  8350. * @memberOf _
  8351. * @since 4.6.0
  8352. * @category Array
  8353. * @param {Array} array The array to modify.
  8354. * @param {Array} values The values to remove.
  8355. * @param {Function} [comparator] The comparator invoked per element.
  8356. * @returns {Array} Returns `array`.
  8357. * @example
  8358. *
  8359. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8360. *
  8361. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8362. * console.log(array);
  8363. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8364. */
  8365. function pullAllWith(array, values, comparator) {
  8366. return (array && array.length && values && values.length)
  8367. ? basePullAll(array, values, undefined, comparator)
  8368. : array;
  8369. }
  8370. /**
  8371. * Removes elements from `array` corresponding to `indexes` and returns an
  8372. * array of removed elements.
  8373. *
  8374. * **Note:** Unlike `_.at`, this method mutates `array`.
  8375. *
  8376. * @static
  8377. * @memberOf _
  8378. * @since 3.0.0
  8379. * @category Array
  8380. * @param {Array} array The array to modify.
  8381. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8382. * @returns {Array} Returns the new array of removed elements.
  8383. * @example
  8384. *
  8385. * var array = ['a', 'b', 'c', 'd'];
  8386. * var pulled = _.pullAt(array, [1, 3]);
  8387. *
  8388. * console.log(array);
  8389. * // => ['a', 'c']
  8390. *
  8391. * console.log(pulled);
  8392. * // => ['b', 'd']
  8393. */
  8394. var pullAt = flatRest(function(array, indexes) {
  8395. var length = array == null ? 0 : array.length,
  8396. result = baseAt(array, indexes);
  8397. basePullAt(array, arrayMap(indexes, function(index) {
  8398. return isIndex(index, length) ? +index : index;
  8399. }).sort(compareAscending));
  8400. return result;
  8401. });
  8402. /**
  8403. * Removes all elements from `array` that `predicate` returns truthy for
  8404. * and returns an array of the removed elements. The predicate is invoked
  8405. * with three arguments: (value, index, array).
  8406. *
  8407. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8408. * to pull elements from an array by value.
  8409. *
  8410. * @static
  8411. * @memberOf _
  8412. * @since 2.0.0
  8413. * @category Array
  8414. * @param {Array} array The array to modify.
  8415. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8416. * @returns {Array} Returns the new array of removed elements.
  8417. * @example
  8418. *
  8419. * var array = [1, 2, 3, 4];
  8420. * var evens = _.remove(array, function(n) {
  8421. * return n % 2 == 0;
  8422. * });
  8423. *
  8424. * console.log(array);
  8425. * // => [1, 3]
  8426. *
  8427. * console.log(evens);
  8428. * // => [2, 4]
  8429. */
  8430. function remove(array, predicate) {
  8431. var result = [];
  8432. if (!(array && array.length)) {
  8433. return result;
  8434. }
  8435. var index = -1,
  8436. indexes = [],
  8437. length = array.length;
  8438. predicate = getIteratee(predicate, 3);
  8439. while (++index < length) {
  8440. var value = array[index];
  8441. if (predicate(value, index, array)) {
  8442. result.push(value);
  8443. indexes.push(index);
  8444. }
  8445. }
  8446. basePullAt(array, indexes);
  8447. return result;
  8448. }
  8449. /**
  8450. * Reverses `array` so that the first element becomes the last, the second
  8451. * element becomes the second to last, and so on.
  8452. *
  8453. * **Note:** This method mutates `array` and is based on
  8454. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8455. *
  8456. * @static
  8457. * @memberOf _
  8458. * @since 4.0.0
  8459. * @category Array
  8460. * @param {Array} array The array to modify.
  8461. * @returns {Array} Returns `array`.
  8462. * @example
  8463. *
  8464. * var array = [1, 2, 3];
  8465. *
  8466. * _.reverse(array);
  8467. * // => [3, 2, 1]
  8468. *
  8469. * console.log(array);
  8470. * // => [3, 2, 1]
  8471. */
  8472. function reverse(array) {
  8473. return array == null ? array : nativeReverse.call(array);
  8474. }
  8475. /**
  8476. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8477. *
  8478. * **Note:** This method is used instead of
  8479. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8480. * returned.
  8481. *
  8482. * @static
  8483. * @memberOf _
  8484. * @since 3.0.0
  8485. * @category Array
  8486. * @param {Array} array The array to slice.
  8487. * @param {number} [start=0] The start position.
  8488. * @param {number} [end=array.length] The end position.
  8489. * @returns {Array} Returns the slice of `array`.
  8490. */
  8491. function slice(array, start, end) {
  8492. var length = array == null ? 0 : array.length;
  8493. if (!length) {
  8494. return [];
  8495. }
  8496. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8497. start = 0;
  8498. end = length;
  8499. }
  8500. else {
  8501. start = start == null ? 0 : toInteger(start);
  8502. end = end === undefined ? length : toInteger(end);
  8503. }
  8504. return baseSlice(array, start, end);
  8505. }
  8506. /**
  8507. * Uses a binary search to determine the lowest index at which `value`
  8508. * should be inserted into `array` in order to maintain its sort order.
  8509. *
  8510. * @static
  8511. * @memberOf _
  8512. * @since 0.1.0
  8513. * @category Array
  8514. * @param {Array} array The sorted array to inspect.
  8515. * @param {*} value The value to evaluate.
  8516. * @returns {number} Returns the index at which `value` should be inserted
  8517. * into `array`.
  8518. * @example
  8519. *
  8520. * _.sortedIndex([30, 50], 40);
  8521. * // => 1
  8522. */
  8523. function sortedIndex(array, value) {
  8524. return baseSortedIndex(array, value);
  8525. }
  8526. /**
  8527. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8528. * which is invoked for `value` and each element of `array` to compute their
  8529. * sort ranking. The iteratee is invoked with one argument: (value).
  8530. *
  8531. * @static
  8532. * @memberOf _
  8533. * @since 4.0.0
  8534. * @category Array
  8535. * @param {Array} array The sorted array to inspect.
  8536. * @param {*} value The value to evaluate.
  8537. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8538. * @returns {number} Returns the index at which `value` should be inserted
  8539. * into `array`.
  8540. * @example
  8541. *
  8542. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8543. *
  8544. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8545. * // => 0
  8546. *
  8547. * // The `_.property` iteratee shorthand.
  8548. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8549. * // => 0
  8550. */
  8551. function sortedIndexBy(array, value, iteratee) {
  8552. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8553. }
  8554. /**
  8555. * This method is like `_.indexOf` except that it performs a binary
  8556. * search on a sorted `array`.
  8557. *
  8558. * @static
  8559. * @memberOf _
  8560. * @since 4.0.0
  8561. * @category Array
  8562. * @param {Array} array The array to inspect.
  8563. * @param {*} value The value to search for.
  8564. * @returns {number} Returns the index of the matched value, else `-1`.
  8565. * @example
  8566. *
  8567. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8568. * // => 1
  8569. */
  8570. function sortedIndexOf(array, value) {
  8571. var length = array == null ? 0 : array.length;
  8572. if (length) {
  8573. var index = baseSortedIndex(array, value);
  8574. if (index < length && eq(array[index], value)) {
  8575. return index;
  8576. }
  8577. }
  8578. return -1;
  8579. }
  8580. /**
  8581. * This method is like `_.sortedIndex` except that it returns the highest
  8582. * index at which `value` should be inserted into `array` in order to
  8583. * maintain its sort order.
  8584. *
  8585. * @static
  8586. * @memberOf _
  8587. * @since 3.0.0
  8588. * @category Array
  8589. * @param {Array} array The sorted array to inspect.
  8590. * @param {*} value The value to evaluate.
  8591. * @returns {number} Returns the index at which `value` should be inserted
  8592. * into `array`.
  8593. * @example
  8594. *
  8595. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8596. * // => 4
  8597. */
  8598. function sortedLastIndex(array, value) {
  8599. return baseSortedIndex(array, value, true);
  8600. }
  8601. /**
  8602. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8603. * which is invoked for `value` and each element of `array` to compute their
  8604. * sort ranking. The iteratee is invoked with one argument: (value).
  8605. *
  8606. * @static
  8607. * @memberOf _
  8608. * @since 4.0.0
  8609. * @category Array
  8610. * @param {Array} array The sorted array to inspect.
  8611. * @param {*} value The value to evaluate.
  8612. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8613. * @returns {number} Returns the index at which `value` should be inserted
  8614. * into `array`.
  8615. * @example
  8616. *
  8617. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8618. *
  8619. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8620. * // => 1
  8621. *
  8622. * // The `_.property` iteratee shorthand.
  8623. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8624. * // => 1
  8625. */
  8626. function sortedLastIndexBy(array, value, iteratee) {
  8627. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8628. }
  8629. /**
  8630. * This method is like `_.lastIndexOf` except that it performs a binary
  8631. * search on a sorted `array`.
  8632. *
  8633. * @static
  8634. * @memberOf _
  8635. * @since 4.0.0
  8636. * @category Array
  8637. * @param {Array} array The array to inspect.
  8638. * @param {*} value The value to search for.
  8639. * @returns {number} Returns the index of the matched value, else `-1`.
  8640. * @example
  8641. *
  8642. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8643. * // => 3
  8644. */
  8645. function sortedLastIndexOf(array, value) {
  8646. var length = array == null ? 0 : array.length;
  8647. if (length) {
  8648. var index = baseSortedIndex(array, value, true) - 1;
  8649. if (eq(array[index], value)) {
  8650. return index;
  8651. }
  8652. }
  8653. return -1;
  8654. }
  8655. /**
  8656. * This method is like `_.uniq` except that it's designed and optimized
  8657. * for sorted arrays.
  8658. *
  8659. * @static
  8660. * @memberOf _
  8661. * @since 4.0.0
  8662. * @category Array
  8663. * @param {Array} array The array to inspect.
  8664. * @returns {Array} Returns the new duplicate free array.
  8665. * @example
  8666. *
  8667. * _.sortedUniq([1, 1, 2]);
  8668. * // => [1, 2]
  8669. */
  8670. function sortedUniq(array) {
  8671. return (array && array.length)
  8672. ? baseSortedUniq(array)
  8673. : [];
  8674. }
  8675. /**
  8676. * This method is like `_.uniqBy` except that it's designed and optimized
  8677. * for sorted arrays.
  8678. *
  8679. * @static
  8680. * @memberOf _
  8681. * @since 4.0.0
  8682. * @category Array
  8683. * @param {Array} array The array to inspect.
  8684. * @param {Function} [iteratee] The iteratee invoked per element.
  8685. * @returns {Array} Returns the new duplicate free array.
  8686. * @example
  8687. *
  8688. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8689. * // => [1.1, 2.3]
  8690. */
  8691. function sortedUniqBy(array, iteratee) {
  8692. return (array && array.length)
  8693. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8694. : [];
  8695. }
  8696. /**
  8697. * Gets all but the first element of `array`.
  8698. *
  8699. * @static
  8700. * @memberOf _
  8701. * @since 4.0.0
  8702. * @category Array
  8703. * @param {Array} array The array to query.
  8704. * @returns {Array} Returns the slice of `array`.
  8705. * @example
  8706. *
  8707. * _.tail([1, 2, 3]);
  8708. * // => [2, 3]
  8709. */
  8710. function tail(array) {
  8711. var length = array == null ? 0 : array.length;
  8712. return length ? baseSlice(array, 1, length) : [];
  8713. }
  8714. /**
  8715. * Creates a slice of `array` with `n` elements taken from the beginning.
  8716. *
  8717. * @static
  8718. * @memberOf _
  8719. * @since 0.1.0
  8720. * @category Array
  8721. * @param {Array} array The array to query.
  8722. * @param {number} [n=1] The number of elements to take.
  8723. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8724. * @returns {Array} Returns the slice of `array`.
  8725. * @example
  8726. *
  8727. * _.take([1, 2, 3]);
  8728. * // => [1]
  8729. *
  8730. * _.take([1, 2, 3], 2);
  8731. * // => [1, 2]
  8732. *
  8733. * _.take([1, 2, 3], 5);
  8734. * // => [1, 2, 3]
  8735. *
  8736. * _.take([1, 2, 3], 0);
  8737. * // => []
  8738. */
  8739. function take(array, n, guard) {
  8740. if (!(array && array.length)) {
  8741. return [];
  8742. }
  8743. n = (guard || n === undefined) ? 1 : toInteger(n);
  8744. return baseSlice(array, 0, n < 0 ? 0 : n);
  8745. }
  8746. /**
  8747. * Creates a slice of `array` with `n` elements taken from the end.
  8748. *
  8749. * @static
  8750. * @memberOf _
  8751. * @since 3.0.0
  8752. * @category Array
  8753. * @param {Array} array The array to query.
  8754. * @param {number} [n=1] The number of elements to take.
  8755. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8756. * @returns {Array} Returns the slice of `array`.
  8757. * @example
  8758. *
  8759. * _.takeRight([1, 2, 3]);
  8760. * // => [3]
  8761. *
  8762. * _.takeRight([1, 2, 3], 2);
  8763. * // => [2, 3]
  8764. *
  8765. * _.takeRight([1, 2, 3], 5);
  8766. * // => [1, 2, 3]
  8767. *
  8768. * _.takeRight([1, 2, 3], 0);
  8769. * // => []
  8770. */
  8771. function takeRight(array, n, guard) {
  8772. var length = array == null ? 0 : array.length;
  8773. if (!length) {
  8774. return [];
  8775. }
  8776. n = (guard || n === undefined) ? 1 : toInteger(n);
  8777. n = length - n;
  8778. return baseSlice(array, n < 0 ? 0 : n, length);
  8779. }
  8780. /**
  8781. * Creates a slice of `array` with elements taken from the end. Elements are
  8782. * taken until `predicate` returns falsey. The predicate is invoked with
  8783. * three arguments: (value, index, array).
  8784. *
  8785. * @static
  8786. * @memberOf _
  8787. * @since 3.0.0
  8788. * @category Array
  8789. * @param {Array} array The array to query.
  8790. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8791. * @returns {Array} Returns the slice of `array`.
  8792. * @example
  8793. *
  8794. * var users = [
  8795. * { 'user': 'barney', 'active': true },
  8796. * { 'user': 'fred', 'active': false },
  8797. * { 'user': 'pebbles', 'active': false }
  8798. * ];
  8799. *
  8800. * _.takeRightWhile(users, function(o) { return !o.active; });
  8801. * // => objects for ['fred', 'pebbles']
  8802. *
  8803. * // The `_.matches` iteratee shorthand.
  8804. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8805. * // => objects for ['pebbles']
  8806. *
  8807. * // The `_.matchesProperty` iteratee shorthand.
  8808. * _.takeRightWhile(users, ['active', false]);
  8809. * // => objects for ['fred', 'pebbles']
  8810. *
  8811. * // The `_.property` iteratee shorthand.
  8812. * _.takeRightWhile(users, 'active');
  8813. * // => []
  8814. */
  8815. function takeRightWhile(array, predicate) {
  8816. return (array && array.length)
  8817. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8818. : [];
  8819. }
  8820. /**
  8821. * Creates a slice of `array` with elements taken from the beginning. Elements
  8822. * are taken until `predicate` returns falsey. The predicate is invoked with
  8823. * three arguments: (value, index, array).
  8824. *
  8825. * @static
  8826. * @memberOf _
  8827. * @since 3.0.0
  8828. * @category Array
  8829. * @param {Array} array The array to query.
  8830. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8831. * @returns {Array} Returns the slice of `array`.
  8832. * @example
  8833. *
  8834. * var users = [
  8835. * { 'user': 'barney', 'active': false },
  8836. * { 'user': 'fred', 'active': false },
  8837. * { 'user': 'pebbles', 'active': true }
  8838. * ];
  8839. *
  8840. * _.takeWhile(users, function(o) { return !o.active; });
  8841. * // => objects for ['barney', 'fred']
  8842. *
  8843. * // The `_.matches` iteratee shorthand.
  8844. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8845. * // => objects for ['barney']
  8846. *
  8847. * // The `_.matchesProperty` iteratee shorthand.
  8848. * _.takeWhile(users, ['active', false]);
  8849. * // => objects for ['barney', 'fred']
  8850. *
  8851. * // The `_.property` iteratee shorthand.
  8852. * _.takeWhile(users, 'active');
  8853. * // => []
  8854. */
  8855. function takeWhile(array, predicate) {
  8856. return (array && array.length)
  8857. ? baseWhile(array, getIteratee(predicate, 3))
  8858. : [];
  8859. }
  8860. /**
  8861. * Creates an array of unique values, in order, from all given arrays using
  8862. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8863. * for equality comparisons.
  8864. *
  8865. * @static
  8866. * @memberOf _
  8867. * @since 0.1.0
  8868. * @category Array
  8869. * @param {...Array} [arrays] The arrays to inspect.
  8870. * @returns {Array} Returns the new array of combined values.
  8871. * @example
  8872. *
  8873. * _.union([2], [1, 2]);
  8874. * // => [2, 1]
  8875. */
  8876. var union = baseRest(function(arrays) {
  8877. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8878. });
  8879. /**
  8880. * This method is like `_.union` except that it accepts `iteratee` which is
  8881. * invoked for each element of each `arrays` to generate the criterion by
  8882. * which uniqueness is computed. Result values are chosen from the first
  8883. * array in which the value occurs. The iteratee is invoked with one argument:
  8884. * (value).
  8885. *
  8886. * @static
  8887. * @memberOf _
  8888. * @since 4.0.0
  8889. * @category Array
  8890. * @param {...Array} [arrays] The arrays to inspect.
  8891. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8892. * @returns {Array} Returns the new array of combined values.
  8893. * @example
  8894. *
  8895. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8896. * // => [2.1, 1.2]
  8897. *
  8898. * // The `_.property` iteratee shorthand.
  8899. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8900. * // => [{ 'x': 1 }, { 'x': 2 }]
  8901. */
  8902. var unionBy = baseRest(function(arrays) {
  8903. var iteratee = last(arrays);
  8904. if (isArrayLikeObject(iteratee)) {
  8905. iteratee = undefined;
  8906. }
  8907. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8908. });
  8909. /**
  8910. * This method is like `_.union` except that it accepts `comparator` which
  8911. * is invoked to compare elements of `arrays`. Result values are chosen from
  8912. * the first array in which the value occurs. The comparator is invoked
  8913. * with two arguments: (arrVal, othVal).
  8914. *
  8915. * @static
  8916. * @memberOf _
  8917. * @since 4.0.0
  8918. * @category Array
  8919. * @param {...Array} [arrays] The arrays to inspect.
  8920. * @param {Function} [comparator] The comparator invoked per element.
  8921. * @returns {Array} Returns the new array of combined values.
  8922. * @example
  8923. *
  8924. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8925. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8926. *
  8927. * _.unionWith(objects, others, _.isEqual);
  8928. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8929. */
  8930. var unionWith = baseRest(function(arrays) {
  8931. var comparator = last(arrays);
  8932. comparator = typeof comparator == 'function' ? comparator : undefined;
  8933. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8934. });
  8935. /**
  8936. * Creates a duplicate-free version of an array, using
  8937. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8938. * for equality comparisons, in which only the first occurrence of each element
  8939. * is kept. The order of result values is determined by the order they occur
  8940. * in the array.
  8941. *
  8942. * @static
  8943. * @memberOf _
  8944. * @since 0.1.0
  8945. * @category Array
  8946. * @param {Array} array The array to inspect.
  8947. * @returns {Array} Returns the new duplicate free array.
  8948. * @example
  8949. *
  8950. * _.uniq([2, 1, 2]);
  8951. * // => [2, 1]
  8952. */
  8953. function uniq(array) {
  8954. return (array && array.length) ? baseUniq(array) : [];
  8955. }
  8956. /**
  8957. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8958. * invoked for each element in `array` to generate the criterion by which
  8959. * uniqueness is computed. The order of result values is determined by the
  8960. * order they occur in the array. The iteratee is invoked with one argument:
  8961. * (value).
  8962. *
  8963. * @static
  8964. * @memberOf _
  8965. * @since 4.0.0
  8966. * @category Array
  8967. * @param {Array} array The array to inspect.
  8968. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8969. * @returns {Array} Returns the new duplicate free array.
  8970. * @example
  8971. *
  8972. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8973. * // => [2.1, 1.2]
  8974. *
  8975. * // The `_.property` iteratee shorthand.
  8976. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8977. * // => [{ 'x': 1 }, { 'x': 2 }]
  8978. */
  8979. function uniqBy(array, iteratee) {
  8980. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8981. }
  8982. /**
  8983. * This method is like `_.uniq` except that it accepts `comparator` which
  8984. * is invoked to compare elements of `array`. The order of result values is
  8985. * determined by the order they occur in the array.The comparator is invoked
  8986. * with two arguments: (arrVal, othVal).
  8987. *
  8988. * @static
  8989. * @memberOf _
  8990. * @since 4.0.0
  8991. * @category Array
  8992. * @param {Array} array The array to inspect.
  8993. * @param {Function} [comparator] The comparator invoked per element.
  8994. * @returns {Array} Returns the new duplicate free array.
  8995. * @example
  8996. *
  8997. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8998. *
  8999. * _.uniqWith(objects, _.isEqual);
  9000. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9001. */
  9002. function uniqWith(array, comparator) {
  9003. comparator = typeof comparator == 'function' ? comparator : undefined;
  9004. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9005. }
  9006. /**
  9007. * This method is like `_.zip` except that it accepts an array of grouped
  9008. * elements and creates an array regrouping the elements to their pre-zip
  9009. * configuration.
  9010. *
  9011. * @static
  9012. * @memberOf _
  9013. * @since 1.2.0
  9014. * @category Array
  9015. * @param {Array} array The array of grouped elements to process.
  9016. * @returns {Array} Returns the new array of regrouped elements.
  9017. * @example
  9018. *
  9019. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9020. * // => [['a', 1, true], ['b', 2, false]]
  9021. *
  9022. * _.unzip(zipped);
  9023. * // => [['a', 'b'], [1, 2], [true, false]]
  9024. */
  9025. function unzip(array) {
  9026. if (!(array && array.length)) {
  9027. return [];
  9028. }
  9029. var length = 0;
  9030. array = arrayFilter(array, function(group) {
  9031. if (isArrayLikeObject(group)) {
  9032. length = nativeMax(group.length, length);
  9033. return true;
  9034. }
  9035. });
  9036. return baseTimes(length, function(index) {
  9037. return arrayMap(array, baseProperty(index));
  9038. });
  9039. }
  9040. /**
  9041. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9042. * how regrouped values should be combined. The iteratee is invoked with the
  9043. * elements of each group: (...group).
  9044. *
  9045. * @static
  9046. * @memberOf _
  9047. * @since 3.8.0
  9048. * @category Array
  9049. * @param {Array} array The array of grouped elements to process.
  9050. * @param {Function} [iteratee=_.identity] The function to combine
  9051. * regrouped values.
  9052. * @returns {Array} Returns the new array of regrouped elements.
  9053. * @example
  9054. *
  9055. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9056. * // => [[1, 10, 100], [2, 20, 200]]
  9057. *
  9058. * _.unzipWith(zipped, _.add);
  9059. * // => [3, 30, 300]
  9060. */
  9061. function unzipWith(array, iteratee) {
  9062. if (!(array && array.length)) {
  9063. return [];
  9064. }
  9065. var result = unzip(array);
  9066. if (iteratee == null) {
  9067. return result;
  9068. }
  9069. return arrayMap(result, function(group) {
  9070. return apply(iteratee, undefined, group);
  9071. });
  9072. }
  9073. /**
  9074. * Creates an array excluding all given values using
  9075. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9076. * for equality comparisons.
  9077. *
  9078. * **Note:** Unlike `_.pull`, this method returns a new array.
  9079. *
  9080. * @static
  9081. * @memberOf _
  9082. * @since 0.1.0
  9083. * @category Array
  9084. * @param {Array} array The array to inspect.
  9085. * @param {...*} [values] The values to exclude.
  9086. * @returns {Array} Returns the new array of filtered values.
  9087. * @see _.difference, _.xor
  9088. * @example
  9089. *
  9090. * _.without([2, 1, 2, 3], 1, 2);
  9091. * // => [3]
  9092. */
  9093. var without = baseRest(function(array, values) {
  9094. return isArrayLikeObject(array)
  9095. ? baseDifference(array, values)
  9096. : [];
  9097. });
  9098. /**
  9099. * Creates an array of unique values that is the
  9100. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9101. * of the given arrays. The order of result values is determined by the order
  9102. * they occur in the arrays.
  9103. *
  9104. * @static
  9105. * @memberOf _
  9106. * @since 2.4.0
  9107. * @category Array
  9108. * @param {...Array} [arrays] The arrays to inspect.
  9109. * @returns {Array} Returns the new array of filtered values.
  9110. * @see _.difference, _.without
  9111. * @example
  9112. *
  9113. * _.xor([2, 1], [2, 3]);
  9114. * // => [1, 3]
  9115. */
  9116. var xor = baseRest(function(arrays) {
  9117. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9118. });
  9119. /**
  9120. * This method is like `_.xor` except that it accepts `iteratee` which is
  9121. * invoked for each element of each `arrays` to generate the criterion by
  9122. * which by which they're compared. The order of result values is determined
  9123. * by the order they occur in the arrays. The iteratee is invoked with one
  9124. * argument: (value).
  9125. *
  9126. * @static
  9127. * @memberOf _
  9128. * @since 4.0.0
  9129. * @category Array
  9130. * @param {...Array} [arrays] The arrays to inspect.
  9131. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9132. * @returns {Array} Returns the new array of filtered values.
  9133. * @example
  9134. *
  9135. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9136. * // => [1.2, 3.4]
  9137. *
  9138. * // The `_.property` iteratee shorthand.
  9139. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9140. * // => [{ 'x': 2 }]
  9141. */
  9142. var xorBy = baseRest(function(arrays) {
  9143. var iteratee = last(arrays);
  9144. if (isArrayLikeObject(iteratee)) {
  9145. iteratee = undefined;
  9146. }
  9147. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9148. });
  9149. /**
  9150. * This method is like `_.xor` except that it accepts `comparator` which is
  9151. * invoked to compare elements of `arrays`. The order of result values is
  9152. * determined by the order they occur in the arrays. The comparator is invoked
  9153. * with two arguments: (arrVal, othVal).
  9154. *
  9155. * @static
  9156. * @memberOf _
  9157. * @since 4.0.0
  9158. * @category Array
  9159. * @param {...Array} [arrays] The arrays to inspect.
  9160. * @param {Function} [comparator] The comparator invoked per element.
  9161. * @returns {Array} Returns the new array of filtered values.
  9162. * @example
  9163. *
  9164. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9165. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9166. *
  9167. * _.xorWith(objects, others, _.isEqual);
  9168. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9169. */
  9170. var xorWith = baseRest(function(arrays) {
  9171. var comparator = last(arrays);
  9172. comparator = typeof comparator == 'function' ? comparator : undefined;
  9173. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9174. });
  9175. /**
  9176. * Creates an array of grouped elements, the first of which contains the
  9177. * first elements of the given arrays, the second of which contains the
  9178. * second elements of the given arrays, and so on.
  9179. *
  9180. * @static
  9181. * @memberOf _
  9182. * @since 0.1.0
  9183. * @category Array
  9184. * @param {...Array} [arrays] The arrays to process.
  9185. * @returns {Array} Returns the new array of grouped elements.
  9186. * @example
  9187. *
  9188. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9189. * // => [['a', 1, true], ['b', 2, false]]
  9190. */
  9191. var zip = baseRest(unzip);
  9192. /**
  9193. * This method is like `_.fromPairs` except that it accepts two arrays,
  9194. * one of property identifiers and one of corresponding values.
  9195. *
  9196. * @static
  9197. * @memberOf _
  9198. * @since 0.4.0
  9199. * @category Array
  9200. * @param {Array} [props=[]] The property identifiers.
  9201. * @param {Array} [values=[]] The property values.
  9202. * @returns {Object} Returns the new object.
  9203. * @example
  9204. *
  9205. * _.zipObject(['a', 'b'], [1, 2]);
  9206. * // => { 'a': 1, 'b': 2 }
  9207. */
  9208. function zipObject(props, values) {
  9209. return baseZipObject(props || [], values || [], assignValue);
  9210. }
  9211. /**
  9212. * This method is like `_.zipObject` except that it supports property paths.
  9213. *
  9214. * @static
  9215. * @memberOf _
  9216. * @since 4.1.0
  9217. * @category Array
  9218. * @param {Array} [props=[]] The property identifiers.
  9219. * @param {Array} [values=[]] The property values.
  9220. * @returns {Object} Returns the new object.
  9221. * @example
  9222. *
  9223. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9224. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9225. */
  9226. function zipObjectDeep(props, values) {
  9227. return baseZipObject(props || [], values || [], baseSet);
  9228. }
  9229. /**
  9230. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9231. * how grouped values should be combined. The iteratee is invoked with the
  9232. * elements of each group: (...group).
  9233. *
  9234. * @static
  9235. * @memberOf _
  9236. * @since 3.8.0
  9237. * @category Array
  9238. * @param {...Array} [arrays] The arrays to process.
  9239. * @param {Function} [iteratee=_.identity] The function to combine
  9240. * grouped values.
  9241. * @returns {Array} Returns the new array of grouped elements.
  9242. * @example
  9243. *
  9244. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9245. * return a + b + c;
  9246. * });
  9247. * // => [111, 222]
  9248. */
  9249. var zipWith = baseRest(function(arrays) {
  9250. var length = arrays.length,
  9251. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9252. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9253. return unzipWith(arrays, iteratee);
  9254. });
  9255. /*------------------------------------------------------------------------*/
  9256. /**
  9257. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9258. * chain sequences enabled. The result of such sequences must be unwrapped
  9259. * with `_#value`.
  9260. *
  9261. * @static
  9262. * @memberOf _
  9263. * @since 1.3.0
  9264. * @category Seq
  9265. * @param {*} value The value to wrap.
  9266. * @returns {Object} Returns the new `lodash` wrapper instance.
  9267. * @example
  9268. *
  9269. * var users = [
  9270. * { 'user': 'barney', 'age': 36 },
  9271. * { 'user': 'fred', 'age': 40 },
  9272. * { 'user': 'pebbles', 'age': 1 }
  9273. * ];
  9274. *
  9275. * var youngest = _
  9276. * .chain(users)
  9277. * .sortBy('age')
  9278. * .map(function(o) {
  9279. * return o.user + ' is ' + o.age;
  9280. * })
  9281. * .head()
  9282. * .value();
  9283. * // => 'pebbles is 1'
  9284. */
  9285. function chain(value) {
  9286. var result = lodash(value);
  9287. result.__chain__ = true;
  9288. return result;
  9289. }
  9290. /**
  9291. * This method invokes `interceptor` and returns `value`. The interceptor
  9292. * is invoked with one argument; (value). The purpose of this method is to
  9293. * "tap into" a method chain sequence in order to modify intermediate results.
  9294. *
  9295. * @static
  9296. * @memberOf _
  9297. * @since 0.1.0
  9298. * @category Seq
  9299. * @param {*} value The value to provide to `interceptor`.
  9300. * @param {Function} interceptor The function to invoke.
  9301. * @returns {*} Returns `value`.
  9302. * @example
  9303. *
  9304. * _([1, 2, 3])
  9305. * .tap(function(array) {
  9306. * // Mutate input array.
  9307. * array.pop();
  9308. * })
  9309. * .reverse()
  9310. * .value();
  9311. * // => [2, 1]
  9312. */
  9313. function tap(value, interceptor) {
  9314. interceptor(value);
  9315. return value;
  9316. }
  9317. /**
  9318. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9319. * The purpose of this method is to "pass thru" values replacing intermediate
  9320. * results in a method chain sequence.
  9321. *
  9322. * @static
  9323. * @memberOf _
  9324. * @since 3.0.0
  9325. * @category Seq
  9326. * @param {*} value The value to provide to `interceptor`.
  9327. * @param {Function} interceptor The function to invoke.
  9328. * @returns {*} Returns the result of `interceptor`.
  9329. * @example
  9330. *
  9331. * _(' abc ')
  9332. * .chain()
  9333. * .trim()
  9334. * .thru(function(value) {
  9335. * return [value];
  9336. * })
  9337. * .value();
  9338. * // => ['abc']
  9339. */
  9340. function thru(value, interceptor) {
  9341. return interceptor(value);
  9342. }
  9343. /**
  9344. * This method is the wrapper version of `_.at`.
  9345. *
  9346. * @name at
  9347. * @memberOf _
  9348. * @since 1.0.0
  9349. * @category Seq
  9350. * @param {...(string|string[])} [paths] The property paths to pick.
  9351. * @returns {Object} Returns the new `lodash` wrapper instance.
  9352. * @example
  9353. *
  9354. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9355. *
  9356. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9357. * // => [3, 4]
  9358. */
  9359. var wrapperAt = flatRest(function(paths) {
  9360. var length = paths.length,
  9361. start = length ? paths[0] : 0,
  9362. value = this.__wrapped__,
  9363. interceptor = function(object) { return baseAt(object, paths); };
  9364. if (length > 1 || this.__actions__.length ||
  9365. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9366. return this.thru(interceptor);
  9367. }
  9368. value = value.slice(start, +start + (length ? 1 : 0));
  9369. value.__actions__.push({
  9370. 'func': thru,
  9371. 'args': [interceptor],
  9372. 'thisArg': undefined
  9373. });
  9374. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9375. if (length && !array.length) {
  9376. array.push(undefined);
  9377. }
  9378. return array;
  9379. });
  9380. });
  9381. /**
  9382. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9383. *
  9384. * @name chain
  9385. * @memberOf _
  9386. * @since 0.1.0
  9387. * @category Seq
  9388. * @returns {Object} Returns the new `lodash` wrapper instance.
  9389. * @example
  9390. *
  9391. * var users = [
  9392. * { 'user': 'barney', 'age': 36 },
  9393. * { 'user': 'fred', 'age': 40 }
  9394. * ];
  9395. *
  9396. * // A sequence without explicit chaining.
  9397. * _(users).head();
  9398. * // => { 'user': 'barney', 'age': 36 }
  9399. *
  9400. * // A sequence with explicit chaining.
  9401. * _(users)
  9402. * .chain()
  9403. * .head()
  9404. * .pick('user')
  9405. * .value();
  9406. * // => { 'user': 'barney' }
  9407. */
  9408. function wrapperChain() {
  9409. return chain(this);
  9410. }
  9411. /**
  9412. * Executes the chain sequence and returns the wrapped result.
  9413. *
  9414. * @name commit
  9415. * @memberOf _
  9416. * @since 3.2.0
  9417. * @category Seq
  9418. * @returns {Object} Returns the new `lodash` wrapper instance.
  9419. * @example
  9420. *
  9421. * var array = [1, 2];
  9422. * var wrapped = _(array).push(3);
  9423. *
  9424. * console.log(array);
  9425. * // => [1, 2]
  9426. *
  9427. * wrapped = wrapped.commit();
  9428. * console.log(array);
  9429. * // => [1, 2, 3]
  9430. *
  9431. * wrapped.last();
  9432. * // => 3
  9433. *
  9434. * console.log(array);
  9435. * // => [1, 2, 3]
  9436. */
  9437. function wrapperCommit() {
  9438. return new LodashWrapper(this.value(), this.__chain__);
  9439. }
  9440. /**
  9441. * Gets the next value on a wrapped object following the
  9442. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9443. *
  9444. * @name next
  9445. * @memberOf _
  9446. * @since 4.0.0
  9447. * @category Seq
  9448. * @returns {Object} Returns the next iterator value.
  9449. * @example
  9450. *
  9451. * var wrapped = _([1, 2]);
  9452. *
  9453. * wrapped.next();
  9454. * // => { 'done': false, 'value': 1 }
  9455. *
  9456. * wrapped.next();
  9457. * // => { 'done': false, 'value': 2 }
  9458. *
  9459. * wrapped.next();
  9460. * // => { 'done': true, 'value': undefined }
  9461. */
  9462. function wrapperNext() {
  9463. if (this.__values__ === undefined) {
  9464. this.__values__ = toArray(this.value());
  9465. }
  9466. var done = this.__index__ >= this.__values__.length,
  9467. value = done ? undefined : this.__values__[this.__index__++];
  9468. return { 'done': done, 'value': value };
  9469. }
  9470. /**
  9471. * Enables the wrapper to be iterable.
  9472. *
  9473. * @name Symbol.iterator
  9474. * @memberOf _
  9475. * @since 4.0.0
  9476. * @category Seq
  9477. * @returns {Object} Returns the wrapper object.
  9478. * @example
  9479. *
  9480. * var wrapped = _([1, 2]);
  9481. *
  9482. * wrapped[Symbol.iterator]() === wrapped;
  9483. * // => true
  9484. *
  9485. * Array.from(wrapped);
  9486. * // => [1, 2]
  9487. */
  9488. function wrapperToIterator() {
  9489. return this;
  9490. }
  9491. /**
  9492. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9493. *
  9494. * @name plant
  9495. * @memberOf _
  9496. * @since 3.2.0
  9497. * @category Seq
  9498. * @param {*} value The value to plant.
  9499. * @returns {Object} Returns the new `lodash` wrapper instance.
  9500. * @example
  9501. *
  9502. * function square(n) {
  9503. * return n * n;
  9504. * }
  9505. *
  9506. * var wrapped = _([1, 2]).map(square);
  9507. * var other = wrapped.plant([3, 4]);
  9508. *
  9509. * other.value();
  9510. * // => [9, 16]
  9511. *
  9512. * wrapped.value();
  9513. * // => [1, 4]
  9514. */
  9515. function wrapperPlant(value) {
  9516. var result,
  9517. parent = this;
  9518. while (parent instanceof baseLodash) {
  9519. var clone = wrapperClone(parent);
  9520. clone.__index__ = 0;
  9521. clone.__values__ = undefined;
  9522. if (result) {
  9523. previous.__wrapped__ = clone;
  9524. } else {
  9525. result = clone;
  9526. }
  9527. var previous = clone;
  9528. parent = parent.__wrapped__;
  9529. }
  9530. previous.__wrapped__ = value;
  9531. return result;
  9532. }
  9533. /**
  9534. * This method is the wrapper version of `_.reverse`.
  9535. *
  9536. * **Note:** This method mutates the wrapped array.
  9537. *
  9538. * @name reverse
  9539. * @memberOf _
  9540. * @since 0.1.0
  9541. * @category Seq
  9542. * @returns {Object} Returns the new `lodash` wrapper instance.
  9543. * @example
  9544. *
  9545. * var array = [1, 2, 3];
  9546. *
  9547. * _(array).reverse().value()
  9548. * // => [3, 2, 1]
  9549. *
  9550. * console.log(array);
  9551. * // => [3, 2, 1]
  9552. */
  9553. function wrapperReverse() {
  9554. var value = this.__wrapped__;
  9555. if (value instanceof LazyWrapper) {
  9556. var wrapped = value;
  9557. if (this.__actions__.length) {
  9558. wrapped = new LazyWrapper(this);
  9559. }
  9560. wrapped = wrapped.reverse();
  9561. wrapped.__actions__.push({
  9562. 'func': thru,
  9563. 'args': [reverse],
  9564. 'thisArg': undefined
  9565. });
  9566. return new LodashWrapper(wrapped, this.__chain__);
  9567. }
  9568. return this.thru(reverse);
  9569. }
  9570. /**
  9571. * Executes the chain sequence to resolve the unwrapped value.
  9572. *
  9573. * @name value
  9574. * @memberOf _
  9575. * @since 0.1.0
  9576. * @alias toJSON, valueOf
  9577. * @category Seq
  9578. * @returns {*} Returns the resolved unwrapped value.
  9579. * @example
  9580. *
  9581. * _([1, 2, 3]).value();
  9582. * // => [1, 2, 3]
  9583. */
  9584. function wrapperValue() {
  9585. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9586. }
  9587. /*------------------------------------------------------------------------*/
  9588. /**
  9589. * Creates an object composed of keys generated from the results of running
  9590. * each element of `collection` thru `iteratee`. The corresponding value of
  9591. * each key is the number of times the key was returned by `iteratee`. The
  9592. * iteratee is invoked with one argument: (value).
  9593. *
  9594. * @static
  9595. * @memberOf _
  9596. * @since 0.5.0
  9597. * @category Collection
  9598. * @param {Array|Object} collection The collection to iterate over.
  9599. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9600. * @returns {Object} Returns the composed aggregate object.
  9601. * @example
  9602. *
  9603. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9604. * // => { '4': 1, '6': 2 }
  9605. *
  9606. * // The `_.property` iteratee shorthand.
  9607. * _.countBy(['one', 'two', 'three'], 'length');
  9608. * // => { '3': 2, '5': 1 }
  9609. */
  9610. var countBy = createAggregator(function(result, value, key) {
  9611. if (hasOwnProperty.call(result, key)) {
  9612. ++result[key];
  9613. } else {
  9614. baseAssignValue(result, key, 1);
  9615. }
  9616. });
  9617. /**
  9618. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9619. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9620. * invoked with three arguments: (value, index|key, collection).
  9621. *
  9622. * **Note:** This method returns `true` for
  9623. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9624. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9625. * elements of empty collections.
  9626. *
  9627. * @static
  9628. * @memberOf _
  9629. * @since 0.1.0
  9630. * @category Collection
  9631. * @param {Array|Object} collection The collection to iterate over.
  9632. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9633. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9634. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9635. * else `false`.
  9636. * @example
  9637. *
  9638. * _.every([true, 1, null, 'yes'], Boolean);
  9639. * // => false
  9640. *
  9641. * var users = [
  9642. * { 'user': 'barney', 'age': 36, 'active': false },
  9643. * { 'user': 'fred', 'age': 40, 'active': false }
  9644. * ];
  9645. *
  9646. * // The `_.matches` iteratee shorthand.
  9647. * _.every(users, { 'user': 'barney', 'active': false });
  9648. * // => false
  9649. *
  9650. * // The `_.matchesProperty` iteratee shorthand.
  9651. * _.every(users, ['active', false]);
  9652. * // => true
  9653. *
  9654. * // The `_.property` iteratee shorthand.
  9655. * _.every(users, 'active');
  9656. * // => false
  9657. */
  9658. function every(collection, predicate, guard) {
  9659. var func = isArray(collection) ? arrayEvery : baseEvery;
  9660. if (guard && isIterateeCall(collection, predicate, guard)) {
  9661. predicate = undefined;
  9662. }
  9663. return func(collection, getIteratee(predicate, 3));
  9664. }
  9665. /**
  9666. * Iterates over elements of `collection`, returning an array of all elements
  9667. * `predicate` returns truthy for. The predicate is invoked with three
  9668. * arguments: (value, index|key, collection).
  9669. *
  9670. * **Note:** Unlike `_.remove`, this method returns a new array.
  9671. *
  9672. * @static
  9673. * @memberOf _
  9674. * @since 0.1.0
  9675. * @category Collection
  9676. * @param {Array|Object} collection The collection to iterate over.
  9677. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9678. * @returns {Array} Returns the new filtered array.
  9679. * @see _.reject
  9680. * @example
  9681. *
  9682. * var users = [
  9683. * { 'user': 'barney', 'age': 36, 'active': true },
  9684. * { 'user': 'fred', 'age': 40, 'active': false }
  9685. * ];
  9686. *
  9687. * _.filter(users, function(o) { return !o.active; });
  9688. * // => objects for ['fred']
  9689. *
  9690. * // The `_.matches` iteratee shorthand.
  9691. * _.filter(users, { 'age': 36, 'active': true });
  9692. * // => objects for ['barney']
  9693. *
  9694. * // The `_.matchesProperty` iteratee shorthand.
  9695. * _.filter(users, ['active', false]);
  9696. * // => objects for ['fred']
  9697. *
  9698. * // The `_.property` iteratee shorthand.
  9699. * _.filter(users, 'active');
  9700. * // => objects for ['barney']
  9701. *
  9702. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9703. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9704. * // => objects for ['fred', 'barney']
  9705. */
  9706. function filter(collection, predicate) {
  9707. var func = isArray(collection) ? arrayFilter : baseFilter;
  9708. return func(collection, getIteratee(predicate, 3));
  9709. }
  9710. /**
  9711. * Iterates over elements of `collection`, returning the first element
  9712. * `predicate` returns truthy for. The predicate is invoked with three
  9713. * arguments: (value, index|key, collection).
  9714. *
  9715. * @static
  9716. * @memberOf _
  9717. * @since 0.1.0
  9718. * @category Collection
  9719. * @param {Array|Object} collection The collection to inspect.
  9720. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9721. * @param {number} [fromIndex=0] The index to search from.
  9722. * @returns {*} Returns the matched element, else `undefined`.
  9723. * @example
  9724. *
  9725. * var users = [
  9726. * { 'user': 'barney', 'age': 36, 'active': true },
  9727. * { 'user': 'fred', 'age': 40, 'active': false },
  9728. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9729. * ];
  9730. *
  9731. * _.find(users, function(o) { return o.age < 40; });
  9732. * // => object for 'barney'
  9733. *
  9734. * // The `_.matches` iteratee shorthand.
  9735. * _.find(users, { 'age': 1, 'active': true });
  9736. * // => object for 'pebbles'
  9737. *
  9738. * // The `_.matchesProperty` iteratee shorthand.
  9739. * _.find(users, ['active', false]);
  9740. * // => object for 'fred'
  9741. *
  9742. * // The `_.property` iteratee shorthand.
  9743. * _.find(users, 'active');
  9744. * // => object for 'barney'
  9745. */
  9746. var find = createFind(findIndex);
  9747. /**
  9748. * This method is like `_.find` except that it iterates over elements of
  9749. * `collection` from right to left.
  9750. *
  9751. * @static
  9752. * @memberOf _
  9753. * @since 2.0.0
  9754. * @category Collection
  9755. * @param {Array|Object} collection The collection to inspect.
  9756. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9757. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9758. * @returns {*} Returns the matched element, else `undefined`.
  9759. * @example
  9760. *
  9761. * _.findLast([1, 2, 3, 4], function(n) {
  9762. * return n % 2 == 1;
  9763. * });
  9764. * // => 3
  9765. */
  9766. var findLast = createFind(findLastIndex);
  9767. /**
  9768. * Creates a flattened array of values by running each element in `collection`
  9769. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9770. * with three arguments: (value, index|key, collection).
  9771. *
  9772. * @static
  9773. * @memberOf _
  9774. * @since 4.0.0
  9775. * @category Collection
  9776. * @param {Array|Object} collection The collection to iterate over.
  9777. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9778. * @returns {Array} Returns the new flattened array.
  9779. * @example
  9780. *
  9781. * function duplicate(n) {
  9782. * return [n, n];
  9783. * }
  9784. *
  9785. * _.flatMap([1, 2], duplicate);
  9786. * // => [1, 1, 2, 2]
  9787. */
  9788. function flatMap(collection, iteratee) {
  9789. return baseFlatten(map(collection, iteratee), 1);
  9790. }
  9791. /**
  9792. * This method is like `_.flatMap` except that it recursively flattens the
  9793. * mapped results.
  9794. *
  9795. * @static
  9796. * @memberOf _
  9797. * @since 4.7.0
  9798. * @category Collection
  9799. * @param {Array|Object} collection The collection to iterate over.
  9800. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9801. * @returns {Array} Returns the new flattened array.
  9802. * @example
  9803. *
  9804. * function duplicate(n) {
  9805. * return [[[n, n]]];
  9806. * }
  9807. *
  9808. * _.flatMapDeep([1, 2], duplicate);
  9809. * // => [1, 1, 2, 2]
  9810. */
  9811. function flatMapDeep(collection, iteratee) {
  9812. return baseFlatten(map(collection, iteratee), INFINITY);
  9813. }
  9814. /**
  9815. * This method is like `_.flatMap` except that it recursively flattens the
  9816. * mapped results up to `depth` times.
  9817. *
  9818. * @static
  9819. * @memberOf _
  9820. * @since 4.7.0
  9821. * @category Collection
  9822. * @param {Array|Object} collection The collection to iterate over.
  9823. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9824. * @param {number} [depth=1] The maximum recursion depth.
  9825. * @returns {Array} Returns the new flattened array.
  9826. * @example
  9827. *
  9828. * function duplicate(n) {
  9829. * return [[[n, n]]];
  9830. * }
  9831. *
  9832. * _.flatMapDepth([1, 2], duplicate, 2);
  9833. * // => [[1, 1], [2, 2]]
  9834. */
  9835. function flatMapDepth(collection, iteratee, depth) {
  9836. depth = depth === undefined ? 1 : toInteger(depth);
  9837. return baseFlatten(map(collection, iteratee), depth);
  9838. }
  9839. /**
  9840. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9841. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9842. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9843. *
  9844. * **Note:** As with other "Collections" methods, objects with a "length"
  9845. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9846. * or `_.forOwn` for object iteration.
  9847. *
  9848. * @static
  9849. * @memberOf _
  9850. * @since 0.1.0
  9851. * @alias each
  9852. * @category Collection
  9853. * @param {Array|Object} collection The collection to iterate over.
  9854. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9855. * @returns {Array|Object} Returns `collection`.
  9856. * @see _.forEachRight
  9857. * @example
  9858. *
  9859. * _.forEach([1, 2], function(value) {
  9860. * console.log(value);
  9861. * });
  9862. * // => Logs `1` then `2`.
  9863. *
  9864. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9865. * console.log(key);
  9866. * });
  9867. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9868. */
  9869. function forEach(collection, iteratee) {
  9870. var func = isArray(collection) ? arrayEach : baseEach;
  9871. return func(collection, getIteratee(iteratee, 3));
  9872. }
  9873. /**
  9874. * This method is like `_.forEach` except that it iterates over elements of
  9875. * `collection` from right to left.
  9876. *
  9877. * @static
  9878. * @memberOf _
  9879. * @since 2.0.0
  9880. * @alias eachRight
  9881. * @category Collection
  9882. * @param {Array|Object} collection The collection to iterate over.
  9883. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9884. * @returns {Array|Object} Returns `collection`.
  9885. * @see _.forEach
  9886. * @example
  9887. *
  9888. * _.forEachRight([1, 2], function(value) {
  9889. * console.log(value);
  9890. * });
  9891. * // => Logs `2` then `1`.
  9892. */
  9893. function forEachRight(collection, iteratee) {
  9894. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9895. return func(collection, getIteratee(iteratee, 3));
  9896. }
  9897. /**
  9898. * Creates an object composed of keys generated from the results of running
  9899. * each element of `collection` thru `iteratee`. The order of grouped values
  9900. * is determined by the order they occur in `collection`. The corresponding
  9901. * value of each key is an array of elements responsible for generating the
  9902. * key. The iteratee is invoked with one argument: (value).
  9903. *
  9904. * @static
  9905. * @memberOf _
  9906. * @since 0.1.0
  9907. * @category Collection
  9908. * @param {Array|Object} collection The collection to iterate over.
  9909. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9910. * @returns {Object} Returns the composed aggregate object.
  9911. * @example
  9912. *
  9913. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9914. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9915. *
  9916. * // The `_.property` iteratee shorthand.
  9917. * _.groupBy(['one', 'two', 'three'], 'length');
  9918. * // => { '3': ['one', 'two'], '5': ['three'] }
  9919. */
  9920. var groupBy = createAggregator(function(result, value, key) {
  9921. if (hasOwnProperty.call(result, key)) {
  9922. result[key].push(value);
  9923. } else {
  9924. baseAssignValue(result, key, [value]);
  9925. }
  9926. });
  9927. /**
  9928. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9929. * checked for a substring of `value`, otherwise
  9930. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9931. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9932. * the offset from the end of `collection`.
  9933. *
  9934. * @static
  9935. * @memberOf _
  9936. * @since 0.1.0
  9937. * @category Collection
  9938. * @param {Array|Object|string} collection The collection to inspect.
  9939. * @param {*} value The value to search for.
  9940. * @param {number} [fromIndex=0] The index to search from.
  9941. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9942. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9943. * @example
  9944. *
  9945. * _.includes([1, 2, 3], 1);
  9946. * // => true
  9947. *
  9948. * _.includes([1, 2, 3], 1, 2);
  9949. * // => false
  9950. *
  9951. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9952. * // => true
  9953. *
  9954. * _.includes('abcd', 'bc');
  9955. * // => true
  9956. */
  9957. function includes(collection, value, fromIndex, guard) {
  9958. collection = isArrayLike(collection) ? collection : values(collection);
  9959. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9960. var length = collection.length;
  9961. if (fromIndex < 0) {
  9962. fromIndex = nativeMax(length + fromIndex, 0);
  9963. }
  9964. return isString(collection)
  9965. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9966. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9967. }
  9968. /**
  9969. * Invokes the method at `path` of each element in `collection`, returning
  9970. * an array of the results of each invoked method. Any additional arguments
  9971. * are provided to each invoked method. If `path` is a function, it's invoked
  9972. * for, and `this` bound to, each element in `collection`.
  9973. *
  9974. * @static
  9975. * @memberOf _
  9976. * @since 4.0.0
  9977. * @category Collection
  9978. * @param {Array|Object} collection The collection to iterate over.
  9979. * @param {Array|Function|string} path The path of the method to invoke or
  9980. * the function invoked per iteration.
  9981. * @param {...*} [args] The arguments to invoke each method with.
  9982. * @returns {Array} Returns the array of results.
  9983. * @example
  9984. *
  9985. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9986. * // => [[1, 5, 7], [1, 2, 3]]
  9987. *
  9988. * _.invokeMap([123, 456], String.prototype.split, '');
  9989. * // => [['1', '2', '3'], ['4', '5', '6']]
  9990. */
  9991. var invokeMap = baseRest(function(collection, path, args) {
  9992. var index = -1,
  9993. isFunc = typeof path == 'function',
  9994. result = isArrayLike(collection) ? Array(collection.length) : [];
  9995. baseEach(collection, function(value) {
  9996. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9997. });
  9998. return result;
  9999. });
  10000. /**
  10001. * Creates an object composed of keys generated from the results of running
  10002. * each element of `collection` thru `iteratee`. The corresponding value of
  10003. * each key is the last element responsible for generating the key. The
  10004. * iteratee is invoked with one argument: (value).
  10005. *
  10006. * @static
  10007. * @memberOf _
  10008. * @since 4.0.0
  10009. * @category Collection
  10010. * @param {Array|Object} collection The collection to iterate over.
  10011. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10012. * @returns {Object} Returns the composed aggregate object.
  10013. * @example
  10014. *
  10015. * var array = [
  10016. * { 'dir': 'left', 'code': 97 },
  10017. * { 'dir': 'right', 'code': 100 }
  10018. * ];
  10019. *
  10020. * _.keyBy(array, function(o) {
  10021. * return String.fromCharCode(o.code);
  10022. * });
  10023. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10024. *
  10025. * _.keyBy(array, 'dir');
  10026. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10027. */
  10028. var keyBy = createAggregator(function(result, value, key) {
  10029. baseAssignValue(result, key, value);
  10030. });
  10031. /**
  10032. * Creates an array of values by running each element in `collection` thru
  10033. * `iteratee`. The iteratee is invoked with three arguments:
  10034. * (value, index|key, collection).
  10035. *
  10036. * Many lodash methods are guarded to work as iteratees for methods like
  10037. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10038. *
  10039. * The guarded methods are:
  10040. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10041. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10042. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10043. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10044. *
  10045. * @static
  10046. * @memberOf _
  10047. * @since 0.1.0
  10048. * @category Collection
  10049. * @param {Array|Object} collection The collection to iterate over.
  10050. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10051. * @returns {Array} Returns the new mapped array.
  10052. * @example
  10053. *
  10054. * function square(n) {
  10055. * return n * n;
  10056. * }
  10057. *
  10058. * _.map([4, 8], square);
  10059. * // => [16, 64]
  10060. *
  10061. * _.map({ 'a': 4, 'b': 8 }, square);
  10062. * // => [16, 64] (iteration order is not guaranteed)
  10063. *
  10064. * var users = [
  10065. * { 'user': 'barney' },
  10066. * { 'user': 'fred' }
  10067. * ];
  10068. *
  10069. * // The `_.property` iteratee shorthand.
  10070. * _.map(users, 'user');
  10071. * // => ['barney', 'fred']
  10072. */
  10073. function map(collection, iteratee) {
  10074. var func = isArray(collection) ? arrayMap : baseMap;
  10075. return func(collection, getIteratee(iteratee, 3));
  10076. }
  10077. /**
  10078. * This method is like `_.sortBy` except that it allows specifying the sort
  10079. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10080. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10081. * descending or "asc" for ascending sort order of corresponding values.
  10082. *
  10083. * @static
  10084. * @memberOf _
  10085. * @since 4.0.0
  10086. * @category Collection
  10087. * @param {Array|Object} collection The collection to iterate over.
  10088. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10089. * The iteratees to sort by.
  10090. * @param {string[]} [orders] The sort orders of `iteratees`.
  10091. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10092. * @returns {Array} Returns the new sorted array.
  10093. * @example
  10094. *
  10095. * var users = [
  10096. * { 'user': 'fred', 'age': 48 },
  10097. * { 'user': 'barney', 'age': 34 },
  10098. * { 'user': 'fred', 'age': 40 },
  10099. * { 'user': 'barney', 'age': 36 }
  10100. * ];
  10101. *
  10102. * // Sort by `user` in ascending order and by `age` in descending order.
  10103. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10104. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10105. */
  10106. function orderBy(collection, iteratees, orders, guard) {
  10107. if (collection == null) {
  10108. return [];
  10109. }
  10110. if (!isArray(iteratees)) {
  10111. iteratees = iteratees == null ? [] : [iteratees];
  10112. }
  10113. orders = guard ? undefined : orders;
  10114. if (!isArray(orders)) {
  10115. orders = orders == null ? [] : [orders];
  10116. }
  10117. return baseOrderBy(collection, iteratees, orders);
  10118. }
  10119. /**
  10120. * Creates an array of elements split into two groups, the first of which
  10121. * contains elements `predicate` returns truthy for, the second of which
  10122. * contains elements `predicate` returns falsey for. The predicate is
  10123. * invoked with one argument: (value).
  10124. *
  10125. * @static
  10126. * @memberOf _
  10127. * @since 3.0.0
  10128. * @category Collection
  10129. * @param {Array|Object} collection The collection to iterate over.
  10130. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10131. * @returns {Array} Returns the array of grouped elements.
  10132. * @example
  10133. *
  10134. * var users = [
  10135. * { 'user': 'barney', 'age': 36, 'active': false },
  10136. * { 'user': 'fred', 'age': 40, 'active': true },
  10137. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10138. * ];
  10139. *
  10140. * _.partition(users, function(o) { return o.active; });
  10141. * // => objects for [['fred'], ['barney', 'pebbles']]
  10142. *
  10143. * // The `_.matches` iteratee shorthand.
  10144. * _.partition(users, { 'age': 1, 'active': false });
  10145. * // => objects for [['pebbles'], ['barney', 'fred']]
  10146. *
  10147. * // The `_.matchesProperty` iteratee shorthand.
  10148. * _.partition(users, ['active', false]);
  10149. * // => objects for [['barney', 'pebbles'], ['fred']]
  10150. *
  10151. * // The `_.property` iteratee shorthand.
  10152. * _.partition(users, 'active');
  10153. * // => objects for [['fred'], ['barney', 'pebbles']]
  10154. */
  10155. var partition = createAggregator(function(result, value, key) {
  10156. result[key ? 0 : 1].push(value);
  10157. }, function() { return [[], []]; });
  10158. /**
  10159. * Reduces `collection` to a value which is the accumulated result of running
  10160. * each element in `collection` thru `iteratee`, where each successive
  10161. * invocation is supplied the return value of the previous. If `accumulator`
  10162. * is not given, the first element of `collection` is used as the initial
  10163. * value. The iteratee is invoked with four arguments:
  10164. * (accumulator, value, index|key, collection).
  10165. *
  10166. * Many lodash methods are guarded to work as iteratees for methods like
  10167. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10168. *
  10169. * The guarded methods are:
  10170. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10171. * and `sortBy`
  10172. *
  10173. * @static
  10174. * @memberOf _
  10175. * @since 0.1.0
  10176. * @category Collection
  10177. * @param {Array|Object} collection The collection to iterate over.
  10178. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10179. * @param {*} [accumulator] The initial value.
  10180. * @returns {*} Returns the accumulated value.
  10181. * @see _.reduceRight
  10182. * @example
  10183. *
  10184. * _.reduce([1, 2], function(sum, n) {
  10185. * return sum + n;
  10186. * }, 0);
  10187. * // => 3
  10188. *
  10189. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10190. * (result[value] || (result[value] = [])).push(key);
  10191. * return result;
  10192. * }, {});
  10193. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10194. */
  10195. function reduce(collection, iteratee, accumulator) {
  10196. var func = isArray(collection) ? arrayReduce : baseReduce,
  10197. initAccum = arguments.length < 3;
  10198. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10199. }
  10200. /**
  10201. * This method is like `_.reduce` except that it iterates over elements of
  10202. * `collection` from right to left.
  10203. *
  10204. * @static
  10205. * @memberOf _
  10206. * @since 0.1.0
  10207. * @category Collection
  10208. * @param {Array|Object} collection The collection to iterate over.
  10209. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10210. * @param {*} [accumulator] The initial value.
  10211. * @returns {*} Returns the accumulated value.
  10212. * @see _.reduce
  10213. * @example
  10214. *
  10215. * var array = [[0, 1], [2, 3], [4, 5]];
  10216. *
  10217. * _.reduceRight(array, function(flattened, other) {
  10218. * return flattened.concat(other);
  10219. * }, []);
  10220. * // => [4, 5, 2, 3, 0, 1]
  10221. */
  10222. function reduceRight(collection, iteratee, accumulator) {
  10223. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10224. initAccum = arguments.length < 3;
  10225. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10226. }
  10227. /**
  10228. * The opposite of `_.filter`; this method returns the elements of `collection`
  10229. * that `predicate` does **not** return truthy for.
  10230. *
  10231. * @static
  10232. * @memberOf _
  10233. * @since 0.1.0
  10234. * @category Collection
  10235. * @param {Array|Object} collection The collection to iterate over.
  10236. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10237. * @returns {Array} Returns the new filtered array.
  10238. * @see _.filter
  10239. * @example
  10240. *
  10241. * var users = [
  10242. * { 'user': 'barney', 'age': 36, 'active': false },
  10243. * { 'user': 'fred', 'age': 40, 'active': true }
  10244. * ];
  10245. *
  10246. * _.reject(users, function(o) { return !o.active; });
  10247. * // => objects for ['fred']
  10248. *
  10249. * // The `_.matches` iteratee shorthand.
  10250. * _.reject(users, { 'age': 40, 'active': true });
  10251. * // => objects for ['barney']
  10252. *
  10253. * // The `_.matchesProperty` iteratee shorthand.
  10254. * _.reject(users, ['active', false]);
  10255. * // => objects for ['fred']
  10256. *
  10257. * // The `_.property` iteratee shorthand.
  10258. * _.reject(users, 'active');
  10259. * // => objects for ['barney']
  10260. */
  10261. function reject(collection, predicate) {
  10262. var func = isArray(collection) ? arrayFilter : baseFilter;
  10263. return func(collection, negate(getIteratee(predicate, 3)));
  10264. }
  10265. /**
  10266. * Gets a random element from `collection`.
  10267. *
  10268. * @static
  10269. * @memberOf _
  10270. * @since 2.0.0
  10271. * @category Collection
  10272. * @param {Array|Object} collection The collection to sample.
  10273. * @returns {*} Returns the random element.
  10274. * @example
  10275. *
  10276. * _.sample([1, 2, 3, 4]);
  10277. * // => 2
  10278. */
  10279. function sample(collection) {
  10280. var func = isArray(collection) ? arraySample : baseSample;
  10281. return func(collection);
  10282. }
  10283. /**
  10284. * Gets `n` random elements at unique keys from `collection` up to the
  10285. * size of `collection`.
  10286. *
  10287. * @static
  10288. * @memberOf _
  10289. * @since 4.0.0
  10290. * @category Collection
  10291. * @param {Array|Object} collection The collection to sample.
  10292. * @param {number} [n=1] The number of elements to sample.
  10293. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10294. * @returns {Array} Returns the random elements.
  10295. * @example
  10296. *
  10297. * _.sampleSize([1, 2, 3], 2);
  10298. * // => [3, 1]
  10299. *
  10300. * _.sampleSize([1, 2, 3], 4);
  10301. * // => [2, 3, 1]
  10302. */
  10303. function sampleSize(collection, n, guard) {
  10304. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10305. n = 1;
  10306. } else {
  10307. n = toInteger(n);
  10308. }
  10309. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10310. return func(collection, n);
  10311. }
  10312. /**
  10313. * Creates an array of shuffled values, using a version of the
  10314. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10315. *
  10316. * @static
  10317. * @memberOf _
  10318. * @since 0.1.0
  10319. * @category Collection
  10320. * @param {Array|Object} collection The collection to shuffle.
  10321. * @returns {Array} Returns the new shuffled array.
  10322. * @example
  10323. *
  10324. * _.shuffle([1, 2, 3, 4]);
  10325. * // => [4, 1, 3, 2]
  10326. */
  10327. function shuffle(collection) {
  10328. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10329. return func(collection);
  10330. }
  10331. /**
  10332. * Gets the size of `collection` by returning its length for array-like
  10333. * values or the number of own enumerable string keyed properties for objects.
  10334. *
  10335. * @static
  10336. * @memberOf _
  10337. * @since 0.1.0
  10338. * @category Collection
  10339. * @param {Array|Object|string} collection The collection to inspect.
  10340. * @returns {number} Returns the collection size.
  10341. * @example
  10342. *
  10343. * _.size([1, 2, 3]);
  10344. * // => 3
  10345. *
  10346. * _.size({ 'a': 1, 'b': 2 });
  10347. * // => 2
  10348. *
  10349. * _.size('pebbles');
  10350. * // => 7
  10351. */
  10352. function size(collection) {
  10353. if (collection == null) {
  10354. return 0;
  10355. }
  10356. if (isArrayLike(collection)) {
  10357. return isString(collection) ? stringSize(collection) : collection.length;
  10358. }
  10359. var tag = getTag(collection);
  10360. if (tag == mapTag || tag == setTag) {
  10361. return collection.size;
  10362. }
  10363. return baseKeys(collection).length;
  10364. }
  10365. /**
  10366. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10367. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10368. * invoked with three arguments: (value, index|key, collection).
  10369. *
  10370. * @static
  10371. * @memberOf _
  10372. * @since 0.1.0
  10373. * @category Collection
  10374. * @param {Array|Object} collection The collection to iterate over.
  10375. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10376. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10377. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10378. * else `false`.
  10379. * @example
  10380. *
  10381. * _.some([null, 0, 'yes', false], Boolean);
  10382. * // => true
  10383. *
  10384. * var users = [
  10385. * { 'user': 'barney', 'active': true },
  10386. * { 'user': 'fred', 'active': false }
  10387. * ];
  10388. *
  10389. * // The `_.matches` iteratee shorthand.
  10390. * _.some(users, { 'user': 'barney', 'active': false });
  10391. * // => false
  10392. *
  10393. * // The `_.matchesProperty` iteratee shorthand.
  10394. * _.some(users, ['active', false]);
  10395. * // => true
  10396. *
  10397. * // The `_.property` iteratee shorthand.
  10398. * _.some(users, 'active');
  10399. * // => true
  10400. */
  10401. function some(collection, predicate, guard) {
  10402. var func = isArray(collection) ? arraySome : baseSome;
  10403. if (guard && isIterateeCall(collection, predicate, guard)) {
  10404. predicate = undefined;
  10405. }
  10406. return func(collection, getIteratee(predicate, 3));
  10407. }
  10408. /**
  10409. * Creates an array of elements, sorted in ascending order by the results of
  10410. * running each element in a collection thru each iteratee. This method
  10411. * performs a stable sort, that is, it preserves the original sort order of
  10412. * equal elements. The iteratees are invoked with one argument: (value).
  10413. *
  10414. * @static
  10415. * @memberOf _
  10416. * @since 0.1.0
  10417. * @category Collection
  10418. * @param {Array|Object} collection The collection to iterate over.
  10419. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10420. * The iteratees to sort by.
  10421. * @returns {Array} Returns the new sorted array.
  10422. * @example
  10423. *
  10424. * var users = [
  10425. * { 'user': 'fred', 'age': 48 },
  10426. * { 'user': 'barney', 'age': 36 },
  10427. * { 'user': 'fred', 'age': 30 },
  10428. * { 'user': 'barney', 'age': 34 }
  10429. * ];
  10430. *
  10431. * _.sortBy(users, [function(o) { return o.user; }]);
  10432. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10433. *
  10434. * _.sortBy(users, ['user', 'age']);
  10435. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10436. */
  10437. var sortBy = baseRest(function(collection, iteratees) {
  10438. if (collection == null) {
  10439. return [];
  10440. }
  10441. var length = iteratees.length;
  10442. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10443. iteratees = [];
  10444. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10445. iteratees = [iteratees[0]];
  10446. }
  10447. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10448. });
  10449. /*------------------------------------------------------------------------*/
  10450. /**
  10451. * Gets the timestamp of the number of milliseconds that have elapsed since
  10452. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10453. *
  10454. * @static
  10455. * @memberOf _
  10456. * @since 2.4.0
  10457. * @category Date
  10458. * @returns {number} Returns the timestamp.
  10459. * @example
  10460. *
  10461. * _.defer(function(stamp) {
  10462. * console.log(_.now() - stamp);
  10463. * }, _.now());
  10464. * // => Logs the number of milliseconds it took for the deferred invocation.
  10465. */
  10466. var now = ctxNow || function() {
  10467. return root.Date.now();
  10468. };
  10469. /*------------------------------------------------------------------------*/
  10470. /**
  10471. * The opposite of `_.before`; this method creates a function that invokes
  10472. * `func` once it's called `n` or more times.
  10473. *
  10474. * @static
  10475. * @memberOf _
  10476. * @since 0.1.0
  10477. * @category Function
  10478. * @param {number} n The number of calls before `func` is invoked.
  10479. * @param {Function} func The function to restrict.
  10480. * @returns {Function} Returns the new restricted function.
  10481. * @example
  10482. *
  10483. * var saves = ['profile', 'settings'];
  10484. *
  10485. * var done = _.after(saves.length, function() {
  10486. * console.log('done saving!');
  10487. * });
  10488. *
  10489. * _.forEach(saves, function(type) {
  10490. * asyncSave({ 'type': type, 'complete': done });
  10491. * });
  10492. * // => Logs 'done saving!' after the two async saves have completed.
  10493. */
  10494. function after(n, func) {
  10495. if (typeof func != 'function') {
  10496. throw new TypeError(FUNC_ERROR_TEXT);
  10497. }
  10498. n = toInteger(n);
  10499. return function() {
  10500. if (--n < 1) {
  10501. return func.apply(this, arguments);
  10502. }
  10503. };
  10504. }
  10505. /**
  10506. * Creates a function that invokes `func`, with up to `n` arguments,
  10507. * ignoring any additional arguments.
  10508. *
  10509. * @static
  10510. * @memberOf _
  10511. * @since 3.0.0
  10512. * @category Function
  10513. * @param {Function} func The function to cap arguments for.
  10514. * @param {number} [n=func.length] The arity cap.
  10515. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10516. * @returns {Function} Returns the new capped function.
  10517. * @example
  10518. *
  10519. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10520. * // => [6, 8, 10]
  10521. */
  10522. function ary(func, n, guard) {
  10523. n = guard ? undefined : n;
  10524. n = (func && n == null) ? func.length : n;
  10525. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10526. }
  10527. /**
  10528. * Creates a function that invokes `func`, with the `this` binding and arguments
  10529. * of the created function, while it's called less than `n` times. Subsequent
  10530. * calls to the created function return the result of the last `func` invocation.
  10531. *
  10532. * @static
  10533. * @memberOf _
  10534. * @since 3.0.0
  10535. * @category Function
  10536. * @param {number} n The number of calls at which `func` is no longer invoked.
  10537. * @param {Function} func The function to restrict.
  10538. * @returns {Function} Returns the new restricted function.
  10539. * @example
  10540. *
  10541. * jQuery(element).on('click', _.before(5, addContactToList));
  10542. * // => Allows adding up to 4 contacts to the list.
  10543. */
  10544. function before(n, func) {
  10545. var result;
  10546. if (typeof func != 'function') {
  10547. throw new TypeError(FUNC_ERROR_TEXT);
  10548. }
  10549. n = toInteger(n);
  10550. return function() {
  10551. if (--n > 0) {
  10552. result = func.apply(this, arguments);
  10553. }
  10554. if (n <= 1) {
  10555. func = undefined;
  10556. }
  10557. return result;
  10558. };
  10559. }
  10560. /**
  10561. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10562. * and `partials` prepended to the arguments it receives.
  10563. *
  10564. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10565. * may be used as a placeholder for partially applied arguments.
  10566. *
  10567. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10568. * property of bound functions.
  10569. *
  10570. * @static
  10571. * @memberOf _
  10572. * @since 0.1.0
  10573. * @category Function
  10574. * @param {Function} func The function to bind.
  10575. * @param {*} thisArg The `this` binding of `func`.
  10576. * @param {...*} [partials] The arguments to be partially applied.
  10577. * @returns {Function} Returns the new bound function.
  10578. * @example
  10579. *
  10580. * function greet(greeting, punctuation) {
  10581. * return greeting + ' ' + this.user + punctuation;
  10582. * }
  10583. *
  10584. * var object = { 'user': 'fred' };
  10585. *
  10586. * var bound = _.bind(greet, object, 'hi');
  10587. * bound('!');
  10588. * // => 'hi fred!'
  10589. *
  10590. * // Bound with placeholders.
  10591. * var bound = _.bind(greet, object, _, '!');
  10592. * bound('hi');
  10593. * // => 'hi fred!'
  10594. */
  10595. var bind = baseRest(function(func, thisArg, partials) {
  10596. var bitmask = WRAP_BIND_FLAG;
  10597. if (partials.length) {
  10598. var holders = replaceHolders(partials, getHolder(bind));
  10599. bitmask |= WRAP_PARTIAL_FLAG;
  10600. }
  10601. return createWrap(func, bitmask, thisArg, partials, holders);
  10602. });
  10603. /**
  10604. * Creates a function that invokes the method at `object[key]` with `partials`
  10605. * prepended to the arguments it receives.
  10606. *
  10607. * This method differs from `_.bind` by allowing bound functions to reference
  10608. * methods that may be redefined or don't yet exist. See
  10609. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10610. * for more details.
  10611. *
  10612. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10613. * builds, may be used as a placeholder for partially applied arguments.
  10614. *
  10615. * @static
  10616. * @memberOf _
  10617. * @since 0.10.0
  10618. * @category Function
  10619. * @param {Object} object The object to invoke the method on.
  10620. * @param {string} key The key of the method.
  10621. * @param {...*} [partials] The arguments to be partially applied.
  10622. * @returns {Function} Returns the new bound function.
  10623. * @example
  10624. *
  10625. * var object = {
  10626. * 'user': 'fred',
  10627. * 'greet': function(greeting, punctuation) {
  10628. * return greeting + ' ' + this.user + punctuation;
  10629. * }
  10630. * };
  10631. *
  10632. * var bound = _.bindKey(object, 'greet', 'hi');
  10633. * bound('!');
  10634. * // => 'hi fred!'
  10635. *
  10636. * object.greet = function(greeting, punctuation) {
  10637. * return greeting + 'ya ' + this.user + punctuation;
  10638. * };
  10639. *
  10640. * bound('!');
  10641. * // => 'hiya fred!'
  10642. *
  10643. * // Bound with placeholders.
  10644. * var bound = _.bindKey(object, 'greet', _, '!');
  10645. * bound('hi');
  10646. * // => 'hiya fred!'
  10647. */
  10648. var bindKey = baseRest(function(object, key, partials) {
  10649. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10650. if (partials.length) {
  10651. var holders = replaceHolders(partials, getHolder(bindKey));
  10652. bitmask |= WRAP_PARTIAL_FLAG;
  10653. }
  10654. return createWrap(key, bitmask, object, partials, holders);
  10655. });
  10656. /**
  10657. * Creates a function that accepts arguments of `func` and either invokes
  10658. * `func` returning its result, if at least `arity` number of arguments have
  10659. * been provided, or returns a function that accepts the remaining `func`
  10660. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10661. * is not sufficient.
  10662. *
  10663. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10664. * may be used as a placeholder for provided arguments.
  10665. *
  10666. * **Note:** This method doesn't set the "length" property of curried functions.
  10667. *
  10668. * @static
  10669. * @memberOf _
  10670. * @since 2.0.0
  10671. * @category Function
  10672. * @param {Function} func The function to curry.
  10673. * @param {number} [arity=func.length] The arity of `func`.
  10674. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10675. * @returns {Function} Returns the new curried function.
  10676. * @example
  10677. *
  10678. * var abc = function(a, b, c) {
  10679. * return [a, b, c];
  10680. * };
  10681. *
  10682. * var curried = _.curry(abc);
  10683. *
  10684. * curried(1)(2)(3);
  10685. * // => [1, 2, 3]
  10686. *
  10687. * curried(1, 2)(3);
  10688. * // => [1, 2, 3]
  10689. *
  10690. * curried(1, 2, 3);
  10691. * // => [1, 2, 3]
  10692. *
  10693. * // Curried with placeholders.
  10694. * curried(1)(_, 3)(2);
  10695. * // => [1, 2, 3]
  10696. */
  10697. function curry(func, arity, guard) {
  10698. arity = guard ? undefined : arity;
  10699. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10700. result.placeholder = curry.placeholder;
  10701. return result;
  10702. }
  10703. /**
  10704. * This method is like `_.curry` except that arguments are applied to `func`
  10705. * in the manner of `_.partialRight` instead of `_.partial`.
  10706. *
  10707. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10708. * builds, may be used as a placeholder for provided arguments.
  10709. *
  10710. * **Note:** This method doesn't set the "length" property of curried functions.
  10711. *
  10712. * @static
  10713. * @memberOf _
  10714. * @since 3.0.0
  10715. * @category Function
  10716. * @param {Function} func The function to curry.
  10717. * @param {number} [arity=func.length] The arity of `func`.
  10718. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10719. * @returns {Function} Returns the new curried function.
  10720. * @example
  10721. *
  10722. * var abc = function(a, b, c) {
  10723. * return [a, b, c];
  10724. * };
  10725. *
  10726. * var curried = _.curryRight(abc);
  10727. *
  10728. * curried(3)(2)(1);
  10729. * // => [1, 2, 3]
  10730. *
  10731. * curried(2, 3)(1);
  10732. * // => [1, 2, 3]
  10733. *
  10734. * curried(1, 2, 3);
  10735. * // => [1, 2, 3]
  10736. *
  10737. * // Curried with placeholders.
  10738. * curried(3)(1, _)(2);
  10739. * // => [1, 2, 3]
  10740. */
  10741. function curryRight(func, arity, guard) {
  10742. arity = guard ? undefined : arity;
  10743. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10744. result.placeholder = curryRight.placeholder;
  10745. return result;
  10746. }
  10747. /**
  10748. * Creates a debounced function that delays invoking `func` until after `wait`
  10749. * milliseconds have elapsed since the last time the debounced function was
  10750. * invoked. The debounced function comes with a `cancel` method to cancel
  10751. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10752. * Provide `options` to indicate whether `func` should be invoked on the
  10753. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10754. * with the last arguments provided to the debounced function. Subsequent
  10755. * calls to the debounced function return the result of the last `func`
  10756. * invocation.
  10757. *
  10758. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10759. * invoked on the trailing edge of the timeout only if the debounced function
  10760. * is invoked more than once during the `wait` timeout.
  10761. *
  10762. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10763. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10764. *
  10765. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10766. * for details over the differences between `_.debounce` and `_.throttle`.
  10767. *
  10768. * @static
  10769. * @memberOf _
  10770. * @since 0.1.0
  10771. * @category Function
  10772. * @param {Function} func The function to debounce.
  10773. * @param {number} [wait=0] The number of milliseconds to delay.
  10774. * @param {Object} [options={}] The options object.
  10775. * @param {boolean} [options.leading=false]
  10776. * Specify invoking on the leading edge of the timeout.
  10777. * @param {number} [options.maxWait]
  10778. * The maximum time `func` is allowed to be delayed before it's invoked.
  10779. * @param {boolean} [options.trailing=true]
  10780. * Specify invoking on the trailing edge of the timeout.
  10781. * @returns {Function} Returns the new debounced function.
  10782. * @example
  10783. *
  10784. * // Avoid costly calculations while the window size is in flux.
  10785. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10786. *
  10787. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10788. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10789. * 'leading': true,
  10790. * 'trailing': false
  10791. * }));
  10792. *
  10793. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10794. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10795. * var source = new EventSource('/stream');
  10796. * jQuery(source).on('message', debounced);
  10797. *
  10798. * // Cancel the trailing debounced invocation.
  10799. * jQuery(window).on('popstate', debounced.cancel);
  10800. */
  10801. function debounce(func, wait, options) {
  10802. var lastArgs,
  10803. lastThis,
  10804. maxWait,
  10805. result,
  10806. timerId,
  10807. lastCallTime,
  10808. lastInvokeTime = 0,
  10809. leading = false,
  10810. maxing = false,
  10811. trailing = true;
  10812. if (typeof func != 'function') {
  10813. throw new TypeError(FUNC_ERROR_TEXT);
  10814. }
  10815. wait = toNumber(wait) || 0;
  10816. if (isObject(options)) {
  10817. leading = !!options.leading;
  10818. maxing = 'maxWait' in options;
  10819. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10820. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10821. }
  10822. function invokeFunc(time) {
  10823. var args = lastArgs,
  10824. thisArg = lastThis;
  10825. lastArgs = lastThis = undefined;
  10826. lastInvokeTime = time;
  10827. result = func.apply(thisArg, args);
  10828. return result;
  10829. }
  10830. function leadingEdge(time) {
  10831. // Reset any `maxWait` timer.
  10832. lastInvokeTime = time;
  10833. // Start the timer for the trailing edge.
  10834. timerId = setTimeout(timerExpired, wait);
  10835. // Invoke the leading edge.
  10836. return leading ? invokeFunc(time) : result;
  10837. }
  10838. function remainingWait(time) {
  10839. var timeSinceLastCall = time - lastCallTime,
  10840. timeSinceLastInvoke = time - lastInvokeTime,
  10841. timeWaiting = wait - timeSinceLastCall;
  10842. return maxing
  10843. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10844. : timeWaiting;
  10845. }
  10846. function shouldInvoke(time) {
  10847. var timeSinceLastCall = time - lastCallTime,
  10848. timeSinceLastInvoke = time - lastInvokeTime;
  10849. // Either this is the first call, activity has stopped and we're at the
  10850. // trailing edge, the system time has gone backwards and we're treating
  10851. // it as the trailing edge, or we've hit the `maxWait` limit.
  10852. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10853. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10854. }
  10855. function timerExpired() {
  10856. var time = now();
  10857. if (shouldInvoke(time)) {
  10858. return trailingEdge(time);
  10859. }
  10860. // Restart the timer.
  10861. timerId = setTimeout(timerExpired, remainingWait(time));
  10862. }
  10863. function trailingEdge(time) {
  10864. timerId = undefined;
  10865. // Only invoke if we have `lastArgs` which means `func` has been
  10866. // debounced at least once.
  10867. if (trailing && lastArgs) {
  10868. return invokeFunc(time);
  10869. }
  10870. lastArgs = lastThis = undefined;
  10871. return result;
  10872. }
  10873. function cancel() {
  10874. if (timerId !== undefined) {
  10875. clearTimeout(timerId);
  10876. }
  10877. lastInvokeTime = 0;
  10878. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10879. }
  10880. function flush() {
  10881. return timerId === undefined ? result : trailingEdge(now());
  10882. }
  10883. function debounced() {
  10884. var time = now(),
  10885. isInvoking = shouldInvoke(time);
  10886. lastArgs = arguments;
  10887. lastThis = this;
  10888. lastCallTime = time;
  10889. if (isInvoking) {
  10890. if (timerId === undefined) {
  10891. return leadingEdge(lastCallTime);
  10892. }
  10893. if (maxing) {
  10894. // Handle invocations in a tight loop.
  10895. clearTimeout(timerId);
  10896. timerId = setTimeout(timerExpired, wait);
  10897. return invokeFunc(lastCallTime);
  10898. }
  10899. }
  10900. if (timerId === undefined) {
  10901. timerId = setTimeout(timerExpired, wait);
  10902. }
  10903. return result;
  10904. }
  10905. debounced.cancel = cancel;
  10906. debounced.flush = flush;
  10907. return debounced;
  10908. }
  10909. /**
  10910. * Defers invoking the `func` until the current call stack has cleared. Any
  10911. * additional arguments are provided to `func` when it's invoked.
  10912. *
  10913. * @static
  10914. * @memberOf _
  10915. * @since 0.1.0
  10916. * @category Function
  10917. * @param {Function} func The function to defer.
  10918. * @param {...*} [args] The arguments to invoke `func` with.
  10919. * @returns {number} Returns the timer id.
  10920. * @example
  10921. *
  10922. * _.defer(function(text) {
  10923. * console.log(text);
  10924. * }, 'deferred');
  10925. * // => Logs 'deferred' after one millisecond.
  10926. */
  10927. var defer = baseRest(function(func, args) {
  10928. return baseDelay(func, 1, args);
  10929. });
  10930. /**
  10931. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10932. * provided to `func` when it's invoked.
  10933. *
  10934. * @static
  10935. * @memberOf _
  10936. * @since 0.1.0
  10937. * @category Function
  10938. * @param {Function} func The function to delay.
  10939. * @param {number} wait The number of milliseconds to delay invocation.
  10940. * @param {...*} [args] The arguments to invoke `func` with.
  10941. * @returns {number} Returns the timer id.
  10942. * @example
  10943. *
  10944. * _.delay(function(text) {
  10945. * console.log(text);
  10946. * }, 1000, 'later');
  10947. * // => Logs 'later' after one second.
  10948. */
  10949. var delay = baseRest(function(func, wait, args) {
  10950. return baseDelay(func, toNumber(wait) || 0, args);
  10951. });
  10952. /**
  10953. * Creates a function that invokes `func` with arguments reversed.
  10954. *
  10955. * @static
  10956. * @memberOf _
  10957. * @since 4.0.0
  10958. * @category Function
  10959. * @param {Function} func The function to flip arguments for.
  10960. * @returns {Function} Returns the new flipped function.
  10961. * @example
  10962. *
  10963. * var flipped = _.flip(function() {
  10964. * return _.toArray(arguments);
  10965. * });
  10966. *
  10967. * flipped('a', 'b', 'c', 'd');
  10968. * // => ['d', 'c', 'b', 'a']
  10969. */
  10970. function flip(func) {
  10971. return createWrap(func, WRAP_FLIP_FLAG);
  10972. }
  10973. /**
  10974. * Creates a function that memoizes the result of `func`. If `resolver` is
  10975. * provided, it determines the cache key for storing the result based on the
  10976. * arguments provided to the memoized function. By default, the first argument
  10977. * provided to the memoized function is used as the map cache key. The `func`
  10978. * is invoked with the `this` binding of the memoized function.
  10979. *
  10980. * **Note:** The cache is exposed as the `cache` property on the memoized
  10981. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10982. * constructor with one whose instances implement the
  10983. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10984. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10985. *
  10986. * @static
  10987. * @memberOf _
  10988. * @since 0.1.0
  10989. * @category Function
  10990. * @param {Function} func The function to have its output memoized.
  10991. * @param {Function} [resolver] The function to resolve the cache key.
  10992. * @returns {Function} Returns the new memoized function.
  10993. * @example
  10994. *
  10995. * var object = { 'a': 1, 'b': 2 };
  10996. * var other = { 'c': 3, 'd': 4 };
  10997. *
  10998. * var values = _.memoize(_.values);
  10999. * values(object);
  11000. * // => [1, 2]
  11001. *
  11002. * values(other);
  11003. * // => [3, 4]
  11004. *
  11005. * object.a = 2;
  11006. * values(object);
  11007. * // => [1, 2]
  11008. *
  11009. * // Modify the result cache.
  11010. * values.cache.set(object, ['a', 'b']);
  11011. * values(object);
  11012. * // => ['a', 'b']
  11013. *
  11014. * // Replace `_.memoize.Cache`.
  11015. * _.memoize.Cache = WeakMap;
  11016. */
  11017. function memoize(func, resolver) {
  11018. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11019. throw new TypeError(FUNC_ERROR_TEXT);
  11020. }
  11021. var memoized = function() {
  11022. var args = arguments,
  11023. key = resolver ? resolver.apply(this, args) : args[0],
  11024. cache = memoized.cache;
  11025. if (cache.has(key)) {
  11026. return cache.get(key);
  11027. }
  11028. var result = func.apply(this, args);
  11029. memoized.cache = cache.set(key, result) || cache;
  11030. return result;
  11031. };
  11032. memoized.cache = new (memoize.Cache || MapCache);
  11033. return memoized;
  11034. }
  11035. // Expose `MapCache`.
  11036. memoize.Cache = MapCache;
  11037. /**
  11038. * Creates a function that negates the result of the predicate `func`. The
  11039. * `func` predicate is invoked with the `this` binding and arguments of the
  11040. * created function.
  11041. *
  11042. * @static
  11043. * @memberOf _
  11044. * @since 3.0.0
  11045. * @category Function
  11046. * @param {Function} predicate The predicate to negate.
  11047. * @returns {Function} Returns the new negated function.
  11048. * @example
  11049. *
  11050. * function isEven(n) {
  11051. * return n % 2 == 0;
  11052. * }
  11053. *
  11054. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11055. * // => [1, 3, 5]
  11056. */
  11057. function negate(predicate) {
  11058. if (typeof predicate != 'function') {
  11059. throw new TypeError(FUNC_ERROR_TEXT);
  11060. }
  11061. return function() {
  11062. var args = arguments;
  11063. switch (args.length) {
  11064. case 0: return !predicate.call(this);
  11065. case 1: return !predicate.call(this, args[0]);
  11066. case 2: return !predicate.call(this, args[0], args[1]);
  11067. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11068. }
  11069. return !predicate.apply(this, args);
  11070. };
  11071. }
  11072. /**
  11073. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11074. * to the function return the value of the first invocation. The `func` is
  11075. * invoked with the `this` binding and arguments of the created function.
  11076. *
  11077. * @static
  11078. * @memberOf _
  11079. * @since 0.1.0
  11080. * @category Function
  11081. * @param {Function} func The function to restrict.
  11082. * @returns {Function} Returns the new restricted function.
  11083. * @example
  11084. *
  11085. * var initialize = _.once(createApplication);
  11086. * initialize();
  11087. * initialize();
  11088. * // => `createApplication` is invoked once
  11089. */
  11090. function once(func) {
  11091. return before(2, func);
  11092. }
  11093. /**
  11094. * Creates a function that invokes `func` with its arguments transformed.
  11095. *
  11096. * @static
  11097. * @since 4.0.0
  11098. * @memberOf _
  11099. * @category Function
  11100. * @param {Function} func The function to wrap.
  11101. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11102. * The argument transforms.
  11103. * @returns {Function} Returns the new function.
  11104. * @example
  11105. *
  11106. * function doubled(n) {
  11107. * return n * 2;
  11108. * }
  11109. *
  11110. * function square(n) {
  11111. * return n * n;
  11112. * }
  11113. *
  11114. * var func = _.overArgs(function(x, y) {
  11115. * return [x, y];
  11116. * }, [square, doubled]);
  11117. *
  11118. * func(9, 3);
  11119. * // => [81, 6]
  11120. *
  11121. * func(10, 5);
  11122. * // => [100, 10]
  11123. */
  11124. var overArgs = castRest(function(func, transforms) {
  11125. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11126. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11127. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11128. var funcsLength = transforms.length;
  11129. return baseRest(function(args) {
  11130. var index = -1,
  11131. length = nativeMin(args.length, funcsLength);
  11132. while (++index < length) {
  11133. args[index] = transforms[index].call(this, args[index]);
  11134. }
  11135. return apply(func, this, args);
  11136. });
  11137. });
  11138. /**
  11139. * Creates a function that invokes `func` with `partials` prepended to the
  11140. * arguments it receives. This method is like `_.bind` except it does **not**
  11141. * alter the `this` binding.
  11142. *
  11143. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11144. * builds, may be used as a placeholder for partially applied arguments.
  11145. *
  11146. * **Note:** This method doesn't set the "length" property of partially
  11147. * applied functions.
  11148. *
  11149. * @static
  11150. * @memberOf _
  11151. * @since 0.2.0
  11152. * @category Function
  11153. * @param {Function} func The function to partially apply arguments to.
  11154. * @param {...*} [partials] The arguments to be partially applied.
  11155. * @returns {Function} Returns the new partially applied function.
  11156. * @example
  11157. *
  11158. * function greet(greeting, name) {
  11159. * return greeting + ' ' + name;
  11160. * }
  11161. *
  11162. * var sayHelloTo = _.partial(greet, 'hello');
  11163. * sayHelloTo('fred');
  11164. * // => 'hello fred'
  11165. *
  11166. * // Partially applied with placeholders.
  11167. * var greetFred = _.partial(greet, _, 'fred');
  11168. * greetFred('hi');
  11169. * // => 'hi fred'
  11170. */
  11171. var partial = baseRest(function(func, partials) {
  11172. var holders = replaceHolders(partials, getHolder(partial));
  11173. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11174. });
  11175. /**
  11176. * This method is like `_.partial` except that partially applied arguments
  11177. * are appended to the arguments it receives.
  11178. *
  11179. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11180. * builds, may be used as a placeholder for partially applied arguments.
  11181. *
  11182. * **Note:** This method doesn't set the "length" property of partially
  11183. * applied functions.
  11184. *
  11185. * @static
  11186. * @memberOf _
  11187. * @since 1.0.0
  11188. * @category Function
  11189. * @param {Function} func The function to partially apply arguments to.
  11190. * @param {...*} [partials] The arguments to be partially applied.
  11191. * @returns {Function} Returns the new partially applied function.
  11192. * @example
  11193. *
  11194. * function greet(greeting, name) {
  11195. * return greeting + ' ' + name;
  11196. * }
  11197. *
  11198. * var greetFred = _.partialRight(greet, 'fred');
  11199. * greetFred('hi');
  11200. * // => 'hi fred'
  11201. *
  11202. * // Partially applied with placeholders.
  11203. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11204. * sayHelloTo('fred');
  11205. * // => 'hello fred'
  11206. */
  11207. var partialRight = baseRest(function(func, partials) {
  11208. var holders = replaceHolders(partials, getHolder(partialRight));
  11209. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11210. });
  11211. /**
  11212. * Creates a function that invokes `func` with arguments arranged according
  11213. * to the specified `indexes` where the argument value at the first index is
  11214. * provided as the first argument, the argument value at the second index is
  11215. * provided as the second argument, and so on.
  11216. *
  11217. * @static
  11218. * @memberOf _
  11219. * @since 3.0.0
  11220. * @category Function
  11221. * @param {Function} func The function to rearrange arguments for.
  11222. * @param {...(number|number[])} indexes The arranged argument indexes.
  11223. * @returns {Function} Returns the new function.
  11224. * @example
  11225. *
  11226. * var rearged = _.rearg(function(a, b, c) {
  11227. * return [a, b, c];
  11228. * }, [2, 0, 1]);
  11229. *
  11230. * rearged('b', 'c', 'a')
  11231. * // => ['a', 'b', 'c']
  11232. */
  11233. var rearg = flatRest(function(func, indexes) {
  11234. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11235. });
  11236. /**
  11237. * Creates a function that invokes `func` with the `this` binding of the
  11238. * created function and arguments from `start` and beyond provided as
  11239. * an array.
  11240. *
  11241. * **Note:** This method is based on the
  11242. * [rest parameter](https://mdn.io/rest_parameters).
  11243. *
  11244. * @static
  11245. * @memberOf _
  11246. * @since 4.0.0
  11247. * @category Function
  11248. * @param {Function} func The function to apply a rest parameter to.
  11249. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11250. * @returns {Function} Returns the new function.
  11251. * @example
  11252. *
  11253. * var say = _.rest(function(what, names) {
  11254. * return what + ' ' + _.initial(names).join(', ') +
  11255. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11256. * });
  11257. *
  11258. * say('hello', 'fred', 'barney', 'pebbles');
  11259. * // => 'hello fred, barney, & pebbles'
  11260. */
  11261. function rest(func, start) {
  11262. if (typeof func != 'function') {
  11263. throw new TypeError(FUNC_ERROR_TEXT);
  11264. }
  11265. start = start === undefined ? start : toInteger(start);
  11266. return baseRest(func, start);
  11267. }
  11268. /**
  11269. * Creates a function that invokes `func` with the `this` binding of the
  11270. * create function and an array of arguments much like
  11271. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11272. *
  11273. * **Note:** This method is based on the
  11274. * [spread operator](https://mdn.io/spread_operator).
  11275. *
  11276. * @static
  11277. * @memberOf _
  11278. * @since 3.2.0
  11279. * @category Function
  11280. * @param {Function} func The function to spread arguments over.
  11281. * @param {number} [start=0] The start position of the spread.
  11282. * @returns {Function} Returns the new function.
  11283. * @example
  11284. *
  11285. * var say = _.spread(function(who, what) {
  11286. * return who + ' says ' + what;
  11287. * });
  11288. *
  11289. * say(['fred', 'hello']);
  11290. * // => 'fred says hello'
  11291. *
  11292. * var numbers = Promise.all([
  11293. * Promise.resolve(40),
  11294. * Promise.resolve(36)
  11295. * ]);
  11296. *
  11297. * numbers.then(_.spread(function(x, y) {
  11298. * return x + y;
  11299. * }));
  11300. * // => a Promise of 76
  11301. */
  11302. function spread(func, start) {
  11303. if (typeof func != 'function') {
  11304. throw new TypeError(FUNC_ERROR_TEXT);
  11305. }
  11306. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11307. return baseRest(function(args) {
  11308. var array = args[start],
  11309. otherArgs = castSlice(args, 0, start);
  11310. if (array) {
  11311. arrayPush(otherArgs, array);
  11312. }
  11313. return apply(func, this, otherArgs);
  11314. });
  11315. }
  11316. /**
  11317. * Creates a throttled function that only invokes `func` at most once per
  11318. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11319. * method to cancel delayed `func` invocations and a `flush` method to
  11320. * immediately invoke them. Provide `options` to indicate whether `func`
  11321. * should be invoked on the leading and/or trailing edge of the `wait`
  11322. * timeout. The `func` is invoked with the last arguments provided to the
  11323. * throttled function. Subsequent calls to the throttled function return the
  11324. * result of the last `func` invocation.
  11325. *
  11326. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11327. * invoked on the trailing edge of the timeout only if the throttled function
  11328. * is invoked more than once during the `wait` timeout.
  11329. *
  11330. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11331. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11332. *
  11333. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11334. * for details over the differences between `_.throttle` and `_.debounce`.
  11335. *
  11336. * @static
  11337. * @memberOf _
  11338. * @since 0.1.0
  11339. * @category Function
  11340. * @param {Function} func The function to throttle.
  11341. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11342. * @param {Object} [options={}] The options object.
  11343. * @param {boolean} [options.leading=true]
  11344. * Specify invoking on the leading edge of the timeout.
  11345. * @param {boolean} [options.trailing=true]
  11346. * Specify invoking on the trailing edge of the timeout.
  11347. * @returns {Function} Returns the new throttled function.
  11348. * @example
  11349. *
  11350. * // Avoid excessively updating the position while scrolling.
  11351. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11352. *
  11353. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11354. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11355. * jQuery(element).on('click', throttled);
  11356. *
  11357. * // Cancel the trailing throttled invocation.
  11358. * jQuery(window).on('popstate', throttled.cancel);
  11359. */
  11360. function throttle(func, wait, options) {
  11361. var leading = true,
  11362. trailing = true;
  11363. if (typeof func != 'function') {
  11364. throw new TypeError(FUNC_ERROR_TEXT);
  11365. }
  11366. if (isObject(options)) {
  11367. leading = 'leading' in options ? !!options.leading : leading;
  11368. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11369. }
  11370. return debounce(func, wait, {
  11371. 'leading': leading,
  11372. 'maxWait': wait,
  11373. 'trailing': trailing
  11374. });
  11375. }
  11376. /**
  11377. * Creates a function that accepts up to one argument, ignoring any
  11378. * additional arguments.
  11379. *
  11380. * @static
  11381. * @memberOf _
  11382. * @since 4.0.0
  11383. * @category Function
  11384. * @param {Function} func The function to cap arguments for.
  11385. * @returns {Function} Returns the new capped function.
  11386. * @example
  11387. *
  11388. * _.map(['6', '8', '10'], _.unary(parseInt));
  11389. * // => [6, 8, 10]
  11390. */
  11391. function unary(func) {
  11392. return ary(func, 1);
  11393. }
  11394. /**
  11395. * Creates a function that provides `value` to `wrapper` as its first
  11396. * argument. Any additional arguments provided to the function are appended
  11397. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11398. * binding of the created function.
  11399. *
  11400. * @static
  11401. * @memberOf _
  11402. * @since 0.1.0
  11403. * @category Function
  11404. * @param {*} value The value to wrap.
  11405. * @param {Function} [wrapper=identity] The wrapper function.
  11406. * @returns {Function} Returns the new function.
  11407. * @example
  11408. *
  11409. * var p = _.wrap(_.escape, function(func, text) {
  11410. * return '<p>' + func(text) + '</p>';
  11411. * });
  11412. *
  11413. * p('fred, barney, & pebbles');
  11414. * // => '<p>fred, barney, &amp; pebbles</p>'
  11415. */
  11416. function wrap(value, wrapper) {
  11417. return partial(castFunction(wrapper), value);
  11418. }
  11419. /*------------------------------------------------------------------------*/
  11420. /**
  11421. * Casts `value` as an array if it's not one.
  11422. *
  11423. * @static
  11424. * @memberOf _
  11425. * @since 4.4.0
  11426. * @category Lang
  11427. * @param {*} value The value to inspect.
  11428. * @returns {Array} Returns the cast array.
  11429. * @example
  11430. *
  11431. * _.castArray(1);
  11432. * // => [1]
  11433. *
  11434. * _.castArray({ 'a': 1 });
  11435. * // => [{ 'a': 1 }]
  11436. *
  11437. * _.castArray('abc');
  11438. * // => ['abc']
  11439. *
  11440. * _.castArray(null);
  11441. * // => [null]
  11442. *
  11443. * _.castArray(undefined);
  11444. * // => [undefined]
  11445. *
  11446. * _.castArray();
  11447. * // => []
  11448. *
  11449. * var array = [1, 2, 3];
  11450. * console.log(_.castArray(array) === array);
  11451. * // => true
  11452. */
  11453. function castArray() {
  11454. if (!arguments.length) {
  11455. return [];
  11456. }
  11457. var value = arguments[0];
  11458. return isArray(value) ? value : [value];
  11459. }
  11460. /**
  11461. * Creates a shallow clone of `value`.
  11462. *
  11463. * **Note:** This method is loosely based on the
  11464. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11465. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11466. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11467. * arrays. The own enumerable properties of `arguments` objects are cloned
  11468. * as plain objects. An empty object is returned for uncloneable values such
  11469. * as error objects, functions, DOM nodes, and WeakMaps.
  11470. *
  11471. * @static
  11472. * @memberOf _
  11473. * @since 0.1.0
  11474. * @category Lang
  11475. * @param {*} value The value to clone.
  11476. * @returns {*} Returns the cloned value.
  11477. * @see _.cloneDeep
  11478. * @example
  11479. *
  11480. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11481. *
  11482. * var shallow = _.clone(objects);
  11483. * console.log(shallow[0] === objects[0]);
  11484. * // => true
  11485. */
  11486. function clone(value) {
  11487. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11488. }
  11489. /**
  11490. * This method is like `_.clone` except that it accepts `customizer` which
  11491. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11492. * cloning is handled by the method instead. The `customizer` is invoked with
  11493. * up to four arguments; (value [, index|key, object, stack]).
  11494. *
  11495. * @static
  11496. * @memberOf _
  11497. * @since 4.0.0
  11498. * @category Lang
  11499. * @param {*} value The value to clone.
  11500. * @param {Function} [customizer] The function to customize cloning.
  11501. * @returns {*} Returns the cloned value.
  11502. * @see _.cloneDeepWith
  11503. * @example
  11504. *
  11505. * function customizer(value) {
  11506. * if (_.isElement(value)) {
  11507. * return value.cloneNode(false);
  11508. * }
  11509. * }
  11510. *
  11511. * var el = _.cloneWith(document.body, customizer);
  11512. *
  11513. * console.log(el === document.body);
  11514. * // => false
  11515. * console.log(el.nodeName);
  11516. * // => 'BODY'
  11517. * console.log(el.childNodes.length);
  11518. * // => 0
  11519. */
  11520. function cloneWith(value, customizer) {
  11521. customizer = typeof customizer == 'function' ? customizer : undefined;
  11522. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11523. }
  11524. /**
  11525. * This method is like `_.clone` except that it recursively clones `value`.
  11526. *
  11527. * @static
  11528. * @memberOf _
  11529. * @since 1.0.0
  11530. * @category Lang
  11531. * @param {*} value The value to recursively clone.
  11532. * @returns {*} Returns the deep cloned value.
  11533. * @see _.clone
  11534. * @example
  11535. *
  11536. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11537. *
  11538. * var deep = _.cloneDeep(objects);
  11539. * console.log(deep[0] === objects[0]);
  11540. * // => false
  11541. */
  11542. function cloneDeep(value) {
  11543. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11544. }
  11545. /**
  11546. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11547. *
  11548. * @static
  11549. * @memberOf _
  11550. * @since 4.0.0
  11551. * @category Lang
  11552. * @param {*} value The value to recursively clone.
  11553. * @param {Function} [customizer] The function to customize cloning.
  11554. * @returns {*} Returns the deep cloned value.
  11555. * @see _.cloneWith
  11556. * @example
  11557. *
  11558. * function customizer(value) {
  11559. * if (_.isElement(value)) {
  11560. * return value.cloneNode(true);
  11561. * }
  11562. * }
  11563. *
  11564. * var el = _.cloneDeepWith(document.body, customizer);
  11565. *
  11566. * console.log(el === document.body);
  11567. * // => false
  11568. * console.log(el.nodeName);
  11569. * // => 'BODY'
  11570. * console.log(el.childNodes.length);
  11571. * // => 20
  11572. */
  11573. function cloneDeepWith(value, customizer) {
  11574. customizer = typeof customizer == 'function' ? customizer : undefined;
  11575. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11576. }
  11577. /**
  11578. * Checks if `object` conforms to `source` by invoking the predicate
  11579. * properties of `source` with the corresponding property values of `object`.
  11580. *
  11581. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11582. * partially applied.
  11583. *
  11584. * @static
  11585. * @memberOf _
  11586. * @since 4.14.0
  11587. * @category Lang
  11588. * @param {Object} object The object to inspect.
  11589. * @param {Object} source The object of property predicates to conform to.
  11590. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11591. * @example
  11592. *
  11593. * var object = { 'a': 1, 'b': 2 };
  11594. *
  11595. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11596. * // => true
  11597. *
  11598. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11599. * // => false
  11600. */
  11601. function conformsTo(object, source) {
  11602. return source == null || baseConformsTo(object, source, keys(source));
  11603. }
  11604. /**
  11605. * Performs a
  11606. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11607. * comparison between two values to determine if they are equivalent.
  11608. *
  11609. * @static
  11610. * @memberOf _
  11611. * @since 4.0.0
  11612. * @category Lang
  11613. * @param {*} value The value to compare.
  11614. * @param {*} other The other value to compare.
  11615. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11616. * @example
  11617. *
  11618. * var object = { 'a': 1 };
  11619. * var other = { 'a': 1 };
  11620. *
  11621. * _.eq(object, object);
  11622. * // => true
  11623. *
  11624. * _.eq(object, other);
  11625. * // => false
  11626. *
  11627. * _.eq('a', 'a');
  11628. * // => true
  11629. *
  11630. * _.eq('a', Object('a'));
  11631. * // => false
  11632. *
  11633. * _.eq(NaN, NaN);
  11634. * // => true
  11635. */
  11636. function eq(value, other) {
  11637. return value === other || (value !== value && other !== other);
  11638. }
  11639. /**
  11640. * Checks if `value` is greater than `other`.
  11641. *
  11642. * @static
  11643. * @memberOf _
  11644. * @since 3.9.0
  11645. * @category Lang
  11646. * @param {*} value The value to compare.
  11647. * @param {*} other The other value to compare.
  11648. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11649. * else `false`.
  11650. * @see _.lt
  11651. * @example
  11652. *
  11653. * _.gt(3, 1);
  11654. * // => true
  11655. *
  11656. * _.gt(3, 3);
  11657. * // => false
  11658. *
  11659. * _.gt(1, 3);
  11660. * // => false
  11661. */
  11662. var gt = createRelationalOperation(baseGt);
  11663. /**
  11664. * Checks if `value` is greater than or equal to `other`.
  11665. *
  11666. * @static
  11667. * @memberOf _
  11668. * @since 3.9.0
  11669. * @category Lang
  11670. * @param {*} value The value to compare.
  11671. * @param {*} other The other value to compare.
  11672. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11673. * `other`, else `false`.
  11674. * @see _.lte
  11675. * @example
  11676. *
  11677. * _.gte(3, 1);
  11678. * // => true
  11679. *
  11680. * _.gte(3, 3);
  11681. * // => true
  11682. *
  11683. * _.gte(1, 3);
  11684. * // => false
  11685. */
  11686. var gte = createRelationalOperation(function(value, other) {
  11687. return value >= other;
  11688. });
  11689. /**
  11690. * Checks if `value` is likely an `arguments` object.
  11691. *
  11692. * @static
  11693. * @memberOf _
  11694. * @since 0.1.0
  11695. * @category Lang
  11696. * @param {*} value The value to check.
  11697. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11698. * else `false`.
  11699. * @example
  11700. *
  11701. * _.isArguments(function() { return arguments; }());
  11702. * // => true
  11703. *
  11704. * _.isArguments([1, 2, 3]);
  11705. * // => false
  11706. */
  11707. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11708. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11709. !propertyIsEnumerable.call(value, 'callee');
  11710. };
  11711. /**
  11712. * Checks if `value` is classified as an `Array` 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 array, else `false`.
  11720. * @example
  11721. *
  11722. * _.isArray([1, 2, 3]);
  11723. * // => true
  11724. *
  11725. * _.isArray(document.body.children);
  11726. * // => false
  11727. *
  11728. * _.isArray('abc');
  11729. * // => false
  11730. *
  11731. * _.isArray(_.noop);
  11732. * // => false
  11733. */
  11734. var isArray = Array.isArray;
  11735. /**
  11736. * Checks if `value` is classified as an `ArrayBuffer` object.
  11737. *
  11738. * @static
  11739. * @memberOf _
  11740. * @since 4.3.0
  11741. * @category Lang
  11742. * @param {*} value The value to check.
  11743. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11744. * @example
  11745. *
  11746. * _.isArrayBuffer(new ArrayBuffer(2));
  11747. * // => true
  11748. *
  11749. * _.isArrayBuffer(new Array(2));
  11750. * // => false
  11751. */
  11752. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11753. /**
  11754. * Checks if `value` is array-like. A value is considered array-like if it's
  11755. * not a function and has a `value.length` that's an integer greater than or
  11756. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11757. *
  11758. * @static
  11759. * @memberOf _
  11760. * @since 4.0.0
  11761. * @category Lang
  11762. * @param {*} value The value to check.
  11763. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11764. * @example
  11765. *
  11766. * _.isArrayLike([1, 2, 3]);
  11767. * // => true
  11768. *
  11769. * _.isArrayLike(document.body.children);
  11770. * // => true
  11771. *
  11772. * _.isArrayLike('abc');
  11773. * // => true
  11774. *
  11775. * _.isArrayLike(_.noop);
  11776. * // => false
  11777. */
  11778. function isArrayLike(value) {
  11779. return value != null && isLength(value.length) && !isFunction(value);
  11780. }
  11781. /**
  11782. * This method is like `_.isArrayLike` except that it also checks if `value`
  11783. * is an object.
  11784. *
  11785. * @static
  11786. * @memberOf _
  11787. * @since 4.0.0
  11788. * @category Lang
  11789. * @param {*} value The value to check.
  11790. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11791. * else `false`.
  11792. * @example
  11793. *
  11794. * _.isArrayLikeObject([1, 2, 3]);
  11795. * // => true
  11796. *
  11797. * _.isArrayLikeObject(document.body.children);
  11798. * // => true
  11799. *
  11800. * _.isArrayLikeObject('abc');
  11801. * // => false
  11802. *
  11803. * _.isArrayLikeObject(_.noop);
  11804. * // => false
  11805. */
  11806. function isArrayLikeObject(value) {
  11807. return isObjectLike(value) && isArrayLike(value);
  11808. }
  11809. /**
  11810. * Checks if `value` is classified as a boolean primitive or object.
  11811. *
  11812. * @static
  11813. * @memberOf _
  11814. * @since 0.1.0
  11815. * @category Lang
  11816. * @param {*} value The value to check.
  11817. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11818. * @example
  11819. *
  11820. * _.isBoolean(false);
  11821. * // => true
  11822. *
  11823. * _.isBoolean(null);
  11824. * // => false
  11825. */
  11826. function isBoolean(value) {
  11827. return value === true || value === false ||
  11828. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11829. }
  11830. /**
  11831. * Checks if `value` is a buffer.
  11832. *
  11833. * @static
  11834. * @memberOf _
  11835. * @since 4.3.0
  11836. * @category Lang
  11837. * @param {*} value The value to check.
  11838. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11839. * @example
  11840. *
  11841. * _.isBuffer(new Buffer(2));
  11842. * // => true
  11843. *
  11844. * _.isBuffer(new Uint8Array(2));
  11845. * // => false
  11846. */
  11847. var isBuffer = nativeIsBuffer || stubFalse;
  11848. /**
  11849. * Checks if `value` is classified as a `Date` object.
  11850. *
  11851. * @static
  11852. * @memberOf _
  11853. * @since 0.1.0
  11854. * @category Lang
  11855. * @param {*} value The value to check.
  11856. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11857. * @example
  11858. *
  11859. * _.isDate(new Date);
  11860. * // => true
  11861. *
  11862. * _.isDate('Mon April 23 2012');
  11863. * // => false
  11864. */
  11865. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11866. /**
  11867. * Checks if `value` is likely a DOM element.
  11868. *
  11869. * @static
  11870. * @memberOf _
  11871. * @since 0.1.0
  11872. * @category Lang
  11873. * @param {*} value The value to check.
  11874. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11875. * @example
  11876. *
  11877. * _.isElement(document.body);
  11878. * // => true
  11879. *
  11880. * _.isElement('<body>');
  11881. * // => false
  11882. */
  11883. function isElement(value) {
  11884. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11885. }
  11886. /**
  11887. * Checks if `value` is an empty object, collection, map, or set.
  11888. *
  11889. * Objects are considered empty if they have no own enumerable string keyed
  11890. * properties.
  11891. *
  11892. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11893. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11894. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11895. *
  11896. * @static
  11897. * @memberOf _
  11898. * @since 0.1.0
  11899. * @category Lang
  11900. * @param {*} value The value to check.
  11901. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11902. * @example
  11903. *
  11904. * _.isEmpty(null);
  11905. * // => true
  11906. *
  11907. * _.isEmpty(true);
  11908. * // => true
  11909. *
  11910. * _.isEmpty(1);
  11911. * // => true
  11912. *
  11913. * _.isEmpty([1, 2, 3]);
  11914. * // => false
  11915. *
  11916. * _.isEmpty({ 'a': 1 });
  11917. * // => false
  11918. */
  11919. function isEmpty(value) {
  11920. if (value == null) {
  11921. return true;
  11922. }
  11923. if (isArrayLike(value) &&
  11924. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11925. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11926. return !value.length;
  11927. }
  11928. var tag = getTag(value);
  11929. if (tag == mapTag || tag == setTag) {
  11930. return !value.size;
  11931. }
  11932. if (isPrototype(value)) {
  11933. return !baseKeys(value).length;
  11934. }
  11935. for (var key in value) {
  11936. if (hasOwnProperty.call(value, key)) {
  11937. return false;
  11938. }
  11939. }
  11940. return true;
  11941. }
  11942. /**
  11943. * Performs a deep comparison between two values to determine if they are
  11944. * equivalent.
  11945. *
  11946. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11947. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11948. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11949. * by their own, not inherited, enumerable properties. Functions and DOM
  11950. * nodes are compared by strict equality, i.e. `===`.
  11951. *
  11952. * @static
  11953. * @memberOf _
  11954. * @since 0.1.0
  11955. * @category Lang
  11956. * @param {*} value The value to compare.
  11957. * @param {*} other The other value to compare.
  11958. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11959. * @example
  11960. *
  11961. * var object = { 'a': 1 };
  11962. * var other = { 'a': 1 };
  11963. *
  11964. * _.isEqual(object, other);
  11965. * // => true
  11966. *
  11967. * object === other;
  11968. * // => false
  11969. */
  11970. function isEqual(value, other) {
  11971. return baseIsEqual(value, other);
  11972. }
  11973. /**
  11974. * This method is like `_.isEqual` except that it accepts `customizer` which
  11975. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11976. * are handled by the method instead. The `customizer` is invoked with up to
  11977. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11978. *
  11979. * @static
  11980. * @memberOf _
  11981. * @since 4.0.0
  11982. * @category Lang
  11983. * @param {*} value The value to compare.
  11984. * @param {*} other The other value to compare.
  11985. * @param {Function} [customizer] The function to customize comparisons.
  11986. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11987. * @example
  11988. *
  11989. * function isGreeting(value) {
  11990. * return /^h(?:i|ello)$/.test(value);
  11991. * }
  11992. *
  11993. * function customizer(objValue, othValue) {
  11994. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11995. * return true;
  11996. * }
  11997. * }
  11998. *
  11999. * var array = ['hello', 'goodbye'];
  12000. * var other = ['hi', 'goodbye'];
  12001. *
  12002. * _.isEqualWith(array, other, customizer);
  12003. * // => true
  12004. */
  12005. function isEqualWith(value, other, customizer) {
  12006. customizer = typeof customizer == 'function' ? customizer : undefined;
  12007. var result = customizer ? customizer(value, other) : undefined;
  12008. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12009. }
  12010. /**
  12011. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12012. * `SyntaxError`, `TypeError`, or `URIError` object.
  12013. *
  12014. * @static
  12015. * @memberOf _
  12016. * @since 3.0.0
  12017. * @category Lang
  12018. * @param {*} value The value to check.
  12019. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12020. * @example
  12021. *
  12022. * _.isError(new Error);
  12023. * // => true
  12024. *
  12025. * _.isError(Error);
  12026. * // => false
  12027. */
  12028. function isError(value) {
  12029. if (!isObjectLike(value)) {
  12030. return false;
  12031. }
  12032. var tag = baseGetTag(value);
  12033. return tag == errorTag || tag == domExcTag ||
  12034. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12035. }
  12036. /**
  12037. * Checks if `value` is a finite primitive number.
  12038. *
  12039. * **Note:** This method is based on
  12040. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12041. *
  12042. * @static
  12043. * @memberOf _
  12044. * @since 0.1.0
  12045. * @category Lang
  12046. * @param {*} value The value to check.
  12047. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12048. * @example
  12049. *
  12050. * _.isFinite(3);
  12051. * // => true
  12052. *
  12053. * _.isFinite(Number.MIN_VALUE);
  12054. * // => true
  12055. *
  12056. * _.isFinite(Infinity);
  12057. * // => false
  12058. *
  12059. * _.isFinite('3');
  12060. * // => false
  12061. */
  12062. function isFinite(value) {
  12063. return typeof value == 'number' && nativeIsFinite(value);
  12064. }
  12065. /**
  12066. * Checks if `value` is classified as a `Function` object.
  12067. *
  12068. * @static
  12069. * @memberOf _
  12070. * @since 0.1.0
  12071. * @category Lang
  12072. * @param {*} value The value to check.
  12073. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12074. * @example
  12075. *
  12076. * _.isFunction(_);
  12077. * // => true
  12078. *
  12079. * _.isFunction(/abc/);
  12080. * // => false
  12081. */
  12082. function isFunction(value) {
  12083. if (!isObject(value)) {
  12084. return false;
  12085. }
  12086. // The use of `Object#toString` avoids issues with the `typeof` operator
  12087. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12088. var tag = baseGetTag(value);
  12089. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12090. }
  12091. /**
  12092. * Checks if `value` is an integer.
  12093. *
  12094. * **Note:** This method is based on
  12095. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12096. *
  12097. * @static
  12098. * @memberOf _
  12099. * @since 4.0.0
  12100. * @category Lang
  12101. * @param {*} value The value to check.
  12102. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12103. * @example
  12104. *
  12105. * _.isInteger(3);
  12106. * // => true
  12107. *
  12108. * _.isInteger(Number.MIN_VALUE);
  12109. * // => false
  12110. *
  12111. * _.isInteger(Infinity);
  12112. * // => false
  12113. *
  12114. * _.isInteger('3');
  12115. * // => false
  12116. */
  12117. function isInteger(value) {
  12118. return typeof value == 'number' && value == toInteger(value);
  12119. }
  12120. /**
  12121. * Checks if `value` is a valid array-like length.
  12122. *
  12123. * **Note:** This method is loosely based on
  12124. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12125. *
  12126. * @static
  12127. * @memberOf _
  12128. * @since 4.0.0
  12129. * @category Lang
  12130. * @param {*} value The value to check.
  12131. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12132. * @example
  12133. *
  12134. * _.isLength(3);
  12135. * // => true
  12136. *
  12137. * _.isLength(Number.MIN_VALUE);
  12138. * // => false
  12139. *
  12140. * _.isLength(Infinity);
  12141. * // => false
  12142. *
  12143. * _.isLength('3');
  12144. * // => false
  12145. */
  12146. function isLength(value) {
  12147. return typeof value == 'number' &&
  12148. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12149. }
  12150. /**
  12151. * Checks if `value` is the
  12152. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12153. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12154. *
  12155. * @static
  12156. * @memberOf _
  12157. * @since 0.1.0
  12158. * @category Lang
  12159. * @param {*} value The value to check.
  12160. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12161. * @example
  12162. *
  12163. * _.isObject({});
  12164. * // => true
  12165. *
  12166. * _.isObject([1, 2, 3]);
  12167. * // => true
  12168. *
  12169. * _.isObject(_.noop);
  12170. * // => true
  12171. *
  12172. * _.isObject(null);
  12173. * // => false
  12174. */
  12175. function isObject(value) {
  12176. var type = typeof value;
  12177. return value != null && (type == 'object' || type == 'function');
  12178. }
  12179. /**
  12180. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12181. * and has a `typeof` result of "object".
  12182. *
  12183. * @static
  12184. * @memberOf _
  12185. * @since 4.0.0
  12186. * @category Lang
  12187. * @param {*} value The value to check.
  12188. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12189. * @example
  12190. *
  12191. * _.isObjectLike({});
  12192. * // => true
  12193. *
  12194. * _.isObjectLike([1, 2, 3]);
  12195. * // => true
  12196. *
  12197. * _.isObjectLike(_.noop);
  12198. * // => false
  12199. *
  12200. * _.isObjectLike(null);
  12201. * // => false
  12202. */
  12203. function isObjectLike(value) {
  12204. return value != null && typeof value == 'object';
  12205. }
  12206. /**
  12207. * Checks if `value` is classified as a `Map` object.
  12208. *
  12209. * @static
  12210. * @memberOf _
  12211. * @since 4.3.0
  12212. * @category Lang
  12213. * @param {*} value The value to check.
  12214. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12215. * @example
  12216. *
  12217. * _.isMap(new Map);
  12218. * // => true
  12219. *
  12220. * _.isMap(new WeakMap);
  12221. * // => false
  12222. */
  12223. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12224. /**
  12225. * Performs a partial deep comparison between `object` and `source` to
  12226. * determine if `object` contains equivalent property values.
  12227. *
  12228. * **Note:** This method is equivalent to `_.matches` when `source` is
  12229. * partially applied.
  12230. *
  12231. * Partial comparisons will match empty array and empty object `source`
  12232. * values against any array or object value, respectively. See `_.isEqual`
  12233. * for a list of supported value comparisons.
  12234. *
  12235. * @static
  12236. * @memberOf _
  12237. * @since 3.0.0
  12238. * @category Lang
  12239. * @param {Object} object The object to inspect.
  12240. * @param {Object} source The object of property values to match.
  12241. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12242. * @example
  12243. *
  12244. * var object = { 'a': 1, 'b': 2 };
  12245. *
  12246. * _.isMatch(object, { 'b': 2 });
  12247. * // => true
  12248. *
  12249. * _.isMatch(object, { 'b': 1 });
  12250. * // => false
  12251. */
  12252. function isMatch(object, source) {
  12253. return object === source || baseIsMatch(object, source, getMatchData(source));
  12254. }
  12255. /**
  12256. * This method is like `_.isMatch` except that it accepts `customizer` which
  12257. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12258. * are handled by the method instead. The `customizer` is invoked with five
  12259. * arguments: (objValue, srcValue, index|key, object, source).
  12260. *
  12261. * @static
  12262. * @memberOf _
  12263. * @since 4.0.0
  12264. * @category Lang
  12265. * @param {Object} object The object to inspect.
  12266. * @param {Object} source The object of property values to match.
  12267. * @param {Function} [customizer] The function to customize comparisons.
  12268. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12269. * @example
  12270. *
  12271. * function isGreeting(value) {
  12272. * return /^h(?:i|ello)$/.test(value);
  12273. * }
  12274. *
  12275. * function customizer(objValue, srcValue) {
  12276. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12277. * return true;
  12278. * }
  12279. * }
  12280. *
  12281. * var object = { 'greeting': 'hello' };
  12282. * var source = { 'greeting': 'hi' };
  12283. *
  12284. * _.isMatchWith(object, source, customizer);
  12285. * // => true
  12286. */
  12287. function isMatchWith(object, source, customizer) {
  12288. customizer = typeof customizer == 'function' ? customizer : undefined;
  12289. return baseIsMatch(object, source, getMatchData(source), customizer);
  12290. }
  12291. /**
  12292. * Checks if `value` is `NaN`.
  12293. *
  12294. * **Note:** This method is based on
  12295. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12296. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12297. * `undefined` and other non-number values.
  12298. *
  12299. * @static
  12300. * @memberOf _
  12301. * @since 0.1.0
  12302. * @category Lang
  12303. * @param {*} value The value to check.
  12304. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12305. * @example
  12306. *
  12307. * _.isNaN(NaN);
  12308. * // => true
  12309. *
  12310. * _.isNaN(new Number(NaN));
  12311. * // => true
  12312. *
  12313. * isNaN(undefined);
  12314. * // => true
  12315. *
  12316. * _.isNaN(undefined);
  12317. * // => false
  12318. */
  12319. function isNaN(value) {
  12320. // An `NaN` primitive is the only value that is not equal to itself.
  12321. // Perform the `toStringTag` check first to avoid errors with some
  12322. // ActiveX objects in IE.
  12323. return isNumber(value) && value != +value;
  12324. }
  12325. /**
  12326. * Checks if `value` is a pristine native function.
  12327. *
  12328. * **Note:** This method can't reliably detect native functions in the presence
  12329. * of the core-js package because core-js circumvents this kind of detection.
  12330. * Despite multiple requests, the core-js maintainer has made it clear: any
  12331. * attempt to fix the detection will be obstructed. As a result, we're left
  12332. * with little choice but to throw an error. Unfortunately, this also affects
  12333. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12334. * which rely on core-js.
  12335. *
  12336. * @static
  12337. * @memberOf _
  12338. * @since 3.0.0
  12339. * @category Lang
  12340. * @param {*} value The value to check.
  12341. * @returns {boolean} Returns `true` if `value` is a native function,
  12342. * else `false`.
  12343. * @example
  12344. *
  12345. * _.isNative(Array.prototype.push);
  12346. * // => true
  12347. *
  12348. * _.isNative(_);
  12349. * // => false
  12350. */
  12351. function isNative(value) {
  12352. if (isMaskable(value)) {
  12353. throw new Error(CORE_ERROR_TEXT);
  12354. }
  12355. return baseIsNative(value);
  12356. }
  12357. /**
  12358. * Checks if `value` is `null`.
  12359. *
  12360. * @static
  12361. * @memberOf _
  12362. * @since 0.1.0
  12363. * @category Lang
  12364. * @param {*} value The value to check.
  12365. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12366. * @example
  12367. *
  12368. * _.isNull(null);
  12369. * // => true
  12370. *
  12371. * _.isNull(void 0);
  12372. * // => false
  12373. */
  12374. function isNull(value) {
  12375. return value === null;
  12376. }
  12377. /**
  12378. * Checks if `value` is `null` or `undefined`.
  12379. *
  12380. * @static
  12381. * @memberOf _
  12382. * @since 4.0.0
  12383. * @category Lang
  12384. * @param {*} value The value to check.
  12385. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12386. * @example
  12387. *
  12388. * _.isNil(null);
  12389. * // => true
  12390. *
  12391. * _.isNil(void 0);
  12392. * // => true
  12393. *
  12394. * _.isNil(NaN);
  12395. * // => false
  12396. */
  12397. function isNil(value) {
  12398. return value == null;
  12399. }
  12400. /**
  12401. * Checks if `value` is classified as a `Number` primitive or object.
  12402. *
  12403. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12404. * classified as numbers, use the `_.isFinite` method.
  12405. *
  12406. * @static
  12407. * @memberOf _
  12408. * @since 0.1.0
  12409. * @category Lang
  12410. * @param {*} value The value to check.
  12411. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12412. * @example
  12413. *
  12414. * _.isNumber(3);
  12415. * // => true
  12416. *
  12417. * _.isNumber(Number.MIN_VALUE);
  12418. * // => true
  12419. *
  12420. * _.isNumber(Infinity);
  12421. * // => true
  12422. *
  12423. * _.isNumber('3');
  12424. * // => false
  12425. */
  12426. function isNumber(value) {
  12427. return typeof value == 'number' ||
  12428. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12429. }
  12430. /**
  12431. * Checks if `value` is a plain object, that is, an object created by the
  12432. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12433. *
  12434. * @static
  12435. * @memberOf _
  12436. * @since 0.8.0
  12437. * @category Lang
  12438. * @param {*} value The value to check.
  12439. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12440. * @example
  12441. *
  12442. * function Foo() {
  12443. * this.a = 1;
  12444. * }
  12445. *
  12446. * _.isPlainObject(new Foo);
  12447. * // => false
  12448. *
  12449. * _.isPlainObject([1, 2, 3]);
  12450. * // => false
  12451. *
  12452. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12453. * // => true
  12454. *
  12455. * _.isPlainObject(Object.create(null));
  12456. * // => true
  12457. */
  12458. function isPlainObject(value) {
  12459. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12460. return false;
  12461. }
  12462. var proto = getPrototype(value);
  12463. if (proto === null) {
  12464. return true;
  12465. }
  12466. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12467. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12468. funcToString.call(Ctor) == objectCtorString;
  12469. }
  12470. /**
  12471. * Checks if `value` is classified as a `RegExp` object.
  12472. *
  12473. * @static
  12474. * @memberOf _
  12475. * @since 0.1.0
  12476. * @category Lang
  12477. * @param {*} value The value to check.
  12478. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12479. * @example
  12480. *
  12481. * _.isRegExp(/abc/);
  12482. * // => true
  12483. *
  12484. * _.isRegExp('/abc/');
  12485. * // => false
  12486. */
  12487. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12488. /**
  12489. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12490. * double precision number which isn't the result of a rounded unsafe integer.
  12491. *
  12492. * **Note:** This method is based on
  12493. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12494. *
  12495. * @static
  12496. * @memberOf _
  12497. * @since 4.0.0
  12498. * @category Lang
  12499. * @param {*} value The value to check.
  12500. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12501. * @example
  12502. *
  12503. * _.isSafeInteger(3);
  12504. * // => true
  12505. *
  12506. * _.isSafeInteger(Number.MIN_VALUE);
  12507. * // => false
  12508. *
  12509. * _.isSafeInteger(Infinity);
  12510. * // => false
  12511. *
  12512. * _.isSafeInteger('3');
  12513. * // => false
  12514. */
  12515. function isSafeInteger(value) {
  12516. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12517. }
  12518. /**
  12519. * Checks if `value` is classified as a `Set` object.
  12520. *
  12521. * @static
  12522. * @memberOf _
  12523. * @since 4.3.0
  12524. * @category Lang
  12525. * @param {*} value The value to check.
  12526. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12527. * @example
  12528. *
  12529. * _.isSet(new Set);
  12530. * // => true
  12531. *
  12532. * _.isSet(new WeakSet);
  12533. * // => false
  12534. */
  12535. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12536. /**
  12537. * Checks if `value` is classified as a `String` primitive or object.
  12538. *
  12539. * @static
  12540. * @since 0.1.0
  12541. * @memberOf _
  12542. * @category Lang
  12543. * @param {*} value The value to check.
  12544. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12545. * @example
  12546. *
  12547. * _.isString('abc');
  12548. * // => true
  12549. *
  12550. * _.isString(1);
  12551. * // => false
  12552. */
  12553. function isString(value) {
  12554. return typeof value == 'string' ||
  12555. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12556. }
  12557. /**
  12558. * Checks if `value` is classified as a `Symbol` primitive or object.
  12559. *
  12560. * @static
  12561. * @memberOf _
  12562. * @since 4.0.0
  12563. * @category Lang
  12564. * @param {*} value The value to check.
  12565. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12566. * @example
  12567. *
  12568. * _.isSymbol(Symbol.iterator);
  12569. * // => true
  12570. *
  12571. * _.isSymbol('abc');
  12572. * // => false
  12573. */
  12574. function isSymbol(value) {
  12575. return typeof value == 'symbol' ||
  12576. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12577. }
  12578. /**
  12579. * Checks if `value` is classified as a typed array.
  12580. *
  12581. * @static
  12582. * @memberOf _
  12583. * @since 3.0.0
  12584. * @category Lang
  12585. * @param {*} value The value to check.
  12586. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12587. * @example
  12588. *
  12589. * _.isTypedArray(new Uint8Array);
  12590. * // => true
  12591. *
  12592. * _.isTypedArray([]);
  12593. * // => false
  12594. */
  12595. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12596. /**
  12597. * Checks if `value` is `undefined`.
  12598. *
  12599. * @static
  12600. * @since 0.1.0
  12601. * @memberOf _
  12602. * @category Lang
  12603. * @param {*} value The value to check.
  12604. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12605. * @example
  12606. *
  12607. * _.isUndefined(void 0);
  12608. * // => true
  12609. *
  12610. * _.isUndefined(null);
  12611. * // => false
  12612. */
  12613. function isUndefined(value) {
  12614. return value === undefined;
  12615. }
  12616. /**
  12617. * Checks if `value` is classified as a `WeakMap` object.
  12618. *
  12619. * @static
  12620. * @memberOf _
  12621. * @since 4.3.0
  12622. * @category Lang
  12623. * @param {*} value The value to check.
  12624. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12625. * @example
  12626. *
  12627. * _.isWeakMap(new WeakMap);
  12628. * // => true
  12629. *
  12630. * _.isWeakMap(new Map);
  12631. * // => false
  12632. */
  12633. function isWeakMap(value) {
  12634. return isObjectLike(value) && getTag(value) == weakMapTag;
  12635. }
  12636. /**
  12637. * Checks if `value` is classified as a `WeakSet` object.
  12638. *
  12639. * @static
  12640. * @memberOf _
  12641. * @since 4.3.0
  12642. * @category Lang
  12643. * @param {*} value The value to check.
  12644. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12645. * @example
  12646. *
  12647. * _.isWeakSet(new WeakSet);
  12648. * // => true
  12649. *
  12650. * _.isWeakSet(new Set);
  12651. * // => false
  12652. */
  12653. function isWeakSet(value) {
  12654. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12655. }
  12656. /**
  12657. * Checks if `value` is less than `other`.
  12658. *
  12659. * @static
  12660. * @memberOf _
  12661. * @since 3.9.0
  12662. * @category Lang
  12663. * @param {*} value The value to compare.
  12664. * @param {*} other The other value to compare.
  12665. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12666. * else `false`.
  12667. * @see _.gt
  12668. * @example
  12669. *
  12670. * _.lt(1, 3);
  12671. * // => true
  12672. *
  12673. * _.lt(3, 3);
  12674. * // => false
  12675. *
  12676. * _.lt(3, 1);
  12677. * // => false
  12678. */
  12679. var lt = createRelationalOperation(baseLt);
  12680. /**
  12681. * Checks if `value` is less than or equal to `other`.
  12682. *
  12683. * @static
  12684. * @memberOf _
  12685. * @since 3.9.0
  12686. * @category Lang
  12687. * @param {*} value The value to compare.
  12688. * @param {*} other The other value to compare.
  12689. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12690. * `other`, else `false`.
  12691. * @see _.gte
  12692. * @example
  12693. *
  12694. * _.lte(1, 3);
  12695. * // => true
  12696. *
  12697. * _.lte(3, 3);
  12698. * // => true
  12699. *
  12700. * _.lte(3, 1);
  12701. * // => false
  12702. */
  12703. var lte = createRelationalOperation(function(value, other) {
  12704. return value <= other;
  12705. });
  12706. /**
  12707. * Converts `value` to an array.
  12708. *
  12709. * @static
  12710. * @since 0.1.0
  12711. * @memberOf _
  12712. * @category Lang
  12713. * @param {*} value The value to convert.
  12714. * @returns {Array} Returns the converted array.
  12715. * @example
  12716. *
  12717. * _.toArray({ 'a': 1, 'b': 2 });
  12718. * // => [1, 2]
  12719. *
  12720. * _.toArray('abc');
  12721. * // => ['a', 'b', 'c']
  12722. *
  12723. * _.toArray(1);
  12724. * // => []
  12725. *
  12726. * _.toArray(null);
  12727. * // => []
  12728. */
  12729. function toArray(value) {
  12730. if (!value) {
  12731. return [];
  12732. }
  12733. if (isArrayLike(value)) {
  12734. return isString(value) ? stringToArray(value) : copyArray(value);
  12735. }
  12736. if (symIterator && value[symIterator]) {
  12737. return iteratorToArray(value[symIterator]());
  12738. }
  12739. var tag = getTag(value),
  12740. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12741. return func(value);
  12742. }
  12743. /**
  12744. * Converts `value` to a finite number.
  12745. *
  12746. * @static
  12747. * @memberOf _
  12748. * @since 4.12.0
  12749. * @category Lang
  12750. * @param {*} value The value to convert.
  12751. * @returns {number} Returns the converted number.
  12752. * @example
  12753. *
  12754. * _.toFinite(3.2);
  12755. * // => 3.2
  12756. *
  12757. * _.toFinite(Number.MIN_VALUE);
  12758. * // => 5e-324
  12759. *
  12760. * _.toFinite(Infinity);
  12761. * // => 1.7976931348623157e+308
  12762. *
  12763. * _.toFinite('3.2');
  12764. * // => 3.2
  12765. */
  12766. function toFinite(value) {
  12767. if (!value) {
  12768. return value === 0 ? value : 0;
  12769. }
  12770. value = toNumber(value);
  12771. if (value === INFINITY || value === -INFINITY) {
  12772. var sign = (value < 0 ? -1 : 1);
  12773. return sign * MAX_INTEGER;
  12774. }
  12775. return value === value ? value : 0;
  12776. }
  12777. /**
  12778. * Converts `value` to an integer.
  12779. *
  12780. * **Note:** This method is loosely based on
  12781. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12782. *
  12783. * @static
  12784. * @memberOf _
  12785. * @since 4.0.0
  12786. * @category Lang
  12787. * @param {*} value The value to convert.
  12788. * @returns {number} Returns the converted integer.
  12789. * @example
  12790. *
  12791. * _.toInteger(3.2);
  12792. * // => 3
  12793. *
  12794. * _.toInteger(Number.MIN_VALUE);
  12795. * // => 0
  12796. *
  12797. * _.toInteger(Infinity);
  12798. * // => 1.7976931348623157e+308
  12799. *
  12800. * _.toInteger('3.2');
  12801. * // => 3
  12802. */
  12803. function toInteger(value) {
  12804. var result = toFinite(value),
  12805. remainder = result % 1;
  12806. return result === result ? (remainder ? result - remainder : result) : 0;
  12807. }
  12808. /**
  12809. * Converts `value` to an integer suitable for use as the length of an
  12810. * array-like object.
  12811. *
  12812. * **Note:** This method is based on
  12813. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12814. *
  12815. * @static
  12816. * @memberOf _
  12817. * @since 4.0.0
  12818. * @category Lang
  12819. * @param {*} value The value to convert.
  12820. * @returns {number} Returns the converted integer.
  12821. * @example
  12822. *
  12823. * _.toLength(3.2);
  12824. * // => 3
  12825. *
  12826. * _.toLength(Number.MIN_VALUE);
  12827. * // => 0
  12828. *
  12829. * _.toLength(Infinity);
  12830. * // => 4294967295
  12831. *
  12832. * _.toLength('3.2');
  12833. * // => 3
  12834. */
  12835. function toLength(value) {
  12836. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12837. }
  12838. /**
  12839. * Converts `value` to a number.
  12840. *
  12841. * @static
  12842. * @memberOf _
  12843. * @since 4.0.0
  12844. * @category Lang
  12845. * @param {*} value The value to process.
  12846. * @returns {number} Returns the number.
  12847. * @example
  12848. *
  12849. * _.toNumber(3.2);
  12850. * // => 3.2
  12851. *
  12852. * _.toNumber(Number.MIN_VALUE);
  12853. * // => 5e-324
  12854. *
  12855. * _.toNumber(Infinity);
  12856. * // => Infinity
  12857. *
  12858. * _.toNumber('3.2');
  12859. * // => 3.2
  12860. */
  12861. function toNumber(value) {
  12862. if (typeof value == 'number') {
  12863. return value;
  12864. }
  12865. if (isSymbol(value)) {
  12866. return NAN;
  12867. }
  12868. if (isObject(value)) {
  12869. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12870. value = isObject(other) ? (other + '') : other;
  12871. }
  12872. if (typeof value != 'string') {
  12873. return value === 0 ? value : +value;
  12874. }
  12875. value = baseTrim(value);
  12876. var isBinary = reIsBinary.test(value);
  12877. return (isBinary || reIsOctal.test(value))
  12878. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12879. : (reIsBadHex.test(value) ? NAN : +value);
  12880. }
  12881. /**
  12882. * Converts `value` to a plain object flattening inherited enumerable string
  12883. * keyed properties of `value` to own properties of the plain object.
  12884. *
  12885. * @static
  12886. * @memberOf _
  12887. * @since 3.0.0
  12888. * @category Lang
  12889. * @param {*} value The value to convert.
  12890. * @returns {Object} Returns the converted plain object.
  12891. * @example
  12892. *
  12893. * function Foo() {
  12894. * this.b = 2;
  12895. * }
  12896. *
  12897. * Foo.prototype.c = 3;
  12898. *
  12899. * _.assign({ 'a': 1 }, new Foo);
  12900. * // => { 'a': 1, 'b': 2 }
  12901. *
  12902. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12903. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12904. */
  12905. function toPlainObject(value) {
  12906. return copyObject(value, keysIn(value));
  12907. }
  12908. /**
  12909. * Converts `value` to a safe integer. A safe integer can be compared and
  12910. * represented correctly.
  12911. *
  12912. * @static
  12913. * @memberOf _
  12914. * @since 4.0.0
  12915. * @category Lang
  12916. * @param {*} value The value to convert.
  12917. * @returns {number} Returns the converted integer.
  12918. * @example
  12919. *
  12920. * _.toSafeInteger(3.2);
  12921. * // => 3
  12922. *
  12923. * _.toSafeInteger(Number.MIN_VALUE);
  12924. * // => 0
  12925. *
  12926. * _.toSafeInteger(Infinity);
  12927. * // => 9007199254740991
  12928. *
  12929. * _.toSafeInteger('3.2');
  12930. * // => 3
  12931. */
  12932. function toSafeInteger(value) {
  12933. return value
  12934. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12935. : (value === 0 ? value : 0);
  12936. }
  12937. /**
  12938. * Converts `value` to a string. An empty string is returned for `null`
  12939. * and `undefined` values. The sign of `-0` is preserved.
  12940. *
  12941. * @static
  12942. * @memberOf _
  12943. * @since 4.0.0
  12944. * @category Lang
  12945. * @param {*} value The value to convert.
  12946. * @returns {string} Returns the converted string.
  12947. * @example
  12948. *
  12949. * _.toString(null);
  12950. * // => ''
  12951. *
  12952. * _.toString(-0);
  12953. * // => '-0'
  12954. *
  12955. * _.toString([1, 2, 3]);
  12956. * // => '1,2,3'
  12957. */
  12958. function toString(value) {
  12959. return value == null ? '' : baseToString(value);
  12960. }
  12961. /*------------------------------------------------------------------------*/
  12962. /**
  12963. * Assigns own enumerable string keyed properties of source objects to the
  12964. * destination object. Source objects are applied from left to right.
  12965. * Subsequent sources overwrite property assignments of previous sources.
  12966. *
  12967. * **Note:** This method mutates `object` and is loosely based on
  12968. * [`Object.assign`](https://mdn.io/Object/assign).
  12969. *
  12970. * @static
  12971. * @memberOf _
  12972. * @since 0.10.0
  12973. * @category Object
  12974. * @param {Object} object The destination object.
  12975. * @param {...Object} [sources] The source objects.
  12976. * @returns {Object} Returns `object`.
  12977. * @see _.assignIn
  12978. * @example
  12979. *
  12980. * function Foo() {
  12981. * this.a = 1;
  12982. * }
  12983. *
  12984. * function Bar() {
  12985. * this.c = 3;
  12986. * }
  12987. *
  12988. * Foo.prototype.b = 2;
  12989. * Bar.prototype.d = 4;
  12990. *
  12991. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12992. * // => { 'a': 1, 'c': 3 }
  12993. */
  12994. var assign = createAssigner(function(object, source) {
  12995. if (isPrototype(source) || isArrayLike(source)) {
  12996. copyObject(source, keys(source), object);
  12997. return;
  12998. }
  12999. for (var key in source) {
  13000. if (hasOwnProperty.call(source, key)) {
  13001. assignValue(object, key, source[key]);
  13002. }
  13003. }
  13004. });
  13005. /**
  13006. * This method is like `_.assign` except that it iterates over own and
  13007. * inherited source properties.
  13008. *
  13009. * **Note:** This method mutates `object`.
  13010. *
  13011. * @static
  13012. * @memberOf _
  13013. * @since 4.0.0
  13014. * @alias extend
  13015. * @category Object
  13016. * @param {Object} object The destination object.
  13017. * @param {...Object} [sources] The source objects.
  13018. * @returns {Object} Returns `object`.
  13019. * @see _.assign
  13020. * @example
  13021. *
  13022. * function Foo() {
  13023. * this.a = 1;
  13024. * }
  13025. *
  13026. * function Bar() {
  13027. * this.c = 3;
  13028. * }
  13029. *
  13030. * Foo.prototype.b = 2;
  13031. * Bar.prototype.d = 4;
  13032. *
  13033. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13034. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13035. */
  13036. var assignIn = createAssigner(function(object, source) {
  13037. copyObject(source, keysIn(source), object);
  13038. });
  13039. /**
  13040. * This method is like `_.assignIn` except that it accepts `customizer`
  13041. * which is invoked to produce the assigned values. If `customizer` returns
  13042. * `undefined`, assignment is handled by the method instead. The `customizer`
  13043. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13044. *
  13045. * **Note:** This method mutates `object`.
  13046. *
  13047. * @static
  13048. * @memberOf _
  13049. * @since 4.0.0
  13050. * @alias extendWith
  13051. * @category Object
  13052. * @param {Object} object The destination object.
  13053. * @param {...Object} sources The source objects.
  13054. * @param {Function} [customizer] The function to customize assigned values.
  13055. * @returns {Object} Returns `object`.
  13056. * @see _.assignWith
  13057. * @example
  13058. *
  13059. * function customizer(objValue, srcValue) {
  13060. * return _.isUndefined(objValue) ? srcValue : objValue;
  13061. * }
  13062. *
  13063. * var defaults = _.partialRight(_.assignInWith, customizer);
  13064. *
  13065. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13066. * // => { 'a': 1, 'b': 2 }
  13067. */
  13068. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13069. copyObject(source, keysIn(source), object, customizer);
  13070. });
  13071. /**
  13072. * This method is like `_.assign` except that it accepts `customizer`
  13073. * which is invoked to produce the assigned values. If `customizer` returns
  13074. * `undefined`, assignment is handled by the method instead. The `customizer`
  13075. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13076. *
  13077. * **Note:** This method mutates `object`.
  13078. *
  13079. * @static
  13080. * @memberOf _
  13081. * @since 4.0.0
  13082. * @category Object
  13083. * @param {Object} object The destination object.
  13084. * @param {...Object} sources The source objects.
  13085. * @param {Function} [customizer] The function to customize assigned values.
  13086. * @returns {Object} Returns `object`.
  13087. * @see _.assignInWith
  13088. * @example
  13089. *
  13090. * function customizer(objValue, srcValue) {
  13091. * return _.isUndefined(objValue) ? srcValue : objValue;
  13092. * }
  13093. *
  13094. * var defaults = _.partialRight(_.assignWith, customizer);
  13095. *
  13096. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13097. * // => { 'a': 1, 'b': 2 }
  13098. */
  13099. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13100. copyObject(source, keys(source), object, customizer);
  13101. });
  13102. /**
  13103. * Creates an array of values corresponding to `paths` of `object`.
  13104. *
  13105. * @static
  13106. * @memberOf _
  13107. * @since 1.0.0
  13108. * @category Object
  13109. * @param {Object} object The object to iterate over.
  13110. * @param {...(string|string[])} [paths] The property paths to pick.
  13111. * @returns {Array} Returns the picked values.
  13112. * @example
  13113. *
  13114. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13115. *
  13116. * _.at(object, ['a[0].b.c', 'a[1]']);
  13117. * // => [3, 4]
  13118. */
  13119. var at = flatRest(baseAt);
  13120. /**
  13121. * Creates an object that inherits from the `prototype` object. If a
  13122. * `properties` object is given, its own enumerable string keyed properties
  13123. * are assigned to the created object.
  13124. *
  13125. * @static
  13126. * @memberOf _
  13127. * @since 2.3.0
  13128. * @category Object
  13129. * @param {Object} prototype The object to inherit from.
  13130. * @param {Object} [properties] The properties to assign to the object.
  13131. * @returns {Object} Returns the new object.
  13132. * @example
  13133. *
  13134. * function Shape() {
  13135. * this.x = 0;
  13136. * this.y = 0;
  13137. * }
  13138. *
  13139. * function Circle() {
  13140. * Shape.call(this);
  13141. * }
  13142. *
  13143. * Circle.prototype = _.create(Shape.prototype, {
  13144. * 'constructor': Circle
  13145. * });
  13146. *
  13147. * var circle = new Circle;
  13148. * circle instanceof Circle;
  13149. * // => true
  13150. *
  13151. * circle instanceof Shape;
  13152. * // => true
  13153. */
  13154. function create(prototype, properties) {
  13155. var result = baseCreate(prototype);
  13156. return properties == null ? result : baseAssign(result, properties);
  13157. }
  13158. /**
  13159. * Assigns own and inherited enumerable string keyed properties of source
  13160. * objects to the destination object for all destination properties that
  13161. * resolve to `undefined`. Source objects are applied from left to right.
  13162. * Once a property is set, additional values of the same property are ignored.
  13163. *
  13164. * **Note:** This method mutates `object`.
  13165. *
  13166. * @static
  13167. * @since 0.1.0
  13168. * @memberOf _
  13169. * @category Object
  13170. * @param {Object} object The destination object.
  13171. * @param {...Object} [sources] The source objects.
  13172. * @returns {Object} Returns `object`.
  13173. * @see _.defaultsDeep
  13174. * @example
  13175. *
  13176. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13177. * // => { 'a': 1, 'b': 2 }
  13178. */
  13179. var defaults = baseRest(function(object, sources) {
  13180. object = Object(object);
  13181. var index = -1;
  13182. var length = sources.length;
  13183. var guard = length > 2 ? sources[2] : undefined;
  13184. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13185. length = 1;
  13186. }
  13187. while (++index < length) {
  13188. var source = sources[index];
  13189. var props = keysIn(source);
  13190. var propsIndex = -1;
  13191. var propsLength = props.length;
  13192. while (++propsIndex < propsLength) {
  13193. var key = props[propsIndex];
  13194. var value = object[key];
  13195. if (value === undefined ||
  13196. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13197. object[key] = source[key];
  13198. }
  13199. }
  13200. }
  13201. return object;
  13202. });
  13203. /**
  13204. * This method is like `_.defaults` except that it recursively assigns
  13205. * default properties.
  13206. *
  13207. * **Note:** This method mutates `object`.
  13208. *
  13209. * @static
  13210. * @memberOf _
  13211. * @since 3.10.0
  13212. * @category Object
  13213. * @param {Object} object The destination object.
  13214. * @param {...Object} [sources] The source objects.
  13215. * @returns {Object} Returns `object`.
  13216. * @see _.defaults
  13217. * @example
  13218. *
  13219. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13220. * // => { 'a': { 'b': 2, 'c': 3 } }
  13221. */
  13222. var defaultsDeep = baseRest(function(args) {
  13223. args.push(undefined, customDefaultsMerge);
  13224. return apply(mergeWith, undefined, args);
  13225. });
  13226. /**
  13227. * This method is like `_.find` except that it returns the key of the first
  13228. * element `predicate` returns truthy for instead of the element itself.
  13229. *
  13230. * @static
  13231. * @memberOf _
  13232. * @since 1.1.0
  13233. * @category Object
  13234. * @param {Object} object The object to inspect.
  13235. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13236. * @returns {string|undefined} Returns the key of the matched element,
  13237. * else `undefined`.
  13238. * @example
  13239. *
  13240. * var users = {
  13241. * 'barney': { 'age': 36, 'active': true },
  13242. * 'fred': { 'age': 40, 'active': false },
  13243. * 'pebbles': { 'age': 1, 'active': true }
  13244. * };
  13245. *
  13246. * _.findKey(users, function(o) { return o.age < 40; });
  13247. * // => 'barney' (iteration order is not guaranteed)
  13248. *
  13249. * // The `_.matches` iteratee shorthand.
  13250. * _.findKey(users, { 'age': 1, 'active': true });
  13251. * // => 'pebbles'
  13252. *
  13253. * // The `_.matchesProperty` iteratee shorthand.
  13254. * _.findKey(users, ['active', false]);
  13255. * // => 'fred'
  13256. *
  13257. * // The `_.property` iteratee shorthand.
  13258. * _.findKey(users, 'active');
  13259. * // => 'barney'
  13260. */
  13261. function findKey(object, predicate) {
  13262. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13263. }
  13264. /**
  13265. * This method is like `_.findKey` except that it iterates over elements of
  13266. * a collection in the opposite order.
  13267. *
  13268. * @static
  13269. * @memberOf _
  13270. * @since 2.0.0
  13271. * @category Object
  13272. * @param {Object} object The object to inspect.
  13273. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13274. * @returns {string|undefined} Returns the key of the matched element,
  13275. * else `undefined`.
  13276. * @example
  13277. *
  13278. * var users = {
  13279. * 'barney': { 'age': 36, 'active': true },
  13280. * 'fred': { 'age': 40, 'active': false },
  13281. * 'pebbles': { 'age': 1, 'active': true }
  13282. * };
  13283. *
  13284. * _.findLastKey(users, function(o) { return o.age < 40; });
  13285. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13286. *
  13287. * // The `_.matches` iteratee shorthand.
  13288. * _.findLastKey(users, { 'age': 36, 'active': true });
  13289. * // => 'barney'
  13290. *
  13291. * // The `_.matchesProperty` iteratee shorthand.
  13292. * _.findLastKey(users, ['active', false]);
  13293. * // => 'fred'
  13294. *
  13295. * // The `_.property` iteratee shorthand.
  13296. * _.findLastKey(users, 'active');
  13297. * // => 'pebbles'
  13298. */
  13299. function findLastKey(object, predicate) {
  13300. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13301. }
  13302. /**
  13303. * Iterates over own and inherited enumerable string keyed properties of an
  13304. * object and invokes `iteratee` for each property. The iteratee is invoked
  13305. * with three arguments: (value, key, object). Iteratee functions may exit
  13306. * iteration early by explicitly returning `false`.
  13307. *
  13308. * @static
  13309. * @memberOf _
  13310. * @since 0.3.0
  13311. * @category Object
  13312. * @param {Object} object The object to iterate over.
  13313. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13314. * @returns {Object} Returns `object`.
  13315. * @see _.forInRight
  13316. * @example
  13317. *
  13318. * function Foo() {
  13319. * this.a = 1;
  13320. * this.b = 2;
  13321. * }
  13322. *
  13323. * Foo.prototype.c = 3;
  13324. *
  13325. * _.forIn(new Foo, function(value, key) {
  13326. * console.log(key);
  13327. * });
  13328. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13329. */
  13330. function forIn(object, iteratee) {
  13331. return object == null
  13332. ? object
  13333. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13334. }
  13335. /**
  13336. * This method is like `_.forIn` except that it iterates over properties of
  13337. * `object` in the opposite order.
  13338. *
  13339. * @static
  13340. * @memberOf _
  13341. * @since 2.0.0
  13342. * @category Object
  13343. * @param {Object} object The object to iterate over.
  13344. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13345. * @returns {Object} Returns `object`.
  13346. * @see _.forIn
  13347. * @example
  13348. *
  13349. * function Foo() {
  13350. * this.a = 1;
  13351. * this.b = 2;
  13352. * }
  13353. *
  13354. * Foo.prototype.c = 3;
  13355. *
  13356. * _.forInRight(new Foo, function(value, key) {
  13357. * console.log(key);
  13358. * });
  13359. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13360. */
  13361. function forInRight(object, iteratee) {
  13362. return object == null
  13363. ? object
  13364. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13365. }
  13366. /**
  13367. * Iterates over own enumerable string keyed properties of an object and
  13368. * invokes `iteratee` for each property. The iteratee is invoked with three
  13369. * arguments: (value, key, object). Iteratee functions may exit iteration
  13370. * early by explicitly returning `false`.
  13371. *
  13372. * @static
  13373. * @memberOf _
  13374. * @since 0.3.0
  13375. * @category Object
  13376. * @param {Object} object The object to iterate over.
  13377. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13378. * @returns {Object} Returns `object`.
  13379. * @see _.forOwnRight
  13380. * @example
  13381. *
  13382. * function Foo() {
  13383. * this.a = 1;
  13384. * this.b = 2;
  13385. * }
  13386. *
  13387. * Foo.prototype.c = 3;
  13388. *
  13389. * _.forOwn(new Foo, function(value, key) {
  13390. * console.log(key);
  13391. * });
  13392. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13393. */
  13394. function forOwn(object, iteratee) {
  13395. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13396. }
  13397. /**
  13398. * This method is like `_.forOwn` except that it iterates over properties of
  13399. * `object` in the opposite order.
  13400. *
  13401. * @static
  13402. * @memberOf _
  13403. * @since 2.0.0
  13404. * @category Object
  13405. * @param {Object} object The object to iterate over.
  13406. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13407. * @returns {Object} Returns `object`.
  13408. * @see _.forOwn
  13409. * @example
  13410. *
  13411. * function Foo() {
  13412. * this.a = 1;
  13413. * this.b = 2;
  13414. * }
  13415. *
  13416. * Foo.prototype.c = 3;
  13417. *
  13418. * _.forOwnRight(new Foo, function(value, key) {
  13419. * console.log(key);
  13420. * });
  13421. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13422. */
  13423. function forOwnRight(object, iteratee) {
  13424. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13425. }
  13426. /**
  13427. * Creates an array of function property names from own enumerable properties
  13428. * of `object`.
  13429. *
  13430. * @static
  13431. * @since 0.1.0
  13432. * @memberOf _
  13433. * @category Object
  13434. * @param {Object} object The object to inspect.
  13435. * @returns {Array} Returns the function names.
  13436. * @see _.functionsIn
  13437. * @example
  13438. *
  13439. * function Foo() {
  13440. * this.a = _.constant('a');
  13441. * this.b = _.constant('b');
  13442. * }
  13443. *
  13444. * Foo.prototype.c = _.constant('c');
  13445. *
  13446. * _.functions(new Foo);
  13447. * // => ['a', 'b']
  13448. */
  13449. function functions(object) {
  13450. return object == null ? [] : baseFunctions(object, keys(object));
  13451. }
  13452. /**
  13453. * Creates an array of function property names from own and inherited
  13454. * enumerable properties of `object`.
  13455. *
  13456. * @static
  13457. * @memberOf _
  13458. * @since 4.0.0
  13459. * @category Object
  13460. * @param {Object} object The object to inspect.
  13461. * @returns {Array} Returns the function names.
  13462. * @see _.functions
  13463. * @example
  13464. *
  13465. * function Foo() {
  13466. * this.a = _.constant('a');
  13467. * this.b = _.constant('b');
  13468. * }
  13469. *
  13470. * Foo.prototype.c = _.constant('c');
  13471. *
  13472. * _.functionsIn(new Foo);
  13473. * // => ['a', 'b', 'c']
  13474. */
  13475. function functionsIn(object) {
  13476. return object == null ? [] : baseFunctions(object, keysIn(object));
  13477. }
  13478. /**
  13479. * Gets the value at `path` of `object`. If the resolved value is
  13480. * `undefined`, the `defaultValue` is returned in its place.
  13481. *
  13482. * @static
  13483. * @memberOf _
  13484. * @since 3.7.0
  13485. * @category Object
  13486. * @param {Object} object The object to query.
  13487. * @param {Array|string} path The path of the property to get.
  13488. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13489. * @returns {*} Returns the resolved value.
  13490. * @example
  13491. *
  13492. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13493. *
  13494. * _.get(object, 'a[0].b.c');
  13495. * // => 3
  13496. *
  13497. * _.get(object, ['a', '0', 'b', 'c']);
  13498. * // => 3
  13499. *
  13500. * _.get(object, 'a.b.c', 'default');
  13501. * // => 'default'
  13502. */
  13503. function get(object, path, defaultValue) {
  13504. var result = object == null ? undefined : baseGet(object, path);
  13505. return result === undefined ? defaultValue : result;
  13506. }
  13507. /**
  13508. * Checks if `path` is a direct property of `object`.
  13509. *
  13510. * @static
  13511. * @since 0.1.0
  13512. * @memberOf _
  13513. * @category Object
  13514. * @param {Object} object The object to query.
  13515. * @param {Array|string} path The path to check.
  13516. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13517. * @example
  13518. *
  13519. * var object = { 'a': { 'b': 2 } };
  13520. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13521. *
  13522. * _.has(object, 'a');
  13523. * // => true
  13524. *
  13525. * _.has(object, 'a.b');
  13526. * // => true
  13527. *
  13528. * _.has(object, ['a', 'b']);
  13529. * // => true
  13530. *
  13531. * _.has(other, 'a');
  13532. * // => false
  13533. */
  13534. function has(object, path) {
  13535. return object != null && hasPath(object, path, baseHas);
  13536. }
  13537. /**
  13538. * Checks if `path` is a direct or inherited property of `object`.
  13539. *
  13540. * @static
  13541. * @memberOf _
  13542. * @since 4.0.0
  13543. * @category Object
  13544. * @param {Object} object The object to query.
  13545. * @param {Array|string} path The path to check.
  13546. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13547. * @example
  13548. *
  13549. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13550. *
  13551. * _.hasIn(object, 'a');
  13552. * // => true
  13553. *
  13554. * _.hasIn(object, 'a.b');
  13555. * // => true
  13556. *
  13557. * _.hasIn(object, ['a', 'b']);
  13558. * // => true
  13559. *
  13560. * _.hasIn(object, 'b');
  13561. * // => false
  13562. */
  13563. function hasIn(object, path) {
  13564. return object != null && hasPath(object, path, baseHasIn);
  13565. }
  13566. /**
  13567. * Creates an object composed of the inverted keys and values of `object`.
  13568. * If `object` contains duplicate values, subsequent values overwrite
  13569. * property assignments of previous values.
  13570. *
  13571. * @static
  13572. * @memberOf _
  13573. * @since 0.7.0
  13574. * @category Object
  13575. * @param {Object} object The object to invert.
  13576. * @returns {Object} Returns the new inverted object.
  13577. * @example
  13578. *
  13579. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13580. *
  13581. * _.invert(object);
  13582. * // => { '1': 'c', '2': 'b' }
  13583. */
  13584. var invert = createInverter(function(result, value, key) {
  13585. if (value != null &&
  13586. typeof value.toString != 'function') {
  13587. value = nativeObjectToString.call(value);
  13588. }
  13589. result[value] = key;
  13590. }, constant(identity));
  13591. /**
  13592. * This method is like `_.invert` except that the inverted object is generated
  13593. * from the results of running each element of `object` thru `iteratee`. The
  13594. * corresponding inverted value of each inverted key is an array of keys
  13595. * responsible for generating the inverted value. The iteratee is invoked
  13596. * with one argument: (value).
  13597. *
  13598. * @static
  13599. * @memberOf _
  13600. * @since 4.1.0
  13601. * @category Object
  13602. * @param {Object} object The object to invert.
  13603. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13604. * @returns {Object} Returns the new inverted object.
  13605. * @example
  13606. *
  13607. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13608. *
  13609. * _.invertBy(object);
  13610. * // => { '1': ['a', 'c'], '2': ['b'] }
  13611. *
  13612. * _.invertBy(object, function(value) {
  13613. * return 'group' + value;
  13614. * });
  13615. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13616. */
  13617. var invertBy = createInverter(function(result, value, key) {
  13618. if (value != null &&
  13619. typeof value.toString != 'function') {
  13620. value = nativeObjectToString.call(value);
  13621. }
  13622. if (hasOwnProperty.call(result, value)) {
  13623. result[value].push(key);
  13624. } else {
  13625. result[value] = [key];
  13626. }
  13627. }, getIteratee);
  13628. /**
  13629. * Invokes the method at `path` of `object`.
  13630. *
  13631. * @static
  13632. * @memberOf _
  13633. * @since 4.0.0
  13634. * @category Object
  13635. * @param {Object} object The object to query.
  13636. * @param {Array|string} path The path of the method to invoke.
  13637. * @param {...*} [args] The arguments to invoke the method with.
  13638. * @returns {*} Returns the result of the invoked method.
  13639. * @example
  13640. *
  13641. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13642. *
  13643. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13644. * // => [2, 3]
  13645. */
  13646. var invoke = baseRest(baseInvoke);
  13647. /**
  13648. * Creates an array of the own enumerable property names of `object`.
  13649. *
  13650. * **Note:** Non-object values are coerced to objects. See the
  13651. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13652. * for more details.
  13653. *
  13654. * @static
  13655. * @since 0.1.0
  13656. * @memberOf _
  13657. * @category Object
  13658. * @param {Object} object The object to query.
  13659. * @returns {Array} Returns the array of property names.
  13660. * @example
  13661. *
  13662. * function Foo() {
  13663. * this.a = 1;
  13664. * this.b = 2;
  13665. * }
  13666. *
  13667. * Foo.prototype.c = 3;
  13668. *
  13669. * _.keys(new Foo);
  13670. * // => ['a', 'b'] (iteration order is not guaranteed)
  13671. *
  13672. * _.keys('hi');
  13673. * // => ['0', '1']
  13674. */
  13675. function keys(object) {
  13676. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13677. }
  13678. /**
  13679. * Creates an array of the own and inherited enumerable property names of `object`.
  13680. *
  13681. * **Note:** Non-object values are coerced to objects.
  13682. *
  13683. * @static
  13684. * @memberOf _
  13685. * @since 3.0.0
  13686. * @category Object
  13687. * @param {Object} object The object to query.
  13688. * @returns {Array} Returns the array of property names.
  13689. * @example
  13690. *
  13691. * function Foo() {
  13692. * this.a = 1;
  13693. * this.b = 2;
  13694. * }
  13695. *
  13696. * Foo.prototype.c = 3;
  13697. *
  13698. * _.keysIn(new Foo);
  13699. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13700. */
  13701. function keysIn(object) {
  13702. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13703. }
  13704. /**
  13705. * The opposite of `_.mapValues`; this method creates an object with the
  13706. * same values as `object` and keys generated by running each own enumerable
  13707. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13708. * with three arguments: (value, key, object).
  13709. *
  13710. * @static
  13711. * @memberOf _
  13712. * @since 3.8.0
  13713. * @category Object
  13714. * @param {Object} object The object to iterate over.
  13715. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13716. * @returns {Object} Returns the new mapped object.
  13717. * @see _.mapValues
  13718. * @example
  13719. *
  13720. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13721. * return key + value;
  13722. * });
  13723. * // => { 'a1': 1, 'b2': 2 }
  13724. */
  13725. function mapKeys(object, iteratee) {
  13726. var result = {};
  13727. iteratee = getIteratee(iteratee, 3);
  13728. baseForOwn(object, function(value, key, object) {
  13729. baseAssignValue(result, iteratee(value, key, object), value);
  13730. });
  13731. return result;
  13732. }
  13733. /**
  13734. * Creates an object with the same keys as `object` and values generated
  13735. * by running each own enumerable string keyed property of `object` thru
  13736. * `iteratee`. The iteratee is invoked with three arguments:
  13737. * (value, key, object).
  13738. *
  13739. * @static
  13740. * @memberOf _
  13741. * @since 2.4.0
  13742. * @category Object
  13743. * @param {Object} object The object to iterate over.
  13744. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13745. * @returns {Object} Returns the new mapped object.
  13746. * @see _.mapKeys
  13747. * @example
  13748. *
  13749. * var users = {
  13750. * 'fred': { 'user': 'fred', 'age': 40 },
  13751. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13752. * };
  13753. *
  13754. * _.mapValues(users, function(o) { return o.age; });
  13755. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13756. *
  13757. * // The `_.property` iteratee shorthand.
  13758. * _.mapValues(users, 'age');
  13759. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13760. */
  13761. function mapValues(object, iteratee) {
  13762. var result = {};
  13763. iteratee = getIteratee(iteratee, 3);
  13764. baseForOwn(object, function(value, key, object) {
  13765. baseAssignValue(result, key, iteratee(value, key, object));
  13766. });
  13767. return result;
  13768. }
  13769. /**
  13770. * This method is like `_.assign` except that it recursively merges own and
  13771. * inherited enumerable string keyed properties of source objects into the
  13772. * destination object. Source properties that resolve to `undefined` are
  13773. * skipped if a destination value exists. Array and plain object properties
  13774. * are merged recursively. Other objects and value types are overridden by
  13775. * assignment. Source objects are applied from left to right. Subsequent
  13776. * sources overwrite property assignments of previous sources.
  13777. *
  13778. * **Note:** This method mutates `object`.
  13779. *
  13780. * @static
  13781. * @memberOf _
  13782. * @since 0.5.0
  13783. * @category Object
  13784. * @param {Object} object The destination object.
  13785. * @param {...Object} [sources] The source objects.
  13786. * @returns {Object} Returns `object`.
  13787. * @example
  13788. *
  13789. * var object = {
  13790. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13791. * };
  13792. *
  13793. * var other = {
  13794. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13795. * };
  13796. *
  13797. * _.merge(object, other);
  13798. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13799. */
  13800. var merge = createAssigner(function(object, source, srcIndex) {
  13801. baseMerge(object, source, srcIndex);
  13802. });
  13803. /**
  13804. * This method is like `_.merge` except that it accepts `customizer` which
  13805. * is invoked to produce the merged values of the destination and source
  13806. * properties. If `customizer` returns `undefined`, merging is handled by the
  13807. * method instead. The `customizer` is invoked with six arguments:
  13808. * (objValue, srcValue, key, object, source, stack).
  13809. *
  13810. * **Note:** This method mutates `object`.
  13811. *
  13812. * @static
  13813. * @memberOf _
  13814. * @since 4.0.0
  13815. * @category Object
  13816. * @param {Object} object The destination object.
  13817. * @param {...Object} sources The source objects.
  13818. * @param {Function} customizer The function to customize assigned values.
  13819. * @returns {Object} Returns `object`.
  13820. * @example
  13821. *
  13822. * function customizer(objValue, srcValue) {
  13823. * if (_.isArray(objValue)) {
  13824. * return objValue.concat(srcValue);
  13825. * }
  13826. * }
  13827. *
  13828. * var object = { 'a': [1], 'b': [2] };
  13829. * var other = { 'a': [3], 'b': [4] };
  13830. *
  13831. * _.mergeWith(object, other, customizer);
  13832. * // => { 'a': [1, 3], 'b': [2, 4] }
  13833. */
  13834. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13835. baseMerge(object, source, srcIndex, customizer);
  13836. });
  13837. /**
  13838. * The opposite of `_.pick`; this method creates an object composed of the
  13839. * own and inherited enumerable property paths of `object` that are not omitted.
  13840. *
  13841. * **Note:** This method is considerably slower than `_.pick`.
  13842. *
  13843. * @static
  13844. * @since 0.1.0
  13845. * @memberOf _
  13846. * @category Object
  13847. * @param {Object} object The source object.
  13848. * @param {...(string|string[])} [paths] The property paths to omit.
  13849. * @returns {Object} Returns the new object.
  13850. * @example
  13851. *
  13852. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13853. *
  13854. * _.omit(object, ['a', 'c']);
  13855. * // => { 'b': '2' }
  13856. */
  13857. var omit = flatRest(function(object, paths) {
  13858. var result = {};
  13859. if (object == null) {
  13860. return result;
  13861. }
  13862. var isDeep = false;
  13863. paths = arrayMap(paths, function(path) {
  13864. path = castPath(path, object);
  13865. isDeep || (isDeep = path.length > 1);
  13866. return path;
  13867. });
  13868. copyObject(object, getAllKeysIn(object), result);
  13869. if (isDeep) {
  13870. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13871. }
  13872. var length = paths.length;
  13873. while (length--) {
  13874. baseUnset(result, paths[length]);
  13875. }
  13876. return result;
  13877. });
  13878. /**
  13879. * The opposite of `_.pickBy`; this method creates an object composed of
  13880. * the own and inherited enumerable string keyed properties of `object` that
  13881. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13882. * arguments: (value, key).
  13883. *
  13884. * @static
  13885. * @memberOf _
  13886. * @since 4.0.0
  13887. * @category Object
  13888. * @param {Object} object The source object.
  13889. * @param {Function} [predicate=_.identity] The function invoked per property.
  13890. * @returns {Object} Returns the new object.
  13891. * @example
  13892. *
  13893. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13894. *
  13895. * _.omitBy(object, _.isNumber);
  13896. * // => { 'b': '2' }
  13897. */
  13898. function omitBy(object, predicate) {
  13899. return pickBy(object, negate(getIteratee(predicate)));
  13900. }
  13901. /**
  13902. * Creates an object composed of the picked `object` properties.
  13903. *
  13904. * @static
  13905. * @since 0.1.0
  13906. * @memberOf _
  13907. * @category Object
  13908. * @param {Object} object The source object.
  13909. * @param {...(string|string[])} [paths] The property paths to pick.
  13910. * @returns {Object} Returns the new object.
  13911. * @example
  13912. *
  13913. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13914. *
  13915. * _.pick(object, ['a', 'c']);
  13916. * // => { 'a': 1, 'c': 3 }
  13917. */
  13918. var pick = flatRest(function(object, paths) {
  13919. return object == null ? {} : basePick(object, paths);
  13920. });
  13921. /**
  13922. * Creates an object composed of the `object` properties `predicate` returns
  13923. * truthy for. The predicate is invoked with two arguments: (value, key).
  13924. *
  13925. * @static
  13926. * @memberOf _
  13927. * @since 4.0.0
  13928. * @category Object
  13929. * @param {Object} object The source object.
  13930. * @param {Function} [predicate=_.identity] The function invoked per property.
  13931. * @returns {Object} Returns the new object.
  13932. * @example
  13933. *
  13934. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13935. *
  13936. * _.pickBy(object, _.isNumber);
  13937. * // => { 'a': 1, 'c': 3 }
  13938. */
  13939. function pickBy(object, predicate) {
  13940. if (object == null) {
  13941. return {};
  13942. }
  13943. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13944. return [prop];
  13945. });
  13946. predicate = getIteratee(predicate);
  13947. return basePickBy(object, props, function(value, path) {
  13948. return predicate(value, path[0]);
  13949. });
  13950. }
  13951. /**
  13952. * This method is like `_.get` except that if the resolved value is a
  13953. * function it's invoked with the `this` binding of its parent object and
  13954. * its result is returned.
  13955. *
  13956. * @static
  13957. * @since 0.1.0
  13958. * @memberOf _
  13959. * @category Object
  13960. * @param {Object} object The object to query.
  13961. * @param {Array|string} path The path of the property to resolve.
  13962. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13963. * @returns {*} Returns the resolved value.
  13964. * @example
  13965. *
  13966. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13967. *
  13968. * _.result(object, 'a[0].b.c1');
  13969. * // => 3
  13970. *
  13971. * _.result(object, 'a[0].b.c2');
  13972. * // => 4
  13973. *
  13974. * _.result(object, 'a[0].b.c3', 'default');
  13975. * // => 'default'
  13976. *
  13977. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13978. * // => 'default'
  13979. */
  13980. function result(object, path, defaultValue) {
  13981. path = castPath(path, object);
  13982. var index = -1,
  13983. length = path.length;
  13984. // Ensure the loop is entered when path is empty.
  13985. if (!length) {
  13986. length = 1;
  13987. object = undefined;
  13988. }
  13989. while (++index < length) {
  13990. var value = object == null ? undefined : object[toKey(path[index])];
  13991. if (value === undefined) {
  13992. index = length;
  13993. value = defaultValue;
  13994. }
  13995. object = isFunction(value) ? value.call(object) : value;
  13996. }
  13997. return object;
  13998. }
  13999. /**
  14000. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14001. * it's created. Arrays are created for missing index properties while objects
  14002. * are created for all other missing properties. Use `_.setWith` to customize
  14003. * `path` creation.
  14004. *
  14005. * **Note:** This method mutates `object`.
  14006. *
  14007. * @static
  14008. * @memberOf _
  14009. * @since 3.7.0
  14010. * @category Object
  14011. * @param {Object} object The object to modify.
  14012. * @param {Array|string} path The path of the property to set.
  14013. * @param {*} value The value to set.
  14014. * @returns {Object} Returns `object`.
  14015. * @example
  14016. *
  14017. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14018. *
  14019. * _.set(object, 'a[0].b.c', 4);
  14020. * console.log(object.a[0].b.c);
  14021. * // => 4
  14022. *
  14023. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14024. * console.log(object.x[0].y.z);
  14025. * // => 5
  14026. */
  14027. function set(object, path, value) {
  14028. return object == null ? object : baseSet(object, path, value);
  14029. }
  14030. /**
  14031. * This method is like `_.set` except that it accepts `customizer` which is
  14032. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14033. * path creation is handled by the method instead. The `customizer` is invoked
  14034. * with three arguments: (nsValue, key, nsObject).
  14035. *
  14036. * **Note:** This method mutates `object`.
  14037. *
  14038. * @static
  14039. * @memberOf _
  14040. * @since 4.0.0
  14041. * @category Object
  14042. * @param {Object} object The object to modify.
  14043. * @param {Array|string} path The path of the property to set.
  14044. * @param {*} value The value to set.
  14045. * @param {Function} [customizer] The function to customize assigned values.
  14046. * @returns {Object} Returns `object`.
  14047. * @example
  14048. *
  14049. * var object = {};
  14050. *
  14051. * _.setWith(object, '[0][1]', 'a', Object);
  14052. * // => { '0': { '1': 'a' } }
  14053. */
  14054. function setWith(object, path, value, customizer) {
  14055. customizer = typeof customizer == 'function' ? customizer : undefined;
  14056. return object == null ? object : baseSet(object, path, value, customizer);
  14057. }
  14058. /**
  14059. * Creates an array of own enumerable string keyed-value pairs for `object`
  14060. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14061. * entries are returned.
  14062. *
  14063. * @static
  14064. * @memberOf _
  14065. * @since 4.0.0
  14066. * @alias entries
  14067. * @category Object
  14068. * @param {Object} object The object to query.
  14069. * @returns {Array} Returns the key-value pairs.
  14070. * @example
  14071. *
  14072. * function Foo() {
  14073. * this.a = 1;
  14074. * this.b = 2;
  14075. * }
  14076. *
  14077. * Foo.prototype.c = 3;
  14078. *
  14079. * _.toPairs(new Foo);
  14080. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14081. */
  14082. var toPairs = createToPairs(keys);
  14083. /**
  14084. * Creates an array of own and inherited enumerable string keyed-value pairs
  14085. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14086. * or set, its entries are returned.
  14087. *
  14088. * @static
  14089. * @memberOf _
  14090. * @since 4.0.0
  14091. * @alias entriesIn
  14092. * @category Object
  14093. * @param {Object} object The object to query.
  14094. * @returns {Array} Returns the key-value pairs.
  14095. * @example
  14096. *
  14097. * function Foo() {
  14098. * this.a = 1;
  14099. * this.b = 2;
  14100. * }
  14101. *
  14102. * Foo.prototype.c = 3;
  14103. *
  14104. * _.toPairsIn(new Foo);
  14105. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14106. */
  14107. var toPairsIn = createToPairs(keysIn);
  14108. /**
  14109. * An alternative to `_.reduce`; this method transforms `object` to a new
  14110. * `accumulator` object which is the result of running each of its own
  14111. * enumerable string keyed properties thru `iteratee`, with each invocation
  14112. * potentially mutating the `accumulator` object. If `accumulator` is not
  14113. * provided, a new object with the same `[[Prototype]]` will be used. The
  14114. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14115. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14116. *
  14117. * @static
  14118. * @memberOf _
  14119. * @since 1.3.0
  14120. * @category Object
  14121. * @param {Object} object The object to iterate over.
  14122. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14123. * @param {*} [accumulator] The custom accumulator value.
  14124. * @returns {*} Returns the accumulated value.
  14125. * @example
  14126. *
  14127. * _.transform([2, 3, 4], function(result, n) {
  14128. * result.push(n *= n);
  14129. * return n % 2 == 0;
  14130. * }, []);
  14131. * // => [4, 9]
  14132. *
  14133. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14134. * (result[value] || (result[value] = [])).push(key);
  14135. * }, {});
  14136. * // => { '1': ['a', 'c'], '2': ['b'] }
  14137. */
  14138. function transform(object, iteratee, accumulator) {
  14139. var isArr = isArray(object),
  14140. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14141. iteratee = getIteratee(iteratee, 4);
  14142. if (accumulator == null) {
  14143. var Ctor = object && object.constructor;
  14144. if (isArrLike) {
  14145. accumulator = isArr ? new Ctor : [];
  14146. }
  14147. else if (isObject(object)) {
  14148. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14149. }
  14150. else {
  14151. accumulator = {};
  14152. }
  14153. }
  14154. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14155. return iteratee(accumulator, value, index, object);
  14156. });
  14157. return accumulator;
  14158. }
  14159. /**
  14160. * Removes the property at `path` of `object`.
  14161. *
  14162. * **Note:** This method mutates `object`.
  14163. *
  14164. * @static
  14165. * @memberOf _
  14166. * @since 4.0.0
  14167. * @category Object
  14168. * @param {Object} object The object to modify.
  14169. * @param {Array|string} path The path of the property to unset.
  14170. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14171. * @example
  14172. *
  14173. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14174. * _.unset(object, 'a[0].b.c');
  14175. * // => true
  14176. *
  14177. * console.log(object);
  14178. * // => { 'a': [{ 'b': {} }] };
  14179. *
  14180. * _.unset(object, ['a', '0', 'b', 'c']);
  14181. * // => true
  14182. *
  14183. * console.log(object);
  14184. * // => { 'a': [{ 'b': {} }] };
  14185. */
  14186. function unset(object, path) {
  14187. return object == null ? true : baseUnset(object, path);
  14188. }
  14189. /**
  14190. * This method is like `_.set` except that accepts `updater` to produce the
  14191. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14192. * is invoked with one argument: (value).
  14193. *
  14194. * **Note:** This method mutates `object`.
  14195. *
  14196. * @static
  14197. * @memberOf _
  14198. * @since 4.6.0
  14199. * @category Object
  14200. * @param {Object} object The object to modify.
  14201. * @param {Array|string} path The path of the property to set.
  14202. * @param {Function} updater The function to produce the updated value.
  14203. * @returns {Object} Returns `object`.
  14204. * @example
  14205. *
  14206. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14207. *
  14208. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14209. * console.log(object.a[0].b.c);
  14210. * // => 9
  14211. *
  14212. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14213. * console.log(object.x[0].y.z);
  14214. * // => 0
  14215. */
  14216. function update(object, path, updater) {
  14217. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14218. }
  14219. /**
  14220. * This method is like `_.update` except that it accepts `customizer` which is
  14221. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14222. * path creation is handled by the method instead. The `customizer` is invoked
  14223. * with three arguments: (nsValue, key, nsObject).
  14224. *
  14225. * **Note:** This method mutates `object`.
  14226. *
  14227. * @static
  14228. * @memberOf _
  14229. * @since 4.6.0
  14230. * @category Object
  14231. * @param {Object} object The object to modify.
  14232. * @param {Array|string} path The path of the property to set.
  14233. * @param {Function} updater The function to produce the updated value.
  14234. * @param {Function} [customizer] The function to customize assigned values.
  14235. * @returns {Object} Returns `object`.
  14236. * @example
  14237. *
  14238. * var object = {};
  14239. *
  14240. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14241. * // => { '0': { '1': 'a' } }
  14242. */
  14243. function updateWith(object, path, updater, customizer) {
  14244. customizer = typeof customizer == 'function' ? customizer : undefined;
  14245. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14246. }
  14247. /**
  14248. * Creates an array of the own enumerable string keyed property values of `object`.
  14249. *
  14250. * **Note:** Non-object values are coerced to objects.
  14251. *
  14252. * @static
  14253. * @since 0.1.0
  14254. * @memberOf _
  14255. * @category Object
  14256. * @param {Object} object The object to query.
  14257. * @returns {Array} Returns the array of property values.
  14258. * @example
  14259. *
  14260. * function Foo() {
  14261. * this.a = 1;
  14262. * this.b = 2;
  14263. * }
  14264. *
  14265. * Foo.prototype.c = 3;
  14266. *
  14267. * _.values(new Foo);
  14268. * // => [1, 2] (iteration order is not guaranteed)
  14269. *
  14270. * _.values('hi');
  14271. * // => ['h', 'i']
  14272. */
  14273. function values(object) {
  14274. return object == null ? [] : baseValues(object, keys(object));
  14275. }
  14276. /**
  14277. * Creates an array of the own and inherited enumerable string keyed property
  14278. * values of `object`.
  14279. *
  14280. * **Note:** Non-object values are coerced to objects.
  14281. *
  14282. * @static
  14283. * @memberOf _
  14284. * @since 3.0.0
  14285. * @category Object
  14286. * @param {Object} object The object to query.
  14287. * @returns {Array} Returns the array of property values.
  14288. * @example
  14289. *
  14290. * function Foo() {
  14291. * this.a = 1;
  14292. * this.b = 2;
  14293. * }
  14294. *
  14295. * Foo.prototype.c = 3;
  14296. *
  14297. * _.valuesIn(new Foo);
  14298. * // => [1, 2, 3] (iteration order is not guaranteed)
  14299. */
  14300. function valuesIn(object) {
  14301. return object == null ? [] : baseValues(object, keysIn(object));
  14302. }
  14303. /*------------------------------------------------------------------------*/
  14304. /**
  14305. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14306. *
  14307. * @static
  14308. * @memberOf _
  14309. * @since 4.0.0
  14310. * @category Number
  14311. * @param {number} number The number to clamp.
  14312. * @param {number} [lower] The lower bound.
  14313. * @param {number} upper The upper bound.
  14314. * @returns {number} Returns the clamped number.
  14315. * @example
  14316. *
  14317. * _.clamp(-10, -5, 5);
  14318. * // => -5
  14319. *
  14320. * _.clamp(10, -5, 5);
  14321. * // => 5
  14322. */
  14323. function clamp(number, lower, upper) {
  14324. if (upper === undefined) {
  14325. upper = lower;
  14326. lower = undefined;
  14327. }
  14328. if (upper !== undefined) {
  14329. upper = toNumber(upper);
  14330. upper = upper === upper ? upper : 0;
  14331. }
  14332. if (lower !== undefined) {
  14333. lower = toNumber(lower);
  14334. lower = lower === lower ? lower : 0;
  14335. }
  14336. return baseClamp(toNumber(number), lower, upper);
  14337. }
  14338. /**
  14339. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14340. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14341. * If `start` is greater than `end` the params are swapped to support
  14342. * negative ranges.
  14343. *
  14344. * @static
  14345. * @memberOf _
  14346. * @since 3.3.0
  14347. * @category Number
  14348. * @param {number} number The number to check.
  14349. * @param {number} [start=0] The start of the range.
  14350. * @param {number} end The end of the range.
  14351. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14352. * @see _.range, _.rangeRight
  14353. * @example
  14354. *
  14355. * _.inRange(3, 2, 4);
  14356. * // => true
  14357. *
  14358. * _.inRange(4, 8);
  14359. * // => true
  14360. *
  14361. * _.inRange(4, 2);
  14362. * // => false
  14363. *
  14364. * _.inRange(2, 2);
  14365. * // => false
  14366. *
  14367. * _.inRange(1.2, 2);
  14368. * // => true
  14369. *
  14370. * _.inRange(5.2, 4);
  14371. * // => false
  14372. *
  14373. * _.inRange(-3, -2, -6);
  14374. * // => true
  14375. */
  14376. function inRange(number, start, end) {
  14377. start = toFinite(start);
  14378. if (end === undefined) {
  14379. end = start;
  14380. start = 0;
  14381. } else {
  14382. end = toFinite(end);
  14383. }
  14384. number = toNumber(number);
  14385. return baseInRange(number, start, end);
  14386. }
  14387. /**
  14388. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14389. * If only one argument is provided a number between `0` and the given number
  14390. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14391. * floats, a floating-point number is returned instead of an integer.
  14392. *
  14393. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14394. * floating-point values which can produce unexpected results.
  14395. *
  14396. * @static
  14397. * @memberOf _
  14398. * @since 0.7.0
  14399. * @category Number
  14400. * @param {number} [lower=0] The lower bound.
  14401. * @param {number} [upper=1] The upper bound.
  14402. * @param {boolean} [floating] Specify returning a floating-point number.
  14403. * @returns {number} Returns the random number.
  14404. * @example
  14405. *
  14406. * _.random(0, 5);
  14407. * // => an integer between 0 and 5
  14408. *
  14409. * _.random(5);
  14410. * // => also an integer between 0 and 5
  14411. *
  14412. * _.random(5, true);
  14413. * // => a floating-point number between 0 and 5
  14414. *
  14415. * _.random(1.2, 5.2);
  14416. * // => a floating-point number between 1.2 and 5.2
  14417. */
  14418. function random(lower, upper, floating) {
  14419. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14420. upper = floating = undefined;
  14421. }
  14422. if (floating === undefined) {
  14423. if (typeof upper == 'boolean') {
  14424. floating = upper;
  14425. upper = undefined;
  14426. }
  14427. else if (typeof lower == 'boolean') {
  14428. floating = lower;
  14429. lower = undefined;
  14430. }
  14431. }
  14432. if (lower === undefined && upper === undefined) {
  14433. lower = 0;
  14434. upper = 1;
  14435. }
  14436. else {
  14437. lower = toFinite(lower);
  14438. if (upper === undefined) {
  14439. upper = lower;
  14440. lower = 0;
  14441. } else {
  14442. upper = toFinite(upper);
  14443. }
  14444. }
  14445. if (lower > upper) {
  14446. var temp = lower;
  14447. lower = upper;
  14448. upper = temp;
  14449. }
  14450. if (floating || lower % 1 || upper % 1) {
  14451. var rand = nativeRandom();
  14452. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14453. }
  14454. return baseRandom(lower, upper);
  14455. }
  14456. /*------------------------------------------------------------------------*/
  14457. /**
  14458. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14459. *
  14460. * @static
  14461. * @memberOf _
  14462. * @since 3.0.0
  14463. * @category String
  14464. * @param {string} [string=''] The string to convert.
  14465. * @returns {string} Returns the camel cased string.
  14466. * @example
  14467. *
  14468. * _.camelCase('Foo Bar');
  14469. * // => 'fooBar'
  14470. *
  14471. * _.camelCase('--foo-bar--');
  14472. * // => 'fooBar'
  14473. *
  14474. * _.camelCase('__FOO_BAR__');
  14475. * // => 'fooBar'
  14476. */
  14477. var camelCase = createCompounder(function(result, word, index) {
  14478. word = word.toLowerCase();
  14479. return result + (index ? capitalize(word) : word);
  14480. });
  14481. /**
  14482. * Converts the first character of `string` to upper case and the remaining
  14483. * to lower case.
  14484. *
  14485. * @static
  14486. * @memberOf _
  14487. * @since 3.0.0
  14488. * @category String
  14489. * @param {string} [string=''] The string to capitalize.
  14490. * @returns {string} Returns the capitalized string.
  14491. * @example
  14492. *
  14493. * _.capitalize('FRED');
  14494. * // => 'Fred'
  14495. */
  14496. function capitalize(string) {
  14497. return upperFirst(toString(string).toLowerCase());
  14498. }
  14499. /**
  14500. * Deburrs `string` by converting
  14501. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14502. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14503. * letters to basic Latin letters and removing
  14504. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14505. *
  14506. * @static
  14507. * @memberOf _
  14508. * @since 3.0.0
  14509. * @category String
  14510. * @param {string} [string=''] The string to deburr.
  14511. * @returns {string} Returns the deburred string.
  14512. * @example
  14513. *
  14514. * _.deburr('déjà vu');
  14515. * // => 'deja vu'
  14516. */
  14517. function deburr(string) {
  14518. string = toString(string);
  14519. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14520. }
  14521. /**
  14522. * Checks if `string` ends with the given target string.
  14523. *
  14524. * @static
  14525. * @memberOf _
  14526. * @since 3.0.0
  14527. * @category String
  14528. * @param {string} [string=''] The string to inspect.
  14529. * @param {string} [target] The string to search for.
  14530. * @param {number} [position=string.length] The position to search up to.
  14531. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14532. * else `false`.
  14533. * @example
  14534. *
  14535. * _.endsWith('abc', 'c');
  14536. * // => true
  14537. *
  14538. * _.endsWith('abc', 'b');
  14539. * // => false
  14540. *
  14541. * _.endsWith('abc', 'b', 2);
  14542. * // => true
  14543. */
  14544. function endsWith(string, target, position) {
  14545. string = toString(string);
  14546. target = baseToString(target);
  14547. var length = string.length;
  14548. position = position === undefined
  14549. ? length
  14550. : baseClamp(toInteger(position), 0, length);
  14551. var end = position;
  14552. position -= target.length;
  14553. return position >= 0 && string.slice(position, end) == target;
  14554. }
  14555. /**
  14556. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14557. * corresponding HTML entities.
  14558. *
  14559. * **Note:** No other characters are escaped. To escape additional
  14560. * characters use a third-party library like [_he_](https://mths.be/he).
  14561. *
  14562. * Though the ">" character is escaped for symmetry, characters like
  14563. * ">" and "/" don't need escaping in HTML and have no special meaning
  14564. * unless they're part of a tag or unquoted attribute value. See
  14565. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14566. * (under "semi-related fun fact") for more details.
  14567. *
  14568. * When working with HTML you should always
  14569. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14570. * XSS vectors.
  14571. *
  14572. * @static
  14573. * @since 0.1.0
  14574. * @memberOf _
  14575. * @category String
  14576. * @param {string} [string=''] The string to escape.
  14577. * @returns {string} Returns the escaped string.
  14578. * @example
  14579. *
  14580. * _.escape('fred, barney, & pebbles');
  14581. * // => 'fred, barney, &amp; pebbles'
  14582. */
  14583. function escape(string) {
  14584. string = toString(string);
  14585. return (string && reHasUnescapedHtml.test(string))
  14586. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14587. : string;
  14588. }
  14589. /**
  14590. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14591. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14592. *
  14593. * @static
  14594. * @memberOf _
  14595. * @since 3.0.0
  14596. * @category String
  14597. * @param {string} [string=''] The string to escape.
  14598. * @returns {string} Returns the escaped string.
  14599. * @example
  14600. *
  14601. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14602. * // => '\[lodash\]\(https://lodash\.com/\)'
  14603. */
  14604. function escapeRegExp(string) {
  14605. string = toString(string);
  14606. return (string && reHasRegExpChar.test(string))
  14607. ? string.replace(reRegExpChar, '\\$&')
  14608. : string;
  14609. }
  14610. /**
  14611. * Converts `string` to
  14612. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14613. *
  14614. * @static
  14615. * @memberOf _
  14616. * @since 3.0.0
  14617. * @category String
  14618. * @param {string} [string=''] The string to convert.
  14619. * @returns {string} Returns the kebab cased string.
  14620. * @example
  14621. *
  14622. * _.kebabCase('Foo Bar');
  14623. * // => 'foo-bar'
  14624. *
  14625. * _.kebabCase('fooBar');
  14626. * // => 'foo-bar'
  14627. *
  14628. * _.kebabCase('__FOO_BAR__');
  14629. * // => 'foo-bar'
  14630. */
  14631. var kebabCase = createCompounder(function(result, word, index) {
  14632. return result + (index ? '-' : '') + word.toLowerCase();
  14633. });
  14634. /**
  14635. * Converts `string`, as space separated words, to lower case.
  14636. *
  14637. * @static
  14638. * @memberOf _
  14639. * @since 4.0.0
  14640. * @category String
  14641. * @param {string} [string=''] The string to convert.
  14642. * @returns {string} Returns the lower cased string.
  14643. * @example
  14644. *
  14645. * _.lowerCase('--Foo-Bar--');
  14646. * // => 'foo bar'
  14647. *
  14648. * _.lowerCase('fooBar');
  14649. * // => 'foo bar'
  14650. *
  14651. * _.lowerCase('__FOO_BAR__');
  14652. * // => 'foo bar'
  14653. */
  14654. var lowerCase = createCompounder(function(result, word, index) {
  14655. return result + (index ? ' ' : '') + word.toLowerCase();
  14656. });
  14657. /**
  14658. * Converts the first character of `string` to lower case.
  14659. *
  14660. * @static
  14661. * @memberOf _
  14662. * @since 4.0.0
  14663. * @category String
  14664. * @param {string} [string=''] The string to convert.
  14665. * @returns {string} Returns the converted string.
  14666. * @example
  14667. *
  14668. * _.lowerFirst('Fred');
  14669. * // => 'fred'
  14670. *
  14671. * _.lowerFirst('FRED');
  14672. * // => 'fRED'
  14673. */
  14674. var lowerFirst = createCaseFirst('toLowerCase');
  14675. /**
  14676. * Pads `string` on the left and right sides if it's shorter than `length`.
  14677. * Padding characters are truncated if they can't be evenly divided by `length`.
  14678. *
  14679. * @static
  14680. * @memberOf _
  14681. * @since 3.0.0
  14682. * @category String
  14683. * @param {string} [string=''] The string to pad.
  14684. * @param {number} [length=0] The padding length.
  14685. * @param {string} [chars=' '] The string used as padding.
  14686. * @returns {string} Returns the padded string.
  14687. * @example
  14688. *
  14689. * _.pad('abc', 8);
  14690. * // => ' abc '
  14691. *
  14692. * _.pad('abc', 8, '_-');
  14693. * // => '_-abc_-_'
  14694. *
  14695. * _.pad('abc', 3);
  14696. * // => 'abc'
  14697. */
  14698. function pad(string, length, chars) {
  14699. string = toString(string);
  14700. length = toInteger(length);
  14701. var strLength = length ? stringSize(string) : 0;
  14702. if (!length || strLength >= length) {
  14703. return string;
  14704. }
  14705. var mid = (length - strLength) / 2;
  14706. return (
  14707. createPadding(nativeFloor(mid), chars) +
  14708. string +
  14709. createPadding(nativeCeil(mid), chars)
  14710. );
  14711. }
  14712. /**
  14713. * Pads `string` on the right side if it's shorter than `length`. Padding
  14714. * characters are truncated if they exceed `length`.
  14715. *
  14716. * @static
  14717. * @memberOf _
  14718. * @since 4.0.0
  14719. * @category String
  14720. * @param {string} [string=''] The string to pad.
  14721. * @param {number} [length=0] The padding length.
  14722. * @param {string} [chars=' '] The string used as padding.
  14723. * @returns {string} Returns the padded string.
  14724. * @example
  14725. *
  14726. * _.padEnd('abc', 6);
  14727. * // => 'abc '
  14728. *
  14729. * _.padEnd('abc', 6, '_-');
  14730. * // => 'abc_-_'
  14731. *
  14732. * _.padEnd('abc', 3);
  14733. * // => 'abc'
  14734. */
  14735. function padEnd(string, length, chars) {
  14736. string = toString(string);
  14737. length = toInteger(length);
  14738. var strLength = length ? stringSize(string) : 0;
  14739. return (length && strLength < length)
  14740. ? (string + createPadding(length - strLength, chars))
  14741. : string;
  14742. }
  14743. /**
  14744. * Pads `string` on the left side if it's shorter than `length`. Padding
  14745. * characters are truncated if they exceed `length`.
  14746. *
  14747. * @static
  14748. * @memberOf _
  14749. * @since 4.0.0
  14750. * @category String
  14751. * @param {string} [string=''] The string to pad.
  14752. * @param {number} [length=0] The padding length.
  14753. * @param {string} [chars=' '] The string used as padding.
  14754. * @returns {string} Returns the padded string.
  14755. * @example
  14756. *
  14757. * _.padStart('abc', 6);
  14758. * // => ' abc'
  14759. *
  14760. * _.padStart('abc', 6, '_-');
  14761. * // => '_-_abc'
  14762. *
  14763. * _.padStart('abc', 3);
  14764. * // => 'abc'
  14765. */
  14766. function padStart(string, length, chars) {
  14767. string = toString(string);
  14768. length = toInteger(length);
  14769. var strLength = length ? stringSize(string) : 0;
  14770. return (length && strLength < length)
  14771. ? (createPadding(length - strLength, chars) + string)
  14772. : string;
  14773. }
  14774. /**
  14775. * Converts `string` to an integer of the specified radix. If `radix` is
  14776. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14777. * hexadecimal, in which case a `radix` of `16` is used.
  14778. *
  14779. * **Note:** This method aligns with the
  14780. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14781. *
  14782. * @static
  14783. * @memberOf _
  14784. * @since 1.1.0
  14785. * @category String
  14786. * @param {string} string The string to convert.
  14787. * @param {number} [radix=10] The radix to interpret `value` by.
  14788. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14789. * @returns {number} Returns the converted integer.
  14790. * @example
  14791. *
  14792. * _.parseInt('08');
  14793. * // => 8
  14794. *
  14795. * _.map(['6', '08', '10'], _.parseInt);
  14796. * // => [6, 8, 10]
  14797. */
  14798. function parseInt(string, radix, guard) {
  14799. if (guard || radix == null) {
  14800. radix = 0;
  14801. } else if (radix) {
  14802. radix = +radix;
  14803. }
  14804. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14805. }
  14806. /**
  14807. * Repeats the given string `n` times.
  14808. *
  14809. * @static
  14810. * @memberOf _
  14811. * @since 3.0.0
  14812. * @category String
  14813. * @param {string} [string=''] The string to repeat.
  14814. * @param {number} [n=1] The number of times to repeat the string.
  14815. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14816. * @returns {string} Returns the repeated string.
  14817. * @example
  14818. *
  14819. * _.repeat('*', 3);
  14820. * // => '***'
  14821. *
  14822. * _.repeat('abc', 2);
  14823. * // => 'abcabc'
  14824. *
  14825. * _.repeat('abc', 0);
  14826. * // => ''
  14827. */
  14828. function repeat(string, n, guard) {
  14829. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14830. n = 1;
  14831. } else {
  14832. n = toInteger(n);
  14833. }
  14834. return baseRepeat(toString(string), n);
  14835. }
  14836. /**
  14837. * Replaces matches for `pattern` in `string` with `replacement`.
  14838. *
  14839. * **Note:** This method is based on
  14840. * [`String#replace`](https://mdn.io/String/replace).
  14841. *
  14842. * @static
  14843. * @memberOf _
  14844. * @since 4.0.0
  14845. * @category String
  14846. * @param {string} [string=''] The string to modify.
  14847. * @param {RegExp|string} pattern The pattern to replace.
  14848. * @param {Function|string} replacement The match replacement.
  14849. * @returns {string} Returns the modified string.
  14850. * @example
  14851. *
  14852. * _.replace('Hi Fred', 'Fred', 'Barney');
  14853. * // => 'Hi Barney'
  14854. */
  14855. function replace() {
  14856. var args = arguments,
  14857. string = toString(args[0]);
  14858. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14859. }
  14860. /**
  14861. * Converts `string` to
  14862. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14863. *
  14864. * @static
  14865. * @memberOf _
  14866. * @since 3.0.0
  14867. * @category String
  14868. * @param {string} [string=''] The string to convert.
  14869. * @returns {string} Returns the snake cased string.
  14870. * @example
  14871. *
  14872. * _.snakeCase('Foo Bar');
  14873. * // => 'foo_bar'
  14874. *
  14875. * _.snakeCase('fooBar');
  14876. * // => 'foo_bar'
  14877. *
  14878. * _.snakeCase('--FOO-BAR--');
  14879. * // => 'foo_bar'
  14880. */
  14881. var snakeCase = createCompounder(function(result, word, index) {
  14882. return result + (index ? '_' : '') + word.toLowerCase();
  14883. });
  14884. /**
  14885. * Splits `string` by `separator`.
  14886. *
  14887. * **Note:** This method is based on
  14888. * [`String#split`](https://mdn.io/String/split).
  14889. *
  14890. * @static
  14891. * @memberOf _
  14892. * @since 4.0.0
  14893. * @category String
  14894. * @param {string} [string=''] The string to split.
  14895. * @param {RegExp|string} separator The separator pattern to split by.
  14896. * @param {number} [limit] The length to truncate results to.
  14897. * @returns {Array} Returns the string segments.
  14898. * @example
  14899. *
  14900. * _.split('a-b-c', '-', 2);
  14901. * // => ['a', 'b']
  14902. */
  14903. function split(string, separator, limit) {
  14904. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14905. separator = limit = undefined;
  14906. }
  14907. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14908. if (!limit) {
  14909. return [];
  14910. }
  14911. string = toString(string);
  14912. if (string && (
  14913. typeof separator == 'string' ||
  14914. (separator != null && !isRegExp(separator))
  14915. )) {
  14916. separator = baseToString(separator);
  14917. if (!separator && hasUnicode(string)) {
  14918. return castSlice(stringToArray(string), 0, limit);
  14919. }
  14920. }
  14921. return string.split(separator, limit);
  14922. }
  14923. /**
  14924. * Converts `string` to
  14925. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14926. *
  14927. * @static
  14928. * @memberOf _
  14929. * @since 3.1.0
  14930. * @category String
  14931. * @param {string} [string=''] The string to convert.
  14932. * @returns {string} Returns the start cased string.
  14933. * @example
  14934. *
  14935. * _.startCase('--foo-bar--');
  14936. * // => 'Foo Bar'
  14937. *
  14938. * _.startCase('fooBar');
  14939. * // => 'Foo Bar'
  14940. *
  14941. * _.startCase('__FOO_BAR__');
  14942. * // => 'FOO BAR'
  14943. */
  14944. var startCase = createCompounder(function(result, word, index) {
  14945. return result + (index ? ' ' : '') + upperFirst(word);
  14946. });
  14947. /**
  14948. * Checks if `string` starts with the given target string.
  14949. *
  14950. * @static
  14951. * @memberOf _
  14952. * @since 3.0.0
  14953. * @category String
  14954. * @param {string} [string=''] The string to inspect.
  14955. * @param {string} [target] The string to search for.
  14956. * @param {number} [position=0] The position to search from.
  14957. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14958. * else `false`.
  14959. * @example
  14960. *
  14961. * _.startsWith('abc', 'a');
  14962. * // => true
  14963. *
  14964. * _.startsWith('abc', 'b');
  14965. * // => false
  14966. *
  14967. * _.startsWith('abc', 'b', 1);
  14968. * // => true
  14969. */
  14970. function startsWith(string, target, position) {
  14971. string = toString(string);
  14972. position = position == null
  14973. ? 0
  14974. : baseClamp(toInteger(position), 0, string.length);
  14975. target = baseToString(target);
  14976. return string.slice(position, position + target.length) == target;
  14977. }
  14978. /**
  14979. * Creates a compiled template function that can interpolate data properties
  14980. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14981. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14982. * properties may be accessed as free variables in the template. If a setting
  14983. * object is given, it takes precedence over `_.templateSettings` values.
  14984. *
  14985. * **Note:** In the development build `_.template` utilizes
  14986. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14987. * for easier debugging.
  14988. *
  14989. * For more information on precompiling templates see
  14990. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14991. *
  14992. * For more information on Chrome extension sandboxes see
  14993. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14994. *
  14995. * @static
  14996. * @since 0.1.0
  14997. * @memberOf _
  14998. * @category String
  14999. * @param {string} [string=''] The template string.
  15000. * @param {Object} [options={}] The options object.
  15001. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15002. * The HTML "escape" delimiter.
  15003. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15004. * The "evaluate" delimiter.
  15005. * @param {Object} [options.imports=_.templateSettings.imports]
  15006. * An object to import into the template as free variables.
  15007. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15008. * The "interpolate" delimiter.
  15009. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15010. * The sourceURL of the compiled template.
  15011. * @param {string} [options.variable='obj']
  15012. * The data object variable name.
  15013. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15014. * @returns {Function} Returns the compiled template function.
  15015. * @example
  15016. *
  15017. * // Use the "interpolate" delimiter to create a compiled template.
  15018. * var compiled = _.template('hello <%= user %>!');
  15019. * compiled({ 'user': 'fred' });
  15020. * // => 'hello fred!'
  15021. *
  15022. * // Use the HTML "escape" delimiter to escape data property values.
  15023. * var compiled = _.template('<b><%- value %></b>');
  15024. * compiled({ 'value': '<script>' });
  15025. * // => '<b>&lt;script&gt;</b>'
  15026. *
  15027. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15028. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15029. * compiled({ 'users': ['fred', 'barney'] });
  15030. * // => '<li>fred</li><li>barney</li>'
  15031. *
  15032. * // Use the internal `print` function in "evaluate" delimiters.
  15033. * var compiled = _.template('<% print("hello " + user); %>!');
  15034. * compiled({ 'user': 'barney' });
  15035. * // => 'hello barney!'
  15036. *
  15037. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15038. * // Disable support by replacing the "interpolate" delimiter.
  15039. * var compiled = _.template('hello ${ user }!');
  15040. * compiled({ 'user': 'pebbles' });
  15041. * // => 'hello pebbles!'
  15042. *
  15043. * // Use backslashes to treat delimiters as plain text.
  15044. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15045. * compiled({ 'value': 'ignored' });
  15046. * // => '<%- value %>'
  15047. *
  15048. * // Use the `imports` option to import `jQuery` as `jq`.
  15049. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15050. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15051. * compiled({ 'users': ['fred', 'barney'] });
  15052. * // => '<li>fred</li><li>barney</li>'
  15053. *
  15054. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15055. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15056. * compiled(data);
  15057. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15058. *
  15059. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15060. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15061. * compiled.source;
  15062. * // => function(data) {
  15063. * // var __t, __p = '';
  15064. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15065. * // return __p;
  15066. * // }
  15067. *
  15068. * // Use custom template delimiters.
  15069. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15070. * var compiled = _.template('hello {{ user }}!');
  15071. * compiled({ 'user': 'mustache' });
  15072. * // => 'hello mustache!'
  15073. *
  15074. * // Use the `source` property to inline compiled templates for meaningful
  15075. * // line numbers in error messages and stack traces.
  15076. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15077. * var JST = {\
  15078. * "main": ' + _.template(mainText).source + '\
  15079. * };\
  15080. * ');
  15081. */
  15082. function template(string, options, guard) {
  15083. // Based on John Resig's `tmpl` implementation
  15084. // (http://ejohn.org/blog/javascript-micro-templating/)
  15085. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15086. var settings = lodash.templateSettings;
  15087. if (guard && isIterateeCall(string, options, guard)) {
  15088. options = undefined;
  15089. }
  15090. string = toString(string);
  15091. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15092. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15093. importsKeys = keys(imports),
  15094. importsValues = baseValues(imports, importsKeys);
  15095. var isEscaping,
  15096. isEvaluating,
  15097. index = 0,
  15098. interpolate = options.interpolate || reNoMatch,
  15099. source = "__p += '";
  15100. // Compile the regexp to match each delimiter.
  15101. var reDelimiters = RegExp(
  15102. (options.escape || reNoMatch).source + '|' +
  15103. interpolate.source + '|' +
  15104. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15105. (options.evaluate || reNoMatch).source + '|$'
  15106. , 'g');
  15107. // Use a sourceURL for easier debugging.
  15108. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15109. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15110. // and escape the comment, thus injecting code that gets evaled.
  15111. var sourceURL = '//# sourceURL=' +
  15112. (hasOwnProperty.call(options, 'sourceURL')
  15113. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15114. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15115. ) + '\n';
  15116. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15117. interpolateValue || (interpolateValue = esTemplateValue);
  15118. // Escape characters that can't be included in string literals.
  15119. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15120. // Replace delimiters with snippets.
  15121. if (escapeValue) {
  15122. isEscaping = true;
  15123. source += "' +\n__e(" + escapeValue + ") +\n'";
  15124. }
  15125. if (evaluateValue) {
  15126. isEvaluating = true;
  15127. source += "';\n" + evaluateValue + ";\n__p += '";
  15128. }
  15129. if (interpolateValue) {
  15130. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15131. }
  15132. index = offset + match.length;
  15133. // The JS engine embedded in Adobe products needs `match` returned in
  15134. // order to produce the correct `offset` value.
  15135. return match;
  15136. });
  15137. source += "';\n";
  15138. // If `variable` is not specified wrap a with-statement around the generated
  15139. // code to add the data object to the top of the scope chain.
  15140. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15141. if (!variable) {
  15142. source = 'with (obj) {\n' + source + '\n}\n';
  15143. }
  15144. // Throw an error if a forbidden character was found in `variable`, to prevent
  15145. // potential command injection attacks.
  15146. else if (reForbiddenIdentifierChars.test(variable)) {
  15147. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15148. }
  15149. // Cleanup code by stripping empty strings.
  15150. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15151. .replace(reEmptyStringMiddle, '$1')
  15152. .replace(reEmptyStringTrailing, '$1;');
  15153. // Frame code as the function body.
  15154. source = 'function(' + (variable || 'obj') + ') {\n' +
  15155. (variable
  15156. ? ''
  15157. : 'obj || (obj = {});\n'
  15158. ) +
  15159. "var __t, __p = ''" +
  15160. (isEscaping
  15161. ? ', __e = _.escape'
  15162. : ''
  15163. ) +
  15164. (isEvaluating
  15165. ? ', __j = Array.prototype.join;\n' +
  15166. "function print() { __p += __j.call(arguments, '') }\n"
  15167. : ';\n'
  15168. ) +
  15169. source +
  15170. 'return __p\n}';
  15171. var result = attempt(function() {
  15172. return Function(importsKeys, sourceURL + 'return ' + source)
  15173. .apply(undefined, importsValues);
  15174. });
  15175. // Provide the compiled function's source by its `toString` method or
  15176. // the `source` property as a convenience for inlining compiled templates.
  15177. result.source = source;
  15178. if (isError(result)) {
  15179. throw result;
  15180. }
  15181. return result;
  15182. }
  15183. /**
  15184. * Converts `string`, as a whole, to lower case just like
  15185. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15186. *
  15187. * @static
  15188. * @memberOf _
  15189. * @since 4.0.0
  15190. * @category String
  15191. * @param {string} [string=''] The string to convert.
  15192. * @returns {string} Returns the lower cased string.
  15193. * @example
  15194. *
  15195. * _.toLower('--Foo-Bar--');
  15196. * // => '--foo-bar--'
  15197. *
  15198. * _.toLower('fooBar');
  15199. * // => 'foobar'
  15200. *
  15201. * _.toLower('__FOO_BAR__');
  15202. * // => '__foo_bar__'
  15203. */
  15204. function toLower(value) {
  15205. return toString(value).toLowerCase();
  15206. }
  15207. /**
  15208. * Converts `string`, as a whole, to upper case just like
  15209. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15210. *
  15211. * @static
  15212. * @memberOf _
  15213. * @since 4.0.0
  15214. * @category String
  15215. * @param {string} [string=''] The string to convert.
  15216. * @returns {string} Returns the upper cased string.
  15217. * @example
  15218. *
  15219. * _.toUpper('--foo-bar--');
  15220. * // => '--FOO-BAR--'
  15221. *
  15222. * _.toUpper('fooBar');
  15223. * // => 'FOOBAR'
  15224. *
  15225. * _.toUpper('__foo_bar__');
  15226. * // => '__FOO_BAR__'
  15227. */
  15228. function toUpper(value) {
  15229. return toString(value).toUpperCase();
  15230. }
  15231. /**
  15232. * Removes leading and trailing whitespace or specified characters from `string`.
  15233. *
  15234. * @static
  15235. * @memberOf _
  15236. * @since 3.0.0
  15237. * @category String
  15238. * @param {string} [string=''] The string to trim.
  15239. * @param {string} [chars=whitespace] The characters to trim.
  15240. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15241. * @returns {string} Returns the trimmed string.
  15242. * @example
  15243. *
  15244. * _.trim(' abc ');
  15245. * // => 'abc'
  15246. *
  15247. * _.trim('-_-abc-_-', '_-');
  15248. * // => 'abc'
  15249. *
  15250. * _.map([' foo ', ' bar '], _.trim);
  15251. * // => ['foo', 'bar']
  15252. */
  15253. function trim(string, chars, guard) {
  15254. string = toString(string);
  15255. if (string && (guard || chars === undefined)) {
  15256. return baseTrim(string);
  15257. }
  15258. if (!string || !(chars = baseToString(chars))) {
  15259. return string;
  15260. }
  15261. var strSymbols = stringToArray(string),
  15262. chrSymbols = stringToArray(chars),
  15263. start = charsStartIndex(strSymbols, chrSymbols),
  15264. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15265. return castSlice(strSymbols, start, end).join('');
  15266. }
  15267. /**
  15268. * Removes trailing whitespace or specified characters from `string`.
  15269. *
  15270. * @static
  15271. * @memberOf _
  15272. * @since 4.0.0
  15273. * @category String
  15274. * @param {string} [string=''] The string to trim.
  15275. * @param {string} [chars=whitespace] The characters to trim.
  15276. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15277. * @returns {string} Returns the trimmed string.
  15278. * @example
  15279. *
  15280. * _.trimEnd(' abc ');
  15281. * // => ' abc'
  15282. *
  15283. * _.trimEnd('-_-abc-_-', '_-');
  15284. * // => '-_-abc'
  15285. */
  15286. function trimEnd(string, chars, guard) {
  15287. string = toString(string);
  15288. if (string && (guard || chars === undefined)) {
  15289. return string.slice(0, trimmedEndIndex(string) + 1);
  15290. }
  15291. if (!string || !(chars = baseToString(chars))) {
  15292. return string;
  15293. }
  15294. var strSymbols = stringToArray(string),
  15295. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15296. return castSlice(strSymbols, 0, end).join('');
  15297. }
  15298. /**
  15299. * Removes leading whitespace or specified characters from `string`.
  15300. *
  15301. * @static
  15302. * @memberOf _
  15303. * @since 4.0.0
  15304. * @category String
  15305. * @param {string} [string=''] The string to trim.
  15306. * @param {string} [chars=whitespace] The characters to trim.
  15307. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15308. * @returns {string} Returns the trimmed string.
  15309. * @example
  15310. *
  15311. * _.trimStart(' abc ');
  15312. * // => 'abc '
  15313. *
  15314. * _.trimStart('-_-abc-_-', '_-');
  15315. * // => 'abc-_-'
  15316. */
  15317. function trimStart(string, chars, guard) {
  15318. string = toString(string);
  15319. if (string && (guard || chars === undefined)) {
  15320. return string.replace(reTrimStart, '');
  15321. }
  15322. if (!string || !(chars = baseToString(chars))) {
  15323. return string;
  15324. }
  15325. var strSymbols = stringToArray(string),
  15326. start = charsStartIndex(strSymbols, stringToArray(chars));
  15327. return castSlice(strSymbols, start).join('');
  15328. }
  15329. /**
  15330. * Truncates `string` if it's longer than the given maximum string length.
  15331. * The last characters of the truncated string are replaced with the omission
  15332. * string which defaults to "...".
  15333. *
  15334. * @static
  15335. * @memberOf _
  15336. * @since 4.0.0
  15337. * @category String
  15338. * @param {string} [string=''] The string to truncate.
  15339. * @param {Object} [options={}] The options object.
  15340. * @param {number} [options.length=30] The maximum string length.
  15341. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15342. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15343. * @returns {string} Returns the truncated string.
  15344. * @example
  15345. *
  15346. * _.truncate('hi-diddly-ho there, neighborino');
  15347. * // => 'hi-diddly-ho there, neighbo...'
  15348. *
  15349. * _.truncate('hi-diddly-ho there, neighborino', {
  15350. * 'length': 24,
  15351. * 'separator': ' '
  15352. * });
  15353. * // => 'hi-diddly-ho there,...'
  15354. *
  15355. * _.truncate('hi-diddly-ho there, neighborino', {
  15356. * 'length': 24,
  15357. * 'separator': /,? +/
  15358. * });
  15359. * // => 'hi-diddly-ho there...'
  15360. *
  15361. * _.truncate('hi-diddly-ho there, neighborino', {
  15362. * 'omission': ' [...]'
  15363. * });
  15364. * // => 'hi-diddly-ho there, neig [...]'
  15365. */
  15366. function truncate(string, options) {
  15367. var length = DEFAULT_TRUNC_LENGTH,
  15368. omission = DEFAULT_TRUNC_OMISSION;
  15369. if (isObject(options)) {
  15370. var separator = 'separator' in options ? options.separator : separator;
  15371. length = 'length' in options ? toInteger(options.length) : length;
  15372. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15373. }
  15374. string = toString(string);
  15375. var strLength = string.length;
  15376. if (hasUnicode(string)) {
  15377. var strSymbols = stringToArray(string);
  15378. strLength = strSymbols.length;
  15379. }
  15380. if (length >= strLength) {
  15381. return string;
  15382. }
  15383. var end = length - stringSize(omission);
  15384. if (end < 1) {
  15385. return omission;
  15386. }
  15387. var result = strSymbols
  15388. ? castSlice(strSymbols, 0, end).join('')
  15389. : string.slice(0, end);
  15390. if (separator === undefined) {
  15391. return result + omission;
  15392. }
  15393. if (strSymbols) {
  15394. end += (result.length - end);
  15395. }
  15396. if (isRegExp(separator)) {
  15397. if (string.slice(end).search(separator)) {
  15398. var match,
  15399. substring = result;
  15400. if (!separator.global) {
  15401. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15402. }
  15403. separator.lastIndex = 0;
  15404. while ((match = separator.exec(substring))) {
  15405. var newEnd = match.index;
  15406. }
  15407. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15408. }
  15409. } else if (string.indexOf(baseToString(separator), end) != end) {
  15410. var index = result.lastIndexOf(separator);
  15411. if (index > -1) {
  15412. result = result.slice(0, index);
  15413. }
  15414. }
  15415. return result + omission;
  15416. }
  15417. /**
  15418. * The inverse of `_.escape`; this method converts the HTML entities
  15419. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15420. * their corresponding characters.
  15421. *
  15422. * **Note:** No other HTML entities are unescaped. To unescape additional
  15423. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15424. *
  15425. * @static
  15426. * @memberOf _
  15427. * @since 0.6.0
  15428. * @category String
  15429. * @param {string} [string=''] The string to unescape.
  15430. * @returns {string} Returns the unescaped string.
  15431. * @example
  15432. *
  15433. * _.unescape('fred, barney, &amp; pebbles');
  15434. * // => 'fred, barney, & pebbles'
  15435. */
  15436. function unescape(string) {
  15437. string = toString(string);
  15438. return (string && reHasEscapedHtml.test(string))
  15439. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15440. : string;
  15441. }
  15442. /**
  15443. * Converts `string`, as space separated words, to upper case.
  15444. *
  15445. * @static
  15446. * @memberOf _
  15447. * @since 4.0.0
  15448. * @category String
  15449. * @param {string} [string=''] The string to convert.
  15450. * @returns {string} Returns the upper cased string.
  15451. * @example
  15452. *
  15453. * _.upperCase('--foo-bar');
  15454. * // => 'FOO BAR'
  15455. *
  15456. * _.upperCase('fooBar');
  15457. * // => 'FOO BAR'
  15458. *
  15459. * _.upperCase('__foo_bar__');
  15460. * // => 'FOO BAR'
  15461. */
  15462. var upperCase = createCompounder(function(result, word, index) {
  15463. return result + (index ? ' ' : '') + word.toUpperCase();
  15464. });
  15465. /**
  15466. * Converts the first character of `string` to upper case.
  15467. *
  15468. * @static
  15469. * @memberOf _
  15470. * @since 4.0.0
  15471. * @category String
  15472. * @param {string} [string=''] The string to convert.
  15473. * @returns {string} Returns the converted string.
  15474. * @example
  15475. *
  15476. * _.upperFirst('fred');
  15477. * // => 'Fred'
  15478. *
  15479. * _.upperFirst('FRED');
  15480. * // => 'FRED'
  15481. */
  15482. var upperFirst = createCaseFirst('toUpperCase');
  15483. /**
  15484. * Splits `string` into an array of its words.
  15485. *
  15486. * @static
  15487. * @memberOf _
  15488. * @since 3.0.0
  15489. * @category String
  15490. * @param {string} [string=''] The string to inspect.
  15491. * @param {RegExp|string} [pattern] The pattern to match words.
  15492. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15493. * @returns {Array} Returns the words of `string`.
  15494. * @example
  15495. *
  15496. * _.words('fred, barney, & pebbles');
  15497. * // => ['fred', 'barney', 'pebbles']
  15498. *
  15499. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15500. * // => ['fred', 'barney', '&', 'pebbles']
  15501. */
  15502. function words(string, pattern, guard) {
  15503. string = toString(string);
  15504. pattern = guard ? undefined : pattern;
  15505. if (pattern === undefined) {
  15506. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15507. }
  15508. return string.match(pattern) || [];
  15509. }
  15510. /*------------------------------------------------------------------------*/
  15511. /**
  15512. * Attempts to invoke `func`, returning either the result or the caught error
  15513. * object. Any additional arguments are provided to `func` when it's invoked.
  15514. *
  15515. * @static
  15516. * @memberOf _
  15517. * @since 3.0.0
  15518. * @category Util
  15519. * @param {Function} func The function to attempt.
  15520. * @param {...*} [args] The arguments to invoke `func` with.
  15521. * @returns {*} Returns the `func` result or error object.
  15522. * @example
  15523. *
  15524. * // Avoid throwing errors for invalid selectors.
  15525. * var elements = _.attempt(function(selector) {
  15526. * return document.querySelectorAll(selector);
  15527. * }, '>_>');
  15528. *
  15529. * if (_.isError(elements)) {
  15530. * elements = [];
  15531. * }
  15532. */
  15533. var attempt = baseRest(function(func, args) {
  15534. try {
  15535. return apply(func, undefined, args);
  15536. } catch (e) {
  15537. return isError(e) ? e : new Error(e);
  15538. }
  15539. });
  15540. /**
  15541. * Binds methods of an object to the object itself, overwriting the existing
  15542. * method.
  15543. *
  15544. * **Note:** This method doesn't set the "length" property of bound functions.
  15545. *
  15546. * @static
  15547. * @since 0.1.0
  15548. * @memberOf _
  15549. * @category Util
  15550. * @param {Object} object The object to bind and assign the bound methods to.
  15551. * @param {...(string|string[])} methodNames The object method names to bind.
  15552. * @returns {Object} Returns `object`.
  15553. * @example
  15554. *
  15555. * var view = {
  15556. * 'label': 'docs',
  15557. * 'click': function() {
  15558. * console.log('clicked ' + this.label);
  15559. * }
  15560. * };
  15561. *
  15562. * _.bindAll(view, ['click']);
  15563. * jQuery(element).on('click', view.click);
  15564. * // => Logs 'clicked docs' when clicked.
  15565. */
  15566. var bindAll = flatRest(function(object, methodNames) {
  15567. arrayEach(methodNames, function(key) {
  15568. key = toKey(key);
  15569. baseAssignValue(object, key, bind(object[key], object));
  15570. });
  15571. return object;
  15572. });
  15573. /**
  15574. * Creates a function that iterates over `pairs` and invokes the corresponding
  15575. * function of the first predicate to return truthy. The predicate-function
  15576. * pairs are invoked with the `this` binding and arguments of the created
  15577. * function.
  15578. *
  15579. * @static
  15580. * @memberOf _
  15581. * @since 4.0.0
  15582. * @category Util
  15583. * @param {Array} pairs The predicate-function pairs.
  15584. * @returns {Function} Returns the new composite function.
  15585. * @example
  15586. *
  15587. * var func = _.cond([
  15588. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15589. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15590. * [_.stubTrue, _.constant('no match')]
  15591. * ]);
  15592. *
  15593. * func({ 'a': 1, 'b': 2 });
  15594. * // => 'matches A'
  15595. *
  15596. * func({ 'a': 0, 'b': 1 });
  15597. * // => 'matches B'
  15598. *
  15599. * func({ 'a': '1', 'b': '2' });
  15600. * // => 'no match'
  15601. */
  15602. function cond(pairs) {
  15603. var length = pairs == null ? 0 : pairs.length,
  15604. toIteratee = getIteratee();
  15605. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15606. if (typeof pair[1] != 'function') {
  15607. throw new TypeError(FUNC_ERROR_TEXT);
  15608. }
  15609. return [toIteratee(pair[0]), pair[1]];
  15610. });
  15611. return baseRest(function(args) {
  15612. var index = -1;
  15613. while (++index < length) {
  15614. var pair = pairs[index];
  15615. if (apply(pair[0], this, args)) {
  15616. return apply(pair[1], this, args);
  15617. }
  15618. }
  15619. });
  15620. }
  15621. /**
  15622. * Creates a function that invokes the predicate properties of `source` with
  15623. * the corresponding property values of a given object, returning `true` if
  15624. * all predicates return truthy, else `false`.
  15625. *
  15626. * **Note:** The created function is equivalent to `_.conformsTo` with
  15627. * `source` partially applied.
  15628. *
  15629. * @static
  15630. * @memberOf _
  15631. * @since 4.0.0
  15632. * @category Util
  15633. * @param {Object} source The object of property predicates to conform to.
  15634. * @returns {Function} Returns the new spec function.
  15635. * @example
  15636. *
  15637. * var objects = [
  15638. * { 'a': 2, 'b': 1 },
  15639. * { 'a': 1, 'b': 2 }
  15640. * ];
  15641. *
  15642. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15643. * // => [{ 'a': 1, 'b': 2 }]
  15644. */
  15645. function conforms(source) {
  15646. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15647. }
  15648. /**
  15649. * Creates a function that returns `value`.
  15650. *
  15651. * @static
  15652. * @memberOf _
  15653. * @since 2.4.0
  15654. * @category Util
  15655. * @param {*} value The value to return from the new function.
  15656. * @returns {Function} Returns the new constant function.
  15657. * @example
  15658. *
  15659. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15660. *
  15661. * console.log(objects);
  15662. * // => [{ 'a': 1 }, { 'a': 1 }]
  15663. *
  15664. * console.log(objects[0] === objects[1]);
  15665. * // => true
  15666. */
  15667. function constant(value) {
  15668. return function() {
  15669. return value;
  15670. };
  15671. }
  15672. /**
  15673. * Checks `value` to determine whether a default value should be returned in
  15674. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15675. * or `undefined`.
  15676. *
  15677. * @static
  15678. * @memberOf _
  15679. * @since 4.14.0
  15680. * @category Util
  15681. * @param {*} value The value to check.
  15682. * @param {*} defaultValue The default value.
  15683. * @returns {*} Returns the resolved value.
  15684. * @example
  15685. *
  15686. * _.defaultTo(1, 10);
  15687. * // => 1
  15688. *
  15689. * _.defaultTo(undefined, 10);
  15690. * // => 10
  15691. */
  15692. function defaultTo(value, defaultValue) {
  15693. return (value == null || value !== value) ? defaultValue : value;
  15694. }
  15695. /**
  15696. * Creates a function that returns the result of invoking the given functions
  15697. * with the `this` binding of the created function, where each successive
  15698. * invocation is supplied the return value of the previous.
  15699. *
  15700. * @static
  15701. * @memberOf _
  15702. * @since 3.0.0
  15703. * @category Util
  15704. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15705. * @returns {Function} Returns the new composite function.
  15706. * @see _.flowRight
  15707. * @example
  15708. *
  15709. * function square(n) {
  15710. * return n * n;
  15711. * }
  15712. *
  15713. * var addSquare = _.flow([_.add, square]);
  15714. * addSquare(1, 2);
  15715. * // => 9
  15716. */
  15717. var flow = createFlow();
  15718. /**
  15719. * This method is like `_.flow` except that it creates a function that
  15720. * invokes the given functions from right to left.
  15721. *
  15722. * @static
  15723. * @since 3.0.0
  15724. * @memberOf _
  15725. * @category Util
  15726. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15727. * @returns {Function} Returns the new composite function.
  15728. * @see _.flow
  15729. * @example
  15730. *
  15731. * function square(n) {
  15732. * return n * n;
  15733. * }
  15734. *
  15735. * var addSquare = _.flowRight([square, _.add]);
  15736. * addSquare(1, 2);
  15737. * // => 9
  15738. */
  15739. var flowRight = createFlow(true);
  15740. /**
  15741. * This method returns the first argument it receives.
  15742. *
  15743. * @static
  15744. * @since 0.1.0
  15745. * @memberOf _
  15746. * @category Util
  15747. * @param {*} value Any value.
  15748. * @returns {*} Returns `value`.
  15749. * @example
  15750. *
  15751. * var object = { 'a': 1 };
  15752. *
  15753. * console.log(_.identity(object) === object);
  15754. * // => true
  15755. */
  15756. function identity(value) {
  15757. return value;
  15758. }
  15759. /**
  15760. * Creates a function that invokes `func` with the arguments of the created
  15761. * function. If `func` is a property name, the created function returns the
  15762. * property value for a given element. If `func` is an array or object, the
  15763. * created function returns `true` for elements that contain the equivalent
  15764. * source properties, otherwise it returns `false`.
  15765. *
  15766. * @static
  15767. * @since 4.0.0
  15768. * @memberOf _
  15769. * @category Util
  15770. * @param {*} [func=_.identity] The value to convert to a callback.
  15771. * @returns {Function} Returns the callback.
  15772. * @example
  15773. *
  15774. * var users = [
  15775. * { 'user': 'barney', 'age': 36, 'active': true },
  15776. * { 'user': 'fred', 'age': 40, 'active': false }
  15777. * ];
  15778. *
  15779. * // The `_.matches` iteratee shorthand.
  15780. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15781. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15782. *
  15783. * // The `_.matchesProperty` iteratee shorthand.
  15784. * _.filter(users, _.iteratee(['user', 'fred']));
  15785. * // => [{ 'user': 'fred', 'age': 40 }]
  15786. *
  15787. * // The `_.property` iteratee shorthand.
  15788. * _.map(users, _.iteratee('user'));
  15789. * // => ['barney', 'fred']
  15790. *
  15791. * // Create custom iteratee shorthands.
  15792. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15793. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15794. * return func.test(string);
  15795. * };
  15796. * });
  15797. *
  15798. * _.filter(['abc', 'def'], /ef/);
  15799. * // => ['def']
  15800. */
  15801. function iteratee(func) {
  15802. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15803. }
  15804. /**
  15805. * Creates a function that performs a partial deep comparison between a given
  15806. * object and `source`, returning `true` if the given object has equivalent
  15807. * property values, else `false`.
  15808. *
  15809. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15810. * partially applied.
  15811. *
  15812. * Partial comparisons will match empty array and empty object `source`
  15813. * values against any array or object value, respectively. See `_.isEqual`
  15814. * for a list of supported value comparisons.
  15815. *
  15816. * **Note:** Multiple values can be checked by combining several matchers
  15817. * using `_.overSome`
  15818. *
  15819. * @static
  15820. * @memberOf _
  15821. * @since 3.0.0
  15822. * @category Util
  15823. * @param {Object} source The object of property values to match.
  15824. * @returns {Function} Returns the new spec function.
  15825. * @example
  15826. *
  15827. * var objects = [
  15828. * { 'a': 1, 'b': 2, 'c': 3 },
  15829. * { 'a': 4, 'b': 5, 'c': 6 }
  15830. * ];
  15831. *
  15832. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15833. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15834. *
  15835. * // Checking for several possible values
  15836. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15837. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15838. */
  15839. function matches(source) {
  15840. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15841. }
  15842. /**
  15843. * Creates a function that performs a partial deep comparison between the
  15844. * value at `path` of a given object to `srcValue`, returning `true` if the
  15845. * object value is equivalent, else `false`.
  15846. *
  15847. * **Note:** Partial comparisons will match empty array and empty object
  15848. * `srcValue` values against any array or object value, respectively. See
  15849. * `_.isEqual` for a list of supported value comparisons.
  15850. *
  15851. * **Note:** Multiple values can be checked by combining several matchers
  15852. * using `_.overSome`
  15853. *
  15854. * @static
  15855. * @memberOf _
  15856. * @since 3.2.0
  15857. * @category Util
  15858. * @param {Array|string} path The path of the property to get.
  15859. * @param {*} srcValue The value to match.
  15860. * @returns {Function} Returns the new spec function.
  15861. * @example
  15862. *
  15863. * var objects = [
  15864. * { 'a': 1, 'b': 2, 'c': 3 },
  15865. * { 'a': 4, 'b': 5, 'c': 6 }
  15866. * ];
  15867. *
  15868. * _.find(objects, _.matchesProperty('a', 4));
  15869. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15870. *
  15871. * // Checking for several possible values
  15872. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15873. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15874. */
  15875. function matchesProperty(path, srcValue) {
  15876. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15877. }
  15878. /**
  15879. * Creates a function that invokes the method at `path` of a given object.
  15880. * Any additional arguments are provided to the invoked method.
  15881. *
  15882. * @static
  15883. * @memberOf _
  15884. * @since 3.7.0
  15885. * @category Util
  15886. * @param {Array|string} path The path of the method to invoke.
  15887. * @param {...*} [args] The arguments to invoke the method with.
  15888. * @returns {Function} Returns the new invoker function.
  15889. * @example
  15890. *
  15891. * var objects = [
  15892. * { 'a': { 'b': _.constant(2) } },
  15893. * { 'a': { 'b': _.constant(1) } }
  15894. * ];
  15895. *
  15896. * _.map(objects, _.method('a.b'));
  15897. * // => [2, 1]
  15898. *
  15899. * _.map(objects, _.method(['a', 'b']));
  15900. * // => [2, 1]
  15901. */
  15902. var method = baseRest(function(path, args) {
  15903. return function(object) {
  15904. return baseInvoke(object, path, args);
  15905. };
  15906. });
  15907. /**
  15908. * The opposite of `_.method`; this method creates a function that invokes
  15909. * the method at a given path of `object`. Any additional arguments are
  15910. * provided to the invoked method.
  15911. *
  15912. * @static
  15913. * @memberOf _
  15914. * @since 3.7.0
  15915. * @category Util
  15916. * @param {Object} object The object to query.
  15917. * @param {...*} [args] The arguments to invoke the method with.
  15918. * @returns {Function} Returns the new invoker function.
  15919. * @example
  15920. *
  15921. * var array = _.times(3, _.constant),
  15922. * object = { 'a': array, 'b': array, 'c': array };
  15923. *
  15924. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15925. * // => [2, 0]
  15926. *
  15927. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15928. * // => [2, 0]
  15929. */
  15930. var methodOf = baseRest(function(object, args) {
  15931. return function(path) {
  15932. return baseInvoke(object, path, args);
  15933. };
  15934. });
  15935. /**
  15936. * Adds all own enumerable string keyed function properties of a source
  15937. * object to the destination object. If `object` is a function, then methods
  15938. * are added to its prototype as well.
  15939. *
  15940. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15941. * avoid conflicts caused by modifying the original.
  15942. *
  15943. * @static
  15944. * @since 0.1.0
  15945. * @memberOf _
  15946. * @category Util
  15947. * @param {Function|Object} [object=lodash] The destination object.
  15948. * @param {Object} source The object of functions to add.
  15949. * @param {Object} [options={}] The options object.
  15950. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15951. * @returns {Function|Object} Returns `object`.
  15952. * @example
  15953. *
  15954. * function vowels(string) {
  15955. * return _.filter(string, function(v) {
  15956. * return /[aeiou]/i.test(v);
  15957. * });
  15958. * }
  15959. *
  15960. * _.mixin({ 'vowels': vowels });
  15961. * _.vowels('fred');
  15962. * // => ['e']
  15963. *
  15964. * _('fred').vowels().value();
  15965. * // => ['e']
  15966. *
  15967. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15968. * _('fred').vowels();
  15969. * // => ['e']
  15970. */
  15971. function mixin(object, source, options) {
  15972. var props = keys(source),
  15973. methodNames = baseFunctions(source, props);
  15974. if (options == null &&
  15975. !(isObject(source) && (methodNames.length || !props.length))) {
  15976. options = source;
  15977. source = object;
  15978. object = this;
  15979. methodNames = baseFunctions(source, keys(source));
  15980. }
  15981. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15982. isFunc = isFunction(object);
  15983. arrayEach(methodNames, function(methodName) {
  15984. var func = source[methodName];
  15985. object[methodName] = func;
  15986. if (isFunc) {
  15987. object.prototype[methodName] = function() {
  15988. var chainAll = this.__chain__;
  15989. if (chain || chainAll) {
  15990. var result = object(this.__wrapped__),
  15991. actions = result.__actions__ = copyArray(this.__actions__);
  15992. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15993. result.__chain__ = chainAll;
  15994. return result;
  15995. }
  15996. return func.apply(object, arrayPush([this.value()], arguments));
  15997. };
  15998. }
  15999. });
  16000. return object;
  16001. }
  16002. /**
  16003. * Reverts the `_` variable to its previous value and returns a reference to
  16004. * the `lodash` function.
  16005. *
  16006. * @static
  16007. * @since 0.1.0
  16008. * @memberOf _
  16009. * @category Util
  16010. * @returns {Function} Returns the `lodash` function.
  16011. * @example
  16012. *
  16013. * var lodash = _.noConflict();
  16014. */
  16015. function noConflict() {
  16016. if (root._ === this) {
  16017. root._ = oldDash;
  16018. }
  16019. return this;
  16020. }
  16021. /**
  16022. * This method returns `undefined`.
  16023. *
  16024. * @static
  16025. * @memberOf _
  16026. * @since 2.3.0
  16027. * @category Util
  16028. * @example
  16029. *
  16030. * _.times(2, _.noop);
  16031. * // => [undefined, undefined]
  16032. */
  16033. function noop() {
  16034. // No operation performed.
  16035. }
  16036. /**
  16037. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16038. * the nth argument from the end is returned.
  16039. *
  16040. * @static
  16041. * @memberOf _
  16042. * @since 4.0.0
  16043. * @category Util
  16044. * @param {number} [n=0] The index of the argument to return.
  16045. * @returns {Function} Returns the new pass-thru function.
  16046. * @example
  16047. *
  16048. * var func = _.nthArg(1);
  16049. * func('a', 'b', 'c', 'd');
  16050. * // => 'b'
  16051. *
  16052. * var func = _.nthArg(-2);
  16053. * func('a', 'b', 'c', 'd');
  16054. * // => 'c'
  16055. */
  16056. function nthArg(n) {
  16057. n = toInteger(n);
  16058. return baseRest(function(args) {
  16059. return baseNth(args, n);
  16060. });
  16061. }
  16062. /**
  16063. * Creates a function that invokes `iteratees` with the arguments it receives
  16064. * and returns their results.
  16065. *
  16066. * @static
  16067. * @memberOf _
  16068. * @since 4.0.0
  16069. * @category Util
  16070. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16071. * The iteratees to invoke.
  16072. * @returns {Function} Returns the new function.
  16073. * @example
  16074. *
  16075. * var func = _.over([Math.max, Math.min]);
  16076. *
  16077. * func(1, 2, 3, 4);
  16078. * // => [4, 1]
  16079. */
  16080. var over = createOver(arrayMap);
  16081. /**
  16082. * Creates a function that checks if **all** of the `predicates` return
  16083. * truthy when invoked with the arguments it receives.
  16084. *
  16085. * Following shorthands are possible for providing predicates.
  16086. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16087. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16088. *
  16089. * @static
  16090. * @memberOf _
  16091. * @since 4.0.0
  16092. * @category Util
  16093. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16094. * The predicates to check.
  16095. * @returns {Function} Returns the new function.
  16096. * @example
  16097. *
  16098. * var func = _.overEvery([Boolean, isFinite]);
  16099. *
  16100. * func('1');
  16101. * // => true
  16102. *
  16103. * func(null);
  16104. * // => false
  16105. *
  16106. * func(NaN);
  16107. * // => false
  16108. */
  16109. var overEvery = createOver(arrayEvery);
  16110. /**
  16111. * Creates a function that checks if **any** of the `predicates` return
  16112. * truthy when invoked with the arguments it receives.
  16113. *
  16114. * Following shorthands are possible for providing predicates.
  16115. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16116. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16117. *
  16118. * @static
  16119. * @memberOf _
  16120. * @since 4.0.0
  16121. * @category Util
  16122. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16123. * The predicates to check.
  16124. * @returns {Function} Returns the new function.
  16125. * @example
  16126. *
  16127. * var func = _.overSome([Boolean, isFinite]);
  16128. *
  16129. * func('1');
  16130. * // => true
  16131. *
  16132. * func(null);
  16133. * // => true
  16134. *
  16135. * func(NaN);
  16136. * // => false
  16137. *
  16138. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16139. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16140. */
  16141. var overSome = createOver(arraySome);
  16142. /**
  16143. * Creates a function that returns the value at `path` of a given object.
  16144. *
  16145. * @static
  16146. * @memberOf _
  16147. * @since 2.4.0
  16148. * @category Util
  16149. * @param {Array|string} path The path of the property to get.
  16150. * @returns {Function} Returns the new accessor function.
  16151. * @example
  16152. *
  16153. * var objects = [
  16154. * { 'a': { 'b': 2 } },
  16155. * { 'a': { 'b': 1 } }
  16156. * ];
  16157. *
  16158. * _.map(objects, _.property('a.b'));
  16159. * // => [2, 1]
  16160. *
  16161. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16162. * // => [1, 2]
  16163. */
  16164. function property(path) {
  16165. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16166. }
  16167. /**
  16168. * The opposite of `_.property`; this method creates a function that returns
  16169. * the value at a given path of `object`.
  16170. *
  16171. * @static
  16172. * @memberOf _
  16173. * @since 3.0.0
  16174. * @category Util
  16175. * @param {Object} object The object to query.
  16176. * @returns {Function} Returns the new accessor function.
  16177. * @example
  16178. *
  16179. * var array = [0, 1, 2],
  16180. * object = { 'a': array, 'b': array, 'c': array };
  16181. *
  16182. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16183. * // => [2, 0]
  16184. *
  16185. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16186. * // => [2, 0]
  16187. */
  16188. function propertyOf(object) {
  16189. return function(path) {
  16190. return object == null ? undefined : baseGet(object, path);
  16191. };
  16192. }
  16193. /**
  16194. * Creates an array of numbers (positive and/or negative) progressing from
  16195. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16196. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16197. * it's set to `start` with `start` then set to `0`.
  16198. *
  16199. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16200. * floating-point values which can produce unexpected results.
  16201. *
  16202. * @static
  16203. * @since 0.1.0
  16204. * @memberOf _
  16205. * @category Util
  16206. * @param {number} [start=0] The start of the range.
  16207. * @param {number} end The end of the range.
  16208. * @param {number} [step=1] The value to increment or decrement by.
  16209. * @returns {Array} Returns the range of numbers.
  16210. * @see _.inRange, _.rangeRight
  16211. * @example
  16212. *
  16213. * _.range(4);
  16214. * // => [0, 1, 2, 3]
  16215. *
  16216. * _.range(-4);
  16217. * // => [0, -1, -2, -3]
  16218. *
  16219. * _.range(1, 5);
  16220. * // => [1, 2, 3, 4]
  16221. *
  16222. * _.range(0, 20, 5);
  16223. * // => [0, 5, 10, 15]
  16224. *
  16225. * _.range(0, -4, -1);
  16226. * // => [0, -1, -2, -3]
  16227. *
  16228. * _.range(1, 4, 0);
  16229. * // => [1, 1, 1]
  16230. *
  16231. * _.range(0);
  16232. * // => []
  16233. */
  16234. var range = createRange();
  16235. /**
  16236. * This method is like `_.range` except that it populates values in
  16237. * descending order.
  16238. *
  16239. * @static
  16240. * @memberOf _
  16241. * @since 4.0.0
  16242. * @category Util
  16243. * @param {number} [start=0] The start of the range.
  16244. * @param {number} end The end of the range.
  16245. * @param {number} [step=1] The value to increment or decrement by.
  16246. * @returns {Array} Returns the range of numbers.
  16247. * @see _.inRange, _.range
  16248. * @example
  16249. *
  16250. * _.rangeRight(4);
  16251. * // => [3, 2, 1, 0]
  16252. *
  16253. * _.rangeRight(-4);
  16254. * // => [-3, -2, -1, 0]
  16255. *
  16256. * _.rangeRight(1, 5);
  16257. * // => [4, 3, 2, 1]
  16258. *
  16259. * _.rangeRight(0, 20, 5);
  16260. * // => [15, 10, 5, 0]
  16261. *
  16262. * _.rangeRight(0, -4, -1);
  16263. * // => [-3, -2, -1, 0]
  16264. *
  16265. * _.rangeRight(1, 4, 0);
  16266. * // => [1, 1, 1]
  16267. *
  16268. * _.rangeRight(0);
  16269. * // => []
  16270. */
  16271. var rangeRight = createRange(true);
  16272. /**
  16273. * This method returns a new empty array.
  16274. *
  16275. * @static
  16276. * @memberOf _
  16277. * @since 4.13.0
  16278. * @category Util
  16279. * @returns {Array} Returns the new empty array.
  16280. * @example
  16281. *
  16282. * var arrays = _.times(2, _.stubArray);
  16283. *
  16284. * console.log(arrays);
  16285. * // => [[], []]
  16286. *
  16287. * console.log(arrays[0] === arrays[1]);
  16288. * // => false
  16289. */
  16290. function stubArray() {
  16291. return [];
  16292. }
  16293. /**
  16294. * This method returns `false`.
  16295. *
  16296. * @static
  16297. * @memberOf _
  16298. * @since 4.13.0
  16299. * @category Util
  16300. * @returns {boolean} Returns `false`.
  16301. * @example
  16302. *
  16303. * _.times(2, _.stubFalse);
  16304. * // => [false, false]
  16305. */
  16306. function stubFalse() {
  16307. return false;
  16308. }
  16309. /**
  16310. * This method returns a new empty object.
  16311. *
  16312. * @static
  16313. * @memberOf _
  16314. * @since 4.13.0
  16315. * @category Util
  16316. * @returns {Object} Returns the new empty object.
  16317. * @example
  16318. *
  16319. * var objects = _.times(2, _.stubObject);
  16320. *
  16321. * console.log(objects);
  16322. * // => [{}, {}]
  16323. *
  16324. * console.log(objects[0] === objects[1]);
  16325. * // => false
  16326. */
  16327. function stubObject() {
  16328. return {};
  16329. }
  16330. /**
  16331. * This method returns an empty string.
  16332. *
  16333. * @static
  16334. * @memberOf _
  16335. * @since 4.13.0
  16336. * @category Util
  16337. * @returns {string} Returns the empty string.
  16338. * @example
  16339. *
  16340. * _.times(2, _.stubString);
  16341. * // => ['', '']
  16342. */
  16343. function stubString() {
  16344. return '';
  16345. }
  16346. /**
  16347. * This method returns `true`.
  16348. *
  16349. * @static
  16350. * @memberOf _
  16351. * @since 4.13.0
  16352. * @category Util
  16353. * @returns {boolean} Returns `true`.
  16354. * @example
  16355. *
  16356. * _.times(2, _.stubTrue);
  16357. * // => [true, true]
  16358. */
  16359. function stubTrue() {
  16360. return true;
  16361. }
  16362. /**
  16363. * Invokes the iteratee `n` times, returning an array of the results of
  16364. * each invocation. The iteratee is invoked with one argument; (index).
  16365. *
  16366. * @static
  16367. * @since 0.1.0
  16368. * @memberOf _
  16369. * @category Util
  16370. * @param {number} n The number of times to invoke `iteratee`.
  16371. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16372. * @returns {Array} Returns the array of results.
  16373. * @example
  16374. *
  16375. * _.times(3, String);
  16376. * // => ['0', '1', '2']
  16377. *
  16378. * _.times(4, _.constant(0));
  16379. * // => [0, 0, 0, 0]
  16380. */
  16381. function times(n, iteratee) {
  16382. n = toInteger(n);
  16383. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16384. return [];
  16385. }
  16386. var index = MAX_ARRAY_LENGTH,
  16387. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16388. iteratee = getIteratee(iteratee);
  16389. n -= MAX_ARRAY_LENGTH;
  16390. var result = baseTimes(length, iteratee);
  16391. while (++index < n) {
  16392. iteratee(index);
  16393. }
  16394. return result;
  16395. }
  16396. /**
  16397. * Converts `value` to a property path array.
  16398. *
  16399. * @static
  16400. * @memberOf _
  16401. * @since 4.0.0
  16402. * @category Util
  16403. * @param {*} value The value to convert.
  16404. * @returns {Array} Returns the new property path array.
  16405. * @example
  16406. *
  16407. * _.toPath('a.b.c');
  16408. * // => ['a', 'b', 'c']
  16409. *
  16410. * _.toPath('a[0].b.c');
  16411. * // => ['a', '0', 'b', 'c']
  16412. */
  16413. function toPath(value) {
  16414. if (isArray(value)) {
  16415. return arrayMap(value, toKey);
  16416. }
  16417. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16418. }
  16419. /**
  16420. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16421. *
  16422. * @static
  16423. * @since 0.1.0
  16424. * @memberOf _
  16425. * @category Util
  16426. * @param {string} [prefix=''] The value to prefix the ID with.
  16427. * @returns {string} Returns the unique ID.
  16428. * @example
  16429. *
  16430. * _.uniqueId('contact_');
  16431. * // => 'contact_104'
  16432. *
  16433. * _.uniqueId();
  16434. * // => '105'
  16435. */
  16436. function uniqueId(prefix) {
  16437. var id = ++idCounter;
  16438. return toString(prefix) + id;
  16439. }
  16440. /*------------------------------------------------------------------------*/
  16441. /**
  16442. * Adds two numbers.
  16443. *
  16444. * @static
  16445. * @memberOf _
  16446. * @since 3.4.0
  16447. * @category Math
  16448. * @param {number} augend The first number in an addition.
  16449. * @param {number} addend The second number in an addition.
  16450. * @returns {number} Returns the total.
  16451. * @example
  16452. *
  16453. * _.add(6, 4);
  16454. * // => 10
  16455. */
  16456. var add = createMathOperation(function(augend, addend) {
  16457. return augend + addend;
  16458. }, 0);
  16459. /**
  16460. * Computes `number` rounded up to `precision`.
  16461. *
  16462. * @static
  16463. * @memberOf _
  16464. * @since 3.10.0
  16465. * @category Math
  16466. * @param {number} number The number to round up.
  16467. * @param {number} [precision=0] The precision to round up to.
  16468. * @returns {number} Returns the rounded up number.
  16469. * @example
  16470. *
  16471. * _.ceil(4.006);
  16472. * // => 5
  16473. *
  16474. * _.ceil(6.004, 2);
  16475. * // => 6.01
  16476. *
  16477. * _.ceil(6040, -2);
  16478. * // => 6100
  16479. */
  16480. var ceil = createRound('ceil');
  16481. /**
  16482. * Divide two numbers.
  16483. *
  16484. * @static
  16485. * @memberOf _
  16486. * @since 4.7.0
  16487. * @category Math
  16488. * @param {number} dividend The first number in a division.
  16489. * @param {number} divisor The second number in a division.
  16490. * @returns {number} Returns the quotient.
  16491. * @example
  16492. *
  16493. * _.divide(6, 4);
  16494. * // => 1.5
  16495. */
  16496. var divide = createMathOperation(function(dividend, divisor) {
  16497. return dividend / divisor;
  16498. }, 1);
  16499. /**
  16500. * Computes `number` rounded down to `precision`.
  16501. *
  16502. * @static
  16503. * @memberOf _
  16504. * @since 3.10.0
  16505. * @category Math
  16506. * @param {number} number The number to round down.
  16507. * @param {number} [precision=0] The precision to round down to.
  16508. * @returns {number} Returns the rounded down number.
  16509. * @example
  16510. *
  16511. * _.floor(4.006);
  16512. * // => 4
  16513. *
  16514. * _.floor(0.046, 2);
  16515. * // => 0.04
  16516. *
  16517. * _.floor(4060, -2);
  16518. * // => 4000
  16519. */
  16520. var floor = createRound('floor');
  16521. /**
  16522. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16523. * `undefined` is returned.
  16524. *
  16525. * @static
  16526. * @since 0.1.0
  16527. * @memberOf _
  16528. * @category Math
  16529. * @param {Array} array The array to iterate over.
  16530. * @returns {*} Returns the maximum value.
  16531. * @example
  16532. *
  16533. * _.max([4, 2, 8, 6]);
  16534. * // => 8
  16535. *
  16536. * _.max([]);
  16537. * // => undefined
  16538. */
  16539. function max(array) {
  16540. return (array && array.length)
  16541. ? baseExtremum(array, identity, baseGt)
  16542. : undefined;
  16543. }
  16544. /**
  16545. * This method is like `_.max` except that it accepts `iteratee` which is
  16546. * invoked for each element in `array` to generate the criterion by which
  16547. * the value is ranked. The iteratee is invoked with one argument: (value).
  16548. *
  16549. * @static
  16550. * @memberOf _
  16551. * @since 4.0.0
  16552. * @category Math
  16553. * @param {Array} array The array to iterate over.
  16554. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16555. * @returns {*} Returns the maximum value.
  16556. * @example
  16557. *
  16558. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16559. *
  16560. * _.maxBy(objects, function(o) { return o.n; });
  16561. * // => { 'n': 2 }
  16562. *
  16563. * // The `_.property` iteratee shorthand.
  16564. * _.maxBy(objects, 'n');
  16565. * // => { 'n': 2 }
  16566. */
  16567. function maxBy(array, iteratee) {
  16568. return (array && array.length)
  16569. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16570. : undefined;
  16571. }
  16572. /**
  16573. * Computes the mean of the values in `array`.
  16574. *
  16575. * @static
  16576. * @memberOf _
  16577. * @since 4.0.0
  16578. * @category Math
  16579. * @param {Array} array The array to iterate over.
  16580. * @returns {number} Returns the mean.
  16581. * @example
  16582. *
  16583. * _.mean([4, 2, 8, 6]);
  16584. * // => 5
  16585. */
  16586. function mean(array) {
  16587. return baseMean(array, identity);
  16588. }
  16589. /**
  16590. * This method is like `_.mean` except that it accepts `iteratee` which is
  16591. * invoked for each element in `array` to generate the value to be averaged.
  16592. * The iteratee is invoked with one argument: (value).
  16593. *
  16594. * @static
  16595. * @memberOf _
  16596. * @since 4.7.0
  16597. * @category Math
  16598. * @param {Array} array The array to iterate over.
  16599. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16600. * @returns {number} Returns the mean.
  16601. * @example
  16602. *
  16603. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16604. *
  16605. * _.meanBy(objects, function(o) { return o.n; });
  16606. * // => 5
  16607. *
  16608. * // The `_.property` iteratee shorthand.
  16609. * _.meanBy(objects, 'n');
  16610. * // => 5
  16611. */
  16612. function meanBy(array, iteratee) {
  16613. return baseMean(array, getIteratee(iteratee, 2));
  16614. }
  16615. /**
  16616. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16617. * `undefined` is returned.
  16618. *
  16619. * @static
  16620. * @since 0.1.0
  16621. * @memberOf _
  16622. * @category Math
  16623. * @param {Array} array The array to iterate over.
  16624. * @returns {*} Returns the minimum value.
  16625. * @example
  16626. *
  16627. * _.min([4, 2, 8, 6]);
  16628. * // => 2
  16629. *
  16630. * _.min([]);
  16631. * // => undefined
  16632. */
  16633. function min(array) {
  16634. return (array && array.length)
  16635. ? baseExtremum(array, identity, baseLt)
  16636. : undefined;
  16637. }
  16638. /**
  16639. * This method is like `_.min` except that it accepts `iteratee` which is
  16640. * invoked for each element in `array` to generate the criterion by which
  16641. * the value is ranked. The iteratee is invoked with one argument: (value).
  16642. *
  16643. * @static
  16644. * @memberOf _
  16645. * @since 4.0.0
  16646. * @category Math
  16647. * @param {Array} array The array to iterate over.
  16648. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16649. * @returns {*} Returns the minimum value.
  16650. * @example
  16651. *
  16652. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16653. *
  16654. * _.minBy(objects, function(o) { return o.n; });
  16655. * // => { 'n': 1 }
  16656. *
  16657. * // The `_.property` iteratee shorthand.
  16658. * _.minBy(objects, 'n');
  16659. * // => { 'n': 1 }
  16660. */
  16661. function minBy(array, iteratee) {
  16662. return (array && array.length)
  16663. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16664. : undefined;
  16665. }
  16666. /**
  16667. * Multiply two numbers.
  16668. *
  16669. * @static
  16670. * @memberOf _
  16671. * @since 4.7.0
  16672. * @category Math
  16673. * @param {number} multiplier The first number in a multiplication.
  16674. * @param {number} multiplicand The second number in a multiplication.
  16675. * @returns {number} Returns the product.
  16676. * @example
  16677. *
  16678. * _.multiply(6, 4);
  16679. * // => 24
  16680. */
  16681. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16682. return multiplier * multiplicand;
  16683. }, 1);
  16684. /**
  16685. * Computes `number` rounded to `precision`.
  16686. *
  16687. * @static
  16688. * @memberOf _
  16689. * @since 3.10.0
  16690. * @category Math
  16691. * @param {number} number The number to round.
  16692. * @param {number} [precision=0] The precision to round to.
  16693. * @returns {number} Returns the rounded number.
  16694. * @example
  16695. *
  16696. * _.round(4.006);
  16697. * // => 4
  16698. *
  16699. * _.round(4.006, 2);
  16700. * // => 4.01
  16701. *
  16702. * _.round(4060, -2);
  16703. * // => 4100
  16704. */
  16705. var round = createRound('round');
  16706. /**
  16707. * Subtract two numbers.
  16708. *
  16709. * @static
  16710. * @memberOf _
  16711. * @since 4.0.0
  16712. * @category Math
  16713. * @param {number} minuend The first number in a subtraction.
  16714. * @param {number} subtrahend The second number in a subtraction.
  16715. * @returns {number} Returns the difference.
  16716. * @example
  16717. *
  16718. * _.subtract(6, 4);
  16719. * // => 2
  16720. */
  16721. var subtract = createMathOperation(function(minuend, subtrahend) {
  16722. return minuend - subtrahend;
  16723. }, 0);
  16724. /**
  16725. * Computes the sum of the values in `array`.
  16726. *
  16727. * @static
  16728. * @memberOf _
  16729. * @since 3.4.0
  16730. * @category Math
  16731. * @param {Array} array The array to iterate over.
  16732. * @returns {number} Returns the sum.
  16733. * @example
  16734. *
  16735. * _.sum([4, 2, 8, 6]);
  16736. * // => 20
  16737. */
  16738. function sum(array) {
  16739. return (array && array.length)
  16740. ? baseSum(array, identity)
  16741. : 0;
  16742. }
  16743. /**
  16744. * This method is like `_.sum` except that it accepts `iteratee` which is
  16745. * invoked for each element in `array` to generate the value to be summed.
  16746. * The iteratee is invoked with one argument: (value).
  16747. *
  16748. * @static
  16749. * @memberOf _
  16750. * @since 4.0.0
  16751. * @category Math
  16752. * @param {Array} array The array to iterate over.
  16753. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16754. * @returns {number} Returns the sum.
  16755. * @example
  16756. *
  16757. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16758. *
  16759. * _.sumBy(objects, function(o) { return o.n; });
  16760. * // => 20
  16761. *
  16762. * // The `_.property` iteratee shorthand.
  16763. * _.sumBy(objects, 'n');
  16764. * // => 20
  16765. */
  16766. function sumBy(array, iteratee) {
  16767. return (array && array.length)
  16768. ? baseSum(array, getIteratee(iteratee, 2))
  16769. : 0;
  16770. }
  16771. /*------------------------------------------------------------------------*/
  16772. // Add methods that return wrapped values in chain sequences.
  16773. lodash.after = after;
  16774. lodash.ary = ary;
  16775. lodash.assign = assign;
  16776. lodash.assignIn = assignIn;
  16777. lodash.assignInWith = assignInWith;
  16778. lodash.assignWith = assignWith;
  16779. lodash.at = at;
  16780. lodash.before = before;
  16781. lodash.bind = bind;
  16782. lodash.bindAll = bindAll;
  16783. lodash.bindKey = bindKey;
  16784. lodash.castArray = castArray;
  16785. lodash.chain = chain;
  16786. lodash.chunk = chunk;
  16787. lodash.compact = compact;
  16788. lodash.concat = concat;
  16789. lodash.cond = cond;
  16790. lodash.conforms = conforms;
  16791. lodash.constant = constant;
  16792. lodash.countBy = countBy;
  16793. lodash.create = create;
  16794. lodash.curry = curry;
  16795. lodash.curryRight = curryRight;
  16796. lodash.debounce = debounce;
  16797. lodash.defaults = defaults;
  16798. lodash.defaultsDeep = defaultsDeep;
  16799. lodash.defer = defer;
  16800. lodash.delay = delay;
  16801. lodash.difference = difference;
  16802. lodash.differenceBy = differenceBy;
  16803. lodash.differenceWith = differenceWith;
  16804. lodash.drop = drop;
  16805. lodash.dropRight = dropRight;
  16806. lodash.dropRightWhile = dropRightWhile;
  16807. lodash.dropWhile = dropWhile;
  16808. lodash.fill = fill;
  16809. lodash.filter = filter;
  16810. lodash.flatMap = flatMap;
  16811. lodash.flatMapDeep = flatMapDeep;
  16812. lodash.flatMapDepth = flatMapDepth;
  16813. lodash.flatten = flatten;
  16814. lodash.flattenDeep = flattenDeep;
  16815. lodash.flattenDepth = flattenDepth;
  16816. lodash.flip = flip;
  16817. lodash.flow = flow;
  16818. lodash.flowRight = flowRight;
  16819. lodash.fromPairs = fromPairs;
  16820. lodash.functions = functions;
  16821. lodash.functionsIn = functionsIn;
  16822. lodash.groupBy = groupBy;
  16823. lodash.initial = initial;
  16824. lodash.intersection = intersection;
  16825. lodash.intersectionBy = intersectionBy;
  16826. lodash.intersectionWith = intersectionWith;
  16827. lodash.invert = invert;
  16828. lodash.invertBy = invertBy;
  16829. lodash.invokeMap = invokeMap;
  16830. lodash.iteratee = iteratee;
  16831. lodash.keyBy = keyBy;
  16832. lodash.keys = keys;
  16833. lodash.keysIn = keysIn;
  16834. lodash.map = map;
  16835. lodash.mapKeys = mapKeys;
  16836. lodash.mapValues = mapValues;
  16837. lodash.matches = matches;
  16838. lodash.matchesProperty = matchesProperty;
  16839. lodash.memoize = memoize;
  16840. lodash.merge = merge;
  16841. lodash.mergeWith = mergeWith;
  16842. lodash.method = method;
  16843. lodash.methodOf = methodOf;
  16844. lodash.mixin = mixin;
  16845. lodash.negate = negate;
  16846. lodash.nthArg = nthArg;
  16847. lodash.omit = omit;
  16848. lodash.omitBy = omitBy;
  16849. lodash.once = once;
  16850. lodash.orderBy = orderBy;
  16851. lodash.over = over;
  16852. lodash.overArgs = overArgs;
  16853. lodash.overEvery = overEvery;
  16854. lodash.overSome = overSome;
  16855. lodash.partial = partial;
  16856. lodash.partialRight = partialRight;
  16857. lodash.partition = partition;
  16858. lodash.pick = pick;
  16859. lodash.pickBy = pickBy;
  16860. lodash.property = property;
  16861. lodash.propertyOf = propertyOf;
  16862. lodash.pull = pull;
  16863. lodash.pullAll = pullAll;
  16864. lodash.pullAllBy = pullAllBy;
  16865. lodash.pullAllWith = pullAllWith;
  16866. lodash.pullAt = pullAt;
  16867. lodash.range = range;
  16868. lodash.rangeRight = rangeRight;
  16869. lodash.rearg = rearg;
  16870. lodash.reject = reject;
  16871. lodash.remove = remove;
  16872. lodash.rest = rest;
  16873. lodash.reverse = reverse;
  16874. lodash.sampleSize = sampleSize;
  16875. lodash.set = set;
  16876. lodash.setWith = setWith;
  16877. lodash.shuffle = shuffle;
  16878. lodash.slice = slice;
  16879. lodash.sortBy = sortBy;
  16880. lodash.sortedUniq = sortedUniq;
  16881. lodash.sortedUniqBy = sortedUniqBy;
  16882. lodash.split = split;
  16883. lodash.spread = spread;
  16884. lodash.tail = tail;
  16885. lodash.take = take;
  16886. lodash.takeRight = takeRight;
  16887. lodash.takeRightWhile = takeRightWhile;
  16888. lodash.takeWhile = takeWhile;
  16889. lodash.tap = tap;
  16890. lodash.throttle = throttle;
  16891. lodash.thru = thru;
  16892. lodash.toArray = toArray;
  16893. lodash.toPairs = toPairs;
  16894. lodash.toPairsIn = toPairsIn;
  16895. lodash.toPath = toPath;
  16896. lodash.toPlainObject = toPlainObject;
  16897. lodash.transform = transform;
  16898. lodash.unary = unary;
  16899. lodash.union = union;
  16900. lodash.unionBy = unionBy;
  16901. lodash.unionWith = unionWith;
  16902. lodash.uniq = uniq;
  16903. lodash.uniqBy = uniqBy;
  16904. lodash.uniqWith = uniqWith;
  16905. lodash.unset = unset;
  16906. lodash.unzip = unzip;
  16907. lodash.unzipWith = unzipWith;
  16908. lodash.update = update;
  16909. lodash.updateWith = updateWith;
  16910. lodash.values = values;
  16911. lodash.valuesIn = valuesIn;
  16912. lodash.without = without;
  16913. lodash.words = words;
  16914. lodash.wrap = wrap;
  16915. lodash.xor = xor;
  16916. lodash.xorBy = xorBy;
  16917. lodash.xorWith = xorWith;
  16918. lodash.zip = zip;
  16919. lodash.zipObject = zipObject;
  16920. lodash.zipObjectDeep = zipObjectDeep;
  16921. lodash.zipWith = zipWith;
  16922. // Add aliases.
  16923. lodash.entries = toPairs;
  16924. lodash.entriesIn = toPairsIn;
  16925. lodash.extend = assignIn;
  16926. lodash.extendWith = assignInWith;
  16927. // Add methods to `lodash.prototype`.
  16928. mixin(lodash, lodash);
  16929. /*------------------------------------------------------------------------*/
  16930. // Add methods that return unwrapped values in chain sequences.
  16931. lodash.add = add;
  16932. lodash.attempt = attempt;
  16933. lodash.camelCase = camelCase;
  16934. lodash.capitalize = capitalize;
  16935. lodash.ceil = ceil;
  16936. lodash.clamp = clamp;
  16937. lodash.clone = clone;
  16938. lodash.cloneDeep = cloneDeep;
  16939. lodash.cloneDeepWith = cloneDeepWith;
  16940. lodash.cloneWith = cloneWith;
  16941. lodash.conformsTo = conformsTo;
  16942. lodash.deburr = deburr;
  16943. lodash.defaultTo = defaultTo;
  16944. lodash.divide = divide;
  16945. lodash.endsWith = endsWith;
  16946. lodash.eq = eq;
  16947. lodash.escape = escape;
  16948. lodash.escapeRegExp = escapeRegExp;
  16949. lodash.every = every;
  16950. lodash.find = find;
  16951. lodash.findIndex = findIndex;
  16952. lodash.findKey = findKey;
  16953. lodash.findLast = findLast;
  16954. lodash.findLastIndex = findLastIndex;
  16955. lodash.findLastKey = findLastKey;
  16956. lodash.floor = floor;
  16957. lodash.forEach = forEach;
  16958. lodash.forEachRight = forEachRight;
  16959. lodash.forIn = forIn;
  16960. lodash.forInRight = forInRight;
  16961. lodash.forOwn = forOwn;
  16962. lodash.forOwnRight = forOwnRight;
  16963. lodash.get = get;
  16964. lodash.gt = gt;
  16965. lodash.gte = gte;
  16966. lodash.has = has;
  16967. lodash.hasIn = hasIn;
  16968. lodash.head = head;
  16969. lodash.identity = identity;
  16970. lodash.includes = includes;
  16971. lodash.indexOf = indexOf;
  16972. lodash.inRange = inRange;
  16973. lodash.invoke = invoke;
  16974. lodash.isArguments = isArguments;
  16975. lodash.isArray = isArray;
  16976. lodash.isArrayBuffer = isArrayBuffer;
  16977. lodash.isArrayLike = isArrayLike;
  16978. lodash.isArrayLikeObject = isArrayLikeObject;
  16979. lodash.isBoolean = isBoolean;
  16980. lodash.isBuffer = isBuffer;
  16981. lodash.isDate = isDate;
  16982. lodash.isElement = isElement;
  16983. lodash.isEmpty = isEmpty;
  16984. lodash.isEqual = isEqual;
  16985. lodash.isEqualWith = isEqualWith;
  16986. lodash.isError = isError;
  16987. lodash.isFinite = isFinite;
  16988. lodash.isFunction = isFunction;
  16989. lodash.isInteger = isInteger;
  16990. lodash.isLength = isLength;
  16991. lodash.isMap = isMap;
  16992. lodash.isMatch = isMatch;
  16993. lodash.isMatchWith = isMatchWith;
  16994. lodash.isNaN = isNaN;
  16995. lodash.isNative = isNative;
  16996. lodash.isNil = isNil;
  16997. lodash.isNull = isNull;
  16998. lodash.isNumber = isNumber;
  16999. lodash.isObject = isObject;
  17000. lodash.isObjectLike = isObjectLike;
  17001. lodash.isPlainObject = isPlainObject;
  17002. lodash.isRegExp = isRegExp;
  17003. lodash.isSafeInteger = isSafeInteger;
  17004. lodash.isSet = isSet;
  17005. lodash.isString = isString;
  17006. lodash.isSymbol = isSymbol;
  17007. lodash.isTypedArray = isTypedArray;
  17008. lodash.isUndefined = isUndefined;
  17009. lodash.isWeakMap = isWeakMap;
  17010. lodash.isWeakSet = isWeakSet;
  17011. lodash.join = join;
  17012. lodash.kebabCase = kebabCase;
  17013. lodash.last = last;
  17014. lodash.lastIndexOf = lastIndexOf;
  17015. lodash.lowerCase = lowerCase;
  17016. lodash.lowerFirst = lowerFirst;
  17017. lodash.lt = lt;
  17018. lodash.lte = lte;
  17019. lodash.max = max;
  17020. lodash.maxBy = maxBy;
  17021. lodash.mean = mean;
  17022. lodash.meanBy = meanBy;
  17023. lodash.min = min;
  17024. lodash.minBy = minBy;
  17025. lodash.stubArray = stubArray;
  17026. lodash.stubFalse = stubFalse;
  17027. lodash.stubObject = stubObject;
  17028. lodash.stubString = stubString;
  17029. lodash.stubTrue = stubTrue;
  17030. lodash.multiply = multiply;
  17031. lodash.nth = nth;
  17032. lodash.noConflict = noConflict;
  17033. lodash.noop = noop;
  17034. lodash.now = now;
  17035. lodash.pad = pad;
  17036. lodash.padEnd = padEnd;
  17037. lodash.padStart = padStart;
  17038. lodash.parseInt = parseInt;
  17039. lodash.random = random;
  17040. lodash.reduce = reduce;
  17041. lodash.reduceRight = reduceRight;
  17042. lodash.repeat = repeat;
  17043. lodash.replace = replace;
  17044. lodash.result = result;
  17045. lodash.round = round;
  17046. lodash.runInContext = runInContext;
  17047. lodash.sample = sample;
  17048. lodash.size = size;
  17049. lodash.snakeCase = snakeCase;
  17050. lodash.some = some;
  17051. lodash.sortedIndex = sortedIndex;
  17052. lodash.sortedIndexBy = sortedIndexBy;
  17053. lodash.sortedIndexOf = sortedIndexOf;
  17054. lodash.sortedLastIndex = sortedLastIndex;
  17055. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17056. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17057. lodash.startCase = startCase;
  17058. lodash.startsWith = startsWith;
  17059. lodash.subtract = subtract;
  17060. lodash.sum = sum;
  17061. lodash.sumBy = sumBy;
  17062. lodash.template = template;
  17063. lodash.times = times;
  17064. lodash.toFinite = toFinite;
  17065. lodash.toInteger = toInteger;
  17066. lodash.toLength = toLength;
  17067. lodash.toLower = toLower;
  17068. lodash.toNumber = toNumber;
  17069. lodash.toSafeInteger = toSafeInteger;
  17070. lodash.toString = toString;
  17071. lodash.toUpper = toUpper;
  17072. lodash.trim = trim;
  17073. lodash.trimEnd = trimEnd;
  17074. lodash.trimStart = trimStart;
  17075. lodash.truncate = truncate;
  17076. lodash.unescape = unescape;
  17077. lodash.uniqueId = uniqueId;
  17078. lodash.upperCase = upperCase;
  17079. lodash.upperFirst = upperFirst;
  17080. // Add aliases.
  17081. lodash.each = forEach;
  17082. lodash.eachRight = forEachRight;
  17083. lodash.first = head;
  17084. mixin(lodash, (function() {
  17085. var source = {};
  17086. baseForOwn(lodash, function(func, methodName) {
  17087. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17088. source[methodName] = func;
  17089. }
  17090. });
  17091. return source;
  17092. }()), { 'chain': false });
  17093. /*------------------------------------------------------------------------*/
  17094. /**
  17095. * The semantic version number.
  17096. *
  17097. * @static
  17098. * @memberOf _
  17099. * @type {string}
  17100. */
  17101. lodash.VERSION = VERSION;
  17102. // Assign default placeholders.
  17103. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17104. lodash[methodName].placeholder = lodash;
  17105. });
  17106. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17107. arrayEach(['drop', 'take'], function(methodName, index) {
  17108. LazyWrapper.prototype[methodName] = function(n) {
  17109. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17110. var result = (this.__filtered__ && !index)
  17111. ? new LazyWrapper(this)
  17112. : this.clone();
  17113. if (result.__filtered__) {
  17114. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17115. } else {
  17116. result.__views__.push({
  17117. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17118. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17119. });
  17120. }
  17121. return result;
  17122. };
  17123. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17124. return this.reverse()[methodName](n).reverse();
  17125. };
  17126. });
  17127. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17128. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17129. var type = index + 1,
  17130. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17131. LazyWrapper.prototype[methodName] = function(iteratee) {
  17132. var result = this.clone();
  17133. result.__iteratees__.push({
  17134. 'iteratee': getIteratee(iteratee, 3),
  17135. 'type': type
  17136. });
  17137. result.__filtered__ = result.__filtered__ || isFilter;
  17138. return result;
  17139. };
  17140. });
  17141. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17142. arrayEach(['head', 'last'], function(methodName, index) {
  17143. var takeName = 'take' + (index ? 'Right' : '');
  17144. LazyWrapper.prototype[methodName] = function() {
  17145. return this[takeName](1).value()[0];
  17146. };
  17147. });
  17148. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17149. arrayEach(['initial', 'tail'], function(methodName, index) {
  17150. var dropName = 'drop' + (index ? '' : 'Right');
  17151. LazyWrapper.prototype[methodName] = function() {
  17152. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17153. };
  17154. });
  17155. LazyWrapper.prototype.compact = function() {
  17156. return this.filter(identity);
  17157. };
  17158. LazyWrapper.prototype.find = function(predicate) {
  17159. return this.filter(predicate).head();
  17160. };
  17161. LazyWrapper.prototype.findLast = function(predicate) {
  17162. return this.reverse().find(predicate);
  17163. };
  17164. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17165. if (typeof path == 'function') {
  17166. return new LazyWrapper(this);
  17167. }
  17168. return this.map(function(value) {
  17169. return baseInvoke(value, path, args);
  17170. });
  17171. });
  17172. LazyWrapper.prototype.reject = function(predicate) {
  17173. return this.filter(negate(getIteratee(predicate)));
  17174. };
  17175. LazyWrapper.prototype.slice = function(start, end) {
  17176. start = toInteger(start);
  17177. var result = this;
  17178. if (result.__filtered__ && (start > 0 || end < 0)) {
  17179. return new LazyWrapper(result);
  17180. }
  17181. if (start < 0) {
  17182. result = result.takeRight(-start);
  17183. } else if (start) {
  17184. result = result.drop(start);
  17185. }
  17186. if (end !== undefined) {
  17187. end = toInteger(end);
  17188. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17189. }
  17190. return result;
  17191. };
  17192. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17193. return this.reverse().takeWhile(predicate).reverse();
  17194. };
  17195. LazyWrapper.prototype.toArray = function() {
  17196. return this.take(MAX_ARRAY_LENGTH);
  17197. };
  17198. // Add `LazyWrapper` methods to `lodash.prototype`.
  17199. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17200. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17201. isTaker = /^(?:head|last)$/.test(methodName),
  17202. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17203. retUnwrapped = isTaker || /^find/.test(methodName);
  17204. if (!lodashFunc) {
  17205. return;
  17206. }
  17207. lodash.prototype[methodName] = function() {
  17208. var value = this.__wrapped__,
  17209. args = isTaker ? [1] : arguments,
  17210. isLazy = value instanceof LazyWrapper,
  17211. iteratee = args[0],
  17212. useLazy = isLazy || isArray(value);
  17213. var interceptor = function(value) {
  17214. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17215. return (isTaker && chainAll) ? result[0] : result;
  17216. };
  17217. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17218. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17219. isLazy = useLazy = false;
  17220. }
  17221. var chainAll = this.__chain__,
  17222. isHybrid = !!this.__actions__.length,
  17223. isUnwrapped = retUnwrapped && !chainAll,
  17224. onlyLazy = isLazy && !isHybrid;
  17225. if (!retUnwrapped && useLazy) {
  17226. value = onlyLazy ? value : new LazyWrapper(this);
  17227. var result = func.apply(value, args);
  17228. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17229. return new LodashWrapper(result, chainAll);
  17230. }
  17231. if (isUnwrapped && onlyLazy) {
  17232. return func.apply(this, args);
  17233. }
  17234. result = this.thru(interceptor);
  17235. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17236. };
  17237. });
  17238. // Add `Array` methods to `lodash.prototype`.
  17239. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17240. var func = arrayProto[methodName],
  17241. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17242. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17243. lodash.prototype[methodName] = function() {
  17244. var args = arguments;
  17245. if (retUnwrapped && !this.__chain__) {
  17246. var value = this.value();
  17247. return func.apply(isArray(value) ? value : [], args);
  17248. }
  17249. return this[chainName](function(value) {
  17250. return func.apply(isArray(value) ? value : [], args);
  17251. });
  17252. };
  17253. });
  17254. // Map minified method names to their real names.
  17255. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17256. var lodashFunc = lodash[methodName];
  17257. if (lodashFunc) {
  17258. var key = lodashFunc.name + '';
  17259. if (!hasOwnProperty.call(realNames, key)) {
  17260. realNames[key] = [];
  17261. }
  17262. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17263. }
  17264. });
  17265. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17266. 'name': 'wrapper',
  17267. 'func': undefined
  17268. }];
  17269. // Add methods to `LazyWrapper`.
  17270. LazyWrapper.prototype.clone = lazyClone;
  17271. LazyWrapper.prototype.reverse = lazyReverse;
  17272. LazyWrapper.prototype.value = lazyValue;
  17273. // Add chain sequence methods to the `lodash` wrapper.
  17274. lodash.prototype.at = wrapperAt;
  17275. lodash.prototype.chain = wrapperChain;
  17276. lodash.prototype.commit = wrapperCommit;
  17277. lodash.prototype.next = wrapperNext;
  17278. lodash.prototype.plant = wrapperPlant;
  17279. lodash.prototype.reverse = wrapperReverse;
  17280. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17281. // Add lazy aliases.
  17282. lodash.prototype.first = lodash.prototype.head;
  17283. if (symIterator) {
  17284. lodash.prototype[symIterator] = wrapperToIterator;
  17285. }
  17286. return lodash;
  17287. });
  17288. /*--------------------------------------------------------------------------*/
  17289. // Export lodash.
  17290. var _ = runInContext();
  17291. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17292. if (true) {
  17293. // Expose Lodash on the global object to prevent errors when Lodash is
  17294. // loaded by a script tag in the presence of an AMD loader.
  17295. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17296. // Use `_.noConflict` to remove Lodash from the global object.
  17297. root._ = _;
  17298. // Define as an anonymous module so, through path mapping, it can be
  17299. // referenced as the "underscore" module.
  17300. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17301. return _;
  17302. }).call(exports, __webpack_require__, exports, module),
  17303. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17304. }
  17305. // Check for `exports` after `define` in case a build optimizer adds it.
  17306. else {}
  17307. }.call(this));
  17308. /***/ }),
  17309. /***/ "./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":
  17310. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17311. !*** ./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 ***!
  17312. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17313. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17314. "use strict";
  17315. __webpack_require__.r(__webpack_exports__);
  17316. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17317. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17318. /* harmony export */ });
  17319. /* 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");
  17320. /* 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__);
  17321. /* 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");
  17322. var options = {};
  17323. options.insert = "head";
  17324. options.singleton = false;
  17325. 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);
  17326. /* 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 || {});
  17327. /***/ }),
  17328. /***/ "./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":
  17329. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17330. !*** ./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 ***!
  17331. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17332. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17333. "use strict";
  17334. __webpack_require__.r(__webpack_exports__);
  17335. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17336. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17337. /* harmony export */ });
  17338. /* 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");
  17339. /* 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__);
  17340. /* 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");
  17341. var options = {};
  17342. options.insert = "head";
  17343. options.singleton = false;
  17344. 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);
  17345. /* 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 || {});
  17346. /***/ }),
  17347. /***/ "./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":
  17348. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17349. !*** ./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 ***!
  17350. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17351. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17352. "use strict";
  17353. __webpack_require__.r(__webpack_exports__);
  17354. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17355. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17356. /* harmony export */ });
  17357. /* 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");
  17358. /* 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__);
  17359. /* 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");
  17360. var options = {};
  17361. options.insert = "head";
  17362. options.singleton = false;
  17363. 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);
  17364. /* 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 || {});
  17365. /***/ }),
  17366. /***/ "./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":
  17367. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17368. !*** ./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 ***!
  17369. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17370. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17371. "use strict";
  17372. __webpack_require__.r(__webpack_exports__);
  17373. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17374. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17375. /* harmony export */ });
  17376. /* 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");
  17377. /* 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__);
  17378. /* 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");
  17379. var options = {};
  17380. options.insert = "head";
  17381. options.singleton = false;
  17382. 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);
  17383. /* 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 || {});
  17384. /***/ }),
  17385. /***/ "./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":
  17386. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17387. !*** ./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 ***!
  17388. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17389. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17390. "use strict";
  17391. __webpack_require__.r(__webpack_exports__);
  17392. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17393. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17394. /* harmony export */ });
  17395. /* 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");
  17396. /* 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__);
  17397. /* 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");
  17398. var options = {};
  17399. options.insert = "head";
  17400. options.singleton = false;
  17401. 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);
  17402. /* 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 || {});
  17403. /***/ }),
  17404. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17405. /*!******************************************************!*\
  17406. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17407. \******************************************************/
  17408. /***/ ((__unused_webpack_module, exports) => {
  17409. "use strict";
  17410. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17411. // runtime helper for setting properties on components
  17412. // in a tree-shakable way
  17413. exports["default"] = (sfc, props) => {
  17414. const target = sfc.__vccOpts || sfc;
  17415. for (const [key, val] of props) {
  17416. target[key] = val;
  17417. }
  17418. return target;
  17419. };
  17420. /***/ }),
  17421. /***/ "./resources/js/components/AppButtonLink.vue":
  17422. /*!***************************************************!*\
  17423. !*** ./resources/js/components/AppButtonLink.vue ***!
  17424. \***************************************************/
  17425. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17426. "use strict";
  17427. __webpack_require__.r(__webpack_exports__);
  17428. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17429. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17430. /* harmony export */ });
  17431. /* 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");
  17432. /* 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");
  17433. /* 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");
  17434. ;
  17435. 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"]])
  17436. /* hot reload */
  17437. if (false) {}
  17438. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17439. /***/ }),
  17440. /***/ "./resources/js/components/AppFooter.vue":
  17441. /*!***********************************************!*\
  17442. !*** ./resources/js/components/AppFooter.vue ***!
  17443. \***********************************************/
  17444. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17445. "use strict";
  17446. __webpack_require__.r(__webpack_exports__);
  17447. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17448. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17449. /* harmony export */ });
  17450. /* 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");
  17451. /* 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");
  17452. /* 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");
  17453. const script = {}
  17454. ;
  17455. 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"]])
  17456. /* hot reload */
  17457. if (false) {}
  17458. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17459. /***/ }),
  17460. /***/ "./resources/js/components/AppMessage.vue":
  17461. /*!************************************************!*\
  17462. !*** ./resources/js/components/AppMessage.vue ***!
  17463. \************************************************/
  17464. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17465. "use strict";
  17466. __webpack_require__.r(__webpack_exports__);
  17467. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17468. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17469. /* harmony export */ });
  17470. /* 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");
  17471. /* 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");
  17472. /* 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");
  17473. ;
  17474. 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"]])
  17475. /* hot reload */
  17476. if (false) {}
  17477. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17478. /***/ }),
  17479. /***/ "./resources/js/components/AppPagination.vue":
  17480. /*!***************************************************!*\
  17481. !*** ./resources/js/components/AppPagination.vue ***!
  17482. \***************************************************/
  17483. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17484. "use strict";
  17485. __webpack_require__.r(__webpack_exports__);
  17486. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17487. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17488. /* harmony export */ });
  17489. /* 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");
  17490. /* 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");
  17491. /* 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");
  17492. ;
  17493. 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"]])
  17494. /* hot reload */
  17495. if (false) {}
  17496. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17497. /***/ }),
  17498. /***/ "./resources/js/components/AppSidebar.vue":
  17499. /*!************************************************!*\
  17500. !*** ./resources/js/components/AppSidebar.vue ***!
  17501. \************************************************/
  17502. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17503. "use strict";
  17504. __webpack_require__.r(__webpack_exports__);
  17505. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17506. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17507. /* harmony export */ });
  17508. /* 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");
  17509. /* 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");
  17510. /* 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");
  17511. /* 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");
  17512. ;
  17513. 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"]])
  17514. /* hot reload */
  17515. if (false) {}
  17516. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17517. /***/ }),
  17518. /***/ "./resources/js/components/AppSubSidebar.vue":
  17519. /*!***************************************************!*\
  17520. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17521. \***************************************************/
  17522. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17523. "use strict";
  17524. __webpack_require__.r(__webpack_exports__);
  17525. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17526. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17527. /* harmony export */ });
  17528. /* 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");
  17529. /* 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");
  17530. /* 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");
  17531. /* 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");
  17532. ;
  17533. 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"]])
  17534. /* hot reload */
  17535. if (false) {}
  17536. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17537. /***/ }),
  17538. /***/ "./resources/js/components/AppTopBar.vue":
  17539. /*!***********************************************!*\
  17540. !*** ./resources/js/components/AppTopBar.vue ***!
  17541. \***********************************************/
  17542. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17543. "use strict";
  17544. __webpack_require__.r(__webpack_exports__);
  17545. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17546. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17547. /* harmony export */ });
  17548. /* 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");
  17549. /* 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");
  17550. /* 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");
  17551. /* 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");
  17552. ;
  17553. 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"]])
  17554. /* hot reload */
  17555. if (false) {}
  17556. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17557. /***/ }),
  17558. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17559. /*!**************************************************!*\
  17560. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17561. \**************************************************/
  17562. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17563. "use strict";
  17564. __webpack_require__.r(__webpack_exports__);
  17565. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17566. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17567. /* harmony export */ });
  17568. /* 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");
  17569. /* 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");
  17570. /* 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");
  17571. /* 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");
  17572. ;
  17573. 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"]])
  17574. /* hot reload */
  17575. if (false) {}
  17576. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17577. /***/ }),
  17578. /***/ "./resources/js/pages/user/Index.vue":
  17579. /*!*******************************************!*\
  17580. !*** ./resources/js/pages/user/Index.vue ***!
  17581. \*******************************************/
  17582. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17583. "use strict";
  17584. __webpack_require__.r(__webpack_exports__);
  17585. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17586. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17587. /* harmony export */ });
  17588. /* 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");
  17589. /* 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");
  17590. /* 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");
  17591. ;
  17592. 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"]])
  17593. /* hot reload */
  17594. if (false) {}
  17595. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17596. /***/ }),
  17597. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17598. /*!**************************************************************************************!*\
  17599. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17600. \**************************************************************************************/
  17601. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17602. "use strict";
  17603. __webpack_require__.r(__webpack_exports__);
  17604. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17605. /* 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"])
  17606. /* harmony export */ });
  17607. /* 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");
  17608. /***/ }),
  17609. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17610. /*!***********************************************************************************!*\
  17611. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17612. \***********************************************************************************/
  17613. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17614. "use strict";
  17615. __webpack_require__.r(__webpack_exports__);
  17616. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17617. /* 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"])
  17618. /* harmony export */ });
  17619. /* 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");
  17620. /***/ }),
  17621. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17622. /*!**************************************************************************************!*\
  17623. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17624. \**************************************************************************************/
  17625. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17626. "use strict";
  17627. __webpack_require__.r(__webpack_exports__);
  17628. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17629. /* 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"])
  17630. /* harmony export */ });
  17631. /* 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");
  17632. /***/ }),
  17633. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17634. /*!***********************************************************************************!*\
  17635. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17636. \***********************************************************************************/
  17637. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17638. "use strict";
  17639. __webpack_require__.r(__webpack_exports__);
  17640. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17641. /* 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"])
  17642. /* harmony export */ });
  17643. /* 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");
  17644. /***/ }),
  17645. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17646. /*!**************************************************************************************!*\
  17647. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17648. \**************************************************************************************/
  17649. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17650. "use strict";
  17651. __webpack_require__.r(__webpack_exports__);
  17652. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17653. /* 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"])
  17654. /* harmony export */ });
  17655. /* 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");
  17656. /***/ }),
  17657. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17658. /*!**********************************************************************************!*\
  17659. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17660. \**********************************************************************************/
  17661. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17662. "use strict";
  17663. __webpack_require__.r(__webpack_exports__);
  17664. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17665. /* 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"])
  17666. /* harmony export */ });
  17667. /* 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");
  17668. /***/ }),
  17669. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17670. /*!*************************************************************************************!*\
  17671. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17672. \*************************************************************************************/
  17673. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17674. "use strict";
  17675. __webpack_require__.r(__webpack_exports__);
  17676. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17677. /* 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"])
  17678. /* harmony export */ });
  17679. /* 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");
  17680. /***/ }),
  17681. /***/ "./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js":
  17682. /*!******************************************************************************!*\
  17683. !*** ./resources/js/pages/user/Index.vue?vue&type=script&setup=true&lang=js ***!
  17684. \******************************************************************************/
  17685. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17686. "use strict";
  17687. __webpack_require__.r(__webpack_exports__);
  17688. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17689. /* 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"])
  17690. /* harmony export */ });
  17691. /* 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");
  17692. /***/ }),
  17693. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17694. /*!*********************************************************************************!*\
  17695. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17696. \*********************************************************************************/
  17697. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17698. "use strict";
  17699. __webpack_require__.r(__webpack_exports__);
  17700. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17701. /* 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)
  17702. /* harmony export */ });
  17703. /* 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");
  17704. /***/ }),
  17705. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17706. /*!*****************************************************************************************!*\
  17707. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17708. \*****************************************************************************************/
  17709. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17710. "use strict";
  17711. __webpack_require__.r(__webpack_exports__);
  17712. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17713. /* 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)
  17714. /* harmony export */ });
  17715. /* 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");
  17716. /***/ }),
  17717. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17718. /*!******************************************************************************!*\
  17719. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17720. \******************************************************************************/
  17721. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17722. "use strict";
  17723. __webpack_require__.r(__webpack_exports__);
  17724. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17725. /* 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)
  17726. /* harmony export */ });
  17727. /* 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");
  17728. /***/ }),
  17729. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17730. /*!*********************************************************************************!*\
  17731. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17732. \*********************************************************************************/
  17733. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17734. "use strict";
  17735. __webpack_require__.r(__webpack_exports__);
  17736. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17737. /* 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)
  17738. /* harmony export */ });
  17739. /* 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");
  17740. /***/ }),
  17741. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17742. /*!******************************************************************************************!*\
  17743. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17744. \******************************************************************************************/
  17745. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17746. "use strict";
  17747. __webpack_require__.r(__webpack_exports__);
  17748. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17749. /* 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)
  17750. /* harmony export */ });
  17751. /* 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");
  17752. /***/ }),
  17753. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17754. /*!*********************************************************************************************!*\
  17755. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17756. \*********************************************************************************************/
  17757. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17758. "use strict";
  17759. __webpack_require__.r(__webpack_exports__);
  17760. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17761. /* 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)
  17762. /* harmony export */ });
  17763. /* 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");
  17764. /***/ }),
  17765. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17766. /*!*****************************************************************************************!*\
  17767. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17768. \*****************************************************************************************/
  17769. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17770. "use strict";
  17771. __webpack_require__.r(__webpack_exports__);
  17772. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17773. /* 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)
  17774. /* harmony export */ });
  17775. /* 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");
  17776. /***/ }),
  17777. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17778. /*!********************************************************************************************!*\
  17779. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17780. \********************************************************************************************/
  17781. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17782. "use strict";
  17783. __webpack_require__.r(__webpack_exports__);
  17784. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17785. /* 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)
  17786. /* harmony export */ });
  17787. /* 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");
  17788. /***/ }),
  17789. /***/ "./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497":
  17790. /*!*************************************************************************!*\
  17791. !*** ./resources/js/pages/user/Index.vue?vue&type=template&id=3aca4497 ***!
  17792. \*************************************************************************/
  17793. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17794. "use strict";
  17795. __webpack_require__.r(__webpack_exports__);
  17796. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17797. /* 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)
  17798. /* harmony export */ });
  17799. /* 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");
  17800. /***/ }),
  17801. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17802. /*!********************************************************************************************************!*\
  17803. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17804. \********************************************************************************************************/
  17805. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17806. "use strict";
  17807. __webpack_require__.r(__webpack_exports__);
  17808. /* 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");
  17809. /***/ }),
  17810. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17811. /*!*********************************************************************************************************!*\
  17812. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17813. \*********************************************************************************************************/
  17814. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17815. "use strict";
  17816. __webpack_require__.r(__webpack_exports__);
  17817. /* 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");
  17818. /***/ }),
  17819. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17820. /*!************************************************************************************************************!*\
  17821. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17822. \************************************************************************************************************/
  17823. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17824. "use strict";
  17825. __webpack_require__.r(__webpack_exports__);
  17826. /* 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");
  17827. /***/ }),
  17828. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17829. /*!********************************************************************************************************!*\
  17830. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17831. \********************************************************************************************************/
  17832. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17833. "use strict";
  17834. __webpack_require__.r(__webpack_exports__);
  17835. /* 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");
  17836. /***/ }),
  17837. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17838. /*!***********************************************************************************************************!*\
  17839. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17840. \***********************************************************************************************************/
  17841. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17842. "use strict";
  17843. __webpack_require__.r(__webpack_exports__);
  17844. /* 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");
  17845. /***/ })
  17846. }]);