resources_js_pages_member_Index_vue.js 694KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_member_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/member/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/member/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/member/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 _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  276. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  277. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. members: 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('/members', (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. indexTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.indexTable,
  304. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  305. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  306. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  307. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  308. };
  309. Object.defineProperty(__returned__, '__isScriptSetup', {
  310. enumerable: false,
  311. value: true
  312. });
  313. return __returned__;
  314. }
  315. });
  316. /***/ }),
  317. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  318. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  319. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  320. \***********************************************************************************************************************************************************************************************************************************************************************************/
  321. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  322. "use strict";
  323. __webpack_require__.r(__webpack_exports__);
  324. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  325. /* harmony export */ "render": () => (/* binding */ render)
  326. /* harmony export */ });
  327. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  328. var _hoisted_1 = {
  329. key: 1,
  330. "class": "p-button-label"
  331. };
  332. var _hoisted_2 = {
  333. key: 1,
  334. "class": "p-button-label"
  335. };
  336. function render(_ctx, _cache, $props, $setup, $data, $options) {
  337. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  338. key: 0,
  339. "class": "p-button p-component",
  340. as: "button",
  341. type: "button"
  342. }, {
  343. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  344. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  345. key: 0,
  346. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  347. }, null, 2
  348. /* CLASS */
  349. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  350. /* TEXT */
  351. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  352. }),
  353. _: 1
  354. /* STABLE */
  355. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  356. key: 1,
  357. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  358. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  359. key: 0,
  360. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  361. }, null, 2
  362. /* CLASS */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  364. /* TEXT */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  366. /* CLASS */
  367. ));
  368. }
  369. /***/ }),
  370. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  371. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  372. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  373. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  374. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  375. "use strict";
  376. __webpack_require__.r(__webpack_exports__);
  377. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  378. /* harmony export */ "render": () => (/* binding */ render)
  379. /* harmony export */ });
  380. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  381. var _withScopeId = function _withScopeId(n) {
  382. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  383. };
  384. var _hoisted_1 = {
  385. "class": "layout-footer"
  386. };
  387. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  388. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  389. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  390. href: "https://dijitalcode.com",
  391. target: "_blank",
  392. "class": "font-medium ml-2"
  393. }, "DijitalCODE", -1
  394. /* HOISTED */
  395. );
  396. });
  397. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  398. function render(_ctx, _cache) {
  399. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  400. }
  401. /***/ }),
  402. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  403. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  404. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  405. \********************************************************************************************************************************************************************************************************************************************************************************/
  406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  407. "use strict";
  408. __webpack_require__.r(__webpack_exports__);
  409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  410. /* harmony export */ "render": () => (/* binding */ render)
  411. /* harmony export */ });
  412. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  413. var _hoisted_1 = {
  414. key: 0
  415. };
  416. var _hoisted_2 = {
  417. key: 1
  418. };
  419. function render(_ctx, _cache, $props, $setup, $data, $options) {
  420. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  421. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  422. key: 0,
  423. severity: "success",
  424. onClose: $setup.onClose
  425. }, {
  426. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  427. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  428. /* TEXT */
  429. )];
  430. }),
  431. _: 1
  432. /* STABLE */
  433. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  434. key: 1,
  435. severity: "error",
  436. onClose: $setup.onClose
  437. }, {
  438. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  439. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  440. /* TEXT */
  441. )];
  442. }),
  443. _: 1
  444. /* STABLE */
  445. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  446. key: 2,
  447. severity: "error",
  448. onClose: $setup.onClose
  449. }, {
  450. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  451. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  452. /* TEXT */
  453. ))];
  454. }),
  455. _: 1
  456. /* STABLE */
  457. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  458. /* STABLE_FRAGMENT */
  459. );
  460. }
  461. /***/ }),
  462. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  463. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  464. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  465. \***********************************************************************************************************************************************************************************************************************************************************************************/
  466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  467. "use strict";
  468. __webpack_require__.r(__webpack_exports__);
  469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  470. /* harmony export */ "render": () => (/* binding */ render)
  471. /* harmony export */ });
  472. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  473. var _hoisted_1 = {
  474. key: 0,
  475. "class": "p-paginator p-component flex justify-content-start"
  476. };
  477. var _hoisted_2 = {
  478. "class": "p-paginator-pages"
  479. };
  480. var _hoisted_3 = ["innerHTML"];
  481. function render(_ctx, _cache, $props, $setup, $data, $options) {
  482. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  483. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  484. key: "link-".concat(key),
  485. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  486. 'p-disabled': link
  487. }]),
  488. innerHTML: link.label
  489. }, null, 10
  490. /* CLASS, PROPS */
  491. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  492. key: "link-".concat(key),
  493. href: link.url,
  494. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  495. 'p-highlight': link.active
  496. }, "p-paginator-page p-paginator-element p-link"]),
  497. innerHTML: link.label
  498. }, null, 8
  499. /* PROPS */
  500. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  501. /* STABLE_FRAGMENT */
  502. );
  503. }), 256
  504. /* UNKEYED_FRAGMENT */
  505. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  506. }
  507. /***/ }),
  508. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  509. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  510. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  511. \********************************************************************************************************************************************************************************************************************************************************************************************/
  512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  513. "use strict";
  514. __webpack_require__.r(__webpack_exports__);
  515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  516. /* harmony export */ "render": () => (/* binding */ render)
  517. /* harmony export */ });
  518. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  519. function render(_ctx, _cache, $props, $setup, $data, $options) {
  520. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  521. "class": "layout-menu",
  522. items: $props.menu,
  523. root: true
  524. }, null, 8
  525. /* PROPS */
  526. , ["items"])]);
  527. }
  528. /***/ }),
  529. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  530. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  531. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  532. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  534. "use strict";
  535. __webpack_require__.r(__webpack_exports__);
  536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  537. /* harmony export */ "render": () => (/* binding */ render)
  538. /* harmony export */ });
  539. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  540. var _withScopeId = function _withScopeId(n) {
  541. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  542. };
  543. var _hoisted_1 = {
  544. key: 0
  545. };
  546. var _hoisted_2 = ["aria-label"];
  547. var _hoisted_3 = ["aria-label"];
  548. function render(_ctx, _cache, $props, $setup, $data, $options) {
  549. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  550. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  551. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  552. key: i,
  553. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  554. 'layout-menuitem-category': $props.root
  555. }]),
  556. role: "none"
  557. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  558. key: 0
  559. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  560. "class": "layout-menuitem-root-text",
  561. "aria-label": item.label
  562. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  563. /* TEXT, PROPS */
  564. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  565. items: item.items
  566. }, null, 8
  567. /* PROPS */
  568. , ["items"])], 64
  569. /* STABLE_FRAGMENT */
  570. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  571. key: 1
  572. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  573. key: 0,
  574. role: "menuitem",
  575. href: item.to,
  576. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  577. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  578. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  579. }]),
  580. "aria-label": item.label
  581. }, {
  582. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  583. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  585. }, null, 2
  586. /* CLASS */
  587. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  588. /* TEXT */
  589. )];
  590. }),
  591. _: 2
  592. /* DYNAMIC */
  593. }, 1032
  594. /* PROPS, DYNAMIC_SLOTS */
  595. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  596. key: 1,
  597. href: "#",
  598. role: "menuitem",
  599. "aria-label": item.label
  600. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  601. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  602. }, null, 2
  603. /* CLASS */
  604. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  605. /* TEXT */
  606. )], 8
  607. /* PROPS */
  608. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  609. items: item.items
  610. }, null, 8
  611. /* PROPS */
  612. , ["items"])], 64
  613. /* STABLE_FRAGMENT */
  614. ))], 2
  615. /* CLASS */
  616. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  617. /* STABLE_FRAGMENT */
  618. );
  619. }), 256
  620. /* UNKEYED_FRAGMENT */
  621. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  622. }
  623. /***/ }),
  624. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  625. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  626. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  627. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  629. "use strict";
  630. __webpack_require__.r(__webpack_exports__);
  631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  632. /* harmony export */ "render": () => (/* binding */ render)
  633. /* harmony export */ });
  634. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  635. var _withScopeId = function _withScopeId(n) {
  636. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  637. };
  638. var _hoisted_1 = {
  639. "class": "layout-topbar"
  640. };
  641. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  642. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  643. alt: "Logo",
  644. src: "/images/logo.svg",
  645. "class": "md:mr-3"
  646. }, null, -1
  647. /* HOISTED */
  648. );
  649. });
  650. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  651. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  652. /* HOISTED */
  653. );
  654. });
  655. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  656. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  657. "class": "pi pi-bars"
  658. }, null, -1
  659. /* HOISTED */
  660. );
  661. });
  662. var _hoisted_5 = [_hoisted_4];
  663. var _hoisted_6 = {
  664. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  665. };
  666. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": "pi pi-ellipsis-v"
  669. }, null, -1
  670. /* HOISTED */
  671. );
  672. });
  673. var _hoisted_8 = [_hoisted_7];
  674. var _hoisted_9 = {
  675. "class": "layout-topbar-menu hidden lg:flex origin-top"
  676. };
  677. var _hoisted_10 = {
  678. "class": "align-self-center"
  679. };
  680. var _hoisted_11 = {
  681. "class": "hidden lg:inline"
  682. };
  683. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  684. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": "pi pi-user"
  686. }, null, -1
  687. /* HOISTED */
  688. );
  689. });
  690. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  691. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  692. /* HOISTED */
  693. );
  694. });
  695. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  696. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  697. "class": "pi pi-sign-out"
  698. }, null, -1
  699. /* HOISTED */
  700. );
  701. });
  702. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  703. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  704. /* HOISTED */
  705. );
  706. });
  707. function render(_ctx, _cache, $props, $setup, $data, $options) {
  708. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  709. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  710. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  711. href: "/",
  712. "class": "layout-topbar-logo"
  713. }, {
  714. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  715. return [_hoisted_2, _hoisted_3];
  716. }),
  717. _: 1
  718. /* STABLE */
  719. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  720. "class": "p-link layout-menu-button layout-topbar-button",
  721. onClick: _cache[0] || (_cache[0] = function ($event) {
  722. return _ctx.$emit('menu-toggle', $event);
  723. })
  724. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  725. selector: '@next',
  726. enterClass: 'hidden',
  727. enterActiveClass: 'scalein',
  728. leaveToClass: 'hidden',
  729. leaveActiveClass: 'fadeout',
  730. hideOnOutsideClick: true
  731. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  732. /* TEXT */
  733. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  734. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  735. "class": "p-link layout-topbar-button"
  736. }, {
  737. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  738. return [_hoisted_12, _hoisted_13];
  739. }),
  740. _: 1
  741. /* STABLE */
  742. }, 8
  743. /* PROPS */
  744. , ["href"])), [[_directive_tooltip, {
  745. value: 'Ubah Profil',
  746. "class": 'layout-topbar-menu-tooltip'
  747. }, void 0, {
  748. bottom: true
  749. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  750. href: _ctx.route('logout'),
  751. as: "button",
  752. method: "post",
  753. "class": "p-link layout-topbar-button"
  754. }, {
  755. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  756. return [_hoisted_14, _hoisted_15];
  757. }),
  758. _: 1
  759. /* STABLE */
  760. }, 8
  761. /* PROPS */
  762. , ["href"])), [[_directive_tooltip, {
  763. value: 'Keluar',
  764. "class": 'layout-topbar-menu-tooltip'
  765. }, void 0, {
  766. bottom: true
  767. }]])])])]);
  768. }
  769. /***/ }),
  770. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  771. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  772. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  773. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  775. "use strict";
  776. __webpack_require__.r(__webpack_exports__);
  777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  778. /* harmony export */ "render": () => (/* binding */ render)
  779. /* harmony export */ });
  780. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  781. var _withScopeId = function _withScopeId(n) {
  782. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  783. };
  784. var _hoisted_1 = {
  785. "class": "layout-sidebar"
  786. };
  787. var _hoisted_2 = {
  788. "class": "layout-main-container"
  789. };
  790. var _hoisted_3 = {
  791. "class": "layout-main"
  792. };
  793. var _hoisted_4 = {
  794. key: 0,
  795. "class": "layout-mask p-component-overlay"
  796. };
  797. function render(_ctx, _cache, $props, $setup, $data, $options) {
  798. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  799. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  800. onClick: $setup.onWrapperClick
  801. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  802. onMenuToggle: $setup.onMenuToggle
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  804. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  805. }, null, 8
  806. /* PROPS */
  807. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  808. name: "layout-mask"
  809. }, {
  810. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  811. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  812. }),
  813. _: 1
  814. /* STABLE */
  815. })], 2
  816. /* CLASS */
  817. );
  818. }
  819. /***/ }),
  820. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66":
  821. /*!*****************************************************************************************************************************************************************************************************************************************************************************!*\
  822. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66 ***!
  823. \*****************************************************************************************************************************************************************************************************************************************************************************/
  824. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  825. "use strict";
  826. __webpack_require__.r(__webpack_exports__);
  827. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  828. /* harmony export */ "render": () => (/* binding */ render)
  829. /* harmony export */ });
  830. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  831. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Daftar Member", -1
  832. /* HOISTED */
  833. );
  834. var _hoisted_2 = {
  835. "class": "grid"
  836. };
  837. var _hoisted_3 = {
  838. "class": "col-12 md:col-8"
  839. };
  840. var _hoisted_4 = {
  841. "class": "flex align-items-center"
  842. };
  843. var _hoisted_5 = {
  844. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  845. };
  846. function render(_ctx, _cache, $props, $setup, $data, $options) {
  847. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  848. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  849. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  850. 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"], {
  851. title: "Daftar Member"
  852. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  853. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  854. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  855. "responsive-layout": "scroll",
  856. "column-resize-mode": "expand",
  857. value: $props.members.data,
  858. "row-hover": true,
  859. "striped-rows": true
  860. }, {
  861. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  862. 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, {
  863. "class": "w-full md:w-27rem",
  864. placeholder: "cari, contoh: tina",
  865. modelValue: $setup.search,
  866. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  867. return $setup.search = $event;
  868. })
  869. }, null, 8
  870. /* PROPS */
  871. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  872. label: "Tambah Member",
  873. "class": "p-button-outlined",
  874. icon: "pi pi-pencil",
  875. href: _ctx.route('members.create')
  876. }, null, 8
  877. /* PROPS */
  878. , ["href"])])])];
  879. }),
  880. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  881. 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.indexTable, function (value) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  883. field: value.field,
  884. header: value.header,
  885. key: value.field
  886. }, null, 8
  887. /* PROPS */
  888. , ["field", "header"]);
  889. }), 128
  890. /* KEYED_FRAGMENT */
  891. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  892. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  893. var data = _ref.data;
  894. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  895. icon: "pi pi-pencil",
  896. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  897. href: _ctx.route('members.edit', data.id)
  898. }, null, 8
  899. /* PROPS */
  900. , ["href"])];
  901. }),
  902. _: 1
  903. /* STABLE */
  904. })];
  905. }),
  906. _: 1
  907. /* STABLE */
  908. }, 8
  909. /* PROPS */
  910. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  911. links: $props.members.links
  912. }, null, 8
  913. /* PROPS */
  914. , ["links"])];
  915. }),
  916. _: 1
  917. /* STABLE */
  918. })], 64
  919. /* STABLE_FRAGMENT */
  920. );
  921. }
  922. /***/ }),
  923. /***/ "./resources/js/components/useSearchText.js":
  924. /*!**************************************************!*\
  925. !*** ./resources/js/components/useSearchText.js ***!
  926. \**************************************************/
  927. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  928. "use strict";
  929. __webpack_require__.r(__webpack_exports__);
  930. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  931. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  932. /* harmony export */ });
  933. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  934. function useSearchText(props) {
  935. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  936. return {
  937. search: search
  938. };
  939. }
  940. /***/ }),
  941. /***/ "./resources/js/pages/member/tableHeader.js":
  942. /*!**************************************************!*\
  943. !*** ./resources/js/pages/member/tableHeader.js ***!
  944. \**************************************************/
  945. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  946. "use strict";
  947. __webpack_require__.r(__webpack_exports__);
  948. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  949. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  950. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  951. /* harmony export */ });
  952. var indexTable = [{
  953. field: 'updatedAt',
  954. header: 'Diperbaharui'
  955. }, {
  956. field: 'name',
  957. header: 'Nama'
  958. }, {
  959. field: 'platNumber',
  960. header: 'Plat Kendaraan'
  961. }, {
  962. field: 'type',
  963. header: 'Jenis Member'
  964. }, {
  965. field: 'price',
  966. header: 'Tarif Member'
  967. }, {
  968. field: 'expDate',
  969. header: 'Berakhir'
  970. }];
  971. var platNumberTable = [{
  972. field: 'platNumber',
  973. header: 'Plat Kendaraan'
  974. }, {
  975. field: 'typeVehicle',
  976. header: 'Jenis Kendaraan'
  977. }];
  978. /***/ }),
  979. /***/ "./resources/js/utils/menu.js":
  980. /*!************************************!*\
  981. !*** ./resources/js/utils/menu.js ***!
  982. \************************************/
  983. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  984. "use strict";
  985. __webpack_require__.r(__webpack_exports__);
  986. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  987. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  988. /* harmony export */ });
  989. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  990. // Admin
  991. 1: [{
  992. label: 'Home',
  993. items: [{
  994. label: 'Dashboard',
  995. icon: 'pi pi-home',
  996. to: '/dashboards',
  997. component: 'home/Index'
  998. }]
  999. }, {
  1000. label: 'Master',
  1001. items: [{
  1002. label: 'User',
  1003. icon: 'pi pi-user',
  1004. to: '/users',
  1005. component: 'user/Index'
  1006. }]
  1007. }],
  1008. // Supervisor
  1009. 2: [{
  1010. label: 'Home',
  1011. items: [{
  1012. label: 'Dashboard',
  1013. icon: 'pi pi-home',
  1014. to: '/dashboards',
  1015. component: 'home/Index'
  1016. }]
  1017. }, {
  1018. label: 'Menu',
  1019. items: [{
  1020. label: 'Pengeluaran',
  1021. icon: 'pi pi-wallet',
  1022. to: '/expenses',
  1023. component: 'expense/Index'
  1024. }, {
  1025. label: 'Laporan',
  1026. icon: 'pi pi-book',
  1027. items: [{
  1028. label: 'Mutasi',
  1029. icon: 'pi pi-circle',
  1030. to: '/reports/mutations',
  1031. component: 'mutation/Report'
  1032. }]
  1033. }]
  1034. }, {
  1035. label: 'Master',
  1036. items: [{
  1037. label: 'Jenis Kendaraan',
  1038. icon: 'pi pi-car',
  1039. to: '/type-vehicles',
  1040. component: 'typevehicle/Index'
  1041. }, {
  1042. label: 'Jenis Member',
  1043. icon: 'pi pi-id-card',
  1044. to: '/type-members',
  1045. component: 'typemember/Index'
  1046. }]
  1047. }, {
  1048. label: 'Pengaturan',
  1049. items: [{
  1050. label: 'Tarif Parkir',
  1051. icon: 'pi pi-car',
  1052. to: '/parking-fees/create',
  1053. component: 'parkingfee/Create'
  1054. }]
  1055. }],
  1056. // Operator
  1057. 3: [{
  1058. label: 'Home',
  1059. items: [{
  1060. label: 'Dashboard',
  1061. icon: 'pi pi-home',
  1062. to: '/dashboards',
  1063. component: 'home/Index'
  1064. }]
  1065. }, {
  1066. label: 'Transaksi',
  1067. items: [{
  1068. label: 'Transaksi masuk dan keluar',
  1069. icon: 'pi pi-car',
  1070. to: '/transactions/create',
  1071. component: 'transaction/Create'
  1072. }]
  1073. }, {
  1074. label: 'Menu',
  1075. items: [{
  1076. label: 'Pengeluaran',
  1077. icon: 'pi pi-wallet',
  1078. to: '/expenses',
  1079. component: 'expense/Index'
  1080. }, {
  1081. label: 'Member',
  1082. icon: 'pi pi-id-card',
  1083. to: '/members',
  1084. component: 'member/Index'
  1085. }, {
  1086. label: 'Top Up',
  1087. icon: 'pi pi-car',
  1088. to: '/top-ups',
  1089. component: 'topup/Index'
  1090. }]
  1091. }]
  1092. });
  1093. /***/ }),
  1094. /***/ "./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":
  1095. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1096. !*** ./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 ***!
  1097. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1098. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1099. "use strict";
  1100. __webpack_require__.r(__webpack_exports__);
  1101. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1102. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1103. /* harmony export */ });
  1104. /* 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");
  1105. /* 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__);
  1106. // Imports
  1107. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1108. // Module
  1109. ___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}", ""]);
  1110. // Exports
  1111. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1112. /***/ }),
  1113. /***/ "./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":
  1114. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1115. !*** ./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 ***!
  1116. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1117. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1118. "use strict";
  1119. __webpack_require__.r(__webpack_exports__);
  1120. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1121. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1122. /* harmony export */ });
  1123. /* 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");
  1124. /* 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__);
  1125. // Imports
  1126. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1127. // Module
  1128. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1129. // Exports
  1130. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1131. /***/ }),
  1132. /***/ "./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":
  1133. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1134. !*** ./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 ***!
  1135. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1136. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1137. "use strict";
  1138. __webpack_require__.r(__webpack_exports__);
  1139. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1140. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1141. /* harmony export */ });
  1142. /* 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");
  1143. /* 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__);
  1144. // Imports
  1145. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1146. // Module
  1147. ___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}", ""]);
  1148. // Exports
  1149. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1150. /***/ }),
  1151. /***/ "./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":
  1152. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1153. !*** ./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 ***!
  1154. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1155. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1156. "use strict";
  1157. __webpack_require__.r(__webpack_exports__);
  1158. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1159. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1160. /* harmony export */ });
  1161. /* 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");
  1162. /* 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__);
  1163. // Imports
  1164. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1165. // Module
  1166. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1167. // Exports
  1168. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1169. /***/ }),
  1170. /***/ "./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":
  1171. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1172. !*** ./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 ***!
  1173. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1174. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1175. "use strict";
  1176. __webpack_require__.r(__webpack_exports__);
  1177. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1178. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1179. /* harmony export */ });
  1180. /* 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");
  1181. /* 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__);
  1182. // Imports
  1183. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1184. // Module
  1185. ___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}", ""]);
  1186. // Exports
  1187. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1188. /***/ }),
  1189. /***/ "./node_modules/lodash/lodash.js":
  1190. /*!***************************************!*\
  1191. !*** ./node_modules/lodash/lodash.js ***!
  1192. \***************************************/
  1193. /***/ (function(module, exports, __webpack_require__) {
  1194. /* module decorator */ module = __webpack_require__.nmd(module);
  1195. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1196. * @license
  1197. * Lodash <https://lodash.com/>
  1198. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1199. * Released under MIT license <https://lodash.com/license>
  1200. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1201. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1202. */
  1203. ;(function() {
  1204. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1205. var undefined;
  1206. /** Used as the semantic version number. */
  1207. var VERSION = '4.17.21';
  1208. /** Used as the size to enable large array optimizations. */
  1209. var LARGE_ARRAY_SIZE = 200;
  1210. /** Error message constants. */
  1211. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1212. FUNC_ERROR_TEXT = 'Expected a function',
  1213. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1214. /** Used to stand-in for `undefined` hash values. */
  1215. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1216. /** Used as the maximum memoize cache size. */
  1217. var MAX_MEMOIZE_SIZE = 500;
  1218. /** Used as the internal argument placeholder. */
  1219. var PLACEHOLDER = '__lodash_placeholder__';
  1220. /** Used to compose bitmasks for cloning. */
  1221. var CLONE_DEEP_FLAG = 1,
  1222. CLONE_FLAT_FLAG = 2,
  1223. CLONE_SYMBOLS_FLAG = 4;
  1224. /** Used to compose bitmasks for value comparisons. */
  1225. var COMPARE_PARTIAL_FLAG = 1,
  1226. COMPARE_UNORDERED_FLAG = 2;
  1227. /** Used to compose bitmasks for function metadata. */
  1228. var WRAP_BIND_FLAG = 1,
  1229. WRAP_BIND_KEY_FLAG = 2,
  1230. WRAP_CURRY_BOUND_FLAG = 4,
  1231. WRAP_CURRY_FLAG = 8,
  1232. WRAP_CURRY_RIGHT_FLAG = 16,
  1233. WRAP_PARTIAL_FLAG = 32,
  1234. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1235. WRAP_ARY_FLAG = 128,
  1236. WRAP_REARG_FLAG = 256,
  1237. WRAP_FLIP_FLAG = 512;
  1238. /** Used as default options for `_.truncate`. */
  1239. var DEFAULT_TRUNC_LENGTH = 30,
  1240. DEFAULT_TRUNC_OMISSION = '...';
  1241. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1242. var HOT_COUNT = 800,
  1243. HOT_SPAN = 16;
  1244. /** Used to indicate the type of lazy iteratees. */
  1245. var LAZY_FILTER_FLAG = 1,
  1246. LAZY_MAP_FLAG = 2,
  1247. LAZY_WHILE_FLAG = 3;
  1248. /** Used as references for various `Number` constants. */
  1249. var INFINITY = 1 / 0,
  1250. MAX_SAFE_INTEGER = 9007199254740991,
  1251. MAX_INTEGER = 1.7976931348623157e+308,
  1252. NAN = 0 / 0;
  1253. /** Used as references for the maximum length and index of an array. */
  1254. var MAX_ARRAY_LENGTH = 4294967295,
  1255. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1256. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1257. /** Used to associate wrap methods with their bit flags. */
  1258. var wrapFlags = [
  1259. ['ary', WRAP_ARY_FLAG],
  1260. ['bind', WRAP_BIND_FLAG],
  1261. ['bindKey', WRAP_BIND_KEY_FLAG],
  1262. ['curry', WRAP_CURRY_FLAG],
  1263. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1264. ['flip', WRAP_FLIP_FLAG],
  1265. ['partial', WRAP_PARTIAL_FLAG],
  1266. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1267. ['rearg', WRAP_REARG_FLAG]
  1268. ];
  1269. /** `Object#toString` result references. */
  1270. var argsTag = '[object Arguments]',
  1271. arrayTag = '[object Array]',
  1272. asyncTag = '[object AsyncFunction]',
  1273. boolTag = '[object Boolean]',
  1274. dateTag = '[object Date]',
  1275. domExcTag = '[object DOMException]',
  1276. errorTag = '[object Error]',
  1277. funcTag = '[object Function]',
  1278. genTag = '[object GeneratorFunction]',
  1279. mapTag = '[object Map]',
  1280. numberTag = '[object Number]',
  1281. nullTag = '[object Null]',
  1282. objectTag = '[object Object]',
  1283. promiseTag = '[object Promise]',
  1284. proxyTag = '[object Proxy]',
  1285. regexpTag = '[object RegExp]',
  1286. setTag = '[object Set]',
  1287. stringTag = '[object String]',
  1288. symbolTag = '[object Symbol]',
  1289. undefinedTag = '[object Undefined]',
  1290. weakMapTag = '[object WeakMap]',
  1291. weakSetTag = '[object WeakSet]';
  1292. var arrayBufferTag = '[object ArrayBuffer]',
  1293. dataViewTag = '[object DataView]',
  1294. float32Tag = '[object Float32Array]',
  1295. float64Tag = '[object Float64Array]',
  1296. int8Tag = '[object Int8Array]',
  1297. int16Tag = '[object Int16Array]',
  1298. int32Tag = '[object Int32Array]',
  1299. uint8Tag = '[object Uint8Array]',
  1300. uint8ClampedTag = '[object Uint8ClampedArray]',
  1301. uint16Tag = '[object Uint16Array]',
  1302. uint32Tag = '[object Uint32Array]';
  1303. /** Used to match empty string literals in compiled template source. */
  1304. var reEmptyStringLeading = /\b__p \+= '';/g,
  1305. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1306. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1307. /** Used to match HTML entities and HTML characters. */
  1308. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1309. reUnescapedHtml = /[&<>"']/g,
  1310. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1311. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1312. /** Used to match template delimiters. */
  1313. var reEscape = /<%-([\s\S]+?)%>/g,
  1314. reEvaluate = /<%([\s\S]+?)%>/g,
  1315. reInterpolate = /<%=([\s\S]+?)%>/g;
  1316. /** Used to match property names within property paths. */
  1317. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1318. reIsPlainProp = /^\w*$/,
  1319. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1320. /**
  1321. * Used to match `RegExp`
  1322. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1323. */
  1324. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1325. reHasRegExpChar = RegExp(reRegExpChar.source);
  1326. /** Used to match leading whitespace. */
  1327. var reTrimStart = /^\s+/;
  1328. /** Used to match a single whitespace character. */
  1329. var reWhitespace = /\s/;
  1330. /** Used to match wrap detail comments. */
  1331. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1332. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1333. reSplitDetails = /,? & /;
  1334. /** Used to match words composed of alphanumeric characters. */
  1335. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1336. /**
  1337. * Used to validate the `validate` option in `_.template` variable.
  1338. *
  1339. * Forbids characters which could potentially change the meaning of the function argument definition:
  1340. * - "()," (modification of function parameters)
  1341. * - "=" (default value)
  1342. * - "[]{}" (destructuring of function parameters)
  1343. * - "/" (beginning of a comment)
  1344. * - whitespace
  1345. */
  1346. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1347. /** Used to match backslashes in property paths. */
  1348. var reEscapeChar = /\\(\\)?/g;
  1349. /**
  1350. * Used to match
  1351. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1352. */
  1353. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1354. /** Used to match `RegExp` flags from their coerced string values. */
  1355. var reFlags = /\w*$/;
  1356. /** Used to detect bad signed hexadecimal string values. */
  1357. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1358. /** Used to detect binary string values. */
  1359. var reIsBinary = /^0b[01]+$/i;
  1360. /** Used to detect host constructors (Safari). */
  1361. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1362. /** Used to detect octal string values. */
  1363. var reIsOctal = /^0o[0-7]+$/i;
  1364. /** Used to detect unsigned integer values. */
  1365. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1366. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1367. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1368. /** Used to ensure capturing order of template delimiters. */
  1369. var reNoMatch = /($^)/;
  1370. /** Used to match unescaped characters in compiled string literals. */
  1371. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1372. /** Used to compose unicode character classes. */
  1373. var rsAstralRange = '\\ud800-\\udfff',
  1374. rsComboMarksRange = '\\u0300-\\u036f',
  1375. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1376. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1377. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1378. rsDingbatRange = '\\u2700-\\u27bf',
  1379. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1380. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1381. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1382. rsPunctuationRange = '\\u2000-\\u206f',
  1383. 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',
  1384. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1385. rsVarRange = '\\ufe0e\\ufe0f',
  1386. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1387. /** Used to compose unicode capture groups. */
  1388. var rsApos = "['\u2019]",
  1389. rsAstral = '[' + rsAstralRange + ']',
  1390. rsBreak = '[' + rsBreakRange + ']',
  1391. rsCombo = '[' + rsComboRange + ']',
  1392. rsDigits = '\\d+',
  1393. rsDingbat = '[' + rsDingbatRange + ']',
  1394. rsLower = '[' + rsLowerRange + ']',
  1395. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1396. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1397. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1398. rsNonAstral = '[^' + rsAstralRange + ']',
  1399. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1400. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1401. rsUpper = '[' + rsUpperRange + ']',
  1402. rsZWJ = '\\u200d';
  1403. /** Used to compose unicode regexes. */
  1404. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1405. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1406. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1407. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1408. reOptMod = rsModifier + '?',
  1409. rsOptVar = '[' + rsVarRange + ']?',
  1410. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1411. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1412. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1413. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1414. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1415. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1416. /** Used to match apostrophes. */
  1417. var reApos = RegExp(rsApos, 'g');
  1418. /**
  1419. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1420. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1421. */
  1422. var reComboMark = RegExp(rsCombo, 'g');
  1423. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1424. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1425. /** Used to match complex or compound words. */
  1426. var reUnicodeWord = RegExp([
  1427. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1428. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1429. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1430. rsUpper + '+' + rsOptContrUpper,
  1431. rsOrdUpper,
  1432. rsOrdLower,
  1433. rsDigits,
  1434. rsEmoji
  1435. ].join('|'), 'g');
  1436. /** 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/). */
  1437. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1438. /** Used to detect strings that need a more robust regexp to match words. */
  1439. 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 ]/;
  1440. /** Used to assign default `context` object properties. */
  1441. var contextProps = [
  1442. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1443. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1444. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1445. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1446. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1447. ];
  1448. /** Used to make template sourceURLs easier to identify. */
  1449. var templateCounter = -1;
  1450. /** Used to identify `toStringTag` values of typed arrays. */
  1451. var typedArrayTags = {};
  1452. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1453. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1454. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1455. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1456. typedArrayTags[uint32Tag] = true;
  1457. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1458. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1459. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1460. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1461. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1462. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1463. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1464. typedArrayTags[weakMapTag] = false;
  1465. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1466. var cloneableTags = {};
  1467. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1468. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1469. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1470. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1471. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1472. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1473. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1474. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1475. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1476. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1477. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1478. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1479. cloneableTags[weakMapTag] = false;
  1480. /** Used to map Latin Unicode letters to basic Latin letters. */
  1481. var deburredLetters = {
  1482. // Latin-1 Supplement block.
  1483. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1484. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1485. '\xc7': 'C', '\xe7': 'c',
  1486. '\xd0': 'D', '\xf0': 'd',
  1487. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1488. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1489. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1490. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1491. '\xd1': 'N', '\xf1': 'n',
  1492. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1493. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1494. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1495. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1496. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1497. '\xc6': 'Ae', '\xe6': 'ae',
  1498. '\xde': 'Th', '\xfe': 'th',
  1499. '\xdf': 'ss',
  1500. // Latin Extended-A block.
  1501. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1502. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1503. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1504. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1505. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1506. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1507. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1508. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1509. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1510. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1511. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1512. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1513. '\u0134': 'J', '\u0135': 'j',
  1514. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1515. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1516. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1517. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1518. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1519. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1520. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1521. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1522. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1523. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1524. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1525. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1526. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1527. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1528. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1529. '\u0174': 'W', '\u0175': 'w',
  1530. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1531. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1532. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1533. '\u0132': 'IJ', '\u0133': 'ij',
  1534. '\u0152': 'Oe', '\u0153': 'oe',
  1535. '\u0149': "'n", '\u017f': 's'
  1536. };
  1537. /** Used to map characters to HTML entities. */
  1538. var htmlEscapes = {
  1539. '&': '&amp;',
  1540. '<': '&lt;',
  1541. '>': '&gt;',
  1542. '"': '&quot;',
  1543. "'": '&#39;'
  1544. };
  1545. /** Used to map HTML entities to characters. */
  1546. var htmlUnescapes = {
  1547. '&amp;': '&',
  1548. '&lt;': '<',
  1549. '&gt;': '>',
  1550. '&quot;': '"',
  1551. '&#39;': "'"
  1552. };
  1553. /** Used to escape characters for inclusion in compiled string literals. */
  1554. var stringEscapes = {
  1555. '\\': '\\',
  1556. "'": "'",
  1557. '\n': 'n',
  1558. '\r': 'r',
  1559. '\u2028': 'u2028',
  1560. '\u2029': 'u2029'
  1561. };
  1562. /** Built-in method references without a dependency on `root`. */
  1563. var freeParseFloat = parseFloat,
  1564. freeParseInt = parseInt;
  1565. /** Detect free variable `global` from Node.js. */
  1566. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1567. /** Detect free variable `self`. */
  1568. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1569. /** Used as a reference to the global object. */
  1570. var root = freeGlobal || freeSelf || Function('return this')();
  1571. /** Detect free variable `exports`. */
  1572. var freeExports = true && exports && !exports.nodeType && exports;
  1573. /** Detect free variable `module`. */
  1574. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1575. /** Detect the popular CommonJS extension `module.exports`. */
  1576. var moduleExports = freeModule && freeModule.exports === freeExports;
  1577. /** Detect free variable `process` from Node.js. */
  1578. var freeProcess = moduleExports && freeGlobal.process;
  1579. /** Used to access faster Node.js helpers. */
  1580. var nodeUtil = (function() {
  1581. try {
  1582. // Use `util.types` for Node.js 10+.
  1583. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1584. if (types) {
  1585. return types;
  1586. }
  1587. // Legacy `process.binding('util')` for Node.js < 10.
  1588. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1589. } catch (e) {}
  1590. }());
  1591. /* Node.js helper references. */
  1592. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1593. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1594. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1595. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1596. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1597. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1598. /*--------------------------------------------------------------------------*/
  1599. /**
  1600. * A faster alternative to `Function#apply`, this function invokes `func`
  1601. * with the `this` binding of `thisArg` and the arguments of `args`.
  1602. *
  1603. * @private
  1604. * @param {Function} func The function to invoke.
  1605. * @param {*} thisArg The `this` binding of `func`.
  1606. * @param {Array} args The arguments to invoke `func` with.
  1607. * @returns {*} Returns the result of `func`.
  1608. */
  1609. function apply(func, thisArg, args) {
  1610. switch (args.length) {
  1611. case 0: return func.call(thisArg);
  1612. case 1: return func.call(thisArg, args[0]);
  1613. case 2: return func.call(thisArg, args[0], args[1]);
  1614. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1615. }
  1616. return func.apply(thisArg, args);
  1617. }
  1618. /**
  1619. * A specialized version of `baseAggregator` for arrays.
  1620. *
  1621. * @private
  1622. * @param {Array} [array] The array to iterate over.
  1623. * @param {Function} setter The function to set `accumulator` values.
  1624. * @param {Function} iteratee The iteratee to transform keys.
  1625. * @param {Object} accumulator The initial aggregated object.
  1626. * @returns {Function} Returns `accumulator`.
  1627. */
  1628. function arrayAggregator(array, setter, iteratee, accumulator) {
  1629. var index = -1,
  1630. length = array == null ? 0 : array.length;
  1631. while (++index < length) {
  1632. var value = array[index];
  1633. setter(accumulator, value, iteratee(value), array);
  1634. }
  1635. return accumulator;
  1636. }
  1637. /**
  1638. * A specialized version of `_.forEach` for arrays without support for
  1639. * iteratee shorthands.
  1640. *
  1641. * @private
  1642. * @param {Array} [array] The array to iterate over.
  1643. * @param {Function} iteratee The function invoked per iteration.
  1644. * @returns {Array} Returns `array`.
  1645. */
  1646. function arrayEach(array, iteratee) {
  1647. var index = -1,
  1648. length = array == null ? 0 : array.length;
  1649. while (++index < length) {
  1650. if (iteratee(array[index], index, array) === false) {
  1651. break;
  1652. }
  1653. }
  1654. return array;
  1655. }
  1656. /**
  1657. * A specialized version of `_.forEachRight` for arrays without support for
  1658. * iteratee shorthands.
  1659. *
  1660. * @private
  1661. * @param {Array} [array] The array to iterate over.
  1662. * @param {Function} iteratee The function invoked per iteration.
  1663. * @returns {Array} Returns `array`.
  1664. */
  1665. function arrayEachRight(array, iteratee) {
  1666. var length = array == null ? 0 : array.length;
  1667. while (length--) {
  1668. if (iteratee(array[length], length, array) === false) {
  1669. break;
  1670. }
  1671. }
  1672. return array;
  1673. }
  1674. /**
  1675. * A specialized version of `_.every` for arrays without support for
  1676. * iteratee shorthands.
  1677. *
  1678. * @private
  1679. * @param {Array} [array] The array to iterate over.
  1680. * @param {Function} predicate The function invoked per iteration.
  1681. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1682. * else `false`.
  1683. */
  1684. function arrayEvery(array, predicate) {
  1685. var index = -1,
  1686. length = array == null ? 0 : array.length;
  1687. while (++index < length) {
  1688. if (!predicate(array[index], index, array)) {
  1689. return false;
  1690. }
  1691. }
  1692. return true;
  1693. }
  1694. /**
  1695. * A specialized version of `_.filter` for arrays without support for
  1696. * iteratee shorthands.
  1697. *
  1698. * @private
  1699. * @param {Array} [array] The array to iterate over.
  1700. * @param {Function} predicate The function invoked per iteration.
  1701. * @returns {Array} Returns the new filtered array.
  1702. */
  1703. function arrayFilter(array, predicate) {
  1704. var index = -1,
  1705. length = array == null ? 0 : array.length,
  1706. resIndex = 0,
  1707. result = [];
  1708. while (++index < length) {
  1709. var value = array[index];
  1710. if (predicate(value, index, array)) {
  1711. result[resIndex++] = value;
  1712. }
  1713. }
  1714. return result;
  1715. }
  1716. /**
  1717. * A specialized version of `_.includes` for arrays without support for
  1718. * specifying an index to search from.
  1719. *
  1720. * @private
  1721. * @param {Array} [array] The array to inspect.
  1722. * @param {*} target The value to search for.
  1723. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1724. */
  1725. function arrayIncludes(array, value) {
  1726. var length = array == null ? 0 : array.length;
  1727. return !!length && baseIndexOf(array, value, 0) > -1;
  1728. }
  1729. /**
  1730. * This function is like `arrayIncludes` except that it accepts a comparator.
  1731. *
  1732. * @private
  1733. * @param {Array} [array] The array to inspect.
  1734. * @param {*} target The value to search for.
  1735. * @param {Function} comparator The comparator invoked per element.
  1736. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1737. */
  1738. function arrayIncludesWith(array, value, comparator) {
  1739. var index = -1,
  1740. length = array == null ? 0 : array.length;
  1741. while (++index < length) {
  1742. if (comparator(value, array[index])) {
  1743. return true;
  1744. }
  1745. }
  1746. return false;
  1747. }
  1748. /**
  1749. * A specialized version of `_.map` for arrays without support for iteratee
  1750. * shorthands.
  1751. *
  1752. * @private
  1753. * @param {Array} [array] The array to iterate over.
  1754. * @param {Function} iteratee The function invoked per iteration.
  1755. * @returns {Array} Returns the new mapped array.
  1756. */
  1757. function arrayMap(array, iteratee) {
  1758. var index = -1,
  1759. length = array == null ? 0 : array.length,
  1760. result = Array(length);
  1761. while (++index < length) {
  1762. result[index] = iteratee(array[index], index, array);
  1763. }
  1764. return result;
  1765. }
  1766. /**
  1767. * Appends the elements of `values` to `array`.
  1768. *
  1769. * @private
  1770. * @param {Array} array The array to modify.
  1771. * @param {Array} values The values to append.
  1772. * @returns {Array} Returns `array`.
  1773. */
  1774. function arrayPush(array, values) {
  1775. var index = -1,
  1776. length = values.length,
  1777. offset = array.length;
  1778. while (++index < length) {
  1779. array[offset + index] = values[index];
  1780. }
  1781. return array;
  1782. }
  1783. /**
  1784. * A specialized version of `_.reduce` for arrays without support for
  1785. * iteratee shorthands.
  1786. *
  1787. * @private
  1788. * @param {Array} [array] The array to iterate over.
  1789. * @param {Function} iteratee The function invoked per iteration.
  1790. * @param {*} [accumulator] The initial value.
  1791. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1792. * the initial value.
  1793. * @returns {*} Returns the accumulated value.
  1794. */
  1795. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1796. var index = -1,
  1797. length = array == null ? 0 : array.length;
  1798. if (initAccum && length) {
  1799. accumulator = array[++index];
  1800. }
  1801. while (++index < length) {
  1802. accumulator = iteratee(accumulator, array[index], index, array);
  1803. }
  1804. return accumulator;
  1805. }
  1806. /**
  1807. * A specialized version of `_.reduceRight` for arrays without support for
  1808. * iteratee shorthands.
  1809. *
  1810. * @private
  1811. * @param {Array} [array] The array to iterate over.
  1812. * @param {Function} iteratee The function invoked per iteration.
  1813. * @param {*} [accumulator] The initial value.
  1814. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1815. * the initial value.
  1816. * @returns {*} Returns the accumulated value.
  1817. */
  1818. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1819. var length = array == null ? 0 : array.length;
  1820. if (initAccum && length) {
  1821. accumulator = array[--length];
  1822. }
  1823. while (length--) {
  1824. accumulator = iteratee(accumulator, array[length], length, array);
  1825. }
  1826. return accumulator;
  1827. }
  1828. /**
  1829. * A specialized version of `_.some` for arrays without support for iteratee
  1830. * shorthands.
  1831. *
  1832. * @private
  1833. * @param {Array} [array] The array to iterate over.
  1834. * @param {Function} predicate The function invoked per iteration.
  1835. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1836. * else `false`.
  1837. */
  1838. function arraySome(array, predicate) {
  1839. var index = -1,
  1840. length = array == null ? 0 : array.length;
  1841. while (++index < length) {
  1842. if (predicate(array[index], index, array)) {
  1843. return true;
  1844. }
  1845. }
  1846. return false;
  1847. }
  1848. /**
  1849. * Gets the size of an ASCII `string`.
  1850. *
  1851. * @private
  1852. * @param {string} string The string inspect.
  1853. * @returns {number} Returns the string size.
  1854. */
  1855. var asciiSize = baseProperty('length');
  1856. /**
  1857. * Converts an ASCII `string` to an array.
  1858. *
  1859. * @private
  1860. * @param {string} string The string to convert.
  1861. * @returns {Array} Returns the converted array.
  1862. */
  1863. function asciiToArray(string) {
  1864. return string.split('');
  1865. }
  1866. /**
  1867. * Splits an ASCII `string` into an array of its words.
  1868. *
  1869. * @private
  1870. * @param {string} The string to inspect.
  1871. * @returns {Array} Returns the words of `string`.
  1872. */
  1873. function asciiWords(string) {
  1874. return string.match(reAsciiWord) || [];
  1875. }
  1876. /**
  1877. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1878. * without support for iteratee shorthands, which iterates over `collection`
  1879. * using `eachFunc`.
  1880. *
  1881. * @private
  1882. * @param {Array|Object} collection The collection to inspect.
  1883. * @param {Function} predicate The function invoked per iteration.
  1884. * @param {Function} eachFunc The function to iterate over `collection`.
  1885. * @returns {*} Returns the found element or its key, else `undefined`.
  1886. */
  1887. function baseFindKey(collection, predicate, eachFunc) {
  1888. var result;
  1889. eachFunc(collection, function(value, key, collection) {
  1890. if (predicate(value, key, collection)) {
  1891. result = key;
  1892. return false;
  1893. }
  1894. });
  1895. return result;
  1896. }
  1897. /**
  1898. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1899. * support for iteratee shorthands.
  1900. *
  1901. * @private
  1902. * @param {Array} array The array to inspect.
  1903. * @param {Function} predicate The function invoked per iteration.
  1904. * @param {number} fromIndex The index to search from.
  1905. * @param {boolean} [fromRight] Specify iterating from right to left.
  1906. * @returns {number} Returns the index of the matched value, else `-1`.
  1907. */
  1908. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1909. var length = array.length,
  1910. index = fromIndex + (fromRight ? 1 : -1);
  1911. while ((fromRight ? index-- : ++index < length)) {
  1912. if (predicate(array[index], index, array)) {
  1913. return index;
  1914. }
  1915. }
  1916. return -1;
  1917. }
  1918. /**
  1919. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1920. *
  1921. * @private
  1922. * @param {Array} array The array to inspect.
  1923. * @param {*} value The value to search for.
  1924. * @param {number} fromIndex The index to search from.
  1925. * @returns {number} Returns the index of the matched value, else `-1`.
  1926. */
  1927. function baseIndexOf(array, value, fromIndex) {
  1928. return value === value
  1929. ? strictIndexOf(array, value, fromIndex)
  1930. : baseFindIndex(array, baseIsNaN, fromIndex);
  1931. }
  1932. /**
  1933. * This function is like `baseIndexOf` except that it accepts a comparator.
  1934. *
  1935. * @private
  1936. * @param {Array} array The array to inspect.
  1937. * @param {*} value The value to search for.
  1938. * @param {number} fromIndex The index to search from.
  1939. * @param {Function} comparator The comparator invoked per element.
  1940. * @returns {number} Returns the index of the matched value, else `-1`.
  1941. */
  1942. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1943. var index = fromIndex - 1,
  1944. length = array.length;
  1945. while (++index < length) {
  1946. if (comparator(array[index], value)) {
  1947. return index;
  1948. }
  1949. }
  1950. return -1;
  1951. }
  1952. /**
  1953. * The base implementation of `_.isNaN` without support for number objects.
  1954. *
  1955. * @private
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1958. */
  1959. function baseIsNaN(value) {
  1960. return value !== value;
  1961. }
  1962. /**
  1963. * The base implementation of `_.mean` and `_.meanBy` without support for
  1964. * iteratee shorthands.
  1965. *
  1966. * @private
  1967. * @param {Array} array The array to iterate over.
  1968. * @param {Function} iteratee The function invoked per iteration.
  1969. * @returns {number} Returns the mean.
  1970. */
  1971. function baseMean(array, iteratee) {
  1972. var length = array == null ? 0 : array.length;
  1973. return length ? (baseSum(array, iteratee) / length) : NAN;
  1974. }
  1975. /**
  1976. * The base implementation of `_.property` without support for deep paths.
  1977. *
  1978. * @private
  1979. * @param {string} key The key of the property to get.
  1980. * @returns {Function} Returns the new accessor function.
  1981. */
  1982. function baseProperty(key) {
  1983. return function(object) {
  1984. return object == null ? undefined : object[key];
  1985. };
  1986. }
  1987. /**
  1988. * The base implementation of `_.propertyOf` without support for deep paths.
  1989. *
  1990. * @private
  1991. * @param {Object} object The object to query.
  1992. * @returns {Function} Returns the new accessor function.
  1993. */
  1994. function basePropertyOf(object) {
  1995. return function(key) {
  1996. return object == null ? undefined : object[key];
  1997. };
  1998. }
  1999. /**
  2000. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2001. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2002. *
  2003. * @private
  2004. * @param {Array|Object} collection The collection to iterate over.
  2005. * @param {Function} iteratee The function invoked per iteration.
  2006. * @param {*} accumulator The initial value.
  2007. * @param {boolean} initAccum Specify using the first or last element of
  2008. * `collection` as the initial value.
  2009. * @param {Function} eachFunc The function to iterate over `collection`.
  2010. * @returns {*} Returns the accumulated value.
  2011. */
  2012. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2013. eachFunc(collection, function(value, index, collection) {
  2014. accumulator = initAccum
  2015. ? (initAccum = false, value)
  2016. : iteratee(accumulator, value, index, collection);
  2017. });
  2018. return accumulator;
  2019. }
  2020. /**
  2021. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2022. * sort order of `array` and replaces criteria objects with their corresponding
  2023. * values.
  2024. *
  2025. * @private
  2026. * @param {Array} array The array to sort.
  2027. * @param {Function} comparer The function to define sort order.
  2028. * @returns {Array} Returns `array`.
  2029. */
  2030. function baseSortBy(array, comparer) {
  2031. var length = array.length;
  2032. array.sort(comparer);
  2033. while (length--) {
  2034. array[length] = array[length].value;
  2035. }
  2036. return array;
  2037. }
  2038. /**
  2039. * The base implementation of `_.sum` and `_.sumBy` without support for
  2040. * iteratee shorthands.
  2041. *
  2042. * @private
  2043. * @param {Array} array The array to iterate over.
  2044. * @param {Function} iteratee The function invoked per iteration.
  2045. * @returns {number} Returns the sum.
  2046. */
  2047. function baseSum(array, iteratee) {
  2048. var result,
  2049. index = -1,
  2050. length = array.length;
  2051. while (++index < length) {
  2052. var current = iteratee(array[index]);
  2053. if (current !== undefined) {
  2054. result = result === undefined ? current : (result + current);
  2055. }
  2056. }
  2057. return result;
  2058. }
  2059. /**
  2060. * The base implementation of `_.times` without support for iteratee shorthands
  2061. * or max array length checks.
  2062. *
  2063. * @private
  2064. * @param {number} n The number of times to invoke `iteratee`.
  2065. * @param {Function} iteratee The function invoked per iteration.
  2066. * @returns {Array} Returns the array of results.
  2067. */
  2068. function baseTimes(n, iteratee) {
  2069. var index = -1,
  2070. result = Array(n);
  2071. while (++index < n) {
  2072. result[index] = iteratee(index);
  2073. }
  2074. return result;
  2075. }
  2076. /**
  2077. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2078. * of key-value pairs for `object` corresponding to the property names of `props`.
  2079. *
  2080. * @private
  2081. * @param {Object} object The object to query.
  2082. * @param {Array} props The property names to get values for.
  2083. * @returns {Object} Returns the key-value pairs.
  2084. */
  2085. function baseToPairs(object, props) {
  2086. return arrayMap(props, function(key) {
  2087. return [key, object[key]];
  2088. });
  2089. }
  2090. /**
  2091. * The base implementation of `_.trim`.
  2092. *
  2093. * @private
  2094. * @param {string} string The string to trim.
  2095. * @returns {string} Returns the trimmed string.
  2096. */
  2097. function baseTrim(string) {
  2098. return string
  2099. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2100. : string;
  2101. }
  2102. /**
  2103. * The base implementation of `_.unary` without support for storing metadata.
  2104. *
  2105. * @private
  2106. * @param {Function} func The function to cap arguments for.
  2107. * @returns {Function} Returns the new capped function.
  2108. */
  2109. function baseUnary(func) {
  2110. return function(value) {
  2111. return func(value);
  2112. };
  2113. }
  2114. /**
  2115. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2116. * array of `object` property values corresponding to the property names
  2117. * of `props`.
  2118. *
  2119. * @private
  2120. * @param {Object} object The object to query.
  2121. * @param {Array} props The property names to get values for.
  2122. * @returns {Object} Returns the array of property values.
  2123. */
  2124. function baseValues(object, props) {
  2125. return arrayMap(props, function(key) {
  2126. return object[key];
  2127. });
  2128. }
  2129. /**
  2130. * Checks if a `cache` value for `key` exists.
  2131. *
  2132. * @private
  2133. * @param {Object} cache The cache to query.
  2134. * @param {string} key The key of the entry to check.
  2135. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2136. */
  2137. function cacheHas(cache, key) {
  2138. return cache.has(key);
  2139. }
  2140. /**
  2141. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2142. * that is not found in the character symbols.
  2143. *
  2144. * @private
  2145. * @param {Array} strSymbols The string symbols to inspect.
  2146. * @param {Array} chrSymbols The character symbols to find.
  2147. * @returns {number} Returns the index of the first unmatched string symbol.
  2148. */
  2149. function charsStartIndex(strSymbols, chrSymbols) {
  2150. var index = -1,
  2151. length = strSymbols.length;
  2152. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2153. return index;
  2154. }
  2155. /**
  2156. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2157. * that is not found in the character symbols.
  2158. *
  2159. * @private
  2160. * @param {Array} strSymbols The string symbols to inspect.
  2161. * @param {Array} chrSymbols The character symbols to find.
  2162. * @returns {number} Returns the index of the last unmatched string symbol.
  2163. */
  2164. function charsEndIndex(strSymbols, chrSymbols) {
  2165. var index = strSymbols.length;
  2166. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2167. return index;
  2168. }
  2169. /**
  2170. * Gets the number of `placeholder` occurrences in `array`.
  2171. *
  2172. * @private
  2173. * @param {Array} array The array to inspect.
  2174. * @param {*} placeholder The placeholder to search for.
  2175. * @returns {number} Returns the placeholder count.
  2176. */
  2177. function countHolders(array, placeholder) {
  2178. var length = array.length,
  2179. result = 0;
  2180. while (length--) {
  2181. if (array[length] === placeholder) {
  2182. ++result;
  2183. }
  2184. }
  2185. return result;
  2186. }
  2187. /**
  2188. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2189. * letters to basic Latin letters.
  2190. *
  2191. * @private
  2192. * @param {string} letter The matched letter to deburr.
  2193. * @returns {string} Returns the deburred letter.
  2194. */
  2195. var deburrLetter = basePropertyOf(deburredLetters);
  2196. /**
  2197. * Used by `_.escape` to convert characters to HTML entities.
  2198. *
  2199. * @private
  2200. * @param {string} chr The matched character to escape.
  2201. * @returns {string} Returns the escaped character.
  2202. */
  2203. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2204. /**
  2205. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2206. *
  2207. * @private
  2208. * @param {string} chr The matched character to escape.
  2209. * @returns {string} Returns the escaped character.
  2210. */
  2211. function escapeStringChar(chr) {
  2212. return '\\' + stringEscapes[chr];
  2213. }
  2214. /**
  2215. * Gets the value at `key` of `object`.
  2216. *
  2217. * @private
  2218. * @param {Object} [object] The object to query.
  2219. * @param {string} key The key of the property to get.
  2220. * @returns {*} Returns the property value.
  2221. */
  2222. function getValue(object, key) {
  2223. return object == null ? undefined : object[key];
  2224. }
  2225. /**
  2226. * Checks if `string` contains Unicode symbols.
  2227. *
  2228. * @private
  2229. * @param {string} string The string to inspect.
  2230. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2231. */
  2232. function hasUnicode(string) {
  2233. return reHasUnicode.test(string);
  2234. }
  2235. /**
  2236. * Checks if `string` contains a word composed of Unicode symbols.
  2237. *
  2238. * @private
  2239. * @param {string} string The string to inspect.
  2240. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2241. */
  2242. function hasUnicodeWord(string) {
  2243. return reHasUnicodeWord.test(string);
  2244. }
  2245. /**
  2246. * Converts `iterator` to an array.
  2247. *
  2248. * @private
  2249. * @param {Object} iterator The iterator to convert.
  2250. * @returns {Array} Returns the converted array.
  2251. */
  2252. function iteratorToArray(iterator) {
  2253. var data,
  2254. result = [];
  2255. while (!(data = iterator.next()).done) {
  2256. result.push(data.value);
  2257. }
  2258. return result;
  2259. }
  2260. /**
  2261. * Converts `map` to its key-value pairs.
  2262. *
  2263. * @private
  2264. * @param {Object} map The map to convert.
  2265. * @returns {Array} Returns the key-value pairs.
  2266. */
  2267. function mapToArray(map) {
  2268. var index = -1,
  2269. result = Array(map.size);
  2270. map.forEach(function(value, key) {
  2271. result[++index] = [key, value];
  2272. });
  2273. return result;
  2274. }
  2275. /**
  2276. * Creates a unary function that invokes `func` with its argument transformed.
  2277. *
  2278. * @private
  2279. * @param {Function} func The function to wrap.
  2280. * @param {Function} transform The argument transform.
  2281. * @returns {Function} Returns the new function.
  2282. */
  2283. function overArg(func, transform) {
  2284. return function(arg) {
  2285. return func(transform(arg));
  2286. };
  2287. }
  2288. /**
  2289. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2290. * and returns an array of their indexes.
  2291. *
  2292. * @private
  2293. * @param {Array} array The array to modify.
  2294. * @param {*} placeholder The placeholder to replace.
  2295. * @returns {Array} Returns the new array of placeholder indexes.
  2296. */
  2297. function replaceHolders(array, placeholder) {
  2298. var index = -1,
  2299. length = array.length,
  2300. resIndex = 0,
  2301. result = [];
  2302. while (++index < length) {
  2303. var value = array[index];
  2304. if (value === placeholder || value === PLACEHOLDER) {
  2305. array[index] = PLACEHOLDER;
  2306. result[resIndex++] = index;
  2307. }
  2308. }
  2309. return result;
  2310. }
  2311. /**
  2312. * Converts `set` to an array of its values.
  2313. *
  2314. * @private
  2315. * @param {Object} set The set to convert.
  2316. * @returns {Array} Returns the values.
  2317. */
  2318. function setToArray(set) {
  2319. var index = -1,
  2320. result = Array(set.size);
  2321. set.forEach(function(value) {
  2322. result[++index] = value;
  2323. });
  2324. return result;
  2325. }
  2326. /**
  2327. * Converts `set` to its value-value pairs.
  2328. *
  2329. * @private
  2330. * @param {Object} set The set to convert.
  2331. * @returns {Array} Returns the value-value pairs.
  2332. */
  2333. function setToPairs(set) {
  2334. var index = -1,
  2335. result = Array(set.size);
  2336. set.forEach(function(value) {
  2337. result[++index] = [value, value];
  2338. });
  2339. return result;
  2340. }
  2341. /**
  2342. * A specialized version of `_.indexOf` which performs strict equality
  2343. * comparisons of values, i.e. `===`.
  2344. *
  2345. * @private
  2346. * @param {Array} array The array to inspect.
  2347. * @param {*} value The value to search for.
  2348. * @param {number} fromIndex The index to search from.
  2349. * @returns {number} Returns the index of the matched value, else `-1`.
  2350. */
  2351. function strictIndexOf(array, value, fromIndex) {
  2352. var index = fromIndex - 1,
  2353. length = array.length;
  2354. while (++index < length) {
  2355. if (array[index] === value) {
  2356. return index;
  2357. }
  2358. }
  2359. return -1;
  2360. }
  2361. /**
  2362. * A specialized version of `_.lastIndexOf` which performs strict equality
  2363. * comparisons of values, i.e. `===`.
  2364. *
  2365. * @private
  2366. * @param {Array} array The array to inspect.
  2367. * @param {*} value The value to search for.
  2368. * @param {number} fromIndex The index to search from.
  2369. * @returns {number} Returns the index of the matched value, else `-1`.
  2370. */
  2371. function strictLastIndexOf(array, value, fromIndex) {
  2372. var index = fromIndex + 1;
  2373. while (index--) {
  2374. if (array[index] === value) {
  2375. return index;
  2376. }
  2377. }
  2378. return index;
  2379. }
  2380. /**
  2381. * Gets the number of symbols in `string`.
  2382. *
  2383. * @private
  2384. * @param {string} string The string to inspect.
  2385. * @returns {number} Returns the string size.
  2386. */
  2387. function stringSize(string) {
  2388. return hasUnicode(string)
  2389. ? unicodeSize(string)
  2390. : asciiSize(string);
  2391. }
  2392. /**
  2393. * Converts `string` to an array.
  2394. *
  2395. * @private
  2396. * @param {string} string The string to convert.
  2397. * @returns {Array} Returns the converted array.
  2398. */
  2399. function stringToArray(string) {
  2400. return hasUnicode(string)
  2401. ? unicodeToArray(string)
  2402. : asciiToArray(string);
  2403. }
  2404. /**
  2405. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2406. * character of `string`.
  2407. *
  2408. * @private
  2409. * @param {string} string The string to inspect.
  2410. * @returns {number} Returns the index of the last non-whitespace character.
  2411. */
  2412. function trimmedEndIndex(string) {
  2413. var index = string.length;
  2414. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2415. return index;
  2416. }
  2417. /**
  2418. * Used by `_.unescape` to convert HTML entities to characters.
  2419. *
  2420. * @private
  2421. * @param {string} chr The matched character to unescape.
  2422. * @returns {string} Returns the unescaped character.
  2423. */
  2424. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2425. /**
  2426. * Gets the size of a Unicode `string`.
  2427. *
  2428. * @private
  2429. * @param {string} string The string inspect.
  2430. * @returns {number} Returns the string size.
  2431. */
  2432. function unicodeSize(string) {
  2433. var result = reUnicode.lastIndex = 0;
  2434. while (reUnicode.test(string)) {
  2435. ++result;
  2436. }
  2437. return result;
  2438. }
  2439. /**
  2440. * Converts a Unicode `string` to an array.
  2441. *
  2442. * @private
  2443. * @param {string} string The string to convert.
  2444. * @returns {Array} Returns the converted array.
  2445. */
  2446. function unicodeToArray(string) {
  2447. return string.match(reUnicode) || [];
  2448. }
  2449. /**
  2450. * Splits a Unicode `string` into an array of its words.
  2451. *
  2452. * @private
  2453. * @param {string} The string to inspect.
  2454. * @returns {Array} Returns the words of `string`.
  2455. */
  2456. function unicodeWords(string) {
  2457. return string.match(reUnicodeWord) || [];
  2458. }
  2459. /*--------------------------------------------------------------------------*/
  2460. /**
  2461. * Create a new pristine `lodash` function using the `context` object.
  2462. *
  2463. * @static
  2464. * @memberOf _
  2465. * @since 1.1.0
  2466. * @category Util
  2467. * @param {Object} [context=root] The context object.
  2468. * @returns {Function} Returns a new `lodash` function.
  2469. * @example
  2470. *
  2471. * _.mixin({ 'foo': _.constant('foo') });
  2472. *
  2473. * var lodash = _.runInContext();
  2474. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2475. *
  2476. * _.isFunction(_.foo);
  2477. * // => true
  2478. * _.isFunction(_.bar);
  2479. * // => false
  2480. *
  2481. * lodash.isFunction(lodash.foo);
  2482. * // => false
  2483. * lodash.isFunction(lodash.bar);
  2484. * // => true
  2485. *
  2486. * // Create a suped-up `defer` in Node.js.
  2487. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2488. */
  2489. var runInContext = (function runInContext(context) {
  2490. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2491. /** Built-in constructor references. */
  2492. var Array = context.Array,
  2493. Date = context.Date,
  2494. Error = context.Error,
  2495. Function = context.Function,
  2496. Math = context.Math,
  2497. Object = context.Object,
  2498. RegExp = context.RegExp,
  2499. String = context.String,
  2500. TypeError = context.TypeError;
  2501. /** Used for built-in method references. */
  2502. var arrayProto = Array.prototype,
  2503. funcProto = Function.prototype,
  2504. objectProto = Object.prototype;
  2505. /** Used to detect overreaching core-js shims. */
  2506. var coreJsData = context['__core-js_shared__'];
  2507. /** Used to resolve the decompiled source of functions. */
  2508. var funcToString = funcProto.toString;
  2509. /** Used to check objects for own properties. */
  2510. var hasOwnProperty = objectProto.hasOwnProperty;
  2511. /** Used to generate unique IDs. */
  2512. var idCounter = 0;
  2513. /** Used to detect methods masquerading as native. */
  2514. var maskSrcKey = (function() {
  2515. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2516. return uid ? ('Symbol(src)_1.' + uid) : '';
  2517. }());
  2518. /**
  2519. * Used to resolve the
  2520. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2521. * of values.
  2522. */
  2523. var nativeObjectToString = objectProto.toString;
  2524. /** Used to infer the `Object` constructor. */
  2525. var objectCtorString = funcToString.call(Object);
  2526. /** Used to restore the original `_` reference in `_.noConflict`. */
  2527. var oldDash = root._;
  2528. /** Used to detect if a method is native. */
  2529. var reIsNative = RegExp('^' +
  2530. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2531. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2532. );
  2533. /** Built-in value references. */
  2534. var Buffer = moduleExports ? context.Buffer : undefined,
  2535. Symbol = context.Symbol,
  2536. Uint8Array = context.Uint8Array,
  2537. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2538. getPrototype = overArg(Object.getPrototypeOf, Object),
  2539. objectCreate = Object.create,
  2540. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2541. splice = arrayProto.splice,
  2542. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2543. symIterator = Symbol ? Symbol.iterator : undefined,
  2544. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2545. var defineProperty = (function() {
  2546. try {
  2547. var func = getNative(Object, 'defineProperty');
  2548. func({}, '', {});
  2549. return func;
  2550. } catch (e) {}
  2551. }());
  2552. /** Mocked built-ins. */
  2553. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2554. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2555. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2556. /* Built-in method references for those with the same name as other `lodash` methods. */
  2557. var nativeCeil = Math.ceil,
  2558. nativeFloor = Math.floor,
  2559. nativeGetSymbols = Object.getOwnPropertySymbols,
  2560. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2561. nativeIsFinite = context.isFinite,
  2562. nativeJoin = arrayProto.join,
  2563. nativeKeys = overArg(Object.keys, Object),
  2564. nativeMax = Math.max,
  2565. nativeMin = Math.min,
  2566. nativeNow = Date.now,
  2567. nativeParseInt = context.parseInt,
  2568. nativeRandom = Math.random,
  2569. nativeReverse = arrayProto.reverse;
  2570. /* Built-in method references that are verified to be native. */
  2571. var DataView = getNative(context, 'DataView'),
  2572. Map = getNative(context, 'Map'),
  2573. Promise = getNative(context, 'Promise'),
  2574. Set = getNative(context, 'Set'),
  2575. WeakMap = getNative(context, 'WeakMap'),
  2576. nativeCreate = getNative(Object, 'create');
  2577. /** Used to store function metadata. */
  2578. var metaMap = WeakMap && new WeakMap;
  2579. /** Used to lookup unminified function names. */
  2580. var realNames = {};
  2581. /** Used to detect maps, sets, and weakmaps. */
  2582. var dataViewCtorString = toSource(DataView),
  2583. mapCtorString = toSource(Map),
  2584. promiseCtorString = toSource(Promise),
  2585. setCtorString = toSource(Set),
  2586. weakMapCtorString = toSource(WeakMap);
  2587. /** Used to convert symbols to primitives and strings. */
  2588. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2589. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2590. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2591. /*------------------------------------------------------------------------*/
  2592. /**
  2593. * Creates a `lodash` object which wraps `value` to enable implicit method
  2594. * chain sequences. Methods that operate on and return arrays, collections,
  2595. * and functions can be chained together. Methods that retrieve a single value
  2596. * or may return a primitive value will automatically end the chain sequence
  2597. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2598. * with `_#value`.
  2599. *
  2600. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2601. * enabled using `_.chain`.
  2602. *
  2603. * The execution of chained methods is lazy, that is, it's deferred until
  2604. * `_#value` is implicitly or explicitly called.
  2605. *
  2606. * Lazy evaluation allows several methods to support shortcut fusion.
  2607. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2608. * the creation of intermediate arrays and can greatly reduce the number of
  2609. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2610. * fusion if the section is applied to an array and iteratees accept only
  2611. * one argument. The heuristic for whether a section qualifies for shortcut
  2612. * fusion is subject to change.
  2613. *
  2614. * Chaining is supported in custom builds as long as the `_#value` method is
  2615. * directly or indirectly included in the build.
  2616. *
  2617. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2618. *
  2619. * The wrapper `Array` methods are:
  2620. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2621. *
  2622. * The wrapper `String` methods are:
  2623. * `replace` and `split`
  2624. *
  2625. * The wrapper methods that support shortcut fusion are:
  2626. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2627. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2628. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2629. *
  2630. * The chainable wrapper methods are:
  2631. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2632. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2633. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2634. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2635. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2636. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2637. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2638. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2639. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2640. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2641. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2642. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2643. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2644. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2645. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2646. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2647. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2648. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2649. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2650. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2651. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2652. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2653. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2654. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2655. *
  2656. * The wrapper methods that are **not** chainable by default are:
  2657. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2658. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2659. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2660. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2661. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2662. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2663. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2664. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2665. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2666. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2667. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2668. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2669. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2670. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2671. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2672. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2673. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2674. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2675. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2676. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2677. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2678. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2679. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2680. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2681. * `upperFirst`, `value`, and `words`
  2682. *
  2683. * @name _
  2684. * @constructor
  2685. * @category Seq
  2686. * @param {*} value The value to wrap in a `lodash` instance.
  2687. * @returns {Object} Returns the new `lodash` wrapper instance.
  2688. * @example
  2689. *
  2690. * function square(n) {
  2691. * return n * n;
  2692. * }
  2693. *
  2694. * var wrapped = _([1, 2, 3]);
  2695. *
  2696. * // Returns an unwrapped value.
  2697. * wrapped.reduce(_.add);
  2698. * // => 6
  2699. *
  2700. * // Returns a wrapped value.
  2701. * var squares = wrapped.map(square);
  2702. *
  2703. * _.isArray(squares);
  2704. * // => false
  2705. *
  2706. * _.isArray(squares.value());
  2707. * // => true
  2708. */
  2709. function lodash(value) {
  2710. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2711. if (value instanceof LodashWrapper) {
  2712. return value;
  2713. }
  2714. if (hasOwnProperty.call(value, '__wrapped__')) {
  2715. return wrapperClone(value);
  2716. }
  2717. }
  2718. return new LodashWrapper(value);
  2719. }
  2720. /**
  2721. * The base implementation of `_.create` without support for assigning
  2722. * properties to the created object.
  2723. *
  2724. * @private
  2725. * @param {Object} proto The object to inherit from.
  2726. * @returns {Object} Returns the new object.
  2727. */
  2728. var baseCreate = (function() {
  2729. function object() {}
  2730. return function(proto) {
  2731. if (!isObject(proto)) {
  2732. return {};
  2733. }
  2734. if (objectCreate) {
  2735. return objectCreate(proto);
  2736. }
  2737. object.prototype = proto;
  2738. var result = new object;
  2739. object.prototype = undefined;
  2740. return result;
  2741. };
  2742. }());
  2743. /**
  2744. * The function whose prototype chain sequence wrappers inherit from.
  2745. *
  2746. * @private
  2747. */
  2748. function baseLodash() {
  2749. // No operation performed.
  2750. }
  2751. /**
  2752. * The base constructor for creating `lodash` wrapper objects.
  2753. *
  2754. * @private
  2755. * @param {*} value The value to wrap.
  2756. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2757. */
  2758. function LodashWrapper(value, chainAll) {
  2759. this.__wrapped__ = value;
  2760. this.__actions__ = [];
  2761. this.__chain__ = !!chainAll;
  2762. this.__index__ = 0;
  2763. this.__values__ = undefined;
  2764. }
  2765. /**
  2766. * By default, the template delimiters used by lodash are like those in
  2767. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2768. * following template settings to use alternative delimiters.
  2769. *
  2770. * @static
  2771. * @memberOf _
  2772. * @type {Object}
  2773. */
  2774. lodash.templateSettings = {
  2775. /**
  2776. * Used to detect `data` property values to be HTML-escaped.
  2777. *
  2778. * @memberOf _.templateSettings
  2779. * @type {RegExp}
  2780. */
  2781. 'escape': reEscape,
  2782. /**
  2783. * Used to detect code to be evaluated.
  2784. *
  2785. * @memberOf _.templateSettings
  2786. * @type {RegExp}
  2787. */
  2788. 'evaluate': reEvaluate,
  2789. /**
  2790. * Used to detect `data` property values to inject.
  2791. *
  2792. * @memberOf _.templateSettings
  2793. * @type {RegExp}
  2794. */
  2795. 'interpolate': reInterpolate,
  2796. /**
  2797. * Used to reference the data object in the template text.
  2798. *
  2799. * @memberOf _.templateSettings
  2800. * @type {string}
  2801. */
  2802. 'variable': '',
  2803. /**
  2804. * Used to import variables into the compiled template.
  2805. *
  2806. * @memberOf _.templateSettings
  2807. * @type {Object}
  2808. */
  2809. 'imports': {
  2810. /**
  2811. * A reference to the `lodash` function.
  2812. *
  2813. * @memberOf _.templateSettings.imports
  2814. * @type {Function}
  2815. */
  2816. '_': lodash
  2817. }
  2818. };
  2819. // Ensure wrappers are instances of `baseLodash`.
  2820. lodash.prototype = baseLodash.prototype;
  2821. lodash.prototype.constructor = lodash;
  2822. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2823. LodashWrapper.prototype.constructor = LodashWrapper;
  2824. /*------------------------------------------------------------------------*/
  2825. /**
  2826. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2827. *
  2828. * @private
  2829. * @constructor
  2830. * @param {*} value The value to wrap.
  2831. */
  2832. function LazyWrapper(value) {
  2833. this.__wrapped__ = value;
  2834. this.__actions__ = [];
  2835. this.__dir__ = 1;
  2836. this.__filtered__ = false;
  2837. this.__iteratees__ = [];
  2838. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2839. this.__views__ = [];
  2840. }
  2841. /**
  2842. * Creates a clone of the lazy wrapper object.
  2843. *
  2844. * @private
  2845. * @name clone
  2846. * @memberOf LazyWrapper
  2847. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2848. */
  2849. function lazyClone() {
  2850. var result = new LazyWrapper(this.__wrapped__);
  2851. result.__actions__ = copyArray(this.__actions__);
  2852. result.__dir__ = this.__dir__;
  2853. result.__filtered__ = this.__filtered__;
  2854. result.__iteratees__ = copyArray(this.__iteratees__);
  2855. result.__takeCount__ = this.__takeCount__;
  2856. result.__views__ = copyArray(this.__views__);
  2857. return result;
  2858. }
  2859. /**
  2860. * Reverses the direction of lazy iteration.
  2861. *
  2862. * @private
  2863. * @name reverse
  2864. * @memberOf LazyWrapper
  2865. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2866. */
  2867. function lazyReverse() {
  2868. if (this.__filtered__) {
  2869. var result = new LazyWrapper(this);
  2870. result.__dir__ = -1;
  2871. result.__filtered__ = true;
  2872. } else {
  2873. result = this.clone();
  2874. result.__dir__ *= -1;
  2875. }
  2876. return result;
  2877. }
  2878. /**
  2879. * Extracts the unwrapped value from its lazy wrapper.
  2880. *
  2881. * @private
  2882. * @name value
  2883. * @memberOf LazyWrapper
  2884. * @returns {*} Returns the unwrapped value.
  2885. */
  2886. function lazyValue() {
  2887. var array = this.__wrapped__.value(),
  2888. dir = this.__dir__,
  2889. isArr = isArray(array),
  2890. isRight = dir < 0,
  2891. arrLength = isArr ? array.length : 0,
  2892. view = getView(0, arrLength, this.__views__),
  2893. start = view.start,
  2894. end = view.end,
  2895. length = end - start,
  2896. index = isRight ? end : (start - 1),
  2897. iteratees = this.__iteratees__,
  2898. iterLength = iteratees.length,
  2899. resIndex = 0,
  2900. takeCount = nativeMin(length, this.__takeCount__);
  2901. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2902. return baseWrapperValue(array, this.__actions__);
  2903. }
  2904. var result = [];
  2905. outer:
  2906. while (length-- && resIndex < takeCount) {
  2907. index += dir;
  2908. var iterIndex = -1,
  2909. value = array[index];
  2910. while (++iterIndex < iterLength) {
  2911. var data = iteratees[iterIndex],
  2912. iteratee = data.iteratee,
  2913. type = data.type,
  2914. computed = iteratee(value);
  2915. if (type == LAZY_MAP_FLAG) {
  2916. value = computed;
  2917. } else if (!computed) {
  2918. if (type == LAZY_FILTER_FLAG) {
  2919. continue outer;
  2920. } else {
  2921. break outer;
  2922. }
  2923. }
  2924. }
  2925. result[resIndex++] = value;
  2926. }
  2927. return result;
  2928. }
  2929. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2930. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2931. LazyWrapper.prototype.constructor = LazyWrapper;
  2932. /*------------------------------------------------------------------------*/
  2933. /**
  2934. * Creates a hash object.
  2935. *
  2936. * @private
  2937. * @constructor
  2938. * @param {Array} [entries] The key-value pairs to cache.
  2939. */
  2940. function Hash(entries) {
  2941. var index = -1,
  2942. length = entries == null ? 0 : entries.length;
  2943. this.clear();
  2944. while (++index < length) {
  2945. var entry = entries[index];
  2946. this.set(entry[0], entry[1]);
  2947. }
  2948. }
  2949. /**
  2950. * Removes all key-value entries from the hash.
  2951. *
  2952. * @private
  2953. * @name clear
  2954. * @memberOf Hash
  2955. */
  2956. function hashClear() {
  2957. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2958. this.size = 0;
  2959. }
  2960. /**
  2961. * Removes `key` and its value from the hash.
  2962. *
  2963. * @private
  2964. * @name delete
  2965. * @memberOf Hash
  2966. * @param {Object} hash The hash to modify.
  2967. * @param {string} key The key of the value to remove.
  2968. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2969. */
  2970. function hashDelete(key) {
  2971. var result = this.has(key) && delete this.__data__[key];
  2972. this.size -= result ? 1 : 0;
  2973. return result;
  2974. }
  2975. /**
  2976. * Gets the hash value for `key`.
  2977. *
  2978. * @private
  2979. * @name get
  2980. * @memberOf Hash
  2981. * @param {string} key The key of the value to get.
  2982. * @returns {*} Returns the entry value.
  2983. */
  2984. function hashGet(key) {
  2985. var data = this.__data__;
  2986. if (nativeCreate) {
  2987. var result = data[key];
  2988. return result === HASH_UNDEFINED ? undefined : result;
  2989. }
  2990. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2991. }
  2992. /**
  2993. * Checks if a hash value for `key` exists.
  2994. *
  2995. * @private
  2996. * @name has
  2997. * @memberOf Hash
  2998. * @param {string} key The key of the entry to check.
  2999. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3000. */
  3001. function hashHas(key) {
  3002. var data = this.__data__;
  3003. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3004. }
  3005. /**
  3006. * Sets the hash `key` to `value`.
  3007. *
  3008. * @private
  3009. * @name set
  3010. * @memberOf Hash
  3011. * @param {string} key The key of the value to set.
  3012. * @param {*} value The value to set.
  3013. * @returns {Object} Returns the hash instance.
  3014. */
  3015. function hashSet(key, value) {
  3016. var data = this.__data__;
  3017. this.size += this.has(key) ? 0 : 1;
  3018. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3019. return this;
  3020. }
  3021. // Add methods to `Hash`.
  3022. Hash.prototype.clear = hashClear;
  3023. Hash.prototype['delete'] = hashDelete;
  3024. Hash.prototype.get = hashGet;
  3025. Hash.prototype.has = hashHas;
  3026. Hash.prototype.set = hashSet;
  3027. /*------------------------------------------------------------------------*/
  3028. /**
  3029. * Creates an list cache object.
  3030. *
  3031. * @private
  3032. * @constructor
  3033. * @param {Array} [entries] The key-value pairs to cache.
  3034. */
  3035. function ListCache(entries) {
  3036. var index = -1,
  3037. length = entries == null ? 0 : entries.length;
  3038. this.clear();
  3039. while (++index < length) {
  3040. var entry = entries[index];
  3041. this.set(entry[0], entry[1]);
  3042. }
  3043. }
  3044. /**
  3045. * Removes all key-value entries from the list cache.
  3046. *
  3047. * @private
  3048. * @name clear
  3049. * @memberOf ListCache
  3050. */
  3051. function listCacheClear() {
  3052. this.__data__ = [];
  3053. this.size = 0;
  3054. }
  3055. /**
  3056. * Removes `key` and its value from the list cache.
  3057. *
  3058. * @private
  3059. * @name delete
  3060. * @memberOf ListCache
  3061. * @param {string} key The key of the value to remove.
  3062. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3063. */
  3064. function listCacheDelete(key) {
  3065. var data = this.__data__,
  3066. index = assocIndexOf(data, key);
  3067. if (index < 0) {
  3068. return false;
  3069. }
  3070. var lastIndex = data.length - 1;
  3071. if (index == lastIndex) {
  3072. data.pop();
  3073. } else {
  3074. splice.call(data, index, 1);
  3075. }
  3076. --this.size;
  3077. return true;
  3078. }
  3079. /**
  3080. * Gets the list cache value for `key`.
  3081. *
  3082. * @private
  3083. * @name get
  3084. * @memberOf ListCache
  3085. * @param {string} key The key of the value to get.
  3086. * @returns {*} Returns the entry value.
  3087. */
  3088. function listCacheGet(key) {
  3089. var data = this.__data__,
  3090. index = assocIndexOf(data, key);
  3091. return index < 0 ? undefined : data[index][1];
  3092. }
  3093. /**
  3094. * Checks if a list cache value for `key` exists.
  3095. *
  3096. * @private
  3097. * @name has
  3098. * @memberOf ListCache
  3099. * @param {string} key The key of the entry to check.
  3100. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3101. */
  3102. function listCacheHas(key) {
  3103. return assocIndexOf(this.__data__, key) > -1;
  3104. }
  3105. /**
  3106. * Sets the list cache `key` to `value`.
  3107. *
  3108. * @private
  3109. * @name set
  3110. * @memberOf ListCache
  3111. * @param {string} key The key of the value to set.
  3112. * @param {*} value The value to set.
  3113. * @returns {Object} Returns the list cache instance.
  3114. */
  3115. function listCacheSet(key, value) {
  3116. var data = this.__data__,
  3117. index = assocIndexOf(data, key);
  3118. if (index < 0) {
  3119. ++this.size;
  3120. data.push([key, value]);
  3121. } else {
  3122. data[index][1] = value;
  3123. }
  3124. return this;
  3125. }
  3126. // Add methods to `ListCache`.
  3127. ListCache.prototype.clear = listCacheClear;
  3128. ListCache.prototype['delete'] = listCacheDelete;
  3129. ListCache.prototype.get = listCacheGet;
  3130. ListCache.prototype.has = listCacheHas;
  3131. ListCache.prototype.set = listCacheSet;
  3132. /*------------------------------------------------------------------------*/
  3133. /**
  3134. * Creates a map cache object to store key-value pairs.
  3135. *
  3136. * @private
  3137. * @constructor
  3138. * @param {Array} [entries] The key-value pairs to cache.
  3139. */
  3140. function MapCache(entries) {
  3141. var index = -1,
  3142. length = entries == null ? 0 : entries.length;
  3143. this.clear();
  3144. while (++index < length) {
  3145. var entry = entries[index];
  3146. this.set(entry[0], entry[1]);
  3147. }
  3148. }
  3149. /**
  3150. * Removes all key-value entries from the map.
  3151. *
  3152. * @private
  3153. * @name clear
  3154. * @memberOf MapCache
  3155. */
  3156. function mapCacheClear() {
  3157. this.size = 0;
  3158. this.__data__ = {
  3159. 'hash': new Hash,
  3160. 'map': new (Map || ListCache),
  3161. 'string': new Hash
  3162. };
  3163. }
  3164. /**
  3165. * Removes `key` and its value from the map.
  3166. *
  3167. * @private
  3168. * @name delete
  3169. * @memberOf MapCache
  3170. * @param {string} key The key of the value to remove.
  3171. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3172. */
  3173. function mapCacheDelete(key) {
  3174. var result = getMapData(this, key)['delete'](key);
  3175. this.size -= result ? 1 : 0;
  3176. return result;
  3177. }
  3178. /**
  3179. * Gets the map value for `key`.
  3180. *
  3181. * @private
  3182. * @name get
  3183. * @memberOf MapCache
  3184. * @param {string} key The key of the value to get.
  3185. * @returns {*} Returns the entry value.
  3186. */
  3187. function mapCacheGet(key) {
  3188. return getMapData(this, key).get(key);
  3189. }
  3190. /**
  3191. * Checks if a map value for `key` exists.
  3192. *
  3193. * @private
  3194. * @name has
  3195. * @memberOf MapCache
  3196. * @param {string} key The key of the entry to check.
  3197. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3198. */
  3199. function mapCacheHas(key) {
  3200. return getMapData(this, key).has(key);
  3201. }
  3202. /**
  3203. * Sets the map `key` to `value`.
  3204. *
  3205. * @private
  3206. * @name set
  3207. * @memberOf MapCache
  3208. * @param {string} key The key of the value to set.
  3209. * @param {*} value The value to set.
  3210. * @returns {Object} Returns the map cache instance.
  3211. */
  3212. function mapCacheSet(key, value) {
  3213. var data = getMapData(this, key),
  3214. size = data.size;
  3215. data.set(key, value);
  3216. this.size += data.size == size ? 0 : 1;
  3217. return this;
  3218. }
  3219. // Add methods to `MapCache`.
  3220. MapCache.prototype.clear = mapCacheClear;
  3221. MapCache.prototype['delete'] = mapCacheDelete;
  3222. MapCache.prototype.get = mapCacheGet;
  3223. MapCache.prototype.has = mapCacheHas;
  3224. MapCache.prototype.set = mapCacheSet;
  3225. /*------------------------------------------------------------------------*/
  3226. /**
  3227. *
  3228. * Creates an array cache object to store unique values.
  3229. *
  3230. * @private
  3231. * @constructor
  3232. * @param {Array} [values] The values to cache.
  3233. */
  3234. function SetCache(values) {
  3235. var index = -1,
  3236. length = values == null ? 0 : values.length;
  3237. this.__data__ = new MapCache;
  3238. while (++index < length) {
  3239. this.add(values[index]);
  3240. }
  3241. }
  3242. /**
  3243. * Adds `value` to the array cache.
  3244. *
  3245. * @private
  3246. * @name add
  3247. * @memberOf SetCache
  3248. * @alias push
  3249. * @param {*} value The value to cache.
  3250. * @returns {Object} Returns the cache instance.
  3251. */
  3252. function setCacheAdd(value) {
  3253. this.__data__.set(value, HASH_UNDEFINED);
  3254. return this;
  3255. }
  3256. /**
  3257. * Checks if `value` is in the array cache.
  3258. *
  3259. * @private
  3260. * @name has
  3261. * @memberOf SetCache
  3262. * @param {*} value The value to search for.
  3263. * @returns {number} Returns `true` if `value` is found, else `false`.
  3264. */
  3265. function setCacheHas(value) {
  3266. return this.__data__.has(value);
  3267. }
  3268. // Add methods to `SetCache`.
  3269. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3270. SetCache.prototype.has = setCacheHas;
  3271. /*------------------------------------------------------------------------*/
  3272. /**
  3273. * Creates a stack cache object to store key-value pairs.
  3274. *
  3275. * @private
  3276. * @constructor
  3277. * @param {Array} [entries] The key-value pairs to cache.
  3278. */
  3279. function Stack(entries) {
  3280. var data = this.__data__ = new ListCache(entries);
  3281. this.size = data.size;
  3282. }
  3283. /**
  3284. * Removes all key-value entries from the stack.
  3285. *
  3286. * @private
  3287. * @name clear
  3288. * @memberOf Stack
  3289. */
  3290. function stackClear() {
  3291. this.__data__ = new ListCache;
  3292. this.size = 0;
  3293. }
  3294. /**
  3295. * Removes `key` and its value from the stack.
  3296. *
  3297. * @private
  3298. * @name delete
  3299. * @memberOf Stack
  3300. * @param {string} key The key of the value to remove.
  3301. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3302. */
  3303. function stackDelete(key) {
  3304. var data = this.__data__,
  3305. result = data['delete'](key);
  3306. this.size = data.size;
  3307. return result;
  3308. }
  3309. /**
  3310. * Gets the stack value for `key`.
  3311. *
  3312. * @private
  3313. * @name get
  3314. * @memberOf Stack
  3315. * @param {string} key The key of the value to get.
  3316. * @returns {*} Returns the entry value.
  3317. */
  3318. function stackGet(key) {
  3319. return this.__data__.get(key);
  3320. }
  3321. /**
  3322. * Checks if a stack value for `key` exists.
  3323. *
  3324. * @private
  3325. * @name has
  3326. * @memberOf Stack
  3327. * @param {string} key The key of the entry to check.
  3328. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3329. */
  3330. function stackHas(key) {
  3331. return this.__data__.has(key);
  3332. }
  3333. /**
  3334. * Sets the stack `key` to `value`.
  3335. *
  3336. * @private
  3337. * @name set
  3338. * @memberOf Stack
  3339. * @param {string} key The key of the value to set.
  3340. * @param {*} value The value to set.
  3341. * @returns {Object} Returns the stack cache instance.
  3342. */
  3343. function stackSet(key, value) {
  3344. var data = this.__data__;
  3345. if (data instanceof ListCache) {
  3346. var pairs = data.__data__;
  3347. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3348. pairs.push([key, value]);
  3349. this.size = ++data.size;
  3350. return this;
  3351. }
  3352. data = this.__data__ = new MapCache(pairs);
  3353. }
  3354. data.set(key, value);
  3355. this.size = data.size;
  3356. return this;
  3357. }
  3358. // Add methods to `Stack`.
  3359. Stack.prototype.clear = stackClear;
  3360. Stack.prototype['delete'] = stackDelete;
  3361. Stack.prototype.get = stackGet;
  3362. Stack.prototype.has = stackHas;
  3363. Stack.prototype.set = stackSet;
  3364. /*------------------------------------------------------------------------*/
  3365. /**
  3366. * Creates an array of the enumerable property names of the array-like `value`.
  3367. *
  3368. * @private
  3369. * @param {*} value The value to query.
  3370. * @param {boolean} inherited Specify returning inherited property names.
  3371. * @returns {Array} Returns the array of property names.
  3372. */
  3373. function arrayLikeKeys(value, inherited) {
  3374. var isArr = isArray(value),
  3375. isArg = !isArr && isArguments(value),
  3376. isBuff = !isArr && !isArg && isBuffer(value),
  3377. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3378. skipIndexes = isArr || isArg || isBuff || isType,
  3379. result = skipIndexes ? baseTimes(value.length, String) : [],
  3380. length = result.length;
  3381. for (var key in value) {
  3382. if ((inherited || hasOwnProperty.call(value, key)) &&
  3383. !(skipIndexes && (
  3384. // Safari 9 has enumerable `arguments.length` in strict mode.
  3385. key == 'length' ||
  3386. // Node.js 0.10 has enumerable non-index properties on buffers.
  3387. (isBuff && (key == 'offset' || key == 'parent')) ||
  3388. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3389. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3390. // Skip index properties.
  3391. isIndex(key, length)
  3392. ))) {
  3393. result.push(key);
  3394. }
  3395. }
  3396. return result;
  3397. }
  3398. /**
  3399. * A specialized version of `_.sample` for arrays.
  3400. *
  3401. * @private
  3402. * @param {Array} array The array to sample.
  3403. * @returns {*} Returns the random element.
  3404. */
  3405. function arraySample(array) {
  3406. var length = array.length;
  3407. return length ? array[baseRandom(0, length - 1)] : undefined;
  3408. }
  3409. /**
  3410. * A specialized version of `_.sampleSize` for arrays.
  3411. *
  3412. * @private
  3413. * @param {Array} array The array to sample.
  3414. * @param {number} n The number of elements to sample.
  3415. * @returns {Array} Returns the random elements.
  3416. */
  3417. function arraySampleSize(array, n) {
  3418. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3419. }
  3420. /**
  3421. * A specialized version of `_.shuffle` for arrays.
  3422. *
  3423. * @private
  3424. * @param {Array} array The array to shuffle.
  3425. * @returns {Array} Returns the new shuffled array.
  3426. */
  3427. function arrayShuffle(array) {
  3428. return shuffleSelf(copyArray(array));
  3429. }
  3430. /**
  3431. * This function is like `assignValue` except that it doesn't assign
  3432. * `undefined` values.
  3433. *
  3434. * @private
  3435. * @param {Object} object The object to modify.
  3436. * @param {string} key The key of the property to assign.
  3437. * @param {*} value The value to assign.
  3438. */
  3439. function assignMergeValue(object, key, value) {
  3440. if ((value !== undefined && !eq(object[key], value)) ||
  3441. (value === undefined && !(key in object))) {
  3442. baseAssignValue(object, key, value);
  3443. }
  3444. }
  3445. /**
  3446. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3447. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3448. * for equality comparisons.
  3449. *
  3450. * @private
  3451. * @param {Object} object The object to modify.
  3452. * @param {string} key The key of the property to assign.
  3453. * @param {*} value The value to assign.
  3454. */
  3455. function assignValue(object, key, value) {
  3456. var objValue = object[key];
  3457. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3458. (value === undefined && !(key in object))) {
  3459. baseAssignValue(object, key, value);
  3460. }
  3461. }
  3462. /**
  3463. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3464. *
  3465. * @private
  3466. * @param {Array} array The array to inspect.
  3467. * @param {*} key The key to search for.
  3468. * @returns {number} Returns the index of the matched value, else `-1`.
  3469. */
  3470. function assocIndexOf(array, key) {
  3471. var length = array.length;
  3472. while (length--) {
  3473. if (eq(array[length][0], key)) {
  3474. return length;
  3475. }
  3476. }
  3477. return -1;
  3478. }
  3479. /**
  3480. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3481. * by `iteratee` and values set by `setter`.
  3482. *
  3483. * @private
  3484. * @param {Array|Object} collection The collection to iterate over.
  3485. * @param {Function} setter The function to set `accumulator` values.
  3486. * @param {Function} iteratee The iteratee to transform keys.
  3487. * @param {Object} accumulator The initial aggregated object.
  3488. * @returns {Function} Returns `accumulator`.
  3489. */
  3490. function baseAggregator(collection, setter, iteratee, accumulator) {
  3491. baseEach(collection, function(value, key, collection) {
  3492. setter(accumulator, value, iteratee(value), collection);
  3493. });
  3494. return accumulator;
  3495. }
  3496. /**
  3497. * The base implementation of `_.assign` without support for multiple sources
  3498. * or `customizer` functions.
  3499. *
  3500. * @private
  3501. * @param {Object} object The destination object.
  3502. * @param {Object} source The source object.
  3503. * @returns {Object} Returns `object`.
  3504. */
  3505. function baseAssign(object, source) {
  3506. return object && copyObject(source, keys(source), object);
  3507. }
  3508. /**
  3509. * The base implementation of `_.assignIn` without support for multiple sources
  3510. * or `customizer` functions.
  3511. *
  3512. * @private
  3513. * @param {Object} object The destination object.
  3514. * @param {Object} source The source object.
  3515. * @returns {Object} Returns `object`.
  3516. */
  3517. function baseAssignIn(object, source) {
  3518. return object && copyObject(source, keysIn(source), object);
  3519. }
  3520. /**
  3521. * The base implementation of `assignValue` and `assignMergeValue` without
  3522. * value checks.
  3523. *
  3524. * @private
  3525. * @param {Object} object The object to modify.
  3526. * @param {string} key The key of the property to assign.
  3527. * @param {*} value The value to assign.
  3528. */
  3529. function baseAssignValue(object, key, value) {
  3530. if (key == '__proto__' && defineProperty) {
  3531. defineProperty(object, key, {
  3532. 'configurable': true,
  3533. 'enumerable': true,
  3534. 'value': value,
  3535. 'writable': true
  3536. });
  3537. } else {
  3538. object[key] = value;
  3539. }
  3540. }
  3541. /**
  3542. * The base implementation of `_.at` without support for individual paths.
  3543. *
  3544. * @private
  3545. * @param {Object} object The object to iterate over.
  3546. * @param {string[]} paths The property paths to pick.
  3547. * @returns {Array} Returns the picked elements.
  3548. */
  3549. function baseAt(object, paths) {
  3550. var index = -1,
  3551. length = paths.length,
  3552. result = Array(length),
  3553. skip = object == null;
  3554. while (++index < length) {
  3555. result[index] = skip ? undefined : get(object, paths[index]);
  3556. }
  3557. return result;
  3558. }
  3559. /**
  3560. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3561. *
  3562. * @private
  3563. * @param {number} number The number to clamp.
  3564. * @param {number} [lower] The lower bound.
  3565. * @param {number} upper The upper bound.
  3566. * @returns {number} Returns the clamped number.
  3567. */
  3568. function baseClamp(number, lower, upper) {
  3569. if (number === number) {
  3570. if (upper !== undefined) {
  3571. number = number <= upper ? number : upper;
  3572. }
  3573. if (lower !== undefined) {
  3574. number = number >= lower ? number : lower;
  3575. }
  3576. }
  3577. return number;
  3578. }
  3579. /**
  3580. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3581. * traversed objects.
  3582. *
  3583. * @private
  3584. * @param {*} value The value to clone.
  3585. * @param {boolean} bitmask The bitmask flags.
  3586. * 1 - Deep clone
  3587. * 2 - Flatten inherited properties
  3588. * 4 - Clone symbols
  3589. * @param {Function} [customizer] The function to customize cloning.
  3590. * @param {string} [key] The key of `value`.
  3591. * @param {Object} [object] The parent object of `value`.
  3592. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3593. * @returns {*} Returns the cloned value.
  3594. */
  3595. function baseClone(value, bitmask, customizer, key, object, stack) {
  3596. var result,
  3597. isDeep = bitmask & CLONE_DEEP_FLAG,
  3598. isFlat = bitmask & CLONE_FLAT_FLAG,
  3599. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3600. if (customizer) {
  3601. result = object ? customizer(value, key, object, stack) : customizer(value);
  3602. }
  3603. if (result !== undefined) {
  3604. return result;
  3605. }
  3606. if (!isObject(value)) {
  3607. return value;
  3608. }
  3609. var isArr = isArray(value);
  3610. if (isArr) {
  3611. result = initCloneArray(value);
  3612. if (!isDeep) {
  3613. return copyArray(value, result);
  3614. }
  3615. } else {
  3616. var tag = getTag(value),
  3617. isFunc = tag == funcTag || tag == genTag;
  3618. if (isBuffer(value)) {
  3619. return cloneBuffer(value, isDeep);
  3620. }
  3621. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3622. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3623. if (!isDeep) {
  3624. return isFlat
  3625. ? copySymbolsIn(value, baseAssignIn(result, value))
  3626. : copySymbols(value, baseAssign(result, value));
  3627. }
  3628. } else {
  3629. if (!cloneableTags[tag]) {
  3630. return object ? value : {};
  3631. }
  3632. result = initCloneByTag(value, tag, isDeep);
  3633. }
  3634. }
  3635. // Check for circular references and return its corresponding clone.
  3636. stack || (stack = new Stack);
  3637. var stacked = stack.get(value);
  3638. if (stacked) {
  3639. return stacked;
  3640. }
  3641. stack.set(value, result);
  3642. if (isSet(value)) {
  3643. value.forEach(function(subValue) {
  3644. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3645. });
  3646. } else if (isMap(value)) {
  3647. value.forEach(function(subValue, key) {
  3648. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3649. });
  3650. }
  3651. var keysFunc = isFull
  3652. ? (isFlat ? getAllKeysIn : getAllKeys)
  3653. : (isFlat ? keysIn : keys);
  3654. var props = isArr ? undefined : keysFunc(value);
  3655. arrayEach(props || value, function(subValue, key) {
  3656. if (props) {
  3657. key = subValue;
  3658. subValue = value[key];
  3659. }
  3660. // Recursively populate clone (susceptible to call stack limits).
  3661. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3662. });
  3663. return result;
  3664. }
  3665. /**
  3666. * The base implementation of `_.conforms` which doesn't clone `source`.
  3667. *
  3668. * @private
  3669. * @param {Object} source The object of property predicates to conform to.
  3670. * @returns {Function} Returns the new spec function.
  3671. */
  3672. function baseConforms(source) {
  3673. var props = keys(source);
  3674. return function(object) {
  3675. return baseConformsTo(object, source, props);
  3676. };
  3677. }
  3678. /**
  3679. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3680. *
  3681. * @private
  3682. * @param {Object} object The object to inspect.
  3683. * @param {Object} source The object of property predicates to conform to.
  3684. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3685. */
  3686. function baseConformsTo(object, source, props) {
  3687. var length = props.length;
  3688. if (object == null) {
  3689. return !length;
  3690. }
  3691. object = Object(object);
  3692. while (length--) {
  3693. var key = props[length],
  3694. predicate = source[key],
  3695. value = object[key];
  3696. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3697. return false;
  3698. }
  3699. }
  3700. return true;
  3701. }
  3702. /**
  3703. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3704. * to provide to `func`.
  3705. *
  3706. * @private
  3707. * @param {Function} func The function to delay.
  3708. * @param {number} wait The number of milliseconds to delay invocation.
  3709. * @param {Array} args The arguments to provide to `func`.
  3710. * @returns {number|Object} Returns the timer id or timeout object.
  3711. */
  3712. function baseDelay(func, wait, args) {
  3713. if (typeof func != 'function') {
  3714. throw new TypeError(FUNC_ERROR_TEXT);
  3715. }
  3716. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3717. }
  3718. /**
  3719. * The base implementation of methods like `_.difference` without support
  3720. * for excluding multiple arrays or iteratee shorthands.
  3721. *
  3722. * @private
  3723. * @param {Array} array The array to inspect.
  3724. * @param {Array} values The values to exclude.
  3725. * @param {Function} [iteratee] The iteratee invoked per element.
  3726. * @param {Function} [comparator] The comparator invoked per element.
  3727. * @returns {Array} Returns the new array of filtered values.
  3728. */
  3729. function baseDifference(array, values, iteratee, comparator) {
  3730. var index = -1,
  3731. includes = arrayIncludes,
  3732. isCommon = true,
  3733. length = array.length,
  3734. result = [],
  3735. valuesLength = values.length;
  3736. if (!length) {
  3737. return result;
  3738. }
  3739. if (iteratee) {
  3740. values = arrayMap(values, baseUnary(iteratee));
  3741. }
  3742. if (comparator) {
  3743. includes = arrayIncludesWith;
  3744. isCommon = false;
  3745. }
  3746. else if (values.length >= LARGE_ARRAY_SIZE) {
  3747. includes = cacheHas;
  3748. isCommon = false;
  3749. values = new SetCache(values);
  3750. }
  3751. outer:
  3752. while (++index < length) {
  3753. var value = array[index],
  3754. computed = iteratee == null ? value : iteratee(value);
  3755. value = (comparator || value !== 0) ? value : 0;
  3756. if (isCommon && computed === computed) {
  3757. var valuesIndex = valuesLength;
  3758. while (valuesIndex--) {
  3759. if (values[valuesIndex] === computed) {
  3760. continue outer;
  3761. }
  3762. }
  3763. result.push(value);
  3764. }
  3765. else if (!includes(values, computed, comparator)) {
  3766. result.push(value);
  3767. }
  3768. }
  3769. return result;
  3770. }
  3771. /**
  3772. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3773. *
  3774. * @private
  3775. * @param {Array|Object} collection The collection to iterate over.
  3776. * @param {Function} iteratee The function invoked per iteration.
  3777. * @returns {Array|Object} Returns `collection`.
  3778. */
  3779. var baseEach = createBaseEach(baseForOwn);
  3780. /**
  3781. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3782. *
  3783. * @private
  3784. * @param {Array|Object} collection The collection to iterate over.
  3785. * @param {Function} iteratee The function invoked per iteration.
  3786. * @returns {Array|Object} Returns `collection`.
  3787. */
  3788. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3789. /**
  3790. * The base implementation of `_.every` without support for iteratee shorthands.
  3791. *
  3792. * @private
  3793. * @param {Array|Object} collection The collection to iterate over.
  3794. * @param {Function} predicate The function invoked per iteration.
  3795. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3796. * else `false`
  3797. */
  3798. function baseEvery(collection, predicate) {
  3799. var result = true;
  3800. baseEach(collection, function(value, index, collection) {
  3801. result = !!predicate(value, index, collection);
  3802. return result;
  3803. });
  3804. return result;
  3805. }
  3806. /**
  3807. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3808. * `comparator` to determine the extremum value.
  3809. *
  3810. * @private
  3811. * @param {Array} array The array to iterate over.
  3812. * @param {Function} iteratee The iteratee invoked per iteration.
  3813. * @param {Function} comparator The comparator used to compare values.
  3814. * @returns {*} Returns the extremum value.
  3815. */
  3816. function baseExtremum(array, iteratee, comparator) {
  3817. var index = -1,
  3818. length = array.length;
  3819. while (++index < length) {
  3820. var value = array[index],
  3821. current = iteratee(value);
  3822. if (current != null && (computed === undefined
  3823. ? (current === current && !isSymbol(current))
  3824. : comparator(current, computed)
  3825. )) {
  3826. var computed = current,
  3827. result = value;
  3828. }
  3829. }
  3830. return result;
  3831. }
  3832. /**
  3833. * The base implementation of `_.fill` without an iteratee call guard.
  3834. *
  3835. * @private
  3836. * @param {Array} array The array to fill.
  3837. * @param {*} value The value to fill `array` with.
  3838. * @param {number} [start=0] The start position.
  3839. * @param {number} [end=array.length] The end position.
  3840. * @returns {Array} Returns `array`.
  3841. */
  3842. function baseFill(array, value, start, end) {
  3843. var length = array.length;
  3844. start = toInteger(start);
  3845. if (start < 0) {
  3846. start = -start > length ? 0 : (length + start);
  3847. }
  3848. end = (end === undefined || end > length) ? length : toInteger(end);
  3849. if (end < 0) {
  3850. end += length;
  3851. }
  3852. end = start > end ? 0 : toLength(end);
  3853. while (start < end) {
  3854. array[start++] = value;
  3855. }
  3856. return array;
  3857. }
  3858. /**
  3859. * The base implementation of `_.filter` without support for iteratee shorthands.
  3860. *
  3861. * @private
  3862. * @param {Array|Object} collection The collection to iterate over.
  3863. * @param {Function} predicate The function invoked per iteration.
  3864. * @returns {Array} Returns the new filtered array.
  3865. */
  3866. function baseFilter(collection, predicate) {
  3867. var result = [];
  3868. baseEach(collection, function(value, index, collection) {
  3869. if (predicate(value, index, collection)) {
  3870. result.push(value);
  3871. }
  3872. });
  3873. return result;
  3874. }
  3875. /**
  3876. * The base implementation of `_.flatten` with support for restricting flattening.
  3877. *
  3878. * @private
  3879. * @param {Array} array The array to flatten.
  3880. * @param {number} depth The maximum recursion depth.
  3881. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3882. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3883. * @param {Array} [result=[]] The initial result value.
  3884. * @returns {Array} Returns the new flattened array.
  3885. */
  3886. function baseFlatten(array, depth, predicate, isStrict, result) {
  3887. var index = -1,
  3888. length = array.length;
  3889. predicate || (predicate = isFlattenable);
  3890. result || (result = []);
  3891. while (++index < length) {
  3892. var value = array[index];
  3893. if (depth > 0 && predicate(value)) {
  3894. if (depth > 1) {
  3895. // Recursively flatten arrays (susceptible to call stack limits).
  3896. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3897. } else {
  3898. arrayPush(result, value);
  3899. }
  3900. } else if (!isStrict) {
  3901. result[result.length] = value;
  3902. }
  3903. }
  3904. return result;
  3905. }
  3906. /**
  3907. * The base implementation of `baseForOwn` which iterates over `object`
  3908. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3909. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3910. *
  3911. * @private
  3912. * @param {Object} object The object to iterate over.
  3913. * @param {Function} iteratee The function invoked per iteration.
  3914. * @param {Function} keysFunc The function to get the keys of `object`.
  3915. * @returns {Object} Returns `object`.
  3916. */
  3917. var baseFor = createBaseFor();
  3918. /**
  3919. * This function is like `baseFor` except that it iterates over properties
  3920. * in the opposite order.
  3921. *
  3922. * @private
  3923. * @param {Object} object The object to iterate over.
  3924. * @param {Function} iteratee The function invoked per iteration.
  3925. * @param {Function} keysFunc The function to get the keys of `object`.
  3926. * @returns {Object} Returns `object`.
  3927. */
  3928. var baseForRight = createBaseFor(true);
  3929. /**
  3930. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3931. *
  3932. * @private
  3933. * @param {Object} object The object to iterate over.
  3934. * @param {Function} iteratee The function invoked per iteration.
  3935. * @returns {Object} Returns `object`.
  3936. */
  3937. function baseForOwn(object, iteratee) {
  3938. return object && baseFor(object, iteratee, keys);
  3939. }
  3940. /**
  3941. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3942. *
  3943. * @private
  3944. * @param {Object} object The object to iterate over.
  3945. * @param {Function} iteratee The function invoked per iteration.
  3946. * @returns {Object} Returns `object`.
  3947. */
  3948. function baseForOwnRight(object, iteratee) {
  3949. return object && baseForRight(object, iteratee, keys);
  3950. }
  3951. /**
  3952. * The base implementation of `_.functions` which creates an array of
  3953. * `object` function property names filtered from `props`.
  3954. *
  3955. * @private
  3956. * @param {Object} object The object to inspect.
  3957. * @param {Array} props The property names to filter.
  3958. * @returns {Array} Returns the function names.
  3959. */
  3960. function baseFunctions(object, props) {
  3961. return arrayFilter(props, function(key) {
  3962. return isFunction(object[key]);
  3963. });
  3964. }
  3965. /**
  3966. * The base implementation of `_.get` without support for default values.
  3967. *
  3968. * @private
  3969. * @param {Object} object The object to query.
  3970. * @param {Array|string} path The path of the property to get.
  3971. * @returns {*} Returns the resolved value.
  3972. */
  3973. function baseGet(object, path) {
  3974. path = castPath(path, object);
  3975. var index = 0,
  3976. length = path.length;
  3977. while (object != null && index < length) {
  3978. object = object[toKey(path[index++])];
  3979. }
  3980. return (index && index == length) ? object : undefined;
  3981. }
  3982. /**
  3983. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3984. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3985. * symbols of `object`.
  3986. *
  3987. * @private
  3988. * @param {Object} object The object to query.
  3989. * @param {Function} keysFunc The function to get the keys of `object`.
  3990. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3991. * @returns {Array} Returns the array of property names and symbols.
  3992. */
  3993. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3994. var result = keysFunc(object);
  3995. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3996. }
  3997. /**
  3998. * The base implementation of `getTag` without fallbacks for buggy environments.
  3999. *
  4000. * @private
  4001. * @param {*} value The value to query.
  4002. * @returns {string} Returns the `toStringTag`.
  4003. */
  4004. function baseGetTag(value) {
  4005. if (value == null) {
  4006. return value === undefined ? undefinedTag : nullTag;
  4007. }
  4008. return (symToStringTag && symToStringTag in Object(value))
  4009. ? getRawTag(value)
  4010. : objectToString(value);
  4011. }
  4012. /**
  4013. * The base implementation of `_.gt` which doesn't coerce arguments.
  4014. *
  4015. * @private
  4016. * @param {*} value The value to compare.
  4017. * @param {*} other The other value to compare.
  4018. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4019. * else `false`.
  4020. */
  4021. function baseGt(value, other) {
  4022. return value > other;
  4023. }
  4024. /**
  4025. * The base implementation of `_.has` without support for deep paths.
  4026. *
  4027. * @private
  4028. * @param {Object} [object] The object to query.
  4029. * @param {Array|string} key The key to check.
  4030. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4031. */
  4032. function baseHas(object, key) {
  4033. return object != null && hasOwnProperty.call(object, key);
  4034. }
  4035. /**
  4036. * The base implementation of `_.hasIn` without support for deep paths.
  4037. *
  4038. * @private
  4039. * @param {Object} [object] The object to query.
  4040. * @param {Array|string} key The key to check.
  4041. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4042. */
  4043. function baseHasIn(object, key) {
  4044. return object != null && key in Object(object);
  4045. }
  4046. /**
  4047. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4048. *
  4049. * @private
  4050. * @param {number} number The number to check.
  4051. * @param {number} start The start of the range.
  4052. * @param {number} end The end of the range.
  4053. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4054. */
  4055. function baseInRange(number, start, end) {
  4056. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4057. }
  4058. /**
  4059. * The base implementation of methods like `_.intersection`, without support
  4060. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4061. *
  4062. * @private
  4063. * @param {Array} arrays The arrays to inspect.
  4064. * @param {Function} [iteratee] The iteratee invoked per element.
  4065. * @param {Function} [comparator] The comparator invoked per element.
  4066. * @returns {Array} Returns the new array of shared values.
  4067. */
  4068. function baseIntersection(arrays, iteratee, comparator) {
  4069. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4070. length = arrays[0].length,
  4071. othLength = arrays.length,
  4072. othIndex = othLength,
  4073. caches = Array(othLength),
  4074. maxLength = Infinity,
  4075. result = [];
  4076. while (othIndex--) {
  4077. var array = arrays[othIndex];
  4078. if (othIndex && iteratee) {
  4079. array = arrayMap(array, baseUnary(iteratee));
  4080. }
  4081. maxLength = nativeMin(array.length, maxLength);
  4082. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4083. ? new SetCache(othIndex && array)
  4084. : undefined;
  4085. }
  4086. array = arrays[0];
  4087. var index = -1,
  4088. seen = caches[0];
  4089. outer:
  4090. while (++index < length && result.length < maxLength) {
  4091. var value = array[index],
  4092. computed = iteratee ? iteratee(value) : value;
  4093. value = (comparator || value !== 0) ? value : 0;
  4094. if (!(seen
  4095. ? cacheHas(seen, computed)
  4096. : includes(result, computed, comparator)
  4097. )) {
  4098. othIndex = othLength;
  4099. while (--othIndex) {
  4100. var cache = caches[othIndex];
  4101. if (!(cache
  4102. ? cacheHas(cache, computed)
  4103. : includes(arrays[othIndex], computed, comparator))
  4104. ) {
  4105. continue outer;
  4106. }
  4107. }
  4108. if (seen) {
  4109. seen.push(computed);
  4110. }
  4111. result.push(value);
  4112. }
  4113. }
  4114. return result;
  4115. }
  4116. /**
  4117. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4118. * `object` with values transformed by `iteratee` and set by `setter`.
  4119. *
  4120. * @private
  4121. * @param {Object} object The object to iterate over.
  4122. * @param {Function} setter The function to set `accumulator` values.
  4123. * @param {Function} iteratee The iteratee to transform values.
  4124. * @param {Object} accumulator The initial inverted object.
  4125. * @returns {Function} Returns `accumulator`.
  4126. */
  4127. function baseInverter(object, setter, iteratee, accumulator) {
  4128. baseForOwn(object, function(value, key, object) {
  4129. setter(accumulator, iteratee(value), key, object);
  4130. });
  4131. return accumulator;
  4132. }
  4133. /**
  4134. * The base implementation of `_.invoke` without support for individual
  4135. * method arguments.
  4136. *
  4137. * @private
  4138. * @param {Object} object The object to query.
  4139. * @param {Array|string} path The path of the method to invoke.
  4140. * @param {Array} args The arguments to invoke the method with.
  4141. * @returns {*} Returns the result of the invoked method.
  4142. */
  4143. function baseInvoke(object, path, args) {
  4144. path = castPath(path, object);
  4145. object = parent(object, path);
  4146. var func = object == null ? object : object[toKey(last(path))];
  4147. return func == null ? undefined : apply(func, object, args);
  4148. }
  4149. /**
  4150. * The base implementation of `_.isArguments`.
  4151. *
  4152. * @private
  4153. * @param {*} value The value to check.
  4154. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4155. */
  4156. function baseIsArguments(value) {
  4157. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4158. }
  4159. /**
  4160. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4161. *
  4162. * @private
  4163. * @param {*} value The value to check.
  4164. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4165. */
  4166. function baseIsArrayBuffer(value) {
  4167. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4168. }
  4169. /**
  4170. * The base implementation of `_.isDate` without Node.js optimizations.
  4171. *
  4172. * @private
  4173. * @param {*} value The value to check.
  4174. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4175. */
  4176. function baseIsDate(value) {
  4177. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4178. }
  4179. /**
  4180. * The base implementation of `_.isEqual` which supports partial comparisons
  4181. * and tracks traversed objects.
  4182. *
  4183. * @private
  4184. * @param {*} value The value to compare.
  4185. * @param {*} other The other value to compare.
  4186. * @param {boolean} bitmask The bitmask flags.
  4187. * 1 - Unordered comparison
  4188. * 2 - Partial comparison
  4189. * @param {Function} [customizer] The function to customize comparisons.
  4190. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4191. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4192. */
  4193. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4194. if (value === other) {
  4195. return true;
  4196. }
  4197. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4198. return value !== value && other !== other;
  4199. }
  4200. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4201. }
  4202. /**
  4203. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4204. * deep comparisons and tracks traversed objects enabling objects with circular
  4205. * references to be compared.
  4206. *
  4207. * @private
  4208. * @param {Object} object The object to compare.
  4209. * @param {Object} other The other object to compare.
  4210. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4211. * @param {Function} customizer The function to customize comparisons.
  4212. * @param {Function} equalFunc The function to determine equivalents of values.
  4213. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4214. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4215. */
  4216. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4217. var objIsArr = isArray(object),
  4218. othIsArr = isArray(other),
  4219. objTag = objIsArr ? arrayTag : getTag(object),
  4220. othTag = othIsArr ? arrayTag : getTag(other);
  4221. objTag = objTag == argsTag ? objectTag : objTag;
  4222. othTag = othTag == argsTag ? objectTag : othTag;
  4223. var objIsObj = objTag == objectTag,
  4224. othIsObj = othTag == objectTag,
  4225. isSameTag = objTag == othTag;
  4226. if (isSameTag && isBuffer(object)) {
  4227. if (!isBuffer(other)) {
  4228. return false;
  4229. }
  4230. objIsArr = true;
  4231. objIsObj = false;
  4232. }
  4233. if (isSameTag && !objIsObj) {
  4234. stack || (stack = new Stack);
  4235. return (objIsArr || isTypedArray(object))
  4236. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4237. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4238. }
  4239. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4240. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4241. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4242. if (objIsWrapped || othIsWrapped) {
  4243. var objUnwrapped = objIsWrapped ? object.value() : object,
  4244. othUnwrapped = othIsWrapped ? other.value() : other;
  4245. stack || (stack = new Stack);
  4246. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4247. }
  4248. }
  4249. if (!isSameTag) {
  4250. return false;
  4251. }
  4252. stack || (stack = new Stack);
  4253. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4254. }
  4255. /**
  4256. * The base implementation of `_.isMap` without Node.js optimizations.
  4257. *
  4258. * @private
  4259. * @param {*} value The value to check.
  4260. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4261. */
  4262. function baseIsMap(value) {
  4263. return isObjectLike(value) && getTag(value) == mapTag;
  4264. }
  4265. /**
  4266. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4267. *
  4268. * @private
  4269. * @param {Object} object The object to inspect.
  4270. * @param {Object} source The object of property values to match.
  4271. * @param {Array} matchData The property names, values, and compare flags to match.
  4272. * @param {Function} [customizer] The function to customize comparisons.
  4273. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4274. */
  4275. function baseIsMatch(object, source, matchData, customizer) {
  4276. var index = matchData.length,
  4277. length = index,
  4278. noCustomizer = !customizer;
  4279. if (object == null) {
  4280. return !length;
  4281. }
  4282. object = Object(object);
  4283. while (index--) {
  4284. var data = matchData[index];
  4285. if ((noCustomizer && data[2])
  4286. ? data[1] !== object[data[0]]
  4287. : !(data[0] in object)
  4288. ) {
  4289. return false;
  4290. }
  4291. }
  4292. while (++index < length) {
  4293. data = matchData[index];
  4294. var key = data[0],
  4295. objValue = object[key],
  4296. srcValue = data[1];
  4297. if (noCustomizer && data[2]) {
  4298. if (objValue === undefined && !(key in object)) {
  4299. return false;
  4300. }
  4301. } else {
  4302. var stack = new Stack;
  4303. if (customizer) {
  4304. var result = customizer(objValue, srcValue, key, object, source, stack);
  4305. }
  4306. if (!(result === undefined
  4307. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4308. : result
  4309. )) {
  4310. return false;
  4311. }
  4312. }
  4313. }
  4314. return true;
  4315. }
  4316. /**
  4317. * The base implementation of `_.isNative` without bad shim checks.
  4318. *
  4319. * @private
  4320. * @param {*} value The value to check.
  4321. * @returns {boolean} Returns `true` if `value` is a native function,
  4322. * else `false`.
  4323. */
  4324. function baseIsNative(value) {
  4325. if (!isObject(value) || isMasked(value)) {
  4326. return false;
  4327. }
  4328. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4329. return pattern.test(toSource(value));
  4330. }
  4331. /**
  4332. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4333. *
  4334. * @private
  4335. * @param {*} value The value to check.
  4336. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4337. */
  4338. function baseIsRegExp(value) {
  4339. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4340. }
  4341. /**
  4342. * The base implementation of `_.isSet` without Node.js optimizations.
  4343. *
  4344. * @private
  4345. * @param {*} value The value to check.
  4346. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4347. */
  4348. function baseIsSet(value) {
  4349. return isObjectLike(value) && getTag(value) == setTag;
  4350. }
  4351. /**
  4352. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4353. *
  4354. * @private
  4355. * @param {*} value The value to check.
  4356. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4357. */
  4358. function baseIsTypedArray(value) {
  4359. return isObjectLike(value) &&
  4360. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4361. }
  4362. /**
  4363. * The base implementation of `_.iteratee`.
  4364. *
  4365. * @private
  4366. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4367. * @returns {Function} Returns the iteratee.
  4368. */
  4369. function baseIteratee(value) {
  4370. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4371. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4372. if (typeof value == 'function') {
  4373. return value;
  4374. }
  4375. if (value == null) {
  4376. return identity;
  4377. }
  4378. if (typeof value == 'object') {
  4379. return isArray(value)
  4380. ? baseMatchesProperty(value[0], value[1])
  4381. : baseMatches(value);
  4382. }
  4383. return property(value);
  4384. }
  4385. /**
  4386. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4387. *
  4388. * @private
  4389. * @param {Object} object The object to query.
  4390. * @returns {Array} Returns the array of property names.
  4391. */
  4392. function baseKeys(object) {
  4393. if (!isPrototype(object)) {
  4394. return nativeKeys(object);
  4395. }
  4396. var result = [];
  4397. for (var key in Object(object)) {
  4398. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4399. result.push(key);
  4400. }
  4401. }
  4402. return result;
  4403. }
  4404. /**
  4405. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4406. *
  4407. * @private
  4408. * @param {Object} object The object to query.
  4409. * @returns {Array} Returns the array of property names.
  4410. */
  4411. function baseKeysIn(object) {
  4412. if (!isObject(object)) {
  4413. return nativeKeysIn(object);
  4414. }
  4415. var isProto = isPrototype(object),
  4416. result = [];
  4417. for (var key in object) {
  4418. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4419. result.push(key);
  4420. }
  4421. }
  4422. return result;
  4423. }
  4424. /**
  4425. * The base implementation of `_.lt` which doesn't coerce arguments.
  4426. *
  4427. * @private
  4428. * @param {*} value The value to compare.
  4429. * @param {*} other The other value to compare.
  4430. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4431. * else `false`.
  4432. */
  4433. function baseLt(value, other) {
  4434. return value < other;
  4435. }
  4436. /**
  4437. * The base implementation of `_.map` without support for iteratee shorthands.
  4438. *
  4439. * @private
  4440. * @param {Array|Object} collection The collection to iterate over.
  4441. * @param {Function} iteratee The function invoked per iteration.
  4442. * @returns {Array} Returns the new mapped array.
  4443. */
  4444. function baseMap(collection, iteratee) {
  4445. var index = -1,
  4446. result = isArrayLike(collection) ? Array(collection.length) : [];
  4447. baseEach(collection, function(value, key, collection) {
  4448. result[++index] = iteratee(value, key, collection);
  4449. });
  4450. return result;
  4451. }
  4452. /**
  4453. * The base implementation of `_.matches` which doesn't clone `source`.
  4454. *
  4455. * @private
  4456. * @param {Object} source The object of property values to match.
  4457. * @returns {Function} Returns the new spec function.
  4458. */
  4459. function baseMatches(source) {
  4460. var matchData = getMatchData(source);
  4461. if (matchData.length == 1 && matchData[0][2]) {
  4462. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4463. }
  4464. return function(object) {
  4465. return object === source || baseIsMatch(object, source, matchData);
  4466. };
  4467. }
  4468. /**
  4469. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4470. *
  4471. * @private
  4472. * @param {string} path The path of the property to get.
  4473. * @param {*} srcValue The value to match.
  4474. * @returns {Function} Returns the new spec function.
  4475. */
  4476. function baseMatchesProperty(path, srcValue) {
  4477. if (isKey(path) && isStrictComparable(srcValue)) {
  4478. return matchesStrictComparable(toKey(path), srcValue);
  4479. }
  4480. return function(object) {
  4481. var objValue = get(object, path);
  4482. return (objValue === undefined && objValue === srcValue)
  4483. ? hasIn(object, path)
  4484. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4485. };
  4486. }
  4487. /**
  4488. * The base implementation of `_.merge` without support for multiple sources.
  4489. *
  4490. * @private
  4491. * @param {Object} object The destination object.
  4492. * @param {Object} source The source object.
  4493. * @param {number} srcIndex The index of `source`.
  4494. * @param {Function} [customizer] The function to customize merged values.
  4495. * @param {Object} [stack] Tracks traversed source values and their merged
  4496. * counterparts.
  4497. */
  4498. function baseMerge(object, source, srcIndex, customizer, stack) {
  4499. if (object === source) {
  4500. return;
  4501. }
  4502. baseFor(source, function(srcValue, key) {
  4503. stack || (stack = new Stack);
  4504. if (isObject(srcValue)) {
  4505. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4506. }
  4507. else {
  4508. var newValue = customizer
  4509. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4510. : undefined;
  4511. if (newValue === undefined) {
  4512. newValue = srcValue;
  4513. }
  4514. assignMergeValue(object, key, newValue);
  4515. }
  4516. }, keysIn);
  4517. }
  4518. /**
  4519. * A specialized version of `baseMerge` for arrays and objects which performs
  4520. * deep merges and tracks traversed objects enabling objects with circular
  4521. * references to be merged.
  4522. *
  4523. * @private
  4524. * @param {Object} object The destination object.
  4525. * @param {Object} source The source object.
  4526. * @param {string} key The key of the value to merge.
  4527. * @param {number} srcIndex The index of `source`.
  4528. * @param {Function} mergeFunc The function to merge values.
  4529. * @param {Function} [customizer] The function to customize assigned values.
  4530. * @param {Object} [stack] Tracks traversed source values and their merged
  4531. * counterparts.
  4532. */
  4533. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4534. var objValue = safeGet(object, key),
  4535. srcValue = safeGet(source, key),
  4536. stacked = stack.get(srcValue);
  4537. if (stacked) {
  4538. assignMergeValue(object, key, stacked);
  4539. return;
  4540. }
  4541. var newValue = customizer
  4542. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4543. : undefined;
  4544. var isCommon = newValue === undefined;
  4545. if (isCommon) {
  4546. var isArr = isArray(srcValue),
  4547. isBuff = !isArr && isBuffer(srcValue),
  4548. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4549. newValue = srcValue;
  4550. if (isArr || isBuff || isTyped) {
  4551. if (isArray(objValue)) {
  4552. newValue = objValue;
  4553. }
  4554. else if (isArrayLikeObject(objValue)) {
  4555. newValue = copyArray(objValue);
  4556. }
  4557. else if (isBuff) {
  4558. isCommon = false;
  4559. newValue = cloneBuffer(srcValue, true);
  4560. }
  4561. else if (isTyped) {
  4562. isCommon = false;
  4563. newValue = cloneTypedArray(srcValue, true);
  4564. }
  4565. else {
  4566. newValue = [];
  4567. }
  4568. }
  4569. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4570. newValue = objValue;
  4571. if (isArguments(objValue)) {
  4572. newValue = toPlainObject(objValue);
  4573. }
  4574. else if (!isObject(objValue) || isFunction(objValue)) {
  4575. newValue = initCloneObject(srcValue);
  4576. }
  4577. }
  4578. else {
  4579. isCommon = false;
  4580. }
  4581. }
  4582. if (isCommon) {
  4583. // Recursively merge objects and arrays (susceptible to call stack limits).
  4584. stack.set(srcValue, newValue);
  4585. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4586. stack['delete'](srcValue);
  4587. }
  4588. assignMergeValue(object, key, newValue);
  4589. }
  4590. /**
  4591. * The base implementation of `_.nth` which doesn't coerce arguments.
  4592. *
  4593. * @private
  4594. * @param {Array} array The array to query.
  4595. * @param {number} n The index of the element to return.
  4596. * @returns {*} Returns the nth element of `array`.
  4597. */
  4598. function baseNth(array, n) {
  4599. var length = array.length;
  4600. if (!length) {
  4601. return;
  4602. }
  4603. n += n < 0 ? length : 0;
  4604. return isIndex(n, length) ? array[n] : undefined;
  4605. }
  4606. /**
  4607. * The base implementation of `_.orderBy` without param guards.
  4608. *
  4609. * @private
  4610. * @param {Array|Object} collection The collection to iterate over.
  4611. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4612. * @param {string[]} orders The sort orders of `iteratees`.
  4613. * @returns {Array} Returns the new sorted array.
  4614. */
  4615. function baseOrderBy(collection, iteratees, orders) {
  4616. if (iteratees.length) {
  4617. iteratees = arrayMap(iteratees, function(iteratee) {
  4618. if (isArray(iteratee)) {
  4619. return function(value) {
  4620. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4621. }
  4622. }
  4623. return iteratee;
  4624. });
  4625. } else {
  4626. iteratees = [identity];
  4627. }
  4628. var index = -1;
  4629. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4630. var result = baseMap(collection, function(value, key, collection) {
  4631. var criteria = arrayMap(iteratees, function(iteratee) {
  4632. return iteratee(value);
  4633. });
  4634. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4635. });
  4636. return baseSortBy(result, function(object, other) {
  4637. return compareMultiple(object, other, orders);
  4638. });
  4639. }
  4640. /**
  4641. * The base implementation of `_.pick` without support for individual
  4642. * property identifiers.
  4643. *
  4644. * @private
  4645. * @param {Object} object The source object.
  4646. * @param {string[]} paths The property paths to pick.
  4647. * @returns {Object} Returns the new object.
  4648. */
  4649. function basePick(object, paths) {
  4650. return basePickBy(object, paths, function(value, path) {
  4651. return hasIn(object, path);
  4652. });
  4653. }
  4654. /**
  4655. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4656. *
  4657. * @private
  4658. * @param {Object} object The source object.
  4659. * @param {string[]} paths The property paths to pick.
  4660. * @param {Function} predicate The function invoked per property.
  4661. * @returns {Object} Returns the new object.
  4662. */
  4663. function basePickBy(object, paths, predicate) {
  4664. var index = -1,
  4665. length = paths.length,
  4666. result = {};
  4667. while (++index < length) {
  4668. var path = paths[index],
  4669. value = baseGet(object, path);
  4670. if (predicate(value, path)) {
  4671. baseSet(result, castPath(path, object), value);
  4672. }
  4673. }
  4674. return result;
  4675. }
  4676. /**
  4677. * A specialized version of `baseProperty` which supports deep paths.
  4678. *
  4679. * @private
  4680. * @param {Array|string} path The path of the property to get.
  4681. * @returns {Function} Returns the new accessor function.
  4682. */
  4683. function basePropertyDeep(path) {
  4684. return function(object) {
  4685. return baseGet(object, path);
  4686. };
  4687. }
  4688. /**
  4689. * The base implementation of `_.pullAllBy` without support for iteratee
  4690. * shorthands.
  4691. *
  4692. * @private
  4693. * @param {Array} array The array to modify.
  4694. * @param {Array} values The values to remove.
  4695. * @param {Function} [iteratee] The iteratee invoked per element.
  4696. * @param {Function} [comparator] The comparator invoked per element.
  4697. * @returns {Array} Returns `array`.
  4698. */
  4699. function basePullAll(array, values, iteratee, comparator) {
  4700. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4701. index = -1,
  4702. length = values.length,
  4703. seen = array;
  4704. if (array === values) {
  4705. values = copyArray(values);
  4706. }
  4707. if (iteratee) {
  4708. seen = arrayMap(array, baseUnary(iteratee));
  4709. }
  4710. while (++index < length) {
  4711. var fromIndex = 0,
  4712. value = values[index],
  4713. computed = iteratee ? iteratee(value) : value;
  4714. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4715. if (seen !== array) {
  4716. splice.call(seen, fromIndex, 1);
  4717. }
  4718. splice.call(array, fromIndex, 1);
  4719. }
  4720. }
  4721. return array;
  4722. }
  4723. /**
  4724. * The base implementation of `_.pullAt` without support for individual
  4725. * indexes or capturing the removed elements.
  4726. *
  4727. * @private
  4728. * @param {Array} array The array to modify.
  4729. * @param {number[]} indexes The indexes of elements to remove.
  4730. * @returns {Array} Returns `array`.
  4731. */
  4732. function basePullAt(array, indexes) {
  4733. var length = array ? indexes.length : 0,
  4734. lastIndex = length - 1;
  4735. while (length--) {
  4736. var index = indexes[length];
  4737. if (length == lastIndex || index !== previous) {
  4738. var previous = index;
  4739. if (isIndex(index)) {
  4740. splice.call(array, index, 1);
  4741. } else {
  4742. baseUnset(array, index);
  4743. }
  4744. }
  4745. }
  4746. return array;
  4747. }
  4748. /**
  4749. * The base implementation of `_.random` without support for returning
  4750. * floating-point numbers.
  4751. *
  4752. * @private
  4753. * @param {number} lower The lower bound.
  4754. * @param {number} upper The upper bound.
  4755. * @returns {number} Returns the random number.
  4756. */
  4757. function baseRandom(lower, upper) {
  4758. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4759. }
  4760. /**
  4761. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4762. * coerce arguments.
  4763. *
  4764. * @private
  4765. * @param {number} start The start of the range.
  4766. * @param {number} end The end of the range.
  4767. * @param {number} step The value to increment or decrement by.
  4768. * @param {boolean} [fromRight] Specify iterating from right to left.
  4769. * @returns {Array} Returns the range of numbers.
  4770. */
  4771. function baseRange(start, end, step, fromRight) {
  4772. var index = -1,
  4773. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4774. result = Array(length);
  4775. while (length--) {
  4776. result[fromRight ? length : ++index] = start;
  4777. start += step;
  4778. }
  4779. return result;
  4780. }
  4781. /**
  4782. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4783. *
  4784. * @private
  4785. * @param {string} string The string to repeat.
  4786. * @param {number} n The number of times to repeat the string.
  4787. * @returns {string} Returns the repeated string.
  4788. */
  4789. function baseRepeat(string, n) {
  4790. var result = '';
  4791. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4792. return result;
  4793. }
  4794. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4795. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4796. do {
  4797. if (n % 2) {
  4798. result += string;
  4799. }
  4800. n = nativeFloor(n / 2);
  4801. if (n) {
  4802. string += string;
  4803. }
  4804. } while (n);
  4805. return result;
  4806. }
  4807. /**
  4808. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4809. *
  4810. * @private
  4811. * @param {Function} func The function to apply a rest parameter to.
  4812. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4813. * @returns {Function} Returns the new function.
  4814. */
  4815. function baseRest(func, start) {
  4816. return setToString(overRest(func, start, identity), func + '');
  4817. }
  4818. /**
  4819. * The base implementation of `_.sample`.
  4820. *
  4821. * @private
  4822. * @param {Array|Object} collection The collection to sample.
  4823. * @returns {*} Returns the random element.
  4824. */
  4825. function baseSample(collection) {
  4826. return arraySample(values(collection));
  4827. }
  4828. /**
  4829. * The base implementation of `_.sampleSize` without param guards.
  4830. *
  4831. * @private
  4832. * @param {Array|Object} collection The collection to sample.
  4833. * @param {number} n The number of elements to sample.
  4834. * @returns {Array} Returns the random elements.
  4835. */
  4836. function baseSampleSize(collection, n) {
  4837. var array = values(collection);
  4838. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4839. }
  4840. /**
  4841. * The base implementation of `_.set`.
  4842. *
  4843. * @private
  4844. * @param {Object} object The object to modify.
  4845. * @param {Array|string} path The path of the property to set.
  4846. * @param {*} value The value to set.
  4847. * @param {Function} [customizer] The function to customize path creation.
  4848. * @returns {Object} Returns `object`.
  4849. */
  4850. function baseSet(object, path, value, customizer) {
  4851. if (!isObject(object)) {
  4852. return object;
  4853. }
  4854. path = castPath(path, object);
  4855. var index = -1,
  4856. length = path.length,
  4857. lastIndex = length - 1,
  4858. nested = object;
  4859. while (nested != null && ++index < length) {
  4860. var key = toKey(path[index]),
  4861. newValue = value;
  4862. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4863. return object;
  4864. }
  4865. if (index != lastIndex) {
  4866. var objValue = nested[key];
  4867. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4868. if (newValue === undefined) {
  4869. newValue = isObject(objValue)
  4870. ? objValue
  4871. : (isIndex(path[index + 1]) ? [] : {});
  4872. }
  4873. }
  4874. assignValue(nested, key, newValue);
  4875. nested = nested[key];
  4876. }
  4877. return object;
  4878. }
  4879. /**
  4880. * The base implementation of `setData` without support for hot loop shorting.
  4881. *
  4882. * @private
  4883. * @param {Function} func The function to associate metadata with.
  4884. * @param {*} data The metadata.
  4885. * @returns {Function} Returns `func`.
  4886. */
  4887. var baseSetData = !metaMap ? identity : function(func, data) {
  4888. metaMap.set(func, data);
  4889. return func;
  4890. };
  4891. /**
  4892. * The base implementation of `setToString` without support for hot loop shorting.
  4893. *
  4894. * @private
  4895. * @param {Function} func The function to modify.
  4896. * @param {Function} string The `toString` result.
  4897. * @returns {Function} Returns `func`.
  4898. */
  4899. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4900. return defineProperty(func, 'toString', {
  4901. 'configurable': true,
  4902. 'enumerable': false,
  4903. 'value': constant(string),
  4904. 'writable': true
  4905. });
  4906. };
  4907. /**
  4908. * The base implementation of `_.shuffle`.
  4909. *
  4910. * @private
  4911. * @param {Array|Object} collection The collection to shuffle.
  4912. * @returns {Array} Returns the new shuffled array.
  4913. */
  4914. function baseShuffle(collection) {
  4915. return shuffleSelf(values(collection));
  4916. }
  4917. /**
  4918. * The base implementation of `_.slice` without an iteratee call guard.
  4919. *
  4920. * @private
  4921. * @param {Array} array The array to slice.
  4922. * @param {number} [start=0] The start position.
  4923. * @param {number} [end=array.length] The end position.
  4924. * @returns {Array} Returns the slice of `array`.
  4925. */
  4926. function baseSlice(array, start, end) {
  4927. var index = -1,
  4928. length = array.length;
  4929. if (start < 0) {
  4930. start = -start > length ? 0 : (length + start);
  4931. }
  4932. end = end > length ? length : end;
  4933. if (end < 0) {
  4934. end += length;
  4935. }
  4936. length = start > end ? 0 : ((end - start) >>> 0);
  4937. start >>>= 0;
  4938. var result = Array(length);
  4939. while (++index < length) {
  4940. result[index] = array[index + start];
  4941. }
  4942. return result;
  4943. }
  4944. /**
  4945. * The base implementation of `_.some` without support for iteratee shorthands.
  4946. *
  4947. * @private
  4948. * @param {Array|Object} collection The collection to iterate over.
  4949. * @param {Function} predicate The function invoked per iteration.
  4950. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4951. * else `false`.
  4952. */
  4953. function baseSome(collection, predicate) {
  4954. var result;
  4955. baseEach(collection, function(value, index, collection) {
  4956. result = predicate(value, index, collection);
  4957. return !result;
  4958. });
  4959. return !!result;
  4960. }
  4961. /**
  4962. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4963. * performs a binary search of `array` to determine the index at which `value`
  4964. * should be inserted into `array` in order to maintain its sort order.
  4965. *
  4966. * @private
  4967. * @param {Array} array The sorted array to inspect.
  4968. * @param {*} value The value to evaluate.
  4969. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4970. * @returns {number} Returns the index at which `value` should be inserted
  4971. * into `array`.
  4972. */
  4973. function baseSortedIndex(array, value, retHighest) {
  4974. var low = 0,
  4975. high = array == null ? low : array.length;
  4976. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4977. while (low < high) {
  4978. var mid = (low + high) >>> 1,
  4979. computed = array[mid];
  4980. if (computed !== null && !isSymbol(computed) &&
  4981. (retHighest ? (computed <= value) : (computed < value))) {
  4982. low = mid + 1;
  4983. } else {
  4984. high = mid;
  4985. }
  4986. }
  4987. return high;
  4988. }
  4989. return baseSortedIndexBy(array, value, identity, retHighest);
  4990. }
  4991. /**
  4992. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4993. * which invokes `iteratee` for `value` and each element of `array` to compute
  4994. * their sort ranking. The iteratee is invoked with one argument; (value).
  4995. *
  4996. * @private
  4997. * @param {Array} array The sorted array to inspect.
  4998. * @param {*} value The value to evaluate.
  4999. * @param {Function} iteratee The iteratee invoked per element.
  5000. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5001. * @returns {number} Returns the index at which `value` should be inserted
  5002. * into `array`.
  5003. */
  5004. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5005. var low = 0,
  5006. high = array == null ? 0 : array.length;
  5007. if (high === 0) {
  5008. return 0;
  5009. }
  5010. value = iteratee(value);
  5011. var valIsNaN = value !== value,
  5012. valIsNull = value === null,
  5013. valIsSymbol = isSymbol(value),
  5014. valIsUndefined = value === undefined;
  5015. while (low < high) {
  5016. var mid = nativeFloor((low + high) / 2),
  5017. computed = iteratee(array[mid]),
  5018. othIsDefined = computed !== undefined,
  5019. othIsNull = computed === null,
  5020. othIsReflexive = computed === computed,
  5021. othIsSymbol = isSymbol(computed);
  5022. if (valIsNaN) {
  5023. var setLow = retHighest || othIsReflexive;
  5024. } else if (valIsUndefined) {
  5025. setLow = othIsReflexive && (retHighest || othIsDefined);
  5026. } else if (valIsNull) {
  5027. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5028. } else if (valIsSymbol) {
  5029. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5030. } else if (othIsNull || othIsSymbol) {
  5031. setLow = false;
  5032. } else {
  5033. setLow = retHighest ? (computed <= value) : (computed < value);
  5034. }
  5035. if (setLow) {
  5036. low = mid + 1;
  5037. } else {
  5038. high = mid;
  5039. }
  5040. }
  5041. return nativeMin(high, MAX_ARRAY_INDEX);
  5042. }
  5043. /**
  5044. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5045. * support for iteratee shorthands.
  5046. *
  5047. * @private
  5048. * @param {Array} array The array to inspect.
  5049. * @param {Function} [iteratee] The iteratee invoked per element.
  5050. * @returns {Array} Returns the new duplicate free array.
  5051. */
  5052. function baseSortedUniq(array, iteratee) {
  5053. var index = -1,
  5054. length = array.length,
  5055. resIndex = 0,
  5056. result = [];
  5057. while (++index < length) {
  5058. var value = array[index],
  5059. computed = iteratee ? iteratee(value) : value;
  5060. if (!index || !eq(computed, seen)) {
  5061. var seen = computed;
  5062. result[resIndex++] = value === 0 ? 0 : value;
  5063. }
  5064. }
  5065. return result;
  5066. }
  5067. /**
  5068. * The base implementation of `_.toNumber` which doesn't ensure correct
  5069. * conversions of binary, hexadecimal, or octal string values.
  5070. *
  5071. * @private
  5072. * @param {*} value The value to process.
  5073. * @returns {number} Returns the number.
  5074. */
  5075. function baseToNumber(value) {
  5076. if (typeof value == 'number') {
  5077. return value;
  5078. }
  5079. if (isSymbol(value)) {
  5080. return NAN;
  5081. }
  5082. return +value;
  5083. }
  5084. /**
  5085. * The base implementation of `_.toString` which doesn't convert nullish
  5086. * values to empty strings.
  5087. *
  5088. * @private
  5089. * @param {*} value The value to process.
  5090. * @returns {string} Returns the string.
  5091. */
  5092. function baseToString(value) {
  5093. // Exit early for strings to avoid a performance hit in some environments.
  5094. if (typeof value == 'string') {
  5095. return value;
  5096. }
  5097. if (isArray(value)) {
  5098. // Recursively convert values (susceptible to call stack limits).
  5099. return arrayMap(value, baseToString) + '';
  5100. }
  5101. if (isSymbol(value)) {
  5102. return symbolToString ? symbolToString.call(value) : '';
  5103. }
  5104. var result = (value + '');
  5105. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5106. }
  5107. /**
  5108. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5109. *
  5110. * @private
  5111. * @param {Array} array The array to inspect.
  5112. * @param {Function} [iteratee] The iteratee invoked per element.
  5113. * @param {Function} [comparator] The comparator invoked per element.
  5114. * @returns {Array} Returns the new duplicate free array.
  5115. */
  5116. function baseUniq(array, iteratee, comparator) {
  5117. var index = -1,
  5118. includes = arrayIncludes,
  5119. length = array.length,
  5120. isCommon = true,
  5121. result = [],
  5122. seen = result;
  5123. if (comparator) {
  5124. isCommon = false;
  5125. includes = arrayIncludesWith;
  5126. }
  5127. else if (length >= LARGE_ARRAY_SIZE) {
  5128. var set = iteratee ? null : createSet(array);
  5129. if (set) {
  5130. return setToArray(set);
  5131. }
  5132. isCommon = false;
  5133. includes = cacheHas;
  5134. seen = new SetCache;
  5135. }
  5136. else {
  5137. seen = iteratee ? [] : result;
  5138. }
  5139. outer:
  5140. while (++index < length) {
  5141. var value = array[index],
  5142. computed = iteratee ? iteratee(value) : value;
  5143. value = (comparator || value !== 0) ? value : 0;
  5144. if (isCommon && computed === computed) {
  5145. var seenIndex = seen.length;
  5146. while (seenIndex--) {
  5147. if (seen[seenIndex] === computed) {
  5148. continue outer;
  5149. }
  5150. }
  5151. if (iteratee) {
  5152. seen.push(computed);
  5153. }
  5154. result.push(value);
  5155. }
  5156. else if (!includes(seen, computed, comparator)) {
  5157. if (seen !== result) {
  5158. seen.push(computed);
  5159. }
  5160. result.push(value);
  5161. }
  5162. }
  5163. return result;
  5164. }
  5165. /**
  5166. * The base implementation of `_.unset`.
  5167. *
  5168. * @private
  5169. * @param {Object} object The object to modify.
  5170. * @param {Array|string} path The property path to unset.
  5171. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5172. */
  5173. function baseUnset(object, path) {
  5174. path = castPath(path, object);
  5175. object = parent(object, path);
  5176. return object == null || delete object[toKey(last(path))];
  5177. }
  5178. /**
  5179. * The base implementation of `_.update`.
  5180. *
  5181. * @private
  5182. * @param {Object} object The object to modify.
  5183. * @param {Array|string} path The path of the property to update.
  5184. * @param {Function} updater The function to produce the updated value.
  5185. * @param {Function} [customizer] The function to customize path creation.
  5186. * @returns {Object} Returns `object`.
  5187. */
  5188. function baseUpdate(object, path, updater, customizer) {
  5189. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5190. }
  5191. /**
  5192. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5193. * without support for iteratee shorthands.
  5194. *
  5195. * @private
  5196. * @param {Array} array The array to query.
  5197. * @param {Function} predicate The function invoked per iteration.
  5198. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5199. * @param {boolean} [fromRight] Specify iterating from right to left.
  5200. * @returns {Array} Returns the slice of `array`.
  5201. */
  5202. function baseWhile(array, predicate, isDrop, fromRight) {
  5203. var length = array.length,
  5204. index = fromRight ? length : -1;
  5205. while ((fromRight ? index-- : ++index < length) &&
  5206. predicate(array[index], index, array)) {}
  5207. return isDrop
  5208. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5209. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5210. }
  5211. /**
  5212. * The base implementation of `wrapperValue` which returns the result of
  5213. * performing a sequence of actions on the unwrapped `value`, where each
  5214. * successive action is supplied the return value of the previous.
  5215. *
  5216. * @private
  5217. * @param {*} value The unwrapped value.
  5218. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5219. * @returns {*} Returns the resolved value.
  5220. */
  5221. function baseWrapperValue(value, actions) {
  5222. var result = value;
  5223. if (result instanceof LazyWrapper) {
  5224. result = result.value();
  5225. }
  5226. return arrayReduce(actions, function(result, action) {
  5227. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5228. }, result);
  5229. }
  5230. /**
  5231. * The base implementation of methods like `_.xor`, without support for
  5232. * iteratee shorthands, that accepts an array of arrays to inspect.
  5233. *
  5234. * @private
  5235. * @param {Array} arrays The arrays to inspect.
  5236. * @param {Function} [iteratee] The iteratee invoked per element.
  5237. * @param {Function} [comparator] The comparator invoked per element.
  5238. * @returns {Array} Returns the new array of values.
  5239. */
  5240. function baseXor(arrays, iteratee, comparator) {
  5241. var length = arrays.length;
  5242. if (length < 2) {
  5243. return length ? baseUniq(arrays[0]) : [];
  5244. }
  5245. var index = -1,
  5246. result = Array(length);
  5247. while (++index < length) {
  5248. var array = arrays[index],
  5249. othIndex = -1;
  5250. while (++othIndex < length) {
  5251. if (othIndex != index) {
  5252. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5253. }
  5254. }
  5255. }
  5256. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5257. }
  5258. /**
  5259. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5260. *
  5261. * @private
  5262. * @param {Array} props The property identifiers.
  5263. * @param {Array} values The property values.
  5264. * @param {Function} assignFunc The function to assign values.
  5265. * @returns {Object} Returns the new object.
  5266. */
  5267. function baseZipObject(props, values, assignFunc) {
  5268. var index = -1,
  5269. length = props.length,
  5270. valsLength = values.length,
  5271. result = {};
  5272. while (++index < length) {
  5273. var value = index < valsLength ? values[index] : undefined;
  5274. assignFunc(result, props[index], value);
  5275. }
  5276. return result;
  5277. }
  5278. /**
  5279. * Casts `value` to an empty array if it's not an array like object.
  5280. *
  5281. * @private
  5282. * @param {*} value The value to inspect.
  5283. * @returns {Array|Object} Returns the cast array-like object.
  5284. */
  5285. function castArrayLikeObject(value) {
  5286. return isArrayLikeObject(value) ? value : [];
  5287. }
  5288. /**
  5289. * Casts `value` to `identity` if it's not a function.
  5290. *
  5291. * @private
  5292. * @param {*} value The value to inspect.
  5293. * @returns {Function} Returns cast function.
  5294. */
  5295. function castFunction(value) {
  5296. return typeof value == 'function' ? value : identity;
  5297. }
  5298. /**
  5299. * Casts `value` to a path array if it's not one.
  5300. *
  5301. * @private
  5302. * @param {*} value The value to inspect.
  5303. * @param {Object} [object] The object to query keys on.
  5304. * @returns {Array} Returns the cast property path array.
  5305. */
  5306. function castPath(value, object) {
  5307. if (isArray(value)) {
  5308. return value;
  5309. }
  5310. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5311. }
  5312. /**
  5313. * A `baseRest` alias which can be replaced with `identity` by module
  5314. * replacement plugins.
  5315. *
  5316. * @private
  5317. * @type {Function}
  5318. * @param {Function} func The function to apply a rest parameter to.
  5319. * @returns {Function} Returns the new function.
  5320. */
  5321. var castRest = baseRest;
  5322. /**
  5323. * Casts `array` to a slice if it's needed.
  5324. *
  5325. * @private
  5326. * @param {Array} array The array to inspect.
  5327. * @param {number} start The start position.
  5328. * @param {number} [end=array.length] The end position.
  5329. * @returns {Array} Returns the cast slice.
  5330. */
  5331. function castSlice(array, start, end) {
  5332. var length = array.length;
  5333. end = end === undefined ? length : end;
  5334. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5335. }
  5336. /**
  5337. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5338. *
  5339. * @private
  5340. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5341. */
  5342. var clearTimeout = ctxClearTimeout || function(id) {
  5343. return root.clearTimeout(id);
  5344. };
  5345. /**
  5346. * Creates a clone of `buffer`.
  5347. *
  5348. * @private
  5349. * @param {Buffer} buffer The buffer to clone.
  5350. * @param {boolean} [isDeep] Specify a deep clone.
  5351. * @returns {Buffer} Returns the cloned buffer.
  5352. */
  5353. function cloneBuffer(buffer, isDeep) {
  5354. if (isDeep) {
  5355. return buffer.slice();
  5356. }
  5357. var length = buffer.length,
  5358. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5359. buffer.copy(result);
  5360. return result;
  5361. }
  5362. /**
  5363. * Creates a clone of `arrayBuffer`.
  5364. *
  5365. * @private
  5366. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5367. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5368. */
  5369. function cloneArrayBuffer(arrayBuffer) {
  5370. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5371. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5372. return result;
  5373. }
  5374. /**
  5375. * Creates a clone of `dataView`.
  5376. *
  5377. * @private
  5378. * @param {Object} dataView The data view to clone.
  5379. * @param {boolean} [isDeep] Specify a deep clone.
  5380. * @returns {Object} Returns the cloned data view.
  5381. */
  5382. function cloneDataView(dataView, isDeep) {
  5383. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5384. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5385. }
  5386. /**
  5387. * Creates a clone of `regexp`.
  5388. *
  5389. * @private
  5390. * @param {Object} regexp The regexp to clone.
  5391. * @returns {Object} Returns the cloned regexp.
  5392. */
  5393. function cloneRegExp(regexp) {
  5394. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5395. result.lastIndex = regexp.lastIndex;
  5396. return result;
  5397. }
  5398. /**
  5399. * Creates a clone of the `symbol` object.
  5400. *
  5401. * @private
  5402. * @param {Object} symbol The symbol object to clone.
  5403. * @returns {Object} Returns the cloned symbol object.
  5404. */
  5405. function cloneSymbol(symbol) {
  5406. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5407. }
  5408. /**
  5409. * Creates a clone of `typedArray`.
  5410. *
  5411. * @private
  5412. * @param {Object} typedArray The typed array to clone.
  5413. * @param {boolean} [isDeep] Specify a deep clone.
  5414. * @returns {Object} Returns the cloned typed array.
  5415. */
  5416. function cloneTypedArray(typedArray, isDeep) {
  5417. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5418. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5419. }
  5420. /**
  5421. * Compares values to sort them in ascending order.
  5422. *
  5423. * @private
  5424. * @param {*} value The value to compare.
  5425. * @param {*} other The other value to compare.
  5426. * @returns {number} Returns the sort order indicator for `value`.
  5427. */
  5428. function compareAscending(value, other) {
  5429. if (value !== other) {
  5430. var valIsDefined = value !== undefined,
  5431. valIsNull = value === null,
  5432. valIsReflexive = value === value,
  5433. valIsSymbol = isSymbol(value);
  5434. var othIsDefined = other !== undefined,
  5435. othIsNull = other === null,
  5436. othIsReflexive = other === other,
  5437. othIsSymbol = isSymbol(other);
  5438. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5439. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5440. (valIsNull && othIsDefined && othIsReflexive) ||
  5441. (!valIsDefined && othIsReflexive) ||
  5442. !valIsReflexive) {
  5443. return 1;
  5444. }
  5445. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5446. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5447. (othIsNull && valIsDefined && valIsReflexive) ||
  5448. (!othIsDefined && valIsReflexive) ||
  5449. !othIsReflexive) {
  5450. return -1;
  5451. }
  5452. }
  5453. return 0;
  5454. }
  5455. /**
  5456. * Used by `_.orderBy` to compare multiple properties of a value to another
  5457. * and stable sort them.
  5458. *
  5459. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5460. * specify an order of "desc" for descending or "asc" for ascending sort order
  5461. * of corresponding values.
  5462. *
  5463. * @private
  5464. * @param {Object} object The object to compare.
  5465. * @param {Object} other The other object to compare.
  5466. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5467. * @returns {number} Returns the sort order indicator for `object`.
  5468. */
  5469. function compareMultiple(object, other, orders) {
  5470. var index = -1,
  5471. objCriteria = object.criteria,
  5472. othCriteria = other.criteria,
  5473. length = objCriteria.length,
  5474. ordersLength = orders.length;
  5475. while (++index < length) {
  5476. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5477. if (result) {
  5478. if (index >= ordersLength) {
  5479. return result;
  5480. }
  5481. var order = orders[index];
  5482. return result * (order == 'desc' ? -1 : 1);
  5483. }
  5484. }
  5485. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5486. // that causes it, under certain circumstances, to provide the same value for
  5487. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5488. // for more details.
  5489. //
  5490. // This also ensures a stable sort in V8 and other engines.
  5491. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5492. return object.index - other.index;
  5493. }
  5494. /**
  5495. * Creates an array that is the composition of partially applied arguments,
  5496. * placeholders, and provided arguments into a single array of arguments.
  5497. *
  5498. * @private
  5499. * @param {Array} args The provided arguments.
  5500. * @param {Array} partials The arguments to prepend 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 composeArgs(args, partials, holders, isCurried) {
  5506. var argsIndex = -1,
  5507. argsLength = args.length,
  5508. holdersLength = holders.length,
  5509. leftIndex = -1,
  5510. leftLength = partials.length,
  5511. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5512. result = Array(leftLength + rangeLength),
  5513. isUncurried = !isCurried;
  5514. while (++leftIndex < leftLength) {
  5515. result[leftIndex] = partials[leftIndex];
  5516. }
  5517. while (++argsIndex < holdersLength) {
  5518. if (isUncurried || argsIndex < argsLength) {
  5519. result[holders[argsIndex]] = args[argsIndex];
  5520. }
  5521. }
  5522. while (rangeLength--) {
  5523. result[leftIndex++] = args[argsIndex++];
  5524. }
  5525. return result;
  5526. }
  5527. /**
  5528. * This function is like `composeArgs` except that the arguments composition
  5529. * is tailored for `_.partialRight`.
  5530. *
  5531. * @private
  5532. * @param {Array} args The provided arguments.
  5533. * @param {Array} partials The arguments to append to those provided.
  5534. * @param {Array} holders The `partials` placeholder indexes.
  5535. * @params {boolean} [isCurried] Specify composing for a curried function.
  5536. * @returns {Array} Returns the new array of composed arguments.
  5537. */
  5538. function composeArgsRight(args, partials, holders, isCurried) {
  5539. var argsIndex = -1,
  5540. argsLength = args.length,
  5541. holdersIndex = -1,
  5542. holdersLength = holders.length,
  5543. rightIndex = -1,
  5544. rightLength = partials.length,
  5545. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5546. result = Array(rangeLength + rightLength),
  5547. isUncurried = !isCurried;
  5548. while (++argsIndex < rangeLength) {
  5549. result[argsIndex] = args[argsIndex];
  5550. }
  5551. var offset = argsIndex;
  5552. while (++rightIndex < rightLength) {
  5553. result[offset + rightIndex] = partials[rightIndex];
  5554. }
  5555. while (++holdersIndex < holdersLength) {
  5556. if (isUncurried || argsIndex < argsLength) {
  5557. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5558. }
  5559. }
  5560. return result;
  5561. }
  5562. /**
  5563. * Copies the values of `source` to `array`.
  5564. *
  5565. * @private
  5566. * @param {Array} source The array to copy values from.
  5567. * @param {Array} [array=[]] The array to copy values to.
  5568. * @returns {Array} Returns `array`.
  5569. */
  5570. function copyArray(source, array) {
  5571. var index = -1,
  5572. length = source.length;
  5573. array || (array = Array(length));
  5574. while (++index < length) {
  5575. array[index] = source[index];
  5576. }
  5577. return array;
  5578. }
  5579. /**
  5580. * Copies properties of `source` to `object`.
  5581. *
  5582. * @private
  5583. * @param {Object} source The object to copy properties from.
  5584. * @param {Array} props The property identifiers to copy.
  5585. * @param {Object} [object={}] The object to copy properties to.
  5586. * @param {Function} [customizer] The function to customize copied values.
  5587. * @returns {Object} Returns `object`.
  5588. */
  5589. function copyObject(source, props, object, customizer) {
  5590. var isNew = !object;
  5591. object || (object = {});
  5592. var index = -1,
  5593. length = props.length;
  5594. while (++index < length) {
  5595. var key = props[index];
  5596. var newValue = customizer
  5597. ? customizer(object[key], source[key], key, object, source)
  5598. : undefined;
  5599. if (newValue === undefined) {
  5600. newValue = source[key];
  5601. }
  5602. if (isNew) {
  5603. baseAssignValue(object, key, newValue);
  5604. } else {
  5605. assignValue(object, key, newValue);
  5606. }
  5607. }
  5608. return object;
  5609. }
  5610. /**
  5611. * Copies own symbols of `source` to `object`.
  5612. *
  5613. * @private
  5614. * @param {Object} source The object to copy symbols from.
  5615. * @param {Object} [object={}] The object to copy symbols to.
  5616. * @returns {Object} Returns `object`.
  5617. */
  5618. function copySymbols(source, object) {
  5619. return copyObject(source, getSymbols(source), object);
  5620. }
  5621. /**
  5622. * Copies own and inherited symbols of `source` to `object`.
  5623. *
  5624. * @private
  5625. * @param {Object} source The object to copy symbols from.
  5626. * @param {Object} [object={}] The object to copy symbols to.
  5627. * @returns {Object} Returns `object`.
  5628. */
  5629. function copySymbolsIn(source, object) {
  5630. return copyObject(source, getSymbolsIn(source), object);
  5631. }
  5632. /**
  5633. * Creates a function like `_.groupBy`.
  5634. *
  5635. * @private
  5636. * @param {Function} setter The function to set accumulator values.
  5637. * @param {Function} [initializer] The accumulator object initializer.
  5638. * @returns {Function} Returns the new aggregator function.
  5639. */
  5640. function createAggregator(setter, initializer) {
  5641. return function(collection, iteratee) {
  5642. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5643. accumulator = initializer ? initializer() : {};
  5644. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5645. };
  5646. }
  5647. /**
  5648. * Creates a function like `_.assign`.
  5649. *
  5650. * @private
  5651. * @param {Function} assigner The function to assign values.
  5652. * @returns {Function} Returns the new assigner function.
  5653. */
  5654. function createAssigner(assigner) {
  5655. return baseRest(function(object, sources) {
  5656. var index = -1,
  5657. length = sources.length,
  5658. customizer = length > 1 ? sources[length - 1] : undefined,
  5659. guard = length > 2 ? sources[2] : undefined;
  5660. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5661. ? (length--, customizer)
  5662. : undefined;
  5663. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5664. customizer = length < 3 ? undefined : customizer;
  5665. length = 1;
  5666. }
  5667. object = Object(object);
  5668. while (++index < length) {
  5669. var source = sources[index];
  5670. if (source) {
  5671. assigner(object, source, index, customizer);
  5672. }
  5673. }
  5674. return object;
  5675. });
  5676. }
  5677. /**
  5678. * Creates a `baseEach` or `baseEachRight` function.
  5679. *
  5680. * @private
  5681. * @param {Function} eachFunc The function to iterate over a collection.
  5682. * @param {boolean} [fromRight] Specify iterating from right to left.
  5683. * @returns {Function} Returns the new base function.
  5684. */
  5685. function createBaseEach(eachFunc, fromRight) {
  5686. return function(collection, iteratee) {
  5687. if (collection == null) {
  5688. return collection;
  5689. }
  5690. if (!isArrayLike(collection)) {
  5691. return eachFunc(collection, iteratee);
  5692. }
  5693. var length = collection.length,
  5694. index = fromRight ? length : -1,
  5695. iterable = Object(collection);
  5696. while ((fromRight ? index-- : ++index < length)) {
  5697. if (iteratee(iterable[index], index, iterable) === false) {
  5698. break;
  5699. }
  5700. }
  5701. return collection;
  5702. };
  5703. }
  5704. /**
  5705. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5706. *
  5707. * @private
  5708. * @param {boolean} [fromRight] Specify iterating from right to left.
  5709. * @returns {Function} Returns the new base function.
  5710. */
  5711. function createBaseFor(fromRight) {
  5712. return function(object, iteratee, keysFunc) {
  5713. var index = -1,
  5714. iterable = Object(object),
  5715. props = keysFunc(object),
  5716. length = props.length;
  5717. while (length--) {
  5718. var key = props[fromRight ? length : ++index];
  5719. if (iteratee(iterable[key], key, iterable) === false) {
  5720. break;
  5721. }
  5722. }
  5723. return object;
  5724. };
  5725. }
  5726. /**
  5727. * Creates a function that wraps `func` to invoke it with the optional `this`
  5728. * binding of `thisArg`.
  5729. *
  5730. * @private
  5731. * @param {Function} func The function to wrap.
  5732. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5733. * @param {*} [thisArg] The `this` binding of `func`.
  5734. * @returns {Function} Returns the new wrapped function.
  5735. */
  5736. function createBind(func, bitmask, thisArg) {
  5737. var isBind = bitmask & WRAP_BIND_FLAG,
  5738. Ctor = createCtor(func);
  5739. function wrapper() {
  5740. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5741. return fn.apply(isBind ? thisArg : this, arguments);
  5742. }
  5743. return wrapper;
  5744. }
  5745. /**
  5746. * Creates a function like `_.lowerFirst`.
  5747. *
  5748. * @private
  5749. * @param {string} methodName The name of the `String` case method to use.
  5750. * @returns {Function} Returns the new case function.
  5751. */
  5752. function createCaseFirst(methodName) {
  5753. return function(string) {
  5754. string = toString(string);
  5755. var strSymbols = hasUnicode(string)
  5756. ? stringToArray(string)
  5757. : undefined;
  5758. var chr = strSymbols
  5759. ? strSymbols[0]
  5760. : string.charAt(0);
  5761. var trailing = strSymbols
  5762. ? castSlice(strSymbols, 1).join('')
  5763. : string.slice(1);
  5764. return chr[methodName]() + trailing;
  5765. };
  5766. }
  5767. /**
  5768. * Creates a function like `_.camelCase`.
  5769. *
  5770. * @private
  5771. * @param {Function} callback The function to combine each word.
  5772. * @returns {Function} Returns the new compounder function.
  5773. */
  5774. function createCompounder(callback) {
  5775. return function(string) {
  5776. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5777. };
  5778. }
  5779. /**
  5780. * Creates a function that produces an instance of `Ctor` regardless of
  5781. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5782. *
  5783. * @private
  5784. * @param {Function} Ctor The constructor to wrap.
  5785. * @returns {Function} Returns the new wrapped function.
  5786. */
  5787. function createCtor(Ctor) {
  5788. return function() {
  5789. // Use a `switch` statement to work with class constructors. See
  5790. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5791. // for more details.
  5792. var args = arguments;
  5793. switch (args.length) {
  5794. case 0: return new Ctor;
  5795. case 1: return new Ctor(args[0]);
  5796. case 2: return new Ctor(args[0], args[1]);
  5797. case 3: return new Ctor(args[0], args[1], args[2]);
  5798. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5799. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5800. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5801. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5802. }
  5803. var thisBinding = baseCreate(Ctor.prototype),
  5804. result = Ctor.apply(thisBinding, args);
  5805. // Mimic the constructor's `return` behavior.
  5806. // See https://es5.github.io/#x13.2.2 for more details.
  5807. return isObject(result) ? result : thisBinding;
  5808. };
  5809. }
  5810. /**
  5811. * Creates a function that wraps `func` to enable currying.
  5812. *
  5813. * @private
  5814. * @param {Function} func The function to wrap.
  5815. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5816. * @param {number} arity The arity of `func`.
  5817. * @returns {Function} Returns the new wrapped function.
  5818. */
  5819. function createCurry(func, bitmask, arity) {
  5820. var Ctor = createCtor(func);
  5821. function wrapper() {
  5822. var length = arguments.length,
  5823. args = Array(length),
  5824. index = length,
  5825. placeholder = getHolder(wrapper);
  5826. while (index--) {
  5827. args[index] = arguments[index];
  5828. }
  5829. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5830. ? []
  5831. : replaceHolders(args, placeholder);
  5832. length -= holders.length;
  5833. if (length < arity) {
  5834. return createRecurry(
  5835. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5836. args, holders, undefined, undefined, arity - length);
  5837. }
  5838. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5839. return apply(fn, this, args);
  5840. }
  5841. return wrapper;
  5842. }
  5843. /**
  5844. * Creates a `_.find` or `_.findLast` function.
  5845. *
  5846. * @private
  5847. * @param {Function} findIndexFunc The function to find the collection index.
  5848. * @returns {Function} Returns the new find function.
  5849. */
  5850. function createFind(findIndexFunc) {
  5851. return function(collection, predicate, fromIndex) {
  5852. var iterable = Object(collection);
  5853. if (!isArrayLike(collection)) {
  5854. var iteratee = getIteratee(predicate, 3);
  5855. collection = keys(collection);
  5856. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5857. }
  5858. var index = findIndexFunc(collection, predicate, fromIndex);
  5859. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5860. };
  5861. }
  5862. /**
  5863. * Creates a `_.flow` or `_.flowRight` function.
  5864. *
  5865. * @private
  5866. * @param {boolean} [fromRight] Specify iterating from right to left.
  5867. * @returns {Function} Returns the new flow function.
  5868. */
  5869. function createFlow(fromRight) {
  5870. return flatRest(function(funcs) {
  5871. var length = funcs.length,
  5872. index = length,
  5873. prereq = LodashWrapper.prototype.thru;
  5874. if (fromRight) {
  5875. funcs.reverse();
  5876. }
  5877. while (index--) {
  5878. var func = funcs[index];
  5879. if (typeof func != 'function') {
  5880. throw new TypeError(FUNC_ERROR_TEXT);
  5881. }
  5882. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5883. var wrapper = new LodashWrapper([], true);
  5884. }
  5885. }
  5886. index = wrapper ? index : length;
  5887. while (++index < length) {
  5888. func = funcs[index];
  5889. var funcName = getFuncName(func),
  5890. data = funcName == 'wrapper' ? getData(func) : undefined;
  5891. if (data && isLaziable(data[0]) &&
  5892. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5893. !data[4].length && data[9] == 1
  5894. ) {
  5895. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5896. } else {
  5897. wrapper = (func.length == 1 && isLaziable(func))
  5898. ? wrapper[funcName]()
  5899. : wrapper.thru(func);
  5900. }
  5901. }
  5902. return function() {
  5903. var args = arguments,
  5904. value = args[0];
  5905. if (wrapper && args.length == 1 && isArray(value)) {
  5906. return wrapper.plant(value).value();
  5907. }
  5908. var index = 0,
  5909. result = length ? funcs[index].apply(this, args) : value;
  5910. while (++index < length) {
  5911. result = funcs[index].call(this, result);
  5912. }
  5913. return result;
  5914. };
  5915. });
  5916. }
  5917. /**
  5918. * Creates a function that wraps `func` to invoke it with optional `this`
  5919. * binding of `thisArg`, partial application, and currying.
  5920. *
  5921. * @private
  5922. * @param {Function|string} func The function or method name to wrap.
  5923. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5924. * @param {*} [thisArg] The `this` binding of `func`.
  5925. * @param {Array} [partials] The arguments to prepend to those provided to
  5926. * the new function.
  5927. * @param {Array} [holders] The `partials` placeholder indexes.
  5928. * @param {Array} [partialsRight] The arguments to append to those provided
  5929. * to the new function.
  5930. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5931. * @param {Array} [argPos] The argument positions of the new function.
  5932. * @param {number} [ary] The arity cap of `func`.
  5933. * @param {number} [arity] The arity of `func`.
  5934. * @returns {Function} Returns the new wrapped function.
  5935. */
  5936. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5937. var isAry = bitmask & WRAP_ARY_FLAG,
  5938. isBind = bitmask & WRAP_BIND_FLAG,
  5939. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5940. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5941. isFlip = bitmask & WRAP_FLIP_FLAG,
  5942. Ctor = isBindKey ? undefined : createCtor(func);
  5943. function wrapper() {
  5944. var length = arguments.length,
  5945. args = Array(length),
  5946. index = length;
  5947. while (index--) {
  5948. args[index] = arguments[index];
  5949. }
  5950. if (isCurried) {
  5951. var placeholder = getHolder(wrapper),
  5952. holdersCount = countHolders(args, placeholder);
  5953. }
  5954. if (partials) {
  5955. args = composeArgs(args, partials, holders, isCurried);
  5956. }
  5957. if (partialsRight) {
  5958. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5959. }
  5960. length -= holdersCount;
  5961. if (isCurried && length < arity) {
  5962. var newHolders = replaceHolders(args, placeholder);
  5963. return createRecurry(
  5964. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5965. args, newHolders, argPos, ary, arity - length
  5966. );
  5967. }
  5968. var thisBinding = isBind ? thisArg : this,
  5969. fn = isBindKey ? thisBinding[func] : func;
  5970. length = args.length;
  5971. if (argPos) {
  5972. args = reorder(args, argPos);
  5973. } else if (isFlip && length > 1) {
  5974. args.reverse();
  5975. }
  5976. if (isAry && ary < length) {
  5977. args.length = ary;
  5978. }
  5979. if (this && this !== root && this instanceof wrapper) {
  5980. fn = Ctor || createCtor(fn);
  5981. }
  5982. return fn.apply(thisBinding, args);
  5983. }
  5984. return wrapper;
  5985. }
  5986. /**
  5987. * Creates a function like `_.invertBy`.
  5988. *
  5989. * @private
  5990. * @param {Function} setter The function to set accumulator values.
  5991. * @param {Function} toIteratee The function to resolve iteratees.
  5992. * @returns {Function} Returns the new inverter function.
  5993. */
  5994. function createInverter(setter, toIteratee) {
  5995. return function(object, iteratee) {
  5996. return baseInverter(object, setter, toIteratee(iteratee), {});
  5997. };
  5998. }
  5999. /**
  6000. * Creates a function that performs a mathematical operation on two values.
  6001. *
  6002. * @private
  6003. * @param {Function} operator The function to perform the operation.
  6004. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6005. * @returns {Function} Returns the new mathematical operation function.
  6006. */
  6007. function createMathOperation(operator, defaultValue) {
  6008. return function(value, other) {
  6009. var result;
  6010. if (value === undefined && other === undefined) {
  6011. return defaultValue;
  6012. }
  6013. if (value !== undefined) {
  6014. result = value;
  6015. }
  6016. if (other !== undefined) {
  6017. if (result === undefined) {
  6018. return other;
  6019. }
  6020. if (typeof value == 'string' || typeof other == 'string') {
  6021. value = baseToString(value);
  6022. other = baseToString(other);
  6023. } else {
  6024. value = baseToNumber(value);
  6025. other = baseToNumber(other);
  6026. }
  6027. result = operator(value, other);
  6028. }
  6029. return result;
  6030. };
  6031. }
  6032. /**
  6033. * Creates a function like `_.over`.
  6034. *
  6035. * @private
  6036. * @param {Function} arrayFunc The function to iterate over iteratees.
  6037. * @returns {Function} Returns the new over function.
  6038. */
  6039. function createOver(arrayFunc) {
  6040. return flatRest(function(iteratees) {
  6041. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6042. return baseRest(function(args) {
  6043. var thisArg = this;
  6044. return arrayFunc(iteratees, function(iteratee) {
  6045. return apply(iteratee, thisArg, args);
  6046. });
  6047. });
  6048. });
  6049. }
  6050. /**
  6051. * Creates the padding for `string` based on `length`. The `chars` string
  6052. * is truncated if the number of characters exceeds `length`.
  6053. *
  6054. * @private
  6055. * @param {number} length The padding length.
  6056. * @param {string} [chars=' '] The string used as padding.
  6057. * @returns {string} Returns the padding for `string`.
  6058. */
  6059. function createPadding(length, chars) {
  6060. chars = chars === undefined ? ' ' : baseToString(chars);
  6061. var charsLength = chars.length;
  6062. if (charsLength < 2) {
  6063. return charsLength ? baseRepeat(chars, length) : chars;
  6064. }
  6065. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6066. return hasUnicode(chars)
  6067. ? castSlice(stringToArray(result), 0, length).join('')
  6068. : result.slice(0, length);
  6069. }
  6070. /**
  6071. * Creates a function that wraps `func` to invoke it with the `this` binding
  6072. * of `thisArg` and `partials` prepended to the arguments it receives.
  6073. *
  6074. * @private
  6075. * @param {Function} func The function to wrap.
  6076. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6077. * @param {*} thisArg The `this` binding of `func`.
  6078. * @param {Array} partials The arguments to prepend to those provided to
  6079. * the new function.
  6080. * @returns {Function} Returns the new wrapped function.
  6081. */
  6082. function createPartial(func, bitmask, thisArg, partials) {
  6083. var isBind = bitmask & WRAP_BIND_FLAG,
  6084. Ctor = createCtor(func);
  6085. function wrapper() {
  6086. var argsIndex = -1,
  6087. argsLength = arguments.length,
  6088. leftIndex = -1,
  6089. leftLength = partials.length,
  6090. args = Array(leftLength + argsLength),
  6091. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6092. while (++leftIndex < leftLength) {
  6093. args[leftIndex] = partials[leftIndex];
  6094. }
  6095. while (argsLength--) {
  6096. args[leftIndex++] = arguments[++argsIndex];
  6097. }
  6098. return apply(fn, isBind ? thisArg : this, args);
  6099. }
  6100. return wrapper;
  6101. }
  6102. /**
  6103. * Creates a `_.range` or `_.rangeRight` function.
  6104. *
  6105. * @private
  6106. * @param {boolean} [fromRight] Specify iterating from right to left.
  6107. * @returns {Function} Returns the new range function.
  6108. */
  6109. function createRange(fromRight) {
  6110. return function(start, end, step) {
  6111. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6112. end = step = undefined;
  6113. }
  6114. // Ensure the sign of `-0` is preserved.
  6115. start = toFinite(start);
  6116. if (end === undefined) {
  6117. end = start;
  6118. start = 0;
  6119. } else {
  6120. end = toFinite(end);
  6121. }
  6122. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6123. return baseRange(start, end, step, fromRight);
  6124. };
  6125. }
  6126. /**
  6127. * Creates a function that performs a relational operation on two values.
  6128. *
  6129. * @private
  6130. * @param {Function} operator The function to perform the operation.
  6131. * @returns {Function} Returns the new relational operation function.
  6132. */
  6133. function createRelationalOperation(operator) {
  6134. return function(value, other) {
  6135. if (!(typeof value == 'string' && typeof other == 'string')) {
  6136. value = toNumber(value);
  6137. other = toNumber(other);
  6138. }
  6139. return operator(value, other);
  6140. };
  6141. }
  6142. /**
  6143. * Creates a function that wraps `func` to continue currying.
  6144. *
  6145. * @private
  6146. * @param {Function} func The function to wrap.
  6147. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6148. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6149. * @param {*} placeholder The placeholder value.
  6150. * @param {*} [thisArg] The `this` binding of `func`.
  6151. * @param {Array} [partials] The arguments to prepend to those provided to
  6152. * the new function.
  6153. * @param {Array} [holders] The `partials` placeholder indexes.
  6154. * @param {Array} [argPos] The argument positions of the new function.
  6155. * @param {number} [ary] The arity cap of `func`.
  6156. * @param {number} [arity] The arity of `func`.
  6157. * @returns {Function} Returns the new wrapped function.
  6158. */
  6159. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6160. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6161. newHolders = isCurry ? holders : undefined,
  6162. newHoldersRight = isCurry ? undefined : holders,
  6163. newPartials = isCurry ? partials : undefined,
  6164. newPartialsRight = isCurry ? undefined : partials;
  6165. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6166. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6167. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6168. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6169. }
  6170. var newData = [
  6171. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6172. newHoldersRight, argPos, ary, arity
  6173. ];
  6174. var result = wrapFunc.apply(undefined, newData);
  6175. if (isLaziable(func)) {
  6176. setData(result, newData);
  6177. }
  6178. result.placeholder = placeholder;
  6179. return setWrapToString(result, func, bitmask);
  6180. }
  6181. /**
  6182. * Creates a function like `_.round`.
  6183. *
  6184. * @private
  6185. * @param {string} methodName The name of the `Math` method to use when rounding.
  6186. * @returns {Function} Returns the new round function.
  6187. */
  6188. function createRound(methodName) {
  6189. var func = Math[methodName];
  6190. return function(number, precision) {
  6191. number = toNumber(number);
  6192. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6193. if (precision && nativeIsFinite(number)) {
  6194. // Shift with exponential notation to avoid floating-point issues.
  6195. // See [MDN](https://mdn.io/round#Examples) for more details.
  6196. var pair = (toString(number) + 'e').split('e'),
  6197. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6198. pair = (toString(value) + 'e').split('e');
  6199. return +(pair[0] + 'e' + (+pair[1] - precision));
  6200. }
  6201. return func(number);
  6202. };
  6203. }
  6204. /**
  6205. * Creates a set object of `values`.
  6206. *
  6207. * @private
  6208. * @param {Array} values The values to add to the set.
  6209. * @returns {Object} Returns the new set.
  6210. */
  6211. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6212. return new Set(values);
  6213. };
  6214. /**
  6215. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6216. *
  6217. * @private
  6218. * @param {Function} keysFunc The function to get the keys of a given object.
  6219. * @returns {Function} Returns the new pairs function.
  6220. */
  6221. function createToPairs(keysFunc) {
  6222. return function(object) {
  6223. var tag = getTag(object);
  6224. if (tag == mapTag) {
  6225. return mapToArray(object);
  6226. }
  6227. if (tag == setTag) {
  6228. return setToPairs(object);
  6229. }
  6230. return baseToPairs(object, keysFunc(object));
  6231. };
  6232. }
  6233. /**
  6234. * Creates a function that either curries or invokes `func` with optional
  6235. * `this` binding and partially applied arguments.
  6236. *
  6237. * @private
  6238. * @param {Function|string} func The function or method name to wrap.
  6239. * @param {number} bitmask The bitmask flags.
  6240. * 1 - `_.bind`
  6241. * 2 - `_.bindKey`
  6242. * 4 - `_.curry` or `_.curryRight` of a bound function
  6243. * 8 - `_.curry`
  6244. * 16 - `_.curryRight`
  6245. * 32 - `_.partial`
  6246. * 64 - `_.partialRight`
  6247. * 128 - `_.rearg`
  6248. * 256 - `_.ary`
  6249. * 512 - `_.flip`
  6250. * @param {*} [thisArg] The `this` binding of `func`.
  6251. * @param {Array} [partials] The arguments to be partially applied.
  6252. * @param {Array} [holders] The `partials` placeholder indexes.
  6253. * @param {Array} [argPos] The argument positions of the new function.
  6254. * @param {number} [ary] The arity cap of `func`.
  6255. * @param {number} [arity] The arity of `func`.
  6256. * @returns {Function} Returns the new wrapped function.
  6257. */
  6258. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6259. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6260. if (!isBindKey && typeof func != 'function') {
  6261. throw new TypeError(FUNC_ERROR_TEXT);
  6262. }
  6263. var length = partials ? partials.length : 0;
  6264. if (!length) {
  6265. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6266. partials = holders = undefined;
  6267. }
  6268. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6269. arity = arity === undefined ? arity : toInteger(arity);
  6270. length -= holders ? holders.length : 0;
  6271. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6272. var partialsRight = partials,
  6273. holdersRight = holders;
  6274. partials = holders = undefined;
  6275. }
  6276. var data = isBindKey ? undefined : getData(func);
  6277. var newData = [
  6278. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6279. argPos, ary, arity
  6280. ];
  6281. if (data) {
  6282. mergeData(newData, data);
  6283. }
  6284. func = newData[0];
  6285. bitmask = newData[1];
  6286. thisArg = newData[2];
  6287. partials = newData[3];
  6288. holders = newData[4];
  6289. arity = newData[9] = newData[9] === undefined
  6290. ? (isBindKey ? 0 : func.length)
  6291. : nativeMax(newData[9] - length, 0);
  6292. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6293. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6294. }
  6295. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6296. var result = createBind(func, bitmask, thisArg);
  6297. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6298. result = createCurry(func, bitmask, arity);
  6299. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6300. result = createPartial(func, bitmask, thisArg, partials);
  6301. } else {
  6302. result = createHybrid.apply(undefined, newData);
  6303. }
  6304. var setter = data ? baseSetData : setData;
  6305. return setWrapToString(setter(result, newData), func, bitmask);
  6306. }
  6307. /**
  6308. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6309. * of source objects to the destination object for all destination properties
  6310. * that resolve to `undefined`.
  6311. *
  6312. * @private
  6313. * @param {*} objValue The destination value.
  6314. * @param {*} srcValue The source value.
  6315. * @param {string} key The key of the property to assign.
  6316. * @param {Object} object The parent object of `objValue`.
  6317. * @returns {*} Returns the value to assign.
  6318. */
  6319. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6320. if (objValue === undefined ||
  6321. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6322. return srcValue;
  6323. }
  6324. return objValue;
  6325. }
  6326. /**
  6327. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6328. * objects into destination objects that are passed thru.
  6329. *
  6330. * @private
  6331. * @param {*} objValue The destination value.
  6332. * @param {*} srcValue The source value.
  6333. * @param {string} key The key of the property to merge.
  6334. * @param {Object} object The parent object of `objValue`.
  6335. * @param {Object} source The parent object of `srcValue`.
  6336. * @param {Object} [stack] Tracks traversed source values and their merged
  6337. * counterparts.
  6338. * @returns {*} Returns the value to assign.
  6339. */
  6340. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6341. if (isObject(objValue) && isObject(srcValue)) {
  6342. // Recursively merge objects and arrays (susceptible to call stack limits).
  6343. stack.set(srcValue, objValue);
  6344. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6345. stack['delete'](srcValue);
  6346. }
  6347. return objValue;
  6348. }
  6349. /**
  6350. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6351. * objects.
  6352. *
  6353. * @private
  6354. * @param {*} value The value to inspect.
  6355. * @param {string} key The key of the property to inspect.
  6356. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6357. */
  6358. function customOmitClone(value) {
  6359. return isPlainObject(value) ? undefined : value;
  6360. }
  6361. /**
  6362. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6363. * partial deep comparisons.
  6364. *
  6365. * @private
  6366. * @param {Array} array The array to compare.
  6367. * @param {Array} other The other array to compare.
  6368. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6369. * @param {Function} customizer The function to customize comparisons.
  6370. * @param {Function} equalFunc The function to determine equivalents of values.
  6371. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6372. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6373. */
  6374. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6375. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6376. arrLength = array.length,
  6377. othLength = other.length;
  6378. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6379. return false;
  6380. }
  6381. // Check that cyclic values are equal.
  6382. var arrStacked = stack.get(array);
  6383. var othStacked = stack.get(other);
  6384. if (arrStacked && othStacked) {
  6385. return arrStacked == other && othStacked == array;
  6386. }
  6387. var index = -1,
  6388. result = true,
  6389. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6390. stack.set(array, other);
  6391. stack.set(other, array);
  6392. // Ignore non-index properties.
  6393. while (++index < arrLength) {
  6394. var arrValue = array[index],
  6395. othValue = other[index];
  6396. if (customizer) {
  6397. var compared = isPartial
  6398. ? customizer(othValue, arrValue, index, other, array, stack)
  6399. : customizer(arrValue, othValue, index, array, other, stack);
  6400. }
  6401. if (compared !== undefined) {
  6402. if (compared) {
  6403. continue;
  6404. }
  6405. result = false;
  6406. break;
  6407. }
  6408. // Recursively compare arrays (susceptible to call stack limits).
  6409. if (seen) {
  6410. if (!arraySome(other, function(othValue, othIndex) {
  6411. if (!cacheHas(seen, othIndex) &&
  6412. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6413. return seen.push(othIndex);
  6414. }
  6415. })) {
  6416. result = false;
  6417. break;
  6418. }
  6419. } else if (!(
  6420. arrValue === othValue ||
  6421. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6422. )) {
  6423. result = false;
  6424. break;
  6425. }
  6426. }
  6427. stack['delete'](array);
  6428. stack['delete'](other);
  6429. return result;
  6430. }
  6431. /**
  6432. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6433. * the same `toStringTag`.
  6434. *
  6435. * **Note:** This function only supports comparing values with tags of
  6436. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6437. *
  6438. * @private
  6439. * @param {Object} object The object to compare.
  6440. * @param {Object} other The other object to compare.
  6441. * @param {string} tag The `toStringTag` of the objects to compare.
  6442. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6443. * @param {Function} customizer The function to customize comparisons.
  6444. * @param {Function} equalFunc The function to determine equivalents of values.
  6445. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6446. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6447. */
  6448. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6449. switch (tag) {
  6450. case dataViewTag:
  6451. if ((object.byteLength != other.byteLength) ||
  6452. (object.byteOffset != other.byteOffset)) {
  6453. return false;
  6454. }
  6455. object = object.buffer;
  6456. other = other.buffer;
  6457. case arrayBufferTag:
  6458. if ((object.byteLength != other.byteLength) ||
  6459. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6460. return false;
  6461. }
  6462. return true;
  6463. case boolTag:
  6464. case dateTag:
  6465. case numberTag:
  6466. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6467. // Invalid dates are coerced to `NaN`.
  6468. return eq(+object, +other);
  6469. case errorTag:
  6470. return object.name == other.name && object.message == other.message;
  6471. case regexpTag:
  6472. case stringTag:
  6473. // Coerce regexes to strings and treat strings, primitives and objects,
  6474. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6475. // for more details.
  6476. return object == (other + '');
  6477. case mapTag:
  6478. var convert = mapToArray;
  6479. case setTag:
  6480. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6481. convert || (convert = setToArray);
  6482. if (object.size != other.size && !isPartial) {
  6483. return false;
  6484. }
  6485. // Assume cyclic values are equal.
  6486. var stacked = stack.get(object);
  6487. if (stacked) {
  6488. return stacked == other;
  6489. }
  6490. bitmask |= COMPARE_UNORDERED_FLAG;
  6491. // Recursively compare objects (susceptible to call stack limits).
  6492. stack.set(object, other);
  6493. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6494. stack['delete'](object);
  6495. return result;
  6496. case symbolTag:
  6497. if (symbolValueOf) {
  6498. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6499. }
  6500. }
  6501. return false;
  6502. }
  6503. /**
  6504. * A specialized version of `baseIsEqualDeep` for objects with support for
  6505. * partial deep comparisons.
  6506. *
  6507. * @private
  6508. * @param {Object} object The object to compare.
  6509. * @param {Object} other The other object to compare.
  6510. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6511. * @param {Function} customizer The function to customize comparisons.
  6512. * @param {Function} equalFunc The function to determine equivalents of values.
  6513. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6514. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6515. */
  6516. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6517. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6518. objProps = getAllKeys(object),
  6519. objLength = objProps.length,
  6520. othProps = getAllKeys(other),
  6521. othLength = othProps.length;
  6522. if (objLength != othLength && !isPartial) {
  6523. return false;
  6524. }
  6525. var index = objLength;
  6526. while (index--) {
  6527. var key = objProps[index];
  6528. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6529. return false;
  6530. }
  6531. }
  6532. // Check that cyclic values are equal.
  6533. var objStacked = stack.get(object);
  6534. var othStacked = stack.get(other);
  6535. if (objStacked && othStacked) {
  6536. return objStacked == other && othStacked == object;
  6537. }
  6538. var result = true;
  6539. stack.set(object, other);
  6540. stack.set(other, object);
  6541. var skipCtor = isPartial;
  6542. while (++index < objLength) {
  6543. key = objProps[index];
  6544. var objValue = object[key],
  6545. othValue = other[key];
  6546. if (customizer) {
  6547. var compared = isPartial
  6548. ? customizer(othValue, objValue, key, other, object, stack)
  6549. : customizer(objValue, othValue, key, object, other, stack);
  6550. }
  6551. // Recursively compare objects (susceptible to call stack limits).
  6552. if (!(compared === undefined
  6553. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6554. : compared
  6555. )) {
  6556. result = false;
  6557. break;
  6558. }
  6559. skipCtor || (skipCtor = key == 'constructor');
  6560. }
  6561. if (result && !skipCtor) {
  6562. var objCtor = object.constructor,
  6563. othCtor = other.constructor;
  6564. // Non `Object` object instances with different constructors are not equal.
  6565. if (objCtor != othCtor &&
  6566. ('constructor' in object && 'constructor' in other) &&
  6567. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6568. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6569. result = false;
  6570. }
  6571. }
  6572. stack['delete'](object);
  6573. stack['delete'](other);
  6574. return result;
  6575. }
  6576. /**
  6577. * A specialized version of `baseRest` which flattens the rest array.
  6578. *
  6579. * @private
  6580. * @param {Function} func The function to apply a rest parameter to.
  6581. * @returns {Function} Returns the new function.
  6582. */
  6583. function flatRest(func) {
  6584. return setToString(overRest(func, undefined, flatten), func + '');
  6585. }
  6586. /**
  6587. * Creates an array of own enumerable property names and symbols of `object`.
  6588. *
  6589. * @private
  6590. * @param {Object} object The object to query.
  6591. * @returns {Array} Returns the array of property names and symbols.
  6592. */
  6593. function getAllKeys(object) {
  6594. return baseGetAllKeys(object, keys, getSymbols);
  6595. }
  6596. /**
  6597. * Creates an array of own and inherited enumerable property names and
  6598. * symbols of `object`.
  6599. *
  6600. * @private
  6601. * @param {Object} object The object to query.
  6602. * @returns {Array} Returns the array of property names and symbols.
  6603. */
  6604. function getAllKeysIn(object) {
  6605. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6606. }
  6607. /**
  6608. * Gets metadata for `func`.
  6609. *
  6610. * @private
  6611. * @param {Function} func The function to query.
  6612. * @returns {*} Returns the metadata for `func`.
  6613. */
  6614. var getData = !metaMap ? noop : function(func) {
  6615. return metaMap.get(func);
  6616. };
  6617. /**
  6618. * Gets the name of `func`.
  6619. *
  6620. * @private
  6621. * @param {Function} func The function to query.
  6622. * @returns {string} Returns the function name.
  6623. */
  6624. function getFuncName(func) {
  6625. var result = (func.name + ''),
  6626. array = realNames[result],
  6627. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6628. while (length--) {
  6629. var data = array[length],
  6630. otherFunc = data.func;
  6631. if (otherFunc == null || otherFunc == func) {
  6632. return data.name;
  6633. }
  6634. }
  6635. return result;
  6636. }
  6637. /**
  6638. * Gets the argument placeholder value for `func`.
  6639. *
  6640. * @private
  6641. * @param {Function} func The function to inspect.
  6642. * @returns {*} Returns the placeholder value.
  6643. */
  6644. function getHolder(func) {
  6645. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6646. return object.placeholder;
  6647. }
  6648. /**
  6649. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6650. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6651. * If arguments are provided, the chosen function is invoked with them and
  6652. * its result is returned.
  6653. *
  6654. * @private
  6655. * @param {*} [value] The value to convert to an iteratee.
  6656. * @param {number} [arity] The arity of the created iteratee.
  6657. * @returns {Function} Returns the chosen function or its result.
  6658. */
  6659. function getIteratee() {
  6660. var result = lodash.iteratee || iteratee;
  6661. result = result === iteratee ? baseIteratee : result;
  6662. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6663. }
  6664. /**
  6665. * Gets the data for `map`.
  6666. *
  6667. * @private
  6668. * @param {Object} map The map to query.
  6669. * @param {string} key The reference key.
  6670. * @returns {*} Returns the map data.
  6671. */
  6672. function getMapData(map, key) {
  6673. var data = map.__data__;
  6674. return isKeyable(key)
  6675. ? data[typeof key == 'string' ? 'string' : 'hash']
  6676. : data.map;
  6677. }
  6678. /**
  6679. * Gets the property names, values, and compare flags of `object`.
  6680. *
  6681. * @private
  6682. * @param {Object} object The object to query.
  6683. * @returns {Array} Returns the match data of `object`.
  6684. */
  6685. function getMatchData(object) {
  6686. var result = keys(object),
  6687. length = result.length;
  6688. while (length--) {
  6689. var key = result[length],
  6690. value = object[key];
  6691. result[length] = [key, value, isStrictComparable(value)];
  6692. }
  6693. return result;
  6694. }
  6695. /**
  6696. * Gets the native function at `key` of `object`.
  6697. *
  6698. * @private
  6699. * @param {Object} object The object to query.
  6700. * @param {string} key The key of the method to get.
  6701. * @returns {*} Returns the function if it's native, else `undefined`.
  6702. */
  6703. function getNative(object, key) {
  6704. var value = getValue(object, key);
  6705. return baseIsNative(value) ? value : undefined;
  6706. }
  6707. /**
  6708. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6709. *
  6710. * @private
  6711. * @param {*} value The value to query.
  6712. * @returns {string} Returns the raw `toStringTag`.
  6713. */
  6714. function getRawTag(value) {
  6715. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6716. tag = value[symToStringTag];
  6717. try {
  6718. value[symToStringTag] = undefined;
  6719. var unmasked = true;
  6720. } catch (e) {}
  6721. var result = nativeObjectToString.call(value);
  6722. if (unmasked) {
  6723. if (isOwn) {
  6724. value[symToStringTag] = tag;
  6725. } else {
  6726. delete value[symToStringTag];
  6727. }
  6728. }
  6729. return result;
  6730. }
  6731. /**
  6732. * Creates an array of the own enumerable symbols of `object`.
  6733. *
  6734. * @private
  6735. * @param {Object} object The object to query.
  6736. * @returns {Array} Returns the array of symbols.
  6737. */
  6738. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6739. if (object == null) {
  6740. return [];
  6741. }
  6742. object = Object(object);
  6743. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6744. return propertyIsEnumerable.call(object, symbol);
  6745. });
  6746. };
  6747. /**
  6748. * Creates an array of the own and inherited enumerable symbols of `object`.
  6749. *
  6750. * @private
  6751. * @param {Object} object The object to query.
  6752. * @returns {Array} Returns the array of symbols.
  6753. */
  6754. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6755. var result = [];
  6756. while (object) {
  6757. arrayPush(result, getSymbols(object));
  6758. object = getPrototype(object);
  6759. }
  6760. return result;
  6761. };
  6762. /**
  6763. * Gets the `toStringTag` of `value`.
  6764. *
  6765. * @private
  6766. * @param {*} value The value to query.
  6767. * @returns {string} Returns the `toStringTag`.
  6768. */
  6769. var getTag = baseGetTag;
  6770. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6771. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6772. (Map && getTag(new Map) != mapTag) ||
  6773. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6774. (Set && getTag(new Set) != setTag) ||
  6775. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6776. getTag = function(value) {
  6777. var result = baseGetTag(value),
  6778. Ctor = result == objectTag ? value.constructor : undefined,
  6779. ctorString = Ctor ? toSource(Ctor) : '';
  6780. if (ctorString) {
  6781. switch (ctorString) {
  6782. case dataViewCtorString: return dataViewTag;
  6783. case mapCtorString: return mapTag;
  6784. case promiseCtorString: return promiseTag;
  6785. case setCtorString: return setTag;
  6786. case weakMapCtorString: return weakMapTag;
  6787. }
  6788. }
  6789. return result;
  6790. };
  6791. }
  6792. /**
  6793. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6794. *
  6795. * @private
  6796. * @param {number} start The start of the view.
  6797. * @param {number} end The end of the view.
  6798. * @param {Array} transforms The transformations to apply to the view.
  6799. * @returns {Object} Returns an object containing the `start` and `end`
  6800. * positions of the view.
  6801. */
  6802. function getView(start, end, transforms) {
  6803. var index = -1,
  6804. length = transforms.length;
  6805. while (++index < length) {
  6806. var data = transforms[index],
  6807. size = data.size;
  6808. switch (data.type) {
  6809. case 'drop': start += size; break;
  6810. case 'dropRight': end -= size; break;
  6811. case 'take': end = nativeMin(end, start + size); break;
  6812. case 'takeRight': start = nativeMax(start, end - size); break;
  6813. }
  6814. }
  6815. return { 'start': start, 'end': end };
  6816. }
  6817. /**
  6818. * Extracts wrapper details from the `source` body comment.
  6819. *
  6820. * @private
  6821. * @param {string} source The source to inspect.
  6822. * @returns {Array} Returns the wrapper details.
  6823. */
  6824. function getWrapDetails(source) {
  6825. var match = source.match(reWrapDetails);
  6826. return match ? match[1].split(reSplitDetails) : [];
  6827. }
  6828. /**
  6829. * Checks if `path` exists on `object`.
  6830. *
  6831. * @private
  6832. * @param {Object} object The object to query.
  6833. * @param {Array|string} path The path to check.
  6834. * @param {Function} hasFunc The function to check properties.
  6835. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6836. */
  6837. function hasPath(object, path, hasFunc) {
  6838. path = castPath(path, object);
  6839. var index = -1,
  6840. length = path.length,
  6841. result = false;
  6842. while (++index < length) {
  6843. var key = toKey(path[index]);
  6844. if (!(result = object != null && hasFunc(object, key))) {
  6845. break;
  6846. }
  6847. object = object[key];
  6848. }
  6849. if (result || ++index != length) {
  6850. return result;
  6851. }
  6852. length = object == null ? 0 : object.length;
  6853. return !!length && isLength(length) && isIndex(key, length) &&
  6854. (isArray(object) || isArguments(object));
  6855. }
  6856. /**
  6857. * Initializes an array clone.
  6858. *
  6859. * @private
  6860. * @param {Array} array The array to clone.
  6861. * @returns {Array} Returns the initialized clone.
  6862. */
  6863. function initCloneArray(array) {
  6864. var length = array.length,
  6865. result = new array.constructor(length);
  6866. // Add properties assigned by `RegExp#exec`.
  6867. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6868. result.index = array.index;
  6869. result.input = array.input;
  6870. }
  6871. return result;
  6872. }
  6873. /**
  6874. * Initializes an object clone.
  6875. *
  6876. * @private
  6877. * @param {Object} object The object to clone.
  6878. * @returns {Object} Returns the initialized clone.
  6879. */
  6880. function initCloneObject(object) {
  6881. return (typeof object.constructor == 'function' && !isPrototype(object))
  6882. ? baseCreate(getPrototype(object))
  6883. : {};
  6884. }
  6885. /**
  6886. * Initializes an object clone based on its `toStringTag`.
  6887. *
  6888. * **Note:** This function only supports cloning values with tags of
  6889. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6890. *
  6891. * @private
  6892. * @param {Object} object The object to clone.
  6893. * @param {string} tag The `toStringTag` of the object to clone.
  6894. * @param {boolean} [isDeep] Specify a deep clone.
  6895. * @returns {Object} Returns the initialized clone.
  6896. */
  6897. function initCloneByTag(object, tag, isDeep) {
  6898. var Ctor = object.constructor;
  6899. switch (tag) {
  6900. case arrayBufferTag:
  6901. return cloneArrayBuffer(object);
  6902. case boolTag:
  6903. case dateTag:
  6904. return new Ctor(+object);
  6905. case dataViewTag:
  6906. return cloneDataView(object, isDeep);
  6907. case float32Tag: case float64Tag:
  6908. case int8Tag: case int16Tag: case int32Tag:
  6909. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6910. return cloneTypedArray(object, isDeep);
  6911. case mapTag:
  6912. return new Ctor;
  6913. case numberTag:
  6914. case stringTag:
  6915. return new Ctor(object);
  6916. case regexpTag:
  6917. return cloneRegExp(object);
  6918. case setTag:
  6919. return new Ctor;
  6920. case symbolTag:
  6921. return cloneSymbol(object);
  6922. }
  6923. }
  6924. /**
  6925. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6926. *
  6927. * @private
  6928. * @param {string} source The source to modify.
  6929. * @returns {Array} details The details to insert.
  6930. * @returns {string} Returns the modified source.
  6931. */
  6932. function insertWrapDetails(source, details) {
  6933. var length = details.length;
  6934. if (!length) {
  6935. return source;
  6936. }
  6937. var lastIndex = length - 1;
  6938. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6939. details = details.join(length > 2 ? ', ' : ' ');
  6940. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6941. }
  6942. /**
  6943. * Checks if `value` is a flattenable `arguments` object or array.
  6944. *
  6945. * @private
  6946. * @param {*} value The value to check.
  6947. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6948. */
  6949. function isFlattenable(value) {
  6950. return isArray(value) || isArguments(value) ||
  6951. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6952. }
  6953. /**
  6954. * Checks if `value` is a valid array-like index.
  6955. *
  6956. * @private
  6957. * @param {*} value The value to check.
  6958. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6959. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6960. */
  6961. function isIndex(value, length) {
  6962. var type = typeof value;
  6963. length = length == null ? MAX_SAFE_INTEGER : length;
  6964. return !!length &&
  6965. (type == 'number' ||
  6966. (type != 'symbol' && reIsUint.test(value))) &&
  6967. (value > -1 && value % 1 == 0 && value < length);
  6968. }
  6969. /**
  6970. * Checks if the given arguments are from an iteratee call.
  6971. *
  6972. * @private
  6973. * @param {*} value The potential iteratee value argument.
  6974. * @param {*} index The potential iteratee index or key argument.
  6975. * @param {*} object The potential iteratee object argument.
  6976. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6977. * else `false`.
  6978. */
  6979. function isIterateeCall(value, index, object) {
  6980. if (!isObject(object)) {
  6981. return false;
  6982. }
  6983. var type = typeof index;
  6984. if (type == 'number'
  6985. ? (isArrayLike(object) && isIndex(index, object.length))
  6986. : (type == 'string' && index in object)
  6987. ) {
  6988. return eq(object[index], value);
  6989. }
  6990. return false;
  6991. }
  6992. /**
  6993. * Checks if `value` is a property name and not a property path.
  6994. *
  6995. * @private
  6996. * @param {*} value The value to check.
  6997. * @param {Object} [object] The object to query keys on.
  6998. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6999. */
  7000. function isKey(value, object) {
  7001. if (isArray(value)) {
  7002. return false;
  7003. }
  7004. var type = typeof value;
  7005. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7006. value == null || isSymbol(value)) {
  7007. return true;
  7008. }
  7009. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7010. (object != null && value in Object(object));
  7011. }
  7012. /**
  7013. * Checks if `value` is suitable for use as unique object key.
  7014. *
  7015. * @private
  7016. * @param {*} value The value to check.
  7017. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7018. */
  7019. function isKeyable(value) {
  7020. var type = typeof value;
  7021. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7022. ? (value !== '__proto__')
  7023. : (value === null);
  7024. }
  7025. /**
  7026. * Checks if `func` has a lazy counterpart.
  7027. *
  7028. * @private
  7029. * @param {Function} func The function to check.
  7030. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7031. * else `false`.
  7032. */
  7033. function isLaziable(func) {
  7034. var funcName = getFuncName(func),
  7035. other = lodash[funcName];
  7036. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7037. return false;
  7038. }
  7039. if (func === other) {
  7040. return true;
  7041. }
  7042. var data = getData(other);
  7043. return !!data && func === data[0];
  7044. }
  7045. /**
  7046. * Checks if `func` has its source masked.
  7047. *
  7048. * @private
  7049. * @param {Function} func The function to check.
  7050. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7051. */
  7052. function isMasked(func) {
  7053. return !!maskSrcKey && (maskSrcKey in func);
  7054. }
  7055. /**
  7056. * Checks if `func` is capable of being masked.
  7057. *
  7058. * @private
  7059. * @param {*} value The value to check.
  7060. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7061. */
  7062. var isMaskable = coreJsData ? isFunction : stubFalse;
  7063. /**
  7064. * Checks if `value` is likely a prototype object.
  7065. *
  7066. * @private
  7067. * @param {*} value The value to check.
  7068. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7069. */
  7070. function isPrototype(value) {
  7071. var Ctor = value && value.constructor,
  7072. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7073. return value === proto;
  7074. }
  7075. /**
  7076. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7077. *
  7078. * @private
  7079. * @param {*} value The value to check.
  7080. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7081. * equality comparisons, else `false`.
  7082. */
  7083. function isStrictComparable(value) {
  7084. return value === value && !isObject(value);
  7085. }
  7086. /**
  7087. * A specialized version of `matchesProperty` for source values suitable
  7088. * for strict equality comparisons, i.e. `===`.
  7089. *
  7090. * @private
  7091. * @param {string} key The key of the property to get.
  7092. * @param {*} srcValue The value to match.
  7093. * @returns {Function} Returns the new spec function.
  7094. */
  7095. function matchesStrictComparable(key, srcValue) {
  7096. return function(object) {
  7097. if (object == null) {
  7098. return false;
  7099. }
  7100. return object[key] === srcValue &&
  7101. (srcValue !== undefined || (key in Object(object)));
  7102. };
  7103. }
  7104. /**
  7105. * A specialized version of `_.memoize` which clears the memoized function's
  7106. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7107. *
  7108. * @private
  7109. * @param {Function} func The function to have its output memoized.
  7110. * @returns {Function} Returns the new memoized function.
  7111. */
  7112. function memoizeCapped(func) {
  7113. var result = memoize(func, function(key) {
  7114. if (cache.size === MAX_MEMOIZE_SIZE) {
  7115. cache.clear();
  7116. }
  7117. return key;
  7118. });
  7119. var cache = result.cache;
  7120. return result;
  7121. }
  7122. /**
  7123. * Merges the function metadata of `source` into `data`.
  7124. *
  7125. * Merging metadata reduces the number of wrappers used to invoke a function.
  7126. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7127. * may be applied regardless of execution order. Methods like `_.ary` and
  7128. * `_.rearg` modify function arguments, making the order in which they are
  7129. * executed important, preventing the merging of metadata. However, we make
  7130. * an exception for a safe combined case where curried functions have `_.ary`
  7131. * and or `_.rearg` applied.
  7132. *
  7133. * @private
  7134. * @param {Array} data The destination metadata.
  7135. * @param {Array} source The source metadata.
  7136. * @returns {Array} Returns `data`.
  7137. */
  7138. function mergeData(data, source) {
  7139. var bitmask = data[1],
  7140. srcBitmask = source[1],
  7141. newBitmask = bitmask | srcBitmask,
  7142. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7143. var isCombo =
  7144. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7145. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7146. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7147. // Exit early if metadata can't be merged.
  7148. if (!(isCommon || isCombo)) {
  7149. return data;
  7150. }
  7151. // Use source `thisArg` if available.
  7152. if (srcBitmask & WRAP_BIND_FLAG) {
  7153. data[2] = source[2];
  7154. // Set when currying a bound function.
  7155. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7156. }
  7157. // Compose partial arguments.
  7158. var value = source[3];
  7159. if (value) {
  7160. var partials = data[3];
  7161. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7162. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7163. }
  7164. // Compose partial right arguments.
  7165. value = source[5];
  7166. if (value) {
  7167. partials = data[5];
  7168. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7169. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7170. }
  7171. // Use source `argPos` if available.
  7172. value = source[7];
  7173. if (value) {
  7174. data[7] = value;
  7175. }
  7176. // Use source `ary` if it's smaller.
  7177. if (srcBitmask & WRAP_ARY_FLAG) {
  7178. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7179. }
  7180. // Use source `arity` if one is not provided.
  7181. if (data[9] == null) {
  7182. data[9] = source[9];
  7183. }
  7184. // Use source `func` and merge bitmasks.
  7185. data[0] = source[0];
  7186. data[1] = newBitmask;
  7187. return data;
  7188. }
  7189. /**
  7190. * This function is like
  7191. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7192. * except that it includes inherited enumerable properties.
  7193. *
  7194. * @private
  7195. * @param {Object} object The object to query.
  7196. * @returns {Array} Returns the array of property names.
  7197. */
  7198. function nativeKeysIn(object) {
  7199. var result = [];
  7200. if (object != null) {
  7201. for (var key in Object(object)) {
  7202. result.push(key);
  7203. }
  7204. }
  7205. return result;
  7206. }
  7207. /**
  7208. * Converts `value` to a string using `Object.prototype.toString`.
  7209. *
  7210. * @private
  7211. * @param {*} value The value to convert.
  7212. * @returns {string} Returns the converted string.
  7213. */
  7214. function objectToString(value) {
  7215. return nativeObjectToString.call(value);
  7216. }
  7217. /**
  7218. * A specialized version of `baseRest` which transforms the rest array.
  7219. *
  7220. * @private
  7221. * @param {Function} func The function to apply a rest parameter to.
  7222. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7223. * @param {Function} transform The rest array transform.
  7224. * @returns {Function} Returns the new function.
  7225. */
  7226. function overRest(func, start, transform) {
  7227. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7228. return function() {
  7229. var args = arguments,
  7230. index = -1,
  7231. length = nativeMax(args.length - start, 0),
  7232. array = Array(length);
  7233. while (++index < length) {
  7234. array[index] = args[start + index];
  7235. }
  7236. index = -1;
  7237. var otherArgs = Array(start + 1);
  7238. while (++index < start) {
  7239. otherArgs[index] = args[index];
  7240. }
  7241. otherArgs[start] = transform(array);
  7242. return apply(func, this, otherArgs);
  7243. };
  7244. }
  7245. /**
  7246. * Gets the parent value at `path` of `object`.
  7247. *
  7248. * @private
  7249. * @param {Object} object The object to query.
  7250. * @param {Array} path The path to get the parent value of.
  7251. * @returns {*} Returns the parent value.
  7252. */
  7253. function parent(object, path) {
  7254. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7255. }
  7256. /**
  7257. * Reorder `array` according to the specified indexes where the element at
  7258. * the first index is assigned as the first element, the element at
  7259. * the second index is assigned as the second element, and so on.
  7260. *
  7261. * @private
  7262. * @param {Array} array The array to reorder.
  7263. * @param {Array} indexes The arranged array indexes.
  7264. * @returns {Array} Returns `array`.
  7265. */
  7266. function reorder(array, indexes) {
  7267. var arrLength = array.length,
  7268. length = nativeMin(indexes.length, arrLength),
  7269. oldArray = copyArray(array);
  7270. while (length--) {
  7271. var index = indexes[length];
  7272. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7273. }
  7274. return array;
  7275. }
  7276. /**
  7277. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7278. *
  7279. * @private
  7280. * @param {Object} object The object to query.
  7281. * @param {string} key The key of the property to get.
  7282. * @returns {*} Returns the property value.
  7283. */
  7284. function safeGet(object, key) {
  7285. if (key === 'constructor' && typeof object[key] === 'function') {
  7286. return;
  7287. }
  7288. if (key == '__proto__') {
  7289. return;
  7290. }
  7291. return object[key];
  7292. }
  7293. /**
  7294. * Sets metadata for `func`.
  7295. *
  7296. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7297. * period of time, it will trip its breaker and transition to an identity
  7298. * function to avoid garbage collection pauses in V8. See
  7299. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7300. * for more details.
  7301. *
  7302. * @private
  7303. * @param {Function} func The function to associate metadata with.
  7304. * @param {*} data The metadata.
  7305. * @returns {Function} Returns `func`.
  7306. */
  7307. var setData = shortOut(baseSetData);
  7308. /**
  7309. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7310. *
  7311. * @private
  7312. * @param {Function} func The function to delay.
  7313. * @param {number} wait The number of milliseconds to delay invocation.
  7314. * @returns {number|Object} Returns the timer id or timeout object.
  7315. */
  7316. var setTimeout = ctxSetTimeout || function(func, wait) {
  7317. return root.setTimeout(func, wait);
  7318. };
  7319. /**
  7320. * Sets the `toString` method of `func` to return `string`.
  7321. *
  7322. * @private
  7323. * @param {Function} func The function to modify.
  7324. * @param {Function} string The `toString` result.
  7325. * @returns {Function} Returns `func`.
  7326. */
  7327. var setToString = shortOut(baseSetToString);
  7328. /**
  7329. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7330. * with wrapper details in a comment at the top of the source body.
  7331. *
  7332. * @private
  7333. * @param {Function} wrapper The function to modify.
  7334. * @param {Function} reference The reference function.
  7335. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7336. * @returns {Function} Returns `wrapper`.
  7337. */
  7338. function setWrapToString(wrapper, reference, bitmask) {
  7339. var source = (reference + '');
  7340. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7341. }
  7342. /**
  7343. * Creates a function that'll short out and invoke `identity` instead
  7344. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7345. * milliseconds.
  7346. *
  7347. * @private
  7348. * @param {Function} func The function to restrict.
  7349. * @returns {Function} Returns the new shortable function.
  7350. */
  7351. function shortOut(func) {
  7352. var count = 0,
  7353. lastCalled = 0;
  7354. return function() {
  7355. var stamp = nativeNow(),
  7356. remaining = HOT_SPAN - (stamp - lastCalled);
  7357. lastCalled = stamp;
  7358. if (remaining > 0) {
  7359. if (++count >= HOT_COUNT) {
  7360. return arguments[0];
  7361. }
  7362. } else {
  7363. count = 0;
  7364. }
  7365. return func.apply(undefined, arguments);
  7366. };
  7367. }
  7368. /**
  7369. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7370. *
  7371. * @private
  7372. * @param {Array} array The array to shuffle.
  7373. * @param {number} [size=array.length] The size of `array`.
  7374. * @returns {Array} Returns `array`.
  7375. */
  7376. function shuffleSelf(array, size) {
  7377. var index = -1,
  7378. length = array.length,
  7379. lastIndex = length - 1;
  7380. size = size === undefined ? length : size;
  7381. while (++index < size) {
  7382. var rand = baseRandom(index, lastIndex),
  7383. value = array[rand];
  7384. array[rand] = array[index];
  7385. array[index] = value;
  7386. }
  7387. array.length = size;
  7388. return array;
  7389. }
  7390. /**
  7391. * Converts `string` to a property path array.
  7392. *
  7393. * @private
  7394. * @param {string} string The string to convert.
  7395. * @returns {Array} Returns the property path array.
  7396. */
  7397. var stringToPath = memoizeCapped(function(string) {
  7398. var result = [];
  7399. if (string.charCodeAt(0) === 46 /* . */) {
  7400. result.push('');
  7401. }
  7402. string.replace(rePropName, function(match, number, quote, subString) {
  7403. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7404. });
  7405. return result;
  7406. });
  7407. /**
  7408. * Converts `value` to a string key if it's not a string or symbol.
  7409. *
  7410. * @private
  7411. * @param {*} value The value to inspect.
  7412. * @returns {string|symbol} Returns the key.
  7413. */
  7414. function toKey(value) {
  7415. if (typeof value == 'string' || isSymbol(value)) {
  7416. return value;
  7417. }
  7418. var result = (value + '');
  7419. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7420. }
  7421. /**
  7422. * Converts `func` to its source code.
  7423. *
  7424. * @private
  7425. * @param {Function} func The function to convert.
  7426. * @returns {string} Returns the source code.
  7427. */
  7428. function toSource(func) {
  7429. if (func != null) {
  7430. try {
  7431. return funcToString.call(func);
  7432. } catch (e) {}
  7433. try {
  7434. return (func + '');
  7435. } catch (e) {}
  7436. }
  7437. return '';
  7438. }
  7439. /**
  7440. * Updates wrapper `details` based on `bitmask` flags.
  7441. *
  7442. * @private
  7443. * @returns {Array} details The details to modify.
  7444. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7445. * @returns {Array} Returns `details`.
  7446. */
  7447. function updateWrapDetails(details, bitmask) {
  7448. arrayEach(wrapFlags, function(pair) {
  7449. var value = '_.' + pair[0];
  7450. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7451. details.push(value);
  7452. }
  7453. });
  7454. return details.sort();
  7455. }
  7456. /**
  7457. * Creates a clone of `wrapper`.
  7458. *
  7459. * @private
  7460. * @param {Object} wrapper The wrapper to clone.
  7461. * @returns {Object} Returns the cloned wrapper.
  7462. */
  7463. function wrapperClone(wrapper) {
  7464. if (wrapper instanceof LazyWrapper) {
  7465. return wrapper.clone();
  7466. }
  7467. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7468. result.__actions__ = copyArray(wrapper.__actions__);
  7469. result.__index__ = wrapper.__index__;
  7470. result.__values__ = wrapper.__values__;
  7471. return result;
  7472. }
  7473. /*------------------------------------------------------------------------*/
  7474. /**
  7475. * Creates an array of elements split into groups the length of `size`.
  7476. * If `array` can't be split evenly, the final chunk will be the remaining
  7477. * elements.
  7478. *
  7479. * @static
  7480. * @memberOf _
  7481. * @since 3.0.0
  7482. * @category Array
  7483. * @param {Array} array The array to process.
  7484. * @param {number} [size=1] The length of each chunk
  7485. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7486. * @returns {Array} Returns the new array of chunks.
  7487. * @example
  7488. *
  7489. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7490. * // => [['a', 'b'], ['c', 'd']]
  7491. *
  7492. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7493. * // => [['a', 'b', 'c'], ['d']]
  7494. */
  7495. function chunk(array, size, guard) {
  7496. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7497. size = 1;
  7498. } else {
  7499. size = nativeMax(toInteger(size), 0);
  7500. }
  7501. var length = array == null ? 0 : array.length;
  7502. if (!length || size < 1) {
  7503. return [];
  7504. }
  7505. var index = 0,
  7506. resIndex = 0,
  7507. result = Array(nativeCeil(length / size));
  7508. while (index < length) {
  7509. result[resIndex++] = baseSlice(array, index, (index += size));
  7510. }
  7511. return result;
  7512. }
  7513. /**
  7514. * Creates an array with all falsey values removed. The values `false`, `null`,
  7515. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7516. *
  7517. * @static
  7518. * @memberOf _
  7519. * @since 0.1.0
  7520. * @category Array
  7521. * @param {Array} array The array to compact.
  7522. * @returns {Array} Returns the new array of filtered values.
  7523. * @example
  7524. *
  7525. * _.compact([0, 1, false, 2, '', 3]);
  7526. * // => [1, 2, 3]
  7527. */
  7528. function compact(array) {
  7529. var index = -1,
  7530. length = array == null ? 0 : array.length,
  7531. resIndex = 0,
  7532. result = [];
  7533. while (++index < length) {
  7534. var value = array[index];
  7535. if (value) {
  7536. result[resIndex++] = value;
  7537. }
  7538. }
  7539. return result;
  7540. }
  7541. /**
  7542. * Creates a new array concatenating `array` with any additional arrays
  7543. * and/or values.
  7544. *
  7545. * @static
  7546. * @memberOf _
  7547. * @since 4.0.0
  7548. * @category Array
  7549. * @param {Array} array The array to concatenate.
  7550. * @param {...*} [values] The values to concatenate.
  7551. * @returns {Array} Returns the new concatenated array.
  7552. * @example
  7553. *
  7554. * var array = [1];
  7555. * var other = _.concat(array, 2, [3], [[4]]);
  7556. *
  7557. * console.log(other);
  7558. * // => [1, 2, 3, [4]]
  7559. *
  7560. * console.log(array);
  7561. * // => [1]
  7562. */
  7563. function concat() {
  7564. var length = arguments.length;
  7565. if (!length) {
  7566. return [];
  7567. }
  7568. var args = Array(length - 1),
  7569. array = arguments[0],
  7570. index = length;
  7571. while (index--) {
  7572. args[index - 1] = arguments[index];
  7573. }
  7574. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7575. }
  7576. /**
  7577. * Creates an array of `array` values not included in the other given arrays
  7578. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7579. * for equality comparisons. The order and references of result values are
  7580. * determined by the first array.
  7581. *
  7582. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7583. *
  7584. * @static
  7585. * @memberOf _
  7586. * @since 0.1.0
  7587. * @category Array
  7588. * @param {Array} array The array to inspect.
  7589. * @param {...Array} [values] The values to exclude.
  7590. * @returns {Array} Returns the new array of filtered values.
  7591. * @see _.without, _.xor
  7592. * @example
  7593. *
  7594. * _.difference([2, 1], [2, 3]);
  7595. * // => [1]
  7596. */
  7597. var difference = baseRest(function(array, values) {
  7598. return isArrayLikeObject(array)
  7599. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7600. : [];
  7601. });
  7602. /**
  7603. * This method is like `_.difference` except that it accepts `iteratee` which
  7604. * is invoked for each element of `array` and `values` to generate the criterion
  7605. * by which they're compared. The order and references of result values are
  7606. * determined by the first array. The iteratee is invoked with one argument:
  7607. * (value).
  7608. *
  7609. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7610. *
  7611. * @static
  7612. * @memberOf _
  7613. * @since 4.0.0
  7614. * @category Array
  7615. * @param {Array} array The array to inspect.
  7616. * @param {...Array} [values] The values to exclude.
  7617. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7618. * @returns {Array} Returns the new array of filtered values.
  7619. * @example
  7620. *
  7621. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7622. * // => [1.2]
  7623. *
  7624. * // The `_.property` iteratee shorthand.
  7625. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7626. * // => [{ 'x': 2 }]
  7627. */
  7628. var differenceBy = baseRest(function(array, values) {
  7629. var iteratee = last(values);
  7630. if (isArrayLikeObject(iteratee)) {
  7631. iteratee = undefined;
  7632. }
  7633. return isArrayLikeObject(array)
  7634. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7635. : [];
  7636. });
  7637. /**
  7638. * This method is like `_.difference` except that it accepts `comparator`
  7639. * which is invoked to compare elements of `array` to `values`. The order and
  7640. * references of result values are determined by the first array. The comparator
  7641. * is invoked with two arguments: (arrVal, othVal).
  7642. *
  7643. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7644. *
  7645. * @static
  7646. * @memberOf _
  7647. * @since 4.0.0
  7648. * @category Array
  7649. * @param {Array} array The array to inspect.
  7650. * @param {...Array} [values] The values to exclude.
  7651. * @param {Function} [comparator] The comparator invoked per element.
  7652. * @returns {Array} Returns the new array of filtered values.
  7653. * @example
  7654. *
  7655. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7656. *
  7657. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7658. * // => [{ 'x': 2, 'y': 1 }]
  7659. */
  7660. var differenceWith = baseRest(function(array, values) {
  7661. var comparator = last(values);
  7662. if (isArrayLikeObject(comparator)) {
  7663. comparator = undefined;
  7664. }
  7665. return isArrayLikeObject(array)
  7666. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7667. : [];
  7668. });
  7669. /**
  7670. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7671. *
  7672. * @static
  7673. * @memberOf _
  7674. * @since 0.5.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. * _.drop([1, 2, 3]);
  7683. * // => [2, 3]
  7684. *
  7685. * _.drop([1, 2, 3], 2);
  7686. * // => [3]
  7687. *
  7688. * _.drop([1, 2, 3], 5);
  7689. * // => []
  7690. *
  7691. * _.drop([1, 2, 3], 0);
  7692. * // => [1, 2, 3]
  7693. */
  7694. function drop(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. return baseSlice(array, n < 0 ? 0 : n, length);
  7701. }
  7702. /**
  7703. * Creates a slice of `array` with `n` elements dropped from the end.
  7704. *
  7705. * @static
  7706. * @memberOf _
  7707. * @since 3.0.0
  7708. * @category Array
  7709. * @param {Array} array The array to query.
  7710. * @param {number} [n=1] The number of elements to drop.
  7711. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7712. * @returns {Array} Returns the slice of `array`.
  7713. * @example
  7714. *
  7715. * _.dropRight([1, 2, 3]);
  7716. * // => [1, 2]
  7717. *
  7718. * _.dropRight([1, 2, 3], 2);
  7719. * // => [1]
  7720. *
  7721. * _.dropRight([1, 2, 3], 5);
  7722. * // => []
  7723. *
  7724. * _.dropRight([1, 2, 3], 0);
  7725. * // => [1, 2, 3]
  7726. */
  7727. function dropRight(array, n, guard) {
  7728. var length = array == null ? 0 : array.length;
  7729. if (!length) {
  7730. return [];
  7731. }
  7732. n = (guard || n === undefined) ? 1 : toInteger(n);
  7733. n = length - n;
  7734. return baseSlice(array, 0, n < 0 ? 0 : n);
  7735. }
  7736. /**
  7737. * Creates a slice of `array` excluding elements dropped from the end.
  7738. * Elements are dropped until `predicate` returns falsey. The predicate is
  7739. * invoked with three arguments: (value, index, array).
  7740. *
  7741. * @static
  7742. * @memberOf _
  7743. * @since 3.0.0
  7744. * @category Array
  7745. * @param {Array} array The array to query.
  7746. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7747. * @returns {Array} Returns the slice of `array`.
  7748. * @example
  7749. *
  7750. * var users = [
  7751. * { 'user': 'barney', 'active': true },
  7752. * { 'user': 'fred', 'active': false },
  7753. * { 'user': 'pebbles', 'active': false }
  7754. * ];
  7755. *
  7756. * _.dropRightWhile(users, function(o) { return !o.active; });
  7757. * // => objects for ['barney']
  7758. *
  7759. * // The `_.matches` iteratee shorthand.
  7760. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7761. * // => objects for ['barney', 'fred']
  7762. *
  7763. * // The `_.matchesProperty` iteratee shorthand.
  7764. * _.dropRightWhile(users, ['active', false]);
  7765. * // => objects for ['barney']
  7766. *
  7767. * // The `_.property` iteratee shorthand.
  7768. * _.dropRightWhile(users, 'active');
  7769. * // => objects for ['barney', 'fred', 'pebbles']
  7770. */
  7771. function dropRightWhile(array, predicate) {
  7772. return (array && array.length)
  7773. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7774. : [];
  7775. }
  7776. /**
  7777. * Creates a slice of `array` excluding elements dropped from the beginning.
  7778. * Elements are dropped until `predicate` returns falsey. The predicate is
  7779. * invoked with three arguments: (value, index, array).
  7780. *
  7781. * @static
  7782. * @memberOf _
  7783. * @since 3.0.0
  7784. * @category Array
  7785. * @param {Array} array The array to query.
  7786. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7787. * @returns {Array} Returns the slice of `array`.
  7788. * @example
  7789. *
  7790. * var users = [
  7791. * { 'user': 'barney', 'active': false },
  7792. * { 'user': 'fred', 'active': false },
  7793. * { 'user': 'pebbles', 'active': true }
  7794. * ];
  7795. *
  7796. * _.dropWhile(users, function(o) { return !o.active; });
  7797. * // => objects for ['pebbles']
  7798. *
  7799. * // The `_.matches` iteratee shorthand.
  7800. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7801. * // => objects for ['fred', 'pebbles']
  7802. *
  7803. * // The `_.matchesProperty` iteratee shorthand.
  7804. * _.dropWhile(users, ['active', false]);
  7805. * // => objects for ['pebbles']
  7806. *
  7807. * // The `_.property` iteratee shorthand.
  7808. * _.dropWhile(users, 'active');
  7809. * // => objects for ['barney', 'fred', 'pebbles']
  7810. */
  7811. function dropWhile(array, predicate) {
  7812. return (array && array.length)
  7813. ? baseWhile(array, getIteratee(predicate, 3), true)
  7814. : [];
  7815. }
  7816. /**
  7817. * Fills elements of `array` with `value` from `start` up to, but not
  7818. * including, `end`.
  7819. *
  7820. * **Note:** This method mutates `array`.
  7821. *
  7822. * @static
  7823. * @memberOf _
  7824. * @since 3.2.0
  7825. * @category Array
  7826. * @param {Array} array The array to fill.
  7827. * @param {*} value The value to fill `array` with.
  7828. * @param {number} [start=0] The start position.
  7829. * @param {number} [end=array.length] The end position.
  7830. * @returns {Array} Returns `array`.
  7831. * @example
  7832. *
  7833. * var array = [1, 2, 3];
  7834. *
  7835. * _.fill(array, 'a');
  7836. * console.log(array);
  7837. * // => ['a', 'a', 'a']
  7838. *
  7839. * _.fill(Array(3), 2);
  7840. * // => [2, 2, 2]
  7841. *
  7842. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7843. * // => [4, '*', '*', 10]
  7844. */
  7845. function fill(array, value, start, end) {
  7846. var length = array == null ? 0 : array.length;
  7847. if (!length) {
  7848. return [];
  7849. }
  7850. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7851. start = 0;
  7852. end = length;
  7853. }
  7854. return baseFill(array, value, start, end);
  7855. }
  7856. /**
  7857. * This method is like `_.find` except that it returns the index of the first
  7858. * element `predicate` returns truthy for instead of the element itself.
  7859. *
  7860. * @static
  7861. * @memberOf _
  7862. * @since 1.1.0
  7863. * @category Array
  7864. * @param {Array} array The array to inspect.
  7865. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7866. * @param {number} [fromIndex=0] The index to search from.
  7867. * @returns {number} Returns the index of the found element, else `-1`.
  7868. * @example
  7869. *
  7870. * var users = [
  7871. * { 'user': 'barney', 'active': false },
  7872. * { 'user': 'fred', 'active': false },
  7873. * { 'user': 'pebbles', 'active': true }
  7874. * ];
  7875. *
  7876. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7877. * // => 0
  7878. *
  7879. * // The `_.matches` iteratee shorthand.
  7880. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7881. * // => 1
  7882. *
  7883. * // The `_.matchesProperty` iteratee shorthand.
  7884. * _.findIndex(users, ['active', false]);
  7885. * // => 0
  7886. *
  7887. * // The `_.property` iteratee shorthand.
  7888. * _.findIndex(users, 'active');
  7889. * // => 2
  7890. */
  7891. function findIndex(array, predicate, fromIndex) {
  7892. var length = array == null ? 0 : array.length;
  7893. if (!length) {
  7894. return -1;
  7895. }
  7896. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7897. if (index < 0) {
  7898. index = nativeMax(length + index, 0);
  7899. }
  7900. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7901. }
  7902. /**
  7903. * This method is like `_.findIndex` except that it iterates over elements
  7904. * of `collection` from right to left.
  7905. *
  7906. * @static
  7907. * @memberOf _
  7908. * @since 2.0.0
  7909. * @category Array
  7910. * @param {Array} array The array to inspect.
  7911. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7912. * @param {number} [fromIndex=array.length-1] The index to search from.
  7913. * @returns {number} Returns the index of the found element, else `-1`.
  7914. * @example
  7915. *
  7916. * var users = [
  7917. * { 'user': 'barney', 'active': true },
  7918. * { 'user': 'fred', 'active': false },
  7919. * { 'user': 'pebbles', 'active': false }
  7920. * ];
  7921. *
  7922. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7923. * // => 2
  7924. *
  7925. * // The `_.matches` iteratee shorthand.
  7926. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7927. * // => 0
  7928. *
  7929. * // The `_.matchesProperty` iteratee shorthand.
  7930. * _.findLastIndex(users, ['active', false]);
  7931. * // => 2
  7932. *
  7933. * // The `_.property` iteratee shorthand.
  7934. * _.findLastIndex(users, 'active');
  7935. * // => 0
  7936. */
  7937. function findLastIndex(array, predicate, fromIndex) {
  7938. var length = array == null ? 0 : array.length;
  7939. if (!length) {
  7940. return -1;
  7941. }
  7942. var index = length - 1;
  7943. if (fromIndex !== undefined) {
  7944. index = toInteger(fromIndex);
  7945. index = fromIndex < 0
  7946. ? nativeMax(length + index, 0)
  7947. : nativeMin(index, length - 1);
  7948. }
  7949. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7950. }
  7951. /**
  7952. * Flattens `array` a single level deep.
  7953. *
  7954. * @static
  7955. * @memberOf _
  7956. * @since 0.1.0
  7957. * @category Array
  7958. * @param {Array} array The array to flatten.
  7959. * @returns {Array} Returns the new flattened array.
  7960. * @example
  7961. *
  7962. * _.flatten([1, [2, [3, [4]], 5]]);
  7963. * // => [1, 2, [3, [4]], 5]
  7964. */
  7965. function flatten(array) {
  7966. var length = array == null ? 0 : array.length;
  7967. return length ? baseFlatten(array, 1) : [];
  7968. }
  7969. /**
  7970. * Recursively flattens `array`.
  7971. *
  7972. * @static
  7973. * @memberOf _
  7974. * @since 3.0.0
  7975. * @category Array
  7976. * @param {Array} array The array to flatten.
  7977. * @returns {Array} Returns the new flattened array.
  7978. * @example
  7979. *
  7980. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7981. * // => [1, 2, 3, 4, 5]
  7982. */
  7983. function flattenDeep(array) {
  7984. var length = array == null ? 0 : array.length;
  7985. return length ? baseFlatten(array, INFINITY) : [];
  7986. }
  7987. /**
  7988. * Recursively flatten `array` up to `depth` times.
  7989. *
  7990. * @static
  7991. * @memberOf _
  7992. * @since 4.4.0
  7993. * @category Array
  7994. * @param {Array} array The array to flatten.
  7995. * @param {number} [depth=1] The maximum recursion depth.
  7996. * @returns {Array} Returns the new flattened array.
  7997. * @example
  7998. *
  7999. * var array = [1, [2, [3, [4]], 5]];
  8000. *
  8001. * _.flattenDepth(array, 1);
  8002. * // => [1, 2, [3, [4]], 5]
  8003. *
  8004. * _.flattenDepth(array, 2);
  8005. * // => [1, 2, 3, [4], 5]
  8006. */
  8007. function flattenDepth(array, depth) {
  8008. var length = array == null ? 0 : array.length;
  8009. if (!length) {
  8010. return [];
  8011. }
  8012. depth = depth === undefined ? 1 : toInteger(depth);
  8013. return baseFlatten(array, depth);
  8014. }
  8015. /**
  8016. * The inverse of `_.toPairs`; this method returns an object composed
  8017. * from key-value `pairs`.
  8018. *
  8019. * @static
  8020. * @memberOf _
  8021. * @since 4.0.0
  8022. * @category Array
  8023. * @param {Array} pairs The key-value pairs.
  8024. * @returns {Object} Returns the new object.
  8025. * @example
  8026. *
  8027. * _.fromPairs([['a', 1], ['b', 2]]);
  8028. * // => { 'a': 1, 'b': 2 }
  8029. */
  8030. function fromPairs(pairs) {
  8031. var index = -1,
  8032. length = pairs == null ? 0 : pairs.length,
  8033. result = {};
  8034. while (++index < length) {
  8035. var pair = pairs[index];
  8036. result[pair[0]] = pair[1];
  8037. }
  8038. return result;
  8039. }
  8040. /**
  8041. * Gets the first element of `array`.
  8042. *
  8043. * @static
  8044. * @memberOf _
  8045. * @since 0.1.0
  8046. * @alias first
  8047. * @category Array
  8048. * @param {Array} array The array to query.
  8049. * @returns {*} Returns the first element of `array`.
  8050. * @example
  8051. *
  8052. * _.head([1, 2, 3]);
  8053. * // => 1
  8054. *
  8055. * _.head([]);
  8056. * // => undefined
  8057. */
  8058. function head(array) {
  8059. return (array && array.length) ? array[0] : undefined;
  8060. }
  8061. /**
  8062. * Gets the index at which the first occurrence of `value` is found in `array`
  8063. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8064. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8065. * offset from the end of `array`.
  8066. *
  8067. * @static
  8068. * @memberOf _
  8069. * @since 0.1.0
  8070. * @category Array
  8071. * @param {Array} array The array to inspect.
  8072. * @param {*} value The value to search for.
  8073. * @param {number} [fromIndex=0] The index to search from.
  8074. * @returns {number} Returns the index of the matched value, else `-1`.
  8075. * @example
  8076. *
  8077. * _.indexOf([1, 2, 1, 2], 2);
  8078. * // => 1
  8079. *
  8080. * // Search from the `fromIndex`.
  8081. * _.indexOf([1, 2, 1, 2], 2, 2);
  8082. * // => 3
  8083. */
  8084. function indexOf(array, value, fromIndex) {
  8085. var length = array == null ? 0 : array.length;
  8086. if (!length) {
  8087. return -1;
  8088. }
  8089. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8090. if (index < 0) {
  8091. index = nativeMax(length + index, 0);
  8092. }
  8093. return baseIndexOf(array, value, index);
  8094. }
  8095. /**
  8096. * Gets all but the last element of `array`.
  8097. *
  8098. * @static
  8099. * @memberOf _
  8100. * @since 0.1.0
  8101. * @category Array
  8102. * @param {Array} array The array to query.
  8103. * @returns {Array} Returns the slice of `array`.
  8104. * @example
  8105. *
  8106. * _.initial([1, 2, 3]);
  8107. * // => [1, 2]
  8108. */
  8109. function initial(array) {
  8110. var length = array == null ? 0 : array.length;
  8111. return length ? baseSlice(array, 0, -1) : [];
  8112. }
  8113. /**
  8114. * Creates an array of unique values that are included in all given arrays
  8115. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8116. * for equality comparisons. The order and references of result values are
  8117. * determined by the first array.
  8118. *
  8119. * @static
  8120. * @memberOf _
  8121. * @since 0.1.0
  8122. * @category Array
  8123. * @param {...Array} [arrays] The arrays to inspect.
  8124. * @returns {Array} Returns the new array of intersecting values.
  8125. * @example
  8126. *
  8127. * _.intersection([2, 1], [2, 3]);
  8128. * // => [2]
  8129. */
  8130. var intersection = baseRest(function(arrays) {
  8131. var mapped = arrayMap(arrays, castArrayLikeObject);
  8132. return (mapped.length && mapped[0] === arrays[0])
  8133. ? baseIntersection(mapped)
  8134. : [];
  8135. });
  8136. /**
  8137. * This method is like `_.intersection` except that it accepts `iteratee`
  8138. * which is invoked for each element of each `arrays` to generate the criterion
  8139. * by which they're compared. The order and references of result values are
  8140. * determined by the first array. The iteratee is invoked with one argument:
  8141. * (value).
  8142. *
  8143. * @static
  8144. * @memberOf _
  8145. * @since 4.0.0
  8146. * @category Array
  8147. * @param {...Array} [arrays] The arrays to inspect.
  8148. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8149. * @returns {Array} Returns the new array of intersecting values.
  8150. * @example
  8151. *
  8152. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8153. * // => [2.1]
  8154. *
  8155. * // The `_.property` iteratee shorthand.
  8156. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8157. * // => [{ 'x': 1 }]
  8158. */
  8159. var intersectionBy = baseRest(function(arrays) {
  8160. var iteratee = last(arrays),
  8161. mapped = arrayMap(arrays, castArrayLikeObject);
  8162. if (iteratee === last(mapped)) {
  8163. iteratee = undefined;
  8164. } else {
  8165. mapped.pop();
  8166. }
  8167. return (mapped.length && mapped[0] === arrays[0])
  8168. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8169. : [];
  8170. });
  8171. /**
  8172. * This method is like `_.intersection` except that it accepts `comparator`
  8173. * which is invoked to compare elements of `arrays`. The order and references
  8174. * of result values are determined by the first array. The comparator is
  8175. * invoked with two arguments: (arrVal, othVal).
  8176. *
  8177. * @static
  8178. * @memberOf _
  8179. * @since 4.0.0
  8180. * @category Array
  8181. * @param {...Array} [arrays] The arrays to inspect.
  8182. * @param {Function} [comparator] The comparator invoked per element.
  8183. * @returns {Array} Returns the new array of intersecting values.
  8184. * @example
  8185. *
  8186. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8187. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8188. *
  8189. * _.intersectionWith(objects, others, _.isEqual);
  8190. * // => [{ 'x': 1, 'y': 2 }]
  8191. */
  8192. var intersectionWith = baseRest(function(arrays) {
  8193. var comparator = last(arrays),
  8194. mapped = arrayMap(arrays, castArrayLikeObject);
  8195. comparator = typeof comparator == 'function' ? comparator : undefined;
  8196. if (comparator) {
  8197. mapped.pop();
  8198. }
  8199. return (mapped.length && mapped[0] === arrays[0])
  8200. ? baseIntersection(mapped, undefined, comparator)
  8201. : [];
  8202. });
  8203. /**
  8204. * Converts all elements in `array` into a string separated by `separator`.
  8205. *
  8206. * @static
  8207. * @memberOf _
  8208. * @since 4.0.0
  8209. * @category Array
  8210. * @param {Array} array The array to convert.
  8211. * @param {string} [separator=','] The element separator.
  8212. * @returns {string} Returns the joined string.
  8213. * @example
  8214. *
  8215. * _.join(['a', 'b', 'c'], '~');
  8216. * // => 'a~b~c'
  8217. */
  8218. function join(array, separator) {
  8219. return array == null ? '' : nativeJoin.call(array, separator);
  8220. }
  8221. /**
  8222. * Gets the last element of `array`.
  8223. *
  8224. * @static
  8225. * @memberOf _
  8226. * @since 0.1.0
  8227. * @category Array
  8228. * @param {Array} array The array to query.
  8229. * @returns {*} Returns the last element of `array`.
  8230. * @example
  8231. *
  8232. * _.last([1, 2, 3]);
  8233. * // => 3
  8234. */
  8235. function last(array) {
  8236. var length = array == null ? 0 : array.length;
  8237. return length ? array[length - 1] : undefined;
  8238. }
  8239. /**
  8240. * This method is like `_.indexOf` except that it iterates over elements of
  8241. * `array` from right to left.
  8242. *
  8243. * @static
  8244. * @memberOf _
  8245. * @since 0.1.0
  8246. * @category Array
  8247. * @param {Array} array The array to inspect.
  8248. * @param {*} value The value to search for.
  8249. * @param {number} [fromIndex=array.length-1] The index to search from.
  8250. * @returns {number} Returns the index of the matched value, else `-1`.
  8251. * @example
  8252. *
  8253. * _.lastIndexOf([1, 2, 1, 2], 2);
  8254. * // => 3
  8255. *
  8256. * // Search from the `fromIndex`.
  8257. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8258. * // => 1
  8259. */
  8260. function lastIndexOf(array, value, fromIndex) {
  8261. var length = array == null ? 0 : array.length;
  8262. if (!length) {
  8263. return -1;
  8264. }
  8265. var index = length;
  8266. if (fromIndex !== undefined) {
  8267. index = toInteger(fromIndex);
  8268. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8269. }
  8270. return value === value
  8271. ? strictLastIndexOf(array, value, index)
  8272. : baseFindIndex(array, baseIsNaN, index, true);
  8273. }
  8274. /**
  8275. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8276. * element from the end is returned.
  8277. *
  8278. * @static
  8279. * @memberOf _
  8280. * @since 4.11.0
  8281. * @category Array
  8282. * @param {Array} array The array to query.
  8283. * @param {number} [n=0] The index of the element to return.
  8284. * @returns {*} Returns the nth element of `array`.
  8285. * @example
  8286. *
  8287. * var array = ['a', 'b', 'c', 'd'];
  8288. *
  8289. * _.nth(array, 1);
  8290. * // => 'b'
  8291. *
  8292. * _.nth(array, -2);
  8293. * // => 'c';
  8294. */
  8295. function nth(array, n) {
  8296. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8297. }
  8298. /**
  8299. * Removes all given values from `array` using
  8300. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8301. * for equality comparisons.
  8302. *
  8303. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8304. * to remove elements from an array by predicate.
  8305. *
  8306. * @static
  8307. * @memberOf _
  8308. * @since 2.0.0
  8309. * @category Array
  8310. * @param {Array} array The array to modify.
  8311. * @param {...*} [values] The values to remove.
  8312. * @returns {Array} Returns `array`.
  8313. * @example
  8314. *
  8315. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8316. *
  8317. * _.pull(array, 'a', 'c');
  8318. * console.log(array);
  8319. * // => ['b', 'b']
  8320. */
  8321. var pull = baseRest(pullAll);
  8322. /**
  8323. * This method is like `_.pull` except that it accepts an array of values to remove.
  8324. *
  8325. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8326. *
  8327. * @static
  8328. * @memberOf _
  8329. * @since 4.0.0
  8330. * @category Array
  8331. * @param {Array} array The array to modify.
  8332. * @param {Array} values The values to remove.
  8333. * @returns {Array} Returns `array`.
  8334. * @example
  8335. *
  8336. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8337. *
  8338. * _.pullAll(array, ['a', 'c']);
  8339. * console.log(array);
  8340. * // => ['b', 'b']
  8341. */
  8342. function pullAll(array, values) {
  8343. return (array && array.length && values && values.length)
  8344. ? basePullAll(array, values)
  8345. : array;
  8346. }
  8347. /**
  8348. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8349. * invoked for each element of `array` and `values` to generate the criterion
  8350. * by which they're compared. The iteratee is invoked with one argument: (value).
  8351. *
  8352. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8353. *
  8354. * @static
  8355. * @memberOf _
  8356. * @since 4.0.0
  8357. * @category Array
  8358. * @param {Array} array The array to modify.
  8359. * @param {Array} values The values to remove.
  8360. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8361. * @returns {Array} Returns `array`.
  8362. * @example
  8363. *
  8364. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8365. *
  8366. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8367. * console.log(array);
  8368. * // => [{ 'x': 2 }]
  8369. */
  8370. function pullAllBy(array, values, iteratee) {
  8371. return (array && array.length && values && values.length)
  8372. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8373. : array;
  8374. }
  8375. /**
  8376. * This method is like `_.pullAll` except that it accepts `comparator` which
  8377. * is invoked to compare elements of `array` to `values`. The comparator is
  8378. * invoked with two arguments: (arrVal, othVal).
  8379. *
  8380. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8381. *
  8382. * @static
  8383. * @memberOf _
  8384. * @since 4.6.0
  8385. * @category Array
  8386. * @param {Array} array The array to modify.
  8387. * @param {Array} values The values to remove.
  8388. * @param {Function} [comparator] The comparator invoked per element.
  8389. * @returns {Array} Returns `array`.
  8390. * @example
  8391. *
  8392. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8393. *
  8394. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8395. * console.log(array);
  8396. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8397. */
  8398. function pullAllWith(array, values, comparator) {
  8399. return (array && array.length && values && values.length)
  8400. ? basePullAll(array, values, undefined, comparator)
  8401. : array;
  8402. }
  8403. /**
  8404. * Removes elements from `array` corresponding to `indexes` and returns an
  8405. * array of removed elements.
  8406. *
  8407. * **Note:** Unlike `_.at`, this method mutates `array`.
  8408. *
  8409. * @static
  8410. * @memberOf _
  8411. * @since 3.0.0
  8412. * @category Array
  8413. * @param {Array} array The array to modify.
  8414. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8415. * @returns {Array} Returns the new array of removed elements.
  8416. * @example
  8417. *
  8418. * var array = ['a', 'b', 'c', 'd'];
  8419. * var pulled = _.pullAt(array, [1, 3]);
  8420. *
  8421. * console.log(array);
  8422. * // => ['a', 'c']
  8423. *
  8424. * console.log(pulled);
  8425. * // => ['b', 'd']
  8426. */
  8427. var pullAt = flatRest(function(array, indexes) {
  8428. var length = array == null ? 0 : array.length,
  8429. result = baseAt(array, indexes);
  8430. basePullAt(array, arrayMap(indexes, function(index) {
  8431. return isIndex(index, length) ? +index : index;
  8432. }).sort(compareAscending));
  8433. return result;
  8434. });
  8435. /**
  8436. * Removes all elements from `array` that `predicate` returns truthy for
  8437. * and returns an array of the removed elements. The predicate is invoked
  8438. * with three arguments: (value, index, array).
  8439. *
  8440. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8441. * to pull elements from an array by value.
  8442. *
  8443. * @static
  8444. * @memberOf _
  8445. * @since 2.0.0
  8446. * @category Array
  8447. * @param {Array} array The array to modify.
  8448. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8449. * @returns {Array} Returns the new array of removed elements.
  8450. * @example
  8451. *
  8452. * var array = [1, 2, 3, 4];
  8453. * var evens = _.remove(array, function(n) {
  8454. * return n % 2 == 0;
  8455. * });
  8456. *
  8457. * console.log(array);
  8458. * // => [1, 3]
  8459. *
  8460. * console.log(evens);
  8461. * // => [2, 4]
  8462. */
  8463. function remove(array, predicate) {
  8464. var result = [];
  8465. if (!(array && array.length)) {
  8466. return result;
  8467. }
  8468. var index = -1,
  8469. indexes = [],
  8470. length = array.length;
  8471. predicate = getIteratee(predicate, 3);
  8472. while (++index < length) {
  8473. var value = array[index];
  8474. if (predicate(value, index, array)) {
  8475. result.push(value);
  8476. indexes.push(index);
  8477. }
  8478. }
  8479. basePullAt(array, indexes);
  8480. return result;
  8481. }
  8482. /**
  8483. * Reverses `array` so that the first element becomes the last, the second
  8484. * element becomes the second to last, and so on.
  8485. *
  8486. * **Note:** This method mutates `array` and is based on
  8487. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8488. *
  8489. * @static
  8490. * @memberOf _
  8491. * @since 4.0.0
  8492. * @category Array
  8493. * @param {Array} array The array to modify.
  8494. * @returns {Array} Returns `array`.
  8495. * @example
  8496. *
  8497. * var array = [1, 2, 3];
  8498. *
  8499. * _.reverse(array);
  8500. * // => [3, 2, 1]
  8501. *
  8502. * console.log(array);
  8503. * // => [3, 2, 1]
  8504. */
  8505. function reverse(array) {
  8506. return array == null ? array : nativeReverse.call(array);
  8507. }
  8508. /**
  8509. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8510. *
  8511. * **Note:** This method is used instead of
  8512. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8513. * returned.
  8514. *
  8515. * @static
  8516. * @memberOf _
  8517. * @since 3.0.0
  8518. * @category Array
  8519. * @param {Array} array The array to slice.
  8520. * @param {number} [start=0] The start position.
  8521. * @param {number} [end=array.length] The end position.
  8522. * @returns {Array} Returns the slice of `array`.
  8523. */
  8524. function slice(array, start, end) {
  8525. var length = array == null ? 0 : array.length;
  8526. if (!length) {
  8527. return [];
  8528. }
  8529. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8530. start = 0;
  8531. end = length;
  8532. }
  8533. else {
  8534. start = start == null ? 0 : toInteger(start);
  8535. end = end === undefined ? length : toInteger(end);
  8536. }
  8537. return baseSlice(array, start, end);
  8538. }
  8539. /**
  8540. * Uses a binary search to determine the lowest index at which `value`
  8541. * should be inserted into `array` in order to maintain its sort order.
  8542. *
  8543. * @static
  8544. * @memberOf _
  8545. * @since 0.1.0
  8546. * @category Array
  8547. * @param {Array} array The sorted array to inspect.
  8548. * @param {*} value The value to evaluate.
  8549. * @returns {number} Returns the index at which `value` should be inserted
  8550. * into `array`.
  8551. * @example
  8552. *
  8553. * _.sortedIndex([30, 50], 40);
  8554. * // => 1
  8555. */
  8556. function sortedIndex(array, value) {
  8557. return baseSortedIndex(array, value);
  8558. }
  8559. /**
  8560. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8561. * which is invoked for `value` and each element of `array` to compute their
  8562. * sort ranking. The iteratee is invoked with one argument: (value).
  8563. *
  8564. * @static
  8565. * @memberOf _
  8566. * @since 4.0.0
  8567. * @category Array
  8568. * @param {Array} array The sorted array to inspect.
  8569. * @param {*} value The value to evaluate.
  8570. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8571. * @returns {number} Returns the index at which `value` should be inserted
  8572. * into `array`.
  8573. * @example
  8574. *
  8575. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8576. *
  8577. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8578. * // => 0
  8579. *
  8580. * // The `_.property` iteratee shorthand.
  8581. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8582. * // => 0
  8583. */
  8584. function sortedIndexBy(array, value, iteratee) {
  8585. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8586. }
  8587. /**
  8588. * This method is like `_.indexOf` except that it performs a binary
  8589. * search on a sorted `array`.
  8590. *
  8591. * @static
  8592. * @memberOf _
  8593. * @since 4.0.0
  8594. * @category Array
  8595. * @param {Array} array The array to inspect.
  8596. * @param {*} value The value to search for.
  8597. * @returns {number} Returns the index of the matched value, else `-1`.
  8598. * @example
  8599. *
  8600. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8601. * // => 1
  8602. */
  8603. function sortedIndexOf(array, value) {
  8604. var length = array == null ? 0 : array.length;
  8605. if (length) {
  8606. var index = baseSortedIndex(array, value);
  8607. if (index < length && eq(array[index], value)) {
  8608. return index;
  8609. }
  8610. }
  8611. return -1;
  8612. }
  8613. /**
  8614. * This method is like `_.sortedIndex` except that it returns the highest
  8615. * index at which `value` should be inserted into `array` in order to
  8616. * maintain its sort order.
  8617. *
  8618. * @static
  8619. * @memberOf _
  8620. * @since 3.0.0
  8621. * @category Array
  8622. * @param {Array} array The sorted array to inspect.
  8623. * @param {*} value The value to evaluate.
  8624. * @returns {number} Returns the index at which `value` should be inserted
  8625. * into `array`.
  8626. * @example
  8627. *
  8628. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8629. * // => 4
  8630. */
  8631. function sortedLastIndex(array, value) {
  8632. return baseSortedIndex(array, value, true);
  8633. }
  8634. /**
  8635. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8636. * which is invoked for `value` and each element of `array` to compute their
  8637. * sort ranking. The iteratee is invoked with one argument: (value).
  8638. *
  8639. * @static
  8640. * @memberOf _
  8641. * @since 4.0.0
  8642. * @category Array
  8643. * @param {Array} array The sorted array to inspect.
  8644. * @param {*} value The value to evaluate.
  8645. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8646. * @returns {number} Returns the index at which `value` should be inserted
  8647. * into `array`.
  8648. * @example
  8649. *
  8650. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8651. *
  8652. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8653. * // => 1
  8654. *
  8655. * // The `_.property` iteratee shorthand.
  8656. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8657. * // => 1
  8658. */
  8659. function sortedLastIndexBy(array, value, iteratee) {
  8660. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8661. }
  8662. /**
  8663. * This method is like `_.lastIndexOf` except that it performs a binary
  8664. * search on a sorted `array`.
  8665. *
  8666. * @static
  8667. * @memberOf _
  8668. * @since 4.0.0
  8669. * @category Array
  8670. * @param {Array} array The array to inspect.
  8671. * @param {*} value The value to search for.
  8672. * @returns {number} Returns the index of the matched value, else `-1`.
  8673. * @example
  8674. *
  8675. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8676. * // => 3
  8677. */
  8678. function sortedLastIndexOf(array, value) {
  8679. var length = array == null ? 0 : array.length;
  8680. if (length) {
  8681. var index = baseSortedIndex(array, value, true) - 1;
  8682. if (eq(array[index], value)) {
  8683. return index;
  8684. }
  8685. }
  8686. return -1;
  8687. }
  8688. /**
  8689. * This method is like `_.uniq` except that it's designed and optimized
  8690. * for sorted arrays.
  8691. *
  8692. * @static
  8693. * @memberOf _
  8694. * @since 4.0.0
  8695. * @category Array
  8696. * @param {Array} array The array to inspect.
  8697. * @returns {Array} Returns the new duplicate free array.
  8698. * @example
  8699. *
  8700. * _.sortedUniq([1, 1, 2]);
  8701. * // => [1, 2]
  8702. */
  8703. function sortedUniq(array) {
  8704. return (array && array.length)
  8705. ? baseSortedUniq(array)
  8706. : [];
  8707. }
  8708. /**
  8709. * This method is like `_.uniqBy` except that it's designed and optimized
  8710. * for sorted arrays.
  8711. *
  8712. * @static
  8713. * @memberOf _
  8714. * @since 4.0.0
  8715. * @category Array
  8716. * @param {Array} array The array to inspect.
  8717. * @param {Function} [iteratee] The iteratee invoked per element.
  8718. * @returns {Array} Returns the new duplicate free array.
  8719. * @example
  8720. *
  8721. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8722. * // => [1.1, 2.3]
  8723. */
  8724. function sortedUniqBy(array, iteratee) {
  8725. return (array && array.length)
  8726. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8727. : [];
  8728. }
  8729. /**
  8730. * Gets all but the first element of `array`.
  8731. *
  8732. * @static
  8733. * @memberOf _
  8734. * @since 4.0.0
  8735. * @category Array
  8736. * @param {Array} array The array to query.
  8737. * @returns {Array} Returns the slice of `array`.
  8738. * @example
  8739. *
  8740. * _.tail([1, 2, 3]);
  8741. * // => [2, 3]
  8742. */
  8743. function tail(array) {
  8744. var length = array == null ? 0 : array.length;
  8745. return length ? baseSlice(array, 1, length) : [];
  8746. }
  8747. /**
  8748. * Creates a slice of `array` with `n` elements taken from the beginning.
  8749. *
  8750. * @static
  8751. * @memberOf _
  8752. * @since 0.1.0
  8753. * @category Array
  8754. * @param {Array} array The array to query.
  8755. * @param {number} [n=1] The number of elements to take.
  8756. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8757. * @returns {Array} Returns the slice of `array`.
  8758. * @example
  8759. *
  8760. * _.take([1, 2, 3]);
  8761. * // => [1]
  8762. *
  8763. * _.take([1, 2, 3], 2);
  8764. * // => [1, 2]
  8765. *
  8766. * _.take([1, 2, 3], 5);
  8767. * // => [1, 2, 3]
  8768. *
  8769. * _.take([1, 2, 3], 0);
  8770. * // => []
  8771. */
  8772. function take(array, n, guard) {
  8773. if (!(array && array.length)) {
  8774. return [];
  8775. }
  8776. n = (guard || n === undefined) ? 1 : toInteger(n);
  8777. return baseSlice(array, 0, n < 0 ? 0 : n);
  8778. }
  8779. /**
  8780. * Creates a slice of `array` with `n` elements taken from the end.
  8781. *
  8782. * @static
  8783. * @memberOf _
  8784. * @since 3.0.0
  8785. * @category Array
  8786. * @param {Array} array The array to query.
  8787. * @param {number} [n=1] The number of elements to take.
  8788. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8789. * @returns {Array} Returns the slice of `array`.
  8790. * @example
  8791. *
  8792. * _.takeRight([1, 2, 3]);
  8793. * // => [3]
  8794. *
  8795. * _.takeRight([1, 2, 3], 2);
  8796. * // => [2, 3]
  8797. *
  8798. * _.takeRight([1, 2, 3], 5);
  8799. * // => [1, 2, 3]
  8800. *
  8801. * _.takeRight([1, 2, 3], 0);
  8802. * // => []
  8803. */
  8804. function takeRight(array, n, guard) {
  8805. var length = array == null ? 0 : array.length;
  8806. if (!length) {
  8807. return [];
  8808. }
  8809. n = (guard || n === undefined) ? 1 : toInteger(n);
  8810. n = length - n;
  8811. return baseSlice(array, n < 0 ? 0 : n, length);
  8812. }
  8813. /**
  8814. * Creates a slice of `array` with elements taken from the end. Elements are
  8815. * taken until `predicate` returns falsey. The predicate is invoked with
  8816. * three arguments: (value, index, array).
  8817. *
  8818. * @static
  8819. * @memberOf _
  8820. * @since 3.0.0
  8821. * @category Array
  8822. * @param {Array} array The array to query.
  8823. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8824. * @returns {Array} Returns the slice of `array`.
  8825. * @example
  8826. *
  8827. * var users = [
  8828. * { 'user': 'barney', 'active': true },
  8829. * { 'user': 'fred', 'active': false },
  8830. * { 'user': 'pebbles', 'active': false }
  8831. * ];
  8832. *
  8833. * _.takeRightWhile(users, function(o) { return !o.active; });
  8834. * // => objects for ['fred', 'pebbles']
  8835. *
  8836. * // The `_.matches` iteratee shorthand.
  8837. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8838. * // => objects for ['pebbles']
  8839. *
  8840. * // The `_.matchesProperty` iteratee shorthand.
  8841. * _.takeRightWhile(users, ['active', false]);
  8842. * // => objects for ['fred', 'pebbles']
  8843. *
  8844. * // The `_.property` iteratee shorthand.
  8845. * _.takeRightWhile(users, 'active');
  8846. * // => []
  8847. */
  8848. function takeRightWhile(array, predicate) {
  8849. return (array && array.length)
  8850. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8851. : [];
  8852. }
  8853. /**
  8854. * Creates a slice of `array` with elements taken from the beginning. Elements
  8855. * are taken until `predicate` returns falsey. The predicate is invoked with
  8856. * three arguments: (value, index, array).
  8857. *
  8858. * @static
  8859. * @memberOf _
  8860. * @since 3.0.0
  8861. * @category Array
  8862. * @param {Array} array The array to query.
  8863. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8864. * @returns {Array} Returns the slice of `array`.
  8865. * @example
  8866. *
  8867. * var users = [
  8868. * { 'user': 'barney', 'active': false },
  8869. * { 'user': 'fred', 'active': false },
  8870. * { 'user': 'pebbles', 'active': true }
  8871. * ];
  8872. *
  8873. * _.takeWhile(users, function(o) { return !o.active; });
  8874. * // => objects for ['barney', 'fred']
  8875. *
  8876. * // The `_.matches` iteratee shorthand.
  8877. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8878. * // => objects for ['barney']
  8879. *
  8880. * // The `_.matchesProperty` iteratee shorthand.
  8881. * _.takeWhile(users, ['active', false]);
  8882. * // => objects for ['barney', 'fred']
  8883. *
  8884. * // The `_.property` iteratee shorthand.
  8885. * _.takeWhile(users, 'active');
  8886. * // => []
  8887. */
  8888. function takeWhile(array, predicate) {
  8889. return (array && array.length)
  8890. ? baseWhile(array, getIteratee(predicate, 3))
  8891. : [];
  8892. }
  8893. /**
  8894. * Creates an array of unique values, in order, from all given arrays using
  8895. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8896. * for equality comparisons.
  8897. *
  8898. * @static
  8899. * @memberOf _
  8900. * @since 0.1.0
  8901. * @category Array
  8902. * @param {...Array} [arrays] The arrays to inspect.
  8903. * @returns {Array} Returns the new array of combined values.
  8904. * @example
  8905. *
  8906. * _.union([2], [1, 2]);
  8907. * // => [2, 1]
  8908. */
  8909. var union = baseRest(function(arrays) {
  8910. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8911. });
  8912. /**
  8913. * This method is like `_.union` except that it accepts `iteratee` which is
  8914. * invoked for each element of each `arrays` to generate the criterion by
  8915. * which uniqueness is computed. Result values are chosen from the first
  8916. * array in which the value occurs. The iteratee is invoked with one argument:
  8917. * (value).
  8918. *
  8919. * @static
  8920. * @memberOf _
  8921. * @since 4.0.0
  8922. * @category Array
  8923. * @param {...Array} [arrays] The arrays to inspect.
  8924. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8925. * @returns {Array} Returns the new array of combined values.
  8926. * @example
  8927. *
  8928. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8929. * // => [2.1, 1.2]
  8930. *
  8931. * // The `_.property` iteratee shorthand.
  8932. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8933. * // => [{ 'x': 1 }, { 'x': 2 }]
  8934. */
  8935. var unionBy = baseRest(function(arrays) {
  8936. var iteratee = last(arrays);
  8937. if (isArrayLikeObject(iteratee)) {
  8938. iteratee = undefined;
  8939. }
  8940. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8941. });
  8942. /**
  8943. * This method is like `_.union` except that it accepts `comparator` which
  8944. * is invoked to compare elements of `arrays`. Result values are chosen from
  8945. * the first array in which the value occurs. The comparator is invoked
  8946. * with two arguments: (arrVal, othVal).
  8947. *
  8948. * @static
  8949. * @memberOf _
  8950. * @since 4.0.0
  8951. * @category Array
  8952. * @param {...Array} [arrays] The arrays to inspect.
  8953. * @param {Function} [comparator] The comparator invoked per element.
  8954. * @returns {Array} Returns the new array of combined values.
  8955. * @example
  8956. *
  8957. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8958. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8959. *
  8960. * _.unionWith(objects, others, _.isEqual);
  8961. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8962. */
  8963. var unionWith = baseRest(function(arrays) {
  8964. var comparator = last(arrays);
  8965. comparator = typeof comparator == 'function' ? comparator : undefined;
  8966. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8967. });
  8968. /**
  8969. * Creates a duplicate-free version of an array, using
  8970. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8971. * for equality comparisons, in which only the first occurrence of each element
  8972. * is kept. The order of result values is determined by the order they occur
  8973. * in the array.
  8974. *
  8975. * @static
  8976. * @memberOf _
  8977. * @since 0.1.0
  8978. * @category Array
  8979. * @param {Array} array The array to inspect.
  8980. * @returns {Array} Returns the new duplicate free array.
  8981. * @example
  8982. *
  8983. * _.uniq([2, 1, 2]);
  8984. * // => [2, 1]
  8985. */
  8986. function uniq(array) {
  8987. return (array && array.length) ? baseUniq(array) : [];
  8988. }
  8989. /**
  8990. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8991. * invoked for each element in `array` to generate the criterion by which
  8992. * uniqueness is computed. The order of result values is determined by the
  8993. * order they occur in the array. The iteratee is invoked with one argument:
  8994. * (value).
  8995. *
  8996. * @static
  8997. * @memberOf _
  8998. * @since 4.0.0
  8999. * @category Array
  9000. * @param {Array} array The array to inspect.
  9001. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9002. * @returns {Array} Returns the new duplicate free array.
  9003. * @example
  9004. *
  9005. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9006. * // => [2.1, 1.2]
  9007. *
  9008. * // The `_.property` iteratee shorthand.
  9009. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9010. * // => [{ 'x': 1 }, { 'x': 2 }]
  9011. */
  9012. function uniqBy(array, iteratee) {
  9013. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9014. }
  9015. /**
  9016. * This method is like `_.uniq` except that it accepts `comparator` which
  9017. * is invoked to compare elements of `array`. The order of result values is
  9018. * determined by the order they occur in the array.The comparator is invoked
  9019. * with two arguments: (arrVal, othVal).
  9020. *
  9021. * @static
  9022. * @memberOf _
  9023. * @since 4.0.0
  9024. * @category Array
  9025. * @param {Array} array The array to inspect.
  9026. * @param {Function} [comparator] The comparator invoked per element.
  9027. * @returns {Array} Returns the new duplicate free array.
  9028. * @example
  9029. *
  9030. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9031. *
  9032. * _.uniqWith(objects, _.isEqual);
  9033. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9034. */
  9035. function uniqWith(array, comparator) {
  9036. comparator = typeof comparator == 'function' ? comparator : undefined;
  9037. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9038. }
  9039. /**
  9040. * This method is like `_.zip` except that it accepts an array of grouped
  9041. * elements and creates an array regrouping the elements to their pre-zip
  9042. * configuration.
  9043. *
  9044. * @static
  9045. * @memberOf _
  9046. * @since 1.2.0
  9047. * @category Array
  9048. * @param {Array} array The array of grouped elements to process.
  9049. * @returns {Array} Returns the new array of regrouped elements.
  9050. * @example
  9051. *
  9052. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9053. * // => [['a', 1, true], ['b', 2, false]]
  9054. *
  9055. * _.unzip(zipped);
  9056. * // => [['a', 'b'], [1, 2], [true, false]]
  9057. */
  9058. function unzip(array) {
  9059. if (!(array && array.length)) {
  9060. return [];
  9061. }
  9062. var length = 0;
  9063. array = arrayFilter(array, function(group) {
  9064. if (isArrayLikeObject(group)) {
  9065. length = nativeMax(group.length, length);
  9066. return true;
  9067. }
  9068. });
  9069. return baseTimes(length, function(index) {
  9070. return arrayMap(array, baseProperty(index));
  9071. });
  9072. }
  9073. /**
  9074. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9075. * how regrouped values should be combined. The iteratee is invoked with the
  9076. * elements of each group: (...group).
  9077. *
  9078. * @static
  9079. * @memberOf _
  9080. * @since 3.8.0
  9081. * @category Array
  9082. * @param {Array} array The array of grouped elements to process.
  9083. * @param {Function} [iteratee=_.identity] The function to combine
  9084. * regrouped values.
  9085. * @returns {Array} Returns the new array of regrouped elements.
  9086. * @example
  9087. *
  9088. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9089. * // => [[1, 10, 100], [2, 20, 200]]
  9090. *
  9091. * _.unzipWith(zipped, _.add);
  9092. * // => [3, 30, 300]
  9093. */
  9094. function unzipWith(array, iteratee) {
  9095. if (!(array && array.length)) {
  9096. return [];
  9097. }
  9098. var result = unzip(array);
  9099. if (iteratee == null) {
  9100. return result;
  9101. }
  9102. return arrayMap(result, function(group) {
  9103. return apply(iteratee, undefined, group);
  9104. });
  9105. }
  9106. /**
  9107. * Creates an array excluding all given values using
  9108. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9109. * for equality comparisons.
  9110. *
  9111. * **Note:** Unlike `_.pull`, this method returns a new array.
  9112. *
  9113. * @static
  9114. * @memberOf _
  9115. * @since 0.1.0
  9116. * @category Array
  9117. * @param {Array} array The array to inspect.
  9118. * @param {...*} [values] The values to exclude.
  9119. * @returns {Array} Returns the new array of filtered values.
  9120. * @see _.difference, _.xor
  9121. * @example
  9122. *
  9123. * _.without([2, 1, 2, 3], 1, 2);
  9124. * // => [3]
  9125. */
  9126. var without = baseRest(function(array, values) {
  9127. return isArrayLikeObject(array)
  9128. ? baseDifference(array, values)
  9129. : [];
  9130. });
  9131. /**
  9132. * Creates an array of unique values that is the
  9133. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9134. * of the given arrays. The order of result values is determined by the order
  9135. * they occur in the arrays.
  9136. *
  9137. * @static
  9138. * @memberOf _
  9139. * @since 2.4.0
  9140. * @category Array
  9141. * @param {...Array} [arrays] The arrays to inspect.
  9142. * @returns {Array} Returns the new array of filtered values.
  9143. * @see _.difference, _.without
  9144. * @example
  9145. *
  9146. * _.xor([2, 1], [2, 3]);
  9147. * // => [1, 3]
  9148. */
  9149. var xor = baseRest(function(arrays) {
  9150. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9151. });
  9152. /**
  9153. * This method is like `_.xor` except that it accepts `iteratee` which is
  9154. * invoked for each element of each `arrays` to generate the criterion by
  9155. * which by which they're compared. The order of result values is determined
  9156. * by the order they occur in the arrays. The iteratee is invoked with one
  9157. * argument: (value).
  9158. *
  9159. * @static
  9160. * @memberOf _
  9161. * @since 4.0.0
  9162. * @category Array
  9163. * @param {...Array} [arrays] The arrays to inspect.
  9164. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9165. * @returns {Array} Returns the new array of filtered values.
  9166. * @example
  9167. *
  9168. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9169. * // => [1.2, 3.4]
  9170. *
  9171. * // The `_.property` iteratee shorthand.
  9172. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9173. * // => [{ 'x': 2 }]
  9174. */
  9175. var xorBy = baseRest(function(arrays) {
  9176. var iteratee = last(arrays);
  9177. if (isArrayLikeObject(iteratee)) {
  9178. iteratee = undefined;
  9179. }
  9180. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9181. });
  9182. /**
  9183. * This method is like `_.xor` except that it accepts `comparator` which is
  9184. * invoked to compare elements of `arrays`. The order of result values is
  9185. * determined by the order they occur in the arrays. The comparator is invoked
  9186. * with two arguments: (arrVal, othVal).
  9187. *
  9188. * @static
  9189. * @memberOf _
  9190. * @since 4.0.0
  9191. * @category Array
  9192. * @param {...Array} [arrays] The arrays to inspect.
  9193. * @param {Function} [comparator] The comparator invoked per element.
  9194. * @returns {Array} Returns the new array of filtered values.
  9195. * @example
  9196. *
  9197. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9198. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9199. *
  9200. * _.xorWith(objects, others, _.isEqual);
  9201. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9202. */
  9203. var xorWith = baseRest(function(arrays) {
  9204. var comparator = last(arrays);
  9205. comparator = typeof comparator == 'function' ? comparator : undefined;
  9206. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9207. });
  9208. /**
  9209. * Creates an array of grouped elements, the first of which contains the
  9210. * first elements of the given arrays, the second of which contains the
  9211. * second elements of the given arrays, and so on.
  9212. *
  9213. * @static
  9214. * @memberOf _
  9215. * @since 0.1.0
  9216. * @category Array
  9217. * @param {...Array} [arrays] The arrays to process.
  9218. * @returns {Array} Returns the new array of grouped elements.
  9219. * @example
  9220. *
  9221. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9222. * // => [['a', 1, true], ['b', 2, false]]
  9223. */
  9224. var zip = baseRest(unzip);
  9225. /**
  9226. * This method is like `_.fromPairs` except that it accepts two arrays,
  9227. * one of property identifiers and one of corresponding values.
  9228. *
  9229. * @static
  9230. * @memberOf _
  9231. * @since 0.4.0
  9232. * @category Array
  9233. * @param {Array} [props=[]] The property identifiers.
  9234. * @param {Array} [values=[]] The property values.
  9235. * @returns {Object} Returns the new object.
  9236. * @example
  9237. *
  9238. * _.zipObject(['a', 'b'], [1, 2]);
  9239. * // => { 'a': 1, 'b': 2 }
  9240. */
  9241. function zipObject(props, values) {
  9242. return baseZipObject(props || [], values || [], assignValue);
  9243. }
  9244. /**
  9245. * This method is like `_.zipObject` except that it supports property paths.
  9246. *
  9247. * @static
  9248. * @memberOf _
  9249. * @since 4.1.0
  9250. * @category Array
  9251. * @param {Array} [props=[]] The property identifiers.
  9252. * @param {Array} [values=[]] The property values.
  9253. * @returns {Object} Returns the new object.
  9254. * @example
  9255. *
  9256. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9257. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9258. */
  9259. function zipObjectDeep(props, values) {
  9260. return baseZipObject(props || [], values || [], baseSet);
  9261. }
  9262. /**
  9263. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9264. * how grouped values should be combined. The iteratee is invoked with the
  9265. * elements of each group: (...group).
  9266. *
  9267. * @static
  9268. * @memberOf _
  9269. * @since 3.8.0
  9270. * @category Array
  9271. * @param {...Array} [arrays] The arrays to process.
  9272. * @param {Function} [iteratee=_.identity] The function to combine
  9273. * grouped values.
  9274. * @returns {Array} Returns the new array of grouped elements.
  9275. * @example
  9276. *
  9277. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9278. * return a + b + c;
  9279. * });
  9280. * // => [111, 222]
  9281. */
  9282. var zipWith = baseRest(function(arrays) {
  9283. var length = arrays.length,
  9284. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9285. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9286. return unzipWith(arrays, iteratee);
  9287. });
  9288. /*------------------------------------------------------------------------*/
  9289. /**
  9290. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9291. * chain sequences enabled. The result of such sequences must be unwrapped
  9292. * with `_#value`.
  9293. *
  9294. * @static
  9295. * @memberOf _
  9296. * @since 1.3.0
  9297. * @category Seq
  9298. * @param {*} value The value to wrap.
  9299. * @returns {Object} Returns the new `lodash` wrapper instance.
  9300. * @example
  9301. *
  9302. * var users = [
  9303. * { 'user': 'barney', 'age': 36 },
  9304. * { 'user': 'fred', 'age': 40 },
  9305. * { 'user': 'pebbles', 'age': 1 }
  9306. * ];
  9307. *
  9308. * var youngest = _
  9309. * .chain(users)
  9310. * .sortBy('age')
  9311. * .map(function(o) {
  9312. * return o.user + ' is ' + o.age;
  9313. * })
  9314. * .head()
  9315. * .value();
  9316. * // => 'pebbles is 1'
  9317. */
  9318. function chain(value) {
  9319. var result = lodash(value);
  9320. result.__chain__ = true;
  9321. return result;
  9322. }
  9323. /**
  9324. * This method invokes `interceptor` and returns `value`. The interceptor
  9325. * is invoked with one argument; (value). The purpose of this method is to
  9326. * "tap into" a method chain sequence in order to modify intermediate results.
  9327. *
  9328. * @static
  9329. * @memberOf _
  9330. * @since 0.1.0
  9331. * @category Seq
  9332. * @param {*} value The value to provide to `interceptor`.
  9333. * @param {Function} interceptor The function to invoke.
  9334. * @returns {*} Returns `value`.
  9335. * @example
  9336. *
  9337. * _([1, 2, 3])
  9338. * .tap(function(array) {
  9339. * // Mutate input array.
  9340. * array.pop();
  9341. * })
  9342. * .reverse()
  9343. * .value();
  9344. * // => [2, 1]
  9345. */
  9346. function tap(value, interceptor) {
  9347. interceptor(value);
  9348. return value;
  9349. }
  9350. /**
  9351. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9352. * The purpose of this method is to "pass thru" values replacing intermediate
  9353. * results in a method chain sequence.
  9354. *
  9355. * @static
  9356. * @memberOf _
  9357. * @since 3.0.0
  9358. * @category Seq
  9359. * @param {*} value The value to provide to `interceptor`.
  9360. * @param {Function} interceptor The function to invoke.
  9361. * @returns {*} Returns the result of `interceptor`.
  9362. * @example
  9363. *
  9364. * _(' abc ')
  9365. * .chain()
  9366. * .trim()
  9367. * .thru(function(value) {
  9368. * return [value];
  9369. * })
  9370. * .value();
  9371. * // => ['abc']
  9372. */
  9373. function thru(value, interceptor) {
  9374. return interceptor(value);
  9375. }
  9376. /**
  9377. * This method is the wrapper version of `_.at`.
  9378. *
  9379. * @name at
  9380. * @memberOf _
  9381. * @since 1.0.0
  9382. * @category Seq
  9383. * @param {...(string|string[])} [paths] The property paths to pick.
  9384. * @returns {Object} Returns the new `lodash` wrapper instance.
  9385. * @example
  9386. *
  9387. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9388. *
  9389. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9390. * // => [3, 4]
  9391. */
  9392. var wrapperAt = flatRest(function(paths) {
  9393. var length = paths.length,
  9394. start = length ? paths[0] : 0,
  9395. value = this.__wrapped__,
  9396. interceptor = function(object) { return baseAt(object, paths); };
  9397. if (length > 1 || this.__actions__.length ||
  9398. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9399. return this.thru(interceptor);
  9400. }
  9401. value = value.slice(start, +start + (length ? 1 : 0));
  9402. value.__actions__.push({
  9403. 'func': thru,
  9404. 'args': [interceptor],
  9405. 'thisArg': undefined
  9406. });
  9407. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9408. if (length && !array.length) {
  9409. array.push(undefined);
  9410. }
  9411. return array;
  9412. });
  9413. });
  9414. /**
  9415. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9416. *
  9417. * @name chain
  9418. * @memberOf _
  9419. * @since 0.1.0
  9420. * @category Seq
  9421. * @returns {Object} Returns the new `lodash` wrapper instance.
  9422. * @example
  9423. *
  9424. * var users = [
  9425. * { 'user': 'barney', 'age': 36 },
  9426. * { 'user': 'fred', 'age': 40 }
  9427. * ];
  9428. *
  9429. * // A sequence without explicit chaining.
  9430. * _(users).head();
  9431. * // => { 'user': 'barney', 'age': 36 }
  9432. *
  9433. * // A sequence with explicit chaining.
  9434. * _(users)
  9435. * .chain()
  9436. * .head()
  9437. * .pick('user')
  9438. * .value();
  9439. * // => { 'user': 'barney' }
  9440. */
  9441. function wrapperChain() {
  9442. return chain(this);
  9443. }
  9444. /**
  9445. * Executes the chain sequence and returns the wrapped result.
  9446. *
  9447. * @name commit
  9448. * @memberOf _
  9449. * @since 3.2.0
  9450. * @category Seq
  9451. * @returns {Object} Returns the new `lodash` wrapper instance.
  9452. * @example
  9453. *
  9454. * var array = [1, 2];
  9455. * var wrapped = _(array).push(3);
  9456. *
  9457. * console.log(array);
  9458. * // => [1, 2]
  9459. *
  9460. * wrapped = wrapped.commit();
  9461. * console.log(array);
  9462. * // => [1, 2, 3]
  9463. *
  9464. * wrapped.last();
  9465. * // => 3
  9466. *
  9467. * console.log(array);
  9468. * // => [1, 2, 3]
  9469. */
  9470. function wrapperCommit() {
  9471. return new LodashWrapper(this.value(), this.__chain__);
  9472. }
  9473. /**
  9474. * Gets the next value on a wrapped object following the
  9475. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9476. *
  9477. * @name next
  9478. * @memberOf _
  9479. * @since 4.0.0
  9480. * @category Seq
  9481. * @returns {Object} Returns the next iterator value.
  9482. * @example
  9483. *
  9484. * var wrapped = _([1, 2]);
  9485. *
  9486. * wrapped.next();
  9487. * // => { 'done': false, 'value': 1 }
  9488. *
  9489. * wrapped.next();
  9490. * // => { 'done': false, 'value': 2 }
  9491. *
  9492. * wrapped.next();
  9493. * // => { 'done': true, 'value': undefined }
  9494. */
  9495. function wrapperNext() {
  9496. if (this.__values__ === undefined) {
  9497. this.__values__ = toArray(this.value());
  9498. }
  9499. var done = this.__index__ >= this.__values__.length,
  9500. value = done ? undefined : this.__values__[this.__index__++];
  9501. return { 'done': done, 'value': value };
  9502. }
  9503. /**
  9504. * Enables the wrapper to be iterable.
  9505. *
  9506. * @name Symbol.iterator
  9507. * @memberOf _
  9508. * @since 4.0.0
  9509. * @category Seq
  9510. * @returns {Object} Returns the wrapper object.
  9511. * @example
  9512. *
  9513. * var wrapped = _([1, 2]);
  9514. *
  9515. * wrapped[Symbol.iterator]() === wrapped;
  9516. * // => true
  9517. *
  9518. * Array.from(wrapped);
  9519. * // => [1, 2]
  9520. */
  9521. function wrapperToIterator() {
  9522. return this;
  9523. }
  9524. /**
  9525. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9526. *
  9527. * @name plant
  9528. * @memberOf _
  9529. * @since 3.2.0
  9530. * @category Seq
  9531. * @param {*} value The value to plant.
  9532. * @returns {Object} Returns the new `lodash` wrapper instance.
  9533. * @example
  9534. *
  9535. * function square(n) {
  9536. * return n * n;
  9537. * }
  9538. *
  9539. * var wrapped = _([1, 2]).map(square);
  9540. * var other = wrapped.plant([3, 4]);
  9541. *
  9542. * other.value();
  9543. * // => [9, 16]
  9544. *
  9545. * wrapped.value();
  9546. * // => [1, 4]
  9547. */
  9548. function wrapperPlant(value) {
  9549. var result,
  9550. parent = this;
  9551. while (parent instanceof baseLodash) {
  9552. var clone = wrapperClone(parent);
  9553. clone.__index__ = 0;
  9554. clone.__values__ = undefined;
  9555. if (result) {
  9556. previous.__wrapped__ = clone;
  9557. } else {
  9558. result = clone;
  9559. }
  9560. var previous = clone;
  9561. parent = parent.__wrapped__;
  9562. }
  9563. previous.__wrapped__ = value;
  9564. return result;
  9565. }
  9566. /**
  9567. * This method is the wrapper version of `_.reverse`.
  9568. *
  9569. * **Note:** This method mutates the wrapped array.
  9570. *
  9571. * @name reverse
  9572. * @memberOf _
  9573. * @since 0.1.0
  9574. * @category Seq
  9575. * @returns {Object} Returns the new `lodash` wrapper instance.
  9576. * @example
  9577. *
  9578. * var array = [1, 2, 3];
  9579. *
  9580. * _(array).reverse().value()
  9581. * // => [3, 2, 1]
  9582. *
  9583. * console.log(array);
  9584. * // => [3, 2, 1]
  9585. */
  9586. function wrapperReverse() {
  9587. var value = this.__wrapped__;
  9588. if (value instanceof LazyWrapper) {
  9589. var wrapped = value;
  9590. if (this.__actions__.length) {
  9591. wrapped = new LazyWrapper(this);
  9592. }
  9593. wrapped = wrapped.reverse();
  9594. wrapped.__actions__.push({
  9595. 'func': thru,
  9596. 'args': [reverse],
  9597. 'thisArg': undefined
  9598. });
  9599. return new LodashWrapper(wrapped, this.__chain__);
  9600. }
  9601. return this.thru(reverse);
  9602. }
  9603. /**
  9604. * Executes the chain sequence to resolve the unwrapped value.
  9605. *
  9606. * @name value
  9607. * @memberOf _
  9608. * @since 0.1.0
  9609. * @alias toJSON, valueOf
  9610. * @category Seq
  9611. * @returns {*} Returns the resolved unwrapped value.
  9612. * @example
  9613. *
  9614. * _([1, 2, 3]).value();
  9615. * // => [1, 2, 3]
  9616. */
  9617. function wrapperValue() {
  9618. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9619. }
  9620. /*------------------------------------------------------------------------*/
  9621. /**
  9622. * Creates an object composed of keys generated from the results of running
  9623. * each element of `collection` thru `iteratee`. The corresponding value of
  9624. * each key is the number of times the key was returned by `iteratee`. The
  9625. * iteratee is invoked with one argument: (value).
  9626. *
  9627. * @static
  9628. * @memberOf _
  9629. * @since 0.5.0
  9630. * @category Collection
  9631. * @param {Array|Object} collection The collection to iterate over.
  9632. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9633. * @returns {Object} Returns the composed aggregate object.
  9634. * @example
  9635. *
  9636. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9637. * // => { '4': 1, '6': 2 }
  9638. *
  9639. * // The `_.property` iteratee shorthand.
  9640. * _.countBy(['one', 'two', 'three'], 'length');
  9641. * // => { '3': 2, '5': 1 }
  9642. */
  9643. var countBy = createAggregator(function(result, value, key) {
  9644. if (hasOwnProperty.call(result, key)) {
  9645. ++result[key];
  9646. } else {
  9647. baseAssignValue(result, key, 1);
  9648. }
  9649. });
  9650. /**
  9651. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9652. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9653. * invoked with three arguments: (value, index|key, collection).
  9654. *
  9655. * **Note:** This method returns `true` for
  9656. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9657. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9658. * elements of empty collections.
  9659. *
  9660. * @static
  9661. * @memberOf _
  9662. * @since 0.1.0
  9663. * @category Collection
  9664. * @param {Array|Object} collection The collection to iterate over.
  9665. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9666. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9667. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9668. * else `false`.
  9669. * @example
  9670. *
  9671. * _.every([true, 1, null, 'yes'], Boolean);
  9672. * // => false
  9673. *
  9674. * var users = [
  9675. * { 'user': 'barney', 'age': 36, 'active': false },
  9676. * { 'user': 'fred', 'age': 40, 'active': false }
  9677. * ];
  9678. *
  9679. * // The `_.matches` iteratee shorthand.
  9680. * _.every(users, { 'user': 'barney', 'active': false });
  9681. * // => false
  9682. *
  9683. * // The `_.matchesProperty` iteratee shorthand.
  9684. * _.every(users, ['active', false]);
  9685. * // => true
  9686. *
  9687. * // The `_.property` iteratee shorthand.
  9688. * _.every(users, 'active');
  9689. * // => false
  9690. */
  9691. function every(collection, predicate, guard) {
  9692. var func = isArray(collection) ? arrayEvery : baseEvery;
  9693. if (guard && isIterateeCall(collection, predicate, guard)) {
  9694. predicate = undefined;
  9695. }
  9696. return func(collection, getIteratee(predicate, 3));
  9697. }
  9698. /**
  9699. * Iterates over elements of `collection`, returning an array of all elements
  9700. * `predicate` returns truthy for. The predicate is invoked with three
  9701. * arguments: (value, index|key, collection).
  9702. *
  9703. * **Note:** Unlike `_.remove`, this method returns a new array.
  9704. *
  9705. * @static
  9706. * @memberOf _
  9707. * @since 0.1.0
  9708. * @category Collection
  9709. * @param {Array|Object} collection The collection to iterate over.
  9710. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9711. * @returns {Array} Returns the new filtered array.
  9712. * @see _.reject
  9713. * @example
  9714. *
  9715. * var users = [
  9716. * { 'user': 'barney', 'age': 36, 'active': true },
  9717. * { 'user': 'fred', 'age': 40, 'active': false }
  9718. * ];
  9719. *
  9720. * _.filter(users, function(o) { return !o.active; });
  9721. * // => objects for ['fred']
  9722. *
  9723. * // The `_.matches` iteratee shorthand.
  9724. * _.filter(users, { 'age': 36, 'active': true });
  9725. * // => objects for ['barney']
  9726. *
  9727. * // The `_.matchesProperty` iteratee shorthand.
  9728. * _.filter(users, ['active', false]);
  9729. * // => objects for ['fred']
  9730. *
  9731. * // The `_.property` iteratee shorthand.
  9732. * _.filter(users, 'active');
  9733. * // => objects for ['barney']
  9734. *
  9735. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9736. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9737. * // => objects for ['fred', 'barney']
  9738. */
  9739. function filter(collection, predicate) {
  9740. var func = isArray(collection) ? arrayFilter : baseFilter;
  9741. return func(collection, getIteratee(predicate, 3));
  9742. }
  9743. /**
  9744. * Iterates over elements of `collection`, returning the first element
  9745. * `predicate` returns truthy for. The predicate is invoked with three
  9746. * arguments: (value, index|key, collection).
  9747. *
  9748. * @static
  9749. * @memberOf _
  9750. * @since 0.1.0
  9751. * @category Collection
  9752. * @param {Array|Object} collection The collection to inspect.
  9753. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9754. * @param {number} [fromIndex=0] The index to search from.
  9755. * @returns {*} Returns the matched element, else `undefined`.
  9756. * @example
  9757. *
  9758. * var users = [
  9759. * { 'user': 'barney', 'age': 36, 'active': true },
  9760. * { 'user': 'fred', 'age': 40, 'active': false },
  9761. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9762. * ];
  9763. *
  9764. * _.find(users, function(o) { return o.age < 40; });
  9765. * // => object for 'barney'
  9766. *
  9767. * // The `_.matches` iteratee shorthand.
  9768. * _.find(users, { 'age': 1, 'active': true });
  9769. * // => object for 'pebbles'
  9770. *
  9771. * // The `_.matchesProperty` iteratee shorthand.
  9772. * _.find(users, ['active', false]);
  9773. * // => object for 'fred'
  9774. *
  9775. * // The `_.property` iteratee shorthand.
  9776. * _.find(users, 'active');
  9777. * // => object for 'barney'
  9778. */
  9779. var find = createFind(findIndex);
  9780. /**
  9781. * This method is like `_.find` except that it iterates over elements of
  9782. * `collection` from right to left.
  9783. *
  9784. * @static
  9785. * @memberOf _
  9786. * @since 2.0.0
  9787. * @category Collection
  9788. * @param {Array|Object} collection The collection to inspect.
  9789. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9790. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9791. * @returns {*} Returns the matched element, else `undefined`.
  9792. * @example
  9793. *
  9794. * _.findLast([1, 2, 3, 4], function(n) {
  9795. * return n % 2 == 1;
  9796. * });
  9797. * // => 3
  9798. */
  9799. var findLast = createFind(findLastIndex);
  9800. /**
  9801. * Creates a flattened array of values by running each element in `collection`
  9802. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9803. * with three arguments: (value, index|key, collection).
  9804. *
  9805. * @static
  9806. * @memberOf _
  9807. * @since 4.0.0
  9808. * @category Collection
  9809. * @param {Array|Object} collection The collection to iterate over.
  9810. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9811. * @returns {Array} Returns the new flattened array.
  9812. * @example
  9813. *
  9814. * function duplicate(n) {
  9815. * return [n, n];
  9816. * }
  9817. *
  9818. * _.flatMap([1, 2], duplicate);
  9819. * // => [1, 1, 2, 2]
  9820. */
  9821. function flatMap(collection, iteratee) {
  9822. return baseFlatten(map(collection, iteratee), 1);
  9823. }
  9824. /**
  9825. * This method is like `_.flatMap` except that it recursively flattens the
  9826. * mapped results.
  9827. *
  9828. * @static
  9829. * @memberOf _
  9830. * @since 4.7.0
  9831. * @category Collection
  9832. * @param {Array|Object} collection The collection to iterate over.
  9833. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9834. * @returns {Array} Returns the new flattened array.
  9835. * @example
  9836. *
  9837. * function duplicate(n) {
  9838. * return [[[n, n]]];
  9839. * }
  9840. *
  9841. * _.flatMapDeep([1, 2], duplicate);
  9842. * // => [1, 1, 2, 2]
  9843. */
  9844. function flatMapDeep(collection, iteratee) {
  9845. return baseFlatten(map(collection, iteratee), INFINITY);
  9846. }
  9847. /**
  9848. * This method is like `_.flatMap` except that it recursively flattens the
  9849. * mapped results up to `depth` times.
  9850. *
  9851. * @static
  9852. * @memberOf _
  9853. * @since 4.7.0
  9854. * @category Collection
  9855. * @param {Array|Object} collection The collection to iterate over.
  9856. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9857. * @param {number} [depth=1] The maximum recursion depth.
  9858. * @returns {Array} Returns the new flattened array.
  9859. * @example
  9860. *
  9861. * function duplicate(n) {
  9862. * return [[[n, n]]];
  9863. * }
  9864. *
  9865. * _.flatMapDepth([1, 2], duplicate, 2);
  9866. * // => [[1, 1], [2, 2]]
  9867. */
  9868. function flatMapDepth(collection, iteratee, depth) {
  9869. depth = depth === undefined ? 1 : toInteger(depth);
  9870. return baseFlatten(map(collection, iteratee), depth);
  9871. }
  9872. /**
  9873. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9874. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9875. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9876. *
  9877. * **Note:** As with other "Collections" methods, objects with a "length"
  9878. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9879. * or `_.forOwn` for object iteration.
  9880. *
  9881. * @static
  9882. * @memberOf _
  9883. * @since 0.1.0
  9884. * @alias each
  9885. * @category Collection
  9886. * @param {Array|Object} collection The collection to iterate over.
  9887. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9888. * @returns {Array|Object} Returns `collection`.
  9889. * @see _.forEachRight
  9890. * @example
  9891. *
  9892. * _.forEach([1, 2], function(value) {
  9893. * console.log(value);
  9894. * });
  9895. * // => Logs `1` then `2`.
  9896. *
  9897. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9898. * console.log(key);
  9899. * });
  9900. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9901. */
  9902. function forEach(collection, iteratee) {
  9903. var func = isArray(collection) ? arrayEach : baseEach;
  9904. return func(collection, getIteratee(iteratee, 3));
  9905. }
  9906. /**
  9907. * This method is like `_.forEach` except that it iterates over elements of
  9908. * `collection` from right to left.
  9909. *
  9910. * @static
  9911. * @memberOf _
  9912. * @since 2.0.0
  9913. * @alias eachRight
  9914. * @category Collection
  9915. * @param {Array|Object} collection The collection to iterate over.
  9916. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9917. * @returns {Array|Object} Returns `collection`.
  9918. * @see _.forEach
  9919. * @example
  9920. *
  9921. * _.forEachRight([1, 2], function(value) {
  9922. * console.log(value);
  9923. * });
  9924. * // => Logs `2` then `1`.
  9925. */
  9926. function forEachRight(collection, iteratee) {
  9927. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9928. return func(collection, getIteratee(iteratee, 3));
  9929. }
  9930. /**
  9931. * Creates an object composed of keys generated from the results of running
  9932. * each element of `collection` thru `iteratee`. The order of grouped values
  9933. * is determined by the order they occur in `collection`. The corresponding
  9934. * value of each key is an array of elements responsible for generating the
  9935. * key. The iteratee is invoked with one argument: (value).
  9936. *
  9937. * @static
  9938. * @memberOf _
  9939. * @since 0.1.0
  9940. * @category Collection
  9941. * @param {Array|Object} collection The collection to iterate over.
  9942. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9943. * @returns {Object} Returns the composed aggregate object.
  9944. * @example
  9945. *
  9946. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9947. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9948. *
  9949. * // The `_.property` iteratee shorthand.
  9950. * _.groupBy(['one', 'two', 'three'], 'length');
  9951. * // => { '3': ['one', 'two'], '5': ['three'] }
  9952. */
  9953. var groupBy = createAggregator(function(result, value, key) {
  9954. if (hasOwnProperty.call(result, key)) {
  9955. result[key].push(value);
  9956. } else {
  9957. baseAssignValue(result, key, [value]);
  9958. }
  9959. });
  9960. /**
  9961. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9962. * checked for a substring of `value`, otherwise
  9963. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9964. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9965. * the offset from the end of `collection`.
  9966. *
  9967. * @static
  9968. * @memberOf _
  9969. * @since 0.1.0
  9970. * @category Collection
  9971. * @param {Array|Object|string} collection The collection to inspect.
  9972. * @param {*} value The value to search for.
  9973. * @param {number} [fromIndex=0] The index to search from.
  9974. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9975. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9976. * @example
  9977. *
  9978. * _.includes([1, 2, 3], 1);
  9979. * // => true
  9980. *
  9981. * _.includes([1, 2, 3], 1, 2);
  9982. * // => false
  9983. *
  9984. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9985. * // => true
  9986. *
  9987. * _.includes('abcd', 'bc');
  9988. * // => true
  9989. */
  9990. function includes(collection, value, fromIndex, guard) {
  9991. collection = isArrayLike(collection) ? collection : values(collection);
  9992. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9993. var length = collection.length;
  9994. if (fromIndex < 0) {
  9995. fromIndex = nativeMax(length + fromIndex, 0);
  9996. }
  9997. return isString(collection)
  9998. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9999. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10000. }
  10001. /**
  10002. * Invokes the method at `path` of each element in `collection`, returning
  10003. * an array of the results of each invoked method. Any additional arguments
  10004. * are provided to each invoked method. If `path` is a function, it's invoked
  10005. * for, and `this` bound to, each element in `collection`.
  10006. *
  10007. * @static
  10008. * @memberOf _
  10009. * @since 4.0.0
  10010. * @category Collection
  10011. * @param {Array|Object} collection The collection to iterate over.
  10012. * @param {Array|Function|string} path The path of the method to invoke or
  10013. * the function invoked per iteration.
  10014. * @param {...*} [args] The arguments to invoke each method with.
  10015. * @returns {Array} Returns the array of results.
  10016. * @example
  10017. *
  10018. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10019. * // => [[1, 5, 7], [1, 2, 3]]
  10020. *
  10021. * _.invokeMap([123, 456], String.prototype.split, '');
  10022. * // => [['1', '2', '3'], ['4', '5', '6']]
  10023. */
  10024. var invokeMap = baseRest(function(collection, path, args) {
  10025. var index = -1,
  10026. isFunc = typeof path == 'function',
  10027. result = isArrayLike(collection) ? Array(collection.length) : [];
  10028. baseEach(collection, function(value) {
  10029. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10030. });
  10031. return result;
  10032. });
  10033. /**
  10034. * Creates an object composed of keys generated from the results of running
  10035. * each element of `collection` thru `iteratee`. The corresponding value of
  10036. * each key is the last element responsible for generating the key. The
  10037. * iteratee is invoked with one argument: (value).
  10038. *
  10039. * @static
  10040. * @memberOf _
  10041. * @since 4.0.0
  10042. * @category Collection
  10043. * @param {Array|Object} collection The collection to iterate over.
  10044. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10045. * @returns {Object} Returns the composed aggregate object.
  10046. * @example
  10047. *
  10048. * var array = [
  10049. * { 'dir': 'left', 'code': 97 },
  10050. * { 'dir': 'right', 'code': 100 }
  10051. * ];
  10052. *
  10053. * _.keyBy(array, function(o) {
  10054. * return String.fromCharCode(o.code);
  10055. * });
  10056. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10057. *
  10058. * _.keyBy(array, 'dir');
  10059. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10060. */
  10061. var keyBy = createAggregator(function(result, value, key) {
  10062. baseAssignValue(result, key, value);
  10063. });
  10064. /**
  10065. * Creates an array of values by running each element in `collection` thru
  10066. * `iteratee`. The iteratee is invoked with three arguments:
  10067. * (value, index|key, collection).
  10068. *
  10069. * Many lodash methods are guarded to work as iteratees for methods like
  10070. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10071. *
  10072. * The guarded methods are:
  10073. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10074. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10075. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10076. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10077. *
  10078. * @static
  10079. * @memberOf _
  10080. * @since 0.1.0
  10081. * @category Collection
  10082. * @param {Array|Object} collection The collection to iterate over.
  10083. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10084. * @returns {Array} Returns the new mapped array.
  10085. * @example
  10086. *
  10087. * function square(n) {
  10088. * return n * n;
  10089. * }
  10090. *
  10091. * _.map([4, 8], square);
  10092. * // => [16, 64]
  10093. *
  10094. * _.map({ 'a': 4, 'b': 8 }, square);
  10095. * // => [16, 64] (iteration order is not guaranteed)
  10096. *
  10097. * var users = [
  10098. * { 'user': 'barney' },
  10099. * { 'user': 'fred' }
  10100. * ];
  10101. *
  10102. * // The `_.property` iteratee shorthand.
  10103. * _.map(users, 'user');
  10104. * // => ['barney', 'fred']
  10105. */
  10106. function map(collection, iteratee) {
  10107. var func = isArray(collection) ? arrayMap : baseMap;
  10108. return func(collection, getIteratee(iteratee, 3));
  10109. }
  10110. /**
  10111. * This method is like `_.sortBy` except that it allows specifying the sort
  10112. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10113. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10114. * descending or "asc" for ascending sort order of corresponding values.
  10115. *
  10116. * @static
  10117. * @memberOf _
  10118. * @since 4.0.0
  10119. * @category Collection
  10120. * @param {Array|Object} collection The collection to iterate over.
  10121. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10122. * The iteratees to sort by.
  10123. * @param {string[]} [orders] The sort orders of `iteratees`.
  10124. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10125. * @returns {Array} Returns the new sorted array.
  10126. * @example
  10127. *
  10128. * var users = [
  10129. * { 'user': 'fred', 'age': 48 },
  10130. * { 'user': 'barney', 'age': 34 },
  10131. * { 'user': 'fred', 'age': 40 },
  10132. * { 'user': 'barney', 'age': 36 }
  10133. * ];
  10134. *
  10135. * // Sort by `user` in ascending order and by `age` in descending order.
  10136. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10137. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10138. */
  10139. function orderBy(collection, iteratees, orders, guard) {
  10140. if (collection == null) {
  10141. return [];
  10142. }
  10143. if (!isArray(iteratees)) {
  10144. iteratees = iteratees == null ? [] : [iteratees];
  10145. }
  10146. orders = guard ? undefined : orders;
  10147. if (!isArray(orders)) {
  10148. orders = orders == null ? [] : [orders];
  10149. }
  10150. return baseOrderBy(collection, iteratees, orders);
  10151. }
  10152. /**
  10153. * Creates an array of elements split into two groups, the first of which
  10154. * contains elements `predicate` returns truthy for, the second of which
  10155. * contains elements `predicate` returns falsey for. The predicate is
  10156. * invoked with one argument: (value).
  10157. *
  10158. * @static
  10159. * @memberOf _
  10160. * @since 3.0.0
  10161. * @category Collection
  10162. * @param {Array|Object} collection The collection to iterate over.
  10163. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10164. * @returns {Array} Returns the array of grouped elements.
  10165. * @example
  10166. *
  10167. * var users = [
  10168. * { 'user': 'barney', 'age': 36, 'active': false },
  10169. * { 'user': 'fred', 'age': 40, 'active': true },
  10170. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10171. * ];
  10172. *
  10173. * _.partition(users, function(o) { return o.active; });
  10174. * // => objects for [['fred'], ['barney', 'pebbles']]
  10175. *
  10176. * // The `_.matches` iteratee shorthand.
  10177. * _.partition(users, { 'age': 1, 'active': false });
  10178. * // => objects for [['pebbles'], ['barney', 'fred']]
  10179. *
  10180. * // The `_.matchesProperty` iteratee shorthand.
  10181. * _.partition(users, ['active', false]);
  10182. * // => objects for [['barney', 'pebbles'], ['fred']]
  10183. *
  10184. * // The `_.property` iteratee shorthand.
  10185. * _.partition(users, 'active');
  10186. * // => objects for [['fred'], ['barney', 'pebbles']]
  10187. */
  10188. var partition = createAggregator(function(result, value, key) {
  10189. result[key ? 0 : 1].push(value);
  10190. }, function() { return [[], []]; });
  10191. /**
  10192. * Reduces `collection` to a value which is the accumulated result of running
  10193. * each element in `collection` thru `iteratee`, where each successive
  10194. * invocation is supplied the return value of the previous. If `accumulator`
  10195. * is not given, the first element of `collection` is used as the initial
  10196. * value. The iteratee is invoked with four arguments:
  10197. * (accumulator, value, index|key, collection).
  10198. *
  10199. * Many lodash methods are guarded to work as iteratees for methods like
  10200. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10201. *
  10202. * The guarded methods are:
  10203. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10204. * and `sortBy`
  10205. *
  10206. * @static
  10207. * @memberOf _
  10208. * @since 0.1.0
  10209. * @category Collection
  10210. * @param {Array|Object} collection The collection to iterate over.
  10211. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10212. * @param {*} [accumulator] The initial value.
  10213. * @returns {*} Returns the accumulated value.
  10214. * @see _.reduceRight
  10215. * @example
  10216. *
  10217. * _.reduce([1, 2], function(sum, n) {
  10218. * return sum + n;
  10219. * }, 0);
  10220. * // => 3
  10221. *
  10222. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10223. * (result[value] || (result[value] = [])).push(key);
  10224. * return result;
  10225. * }, {});
  10226. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10227. */
  10228. function reduce(collection, iteratee, accumulator) {
  10229. var func = isArray(collection) ? arrayReduce : baseReduce,
  10230. initAccum = arguments.length < 3;
  10231. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10232. }
  10233. /**
  10234. * This method is like `_.reduce` except that it iterates over elements of
  10235. * `collection` from right to left.
  10236. *
  10237. * @static
  10238. * @memberOf _
  10239. * @since 0.1.0
  10240. * @category Collection
  10241. * @param {Array|Object} collection The collection to iterate over.
  10242. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10243. * @param {*} [accumulator] The initial value.
  10244. * @returns {*} Returns the accumulated value.
  10245. * @see _.reduce
  10246. * @example
  10247. *
  10248. * var array = [[0, 1], [2, 3], [4, 5]];
  10249. *
  10250. * _.reduceRight(array, function(flattened, other) {
  10251. * return flattened.concat(other);
  10252. * }, []);
  10253. * // => [4, 5, 2, 3, 0, 1]
  10254. */
  10255. function reduceRight(collection, iteratee, accumulator) {
  10256. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10257. initAccum = arguments.length < 3;
  10258. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10259. }
  10260. /**
  10261. * The opposite of `_.filter`; this method returns the elements of `collection`
  10262. * that `predicate` does **not** return truthy for.
  10263. *
  10264. * @static
  10265. * @memberOf _
  10266. * @since 0.1.0
  10267. * @category Collection
  10268. * @param {Array|Object} collection The collection to iterate over.
  10269. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10270. * @returns {Array} Returns the new filtered array.
  10271. * @see _.filter
  10272. * @example
  10273. *
  10274. * var users = [
  10275. * { 'user': 'barney', 'age': 36, 'active': false },
  10276. * { 'user': 'fred', 'age': 40, 'active': true }
  10277. * ];
  10278. *
  10279. * _.reject(users, function(o) { return !o.active; });
  10280. * // => objects for ['fred']
  10281. *
  10282. * // The `_.matches` iteratee shorthand.
  10283. * _.reject(users, { 'age': 40, 'active': true });
  10284. * // => objects for ['barney']
  10285. *
  10286. * // The `_.matchesProperty` iteratee shorthand.
  10287. * _.reject(users, ['active', false]);
  10288. * // => objects for ['fred']
  10289. *
  10290. * // The `_.property` iteratee shorthand.
  10291. * _.reject(users, 'active');
  10292. * // => objects for ['barney']
  10293. */
  10294. function reject(collection, predicate) {
  10295. var func = isArray(collection) ? arrayFilter : baseFilter;
  10296. return func(collection, negate(getIteratee(predicate, 3)));
  10297. }
  10298. /**
  10299. * Gets a random element from `collection`.
  10300. *
  10301. * @static
  10302. * @memberOf _
  10303. * @since 2.0.0
  10304. * @category Collection
  10305. * @param {Array|Object} collection The collection to sample.
  10306. * @returns {*} Returns the random element.
  10307. * @example
  10308. *
  10309. * _.sample([1, 2, 3, 4]);
  10310. * // => 2
  10311. */
  10312. function sample(collection) {
  10313. var func = isArray(collection) ? arraySample : baseSample;
  10314. return func(collection);
  10315. }
  10316. /**
  10317. * Gets `n` random elements at unique keys from `collection` up to the
  10318. * size of `collection`.
  10319. *
  10320. * @static
  10321. * @memberOf _
  10322. * @since 4.0.0
  10323. * @category Collection
  10324. * @param {Array|Object} collection The collection to sample.
  10325. * @param {number} [n=1] The number of elements to sample.
  10326. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10327. * @returns {Array} Returns the random elements.
  10328. * @example
  10329. *
  10330. * _.sampleSize([1, 2, 3], 2);
  10331. * // => [3, 1]
  10332. *
  10333. * _.sampleSize([1, 2, 3], 4);
  10334. * // => [2, 3, 1]
  10335. */
  10336. function sampleSize(collection, n, guard) {
  10337. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10338. n = 1;
  10339. } else {
  10340. n = toInteger(n);
  10341. }
  10342. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10343. return func(collection, n);
  10344. }
  10345. /**
  10346. * Creates an array of shuffled values, using a version of the
  10347. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10348. *
  10349. * @static
  10350. * @memberOf _
  10351. * @since 0.1.0
  10352. * @category Collection
  10353. * @param {Array|Object} collection The collection to shuffle.
  10354. * @returns {Array} Returns the new shuffled array.
  10355. * @example
  10356. *
  10357. * _.shuffle([1, 2, 3, 4]);
  10358. * // => [4, 1, 3, 2]
  10359. */
  10360. function shuffle(collection) {
  10361. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10362. return func(collection);
  10363. }
  10364. /**
  10365. * Gets the size of `collection` by returning its length for array-like
  10366. * values or the number of own enumerable string keyed properties for objects.
  10367. *
  10368. * @static
  10369. * @memberOf _
  10370. * @since 0.1.0
  10371. * @category Collection
  10372. * @param {Array|Object|string} collection The collection to inspect.
  10373. * @returns {number} Returns the collection size.
  10374. * @example
  10375. *
  10376. * _.size([1, 2, 3]);
  10377. * // => 3
  10378. *
  10379. * _.size({ 'a': 1, 'b': 2 });
  10380. * // => 2
  10381. *
  10382. * _.size('pebbles');
  10383. * // => 7
  10384. */
  10385. function size(collection) {
  10386. if (collection == null) {
  10387. return 0;
  10388. }
  10389. if (isArrayLike(collection)) {
  10390. return isString(collection) ? stringSize(collection) : collection.length;
  10391. }
  10392. var tag = getTag(collection);
  10393. if (tag == mapTag || tag == setTag) {
  10394. return collection.size;
  10395. }
  10396. return baseKeys(collection).length;
  10397. }
  10398. /**
  10399. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10400. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10401. * invoked with three arguments: (value, index|key, collection).
  10402. *
  10403. * @static
  10404. * @memberOf _
  10405. * @since 0.1.0
  10406. * @category Collection
  10407. * @param {Array|Object} collection The collection to iterate over.
  10408. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10409. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10410. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10411. * else `false`.
  10412. * @example
  10413. *
  10414. * _.some([null, 0, 'yes', false], Boolean);
  10415. * // => true
  10416. *
  10417. * var users = [
  10418. * { 'user': 'barney', 'active': true },
  10419. * { 'user': 'fred', 'active': false }
  10420. * ];
  10421. *
  10422. * // The `_.matches` iteratee shorthand.
  10423. * _.some(users, { 'user': 'barney', 'active': false });
  10424. * // => false
  10425. *
  10426. * // The `_.matchesProperty` iteratee shorthand.
  10427. * _.some(users, ['active', false]);
  10428. * // => true
  10429. *
  10430. * // The `_.property` iteratee shorthand.
  10431. * _.some(users, 'active');
  10432. * // => true
  10433. */
  10434. function some(collection, predicate, guard) {
  10435. var func = isArray(collection) ? arraySome : baseSome;
  10436. if (guard && isIterateeCall(collection, predicate, guard)) {
  10437. predicate = undefined;
  10438. }
  10439. return func(collection, getIteratee(predicate, 3));
  10440. }
  10441. /**
  10442. * Creates an array of elements, sorted in ascending order by the results of
  10443. * running each element in a collection thru each iteratee. This method
  10444. * performs a stable sort, that is, it preserves the original sort order of
  10445. * equal elements. The iteratees are invoked with one argument: (value).
  10446. *
  10447. * @static
  10448. * @memberOf _
  10449. * @since 0.1.0
  10450. * @category Collection
  10451. * @param {Array|Object} collection The collection to iterate over.
  10452. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10453. * The iteratees to sort by.
  10454. * @returns {Array} Returns the new sorted array.
  10455. * @example
  10456. *
  10457. * var users = [
  10458. * { 'user': 'fred', 'age': 48 },
  10459. * { 'user': 'barney', 'age': 36 },
  10460. * { 'user': 'fred', 'age': 30 },
  10461. * { 'user': 'barney', 'age': 34 }
  10462. * ];
  10463. *
  10464. * _.sortBy(users, [function(o) { return o.user; }]);
  10465. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10466. *
  10467. * _.sortBy(users, ['user', 'age']);
  10468. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10469. */
  10470. var sortBy = baseRest(function(collection, iteratees) {
  10471. if (collection == null) {
  10472. return [];
  10473. }
  10474. var length = iteratees.length;
  10475. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10476. iteratees = [];
  10477. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10478. iteratees = [iteratees[0]];
  10479. }
  10480. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10481. });
  10482. /*------------------------------------------------------------------------*/
  10483. /**
  10484. * Gets the timestamp of the number of milliseconds that have elapsed since
  10485. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10486. *
  10487. * @static
  10488. * @memberOf _
  10489. * @since 2.4.0
  10490. * @category Date
  10491. * @returns {number} Returns the timestamp.
  10492. * @example
  10493. *
  10494. * _.defer(function(stamp) {
  10495. * console.log(_.now() - stamp);
  10496. * }, _.now());
  10497. * // => Logs the number of milliseconds it took for the deferred invocation.
  10498. */
  10499. var now = ctxNow || function() {
  10500. return root.Date.now();
  10501. };
  10502. /*------------------------------------------------------------------------*/
  10503. /**
  10504. * The opposite of `_.before`; this method creates a function that invokes
  10505. * `func` once it's called `n` or more times.
  10506. *
  10507. * @static
  10508. * @memberOf _
  10509. * @since 0.1.0
  10510. * @category Function
  10511. * @param {number} n The number of calls before `func` is invoked.
  10512. * @param {Function} func The function to restrict.
  10513. * @returns {Function} Returns the new restricted function.
  10514. * @example
  10515. *
  10516. * var saves = ['profile', 'settings'];
  10517. *
  10518. * var done = _.after(saves.length, function() {
  10519. * console.log('done saving!');
  10520. * });
  10521. *
  10522. * _.forEach(saves, function(type) {
  10523. * asyncSave({ 'type': type, 'complete': done });
  10524. * });
  10525. * // => Logs 'done saving!' after the two async saves have completed.
  10526. */
  10527. function after(n, func) {
  10528. if (typeof func != 'function') {
  10529. throw new TypeError(FUNC_ERROR_TEXT);
  10530. }
  10531. n = toInteger(n);
  10532. return function() {
  10533. if (--n < 1) {
  10534. return func.apply(this, arguments);
  10535. }
  10536. };
  10537. }
  10538. /**
  10539. * Creates a function that invokes `func`, with up to `n` arguments,
  10540. * ignoring any additional arguments.
  10541. *
  10542. * @static
  10543. * @memberOf _
  10544. * @since 3.0.0
  10545. * @category Function
  10546. * @param {Function} func The function to cap arguments for.
  10547. * @param {number} [n=func.length] The arity cap.
  10548. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10549. * @returns {Function} Returns the new capped function.
  10550. * @example
  10551. *
  10552. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10553. * // => [6, 8, 10]
  10554. */
  10555. function ary(func, n, guard) {
  10556. n = guard ? undefined : n;
  10557. n = (func && n == null) ? func.length : n;
  10558. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10559. }
  10560. /**
  10561. * Creates a function that invokes `func`, with the `this` binding and arguments
  10562. * of the created function, while it's called less than `n` times. Subsequent
  10563. * calls to the created function return the result of the last `func` invocation.
  10564. *
  10565. * @static
  10566. * @memberOf _
  10567. * @since 3.0.0
  10568. * @category Function
  10569. * @param {number} n The number of calls at which `func` is no longer invoked.
  10570. * @param {Function} func The function to restrict.
  10571. * @returns {Function} Returns the new restricted function.
  10572. * @example
  10573. *
  10574. * jQuery(element).on('click', _.before(5, addContactToList));
  10575. * // => Allows adding up to 4 contacts to the list.
  10576. */
  10577. function before(n, func) {
  10578. var result;
  10579. if (typeof func != 'function') {
  10580. throw new TypeError(FUNC_ERROR_TEXT);
  10581. }
  10582. n = toInteger(n);
  10583. return function() {
  10584. if (--n > 0) {
  10585. result = func.apply(this, arguments);
  10586. }
  10587. if (n <= 1) {
  10588. func = undefined;
  10589. }
  10590. return result;
  10591. };
  10592. }
  10593. /**
  10594. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10595. * and `partials` prepended to the arguments it receives.
  10596. *
  10597. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10598. * may be used as a placeholder for partially applied arguments.
  10599. *
  10600. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10601. * property of bound functions.
  10602. *
  10603. * @static
  10604. * @memberOf _
  10605. * @since 0.1.0
  10606. * @category Function
  10607. * @param {Function} func The function to bind.
  10608. * @param {*} thisArg The `this` binding of `func`.
  10609. * @param {...*} [partials] The arguments to be partially applied.
  10610. * @returns {Function} Returns the new bound function.
  10611. * @example
  10612. *
  10613. * function greet(greeting, punctuation) {
  10614. * return greeting + ' ' + this.user + punctuation;
  10615. * }
  10616. *
  10617. * var object = { 'user': 'fred' };
  10618. *
  10619. * var bound = _.bind(greet, object, 'hi');
  10620. * bound('!');
  10621. * // => 'hi fred!'
  10622. *
  10623. * // Bound with placeholders.
  10624. * var bound = _.bind(greet, object, _, '!');
  10625. * bound('hi');
  10626. * // => 'hi fred!'
  10627. */
  10628. var bind = baseRest(function(func, thisArg, partials) {
  10629. var bitmask = WRAP_BIND_FLAG;
  10630. if (partials.length) {
  10631. var holders = replaceHolders(partials, getHolder(bind));
  10632. bitmask |= WRAP_PARTIAL_FLAG;
  10633. }
  10634. return createWrap(func, bitmask, thisArg, partials, holders);
  10635. });
  10636. /**
  10637. * Creates a function that invokes the method at `object[key]` with `partials`
  10638. * prepended to the arguments it receives.
  10639. *
  10640. * This method differs from `_.bind` by allowing bound functions to reference
  10641. * methods that may be redefined or don't yet exist. See
  10642. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10643. * for more details.
  10644. *
  10645. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10646. * builds, may be used as a placeholder for partially applied arguments.
  10647. *
  10648. * @static
  10649. * @memberOf _
  10650. * @since 0.10.0
  10651. * @category Function
  10652. * @param {Object} object The object to invoke the method on.
  10653. * @param {string} key The key of the method.
  10654. * @param {...*} [partials] The arguments to be partially applied.
  10655. * @returns {Function} Returns the new bound function.
  10656. * @example
  10657. *
  10658. * var object = {
  10659. * 'user': 'fred',
  10660. * 'greet': function(greeting, punctuation) {
  10661. * return greeting + ' ' + this.user + punctuation;
  10662. * }
  10663. * };
  10664. *
  10665. * var bound = _.bindKey(object, 'greet', 'hi');
  10666. * bound('!');
  10667. * // => 'hi fred!'
  10668. *
  10669. * object.greet = function(greeting, punctuation) {
  10670. * return greeting + 'ya ' + this.user + punctuation;
  10671. * };
  10672. *
  10673. * bound('!');
  10674. * // => 'hiya fred!'
  10675. *
  10676. * // Bound with placeholders.
  10677. * var bound = _.bindKey(object, 'greet', _, '!');
  10678. * bound('hi');
  10679. * // => 'hiya fred!'
  10680. */
  10681. var bindKey = baseRest(function(object, key, partials) {
  10682. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10683. if (partials.length) {
  10684. var holders = replaceHolders(partials, getHolder(bindKey));
  10685. bitmask |= WRAP_PARTIAL_FLAG;
  10686. }
  10687. return createWrap(key, bitmask, object, partials, holders);
  10688. });
  10689. /**
  10690. * Creates a function that accepts arguments of `func` and either invokes
  10691. * `func` returning its result, if at least `arity` number of arguments have
  10692. * been provided, or returns a function that accepts the remaining `func`
  10693. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10694. * is not sufficient.
  10695. *
  10696. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10697. * may be used as a placeholder for provided arguments.
  10698. *
  10699. * **Note:** This method doesn't set the "length" property of curried functions.
  10700. *
  10701. * @static
  10702. * @memberOf _
  10703. * @since 2.0.0
  10704. * @category Function
  10705. * @param {Function} func The function to curry.
  10706. * @param {number} [arity=func.length] The arity of `func`.
  10707. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10708. * @returns {Function} Returns the new curried function.
  10709. * @example
  10710. *
  10711. * var abc = function(a, b, c) {
  10712. * return [a, b, c];
  10713. * };
  10714. *
  10715. * var curried = _.curry(abc);
  10716. *
  10717. * curried(1)(2)(3);
  10718. * // => [1, 2, 3]
  10719. *
  10720. * curried(1, 2)(3);
  10721. * // => [1, 2, 3]
  10722. *
  10723. * curried(1, 2, 3);
  10724. * // => [1, 2, 3]
  10725. *
  10726. * // Curried with placeholders.
  10727. * curried(1)(_, 3)(2);
  10728. * // => [1, 2, 3]
  10729. */
  10730. function curry(func, arity, guard) {
  10731. arity = guard ? undefined : arity;
  10732. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10733. result.placeholder = curry.placeholder;
  10734. return result;
  10735. }
  10736. /**
  10737. * This method is like `_.curry` except that arguments are applied to `func`
  10738. * in the manner of `_.partialRight` instead of `_.partial`.
  10739. *
  10740. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10741. * builds, may be used as a placeholder for provided arguments.
  10742. *
  10743. * **Note:** This method doesn't set the "length" property of curried functions.
  10744. *
  10745. * @static
  10746. * @memberOf _
  10747. * @since 3.0.0
  10748. * @category Function
  10749. * @param {Function} func The function to curry.
  10750. * @param {number} [arity=func.length] The arity of `func`.
  10751. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10752. * @returns {Function} Returns the new curried function.
  10753. * @example
  10754. *
  10755. * var abc = function(a, b, c) {
  10756. * return [a, b, c];
  10757. * };
  10758. *
  10759. * var curried = _.curryRight(abc);
  10760. *
  10761. * curried(3)(2)(1);
  10762. * // => [1, 2, 3]
  10763. *
  10764. * curried(2, 3)(1);
  10765. * // => [1, 2, 3]
  10766. *
  10767. * curried(1, 2, 3);
  10768. * // => [1, 2, 3]
  10769. *
  10770. * // Curried with placeholders.
  10771. * curried(3)(1, _)(2);
  10772. * // => [1, 2, 3]
  10773. */
  10774. function curryRight(func, arity, guard) {
  10775. arity = guard ? undefined : arity;
  10776. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10777. result.placeholder = curryRight.placeholder;
  10778. return result;
  10779. }
  10780. /**
  10781. * Creates a debounced function that delays invoking `func` until after `wait`
  10782. * milliseconds have elapsed since the last time the debounced function was
  10783. * invoked. The debounced function comes with a `cancel` method to cancel
  10784. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10785. * Provide `options` to indicate whether `func` should be invoked on the
  10786. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10787. * with the last arguments provided to the debounced function. Subsequent
  10788. * calls to the debounced function return the result of the last `func`
  10789. * invocation.
  10790. *
  10791. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10792. * invoked on the trailing edge of the timeout only if the debounced function
  10793. * is invoked more than once during the `wait` timeout.
  10794. *
  10795. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10796. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10797. *
  10798. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10799. * for details over the differences between `_.debounce` and `_.throttle`.
  10800. *
  10801. * @static
  10802. * @memberOf _
  10803. * @since 0.1.0
  10804. * @category Function
  10805. * @param {Function} func The function to debounce.
  10806. * @param {number} [wait=0] The number of milliseconds to delay.
  10807. * @param {Object} [options={}] The options object.
  10808. * @param {boolean} [options.leading=false]
  10809. * Specify invoking on the leading edge of the timeout.
  10810. * @param {number} [options.maxWait]
  10811. * The maximum time `func` is allowed to be delayed before it's invoked.
  10812. * @param {boolean} [options.trailing=true]
  10813. * Specify invoking on the trailing edge of the timeout.
  10814. * @returns {Function} Returns the new debounced function.
  10815. * @example
  10816. *
  10817. * // Avoid costly calculations while the window size is in flux.
  10818. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10819. *
  10820. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10821. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10822. * 'leading': true,
  10823. * 'trailing': false
  10824. * }));
  10825. *
  10826. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10827. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10828. * var source = new EventSource('/stream');
  10829. * jQuery(source).on('message', debounced);
  10830. *
  10831. * // Cancel the trailing debounced invocation.
  10832. * jQuery(window).on('popstate', debounced.cancel);
  10833. */
  10834. function debounce(func, wait, options) {
  10835. var lastArgs,
  10836. lastThis,
  10837. maxWait,
  10838. result,
  10839. timerId,
  10840. lastCallTime,
  10841. lastInvokeTime = 0,
  10842. leading = false,
  10843. maxing = false,
  10844. trailing = true;
  10845. if (typeof func != 'function') {
  10846. throw new TypeError(FUNC_ERROR_TEXT);
  10847. }
  10848. wait = toNumber(wait) || 0;
  10849. if (isObject(options)) {
  10850. leading = !!options.leading;
  10851. maxing = 'maxWait' in options;
  10852. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10853. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10854. }
  10855. function invokeFunc(time) {
  10856. var args = lastArgs,
  10857. thisArg = lastThis;
  10858. lastArgs = lastThis = undefined;
  10859. lastInvokeTime = time;
  10860. result = func.apply(thisArg, args);
  10861. return result;
  10862. }
  10863. function leadingEdge(time) {
  10864. // Reset any `maxWait` timer.
  10865. lastInvokeTime = time;
  10866. // Start the timer for the trailing edge.
  10867. timerId = setTimeout(timerExpired, wait);
  10868. // Invoke the leading edge.
  10869. return leading ? invokeFunc(time) : result;
  10870. }
  10871. function remainingWait(time) {
  10872. var timeSinceLastCall = time - lastCallTime,
  10873. timeSinceLastInvoke = time - lastInvokeTime,
  10874. timeWaiting = wait - timeSinceLastCall;
  10875. return maxing
  10876. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10877. : timeWaiting;
  10878. }
  10879. function shouldInvoke(time) {
  10880. var timeSinceLastCall = time - lastCallTime,
  10881. timeSinceLastInvoke = time - lastInvokeTime;
  10882. // Either this is the first call, activity has stopped and we're at the
  10883. // trailing edge, the system time has gone backwards and we're treating
  10884. // it as the trailing edge, or we've hit the `maxWait` limit.
  10885. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10886. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10887. }
  10888. function timerExpired() {
  10889. var time = now();
  10890. if (shouldInvoke(time)) {
  10891. return trailingEdge(time);
  10892. }
  10893. // Restart the timer.
  10894. timerId = setTimeout(timerExpired, remainingWait(time));
  10895. }
  10896. function trailingEdge(time) {
  10897. timerId = undefined;
  10898. // Only invoke if we have `lastArgs` which means `func` has been
  10899. // debounced at least once.
  10900. if (trailing && lastArgs) {
  10901. return invokeFunc(time);
  10902. }
  10903. lastArgs = lastThis = undefined;
  10904. return result;
  10905. }
  10906. function cancel() {
  10907. if (timerId !== undefined) {
  10908. clearTimeout(timerId);
  10909. }
  10910. lastInvokeTime = 0;
  10911. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10912. }
  10913. function flush() {
  10914. return timerId === undefined ? result : trailingEdge(now());
  10915. }
  10916. function debounced() {
  10917. var time = now(),
  10918. isInvoking = shouldInvoke(time);
  10919. lastArgs = arguments;
  10920. lastThis = this;
  10921. lastCallTime = time;
  10922. if (isInvoking) {
  10923. if (timerId === undefined) {
  10924. return leadingEdge(lastCallTime);
  10925. }
  10926. if (maxing) {
  10927. // Handle invocations in a tight loop.
  10928. clearTimeout(timerId);
  10929. timerId = setTimeout(timerExpired, wait);
  10930. return invokeFunc(lastCallTime);
  10931. }
  10932. }
  10933. if (timerId === undefined) {
  10934. timerId = setTimeout(timerExpired, wait);
  10935. }
  10936. return result;
  10937. }
  10938. debounced.cancel = cancel;
  10939. debounced.flush = flush;
  10940. return debounced;
  10941. }
  10942. /**
  10943. * Defers invoking the `func` until the current call stack has cleared. Any
  10944. * additional arguments are provided to `func` when it's invoked.
  10945. *
  10946. * @static
  10947. * @memberOf _
  10948. * @since 0.1.0
  10949. * @category Function
  10950. * @param {Function} func The function to defer.
  10951. * @param {...*} [args] The arguments to invoke `func` with.
  10952. * @returns {number} Returns the timer id.
  10953. * @example
  10954. *
  10955. * _.defer(function(text) {
  10956. * console.log(text);
  10957. * }, 'deferred');
  10958. * // => Logs 'deferred' after one millisecond.
  10959. */
  10960. var defer = baseRest(function(func, args) {
  10961. return baseDelay(func, 1, args);
  10962. });
  10963. /**
  10964. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10965. * provided to `func` when it's invoked.
  10966. *
  10967. * @static
  10968. * @memberOf _
  10969. * @since 0.1.0
  10970. * @category Function
  10971. * @param {Function} func The function to delay.
  10972. * @param {number} wait The number of milliseconds to delay invocation.
  10973. * @param {...*} [args] The arguments to invoke `func` with.
  10974. * @returns {number} Returns the timer id.
  10975. * @example
  10976. *
  10977. * _.delay(function(text) {
  10978. * console.log(text);
  10979. * }, 1000, 'later');
  10980. * // => Logs 'later' after one second.
  10981. */
  10982. var delay = baseRest(function(func, wait, args) {
  10983. return baseDelay(func, toNumber(wait) || 0, args);
  10984. });
  10985. /**
  10986. * Creates a function that invokes `func` with arguments reversed.
  10987. *
  10988. * @static
  10989. * @memberOf _
  10990. * @since 4.0.0
  10991. * @category Function
  10992. * @param {Function} func The function to flip arguments for.
  10993. * @returns {Function} Returns the new flipped function.
  10994. * @example
  10995. *
  10996. * var flipped = _.flip(function() {
  10997. * return _.toArray(arguments);
  10998. * });
  10999. *
  11000. * flipped('a', 'b', 'c', 'd');
  11001. * // => ['d', 'c', 'b', 'a']
  11002. */
  11003. function flip(func) {
  11004. return createWrap(func, WRAP_FLIP_FLAG);
  11005. }
  11006. /**
  11007. * Creates a function that memoizes the result of `func`. If `resolver` is
  11008. * provided, it determines the cache key for storing the result based on the
  11009. * arguments provided to the memoized function. By default, the first argument
  11010. * provided to the memoized function is used as the map cache key. The `func`
  11011. * is invoked with the `this` binding of the memoized function.
  11012. *
  11013. * **Note:** The cache is exposed as the `cache` property on the memoized
  11014. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11015. * constructor with one whose instances implement the
  11016. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11017. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11018. *
  11019. * @static
  11020. * @memberOf _
  11021. * @since 0.1.0
  11022. * @category Function
  11023. * @param {Function} func The function to have its output memoized.
  11024. * @param {Function} [resolver] The function to resolve the cache key.
  11025. * @returns {Function} Returns the new memoized function.
  11026. * @example
  11027. *
  11028. * var object = { 'a': 1, 'b': 2 };
  11029. * var other = { 'c': 3, 'd': 4 };
  11030. *
  11031. * var values = _.memoize(_.values);
  11032. * values(object);
  11033. * // => [1, 2]
  11034. *
  11035. * values(other);
  11036. * // => [3, 4]
  11037. *
  11038. * object.a = 2;
  11039. * values(object);
  11040. * // => [1, 2]
  11041. *
  11042. * // Modify the result cache.
  11043. * values.cache.set(object, ['a', 'b']);
  11044. * values(object);
  11045. * // => ['a', 'b']
  11046. *
  11047. * // Replace `_.memoize.Cache`.
  11048. * _.memoize.Cache = WeakMap;
  11049. */
  11050. function memoize(func, resolver) {
  11051. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11052. throw new TypeError(FUNC_ERROR_TEXT);
  11053. }
  11054. var memoized = function() {
  11055. var args = arguments,
  11056. key = resolver ? resolver.apply(this, args) : args[0],
  11057. cache = memoized.cache;
  11058. if (cache.has(key)) {
  11059. return cache.get(key);
  11060. }
  11061. var result = func.apply(this, args);
  11062. memoized.cache = cache.set(key, result) || cache;
  11063. return result;
  11064. };
  11065. memoized.cache = new (memoize.Cache || MapCache);
  11066. return memoized;
  11067. }
  11068. // Expose `MapCache`.
  11069. memoize.Cache = MapCache;
  11070. /**
  11071. * Creates a function that negates the result of the predicate `func`. The
  11072. * `func` predicate is invoked with the `this` binding and arguments of the
  11073. * created function.
  11074. *
  11075. * @static
  11076. * @memberOf _
  11077. * @since 3.0.0
  11078. * @category Function
  11079. * @param {Function} predicate The predicate to negate.
  11080. * @returns {Function} Returns the new negated function.
  11081. * @example
  11082. *
  11083. * function isEven(n) {
  11084. * return n % 2 == 0;
  11085. * }
  11086. *
  11087. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11088. * // => [1, 3, 5]
  11089. */
  11090. function negate(predicate) {
  11091. if (typeof predicate != 'function') {
  11092. throw new TypeError(FUNC_ERROR_TEXT);
  11093. }
  11094. return function() {
  11095. var args = arguments;
  11096. switch (args.length) {
  11097. case 0: return !predicate.call(this);
  11098. case 1: return !predicate.call(this, args[0]);
  11099. case 2: return !predicate.call(this, args[0], args[1]);
  11100. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11101. }
  11102. return !predicate.apply(this, args);
  11103. };
  11104. }
  11105. /**
  11106. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11107. * to the function return the value of the first invocation. The `func` is
  11108. * invoked with the `this` binding and arguments of the created function.
  11109. *
  11110. * @static
  11111. * @memberOf _
  11112. * @since 0.1.0
  11113. * @category Function
  11114. * @param {Function} func The function to restrict.
  11115. * @returns {Function} Returns the new restricted function.
  11116. * @example
  11117. *
  11118. * var initialize = _.once(createApplication);
  11119. * initialize();
  11120. * initialize();
  11121. * // => `createApplication` is invoked once
  11122. */
  11123. function once(func) {
  11124. return before(2, func);
  11125. }
  11126. /**
  11127. * Creates a function that invokes `func` with its arguments transformed.
  11128. *
  11129. * @static
  11130. * @since 4.0.0
  11131. * @memberOf _
  11132. * @category Function
  11133. * @param {Function} func The function to wrap.
  11134. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11135. * The argument transforms.
  11136. * @returns {Function} Returns the new function.
  11137. * @example
  11138. *
  11139. * function doubled(n) {
  11140. * return n * 2;
  11141. * }
  11142. *
  11143. * function square(n) {
  11144. * return n * n;
  11145. * }
  11146. *
  11147. * var func = _.overArgs(function(x, y) {
  11148. * return [x, y];
  11149. * }, [square, doubled]);
  11150. *
  11151. * func(9, 3);
  11152. * // => [81, 6]
  11153. *
  11154. * func(10, 5);
  11155. * // => [100, 10]
  11156. */
  11157. var overArgs = castRest(function(func, transforms) {
  11158. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11159. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11160. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11161. var funcsLength = transforms.length;
  11162. return baseRest(function(args) {
  11163. var index = -1,
  11164. length = nativeMin(args.length, funcsLength);
  11165. while (++index < length) {
  11166. args[index] = transforms[index].call(this, args[index]);
  11167. }
  11168. return apply(func, this, args);
  11169. });
  11170. });
  11171. /**
  11172. * Creates a function that invokes `func` with `partials` prepended to the
  11173. * arguments it receives. This method is like `_.bind` except it does **not**
  11174. * alter the `this` binding.
  11175. *
  11176. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11177. * builds, may be used as a placeholder for partially applied arguments.
  11178. *
  11179. * **Note:** This method doesn't set the "length" property of partially
  11180. * applied functions.
  11181. *
  11182. * @static
  11183. * @memberOf _
  11184. * @since 0.2.0
  11185. * @category Function
  11186. * @param {Function} func The function to partially apply arguments to.
  11187. * @param {...*} [partials] The arguments to be partially applied.
  11188. * @returns {Function} Returns the new partially applied function.
  11189. * @example
  11190. *
  11191. * function greet(greeting, name) {
  11192. * return greeting + ' ' + name;
  11193. * }
  11194. *
  11195. * var sayHelloTo = _.partial(greet, 'hello');
  11196. * sayHelloTo('fred');
  11197. * // => 'hello fred'
  11198. *
  11199. * // Partially applied with placeholders.
  11200. * var greetFred = _.partial(greet, _, 'fred');
  11201. * greetFred('hi');
  11202. * // => 'hi fred'
  11203. */
  11204. var partial = baseRest(function(func, partials) {
  11205. var holders = replaceHolders(partials, getHolder(partial));
  11206. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11207. });
  11208. /**
  11209. * This method is like `_.partial` except that partially applied arguments
  11210. * are appended to the arguments it receives.
  11211. *
  11212. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11213. * builds, may be used as a placeholder for partially applied arguments.
  11214. *
  11215. * **Note:** This method doesn't set the "length" property of partially
  11216. * applied functions.
  11217. *
  11218. * @static
  11219. * @memberOf _
  11220. * @since 1.0.0
  11221. * @category Function
  11222. * @param {Function} func The function to partially apply arguments to.
  11223. * @param {...*} [partials] The arguments to be partially applied.
  11224. * @returns {Function} Returns the new partially applied function.
  11225. * @example
  11226. *
  11227. * function greet(greeting, name) {
  11228. * return greeting + ' ' + name;
  11229. * }
  11230. *
  11231. * var greetFred = _.partialRight(greet, 'fred');
  11232. * greetFred('hi');
  11233. * // => 'hi fred'
  11234. *
  11235. * // Partially applied with placeholders.
  11236. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11237. * sayHelloTo('fred');
  11238. * // => 'hello fred'
  11239. */
  11240. var partialRight = baseRest(function(func, partials) {
  11241. var holders = replaceHolders(partials, getHolder(partialRight));
  11242. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11243. });
  11244. /**
  11245. * Creates a function that invokes `func` with arguments arranged according
  11246. * to the specified `indexes` where the argument value at the first index is
  11247. * provided as the first argument, the argument value at the second index is
  11248. * provided as the second argument, and so on.
  11249. *
  11250. * @static
  11251. * @memberOf _
  11252. * @since 3.0.0
  11253. * @category Function
  11254. * @param {Function} func The function to rearrange arguments for.
  11255. * @param {...(number|number[])} indexes The arranged argument indexes.
  11256. * @returns {Function} Returns the new function.
  11257. * @example
  11258. *
  11259. * var rearged = _.rearg(function(a, b, c) {
  11260. * return [a, b, c];
  11261. * }, [2, 0, 1]);
  11262. *
  11263. * rearged('b', 'c', 'a')
  11264. * // => ['a', 'b', 'c']
  11265. */
  11266. var rearg = flatRest(function(func, indexes) {
  11267. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11268. });
  11269. /**
  11270. * Creates a function that invokes `func` with the `this` binding of the
  11271. * created function and arguments from `start` and beyond provided as
  11272. * an array.
  11273. *
  11274. * **Note:** This method is based on the
  11275. * [rest parameter](https://mdn.io/rest_parameters).
  11276. *
  11277. * @static
  11278. * @memberOf _
  11279. * @since 4.0.0
  11280. * @category Function
  11281. * @param {Function} func The function to apply a rest parameter to.
  11282. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11283. * @returns {Function} Returns the new function.
  11284. * @example
  11285. *
  11286. * var say = _.rest(function(what, names) {
  11287. * return what + ' ' + _.initial(names).join(', ') +
  11288. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11289. * });
  11290. *
  11291. * say('hello', 'fred', 'barney', 'pebbles');
  11292. * // => 'hello fred, barney, & pebbles'
  11293. */
  11294. function rest(func, start) {
  11295. if (typeof func != 'function') {
  11296. throw new TypeError(FUNC_ERROR_TEXT);
  11297. }
  11298. start = start === undefined ? start : toInteger(start);
  11299. return baseRest(func, start);
  11300. }
  11301. /**
  11302. * Creates a function that invokes `func` with the `this` binding of the
  11303. * create function and an array of arguments much like
  11304. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11305. *
  11306. * **Note:** This method is based on the
  11307. * [spread operator](https://mdn.io/spread_operator).
  11308. *
  11309. * @static
  11310. * @memberOf _
  11311. * @since 3.2.0
  11312. * @category Function
  11313. * @param {Function} func The function to spread arguments over.
  11314. * @param {number} [start=0] The start position of the spread.
  11315. * @returns {Function} Returns the new function.
  11316. * @example
  11317. *
  11318. * var say = _.spread(function(who, what) {
  11319. * return who + ' says ' + what;
  11320. * });
  11321. *
  11322. * say(['fred', 'hello']);
  11323. * // => 'fred says hello'
  11324. *
  11325. * var numbers = Promise.all([
  11326. * Promise.resolve(40),
  11327. * Promise.resolve(36)
  11328. * ]);
  11329. *
  11330. * numbers.then(_.spread(function(x, y) {
  11331. * return x + y;
  11332. * }));
  11333. * // => a Promise of 76
  11334. */
  11335. function spread(func, start) {
  11336. if (typeof func != 'function') {
  11337. throw new TypeError(FUNC_ERROR_TEXT);
  11338. }
  11339. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11340. return baseRest(function(args) {
  11341. var array = args[start],
  11342. otherArgs = castSlice(args, 0, start);
  11343. if (array) {
  11344. arrayPush(otherArgs, array);
  11345. }
  11346. return apply(func, this, otherArgs);
  11347. });
  11348. }
  11349. /**
  11350. * Creates a throttled function that only invokes `func` at most once per
  11351. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11352. * method to cancel delayed `func` invocations and a `flush` method to
  11353. * immediately invoke them. Provide `options` to indicate whether `func`
  11354. * should be invoked on the leading and/or trailing edge of the `wait`
  11355. * timeout. The `func` is invoked with the last arguments provided to the
  11356. * throttled function. Subsequent calls to the throttled function return the
  11357. * result of the last `func` invocation.
  11358. *
  11359. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11360. * invoked on the trailing edge of the timeout only if the throttled function
  11361. * is invoked more than once during the `wait` timeout.
  11362. *
  11363. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11364. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11365. *
  11366. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11367. * for details over the differences between `_.throttle` and `_.debounce`.
  11368. *
  11369. * @static
  11370. * @memberOf _
  11371. * @since 0.1.0
  11372. * @category Function
  11373. * @param {Function} func The function to throttle.
  11374. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11375. * @param {Object} [options={}] The options object.
  11376. * @param {boolean} [options.leading=true]
  11377. * Specify invoking on the leading edge of the timeout.
  11378. * @param {boolean} [options.trailing=true]
  11379. * Specify invoking on the trailing edge of the timeout.
  11380. * @returns {Function} Returns the new throttled function.
  11381. * @example
  11382. *
  11383. * // Avoid excessively updating the position while scrolling.
  11384. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11385. *
  11386. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11387. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11388. * jQuery(element).on('click', throttled);
  11389. *
  11390. * // Cancel the trailing throttled invocation.
  11391. * jQuery(window).on('popstate', throttled.cancel);
  11392. */
  11393. function throttle(func, wait, options) {
  11394. var leading = true,
  11395. trailing = true;
  11396. if (typeof func != 'function') {
  11397. throw new TypeError(FUNC_ERROR_TEXT);
  11398. }
  11399. if (isObject(options)) {
  11400. leading = 'leading' in options ? !!options.leading : leading;
  11401. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11402. }
  11403. return debounce(func, wait, {
  11404. 'leading': leading,
  11405. 'maxWait': wait,
  11406. 'trailing': trailing
  11407. });
  11408. }
  11409. /**
  11410. * Creates a function that accepts up to one argument, ignoring any
  11411. * additional arguments.
  11412. *
  11413. * @static
  11414. * @memberOf _
  11415. * @since 4.0.0
  11416. * @category Function
  11417. * @param {Function} func The function to cap arguments for.
  11418. * @returns {Function} Returns the new capped function.
  11419. * @example
  11420. *
  11421. * _.map(['6', '8', '10'], _.unary(parseInt));
  11422. * // => [6, 8, 10]
  11423. */
  11424. function unary(func) {
  11425. return ary(func, 1);
  11426. }
  11427. /**
  11428. * Creates a function that provides `value` to `wrapper` as its first
  11429. * argument. Any additional arguments provided to the function are appended
  11430. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11431. * binding of the created function.
  11432. *
  11433. * @static
  11434. * @memberOf _
  11435. * @since 0.1.0
  11436. * @category Function
  11437. * @param {*} value The value to wrap.
  11438. * @param {Function} [wrapper=identity] The wrapper function.
  11439. * @returns {Function} Returns the new function.
  11440. * @example
  11441. *
  11442. * var p = _.wrap(_.escape, function(func, text) {
  11443. * return '<p>' + func(text) + '</p>';
  11444. * });
  11445. *
  11446. * p('fred, barney, & pebbles');
  11447. * // => '<p>fred, barney, &amp; pebbles</p>'
  11448. */
  11449. function wrap(value, wrapper) {
  11450. return partial(castFunction(wrapper), value);
  11451. }
  11452. /*------------------------------------------------------------------------*/
  11453. /**
  11454. * Casts `value` as an array if it's not one.
  11455. *
  11456. * @static
  11457. * @memberOf _
  11458. * @since 4.4.0
  11459. * @category Lang
  11460. * @param {*} value The value to inspect.
  11461. * @returns {Array} Returns the cast array.
  11462. * @example
  11463. *
  11464. * _.castArray(1);
  11465. * // => [1]
  11466. *
  11467. * _.castArray({ 'a': 1 });
  11468. * // => [{ 'a': 1 }]
  11469. *
  11470. * _.castArray('abc');
  11471. * // => ['abc']
  11472. *
  11473. * _.castArray(null);
  11474. * // => [null]
  11475. *
  11476. * _.castArray(undefined);
  11477. * // => [undefined]
  11478. *
  11479. * _.castArray();
  11480. * // => []
  11481. *
  11482. * var array = [1, 2, 3];
  11483. * console.log(_.castArray(array) === array);
  11484. * // => true
  11485. */
  11486. function castArray() {
  11487. if (!arguments.length) {
  11488. return [];
  11489. }
  11490. var value = arguments[0];
  11491. return isArray(value) ? value : [value];
  11492. }
  11493. /**
  11494. * Creates a shallow clone of `value`.
  11495. *
  11496. * **Note:** This method is loosely based on the
  11497. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11498. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11499. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11500. * arrays. The own enumerable properties of `arguments` objects are cloned
  11501. * as plain objects. An empty object is returned for uncloneable values such
  11502. * as error objects, functions, DOM nodes, and WeakMaps.
  11503. *
  11504. * @static
  11505. * @memberOf _
  11506. * @since 0.1.0
  11507. * @category Lang
  11508. * @param {*} value The value to clone.
  11509. * @returns {*} Returns the cloned value.
  11510. * @see _.cloneDeep
  11511. * @example
  11512. *
  11513. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11514. *
  11515. * var shallow = _.clone(objects);
  11516. * console.log(shallow[0] === objects[0]);
  11517. * // => true
  11518. */
  11519. function clone(value) {
  11520. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11521. }
  11522. /**
  11523. * This method is like `_.clone` except that it accepts `customizer` which
  11524. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11525. * cloning is handled by the method instead. The `customizer` is invoked with
  11526. * up to four arguments; (value [, index|key, object, stack]).
  11527. *
  11528. * @static
  11529. * @memberOf _
  11530. * @since 4.0.0
  11531. * @category Lang
  11532. * @param {*} value The value to clone.
  11533. * @param {Function} [customizer] The function to customize cloning.
  11534. * @returns {*} Returns the cloned value.
  11535. * @see _.cloneDeepWith
  11536. * @example
  11537. *
  11538. * function customizer(value) {
  11539. * if (_.isElement(value)) {
  11540. * return value.cloneNode(false);
  11541. * }
  11542. * }
  11543. *
  11544. * var el = _.cloneWith(document.body, customizer);
  11545. *
  11546. * console.log(el === document.body);
  11547. * // => false
  11548. * console.log(el.nodeName);
  11549. * // => 'BODY'
  11550. * console.log(el.childNodes.length);
  11551. * // => 0
  11552. */
  11553. function cloneWith(value, customizer) {
  11554. customizer = typeof customizer == 'function' ? customizer : undefined;
  11555. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11556. }
  11557. /**
  11558. * This method is like `_.clone` except that it recursively clones `value`.
  11559. *
  11560. * @static
  11561. * @memberOf _
  11562. * @since 1.0.0
  11563. * @category Lang
  11564. * @param {*} value The value to recursively clone.
  11565. * @returns {*} Returns the deep cloned value.
  11566. * @see _.clone
  11567. * @example
  11568. *
  11569. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11570. *
  11571. * var deep = _.cloneDeep(objects);
  11572. * console.log(deep[0] === objects[0]);
  11573. * // => false
  11574. */
  11575. function cloneDeep(value) {
  11576. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11577. }
  11578. /**
  11579. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11580. *
  11581. * @static
  11582. * @memberOf _
  11583. * @since 4.0.0
  11584. * @category Lang
  11585. * @param {*} value The value to recursively clone.
  11586. * @param {Function} [customizer] The function to customize cloning.
  11587. * @returns {*} Returns the deep cloned value.
  11588. * @see _.cloneWith
  11589. * @example
  11590. *
  11591. * function customizer(value) {
  11592. * if (_.isElement(value)) {
  11593. * return value.cloneNode(true);
  11594. * }
  11595. * }
  11596. *
  11597. * var el = _.cloneDeepWith(document.body, customizer);
  11598. *
  11599. * console.log(el === document.body);
  11600. * // => false
  11601. * console.log(el.nodeName);
  11602. * // => 'BODY'
  11603. * console.log(el.childNodes.length);
  11604. * // => 20
  11605. */
  11606. function cloneDeepWith(value, customizer) {
  11607. customizer = typeof customizer == 'function' ? customizer : undefined;
  11608. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11609. }
  11610. /**
  11611. * Checks if `object` conforms to `source` by invoking the predicate
  11612. * properties of `source` with the corresponding property values of `object`.
  11613. *
  11614. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11615. * partially applied.
  11616. *
  11617. * @static
  11618. * @memberOf _
  11619. * @since 4.14.0
  11620. * @category Lang
  11621. * @param {Object} object The object to inspect.
  11622. * @param {Object} source The object of property predicates to conform to.
  11623. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11624. * @example
  11625. *
  11626. * var object = { 'a': 1, 'b': 2 };
  11627. *
  11628. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11629. * // => true
  11630. *
  11631. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11632. * // => false
  11633. */
  11634. function conformsTo(object, source) {
  11635. return source == null || baseConformsTo(object, source, keys(source));
  11636. }
  11637. /**
  11638. * Performs a
  11639. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11640. * comparison between two values to determine if they are equivalent.
  11641. *
  11642. * @static
  11643. * @memberOf _
  11644. * @since 4.0.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 the values are equivalent, else `false`.
  11649. * @example
  11650. *
  11651. * var object = { 'a': 1 };
  11652. * var other = { 'a': 1 };
  11653. *
  11654. * _.eq(object, object);
  11655. * // => true
  11656. *
  11657. * _.eq(object, other);
  11658. * // => false
  11659. *
  11660. * _.eq('a', 'a');
  11661. * // => true
  11662. *
  11663. * _.eq('a', Object('a'));
  11664. * // => false
  11665. *
  11666. * _.eq(NaN, NaN);
  11667. * // => true
  11668. */
  11669. function eq(value, other) {
  11670. return value === other || (value !== value && other !== other);
  11671. }
  11672. /**
  11673. * Checks if `value` is greater than `other`.
  11674. *
  11675. * @static
  11676. * @memberOf _
  11677. * @since 3.9.0
  11678. * @category Lang
  11679. * @param {*} value The value to compare.
  11680. * @param {*} other The other value to compare.
  11681. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11682. * else `false`.
  11683. * @see _.lt
  11684. * @example
  11685. *
  11686. * _.gt(3, 1);
  11687. * // => true
  11688. *
  11689. * _.gt(3, 3);
  11690. * // => false
  11691. *
  11692. * _.gt(1, 3);
  11693. * // => false
  11694. */
  11695. var gt = createRelationalOperation(baseGt);
  11696. /**
  11697. * Checks if `value` is greater than or equal to `other`.
  11698. *
  11699. * @static
  11700. * @memberOf _
  11701. * @since 3.9.0
  11702. * @category Lang
  11703. * @param {*} value The value to compare.
  11704. * @param {*} other The other value to compare.
  11705. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11706. * `other`, else `false`.
  11707. * @see _.lte
  11708. * @example
  11709. *
  11710. * _.gte(3, 1);
  11711. * // => true
  11712. *
  11713. * _.gte(3, 3);
  11714. * // => true
  11715. *
  11716. * _.gte(1, 3);
  11717. * // => false
  11718. */
  11719. var gte = createRelationalOperation(function(value, other) {
  11720. return value >= other;
  11721. });
  11722. /**
  11723. * Checks if `value` is likely an `arguments` object.
  11724. *
  11725. * @static
  11726. * @memberOf _
  11727. * @since 0.1.0
  11728. * @category Lang
  11729. * @param {*} value The value to check.
  11730. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11731. * else `false`.
  11732. * @example
  11733. *
  11734. * _.isArguments(function() { return arguments; }());
  11735. * // => true
  11736. *
  11737. * _.isArguments([1, 2, 3]);
  11738. * // => false
  11739. */
  11740. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11741. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11742. !propertyIsEnumerable.call(value, 'callee');
  11743. };
  11744. /**
  11745. * Checks if `value` is classified as an `Array` object.
  11746. *
  11747. * @static
  11748. * @memberOf _
  11749. * @since 0.1.0
  11750. * @category Lang
  11751. * @param {*} value The value to check.
  11752. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11753. * @example
  11754. *
  11755. * _.isArray([1, 2, 3]);
  11756. * // => true
  11757. *
  11758. * _.isArray(document.body.children);
  11759. * // => false
  11760. *
  11761. * _.isArray('abc');
  11762. * // => false
  11763. *
  11764. * _.isArray(_.noop);
  11765. * // => false
  11766. */
  11767. var isArray = Array.isArray;
  11768. /**
  11769. * Checks if `value` is classified as an `ArrayBuffer` object.
  11770. *
  11771. * @static
  11772. * @memberOf _
  11773. * @since 4.3.0
  11774. * @category Lang
  11775. * @param {*} value The value to check.
  11776. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11777. * @example
  11778. *
  11779. * _.isArrayBuffer(new ArrayBuffer(2));
  11780. * // => true
  11781. *
  11782. * _.isArrayBuffer(new Array(2));
  11783. * // => false
  11784. */
  11785. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11786. /**
  11787. * Checks if `value` is array-like. A value is considered array-like if it's
  11788. * not a function and has a `value.length` that's an integer greater than or
  11789. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11790. *
  11791. * @static
  11792. * @memberOf _
  11793. * @since 4.0.0
  11794. * @category Lang
  11795. * @param {*} value The value to check.
  11796. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11797. * @example
  11798. *
  11799. * _.isArrayLike([1, 2, 3]);
  11800. * // => true
  11801. *
  11802. * _.isArrayLike(document.body.children);
  11803. * // => true
  11804. *
  11805. * _.isArrayLike('abc');
  11806. * // => true
  11807. *
  11808. * _.isArrayLike(_.noop);
  11809. * // => false
  11810. */
  11811. function isArrayLike(value) {
  11812. return value != null && isLength(value.length) && !isFunction(value);
  11813. }
  11814. /**
  11815. * This method is like `_.isArrayLike` except that it also checks if `value`
  11816. * is an object.
  11817. *
  11818. * @static
  11819. * @memberOf _
  11820. * @since 4.0.0
  11821. * @category Lang
  11822. * @param {*} value The value to check.
  11823. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11824. * else `false`.
  11825. * @example
  11826. *
  11827. * _.isArrayLikeObject([1, 2, 3]);
  11828. * // => true
  11829. *
  11830. * _.isArrayLikeObject(document.body.children);
  11831. * // => true
  11832. *
  11833. * _.isArrayLikeObject('abc');
  11834. * // => false
  11835. *
  11836. * _.isArrayLikeObject(_.noop);
  11837. * // => false
  11838. */
  11839. function isArrayLikeObject(value) {
  11840. return isObjectLike(value) && isArrayLike(value);
  11841. }
  11842. /**
  11843. * Checks if `value` is classified as a boolean primitive or object.
  11844. *
  11845. * @static
  11846. * @memberOf _
  11847. * @since 0.1.0
  11848. * @category Lang
  11849. * @param {*} value The value to check.
  11850. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11851. * @example
  11852. *
  11853. * _.isBoolean(false);
  11854. * // => true
  11855. *
  11856. * _.isBoolean(null);
  11857. * // => false
  11858. */
  11859. function isBoolean(value) {
  11860. return value === true || value === false ||
  11861. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11862. }
  11863. /**
  11864. * Checks if `value` is a buffer.
  11865. *
  11866. * @static
  11867. * @memberOf _
  11868. * @since 4.3.0
  11869. * @category Lang
  11870. * @param {*} value The value to check.
  11871. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11872. * @example
  11873. *
  11874. * _.isBuffer(new Buffer(2));
  11875. * // => true
  11876. *
  11877. * _.isBuffer(new Uint8Array(2));
  11878. * // => false
  11879. */
  11880. var isBuffer = nativeIsBuffer || stubFalse;
  11881. /**
  11882. * Checks if `value` is classified as a `Date` object.
  11883. *
  11884. * @static
  11885. * @memberOf _
  11886. * @since 0.1.0
  11887. * @category Lang
  11888. * @param {*} value The value to check.
  11889. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11890. * @example
  11891. *
  11892. * _.isDate(new Date);
  11893. * // => true
  11894. *
  11895. * _.isDate('Mon April 23 2012');
  11896. * // => false
  11897. */
  11898. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11899. /**
  11900. * Checks if `value` is likely a DOM element.
  11901. *
  11902. * @static
  11903. * @memberOf _
  11904. * @since 0.1.0
  11905. * @category Lang
  11906. * @param {*} value The value to check.
  11907. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11908. * @example
  11909. *
  11910. * _.isElement(document.body);
  11911. * // => true
  11912. *
  11913. * _.isElement('<body>');
  11914. * // => false
  11915. */
  11916. function isElement(value) {
  11917. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11918. }
  11919. /**
  11920. * Checks if `value` is an empty object, collection, map, or set.
  11921. *
  11922. * Objects are considered empty if they have no own enumerable string keyed
  11923. * properties.
  11924. *
  11925. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11926. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11927. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11928. *
  11929. * @static
  11930. * @memberOf _
  11931. * @since 0.1.0
  11932. * @category Lang
  11933. * @param {*} value The value to check.
  11934. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11935. * @example
  11936. *
  11937. * _.isEmpty(null);
  11938. * // => true
  11939. *
  11940. * _.isEmpty(true);
  11941. * // => true
  11942. *
  11943. * _.isEmpty(1);
  11944. * // => true
  11945. *
  11946. * _.isEmpty([1, 2, 3]);
  11947. * // => false
  11948. *
  11949. * _.isEmpty({ 'a': 1 });
  11950. * // => false
  11951. */
  11952. function isEmpty(value) {
  11953. if (value == null) {
  11954. return true;
  11955. }
  11956. if (isArrayLike(value) &&
  11957. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11958. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11959. return !value.length;
  11960. }
  11961. var tag = getTag(value);
  11962. if (tag == mapTag || tag == setTag) {
  11963. return !value.size;
  11964. }
  11965. if (isPrototype(value)) {
  11966. return !baseKeys(value).length;
  11967. }
  11968. for (var key in value) {
  11969. if (hasOwnProperty.call(value, key)) {
  11970. return false;
  11971. }
  11972. }
  11973. return true;
  11974. }
  11975. /**
  11976. * Performs a deep comparison between two values to determine if they are
  11977. * equivalent.
  11978. *
  11979. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11980. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11981. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11982. * by their own, not inherited, enumerable properties. Functions and DOM
  11983. * nodes are compared by strict equality, i.e. `===`.
  11984. *
  11985. * @static
  11986. * @memberOf _
  11987. * @since 0.1.0
  11988. * @category Lang
  11989. * @param {*} value The value to compare.
  11990. * @param {*} other The other value to compare.
  11991. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11992. * @example
  11993. *
  11994. * var object = { 'a': 1 };
  11995. * var other = { 'a': 1 };
  11996. *
  11997. * _.isEqual(object, other);
  11998. * // => true
  11999. *
  12000. * object === other;
  12001. * // => false
  12002. */
  12003. function isEqual(value, other) {
  12004. return baseIsEqual(value, other);
  12005. }
  12006. /**
  12007. * This method is like `_.isEqual` except that it accepts `customizer` which
  12008. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12009. * are handled by the method instead. The `customizer` is invoked with up to
  12010. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12011. *
  12012. * @static
  12013. * @memberOf _
  12014. * @since 4.0.0
  12015. * @category Lang
  12016. * @param {*} value The value to compare.
  12017. * @param {*} other The other value to compare.
  12018. * @param {Function} [customizer] The function to customize comparisons.
  12019. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12020. * @example
  12021. *
  12022. * function isGreeting(value) {
  12023. * return /^h(?:i|ello)$/.test(value);
  12024. * }
  12025. *
  12026. * function customizer(objValue, othValue) {
  12027. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12028. * return true;
  12029. * }
  12030. * }
  12031. *
  12032. * var array = ['hello', 'goodbye'];
  12033. * var other = ['hi', 'goodbye'];
  12034. *
  12035. * _.isEqualWith(array, other, customizer);
  12036. * // => true
  12037. */
  12038. function isEqualWith(value, other, customizer) {
  12039. customizer = typeof customizer == 'function' ? customizer : undefined;
  12040. var result = customizer ? customizer(value, other) : undefined;
  12041. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12042. }
  12043. /**
  12044. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12045. * `SyntaxError`, `TypeError`, or `URIError` object.
  12046. *
  12047. * @static
  12048. * @memberOf _
  12049. * @since 3.0.0
  12050. * @category Lang
  12051. * @param {*} value The value to check.
  12052. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12053. * @example
  12054. *
  12055. * _.isError(new Error);
  12056. * // => true
  12057. *
  12058. * _.isError(Error);
  12059. * // => false
  12060. */
  12061. function isError(value) {
  12062. if (!isObjectLike(value)) {
  12063. return false;
  12064. }
  12065. var tag = baseGetTag(value);
  12066. return tag == errorTag || tag == domExcTag ||
  12067. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12068. }
  12069. /**
  12070. * Checks if `value` is a finite primitive number.
  12071. *
  12072. * **Note:** This method is based on
  12073. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12074. *
  12075. * @static
  12076. * @memberOf _
  12077. * @since 0.1.0
  12078. * @category Lang
  12079. * @param {*} value The value to check.
  12080. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12081. * @example
  12082. *
  12083. * _.isFinite(3);
  12084. * // => true
  12085. *
  12086. * _.isFinite(Number.MIN_VALUE);
  12087. * // => true
  12088. *
  12089. * _.isFinite(Infinity);
  12090. * // => false
  12091. *
  12092. * _.isFinite('3');
  12093. * // => false
  12094. */
  12095. function isFinite(value) {
  12096. return typeof value == 'number' && nativeIsFinite(value);
  12097. }
  12098. /**
  12099. * Checks if `value` is classified as a `Function` object.
  12100. *
  12101. * @static
  12102. * @memberOf _
  12103. * @since 0.1.0
  12104. * @category Lang
  12105. * @param {*} value The value to check.
  12106. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12107. * @example
  12108. *
  12109. * _.isFunction(_);
  12110. * // => true
  12111. *
  12112. * _.isFunction(/abc/);
  12113. * // => false
  12114. */
  12115. function isFunction(value) {
  12116. if (!isObject(value)) {
  12117. return false;
  12118. }
  12119. // The use of `Object#toString` avoids issues with the `typeof` operator
  12120. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12121. var tag = baseGetTag(value);
  12122. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12123. }
  12124. /**
  12125. * Checks if `value` is an integer.
  12126. *
  12127. * **Note:** This method is based on
  12128. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12129. *
  12130. * @static
  12131. * @memberOf _
  12132. * @since 4.0.0
  12133. * @category Lang
  12134. * @param {*} value The value to check.
  12135. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12136. * @example
  12137. *
  12138. * _.isInteger(3);
  12139. * // => true
  12140. *
  12141. * _.isInteger(Number.MIN_VALUE);
  12142. * // => false
  12143. *
  12144. * _.isInteger(Infinity);
  12145. * // => false
  12146. *
  12147. * _.isInteger('3');
  12148. * // => false
  12149. */
  12150. function isInteger(value) {
  12151. return typeof value == 'number' && value == toInteger(value);
  12152. }
  12153. /**
  12154. * Checks if `value` is a valid array-like length.
  12155. *
  12156. * **Note:** This method is loosely based on
  12157. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12158. *
  12159. * @static
  12160. * @memberOf _
  12161. * @since 4.0.0
  12162. * @category Lang
  12163. * @param {*} value The value to check.
  12164. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12165. * @example
  12166. *
  12167. * _.isLength(3);
  12168. * // => true
  12169. *
  12170. * _.isLength(Number.MIN_VALUE);
  12171. * // => false
  12172. *
  12173. * _.isLength(Infinity);
  12174. * // => false
  12175. *
  12176. * _.isLength('3');
  12177. * // => false
  12178. */
  12179. function isLength(value) {
  12180. return typeof value == 'number' &&
  12181. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12182. }
  12183. /**
  12184. * Checks if `value` is the
  12185. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12186. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12187. *
  12188. * @static
  12189. * @memberOf _
  12190. * @since 0.1.0
  12191. * @category Lang
  12192. * @param {*} value The value to check.
  12193. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12194. * @example
  12195. *
  12196. * _.isObject({});
  12197. * // => true
  12198. *
  12199. * _.isObject([1, 2, 3]);
  12200. * // => true
  12201. *
  12202. * _.isObject(_.noop);
  12203. * // => true
  12204. *
  12205. * _.isObject(null);
  12206. * // => false
  12207. */
  12208. function isObject(value) {
  12209. var type = typeof value;
  12210. return value != null && (type == 'object' || type == 'function');
  12211. }
  12212. /**
  12213. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12214. * and has a `typeof` result of "object".
  12215. *
  12216. * @static
  12217. * @memberOf _
  12218. * @since 4.0.0
  12219. * @category Lang
  12220. * @param {*} value The value to check.
  12221. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12222. * @example
  12223. *
  12224. * _.isObjectLike({});
  12225. * // => true
  12226. *
  12227. * _.isObjectLike([1, 2, 3]);
  12228. * // => true
  12229. *
  12230. * _.isObjectLike(_.noop);
  12231. * // => false
  12232. *
  12233. * _.isObjectLike(null);
  12234. * // => false
  12235. */
  12236. function isObjectLike(value) {
  12237. return value != null && typeof value == 'object';
  12238. }
  12239. /**
  12240. * Checks if `value` is classified as a `Map` object.
  12241. *
  12242. * @static
  12243. * @memberOf _
  12244. * @since 4.3.0
  12245. * @category Lang
  12246. * @param {*} value The value to check.
  12247. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12248. * @example
  12249. *
  12250. * _.isMap(new Map);
  12251. * // => true
  12252. *
  12253. * _.isMap(new WeakMap);
  12254. * // => false
  12255. */
  12256. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12257. /**
  12258. * Performs a partial deep comparison between `object` and `source` to
  12259. * determine if `object` contains equivalent property values.
  12260. *
  12261. * **Note:** This method is equivalent to `_.matches` when `source` is
  12262. * partially applied.
  12263. *
  12264. * Partial comparisons will match empty array and empty object `source`
  12265. * values against any array or object value, respectively. See `_.isEqual`
  12266. * for a list of supported value comparisons.
  12267. *
  12268. * @static
  12269. * @memberOf _
  12270. * @since 3.0.0
  12271. * @category Lang
  12272. * @param {Object} object The object to inspect.
  12273. * @param {Object} source The object of property values to match.
  12274. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12275. * @example
  12276. *
  12277. * var object = { 'a': 1, 'b': 2 };
  12278. *
  12279. * _.isMatch(object, { 'b': 2 });
  12280. * // => true
  12281. *
  12282. * _.isMatch(object, { 'b': 1 });
  12283. * // => false
  12284. */
  12285. function isMatch(object, source) {
  12286. return object === source || baseIsMatch(object, source, getMatchData(source));
  12287. }
  12288. /**
  12289. * This method is like `_.isMatch` except that it accepts `customizer` which
  12290. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12291. * are handled by the method instead. The `customizer` is invoked with five
  12292. * arguments: (objValue, srcValue, index|key, object, source).
  12293. *
  12294. * @static
  12295. * @memberOf _
  12296. * @since 4.0.0
  12297. * @category Lang
  12298. * @param {Object} object The object to inspect.
  12299. * @param {Object} source The object of property values to match.
  12300. * @param {Function} [customizer] The function to customize comparisons.
  12301. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12302. * @example
  12303. *
  12304. * function isGreeting(value) {
  12305. * return /^h(?:i|ello)$/.test(value);
  12306. * }
  12307. *
  12308. * function customizer(objValue, srcValue) {
  12309. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12310. * return true;
  12311. * }
  12312. * }
  12313. *
  12314. * var object = { 'greeting': 'hello' };
  12315. * var source = { 'greeting': 'hi' };
  12316. *
  12317. * _.isMatchWith(object, source, customizer);
  12318. * // => true
  12319. */
  12320. function isMatchWith(object, source, customizer) {
  12321. customizer = typeof customizer == 'function' ? customizer : undefined;
  12322. return baseIsMatch(object, source, getMatchData(source), customizer);
  12323. }
  12324. /**
  12325. * Checks if `value` is `NaN`.
  12326. *
  12327. * **Note:** This method is based on
  12328. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12329. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12330. * `undefined` and other non-number values.
  12331. *
  12332. * @static
  12333. * @memberOf _
  12334. * @since 0.1.0
  12335. * @category Lang
  12336. * @param {*} value The value to check.
  12337. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12338. * @example
  12339. *
  12340. * _.isNaN(NaN);
  12341. * // => true
  12342. *
  12343. * _.isNaN(new Number(NaN));
  12344. * // => true
  12345. *
  12346. * isNaN(undefined);
  12347. * // => true
  12348. *
  12349. * _.isNaN(undefined);
  12350. * // => false
  12351. */
  12352. function isNaN(value) {
  12353. // An `NaN` primitive is the only value that is not equal to itself.
  12354. // Perform the `toStringTag` check first to avoid errors with some
  12355. // ActiveX objects in IE.
  12356. return isNumber(value) && value != +value;
  12357. }
  12358. /**
  12359. * Checks if `value` is a pristine native function.
  12360. *
  12361. * **Note:** This method can't reliably detect native functions in the presence
  12362. * of the core-js package because core-js circumvents this kind of detection.
  12363. * Despite multiple requests, the core-js maintainer has made it clear: any
  12364. * attempt to fix the detection will be obstructed. As a result, we're left
  12365. * with little choice but to throw an error. Unfortunately, this also affects
  12366. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12367. * which rely on core-js.
  12368. *
  12369. * @static
  12370. * @memberOf _
  12371. * @since 3.0.0
  12372. * @category Lang
  12373. * @param {*} value The value to check.
  12374. * @returns {boolean} Returns `true` if `value` is a native function,
  12375. * else `false`.
  12376. * @example
  12377. *
  12378. * _.isNative(Array.prototype.push);
  12379. * // => true
  12380. *
  12381. * _.isNative(_);
  12382. * // => false
  12383. */
  12384. function isNative(value) {
  12385. if (isMaskable(value)) {
  12386. throw new Error(CORE_ERROR_TEXT);
  12387. }
  12388. return baseIsNative(value);
  12389. }
  12390. /**
  12391. * Checks if `value` is `null`.
  12392. *
  12393. * @static
  12394. * @memberOf _
  12395. * @since 0.1.0
  12396. * @category Lang
  12397. * @param {*} value The value to check.
  12398. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12399. * @example
  12400. *
  12401. * _.isNull(null);
  12402. * // => true
  12403. *
  12404. * _.isNull(void 0);
  12405. * // => false
  12406. */
  12407. function isNull(value) {
  12408. return value === null;
  12409. }
  12410. /**
  12411. * Checks if `value` is `null` or `undefined`.
  12412. *
  12413. * @static
  12414. * @memberOf _
  12415. * @since 4.0.0
  12416. * @category Lang
  12417. * @param {*} value The value to check.
  12418. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12419. * @example
  12420. *
  12421. * _.isNil(null);
  12422. * // => true
  12423. *
  12424. * _.isNil(void 0);
  12425. * // => true
  12426. *
  12427. * _.isNil(NaN);
  12428. * // => false
  12429. */
  12430. function isNil(value) {
  12431. return value == null;
  12432. }
  12433. /**
  12434. * Checks if `value` is classified as a `Number` primitive or object.
  12435. *
  12436. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12437. * classified as numbers, use the `_.isFinite` method.
  12438. *
  12439. * @static
  12440. * @memberOf _
  12441. * @since 0.1.0
  12442. * @category Lang
  12443. * @param {*} value The value to check.
  12444. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12445. * @example
  12446. *
  12447. * _.isNumber(3);
  12448. * // => true
  12449. *
  12450. * _.isNumber(Number.MIN_VALUE);
  12451. * // => true
  12452. *
  12453. * _.isNumber(Infinity);
  12454. * // => true
  12455. *
  12456. * _.isNumber('3');
  12457. * // => false
  12458. */
  12459. function isNumber(value) {
  12460. return typeof value == 'number' ||
  12461. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12462. }
  12463. /**
  12464. * Checks if `value` is a plain object, that is, an object created by the
  12465. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12466. *
  12467. * @static
  12468. * @memberOf _
  12469. * @since 0.8.0
  12470. * @category Lang
  12471. * @param {*} value The value to check.
  12472. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12473. * @example
  12474. *
  12475. * function Foo() {
  12476. * this.a = 1;
  12477. * }
  12478. *
  12479. * _.isPlainObject(new Foo);
  12480. * // => false
  12481. *
  12482. * _.isPlainObject([1, 2, 3]);
  12483. * // => false
  12484. *
  12485. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12486. * // => true
  12487. *
  12488. * _.isPlainObject(Object.create(null));
  12489. * // => true
  12490. */
  12491. function isPlainObject(value) {
  12492. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12493. return false;
  12494. }
  12495. var proto = getPrototype(value);
  12496. if (proto === null) {
  12497. return true;
  12498. }
  12499. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12500. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12501. funcToString.call(Ctor) == objectCtorString;
  12502. }
  12503. /**
  12504. * Checks if `value` is classified as a `RegExp` object.
  12505. *
  12506. * @static
  12507. * @memberOf _
  12508. * @since 0.1.0
  12509. * @category Lang
  12510. * @param {*} value The value to check.
  12511. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12512. * @example
  12513. *
  12514. * _.isRegExp(/abc/);
  12515. * // => true
  12516. *
  12517. * _.isRegExp('/abc/');
  12518. * // => false
  12519. */
  12520. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12521. /**
  12522. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12523. * double precision number which isn't the result of a rounded unsafe integer.
  12524. *
  12525. * **Note:** This method is based on
  12526. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12527. *
  12528. * @static
  12529. * @memberOf _
  12530. * @since 4.0.0
  12531. * @category Lang
  12532. * @param {*} value The value to check.
  12533. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12534. * @example
  12535. *
  12536. * _.isSafeInteger(3);
  12537. * // => true
  12538. *
  12539. * _.isSafeInteger(Number.MIN_VALUE);
  12540. * // => false
  12541. *
  12542. * _.isSafeInteger(Infinity);
  12543. * // => false
  12544. *
  12545. * _.isSafeInteger('3');
  12546. * // => false
  12547. */
  12548. function isSafeInteger(value) {
  12549. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12550. }
  12551. /**
  12552. * Checks if `value` is classified as a `Set` object.
  12553. *
  12554. * @static
  12555. * @memberOf _
  12556. * @since 4.3.0
  12557. * @category Lang
  12558. * @param {*} value The value to check.
  12559. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12560. * @example
  12561. *
  12562. * _.isSet(new Set);
  12563. * // => true
  12564. *
  12565. * _.isSet(new WeakSet);
  12566. * // => false
  12567. */
  12568. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12569. /**
  12570. * Checks if `value` is classified as a `String` primitive or object.
  12571. *
  12572. * @static
  12573. * @since 0.1.0
  12574. * @memberOf _
  12575. * @category Lang
  12576. * @param {*} value The value to check.
  12577. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12578. * @example
  12579. *
  12580. * _.isString('abc');
  12581. * // => true
  12582. *
  12583. * _.isString(1);
  12584. * // => false
  12585. */
  12586. function isString(value) {
  12587. return typeof value == 'string' ||
  12588. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12589. }
  12590. /**
  12591. * Checks if `value` is classified as a `Symbol` primitive or object.
  12592. *
  12593. * @static
  12594. * @memberOf _
  12595. * @since 4.0.0
  12596. * @category Lang
  12597. * @param {*} value The value to check.
  12598. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12599. * @example
  12600. *
  12601. * _.isSymbol(Symbol.iterator);
  12602. * // => true
  12603. *
  12604. * _.isSymbol('abc');
  12605. * // => false
  12606. */
  12607. function isSymbol(value) {
  12608. return typeof value == 'symbol' ||
  12609. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12610. }
  12611. /**
  12612. * Checks if `value` is classified as a typed array.
  12613. *
  12614. * @static
  12615. * @memberOf _
  12616. * @since 3.0.0
  12617. * @category Lang
  12618. * @param {*} value The value to check.
  12619. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12620. * @example
  12621. *
  12622. * _.isTypedArray(new Uint8Array);
  12623. * // => true
  12624. *
  12625. * _.isTypedArray([]);
  12626. * // => false
  12627. */
  12628. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12629. /**
  12630. * Checks if `value` is `undefined`.
  12631. *
  12632. * @static
  12633. * @since 0.1.0
  12634. * @memberOf _
  12635. * @category Lang
  12636. * @param {*} value The value to check.
  12637. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12638. * @example
  12639. *
  12640. * _.isUndefined(void 0);
  12641. * // => true
  12642. *
  12643. * _.isUndefined(null);
  12644. * // => false
  12645. */
  12646. function isUndefined(value) {
  12647. return value === undefined;
  12648. }
  12649. /**
  12650. * Checks if `value` is classified as a `WeakMap` object.
  12651. *
  12652. * @static
  12653. * @memberOf _
  12654. * @since 4.3.0
  12655. * @category Lang
  12656. * @param {*} value The value to check.
  12657. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12658. * @example
  12659. *
  12660. * _.isWeakMap(new WeakMap);
  12661. * // => true
  12662. *
  12663. * _.isWeakMap(new Map);
  12664. * // => false
  12665. */
  12666. function isWeakMap(value) {
  12667. return isObjectLike(value) && getTag(value) == weakMapTag;
  12668. }
  12669. /**
  12670. * Checks if `value` is classified as a `WeakSet` object.
  12671. *
  12672. * @static
  12673. * @memberOf _
  12674. * @since 4.3.0
  12675. * @category Lang
  12676. * @param {*} value The value to check.
  12677. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12678. * @example
  12679. *
  12680. * _.isWeakSet(new WeakSet);
  12681. * // => true
  12682. *
  12683. * _.isWeakSet(new Set);
  12684. * // => false
  12685. */
  12686. function isWeakSet(value) {
  12687. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12688. }
  12689. /**
  12690. * Checks if `value` is less than `other`.
  12691. *
  12692. * @static
  12693. * @memberOf _
  12694. * @since 3.9.0
  12695. * @category Lang
  12696. * @param {*} value The value to compare.
  12697. * @param {*} other The other value to compare.
  12698. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12699. * else `false`.
  12700. * @see _.gt
  12701. * @example
  12702. *
  12703. * _.lt(1, 3);
  12704. * // => true
  12705. *
  12706. * _.lt(3, 3);
  12707. * // => false
  12708. *
  12709. * _.lt(3, 1);
  12710. * // => false
  12711. */
  12712. var lt = createRelationalOperation(baseLt);
  12713. /**
  12714. * Checks if `value` is less than or equal to `other`.
  12715. *
  12716. * @static
  12717. * @memberOf _
  12718. * @since 3.9.0
  12719. * @category Lang
  12720. * @param {*} value The value to compare.
  12721. * @param {*} other The other value to compare.
  12722. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12723. * `other`, else `false`.
  12724. * @see _.gte
  12725. * @example
  12726. *
  12727. * _.lte(1, 3);
  12728. * // => true
  12729. *
  12730. * _.lte(3, 3);
  12731. * // => true
  12732. *
  12733. * _.lte(3, 1);
  12734. * // => false
  12735. */
  12736. var lte = createRelationalOperation(function(value, other) {
  12737. return value <= other;
  12738. });
  12739. /**
  12740. * Converts `value` to an array.
  12741. *
  12742. * @static
  12743. * @since 0.1.0
  12744. * @memberOf _
  12745. * @category Lang
  12746. * @param {*} value The value to convert.
  12747. * @returns {Array} Returns the converted array.
  12748. * @example
  12749. *
  12750. * _.toArray({ 'a': 1, 'b': 2 });
  12751. * // => [1, 2]
  12752. *
  12753. * _.toArray('abc');
  12754. * // => ['a', 'b', 'c']
  12755. *
  12756. * _.toArray(1);
  12757. * // => []
  12758. *
  12759. * _.toArray(null);
  12760. * // => []
  12761. */
  12762. function toArray(value) {
  12763. if (!value) {
  12764. return [];
  12765. }
  12766. if (isArrayLike(value)) {
  12767. return isString(value) ? stringToArray(value) : copyArray(value);
  12768. }
  12769. if (symIterator && value[symIterator]) {
  12770. return iteratorToArray(value[symIterator]());
  12771. }
  12772. var tag = getTag(value),
  12773. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12774. return func(value);
  12775. }
  12776. /**
  12777. * Converts `value` to a finite number.
  12778. *
  12779. * @static
  12780. * @memberOf _
  12781. * @since 4.12.0
  12782. * @category Lang
  12783. * @param {*} value The value to convert.
  12784. * @returns {number} Returns the converted number.
  12785. * @example
  12786. *
  12787. * _.toFinite(3.2);
  12788. * // => 3.2
  12789. *
  12790. * _.toFinite(Number.MIN_VALUE);
  12791. * // => 5e-324
  12792. *
  12793. * _.toFinite(Infinity);
  12794. * // => 1.7976931348623157e+308
  12795. *
  12796. * _.toFinite('3.2');
  12797. * // => 3.2
  12798. */
  12799. function toFinite(value) {
  12800. if (!value) {
  12801. return value === 0 ? value : 0;
  12802. }
  12803. value = toNumber(value);
  12804. if (value === INFINITY || value === -INFINITY) {
  12805. var sign = (value < 0 ? -1 : 1);
  12806. return sign * MAX_INTEGER;
  12807. }
  12808. return value === value ? value : 0;
  12809. }
  12810. /**
  12811. * Converts `value` to an integer.
  12812. *
  12813. * **Note:** This method is loosely based on
  12814. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12815. *
  12816. * @static
  12817. * @memberOf _
  12818. * @since 4.0.0
  12819. * @category Lang
  12820. * @param {*} value The value to convert.
  12821. * @returns {number} Returns the converted integer.
  12822. * @example
  12823. *
  12824. * _.toInteger(3.2);
  12825. * // => 3
  12826. *
  12827. * _.toInteger(Number.MIN_VALUE);
  12828. * // => 0
  12829. *
  12830. * _.toInteger(Infinity);
  12831. * // => 1.7976931348623157e+308
  12832. *
  12833. * _.toInteger('3.2');
  12834. * // => 3
  12835. */
  12836. function toInteger(value) {
  12837. var result = toFinite(value),
  12838. remainder = result % 1;
  12839. return result === result ? (remainder ? result - remainder : result) : 0;
  12840. }
  12841. /**
  12842. * Converts `value` to an integer suitable for use as the length of an
  12843. * array-like object.
  12844. *
  12845. * **Note:** This method is based on
  12846. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12847. *
  12848. * @static
  12849. * @memberOf _
  12850. * @since 4.0.0
  12851. * @category Lang
  12852. * @param {*} value The value to convert.
  12853. * @returns {number} Returns the converted integer.
  12854. * @example
  12855. *
  12856. * _.toLength(3.2);
  12857. * // => 3
  12858. *
  12859. * _.toLength(Number.MIN_VALUE);
  12860. * // => 0
  12861. *
  12862. * _.toLength(Infinity);
  12863. * // => 4294967295
  12864. *
  12865. * _.toLength('3.2');
  12866. * // => 3
  12867. */
  12868. function toLength(value) {
  12869. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12870. }
  12871. /**
  12872. * Converts `value` to a number.
  12873. *
  12874. * @static
  12875. * @memberOf _
  12876. * @since 4.0.0
  12877. * @category Lang
  12878. * @param {*} value The value to process.
  12879. * @returns {number} Returns the number.
  12880. * @example
  12881. *
  12882. * _.toNumber(3.2);
  12883. * // => 3.2
  12884. *
  12885. * _.toNumber(Number.MIN_VALUE);
  12886. * // => 5e-324
  12887. *
  12888. * _.toNumber(Infinity);
  12889. * // => Infinity
  12890. *
  12891. * _.toNumber('3.2');
  12892. * // => 3.2
  12893. */
  12894. function toNumber(value) {
  12895. if (typeof value == 'number') {
  12896. return value;
  12897. }
  12898. if (isSymbol(value)) {
  12899. return NAN;
  12900. }
  12901. if (isObject(value)) {
  12902. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12903. value = isObject(other) ? (other + '') : other;
  12904. }
  12905. if (typeof value != 'string') {
  12906. return value === 0 ? value : +value;
  12907. }
  12908. value = baseTrim(value);
  12909. var isBinary = reIsBinary.test(value);
  12910. return (isBinary || reIsOctal.test(value))
  12911. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12912. : (reIsBadHex.test(value) ? NAN : +value);
  12913. }
  12914. /**
  12915. * Converts `value` to a plain object flattening inherited enumerable string
  12916. * keyed properties of `value` to own properties of the plain object.
  12917. *
  12918. * @static
  12919. * @memberOf _
  12920. * @since 3.0.0
  12921. * @category Lang
  12922. * @param {*} value The value to convert.
  12923. * @returns {Object} Returns the converted plain object.
  12924. * @example
  12925. *
  12926. * function Foo() {
  12927. * this.b = 2;
  12928. * }
  12929. *
  12930. * Foo.prototype.c = 3;
  12931. *
  12932. * _.assign({ 'a': 1 }, new Foo);
  12933. * // => { 'a': 1, 'b': 2 }
  12934. *
  12935. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12936. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12937. */
  12938. function toPlainObject(value) {
  12939. return copyObject(value, keysIn(value));
  12940. }
  12941. /**
  12942. * Converts `value` to a safe integer. A safe integer can be compared and
  12943. * represented correctly.
  12944. *
  12945. * @static
  12946. * @memberOf _
  12947. * @since 4.0.0
  12948. * @category Lang
  12949. * @param {*} value The value to convert.
  12950. * @returns {number} Returns the converted integer.
  12951. * @example
  12952. *
  12953. * _.toSafeInteger(3.2);
  12954. * // => 3
  12955. *
  12956. * _.toSafeInteger(Number.MIN_VALUE);
  12957. * // => 0
  12958. *
  12959. * _.toSafeInteger(Infinity);
  12960. * // => 9007199254740991
  12961. *
  12962. * _.toSafeInteger('3.2');
  12963. * // => 3
  12964. */
  12965. function toSafeInteger(value) {
  12966. return value
  12967. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12968. : (value === 0 ? value : 0);
  12969. }
  12970. /**
  12971. * Converts `value` to a string. An empty string is returned for `null`
  12972. * and `undefined` values. The sign of `-0` is preserved.
  12973. *
  12974. * @static
  12975. * @memberOf _
  12976. * @since 4.0.0
  12977. * @category Lang
  12978. * @param {*} value The value to convert.
  12979. * @returns {string} Returns the converted string.
  12980. * @example
  12981. *
  12982. * _.toString(null);
  12983. * // => ''
  12984. *
  12985. * _.toString(-0);
  12986. * // => '-0'
  12987. *
  12988. * _.toString([1, 2, 3]);
  12989. * // => '1,2,3'
  12990. */
  12991. function toString(value) {
  12992. return value == null ? '' : baseToString(value);
  12993. }
  12994. /*------------------------------------------------------------------------*/
  12995. /**
  12996. * Assigns own enumerable string keyed properties of source objects to the
  12997. * destination object. Source objects are applied from left to right.
  12998. * Subsequent sources overwrite property assignments of previous sources.
  12999. *
  13000. * **Note:** This method mutates `object` and is loosely based on
  13001. * [`Object.assign`](https://mdn.io/Object/assign).
  13002. *
  13003. * @static
  13004. * @memberOf _
  13005. * @since 0.10.0
  13006. * @category Object
  13007. * @param {Object} object The destination object.
  13008. * @param {...Object} [sources] The source objects.
  13009. * @returns {Object} Returns `object`.
  13010. * @see _.assignIn
  13011. * @example
  13012. *
  13013. * function Foo() {
  13014. * this.a = 1;
  13015. * }
  13016. *
  13017. * function Bar() {
  13018. * this.c = 3;
  13019. * }
  13020. *
  13021. * Foo.prototype.b = 2;
  13022. * Bar.prototype.d = 4;
  13023. *
  13024. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13025. * // => { 'a': 1, 'c': 3 }
  13026. */
  13027. var assign = createAssigner(function(object, source) {
  13028. if (isPrototype(source) || isArrayLike(source)) {
  13029. copyObject(source, keys(source), object);
  13030. return;
  13031. }
  13032. for (var key in source) {
  13033. if (hasOwnProperty.call(source, key)) {
  13034. assignValue(object, key, source[key]);
  13035. }
  13036. }
  13037. });
  13038. /**
  13039. * This method is like `_.assign` except that it iterates over own and
  13040. * inherited source properties.
  13041. *
  13042. * **Note:** This method mutates `object`.
  13043. *
  13044. * @static
  13045. * @memberOf _
  13046. * @since 4.0.0
  13047. * @alias extend
  13048. * @category Object
  13049. * @param {Object} object The destination object.
  13050. * @param {...Object} [sources] The source objects.
  13051. * @returns {Object} Returns `object`.
  13052. * @see _.assign
  13053. * @example
  13054. *
  13055. * function Foo() {
  13056. * this.a = 1;
  13057. * }
  13058. *
  13059. * function Bar() {
  13060. * this.c = 3;
  13061. * }
  13062. *
  13063. * Foo.prototype.b = 2;
  13064. * Bar.prototype.d = 4;
  13065. *
  13066. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13067. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13068. */
  13069. var assignIn = createAssigner(function(object, source) {
  13070. copyObject(source, keysIn(source), object);
  13071. });
  13072. /**
  13073. * This method is like `_.assignIn` except that it accepts `customizer`
  13074. * which is invoked to produce the assigned values. If `customizer` returns
  13075. * `undefined`, assignment is handled by the method instead. The `customizer`
  13076. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13077. *
  13078. * **Note:** This method mutates `object`.
  13079. *
  13080. * @static
  13081. * @memberOf _
  13082. * @since 4.0.0
  13083. * @alias extendWith
  13084. * @category Object
  13085. * @param {Object} object The destination object.
  13086. * @param {...Object} sources The source objects.
  13087. * @param {Function} [customizer] The function to customize assigned values.
  13088. * @returns {Object} Returns `object`.
  13089. * @see _.assignWith
  13090. * @example
  13091. *
  13092. * function customizer(objValue, srcValue) {
  13093. * return _.isUndefined(objValue) ? srcValue : objValue;
  13094. * }
  13095. *
  13096. * var defaults = _.partialRight(_.assignInWith, customizer);
  13097. *
  13098. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13099. * // => { 'a': 1, 'b': 2 }
  13100. */
  13101. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13102. copyObject(source, keysIn(source), object, customizer);
  13103. });
  13104. /**
  13105. * This method is like `_.assign` except that it accepts `customizer`
  13106. * which is invoked to produce the assigned values. If `customizer` returns
  13107. * `undefined`, assignment is handled by the method instead. The `customizer`
  13108. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13109. *
  13110. * **Note:** This method mutates `object`.
  13111. *
  13112. * @static
  13113. * @memberOf _
  13114. * @since 4.0.0
  13115. * @category Object
  13116. * @param {Object} object The destination object.
  13117. * @param {...Object} sources The source objects.
  13118. * @param {Function} [customizer] The function to customize assigned values.
  13119. * @returns {Object} Returns `object`.
  13120. * @see _.assignInWith
  13121. * @example
  13122. *
  13123. * function customizer(objValue, srcValue) {
  13124. * return _.isUndefined(objValue) ? srcValue : objValue;
  13125. * }
  13126. *
  13127. * var defaults = _.partialRight(_.assignWith, customizer);
  13128. *
  13129. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13130. * // => { 'a': 1, 'b': 2 }
  13131. */
  13132. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13133. copyObject(source, keys(source), object, customizer);
  13134. });
  13135. /**
  13136. * Creates an array of values corresponding to `paths` of `object`.
  13137. *
  13138. * @static
  13139. * @memberOf _
  13140. * @since 1.0.0
  13141. * @category Object
  13142. * @param {Object} object The object to iterate over.
  13143. * @param {...(string|string[])} [paths] The property paths to pick.
  13144. * @returns {Array} Returns the picked values.
  13145. * @example
  13146. *
  13147. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13148. *
  13149. * _.at(object, ['a[0].b.c', 'a[1]']);
  13150. * // => [3, 4]
  13151. */
  13152. var at = flatRest(baseAt);
  13153. /**
  13154. * Creates an object that inherits from the `prototype` object. If a
  13155. * `properties` object is given, its own enumerable string keyed properties
  13156. * are assigned to the created object.
  13157. *
  13158. * @static
  13159. * @memberOf _
  13160. * @since 2.3.0
  13161. * @category Object
  13162. * @param {Object} prototype The object to inherit from.
  13163. * @param {Object} [properties] The properties to assign to the object.
  13164. * @returns {Object} Returns the new object.
  13165. * @example
  13166. *
  13167. * function Shape() {
  13168. * this.x = 0;
  13169. * this.y = 0;
  13170. * }
  13171. *
  13172. * function Circle() {
  13173. * Shape.call(this);
  13174. * }
  13175. *
  13176. * Circle.prototype = _.create(Shape.prototype, {
  13177. * 'constructor': Circle
  13178. * });
  13179. *
  13180. * var circle = new Circle;
  13181. * circle instanceof Circle;
  13182. * // => true
  13183. *
  13184. * circle instanceof Shape;
  13185. * // => true
  13186. */
  13187. function create(prototype, properties) {
  13188. var result = baseCreate(prototype);
  13189. return properties == null ? result : baseAssign(result, properties);
  13190. }
  13191. /**
  13192. * Assigns own and inherited enumerable string keyed properties of source
  13193. * objects to the destination object for all destination properties that
  13194. * resolve to `undefined`. Source objects are applied from left to right.
  13195. * Once a property is set, additional values of the same property are ignored.
  13196. *
  13197. * **Note:** This method mutates `object`.
  13198. *
  13199. * @static
  13200. * @since 0.1.0
  13201. * @memberOf _
  13202. * @category Object
  13203. * @param {Object} object The destination object.
  13204. * @param {...Object} [sources] The source objects.
  13205. * @returns {Object} Returns `object`.
  13206. * @see _.defaultsDeep
  13207. * @example
  13208. *
  13209. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13210. * // => { 'a': 1, 'b': 2 }
  13211. */
  13212. var defaults = baseRest(function(object, sources) {
  13213. object = Object(object);
  13214. var index = -1;
  13215. var length = sources.length;
  13216. var guard = length > 2 ? sources[2] : undefined;
  13217. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13218. length = 1;
  13219. }
  13220. while (++index < length) {
  13221. var source = sources[index];
  13222. var props = keysIn(source);
  13223. var propsIndex = -1;
  13224. var propsLength = props.length;
  13225. while (++propsIndex < propsLength) {
  13226. var key = props[propsIndex];
  13227. var value = object[key];
  13228. if (value === undefined ||
  13229. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13230. object[key] = source[key];
  13231. }
  13232. }
  13233. }
  13234. return object;
  13235. });
  13236. /**
  13237. * This method is like `_.defaults` except that it recursively assigns
  13238. * default properties.
  13239. *
  13240. * **Note:** This method mutates `object`.
  13241. *
  13242. * @static
  13243. * @memberOf _
  13244. * @since 3.10.0
  13245. * @category Object
  13246. * @param {Object} object The destination object.
  13247. * @param {...Object} [sources] The source objects.
  13248. * @returns {Object} Returns `object`.
  13249. * @see _.defaults
  13250. * @example
  13251. *
  13252. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13253. * // => { 'a': { 'b': 2, 'c': 3 } }
  13254. */
  13255. var defaultsDeep = baseRest(function(args) {
  13256. args.push(undefined, customDefaultsMerge);
  13257. return apply(mergeWith, undefined, args);
  13258. });
  13259. /**
  13260. * This method is like `_.find` except that it returns the key of the first
  13261. * element `predicate` returns truthy for instead of the element itself.
  13262. *
  13263. * @static
  13264. * @memberOf _
  13265. * @since 1.1.0
  13266. * @category Object
  13267. * @param {Object} object The object to inspect.
  13268. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13269. * @returns {string|undefined} Returns the key of the matched element,
  13270. * else `undefined`.
  13271. * @example
  13272. *
  13273. * var users = {
  13274. * 'barney': { 'age': 36, 'active': true },
  13275. * 'fred': { 'age': 40, 'active': false },
  13276. * 'pebbles': { 'age': 1, 'active': true }
  13277. * };
  13278. *
  13279. * _.findKey(users, function(o) { return o.age < 40; });
  13280. * // => 'barney' (iteration order is not guaranteed)
  13281. *
  13282. * // The `_.matches` iteratee shorthand.
  13283. * _.findKey(users, { 'age': 1, 'active': true });
  13284. * // => 'pebbles'
  13285. *
  13286. * // The `_.matchesProperty` iteratee shorthand.
  13287. * _.findKey(users, ['active', false]);
  13288. * // => 'fred'
  13289. *
  13290. * // The `_.property` iteratee shorthand.
  13291. * _.findKey(users, 'active');
  13292. * // => 'barney'
  13293. */
  13294. function findKey(object, predicate) {
  13295. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13296. }
  13297. /**
  13298. * This method is like `_.findKey` except that it iterates over elements of
  13299. * a collection in the opposite order.
  13300. *
  13301. * @static
  13302. * @memberOf _
  13303. * @since 2.0.0
  13304. * @category Object
  13305. * @param {Object} object The object to inspect.
  13306. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13307. * @returns {string|undefined} Returns the key of the matched element,
  13308. * else `undefined`.
  13309. * @example
  13310. *
  13311. * var users = {
  13312. * 'barney': { 'age': 36, 'active': true },
  13313. * 'fred': { 'age': 40, 'active': false },
  13314. * 'pebbles': { 'age': 1, 'active': true }
  13315. * };
  13316. *
  13317. * _.findLastKey(users, function(o) { return o.age < 40; });
  13318. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13319. *
  13320. * // The `_.matches` iteratee shorthand.
  13321. * _.findLastKey(users, { 'age': 36, 'active': true });
  13322. * // => 'barney'
  13323. *
  13324. * // The `_.matchesProperty` iteratee shorthand.
  13325. * _.findLastKey(users, ['active', false]);
  13326. * // => 'fred'
  13327. *
  13328. * // The `_.property` iteratee shorthand.
  13329. * _.findLastKey(users, 'active');
  13330. * // => 'pebbles'
  13331. */
  13332. function findLastKey(object, predicate) {
  13333. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13334. }
  13335. /**
  13336. * Iterates over own and inherited enumerable string keyed properties of an
  13337. * object and invokes `iteratee` for each property. The iteratee is invoked
  13338. * with three arguments: (value, key, object). Iteratee functions may exit
  13339. * iteration early by explicitly returning `false`.
  13340. *
  13341. * @static
  13342. * @memberOf _
  13343. * @since 0.3.0
  13344. * @category Object
  13345. * @param {Object} object The object to iterate over.
  13346. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13347. * @returns {Object} Returns `object`.
  13348. * @see _.forInRight
  13349. * @example
  13350. *
  13351. * function Foo() {
  13352. * this.a = 1;
  13353. * this.b = 2;
  13354. * }
  13355. *
  13356. * Foo.prototype.c = 3;
  13357. *
  13358. * _.forIn(new Foo, function(value, key) {
  13359. * console.log(key);
  13360. * });
  13361. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13362. */
  13363. function forIn(object, iteratee) {
  13364. return object == null
  13365. ? object
  13366. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13367. }
  13368. /**
  13369. * This method is like `_.forIn` except that it iterates over properties of
  13370. * `object` in the opposite order.
  13371. *
  13372. * @static
  13373. * @memberOf _
  13374. * @since 2.0.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 _.forIn
  13380. * @example
  13381. *
  13382. * function Foo() {
  13383. * this.a = 1;
  13384. * this.b = 2;
  13385. * }
  13386. *
  13387. * Foo.prototype.c = 3;
  13388. *
  13389. * _.forInRight(new Foo, function(value, key) {
  13390. * console.log(key);
  13391. * });
  13392. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13393. */
  13394. function forInRight(object, iteratee) {
  13395. return object == null
  13396. ? object
  13397. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13398. }
  13399. /**
  13400. * Iterates over own enumerable string keyed properties of an object and
  13401. * invokes `iteratee` for each property. The iteratee is invoked with three
  13402. * arguments: (value, key, object). Iteratee functions may exit iteration
  13403. * early by explicitly returning `false`.
  13404. *
  13405. * @static
  13406. * @memberOf _
  13407. * @since 0.3.0
  13408. * @category Object
  13409. * @param {Object} object The object to iterate over.
  13410. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13411. * @returns {Object} Returns `object`.
  13412. * @see _.forOwnRight
  13413. * @example
  13414. *
  13415. * function Foo() {
  13416. * this.a = 1;
  13417. * this.b = 2;
  13418. * }
  13419. *
  13420. * Foo.prototype.c = 3;
  13421. *
  13422. * _.forOwn(new Foo, function(value, key) {
  13423. * console.log(key);
  13424. * });
  13425. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13426. */
  13427. function forOwn(object, iteratee) {
  13428. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13429. }
  13430. /**
  13431. * This method is like `_.forOwn` except that it iterates over properties of
  13432. * `object` in the opposite order.
  13433. *
  13434. * @static
  13435. * @memberOf _
  13436. * @since 2.0.0
  13437. * @category Object
  13438. * @param {Object} object The object to iterate over.
  13439. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13440. * @returns {Object} Returns `object`.
  13441. * @see _.forOwn
  13442. * @example
  13443. *
  13444. * function Foo() {
  13445. * this.a = 1;
  13446. * this.b = 2;
  13447. * }
  13448. *
  13449. * Foo.prototype.c = 3;
  13450. *
  13451. * _.forOwnRight(new Foo, function(value, key) {
  13452. * console.log(key);
  13453. * });
  13454. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13455. */
  13456. function forOwnRight(object, iteratee) {
  13457. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13458. }
  13459. /**
  13460. * Creates an array of function property names from own enumerable properties
  13461. * of `object`.
  13462. *
  13463. * @static
  13464. * @since 0.1.0
  13465. * @memberOf _
  13466. * @category Object
  13467. * @param {Object} object The object to inspect.
  13468. * @returns {Array} Returns the function names.
  13469. * @see _.functionsIn
  13470. * @example
  13471. *
  13472. * function Foo() {
  13473. * this.a = _.constant('a');
  13474. * this.b = _.constant('b');
  13475. * }
  13476. *
  13477. * Foo.prototype.c = _.constant('c');
  13478. *
  13479. * _.functions(new Foo);
  13480. * // => ['a', 'b']
  13481. */
  13482. function functions(object) {
  13483. return object == null ? [] : baseFunctions(object, keys(object));
  13484. }
  13485. /**
  13486. * Creates an array of function property names from own and inherited
  13487. * enumerable properties of `object`.
  13488. *
  13489. * @static
  13490. * @memberOf _
  13491. * @since 4.0.0
  13492. * @category Object
  13493. * @param {Object} object The object to inspect.
  13494. * @returns {Array} Returns the function names.
  13495. * @see _.functions
  13496. * @example
  13497. *
  13498. * function Foo() {
  13499. * this.a = _.constant('a');
  13500. * this.b = _.constant('b');
  13501. * }
  13502. *
  13503. * Foo.prototype.c = _.constant('c');
  13504. *
  13505. * _.functionsIn(new Foo);
  13506. * // => ['a', 'b', 'c']
  13507. */
  13508. function functionsIn(object) {
  13509. return object == null ? [] : baseFunctions(object, keysIn(object));
  13510. }
  13511. /**
  13512. * Gets the value at `path` of `object`. If the resolved value is
  13513. * `undefined`, the `defaultValue` is returned in its place.
  13514. *
  13515. * @static
  13516. * @memberOf _
  13517. * @since 3.7.0
  13518. * @category Object
  13519. * @param {Object} object The object to query.
  13520. * @param {Array|string} path The path of the property to get.
  13521. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13522. * @returns {*} Returns the resolved value.
  13523. * @example
  13524. *
  13525. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13526. *
  13527. * _.get(object, 'a[0].b.c');
  13528. * // => 3
  13529. *
  13530. * _.get(object, ['a', '0', 'b', 'c']);
  13531. * // => 3
  13532. *
  13533. * _.get(object, 'a.b.c', 'default');
  13534. * // => 'default'
  13535. */
  13536. function get(object, path, defaultValue) {
  13537. var result = object == null ? undefined : baseGet(object, path);
  13538. return result === undefined ? defaultValue : result;
  13539. }
  13540. /**
  13541. * Checks if `path` is a direct property of `object`.
  13542. *
  13543. * @static
  13544. * @since 0.1.0
  13545. * @memberOf _
  13546. * @category Object
  13547. * @param {Object} object The object to query.
  13548. * @param {Array|string} path The path to check.
  13549. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13550. * @example
  13551. *
  13552. * var object = { 'a': { 'b': 2 } };
  13553. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13554. *
  13555. * _.has(object, 'a');
  13556. * // => true
  13557. *
  13558. * _.has(object, 'a.b');
  13559. * // => true
  13560. *
  13561. * _.has(object, ['a', 'b']);
  13562. * // => true
  13563. *
  13564. * _.has(other, 'a');
  13565. * // => false
  13566. */
  13567. function has(object, path) {
  13568. return object != null && hasPath(object, path, baseHas);
  13569. }
  13570. /**
  13571. * Checks if `path` is a direct or inherited property of `object`.
  13572. *
  13573. * @static
  13574. * @memberOf _
  13575. * @since 4.0.0
  13576. * @category Object
  13577. * @param {Object} object The object to query.
  13578. * @param {Array|string} path The path to check.
  13579. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13580. * @example
  13581. *
  13582. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13583. *
  13584. * _.hasIn(object, 'a');
  13585. * // => true
  13586. *
  13587. * _.hasIn(object, 'a.b');
  13588. * // => true
  13589. *
  13590. * _.hasIn(object, ['a', 'b']);
  13591. * // => true
  13592. *
  13593. * _.hasIn(object, 'b');
  13594. * // => false
  13595. */
  13596. function hasIn(object, path) {
  13597. return object != null && hasPath(object, path, baseHasIn);
  13598. }
  13599. /**
  13600. * Creates an object composed of the inverted keys and values of `object`.
  13601. * If `object` contains duplicate values, subsequent values overwrite
  13602. * property assignments of previous values.
  13603. *
  13604. * @static
  13605. * @memberOf _
  13606. * @since 0.7.0
  13607. * @category Object
  13608. * @param {Object} object The object to invert.
  13609. * @returns {Object} Returns the new inverted object.
  13610. * @example
  13611. *
  13612. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13613. *
  13614. * _.invert(object);
  13615. * // => { '1': 'c', '2': 'b' }
  13616. */
  13617. var invert = createInverter(function(result, value, key) {
  13618. if (value != null &&
  13619. typeof value.toString != 'function') {
  13620. value = nativeObjectToString.call(value);
  13621. }
  13622. result[value] = key;
  13623. }, constant(identity));
  13624. /**
  13625. * This method is like `_.invert` except that the inverted object is generated
  13626. * from the results of running each element of `object` thru `iteratee`. The
  13627. * corresponding inverted value of each inverted key is an array of keys
  13628. * responsible for generating the inverted value. The iteratee is invoked
  13629. * with one argument: (value).
  13630. *
  13631. * @static
  13632. * @memberOf _
  13633. * @since 4.1.0
  13634. * @category Object
  13635. * @param {Object} object The object to invert.
  13636. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13637. * @returns {Object} Returns the new inverted object.
  13638. * @example
  13639. *
  13640. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13641. *
  13642. * _.invertBy(object);
  13643. * // => { '1': ['a', 'c'], '2': ['b'] }
  13644. *
  13645. * _.invertBy(object, function(value) {
  13646. * return 'group' + value;
  13647. * });
  13648. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13649. */
  13650. var invertBy = createInverter(function(result, value, key) {
  13651. if (value != null &&
  13652. typeof value.toString != 'function') {
  13653. value = nativeObjectToString.call(value);
  13654. }
  13655. if (hasOwnProperty.call(result, value)) {
  13656. result[value].push(key);
  13657. } else {
  13658. result[value] = [key];
  13659. }
  13660. }, getIteratee);
  13661. /**
  13662. * Invokes the method at `path` of `object`.
  13663. *
  13664. * @static
  13665. * @memberOf _
  13666. * @since 4.0.0
  13667. * @category Object
  13668. * @param {Object} object The object to query.
  13669. * @param {Array|string} path The path of the method to invoke.
  13670. * @param {...*} [args] The arguments to invoke the method with.
  13671. * @returns {*} Returns the result of the invoked method.
  13672. * @example
  13673. *
  13674. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13675. *
  13676. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13677. * // => [2, 3]
  13678. */
  13679. var invoke = baseRest(baseInvoke);
  13680. /**
  13681. * Creates an array of the own enumerable property names of `object`.
  13682. *
  13683. * **Note:** Non-object values are coerced to objects. See the
  13684. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13685. * for more details.
  13686. *
  13687. * @static
  13688. * @since 0.1.0
  13689. * @memberOf _
  13690. * @category Object
  13691. * @param {Object} object The object to query.
  13692. * @returns {Array} Returns the array of property names.
  13693. * @example
  13694. *
  13695. * function Foo() {
  13696. * this.a = 1;
  13697. * this.b = 2;
  13698. * }
  13699. *
  13700. * Foo.prototype.c = 3;
  13701. *
  13702. * _.keys(new Foo);
  13703. * // => ['a', 'b'] (iteration order is not guaranteed)
  13704. *
  13705. * _.keys('hi');
  13706. * // => ['0', '1']
  13707. */
  13708. function keys(object) {
  13709. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13710. }
  13711. /**
  13712. * Creates an array of the own and inherited enumerable property names of `object`.
  13713. *
  13714. * **Note:** Non-object values are coerced to objects.
  13715. *
  13716. * @static
  13717. * @memberOf _
  13718. * @since 3.0.0
  13719. * @category Object
  13720. * @param {Object} object The object to query.
  13721. * @returns {Array} Returns the array of property names.
  13722. * @example
  13723. *
  13724. * function Foo() {
  13725. * this.a = 1;
  13726. * this.b = 2;
  13727. * }
  13728. *
  13729. * Foo.prototype.c = 3;
  13730. *
  13731. * _.keysIn(new Foo);
  13732. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13733. */
  13734. function keysIn(object) {
  13735. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13736. }
  13737. /**
  13738. * The opposite of `_.mapValues`; this method creates an object with the
  13739. * same values as `object` and keys generated by running each own enumerable
  13740. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13741. * with three arguments: (value, key, object).
  13742. *
  13743. * @static
  13744. * @memberOf _
  13745. * @since 3.8.0
  13746. * @category Object
  13747. * @param {Object} object The object to iterate over.
  13748. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13749. * @returns {Object} Returns the new mapped object.
  13750. * @see _.mapValues
  13751. * @example
  13752. *
  13753. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13754. * return key + value;
  13755. * });
  13756. * // => { 'a1': 1, 'b2': 2 }
  13757. */
  13758. function mapKeys(object, iteratee) {
  13759. var result = {};
  13760. iteratee = getIteratee(iteratee, 3);
  13761. baseForOwn(object, function(value, key, object) {
  13762. baseAssignValue(result, iteratee(value, key, object), value);
  13763. });
  13764. return result;
  13765. }
  13766. /**
  13767. * Creates an object with the same keys as `object` and values generated
  13768. * by running each own enumerable string keyed property of `object` thru
  13769. * `iteratee`. The iteratee is invoked with three arguments:
  13770. * (value, key, object).
  13771. *
  13772. * @static
  13773. * @memberOf _
  13774. * @since 2.4.0
  13775. * @category Object
  13776. * @param {Object} object The object to iterate over.
  13777. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13778. * @returns {Object} Returns the new mapped object.
  13779. * @see _.mapKeys
  13780. * @example
  13781. *
  13782. * var users = {
  13783. * 'fred': { 'user': 'fred', 'age': 40 },
  13784. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13785. * };
  13786. *
  13787. * _.mapValues(users, function(o) { return o.age; });
  13788. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13789. *
  13790. * // The `_.property` iteratee shorthand.
  13791. * _.mapValues(users, 'age');
  13792. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13793. */
  13794. function mapValues(object, iteratee) {
  13795. var result = {};
  13796. iteratee = getIteratee(iteratee, 3);
  13797. baseForOwn(object, function(value, key, object) {
  13798. baseAssignValue(result, key, iteratee(value, key, object));
  13799. });
  13800. return result;
  13801. }
  13802. /**
  13803. * This method is like `_.assign` except that it recursively merges own and
  13804. * inherited enumerable string keyed properties of source objects into the
  13805. * destination object. Source properties that resolve to `undefined` are
  13806. * skipped if a destination value exists. Array and plain object properties
  13807. * are merged recursively. Other objects and value types are overridden by
  13808. * assignment. Source objects are applied from left to right. Subsequent
  13809. * sources overwrite property assignments of previous sources.
  13810. *
  13811. * **Note:** This method mutates `object`.
  13812. *
  13813. * @static
  13814. * @memberOf _
  13815. * @since 0.5.0
  13816. * @category Object
  13817. * @param {Object} object The destination object.
  13818. * @param {...Object} [sources] The source objects.
  13819. * @returns {Object} Returns `object`.
  13820. * @example
  13821. *
  13822. * var object = {
  13823. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13824. * };
  13825. *
  13826. * var other = {
  13827. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13828. * };
  13829. *
  13830. * _.merge(object, other);
  13831. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13832. */
  13833. var merge = createAssigner(function(object, source, srcIndex) {
  13834. baseMerge(object, source, srcIndex);
  13835. });
  13836. /**
  13837. * This method is like `_.merge` except that it accepts `customizer` which
  13838. * is invoked to produce the merged values of the destination and source
  13839. * properties. If `customizer` returns `undefined`, merging is handled by the
  13840. * method instead. The `customizer` is invoked with six arguments:
  13841. * (objValue, srcValue, key, object, source, stack).
  13842. *
  13843. * **Note:** This method mutates `object`.
  13844. *
  13845. * @static
  13846. * @memberOf _
  13847. * @since 4.0.0
  13848. * @category Object
  13849. * @param {Object} object The destination object.
  13850. * @param {...Object} sources The source objects.
  13851. * @param {Function} customizer The function to customize assigned values.
  13852. * @returns {Object} Returns `object`.
  13853. * @example
  13854. *
  13855. * function customizer(objValue, srcValue) {
  13856. * if (_.isArray(objValue)) {
  13857. * return objValue.concat(srcValue);
  13858. * }
  13859. * }
  13860. *
  13861. * var object = { 'a': [1], 'b': [2] };
  13862. * var other = { 'a': [3], 'b': [4] };
  13863. *
  13864. * _.mergeWith(object, other, customizer);
  13865. * // => { 'a': [1, 3], 'b': [2, 4] }
  13866. */
  13867. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13868. baseMerge(object, source, srcIndex, customizer);
  13869. });
  13870. /**
  13871. * The opposite of `_.pick`; this method creates an object composed of the
  13872. * own and inherited enumerable property paths of `object` that are not omitted.
  13873. *
  13874. * **Note:** This method is considerably slower than `_.pick`.
  13875. *
  13876. * @static
  13877. * @since 0.1.0
  13878. * @memberOf _
  13879. * @category Object
  13880. * @param {Object} object The source object.
  13881. * @param {...(string|string[])} [paths] The property paths to omit.
  13882. * @returns {Object} Returns the new object.
  13883. * @example
  13884. *
  13885. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13886. *
  13887. * _.omit(object, ['a', 'c']);
  13888. * // => { 'b': '2' }
  13889. */
  13890. var omit = flatRest(function(object, paths) {
  13891. var result = {};
  13892. if (object == null) {
  13893. return result;
  13894. }
  13895. var isDeep = false;
  13896. paths = arrayMap(paths, function(path) {
  13897. path = castPath(path, object);
  13898. isDeep || (isDeep = path.length > 1);
  13899. return path;
  13900. });
  13901. copyObject(object, getAllKeysIn(object), result);
  13902. if (isDeep) {
  13903. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13904. }
  13905. var length = paths.length;
  13906. while (length--) {
  13907. baseUnset(result, paths[length]);
  13908. }
  13909. return result;
  13910. });
  13911. /**
  13912. * The opposite of `_.pickBy`; this method creates an object composed of
  13913. * the own and inherited enumerable string keyed properties of `object` that
  13914. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13915. * arguments: (value, key).
  13916. *
  13917. * @static
  13918. * @memberOf _
  13919. * @since 4.0.0
  13920. * @category Object
  13921. * @param {Object} object The source object.
  13922. * @param {Function} [predicate=_.identity] The function invoked per property.
  13923. * @returns {Object} Returns the new object.
  13924. * @example
  13925. *
  13926. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13927. *
  13928. * _.omitBy(object, _.isNumber);
  13929. * // => { 'b': '2' }
  13930. */
  13931. function omitBy(object, predicate) {
  13932. return pickBy(object, negate(getIteratee(predicate)));
  13933. }
  13934. /**
  13935. * Creates an object composed of the picked `object` properties.
  13936. *
  13937. * @static
  13938. * @since 0.1.0
  13939. * @memberOf _
  13940. * @category Object
  13941. * @param {Object} object The source object.
  13942. * @param {...(string|string[])} [paths] The property paths to pick.
  13943. * @returns {Object} Returns the new object.
  13944. * @example
  13945. *
  13946. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13947. *
  13948. * _.pick(object, ['a', 'c']);
  13949. * // => { 'a': 1, 'c': 3 }
  13950. */
  13951. var pick = flatRest(function(object, paths) {
  13952. return object == null ? {} : basePick(object, paths);
  13953. });
  13954. /**
  13955. * Creates an object composed of the `object` properties `predicate` returns
  13956. * truthy for. The predicate is invoked with two arguments: (value, key).
  13957. *
  13958. * @static
  13959. * @memberOf _
  13960. * @since 4.0.0
  13961. * @category Object
  13962. * @param {Object} object The source object.
  13963. * @param {Function} [predicate=_.identity] The function invoked per property.
  13964. * @returns {Object} Returns the new object.
  13965. * @example
  13966. *
  13967. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13968. *
  13969. * _.pickBy(object, _.isNumber);
  13970. * // => { 'a': 1, 'c': 3 }
  13971. */
  13972. function pickBy(object, predicate) {
  13973. if (object == null) {
  13974. return {};
  13975. }
  13976. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13977. return [prop];
  13978. });
  13979. predicate = getIteratee(predicate);
  13980. return basePickBy(object, props, function(value, path) {
  13981. return predicate(value, path[0]);
  13982. });
  13983. }
  13984. /**
  13985. * This method is like `_.get` except that if the resolved value is a
  13986. * function it's invoked with the `this` binding of its parent object and
  13987. * its result is returned.
  13988. *
  13989. * @static
  13990. * @since 0.1.0
  13991. * @memberOf _
  13992. * @category Object
  13993. * @param {Object} object The object to query.
  13994. * @param {Array|string} path The path of the property to resolve.
  13995. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13996. * @returns {*} Returns the resolved value.
  13997. * @example
  13998. *
  13999. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14000. *
  14001. * _.result(object, 'a[0].b.c1');
  14002. * // => 3
  14003. *
  14004. * _.result(object, 'a[0].b.c2');
  14005. * // => 4
  14006. *
  14007. * _.result(object, 'a[0].b.c3', 'default');
  14008. * // => 'default'
  14009. *
  14010. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14011. * // => 'default'
  14012. */
  14013. function result(object, path, defaultValue) {
  14014. path = castPath(path, object);
  14015. var index = -1,
  14016. length = path.length;
  14017. // Ensure the loop is entered when path is empty.
  14018. if (!length) {
  14019. length = 1;
  14020. object = undefined;
  14021. }
  14022. while (++index < length) {
  14023. var value = object == null ? undefined : object[toKey(path[index])];
  14024. if (value === undefined) {
  14025. index = length;
  14026. value = defaultValue;
  14027. }
  14028. object = isFunction(value) ? value.call(object) : value;
  14029. }
  14030. return object;
  14031. }
  14032. /**
  14033. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14034. * it's created. Arrays are created for missing index properties while objects
  14035. * are created for all other missing properties. Use `_.setWith` to customize
  14036. * `path` creation.
  14037. *
  14038. * **Note:** This method mutates `object`.
  14039. *
  14040. * @static
  14041. * @memberOf _
  14042. * @since 3.7.0
  14043. * @category Object
  14044. * @param {Object} object The object to modify.
  14045. * @param {Array|string} path The path of the property to set.
  14046. * @param {*} value The value to set.
  14047. * @returns {Object} Returns `object`.
  14048. * @example
  14049. *
  14050. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14051. *
  14052. * _.set(object, 'a[0].b.c', 4);
  14053. * console.log(object.a[0].b.c);
  14054. * // => 4
  14055. *
  14056. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14057. * console.log(object.x[0].y.z);
  14058. * // => 5
  14059. */
  14060. function set(object, path, value) {
  14061. return object == null ? object : baseSet(object, path, value);
  14062. }
  14063. /**
  14064. * This method is like `_.set` except that it accepts `customizer` which is
  14065. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14066. * path creation is handled by the method instead. The `customizer` is invoked
  14067. * with three arguments: (nsValue, key, nsObject).
  14068. *
  14069. * **Note:** This method mutates `object`.
  14070. *
  14071. * @static
  14072. * @memberOf _
  14073. * @since 4.0.0
  14074. * @category Object
  14075. * @param {Object} object The object to modify.
  14076. * @param {Array|string} path The path of the property to set.
  14077. * @param {*} value The value to set.
  14078. * @param {Function} [customizer] The function to customize assigned values.
  14079. * @returns {Object} Returns `object`.
  14080. * @example
  14081. *
  14082. * var object = {};
  14083. *
  14084. * _.setWith(object, '[0][1]', 'a', Object);
  14085. * // => { '0': { '1': 'a' } }
  14086. */
  14087. function setWith(object, path, value, customizer) {
  14088. customizer = typeof customizer == 'function' ? customizer : undefined;
  14089. return object == null ? object : baseSet(object, path, value, customizer);
  14090. }
  14091. /**
  14092. * Creates an array of own enumerable string keyed-value pairs for `object`
  14093. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14094. * entries are returned.
  14095. *
  14096. * @static
  14097. * @memberOf _
  14098. * @since 4.0.0
  14099. * @alias entries
  14100. * @category Object
  14101. * @param {Object} object The object to query.
  14102. * @returns {Array} Returns the key-value pairs.
  14103. * @example
  14104. *
  14105. * function Foo() {
  14106. * this.a = 1;
  14107. * this.b = 2;
  14108. * }
  14109. *
  14110. * Foo.prototype.c = 3;
  14111. *
  14112. * _.toPairs(new Foo);
  14113. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14114. */
  14115. var toPairs = createToPairs(keys);
  14116. /**
  14117. * Creates an array of own and inherited enumerable string keyed-value pairs
  14118. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14119. * or set, its entries are returned.
  14120. *
  14121. * @static
  14122. * @memberOf _
  14123. * @since 4.0.0
  14124. * @alias entriesIn
  14125. * @category Object
  14126. * @param {Object} object The object to query.
  14127. * @returns {Array} Returns the key-value pairs.
  14128. * @example
  14129. *
  14130. * function Foo() {
  14131. * this.a = 1;
  14132. * this.b = 2;
  14133. * }
  14134. *
  14135. * Foo.prototype.c = 3;
  14136. *
  14137. * _.toPairsIn(new Foo);
  14138. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14139. */
  14140. var toPairsIn = createToPairs(keysIn);
  14141. /**
  14142. * An alternative to `_.reduce`; this method transforms `object` to a new
  14143. * `accumulator` object which is the result of running each of its own
  14144. * enumerable string keyed properties thru `iteratee`, with each invocation
  14145. * potentially mutating the `accumulator` object. If `accumulator` is not
  14146. * provided, a new object with the same `[[Prototype]]` will be used. The
  14147. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14148. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14149. *
  14150. * @static
  14151. * @memberOf _
  14152. * @since 1.3.0
  14153. * @category Object
  14154. * @param {Object} object The object to iterate over.
  14155. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14156. * @param {*} [accumulator] The custom accumulator value.
  14157. * @returns {*} Returns the accumulated value.
  14158. * @example
  14159. *
  14160. * _.transform([2, 3, 4], function(result, n) {
  14161. * result.push(n *= n);
  14162. * return n % 2 == 0;
  14163. * }, []);
  14164. * // => [4, 9]
  14165. *
  14166. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14167. * (result[value] || (result[value] = [])).push(key);
  14168. * }, {});
  14169. * // => { '1': ['a', 'c'], '2': ['b'] }
  14170. */
  14171. function transform(object, iteratee, accumulator) {
  14172. var isArr = isArray(object),
  14173. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14174. iteratee = getIteratee(iteratee, 4);
  14175. if (accumulator == null) {
  14176. var Ctor = object && object.constructor;
  14177. if (isArrLike) {
  14178. accumulator = isArr ? new Ctor : [];
  14179. }
  14180. else if (isObject(object)) {
  14181. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14182. }
  14183. else {
  14184. accumulator = {};
  14185. }
  14186. }
  14187. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14188. return iteratee(accumulator, value, index, object);
  14189. });
  14190. return accumulator;
  14191. }
  14192. /**
  14193. * Removes the property at `path` of `object`.
  14194. *
  14195. * **Note:** This method mutates `object`.
  14196. *
  14197. * @static
  14198. * @memberOf _
  14199. * @since 4.0.0
  14200. * @category Object
  14201. * @param {Object} object The object to modify.
  14202. * @param {Array|string} path The path of the property to unset.
  14203. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14204. * @example
  14205. *
  14206. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14207. * _.unset(object, 'a[0].b.c');
  14208. * // => true
  14209. *
  14210. * console.log(object);
  14211. * // => { 'a': [{ 'b': {} }] };
  14212. *
  14213. * _.unset(object, ['a', '0', 'b', 'c']);
  14214. * // => true
  14215. *
  14216. * console.log(object);
  14217. * // => { 'a': [{ 'b': {} }] };
  14218. */
  14219. function unset(object, path) {
  14220. return object == null ? true : baseUnset(object, path);
  14221. }
  14222. /**
  14223. * This method is like `_.set` except that accepts `updater` to produce the
  14224. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14225. * is invoked with one argument: (value).
  14226. *
  14227. * **Note:** This method mutates `object`.
  14228. *
  14229. * @static
  14230. * @memberOf _
  14231. * @since 4.6.0
  14232. * @category Object
  14233. * @param {Object} object The object to modify.
  14234. * @param {Array|string} path The path of the property to set.
  14235. * @param {Function} updater The function to produce the updated value.
  14236. * @returns {Object} Returns `object`.
  14237. * @example
  14238. *
  14239. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14240. *
  14241. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14242. * console.log(object.a[0].b.c);
  14243. * // => 9
  14244. *
  14245. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14246. * console.log(object.x[0].y.z);
  14247. * // => 0
  14248. */
  14249. function update(object, path, updater) {
  14250. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14251. }
  14252. /**
  14253. * This method is like `_.update` except that it accepts `customizer` which is
  14254. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14255. * path creation is handled by the method instead. The `customizer` is invoked
  14256. * with three arguments: (nsValue, key, nsObject).
  14257. *
  14258. * **Note:** This method mutates `object`.
  14259. *
  14260. * @static
  14261. * @memberOf _
  14262. * @since 4.6.0
  14263. * @category Object
  14264. * @param {Object} object The object to modify.
  14265. * @param {Array|string} path The path of the property to set.
  14266. * @param {Function} updater The function to produce the updated value.
  14267. * @param {Function} [customizer] The function to customize assigned values.
  14268. * @returns {Object} Returns `object`.
  14269. * @example
  14270. *
  14271. * var object = {};
  14272. *
  14273. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14274. * // => { '0': { '1': 'a' } }
  14275. */
  14276. function updateWith(object, path, updater, customizer) {
  14277. customizer = typeof customizer == 'function' ? customizer : undefined;
  14278. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14279. }
  14280. /**
  14281. * Creates an array of the own enumerable string keyed property values of `object`.
  14282. *
  14283. * **Note:** Non-object values are coerced to objects.
  14284. *
  14285. * @static
  14286. * @since 0.1.0
  14287. * @memberOf _
  14288. * @category Object
  14289. * @param {Object} object The object to query.
  14290. * @returns {Array} Returns the array of property values.
  14291. * @example
  14292. *
  14293. * function Foo() {
  14294. * this.a = 1;
  14295. * this.b = 2;
  14296. * }
  14297. *
  14298. * Foo.prototype.c = 3;
  14299. *
  14300. * _.values(new Foo);
  14301. * // => [1, 2] (iteration order is not guaranteed)
  14302. *
  14303. * _.values('hi');
  14304. * // => ['h', 'i']
  14305. */
  14306. function values(object) {
  14307. return object == null ? [] : baseValues(object, keys(object));
  14308. }
  14309. /**
  14310. * Creates an array of the own and inherited enumerable string keyed property
  14311. * values of `object`.
  14312. *
  14313. * **Note:** Non-object values are coerced to objects.
  14314. *
  14315. * @static
  14316. * @memberOf _
  14317. * @since 3.0.0
  14318. * @category Object
  14319. * @param {Object} object The object to query.
  14320. * @returns {Array} Returns the array of property values.
  14321. * @example
  14322. *
  14323. * function Foo() {
  14324. * this.a = 1;
  14325. * this.b = 2;
  14326. * }
  14327. *
  14328. * Foo.prototype.c = 3;
  14329. *
  14330. * _.valuesIn(new Foo);
  14331. * // => [1, 2, 3] (iteration order is not guaranteed)
  14332. */
  14333. function valuesIn(object) {
  14334. return object == null ? [] : baseValues(object, keysIn(object));
  14335. }
  14336. /*------------------------------------------------------------------------*/
  14337. /**
  14338. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14339. *
  14340. * @static
  14341. * @memberOf _
  14342. * @since 4.0.0
  14343. * @category Number
  14344. * @param {number} number The number to clamp.
  14345. * @param {number} [lower] The lower bound.
  14346. * @param {number} upper The upper bound.
  14347. * @returns {number} Returns the clamped number.
  14348. * @example
  14349. *
  14350. * _.clamp(-10, -5, 5);
  14351. * // => -5
  14352. *
  14353. * _.clamp(10, -5, 5);
  14354. * // => 5
  14355. */
  14356. function clamp(number, lower, upper) {
  14357. if (upper === undefined) {
  14358. upper = lower;
  14359. lower = undefined;
  14360. }
  14361. if (upper !== undefined) {
  14362. upper = toNumber(upper);
  14363. upper = upper === upper ? upper : 0;
  14364. }
  14365. if (lower !== undefined) {
  14366. lower = toNumber(lower);
  14367. lower = lower === lower ? lower : 0;
  14368. }
  14369. return baseClamp(toNumber(number), lower, upper);
  14370. }
  14371. /**
  14372. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14373. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14374. * If `start` is greater than `end` the params are swapped to support
  14375. * negative ranges.
  14376. *
  14377. * @static
  14378. * @memberOf _
  14379. * @since 3.3.0
  14380. * @category Number
  14381. * @param {number} number The number to check.
  14382. * @param {number} [start=0] The start of the range.
  14383. * @param {number} end The end of the range.
  14384. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14385. * @see _.range, _.rangeRight
  14386. * @example
  14387. *
  14388. * _.inRange(3, 2, 4);
  14389. * // => true
  14390. *
  14391. * _.inRange(4, 8);
  14392. * // => true
  14393. *
  14394. * _.inRange(4, 2);
  14395. * // => false
  14396. *
  14397. * _.inRange(2, 2);
  14398. * // => false
  14399. *
  14400. * _.inRange(1.2, 2);
  14401. * // => true
  14402. *
  14403. * _.inRange(5.2, 4);
  14404. * // => false
  14405. *
  14406. * _.inRange(-3, -2, -6);
  14407. * // => true
  14408. */
  14409. function inRange(number, start, end) {
  14410. start = toFinite(start);
  14411. if (end === undefined) {
  14412. end = start;
  14413. start = 0;
  14414. } else {
  14415. end = toFinite(end);
  14416. }
  14417. number = toNumber(number);
  14418. return baseInRange(number, start, end);
  14419. }
  14420. /**
  14421. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14422. * If only one argument is provided a number between `0` and the given number
  14423. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14424. * floats, a floating-point number is returned instead of an integer.
  14425. *
  14426. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14427. * floating-point values which can produce unexpected results.
  14428. *
  14429. * @static
  14430. * @memberOf _
  14431. * @since 0.7.0
  14432. * @category Number
  14433. * @param {number} [lower=0] The lower bound.
  14434. * @param {number} [upper=1] The upper bound.
  14435. * @param {boolean} [floating] Specify returning a floating-point number.
  14436. * @returns {number} Returns the random number.
  14437. * @example
  14438. *
  14439. * _.random(0, 5);
  14440. * // => an integer between 0 and 5
  14441. *
  14442. * _.random(5);
  14443. * // => also an integer between 0 and 5
  14444. *
  14445. * _.random(5, true);
  14446. * // => a floating-point number between 0 and 5
  14447. *
  14448. * _.random(1.2, 5.2);
  14449. * // => a floating-point number between 1.2 and 5.2
  14450. */
  14451. function random(lower, upper, floating) {
  14452. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14453. upper = floating = undefined;
  14454. }
  14455. if (floating === undefined) {
  14456. if (typeof upper == 'boolean') {
  14457. floating = upper;
  14458. upper = undefined;
  14459. }
  14460. else if (typeof lower == 'boolean') {
  14461. floating = lower;
  14462. lower = undefined;
  14463. }
  14464. }
  14465. if (lower === undefined && upper === undefined) {
  14466. lower = 0;
  14467. upper = 1;
  14468. }
  14469. else {
  14470. lower = toFinite(lower);
  14471. if (upper === undefined) {
  14472. upper = lower;
  14473. lower = 0;
  14474. } else {
  14475. upper = toFinite(upper);
  14476. }
  14477. }
  14478. if (lower > upper) {
  14479. var temp = lower;
  14480. lower = upper;
  14481. upper = temp;
  14482. }
  14483. if (floating || lower % 1 || upper % 1) {
  14484. var rand = nativeRandom();
  14485. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14486. }
  14487. return baseRandom(lower, upper);
  14488. }
  14489. /*------------------------------------------------------------------------*/
  14490. /**
  14491. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14492. *
  14493. * @static
  14494. * @memberOf _
  14495. * @since 3.0.0
  14496. * @category String
  14497. * @param {string} [string=''] The string to convert.
  14498. * @returns {string} Returns the camel cased string.
  14499. * @example
  14500. *
  14501. * _.camelCase('Foo Bar');
  14502. * // => 'fooBar'
  14503. *
  14504. * _.camelCase('--foo-bar--');
  14505. * // => 'fooBar'
  14506. *
  14507. * _.camelCase('__FOO_BAR__');
  14508. * // => 'fooBar'
  14509. */
  14510. var camelCase = createCompounder(function(result, word, index) {
  14511. word = word.toLowerCase();
  14512. return result + (index ? capitalize(word) : word);
  14513. });
  14514. /**
  14515. * Converts the first character of `string` to upper case and the remaining
  14516. * to lower case.
  14517. *
  14518. * @static
  14519. * @memberOf _
  14520. * @since 3.0.0
  14521. * @category String
  14522. * @param {string} [string=''] The string to capitalize.
  14523. * @returns {string} Returns the capitalized string.
  14524. * @example
  14525. *
  14526. * _.capitalize('FRED');
  14527. * // => 'Fred'
  14528. */
  14529. function capitalize(string) {
  14530. return upperFirst(toString(string).toLowerCase());
  14531. }
  14532. /**
  14533. * Deburrs `string` by converting
  14534. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14535. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14536. * letters to basic Latin letters and removing
  14537. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14538. *
  14539. * @static
  14540. * @memberOf _
  14541. * @since 3.0.0
  14542. * @category String
  14543. * @param {string} [string=''] The string to deburr.
  14544. * @returns {string} Returns the deburred string.
  14545. * @example
  14546. *
  14547. * _.deburr('déjà vu');
  14548. * // => 'deja vu'
  14549. */
  14550. function deburr(string) {
  14551. string = toString(string);
  14552. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14553. }
  14554. /**
  14555. * Checks if `string` ends with the given target string.
  14556. *
  14557. * @static
  14558. * @memberOf _
  14559. * @since 3.0.0
  14560. * @category String
  14561. * @param {string} [string=''] The string to inspect.
  14562. * @param {string} [target] The string to search for.
  14563. * @param {number} [position=string.length] The position to search up to.
  14564. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14565. * else `false`.
  14566. * @example
  14567. *
  14568. * _.endsWith('abc', 'c');
  14569. * // => true
  14570. *
  14571. * _.endsWith('abc', 'b');
  14572. * // => false
  14573. *
  14574. * _.endsWith('abc', 'b', 2);
  14575. * // => true
  14576. */
  14577. function endsWith(string, target, position) {
  14578. string = toString(string);
  14579. target = baseToString(target);
  14580. var length = string.length;
  14581. position = position === undefined
  14582. ? length
  14583. : baseClamp(toInteger(position), 0, length);
  14584. var end = position;
  14585. position -= target.length;
  14586. return position >= 0 && string.slice(position, end) == target;
  14587. }
  14588. /**
  14589. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14590. * corresponding HTML entities.
  14591. *
  14592. * **Note:** No other characters are escaped. To escape additional
  14593. * characters use a third-party library like [_he_](https://mths.be/he).
  14594. *
  14595. * Though the ">" character is escaped for symmetry, characters like
  14596. * ">" and "/" don't need escaping in HTML and have no special meaning
  14597. * unless they're part of a tag or unquoted attribute value. See
  14598. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14599. * (under "semi-related fun fact") for more details.
  14600. *
  14601. * When working with HTML you should always
  14602. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14603. * XSS vectors.
  14604. *
  14605. * @static
  14606. * @since 0.1.0
  14607. * @memberOf _
  14608. * @category String
  14609. * @param {string} [string=''] The string to escape.
  14610. * @returns {string} Returns the escaped string.
  14611. * @example
  14612. *
  14613. * _.escape('fred, barney, & pebbles');
  14614. * // => 'fred, barney, &amp; pebbles'
  14615. */
  14616. function escape(string) {
  14617. string = toString(string);
  14618. return (string && reHasUnescapedHtml.test(string))
  14619. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14620. : string;
  14621. }
  14622. /**
  14623. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14624. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14625. *
  14626. * @static
  14627. * @memberOf _
  14628. * @since 3.0.0
  14629. * @category String
  14630. * @param {string} [string=''] The string to escape.
  14631. * @returns {string} Returns the escaped string.
  14632. * @example
  14633. *
  14634. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14635. * // => '\[lodash\]\(https://lodash\.com/\)'
  14636. */
  14637. function escapeRegExp(string) {
  14638. string = toString(string);
  14639. return (string && reHasRegExpChar.test(string))
  14640. ? string.replace(reRegExpChar, '\\$&')
  14641. : string;
  14642. }
  14643. /**
  14644. * Converts `string` to
  14645. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14646. *
  14647. * @static
  14648. * @memberOf _
  14649. * @since 3.0.0
  14650. * @category String
  14651. * @param {string} [string=''] The string to convert.
  14652. * @returns {string} Returns the kebab cased string.
  14653. * @example
  14654. *
  14655. * _.kebabCase('Foo Bar');
  14656. * // => 'foo-bar'
  14657. *
  14658. * _.kebabCase('fooBar');
  14659. * // => 'foo-bar'
  14660. *
  14661. * _.kebabCase('__FOO_BAR__');
  14662. * // => 'foo-bar'
  14663. */
  14664. var kebabCase = createCompounder(function(result, word, index) {
  14665. return result + (index ? '-' : '') + word.toLowerCase();
  14666. });
  14667. /**
  14668. * Converts `string`, as space separated words, to lower case.
  14669. *
  14670. * @static
  14671. * @memberOf _
  14672. * @since 4.0.0
  14673. * @category String
  14674. * @param {string} [string=''] The string to convert.
  14675. * @returns {string} Returns the lower cased string.
  14676. * @example
  14677. *
  14678. * _.lowerCase('--Foo-Bar--');
  14679. * // => 'foo bar'
  14680. *
  14681. * _.lowerCase('fooBar');
  14682. * // => 'foo bar'
  14683. *
  14684. * _.lowerCase('__FOO_BAR__');
  14685. * // => 'foo bar'
  14686. */
  14687. var lowerCase = createCompounder(function(result, word, index) {
  14688. return result + (index ? ' ' : '') + word.toLowerCase();
  14689. });
  14690. /**
  14691. * Converts the first character of `string` to lower case.
  14692. *
  14693. * @static
  14694. * @memberOf _
  14695. * @since 4.0.0
  14696. * @category String
  14697. * @param {string} [string=''] The string to convert.
  14698. * @returns {string} Returns the converted string.
  14699. * @example
  14700. *
  14701. * _.lowerFirst('Fred');
  14702. * // => 'fred'
  14703. *
  14704. * _.lowerFirst('FRED');
  14705. * // => 'fRED'
  14706. */
  14707. var lowerFirst = createCaseFirst('toLowerCase');
  14708. /**
  14709. * Pads `string` on the left and right sides if it's shorter than `length`.
  14710. * Padding characters are truncated if they can't be evenly divided by `length`.
  14711. *
  14712. * @static
  14713. * @memberOf _
  14714. * @since 3.0.0
  14715. * @category String
  14716. * @param {string} [string=''] The string to pad.
  14717. * @param {number} [length=0] The padding length.
  14718. * @param {string} [chars=' '] The string used as padding.
  14719. * @returns {string} Returns the padded string.
  14720. * @example
  14721. *
  14722. * _.pad('abc', 8);
  14723. * // => ' abc '
  14724. *
  14725. * _.pad('abc', 8, '_-');
  14726. * // => '_-abc_-_'
  14727. *
  14728. * _.pad('abc', 3);
  14729. * // => 'abc'
  14730. */
  14731. function pad(string, length, chars) {
  14732. string = toString(string);
  14733. length = toInteger(length);
  14734. var strLength = length ? stringSize(string) : 0;
  14735. if (!length || strLength >= length) {
  14736. return string;
  14737. }
  14738. var mid = (length - strLength) / 2;
  14739. return (
  14740. createPadding(nativeFloor(mid), chars) +
  14741. string +
  14742. createPadding(nativeCeil(mid), chars)
  14743. );
  14744. }
  14745. /**
  14746. * Pads `string` on the right side if it's shorter than `length`. Padding
  14747. * characters are truncated if they exceed `length`.
  14748. *
  14749. * @static
  14750. * @memberOf _
  14751. * @since 4.0.0
  14752. * @category String
  14753. * @param {string} [string=''] The string to pad.
  14754. * @param {number} [length=0] The padding length.
  14755. * @param {string} [chars=' '] The string used as padding.
  14756. * @returns {string} Returns the padded string.
  14757. * @example
  14758. *
  14759. * _.padEnd('abc', 6);
  14760. * // => 'abc '
  14761. *
  14762. * _.padEnd('abc', 6, '_-');
  14763. * // => 'abc_-_'
  14764. *
  14765. * _.padEnd('abc', 3);
  14766. * // => 'abc'
  14767. */
  14768. function padEnd(string, length, chars) {
  14769. string = toString(string);
  14770. length = toInteger(length);
  14771. var strLength = length ? stringSize(string) : 0;
  14772. return (length && strLength < length)
  14773. ? (string + createPadding(length - strLength, chars))
  14774. : string;
  14775. }
  14776. /**
  14777. * Pads `string` on the left side if it's shorter than `length`. Padding
  14778. * characters are truncated if they exceed `length`.
  14779. *
  14780. * @static
  14781. * @memberOf _
  14782. * @since 4.0.0
  14783. * @category String
  14784. * @param {string} [string=''] The string to pad.
  14785. * @param {number} [length=0] The padding length.
  14786. * @param {string} [chars=' '] The string used as padding.
  14787. * @returns {string} Returns the padded string.
  14788. * @example
  14789. *
  14790. * _.padStart('abc', 6);
  14791. * // => ' abc'
  14792. *
  14793. * _.padStart('abc', 6, '_-');
  14794. * // => '_-_abc'
  14795. *
  14796. * _.padStart('abc', 3);
  14797. * // => 'abc'
  14798. */
  14799. function padStart(string, length, chars) {
  14800. string = toString(string);
  14801. length = toInteger(length);
  14802. var strLength = length ? stringSize(string) : 0;
  14803. return (length && strLength < length)
  14804. ? (createPadding(length - strLength, chars) + string)
  14805. : string;
  14806. }
  14807. /**
  14808. * Converts `string` to an integer of the specified radix. If `radix` is
  14809. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14810. * hexadecimal, in which case a `radix` of `16` is used.
  14811. *
  14812. * **Note:** This method aligns with the
  14813. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14814. *
  14815. * @static
  14816. * @memberOf _
  14817. * @since 1.1.0
  14818. * @category String
  14819. * @param {string} string The string to convert.
  14820. * @param {number} [radix=10] The radix to interpret `value` by.
  14821. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14822. * @returns {number} Returns the converted integer.
  14823. * @example
  14824. *
  14825. * _.parseInt('08');
  14826. * // => 8
  14827. *
  14828. * _.map(['6', '08', '10'], _.parseInt);
  14829. * // => [6, 8, 10]
  14830. */
  14831. function parseInt(string, radix, guard) {
  14832. if (guard || radix == null) {
  14833. radix = 0;
  14834. } else if (radix) {
  14835. radix = +radix;
  14836. }
  14837. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14838. }
  14839. /**
  14840. * Repeats the given string `n` times.
  14841. *
  14842. * @static
  14843. * @memberOf _
  14844. * @since 3.0.0
  14845. * @category String
  14846. * @param {string} [string=''] The string to repeat.
  14847. * @param {number} [n=1] The number of times to repeat the string.
  14848. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14849. * @returns {string} Returns the repeated string.
  14850. * @example
  14851. *
  14852. * _.repeat('*', 3);
  14853. * // => '***'
  14854. *
  14855. * _.repeat('abc', 2);
  14856. * // => 'abcabc'
  14857. *
  14858. * _.repeat('abc', 0);
  14859. * // => ''
  14860. */
  14861. function repeat(string, n, guard) {
  14862. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14863. n = 1;
  14864. } else {
  14865. n = toInteger(n);
  14866. }
  14867. return baseRepeat(toString(string), n);
  14868. }
  14869. /**
  14870. * Replaces matches for `pattern` in `string` with `replacement`.
  14871. *
  14872. * **Note:** This method is based on
  14873. * [`String#replace`](https://mdn.io/String/replace).
  14874. *
  14875. * @static
  14876. * @memberOf _
  14877. * @since 4.0.0
  14878. * @category String
  14879. * @param {string} [string=''] The string to modify.
  14880. * @param {RegExp|string} pattern The pattern to replace.
  14881. * @param {Function|string} replacement The match replacement.
  14882. * @returns {string} Returns the modified string.
  14883. * @example
  14884. *
  14885. * _.replace('Hi Fred', 'Fred', 'Barney');
  14886. * // => 'Hi Barney'
  14887. */
  14888. function replace() {
  14889. var args = arguments,
  14890. string = toString(args[0]);
  14891. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14892. }
  14893. /**
  14894. * Converts `string` to
  14895. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14896. *
  14897. * @static
  14898. * @memberOf _
  14899. * @since 3.0.0
  14900. * @category String
  14901. * @param {string} [string=''] The string to convert.
  14902. * @returns {string} Returns the snake cased string.
  14903. * @example
  14904. *
  14905. * _.snakeCase('Foo Bar');
  14906. * // => 'foo_bar'
  14907. *
  14908. * _.snakeCase('fooBar');
  14909. * // => 'foo_bar'
  14910. *
  14911. * _.snakeCase('--FOO-BAR--');
  14912. * // => 'foo_bar'
  14913. */
  14914. var snakeCase = createCompounder(function(result, word, index) {
  14915. return result + (index ? '_' : '') + word.toLowerCase();
  14916. });
  14917. /**
  14918. * Splits `string` by `separator`.
  14919. *
  14920. * **Note:** This method is based on
  14921. * [`String#split`](https://mdn.io/String/split).
  14922. *
  14923. * @static
  14924. * @memberOf _
  14925. * @since 4.0.0
  14926. * @category String
  14927. * @param {string} [string=''] The string to split.
  14928. * @param {RegExp|string} separator The separator pattern to split by.
  14929. * @param {number} [limit] The length to truncate results to.
  14930. * @returns {Array} Returns the string segments.
  14931. * @example
  14932. *
  14933. * _.split('a-b-c', '-', 2);
  14934. * // => ['a', 'b']
  14935. */
  14936. function split(string, separator, limit) {
  14937. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14938. separator = limit = undefined;
  14939. }
  14940. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14941. if (!limit) {
  14942. return [];
  14943. }
  14944. string = toString(string);
  14945. if (string && (
  14946. typeof separator == 'string' ||
  14947. (separator != null && !isRegExp(separator))
  14948. )) {
  14949. separator = baseToString(separator);
  14950. if (!separator && hasUnicode(string)) {
  14951. return castSlice(stringToArray(string), 0, limit);
  14952. }
  14953. }
  14954. return string.split(separator, limit);
  14955. }
  14956. /**
  14957. * Converts `string` to
  14958. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14959. *
  14960. * @static
  14961. * @memberOf _
  14962. * @since 3.1.0
  14963. * @category String
  14964. * @param {string} [string=''] The string to convert.
  14965. * @returns {string} Returns the start cased string.
  14966. * @example
  14967. *
  14968. * _.startCase('--foo-bar--');
  14969. * // => 'Foo Bar'
  14970. *
  14971. * _.startCase('fooBar');
  14972. * // => 'Foo Bar'
  14973. *
  14974. * _.startCase('__FOO_BAR__');
  14975. * // => 'FOO BAR'
  14976. */
  14977. var startCase = createCompounder(function(result, word, index) {
  14978. return result + (index ? ' ' : '') + upperFirst(word);
  14979. });
  14980. /**
  14981. * Checks if `string` starts with the given target string.
  14982. *
  14983. * @static
  14984. * @memberOf _
  14985. * @since 3.0.0
  14986. * @category String
  14987. * @param {string} [string=''] The string to inspect.
  14988. * @param {string} [target] The string to search for.
  14989. * @param {number} [position=0] The position to search from.
  14990. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14991. * else `false`.
  14992. * @example
  14993. *
  14994. * _.startsWith('abc', 'a');
  14995. * // => true
  14996. *
  14997. * _.startsWith('abc', 'b');
  14998. * // => false
  14999. *
  15000. * _.startsWith('abc', 'b', 1);
  15001. * // => true
  15002. */
  15003. function startsWith(string, target, position) {
  15004. string = toString(string);
  15005. position = position == null
  15006. ? 0
  15007. : baseClamp(toInteger(position), 0, string.length);
  15008. target = baseToString(target);
  15009. return string.slice(position, position + target.length) == target;
  15010. }
  15011. /**
  15012. * Creates a compiled template function that can interpolate data properties
  15013. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15014. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15015. * properties may be accessed as free variables in the template. If a setting
  15016. * object is given, it takes precedence over `_.templateSettings` values.
  15017. *
  15018. * **Note:** In the development build `_.template` utilizes
  15019. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15020. * for easier debugging.
  15021. *
  15022. * For more information on precompiling templates see
  15023. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15024. *
  15025. * For more information on Chrome extension sandboxes see
  15026. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15027. *
  15028. * @static
  15029. * @since 0.1.0
  15030. * @memberOf _
  15031. * @category String
  15032. * @param {string} [string=''] The template string.
  15033. * @param {Object} [options={}] The options object.
  15034. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15035. * The HTML "escape" delimiter.
  15036. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15037. * The "evaluate" delimiter.
  15038. * @param {Object} [options.imports=_.templateSettings.imports]
  15039. * An object to import into the template as free variables.
  15040. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15041. * The "interpolate" delimiter.
  15042. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15043. * The sourceURL of the compiled template.
  15044. * @param {string} [options.variable='obj']
  15045. * The data object variable name.
  15046. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15047. * @returns {Function} Returns the compiled template function.
  15048. * @example
  15049. *
  15050. * // Use the "interpolate" delimiter to create a compiled template.
  15051. * var compiled = _.template('hello <%= user %>!');
  15052. * compiled({ 'user': 'fred' });
  15053. * // => 'hello fred!'
  15054. *
  15055. * // Use the HTML "escape" delimiter to escape data property values.
  15056. * var compiled = _.template('<b><%- value %></b>');
  15057. * compiled({ 'value': '<script>' });
  15058. * // => '<b>&lt;script&gt;</b>'
  15059. *
  15060. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15061. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15062. * compiled({ 'users': ['fred', 'barney'] });
  15063. * // => '<li>fred</li><li>barney</li>'
  15064. *
  15065. * // Use the internal `print` function in "evaluate" delimiters.
  15066. * var compiled = _.template('<% print("hello " + user); %>!');
  15067. * compiled({ 'user': 'barney' });
  15068. * // => 'hello barney!'
  15069. *
  15070. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15071. * // Disable support by replacing the "interpolate" delimiter.
  15072. * var compiled = _.template('hello ${ user }!');
  15073. * compiled({ 'user': 'pebbles' });
  15074. * // => 'hello pebbles!'
  15075. *
  15076. * // Use backslashes to treat delimiters as plain text.
  15077. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15078. * compiled({ 'value': 'ignored' });
  15079. * // => '<%- value %>'
  15080. *
  15081. * // Use the `imports` option to import `jQuery` as `jq`.
  15082. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15083. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15084. * compiled({ 'users': ['fred', 'barney'] });
  15085. * // => '<li>fred</li><li>barney</li>'
  15086. *
  15087. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15088. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15089. * compiled(data);
  15090. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15091. *
  15092. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15093. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15094. * compiled.source;
  15095. * // => function(data) {
  15096. * // var __t, __p = '';
  15097. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15098. * // return __p;
  15099. * // }
  15100. *
  15101. * // Use custom template delimiters.
  15102. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15103. * var compiled = _.template('hello {{ user }}!');
  15104. * compiled({ 'user': 'mustache' });
  15105. * // => 'hello mustache!'
  15106. *
  15107. * // Use the `source` property to inline compiled templates for meaningful
  15108. * // line numbers in error messages and stack traces.
  15109. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15110. * var JST = {\
  15111. * "main": ' + _.template(mainText).source + '\
  15112. * };\
  15113. * ');
  15114. */
  15115. function template(string, options, guard) {
  15116. // Based on John Resig's `tmpl` implementation
  15117. // (http://ejohn.org/blog/javascript-micro-templating/)
  15118. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15119. var settings = lodash.templateSettings;
  15120. if (guard && isIterateeCall(string, options, guard)) {
  15121. options = undefined;
  15122. }
  15123. string = toString(string);
  15124. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15125. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15126. importsKeys = keys(imports),
  15127. importsValues = baseValues(imports, importsKeys);
  15128. var isEscaping,
  15129. isEvaluating,
  15130. index = 0,
  15131. interpolate = options.interpolate || reNoMatch,
  15132. source = "__p += '";
  15133. // Compile the regexp to match each delimiter.
  15134. var reDelimiters = RegExp(
  15135. (options.escape || reNoMatch).source + '|' +
  15136. interpolate.source + '|' +
  15137. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15138. (options.evaluate || reNoMatch).source + '|$'
  15139. , 'g');
  15140. // Use a sourceURL for easier debugging.
  15141. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15142. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15143. // and escape the comment, thus injecting code that gets evaled.
  15144. var sourceURL = '//# sourceURL=' +
  15145. (hasOwnProperty.call(options, 'sourceURL')
  15146. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15147. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15148. ) + '\n';
  15149. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15150. interpolateValue || (interpolateValue = esTemplateValue);
  15151. // Escape characters that can't be included in string literals.
  15152. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15153. // Replace delimiters with snippets.
  15154. if (escapeValue) {
  15155. isEscaping = true;
  15156. source += "' +\n__e(" + escapeValue + ") +\n'";
  15157. }
  15158. if (evaluateValue) {
  15159. isEvaluating = true;
  15160. source += "';\n" + evaluateValue + ";\n__p += '";
  15161. }
  15162. if (interpolateValue) {
  15163. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15164. }
  15165. index = offset + match.length;
  15166. // The JS engine embedded in Adobe products needs `match` returned in
  15167. // order to produce the correct `offset` value.
  15168. return match;
  15169. });
  15170. source += "';\n";
  15171. // If `variable` is not specified wrap a with-statement around the generated
  15172. // code to add the data object to the top of the scope chain.
  15173. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15174. if (!variable) {
  15175. source = 'with (obj) {\n' + source + '\n}\n';
  15176. }
  15177. // Throw an error if a forbidden character was found in `variable`, to prevent
  15178. // potential command injection attacks.
  15179. else if (reForbiddenIdentifierChars.test(variable)) {
  15180. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15181. }
  15182. // Cleanup code by stripping empty strings.
  15183. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15184. .replace(reEmptyStringMiddle, '$1')
  15185. .replace(reEmptyStringTrailing, '$1;');
  15186. // Frame code as the function body.
  15187. source = 'function(' + (variable || 'obj') + ') {\n' +
  15188. (variable
  15189. ? ''
  15190. : 'obj || (obj = {});\n'
  15191. ) +
  15192. "var __t, __p = ''" +
  15193. (isEscaping
  15194. ? ', __e = _.escape'
  15195. : ''
  15196. ) +
  15197. (isEvaluating
  15198. ? ', __j = Array.prototype.join;\n' +
  15199. "function print() { __p += __j.call(arguments, '') }\n"
  15200. : ';\n'
  15201. ) +
  15202. source +
  15203. 'return __p\n}';
  15204. var result = attempt(function() {
  15205. return Function(importsKeys, sourceURL + 'return ' + source)
  15206. .apply(undefined, importsValues);
  15207. });
  15208. // Provide the compiled function's source by its `toString` method or
  15209. // the `source` property as a convenience for inlining compiled templates.
  15210. result.source = source;
  15211. if (isError(result)) {
  15212. throw result;
  15213. }
  15214. return result;
  15215. }
  15216. /**
  15217. * Converts `string`, as a whole, to lower case just like
  15218. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15219. *
  15220. * @static
  15221. * @memberOf _
  15222. * @since 4.0.0
  15223. * @category String
  15224. * @param {string} [string=''] The string to convert.
  15225. * @returns {string} Returns the lower cased string.
  15226. * @example
  15227. *
  15228. * _.toLower('--Foo-Bar--');
  15229. * // => '--foo-bar--'
  15230. *
  15231. * _.toLower('fooBar');
  15232. * // => 'foobar'
  15233. *
  15234. * _.toLower('__FOO_BAR__');
  15235. * // => '__foo_bar__'
  15236. */
  15237. function toLower(value) {
  15238. return toString(value).toLowerCase();
  15239. }
  15240. /**
  15241. * Converts `string`, as a whole, to upper case just like
  15242. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15243. *
  15244. * @static
  15245. * @memberOf _
  15246. * @since 4.0.0
  15247. * @category String
  15248. * @param {string} [string=''] The string to convert.
  15249. * @returns {string} Returns the upper cased string.
  15250. * @example
  15251. *
  15252. * _.toUpper('--foo-bar--');
  15253. * // => '--FOO-BAR--'
  15254. *
  15255. * _.toUpper('fooBar');
  15256. * // => 'FOOBAR'
  15257. *
  15258. * _.toUpper('__foo_bar__');
  15259. * // => '__FOO_BAR__'
  15260. */
  15261. function toUpper(value) {
  15262. return toString(value).toUpperCase();
  15263. }
  15264. /**
  15265. * Removes leading and trailing whitespace or specified characters from `string`.
  15266. *
  15267. * @static
  15268. * @memberOf _
  15269. * @since 3.0.0
  15270. * @category String
  15271. * @param {string} [string=''] The string to trim.
  15272. * @param {string} [chars=whitespace] The characters to trim.
  15273. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15274. * @returns {string} Returns the trimmed string.
  15275. * @example
  15276. *
  15277. * _.trim(' abc ');
  15278. * // => 'abc'
  15279. *
  15280. * _.trim('-_-abc-_-', '_-');
  15281. * // => 'abc'
  15282. *
  15283. * _.map([' foo ', ' bar '], _.trim);
  15284. * // => ['foo', 'bar']
  15285. */
  15286. function trim(string, chars, guard) {
  15287. string = toString(string);
  15288. if (string && (guard || chars === undefined)) {
  15289. return baseTrim(string);
  15290. }
  15291. if (!string || !(chars = baseToString(chars))) {
  15292. return string;
  15293. }
  15294. var strSymbols = stringToArray(string),
  15295. chrSymbols = stringToArray(chars),
  15296. start = charsStartIndex(strSymbols, chrSymbols),
  15297. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15298. return castSlice(strSymbols, start, end).join('');
  15299. }
  15300. /**
  15301. * Removes trailing whitespace or specified characters from `string`.
  15302. *
  15303. * @static
  15304. * @memberOf _
  15305. * @since 4.0.0
  15306. * @category String
  15307. * @param {string} [string=''] The string to trim.
  15308. * @param {string} [chars=whitespace] The characters to trim.
  15309. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15310. * @returns {string} Returns the trimmed string.
  15311. * @example
  15312. *
  15313. * _.trimEnd(' abc ');
  15314. * // => ' abc'
  15315. *
  15316. * _.trimEnd('-_-abc-_-', '_-');
  15317. * // => '-_-abc'
  15318. */
  15319. function trimEnd(string, chars, guard) {
  15320. string = toString(string);
  15321. if (string && (guard || chars === undefined)) {
  15322. return string.slice(0, trimmedEndIndex(string) + 1);
  15323. }
  15324. if (!string || !(chars = baseToString(chars))) {
  15325. return string;
  15326. }
  15327. var strSymbols = stringToArray(string),
  15328. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15329. return castSlice(strSymbols, 0, end).join('');
  15330. }
  15331. /**
  15332. * Removes leading whitespace or specified characters from `string`.
  15333. *
  15334. * @static
  15335. * @memberOf _
  15336. * @since 4.0.0
  15337. * @category String
  15338. * @param {string} [string=''] The string to trim.
  15339. * @param {string} [chars=whitespace] The characters to trim.
  15340. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15341. * @returns {string} Returns the trimmed string.
  15342. * @example
  15343. *
  15344. * _.trimStart(' abc ');
  15345. * // => 'abc '
  15346. *
  15347. * _.trimStart('-_-abc-_-', '_-');
  15348. * // => 'abc-_-'
  15349. */
  15350. function trimStart(string, chars, guard) {
  15351. string = toString(string);
  15352. if (string && (guard || chars === undefined)) {
  15353. return string.replace(reTrimStart, '');
  15354. }
  15355. if (!string || !(chars = baseToString(chars))) {
  15356. return string;
  15357. }
  15358. var strSymbols = stringToArray(string),
  15359. start = charsStartIndex(strSymbols, stringToArray(chars));
  15360. return castSlice(strSymbols, start).join('');
  15361. }
  15362. /**
  15363. * Truncates `string` if it's longer than the given maximum string length.
  15364. * The last characters of the truncated string are replaced with the omission
  15365. * string which defaults to "...".
  15366. *
  15367. * @static
  15368. * @memberOf _
  15369. * @since 4.0.0
  15370. * @category String
  15371. * @param {string} [string=''] The string to truncate.
  15372. * @param {Object} [options={}] The options object.
  15373. * @param {number} [options.length=30] The maximum string length.
  15374. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15375. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15376. * @returns {string} Returns the truncated string.
  15377. * @example
  15378. *
  15379. * _.truncate('hi-diddly-ho there, neighborino');
  15380. * // => 'hi-diddly-ho there, neighbo...'
  15381. *
  15382. * _.truncate('hi-diddly-ho there, neighborino', {
  15383. * 'length': 24,
  15384. * 'separator': ' '
  15385. * });
  15386. * // => 'hi-diddly-ho there,...'
  15387. *
  15388. * _.truncate('hi-diddly-ho there, neighborino', {
  15389. * 'length': 24,
  15390. * 'separator': /,? +/
  15391. * });
  15392. * // => 'hi-diddly-ho there...'
  15393. *
  15394. * _.truncate('hi-diddly-ho there, neighborino', {
  15395. * 'omission': ' [...]'
  15396. * });
  15397. * // => 'hi-diddly-ho there, neig [...]'
  15398. */
  15399. function truncate(string, options) {
  15400. var length = DEFAULT_TRUNC_LENGTH,
  15401. omission = DEFAULT_TRUNC_OMISSION;
  15402. if (isObject(options)) {
  15403. var separator = 'separator' in options ? options.separator : separator;
  15404. length = 'length' in options ? toInteger(options.length) : length;
  15405. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15406. }
  15407. string = toString(string);
  15408. var strLength = string.length;
  15409. if (hasUnicode(string)) {
  15410. var strSymbols = stringToArray(string);
  15411. strLength = strSymbols.length;
  15412. }
  15413. if (length >= strLength) {
  15414. return string;
  15415. }
  15416. var end = length - stringSize(omission);
  15417. if (end < 1) {
  15418. return omission;
  15419. }
  15420. var result = strSymbols
  15421. ? castSlice(strSymbols, 0, end).join('')
  15422. : string.slice(0, end);
  15423. if (separator === undefined) {
  15424. return result + omission;
  15425. }
  15426. if (strSymbols) {
  15427. end += (result.length - end);
  15428. }
  15429. if (isRegExp(separator)) {
  15430. if (string.slice(end).search(separator)) {
  15431. var match,
  15432. substring = result;
  15433. if (!separator.global) {
  15434. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15435. }
  15436. separator.lastIndex = 0;
  15437. while ((match = separator.exec(substring))) {
  15438. var newEnd = match.index;
  15439. }
  15440. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15441. }
  15442. } else if (string.indexOf(baseToString(separator), end) != end) {
  15443. var index = result.lastIndexOf(separator);
  15444. if (index > -1) {
  15445. result = result.slice(0, index);
  15446. }
  15447. }
  15448. return result + omission;
  15449. }
  15450. /**
  15451. * The inverse of `_.escape`; this method converts the HTML entities
  15452. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15453. * their corresponding characters.
  15454. *
  15455. * **Note:** No other HTML entities are unescaped. To unescape additional
  15456. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15457. *
  15458. * @static
  15459. * @memberOf _
  15460. * @since 0.6.0
  15461. * @category String
  15462. * @param {string} [string=''] The string to unescape.
  15463. * @returns {string} Returns the unescaped string.
  15464. * @example
  15465. *
  15466. * _.unescape('fred, barney, &amp; pebbles');
  15467. * // => 'fred, barney, & pebbles'
  15468. */
  15469. function unescape(string) {
  15470. string = toString(string);
  15471. return (string && reHasEscapedHtml.test(string))
  15472. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15473. : string;
  15474. }
  15475. /**
  15476. * Converts `string`, as space separated words, to upper case.
  15477. *
  15478. * @static
  15479. * @memberOf _
  15480. * @since 4.0.0
  15481. * @category String
  15482. * @param {string} [string=''] The string to convert.
  15483. * @returns {string} Returns the upper cased string.
  15484. * @example
  15485. *
  15486. * _.upperCase('--foo-bar');
  15487. * // => 'FOO BAR'
  15488. *
  15489. * _.upperCase('fooBar');
  15490. * // => 'FOO BAR'
  15491. *
  15492. * _.upperCase('__foo_bar__');
  15493. * // => 'FOO BAR'
  15494. */
  15495. var upperCase = createCompounder(function(result, word, index) {
  15496. return result + (index ? ' ' : '') + word.toUpperCase();
  15497. });
  15498. /**
  15499. * Converts the first character of `string` to upper case.
  15500. *
  15501. * @static
  15502. * @memberOf _
  15503. * @since 4.0.0
  15504. * @category String
  15505. * @param {string} [string=''] The string to convert.
  15506. * @returns {string} Returns the converted string.
  15507. * @example
  15508. *
  15509. * _.upperFirst('fred');
  15510. * // => 'Fred'
  15511. *
  15512. * _.upperFirst('FRED');
  15513. * // => 'FRED'
  15514. */
  15515. var upperFirst = createCaseFirst('toUpperCase');
  15516. /**
  15517. * Splits `string` into an array of its words.
  15518. *
  15519. * @static
  15520. * @memberOf _
  15521. * @since 3.0.0
  15522. * @category String
  15523. * @param {string} [string=''] The string to inspect.
  15524. * @param {RegExp|string} [pattern] The pattern to match words.
  15525. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15526. * @returns {Array} Returns the words of `string`.
  15527. * @example
  15528. *
  15529. * _.words('fred, barney, & pebbles');
  15530. * // => ['fred', 'barney', 'pebbles']
  15531. *
  15532. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15533. * // => ['fred', 'barney', '&', 'pebbles']
  15534. */
  15535. function words(string, pattern, guard) {
  15536. string = toString(string);
  15537. pattern = guard ? undefined : pattern;
  15538. if (pattern === undefined) {
  15539. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15540. }
  15541. return string.match(pattern) || [];
  15542. }
  15543. /*------------------------------------------------------------------------*/
  15544. /**
  15545. * Attempts to invoke `func`, returning either the result or the caught error
  15546. * object. Any additional arguments are provided to `func` when it's invoked.
  15547. *
  15548. * @static
  15549. * @memberOf _
  15550. * @since 3.0.0
  15551. * @category Util
  15552. * @param {Function} func The function to attempt.
  15553. * @param {...*} [args] The arguments to invoke `func` with.
  15554. * @returns {*} Returns the `func` result or error object.
  15555. * @example
  15556. *
  15557. * // Avoid throwing errors for invalid selectors.
  15558. * var elements = _.attempt(function(selector) {
  15559. * return document.querySelectorAll(selector);
  15560. * }, '>_>');
  15561. *
  15562. * if (_.isError(elements)) {
  15563. * elements = [];
  15564. * }
  15565. */
  15566. var attempt = baseRest(function(func, args) {
  15567. try {
  15568. return apply(func, undefined, args);
  15569. } catch (e) {
  15570. return isError(e) ? e : new Error(e);
  15571. }
  15572. });
  15573. /**
  15574. * Binds methods of an object to the object itself, overwriting the existing
  15575. * method.
  15576. *
  15577. * **Note:** This method doesn't set the "length" property of bound functions.
  15578. *
  15579. * @static
  15580. * @since 0.1.0
  15581. * @memberOf _
  15582. * @category Util
  15583. * @param {Object} object The object to bind and assign the bound methods to.
  15584. * @param {...(string|string[])} methodNames The object method names to bind.
  15585. * @returns {Object} Returns `object`.
  15586. * @example
  15587. *
  15588. * var view = {
  15589. * 'label': 'docs',
  15590. * 'click': function() {
  15591. * console.log('clicked ' + this.label);
  15592. * }
  15593. * };
  15594. *
  15595. * _.bindAll(view, ['click']);
  15596. * jQuery(element).on('click', view.click);
  15597. * // => Logs 'clicked docs' when clicked.
  15598. */
  15599. var bindAll = flatRest(function(object, methodNames) {
  15600. arrayEach(methodNames, function(key) {
  15601. key = toKey(key);
  15602. baseAssignValue(object, key, bind(object[key], object));
  15603. });
  15604. return object;
  15605. });
  15606. /**
  15607. * Creates a function that iterates over `pairs` and invokes the corresponding
  15608. * function of the first predicate to return truthy. The predicate-function
  15609. * pairs are invoked with the `this` binding and arguments of the created
  15610. * function.
  15611. *
  15612. * @static
  15613. * @memberOf _
  15614. * @since 4.0.0
  15615. * @category Util
  15616. * @param {Array} pairs The predicate-function pairs.
  15617. * @returns {Function} Returns the new composite function.
  15618. * @example
  15619. *
  15620. * var func = _.cond([
  15621. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15622. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15623. * [_.stubTrue, _.constant('no match')]
  15624. * ]);
  15625. *
  15626. * func({ 'a': 1, 'b': 2 });
  15627. * // => 'matches A'
  15628. *
  15629. * func({ 'a': 0, 'b': 1 });
  15630. * // => 'matches B'
  15631. *
  15632. * func({ 'a': '1', 'b': '2' });
  15633. * // => 'no match'
  15634. */
  15635. function cond(pairs) {
  15636. var length = pairs == null ? 0 : pairs.length,
  15637. toIteratee = getIteratee();
  15638. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15639. if (typeof pair[1] != 'function') {
  15640. throw new TypeError(FUNC_ERROR_TEXT);
  15641. }
  15642. return [toIteratee(pair[0]), pair[1]];
  15643. });
  15644. return baseRest(function(args) {
  15645. var index = -1;
  15646. while (++index < length) {
  15647. var pair = pairs[index];
  15648. if (apply(pair[0], this, args)) {
  15649. return apply(pair[1], this, args);
  15650. }
  15651. }
  15652. });
  15653. }
  15654. /**
  15655. * Creates a function that invokes the predicate properties of `source` with
  15656. * the corresponding property values of a given object, returning `true` if
  15657. * all predicates return truthy, else `false`.
  15658. *
  15659. * **Note:** The created function is equivalent to `_.conformsTo` with
  15660. * `source` partially applied.
  15661. *
  15662. * @static
  15663. * @memberOf _
  15664. * @since 4.0.0
  15665. * @category Util
  15666. * @param {Object} source The object of property predicates to conform to.
  15667. * @returns {Function} Returns the new spec function.
  15668. * @example
  15669. *
  15670. * var objects = [
  15671. * { 'a': 2, 'b': 1 },
  15672. * { 'a': 1, 'b': 2 }
  15673. * ];
  15674. *
  15675. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15676. * // => [{ 'a': 1, 'b': 2 }]
  15677. */
  15678. function conforms(source) {
  15679. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15680. }
  15681. /**
  15682. * Creates a function that returns `value`.
  15683. *
  15684. * @static
  15685. * @memberOf _
  15686. * @since 2.4.0
  15687. * @category Util
  15688. * @param {*} value The value to return from the new function.
  15689. * @returns {Function} Returns the new constant function.
  15690. * @example
  15691. *
  15692. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15693. *
  15694. * console.log(objects);
  15695. * // => [{ 'a': 1 }, { 'a': 1 }]
  15696. *
  15697. * console.log(objects[0] === objects[1]);
  15698. * // => true
  15699. */
  15700. function constant(value) {
  15701. return function() {
  15702. return value;
  15703. };
  15704. }
  15705. /**
  15706. * Checks `value` to determine whether a default value should be returned in
  15707. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15708. * or `undefined`.
  15709. *
  15710. * @static
  15711. * @memberOf _
  15712. * @since 4.14.0
  15713. * @category Util
  15714. * @param {*} value The value to check.
  15715. * @param {*} defaultValue The default value.
  15716. * @returns {*} Returns the resolved value.
  15717. * @example
  15718. *
  15719. * _.defaultTo(1, 10);
  15720. * // => 1
  15721. *
  15722. * _.defaultTo(undefined, 10);
  15723. * // => 10
  15724. */
  15725. function defaultTo(value, defaultValue) {
  15726. return (value == null || value !== value) ? defaultValue : value;
  15727. }
  15728. /**
  15729. * Creates a function that returns the result of invoking the given functions
  15730. * with the `this` binding of the created function, where each successive
  15731. * invocation is supplied the return value of the previous.
  15732. *
  15733. * @static
  15734. * @memberOf _
  15735. * @since 3.0.0
  15736. * @category Util
  15737. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15738. * @returns {Function} Returns the new composite function.
  15739. * @see _.flowRight
  15740. * @example
  15741. *
  15742. * function square(n) {
  15743. * return n * n;
  15744. * }
  15745. *
  15746. * var addSquare = _.flow([_.add, square]);
  15747. * addSquare(1, 2);
  15748. * // => 9
  15749. */
  15750. var flow = createFlow();
  15751. /**
  15752. * This method is like `_.flow` except that it creates a function that
  15753. * invokes the given functions from right to left.
  15754. *
  15755. * @static
  15756. * @since 3.0.0
  15757. * @memberOf _
  15758. * @category Util
  15759. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15760. * @returns {Function} Returns the new composite function.
  15761. * @see _.flow
  15762. * @example
  15763. *
  15764. * function square(n) {
  15765. * return n * n;
  15766. * }
  15767. *
  15768. * var addSquare = _.flowRight([square, _.add]);
  15769. * addSquare(1, 2);
  15770. * // => 9
  15771. */
  15772. var flowRight = createFlow(true);
  15773. /**
  15774. * This method returns the first argument it receives.
  15775. *
  15776. * @static
  15777. * @since 0.1.0
  15778. * @memberOf _
  15779. * @category Util
  15780. * @param {*} value Any value.
  15781. * @returns {*} Returns `value`.
  15782. * @example
  15783. *
  15784. * var object = { 'a': 1 };
  15785. *
  15786. * console.log(_.identity(object) === object);
  15787. * // => true
  15788. */
  15789. function identity(value) {
  15790. return value;
  15791. }
  15792. /**
  15793. * Creates a function that invokes `func` with the arguments of the created
  15794. * function. If `func` is a property name, the created function returns the
  15795. * property value for a given element. If `func` is an array or object, the
  15796. * created function returns `true` for elements that contain the equivalent
  15797. * source properties, otherwise it returns `false`.
  15798. *
  15799. * @static
  15800. * @since 4.0.0
  15801. * @memberOf _
  15802. * @category Util
  15803. * @param {*} [func=_.identity] The value to convert to a callback.
  15804. * @returns {Function} Returns the callback.
  15805. * @example
  15806. *
  15807. * var users = [
  15808. * { 'user': 'barney', 'age': 36, 'active': true },
  15809. * { 'user': 'fred', 'age': 40, 'active': false }
  15810. * ];
  15811. *
  15812. * // The `_.matches` iteratee shorthand.
  15813. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15814. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15815. *
  15816. * // The `_.matchesProperty` iteratee shorthand.
  15817. * _.filter(users, _.iteratee(['user', 'fred']));
  15818. * // => [{ 'user': 'fred', 'age': 40 }]
  15819. *
  15820. * // The `_.property` iteratee shorthand.
  15821. * _.map(users, _.iteratee('user'));
  15822. * // => ['barney', 'fred']
  15823. *
  15824. * // Create custom iteratee shorthands.
  15825. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15826. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15827. * return func.test(string);
  15828. * };
  15829. * });
  15830. *
  15831. * _.filter(['abc', 'def'], /ef/);
  15832. * // => ['def']
  15833. */
  15834. function iteratee(func) {
  15835. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15836. }
  15837. /**
  15838. * Creates a function that performs a partial deep comparison between a given
  15839. * object and `source`, returning `true` if the given object has equivalent
  15840. * property values, else `false`.
  15841. *
  15842. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15843. * partially applied.
  15844. *
  15845. * Partial comparisons will match empty array and empty object `source`
  15846. * values against any array or object value, respectively. See `_.isEqual`
  15847. * for a list of supported value comparisons.
  15848. *
  15849. * **Note:** Multiple values can be checked by combining several matchers
  15850. * using `_.overSome`
  15851. *
  15852. * @static
  15853. * @memberOf _
  15854. * @since 3.0.0
  15855. * @category Util
  15856. * @param {Object} source The object of property values to match.
  15857. * @returns {Function} Returns the new spec function.
  15858. * @example
  15859. *
  15860. * var objects = [
  15861. * { 'a': 1, 'b': 2, 'c': 3 },
  15862. * { 'a': 4, 'b': 5, 'c': 6 }
  15863. * ];
  15864. *
  15865. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15866. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15867. *
  15868. * // Checking for several possible values
  15869. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15870. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15871. */
  15872. function matches(source) {
  15873. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15874. }
  15875. /**
  15876. * Creates a function that performs a partial deep comparison between the
  15877. * value at `path` of a given object to `srcValue`, returning `true` if the
  15878. * object value is equivalent, else `false`.
  15879. *
  15880. * **Note:** Partial comparisons will match empty array and empty object
  15881. * `srcValue` values against any array or object value, respectively. See
  15882. * `_.isEqual` for a list of supported value comparisons.
  15883. *
  15884. * **Note:** Multiple values can be checked by combining several matchers
  15885. * using `_.overSome`
  15886. *
  15887. * @static
  15888. * @memberOf _
  15889. * @since 3.2.0
  15890. * @category Util
  15891. * @param {Array|string} path The path of the property to get.
  15892. * @param {*} srcValue The value to match.
  15893. * @returns {Function} Returns the new spec function.
  15894. * @example
  15895. *
  15896. * var objects = [
  15897. * { 'a': 1, 'b': 2, 'c': 3 },
  15898. * { 'a': 4, 'b': 5, 'c': 6 }
  15899. * ];
  15900. *
  15901. * _.find(objects, _.matchesProperty('a', 4));
  15902. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15903. *
  15904. * // Checking for several possible values
  15905. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15906. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15907. */
  15908. function matchesProperty(path, srcValue) {
  15909. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15910. }
  15911. /**
  15912. * Creates a function that invokes the method at `path` of a given object.
  15913. * Any additional arguments are provided to the invoked method.
  15914. *
  15915. * @static
  15916. * @memberOf _
  15917. * @since 3.7.0
  15918. * @category Util
  15919. * @param {Array|string} path The path of the method to invoke.
  15920. * @param {...*} [args] The arguments to invoke the method with.
  15921. * @returns {Function} Returns the new invoker function.
  15922. * @example
  15923. *
  15924. * var objects = [
  15925. * { 'a': { 'b': _.constant(2) } },
  15926. * { 'a': { 'b': _.constant(1) } }
  15927. * ];
  15928. *
  15929. * _.map(objects, _.method('a.b'));
  15930. * // => [2, 1]
  15931. *
  15932. * _.map(objects, _.method(['a', 'b']));
  15933. * // => [2, 1]
  15934. */
  15935. var method = baseRest(function(path, args) {
  15936. return function(object) {
  15937. return baseInvoke(object, path, args);
  15938. };
  15939. });
  15940. /**
  15941. * The opposite of `_.method`; this method creates a function that invokes
  15942. * the method at a given path of `object`. Any additional arguments are
  15943. * provided to the invoked method.
  15944. *
  15945. * @static
  15946. * @memberOf _
  15947. * @since 3.7.0
  15948. * @category Util
  15949. * @param {Object} object The object to query.
  15950. * @param {...*} [args] The arguments to invoke the method with.
  15951. * @returns {Function} Returns the new invoker function.
  15952. * @example
  15953. *
  15954. * var array = _.times(3, _.constant),
  15955. * object = { 'a': array, 'b': array, 'c': array };
  15956. *
  15957. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15958. * // => [2, 0]
  15959. *
  15960. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15961. * // => [2, 0]
  15962. */
  15963. var methodOf = baseRest(function(object, args) {
  15964. return function(path) {
  15965. return baseInvoke(object, path, args);
  15966. };
  15967. });
  15968. /**
  15969. * Adds all own enumerable string keyed function properties of a source
  15970. * object to the destination object. If `object` is a function, then methods
  15971. * are added to its prototype as well.
  15972. *
  15973. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15974. * avoid conflicts caused by modifying the original.
  15975. *
  15976. * @static
  15977. * @since 0.1.0
  15978. * @memberOf _
  15979. * @category Util
  15980. * @param {Function|Object} [object=lodash] The destination object.
  15981. * @param {Object} source The object of functions to add.
  15982. * @param {Object} [options={}] The options object.
  15983. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15984. * @returns {Function|Object} Returns `object`.
  15985. * @example
  15986. *
  15987. * function vowels(string) {
  15988. * return _.filter(string, function(v) {
  15989. * return /[aeiou]/i.test(v);
  15990. * });
  15991. * }
  15992. *
  15993. * _.mixin({ 'vowels': vowels });
  15994. * _.vowels('fred');
  15995. * // => ['e']
  15996. *
  15997. * _('fred').vowels().value();
  15998. * // => ['e']
  15999. *
  16000. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16001. * _('fred').vowels();
  16002. * // => ['e']
  16003. */
  16004. function mixin(object, source, options) {
  16005. var props = keys(source),
  16006. methodNames = baseFunctions(source, props);
  16007. if (options == null &&
  16008. !(isObject(source) && (methodNames.length || !props.length))) {
  16009. options = source;
  16010. source = object;
  16011. object = this;
  16012. methodNames = baseFunctions(source, keys(source));
  16013. }
  16014. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16015. isFunc = isFunction(object);
  16016. arrayEach(methodNames, function(methodName) {
  16017. var func = source[methodName];
  16018. object[methodName] = func;
  16019. if (isFunc) {
  16020. object.prototype[methodName] = function() {
  16021. var chainAll = this.__chain__;
  16022. if (chain || chainAll) {
  16023. var result = object(this.__wrapped__),
  16024. actions = result.__actions__ = copyArray(this.__actions__);
  16025. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16026. result.__chain__ = chainAll;
  16027. return result;
  16028. }
  16029. return func.apply(object, arrayPush([this.value()], arguments));
  16030. };
  16031. }
  16032. });
  16033. return object;
  16034. }
  16035. /**
  16036. * Reverts the `_` variable to its previous value and returns a reference to
  16037. * the `lodash` function.
  16038. *
  16039. * @static
  16040. * @since 0.1.0
  16041. * @memberOf _
  16042. * @category Util
  16043. * @returns {Function} Returns the `lodash` function.
  16044. * @example
  16045. *
  16046. * var lodash = _.noConflict();
  16047. */
  16048. function noConflict() {
  16049. if (root._ === this) {
  16050. root._ = oldDash;
  16051. }
  16052. return this;
  16053. }
  16054. /**
  16055. * This method returns `undefined`.
  16056. *
  16057. * @static
  16058. * @memberOf _
  16059. * @since 2.3.0
  16060. * @category Util
  16061. * @example
  16062. *
  16063. * _.times(2, _.noop);
  16064. * // => [undefined, undefined]
  16065. */
  16066. function noop() {
  16067. // No operation performed.
  16068. }
  16069. /**
  16070. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16071. * the nth argument from the end is returned.
  16072. *
  16073. * @static
  16074. * @memberOf _
  16075. * @since 4.0.0
  16076. * @category Util
  16077. * @param {number} [n=0] The index of the argument to return.
  16078. * @returns {Function} Returns the new pass-thru function.
  16079. * @example
  16080. *
  16081. * var func = _.nthArg(1);
  16082. * func('a', 'b', 'c', 'd');
  16083. * // => 'b'
  16084. *
  16085. * var func = _.nthArg(-2);
  16086. * func('a', 'b', 'c', 'd');
  16087. * // => 'c'
  16088. */
  16089. function nthArg(n) {
  16090. n = toInteger(n);
  16091. return baseRest(function(args) {
  16092. return baseNth(args, n);
  16093. });
  16094. }
  16095. /**
  16096. * Creates a function that invokes `iteratees` with the arguments it receives
  16097. * and returns their results.
  16098. *
  16099. * @static
  16100. * @memberOf _
  16101. * @since 4.0.0
  16102. * @category Util
  16103. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16104. * The iteratees to invoke.
  16105. * @returns {Function} Returns the new function.
  16106. * @example
  16107. *
  16108. * var func = _.over([Math.max, Math.min]);
  16109. *
  16110. * func(1, 2, 3, 4);
  16111. * // => [4, 1]
  16112. */
  16113. var over = createOver(arrayMap);
  16114. /**
  16115. * Creates a function that checks if **all** of the `predicates` return
  16116. * truthy when invoked with the arguments it receives.
  16117. *
  16118. * Following shorthands are possible for providing predicates.
  16119. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16120. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16121. *
  16122. * @static
  16123. * @memberOf _
  16124. * @since 4.0.0
  16125. * @category Util
  16126. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16127. * The predicates to check.
  16128. * @returns {Function} Returns the new function.
  16129. * @example
  16130. *
  16131. * var func = _.overEvery([Boolean, isFinite]);
  16132. *
  16133. * func('1');
  16134. * // => true
  16135. *
  16136. * func(null);
  16137. * // => false
  16138. *
  16139. * func(NaN);
  16140. * // => false
  16141. */
  16142. var overEvery = createOver(arrayEvery);
  16143. /**
  16144. * Creates a function that checks if **any** of the `predicates` return
  16145. * truthy when invoked with the arguments it receives.
  16146. *
  16147. * Following shorthands are possible for providing predicates.
  16148. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16149. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16150. *
  16151. * @static
  16152. * @memberOf _
  16153. * @since 4.0.0
  16154. * @category Util
  16155. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16156. * The predicates to check.
  16157. * @returns {Function} Returns the new function.
  16158. * @example
  16159. *
  16160. * var func = _.overSome([Boolean, isFinite]);
  16161. *
  16162. * func('1');
  16163. * // => true
  16164. *
  16165. * func(null);
  16166. * // => true
  16167. *
  16168. * func(NaN);
  16169. * // => false
  16170. *
  16171. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16172. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16173. */
  16174. var overSome = createOver(arraySome);
  16175. /**
  16176. * Creates a function that returns the value at `path` of a given object.
  16177. *
  16178. * @static
  16179. * @memberOf _
  16180. * @since 2.4.0
  16181. * @category Util
  16182. * @param {Array|string} path The path of the property to get.
  16183. * @returns {Function} Returns the new accessor function.
  16184. * @example
  16185. *
  16186. * var objects = [
  16187. * { 'a': { 'b': 2 } },
  16188. * { 'a': { 'b': 1 } }
  16189. * ];
  16190. *
  16191. * _.map(objects, _.property('a.b'));
  16192. * // => [2, 1]
  16193. *
  16194. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16195. * // => [1, 2]
  16196. */
  16197. function property(path) {
  16198. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16199. }
  16200. /**
  16201. * The opposite of `_.property`; this method creates a function that returns
  16202. * the value at a given path of `object`.
  16203. *
  16204. * @static
  16205. * @memberOf _
  16206. * @since 3.0.0
  16207. * @category Util
  16208. * @param {Object} object The object to query.
  16209. * @returns {Function} Returns the new accessor function.
  16210. * @example
  16211. *
  16212. * var array = [0, 1, 2],
  16213. * object = { 'a': array, 'b': array, 'c': array };
  16214. *
  16215. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16216. * // => [2, 0]
  16217. *
  16218. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16219. * // => [2, 0]
  16220. */
  16221. function propertyOf(object) {
  16222. return function(path) {
  16223. return object == null ? undefined : baseGet(object, path);
  16224. };
  16225. }
  16226. /**
  16227. * Creates an array of numbers (positive and/or negative) progressing from
  16228. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16229. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16230. * it's set to `start` with `start` then set to `0`.
  16231. *
  16232. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16233. * floating-point values which can produce unexpected results.
  16234. *
  16235. * @static
  16236. * @since 0.1.0
  16237. * @memberOf _
  16238. * @category Util
  16239. * @param {number} [start=0] The start of the range.
  16240. * @param {number} end The end of the range.
  16241. * @param {number} [step=1] The value to increment or decrement by.
  16242. * @returns {Array} Returns the range of numbers.
  16243. * @see _.inRange, _.rangeRight
  16244. * @example
  16245. *
  16246. * _.range(4);
  16247. * // => [0, 1, 2, 3]
  16248. *
  16249. * _.range(-4);
  16250. * // => [0, -1, -2, -3]
  16251. *
  16252. * _.range(1, 5);
  16253. * // => [1, 2, 3, 4]
  16254. *
  16255. * _.range(0, 20, 5);
  16256. * // => [0, 5, 10, 15]
  16257. *
  16258. * _.range(0, -4, -1);
  16259. * // => [0, -1, -2, -3]
  16260. *
  16261. * _.range(1, 4, 0);
  16262. * // => [1, 1, 1]
  16263. *
  16264. * _.range(0);
  16265. * // => []
  16266. */
  16267. var range = createRange();
  16268. /**
  16269. * This method is like `_.range` except that it populates values in
  16270. * descending order.
  16271. *
  16272. * @static
  16273. * @memberOf _
  16274. * @since 4.0.0
  16275. * @category Util
  16276. * @param {number} [start=0] The start of the range.
  16277. * @param {number} end The end of the range.
  16278. * @param {number} [step=1] The value to increment or decrement by.
  16279. * @returns {Array} Returns the range of numbers.
  16280. * @see _.inRange, _.range
  16281. * @example
  16282. *
  16283. * _.rangeRight(4);
  16284. * // => [3, 2, 1, 0]
  16285. *
  16286. * _.rangeRight(-4);
  16287. * // => [-3, -2, -1, 0]
  16288. *
  16289. * _.rangeRight(1, 5);
  16290. * // => [4, 3, 2, 1]
  16291. *
  16292. * _.rangeRight(0, 20, 5);
  16293. * // => [15, 10, 5, 0]
  16294. *
  16295. * _.rangeRight(0, -4, -1);
  16296. * // => [-3, -2, -1, 0]
  16297. *
  16298. * _.rangeRight(1, 4, 0);
  16299. * // => [1, 1, 1]
  16300. *
  16301. * _.rangeRight(0);
  16302. * // => []
  16303. */
  16304. var rangeRight = createRange(true);
  16305. /**
  16306. * This method returns a new empty array.
  16307. *
  16308. * @static
  16309. * @memberOf _
  16310. * @since 4.13.0
  16311. * @category Util
  16312. * @returns {Array} Returns the new empty array.
  16313. * @example
  16314. *
  16315. * var arrays = _.times(2, _.stubArray);
  16316. *
  16317. * console.log(arrays);
  16318. * // => [[], []]
  16319. *
  16320. * console.log(arrays[0] === arrays[1]);
  16321. * // => false
  16322. */
  16323. function stubArray() {
  16324. return [];
  16325. }
  16326. /**
  16327. * This method returns `false`.
  16328. *
  16329. * @static
  16330. * @memberOf _
  16331. * @since 4.13.0
  16332. * @category Util
  16333. * @returns {boolean} Returns `false`.
  16334. * @example
  16335. *
  16336. * _.times(2, _.stubFalse);
  16337. * // => [false, false]
  16338. */
  16339. function stubFalse() {
  16340. return false;
  16341. }
  16342. /**
  16343. * This method returns a new empty object.
  16344. *
  16345. * @static
  16346. * @memberOf _
  16347. * @since 4.13.0
  16348. * @category Util
  16349. * @returns {Object} Returns the new empty object.
  16350. * @example
  16351. *
  16352. * var objects = _.times(2, _.stubObject);
  16353. *
  16354. * console.log(objects);
  16355. * // => [{}, {}]
  16356. *
  16357. * console.log(objects[0] === objects[1]);
  16358. * // => false
  16359. */
  16360. function stubObject() {
  16361. return {};
  16362. }
  16363. /**
  16364. * This method returns an empty string.
  16365. *
  16366. * @static
  16367. * @memberOf _
  16368. * @since 4.13.0
  16369. * @category Util
  16370. * @returns {string} Returns the empty string.
  16371. * @example
  16372. *
  16373. * _.times(2, _.stubString);
  16374. * // => ['', '']
  16375. */
  16376. function stubString() {
  16377. return '';
  16378. }
  16379. /**
  16380. * This method returns `true`.
  16381. *
  16382. * @static
  16383. * @memberOf _
  16384. * @since 4.13.0
  16385. * @category Util
  16386. * @returns {boolean} Returns `true`.
  16387. * @example
  16388. *
  16389. * _.times(2, _.stubTrue);
  16390. * // => [true, true]
  16391. */
  16392. function stubTrue() {
  16393. return true;
  16394. }
  16395. /**
  16396. * Invokes the iteratee `n` times, returning an array of the results of
  16397. * each invocation. The iteratee is invoked with one argument; (index).
  16398. *
  16399. * @static
  16400. * @since 0.1.0
  16401. * @memberOf _
  16402. * @category Util
  16403. * @param {number} n The number of times to invoke `iteratee`.
  16404. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16405. * @returns {Array} Returns the array of results.
  16406. * @example
  16407. *
  16408. * _.times(3, String);
  16409. * // => ['0', '1', '2']
  16410. *
  16411. * _.times(4, _.constant(0));
  16412. * // => [0, 0, 0, 0]
  16413. */
  16414. function times(n, iteratee) {
  16415. n = toInteger(n);
  16416. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16417. return [];
  16418. }
  16419. var index = MAX_ARRAY_LENGTH,
  16420. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16421. iteratee = getIteratee(iteratee);
  16422. n -= MAX_ARRAY_LENGTH;
  16423. var result = baseTimes(length, iteratee);
  16424. while (++index < n) {
  16425. iteratee(index);
  16426. }
  16427. return result;
  16428. }
  16429. /**
  16430. * Converts `value` to a property path array.
  16431. *
  16432. * @static
  16433. * @memberOf _
  16434. * @since 4.0.0
  16435. * @category Util
  16436. * @param {*} value The value to convert.
  16437. * @returns {Array} Returns the new property path array.
  16438. * @example
  16439. *
  16440. * _.toPath('a.b.c');
  16441. * // => ['a', 'b', 'c']
  16442. *
  16443. * _.toPath('a[0].b.c');
  16444. * // => ['a', '0', 'b', 'c']
  16445. */
  16446. function toPath(value) {
  16447. if (isArray(value)) {
  16448. return arrayMap(value, toKey);
  16449. }
  16450. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16451. }
  16452. /**
  16453. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16454. *
  16455. * @static
  16456. * @since 0.1.0
  16457. * @memberOf _
  16458. * @category Util
  16459. * @param {string} [prefix=''] The value to prefix the ID with.
  16460. * @returns {string} Returns the unique ID.
  16461. * @example
  16462. *
  16463. * _.uniqueId('contact_');
  16464. * // => 'contact_104'
  16465. *
  16466. * _.uniqueId();
  16467. * // => '105'
  16468. */
  16469. function uniqueId(prefix) {
  16470. var id = ++idCounter;
  16471. return toString(prefix) + id;
  16472. }
  16473. /*------------------------------------------------------------------------*/
  16474. /**
  16475. * Adds two numbers.
  16476. *
  16477. * @static
  16478. * @memberOf _
  16479. * @since 3.4.0
  16480. * @category Math
  16481. * @param {number} augend The first number in an addition.
  16482. * @param {number} addend The second number in an addition.
  16483. * @returns {number} Returns the total.
  16484. * @example
  16485. *
  16486. * _.add(6, 4);
  16487. * // => 10
  16488. */
  16489. var add = createMathOperation(function(augend, addend) {
  16490. return augend + addend;
  16491. }, 0);
  16492. /**
  16493. * Computes `number` rounded up to `precision`.
  16494. *
  16495. * @static
  16496. * @memberOf _
  16497. * @since 3.10.0
  16498. * @category Math
  16499. * @param {number} number The number to round up.
  16500. * @param {number} [precision=0] The precision to round up to.
  16501. * @returns {number} Returns the rounded up number.
  16502. * @example
  16503. *
  16504. * _.ceil(4.006);
  16505. * // => 5
  16506. *
  16507. * _.ceil(6.004, 2);
  16508. * // => 6.01
  16509. *
  16510. * _.ceil(6040, -2);
  16511. * // => 6100
  16512. */
  16513. var ceil = createRound('ceil');
  16514. /**
  16515. * Divide two numbers.
  16516. *
  16517. * @static
  16518. * @memberOf _
  16519. * @since 4.7.0
  16520. * @category Math
  16521. * @param {number} dividend The first number in a division.
  16522. * @param {number} divisor The second number in a division.
  16523. * @returns {number} Returns the quotient.
  16524. * @example
  16525. *
  16526. * _.divide(6, 4);
  16527. * // => 1.5
  16528. */
  16529. var divide = createMathOperation(function(dividend, divisor) {
  16530. return dividend / divisor;
  16531. }, 1);
  16532. /**
  16533. * Computes `number` rounded down to `precision`.
  16534. *
  16535. * @static
  16536. * @memberOf _
  16537. * @since 3.10.0
  16538. * @category Math
  16539. * @param {number} number The number to round down.
  16540. * @param {number} [precision=0] The precision to round down to.
  16541. * @returns {number} Returns the rounded down number.
  16542. * @example
  16543. *
  16544. * _.floor(4.006);
  16545. * // => 4
  16546. *
  16547. * _.floor(0.046, 2);
  16548. * // => 0.04
  16549. *
  16550. * _.floor(4060, -2);
  16551. * // => 4000
  16552. */
  16553. var floor = createRound('floor');
  16554. /**
  16555. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16556. * `undefined` is returned.
  16557. *
  16558. * @static
  16559. * @since 0.1.0
  16560. * @memberOf _
  16561. * @category Math
  16562. * @param {Array} array The array to iterate over.
  16563. * @returns {*} Returns the maximum value.
  16564. * @example
  16565. *
  16566. * _.max([4, 2, 8, 6]);
  16567. * // => 8
  16568. *
  16569. * _.max([]);
  16570. * // => undefined
  16571. */
  16572. function max(array) {
  16573. return (array && array.length)
  16574. ? baseExtremum(array, identity, baseGt)
  16575. : undefined;
  16576. }
  16577. /**
  16578. * This method is like `_.max` except that it accepts `iteratee` which is
  16579. * invoked for each element in `array` to generate the criterion by which
  16580. * the value is ranked. The iteratee is invoked with one argument: (value).
  16581. *
  16582. * @static
  16583. * @memberOf _
  16584. * @since 4.0.0
  16585. * @category Math
  16586. * @param {Array} array The array to iterate over.
  16587. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16588. * @returns {*} Returns the maximum value.
  16589. * @example
  16590. *
  16591. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16592. *
  16593. * _.maxBy(objects, function(o) { return o.n; });
  16594. * // => { 'n': 2 }
  16595. *
  16596. * // The `_.property` iteratee shorthand.
  16597. * _.maxBy(objects, 'n');
  16598. * // => { 'n': 2 }
  16599. */
  16600. function maxBy(array, iteratee) {
  16601. return (array && array.length)
  16602. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16603. : undefined;
  16604. }
  16605. /**
  16606. * Computes the mean of the values in `array`.
  16607. *
  16608. * @static
  16609. * @memberOf _
  16610. * @since 4.0.0
  16611. * @category Math
  16612. * @param {Array} array The array to iterate over.
  16613. * @returns {number} Returns the mean.
  16614. * @example
  16615. *
  16616. * _.mean([4, 2, 8, 6]);
  16617. * // => 5
  16618. */
  16619. function mean(array) {
  16620. return baseMean(array, identity);
  16621. }
  16622. /**
  16623. * This method is like `_.mean` except that it accepts `iteratee` which is
  16624. * invoked for each element in `array` to generate the value to be averaged.
  16625. * The iteratee is invoked with one argument: (value).
  16626. *
  16627. * @static
  16628. * @memberOf _
  16629. * @since 4.7.0
  16630. * @category Math
  16631. * @param {Array} array The array to iterate over.
  16632. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16633. * @returns {number} Returns the mean.
  16634. * @example
  16635. *
  16636. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16637. *
  16638. * _.meanBy(objects, function(o) { return o.n; });
  16639. * // => 5
  16640. *
  16641. * // The `_.property` iteratee shorthand.
  16642. * _.meanBy(objects, 'n');
  16643. * // => 5
  16644. */
  16645. function meanBy(array, iteratee) {
  16646. return baseMean(array, getIteratee(iteratee, 2));
  16647. }
  16648. /**
  16649. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16650. * `undefined` is returned.
  16651. *
  16652. * @static
  16653. * @since 0.1.0
  16654. * @memberOf _
  16655. * @category Math
  16656. * @param {Array} array The array to iterate over.
  16657. * @returns {*} Returns the minimum value.
  16658. * @example
  16659. *
  16660. * _.min([4, 2, 8, 6]);
  16661. * // => 2
  16662. *
  16663. * _.min([]);
  16664. * // => undefined
  16665. */
  16666. function min(array) {
  16667. return (array && array.length)
  16668. ? baseExtremum(array, identity, baseLt)
  16669. : undefined;
  16670. }
  16671. /**
  16672. * This method is like `_.min` except that it accepts `iteratee` which is
  16673. * invoked for each element in `array` to generate the criterion by which
  16674. * the value is ranked. The iteratee is invoked with one argument: (value).
  16675. *
  16676. * @static
  16677. * @memberOf _
  16678. * @since 4.0.0
  16679. * @category Math
  16680. * @param {Array} array The array to iterate over.
  16681. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16682. * @returns {*} Returns the minimum value.
  16683. * @example
  16684. *
  16685. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16686. *
  16687. * _.minBy(objects, function(o) { return o.n; });
  16688. * // => { 'n': 1 }
  16689. *
  16690. * // The `_.property` iteratee shorthand.
  16691. * _.minBy(objects, 'n');
  16692. * // => { 'n': 1 }
  16693. */
  16694. function minBy(array, iteratee) {
  16695. return (array && array.length)
  16696. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16697. : undefined;
  16698. }
  16699. /**
  16700. * Multiply two numbers.
  16701. *
  16702. * @static
  16703. * @memberOf _
  16704. * @since 4.7.0
  16705. * @category Math
  16706. * @param {number} multiplier The first number in a multiplication.
  16707. * @param {number} multiplicand The second number in a multiplication.
  16708. * @returns {number} Returns the product.
  16709. * @example
  16710. *
  16711. * _.multiply(6, 4);
  16712. * // => 24
  16713. */
  16714. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16715. return multiplier * multiplicand;
  16716. }, 1);
  16717. /**
  16718. * Computes `number` rounded to `precision`.
  16719. *
  16720. * @static
  16721. * @memberOf _
  16722. * @since 3.10.0
  16723. * @category Math
  16724. * @param {number} number The number to round.
  16725. * @param {number} [precision=0] The precision to round to.
  16726. * @returns {number} Returns the rounded number.
  16727. * @example
  16728. *
  16729. * _.round(4.006);
  16730. * // => 4
  16731. *
  16732. * _.round(4.006, 2);
  16733. * // => 4.01
  16734. *
  16735. * _.round(4060, -2);
  16736. * // => 4100
  16737. */
  16738. var round = createRound('round');
  16739. /**
  16740. * Subtract two numbers.
  16741. *
  16742. * @static
  16743. * @memberOf _
  16744. * @since 4.0.0
  16745. * @category Math
  16746. * @param {number} minuend The first number in a subtraction.
  16747. * @param {number} subtrahend The second number in a subtraction.
  16748. * @returns {number} Returns the difference.
  16749. * @example
  16750. *
  16751. * _.subtract(6, 4);
  16752. * // => 2
  16753. */
  16754. var subtract = createMathOperation(function(minuend, subtrahend) {
  16755. return minuend - subtrahend;
  16756. }, 0);
  16757. /**
  16758. * Computes the sum of the values in `array`.
  16759. *
  16760. * @static
  16761. * @memberOf _
  16762. * @since 3.4.0
  16763. * @category Math
  16764. * @param {Array} array The array to iterate over.
  16765. * @returns {number} Returns the sum.
  16766. * @example
  16767. *
  16768. * _.sum([4, 2, 8, 6]);
  16769. * // => 20
  16770. */
  16771. function sum(array) {
  16772. return (array && array.length)
  16773. ? baseSum(array, identity)
  16774. : 0;
  16775. }
  16776. /**
  16777. * This method is like `_.sum` except that it accepts `iteratee` which is
  16778. * invoked for each element in `array` to generate the value to be summed.
  16779. * The iteratee is invoked with one argument: (value).
  16780. *
  16781. * @static
  16782. * @memberOf _
  16783. * @since 4.0.0
  16784. * @category Math
  16785. * @param {Array} array The array to iterate over.
  16786. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16787. * @returns {number} Returns the sum.
  16788. * @example
  16789. *
  16790. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16791. *
  16792. * _.sumBy(objects, function(o) { return o.n; });
  16793. * // => 20
  16794. *
  16795. * // The `_.property` iteratee shorthand.
  16796. * _.sumBy(objects, 'n');
  16797. * // => 20
  16798. */
  16799. function sumBy(array, iteratee) {
  16800. return (array && array.length)
  16801. ? baseSum(array, getIteratee(iteratee, 2))
  16802. : 0;
  16803. }
  16804. /*------------------------------------------------------------------------*/
  16805. // Add methods that return wrapped values in chain sequences.
  16806. lodash.after = after;
  16807. lodash.ary = ary;
  16808. lodash.assign = assign;
  16809. lodash.assignIn = assignIn;
  16810. lodash.assignInWith = assignInWith;
  16811. lodash.assignWith = assignWith;
  16812. lodash.at = at;
  16813. lodash.before = before;
  16814. lodash.bind = bind;
  16815. lodash.bindAll = bindAll;
  16816. lodash.bindKey = bindKey;
  16817. lodash.castArray = castArray;
  16818. lodash.chain = chain;
  16819. lodash.chunk = chunk;
  16820. lodash.compact = compact;
  16821. lodash.concat = concat;
  16822. lodash.cond = cond;
  16823. lodash.conforms = conforms;
  16824. lodash.constant = constant;
  16825. lodash.countBy = countBy;
  16826. lodash.create = create;
  16827. lodash.curry = curry;
  16828. lodash.curryRight = curryRight;
  16829. lodash.debounce = debounce;
  16830. lodash.defaults = defaults;
  16831. lodash.defaultsDeep = defaultsDeep;
  16832. lodash.defer = defer;
  16833. lodash.delay = delay;
  16834. lodash.difference = difference;
  16835. lodash.differenceBy = differenceBy;
  16836. lodash.differenceWith = differenceWith;
  16837. lodash.drop = drop;
  16838. lodash.dropRight = dropRight;
  16839. lodash.dropRightWhile = dropRightWhile;
  16840. lodash.dropWhile = dropWhile;
  16841. lodash.fill = fill;
  16842. lodash.filter = filter;
  16843. lodash.flatMap = flatMap;
  16844. lodash.flatMapDeep = flatMapDeep;
  16845. lodash.flatMapDepth = flatMapDepth;
  16846. lodash.flatten = flatten;
  16847. lodash.flattenDeep = flattenDeep;
  16848. lodash.flattenDepth = flattenDepth;
  16849. lodash.flip = flip;
  16850. lodash.flow = flow;
  16851. lodash.flowRight = flowRight;
  16852. lodash.fromPairs = fromPairs;
  16853. lodash.functions = functions;
  16854. lodash.functionsIn = functionsIn;
  16855. lodash.groupBy = groupBy;
  16856. lodash.initial = initial;
  16857. lodash.intersection = intersection;
  16858. lodash.intersectionBy = intersectionBy;
  16859. lodash.intersectionWith = intersectionWith;
  16860. lodash.invert = invert;
  16861. lodash.invertBy = invertBy;
  16862. lodash.invokeMap = invokeMap;
  16863. lodash.iteratee = iteratee;
  16864. lodash.keyBy = keyBy;
  16865. lodash.keys = keys;
  16866. lodash.keysIn = keysIn;
  16867. lodash.map = map;
  16868. lodash.mapKeys = mapKeys;
  16869. lodash.mapValues = mapValues;
  16870. lodash.matches = matches;
  16871. lodash.matchesProperty = matchesProperty;
  16872. lodash.memoize = memoize;
  16873. lodash.merge = merge;
  16874. lodash.mergeWith = mergeWith;
  16875. lodash.method = method;
  16876. lodash.methodOf = methodOf;
  16877. lodash.mixin = mixin;
  16878. lodash.negate = negate;
  16879. lodash.nthArg = nthArg;
  16880. lodash.omit = omit;
  16881. lodash.omitBy = omitBy;
  16882. lodash.once = once;
  16883. lodash.orderBy = orderBy;
  16884. lodash.over = over;
  16885. lodash.overArgs = overArgs;
  16886. lodash.overEvery = overEvery;
  16887. lodash.overSome = overSome;
  16888. lodash.partial = partial;
  16889. lodash.partialRight = partialRight;
  16890. lodash.partition = partition;
  16891. lodash.pick = pick;
  16892. lodash.pickBy = pickBy;
  16893. lodash.property = property;
  16894. lodash.propertyOf = propertyOf;
  16895. lodash.pull = pull;
  16896. lodash.pullAll = pullAll;
  16897. lodash.pullAllBy = pullAllBy;
  16898. lodash.pullAllWith = pullAllWith;
  16899. lodash.pullAt = pullAt;
  16900. lodash.range = range;
  16901. lodash.rangeRight = rangeRight;
  16902. lodash.rearg = rearg;
  16903. lodash.reject = reject;
  16904. lodash.remove = remove;
  16905. lodash.rest = rest;
  16906. lodash.reverse = reverse;
  16907. lodash.sampleSize = sampleSize;
  16908. lodash.set = set;
  16909. lodash.setWith = setWith;
  16910. lodash.shuffle = shuffle;
  16911. lodash.slice = slice;
  16912. lodash.sortBy = sortBy;
  16913. lodash.sortedUniq = sortedUniq;
  16914. lodash.sortedUniqBy = sortedUniqBy;
  16915. lodash.split = split;
  16916. lodash.spread = spread;
  16917. lodash.tail = tail;
  16918. lodash.take = take;
  16919. lodash.takeRight = takeRight;
  16920. lodash.takeRightWhile = takeRightWhile;
  16921. lodash.takeWhile = takeWhile;
  16922. lodash.tap = tap;
  16923. lodash.throttle = throttle;
  16924. lodash.thru = thru;
  16925. lodash.toArray = toArray;
  16926. lodash.toPairs = toPairs;
  16927. lodash.toPairsIn = toPairsIn;
  16928. lodash.toPath = toPath;
  16929. lodash.toPlainObject = toPlainObject;
  16930. lodash.transform = transform;
  16931. lodash.unary = unary;
  16932. lodash.union = union;
  16933. lodash.unionBy = unionBy;
  16934. lodash.unionWith = unionWith;
  16935. lodash.uniq = uniq;
  16936. lodash.uniqBy = uniqBy;
  16937. lodash.uniqWith = uniqWith;
  16938. lodash.unset = unset;
  16939. lodash.unzip = unzip;
  16940. lodash.unzipWith = unzipWith;
  16941. lodash.update = update;
  16942. lodash.updateWith = updateWith;
  16943. lodash.values = values;
  16944. lodash.valuesIn = valuesIn;
  16945. lodash.without = without;
  16946. lodash.words = words;
  16947. lodash.wrap = wrap;
  16948. lodash.xor = xor;
  16949. lodash.xorBy = xorBy;
  16950. lodash.xorWith = xorWith;
  16951. lodash.zip = zip;
  16952. lodash.zipObject = zipObject;
  16953. lodash.zipObjectDeep = zipObjectDeep;
  16954. lodash.zipWith = zipWith;
  16955. // Add aliases.
  16956. lodash.entries = toPairs;
  16957. lodash.entriesIn = toPairsIn;
  16958. lodash.extend = assignIn;
  16959. lodash.extendWith = assignInWith;
  16960. // Add methods to `lodash.prototype`.
  16961. mixin(lodash, lodash);
  16962. /*------------------------------------------------------------------------*/
  16963. // Add methods that return unwrapped values in chain sequences.
  16964. lodash.add = add;
  16965. lodash.attempt = attempt;
  16966. lodash.camelCase = camelCase;
  16967. lodash.capitalize = capitalize;
  16968. lodash.ceil = ceil;
  16969. lodash.clamp = clamp;
  16970. lodash.clone = clone;
  16971. lodash.cloneDeep = cloneDeep;
  16972. lodash.cloneDeepWith = cloneDeepWith;
  16973. lodash.cloneWith = cloneWith;
  16974. lodash.conformsTo = conformsTo;
  16975. lodash.deburr = deburr;
  16976. lodash.defaultTo = defaultTo;
  16977. lodash.divide = divide;
  16978. lodash.endsWith = endsWith;
  16979. lodash.eq = eq;
  16980. lodash.escape = escape;
  16981. lodash.escapeRegExp = escapeRegExp;
  16982. lodash.every = every;
  16983. lodash.find = find;
  16984. lodash.findIndex = findIndex;
  16985. lodash.findKey = findKey;
  16986. lodash.findLast = findLast;
  16987. lodash.findLastIndex = findLastIndex;
  16988. lodash.findLastKey = findLastKey;
  16989. lodash.floor = floor;
  16990. lodash.forEach = forEach;
  16991. lodash.forEachRight = forEachRight;
  16992. lodash.forIn = forIn;
  16993. lodash.forInRight = forInRight;
  16994. lodash.forOwn = forOwn;
  16995. lodash.forOwnRight = forOwnRight;
  16996. lodash.get = get;
  16997. lodash.gt = gt;
  16998. lodash.gte = gte;
  16999. lodash.has = has;
  17000. lodash.hasIn = hasIn;
  17001. lodash.head = head;
  17002. lodash.identity = identity;
  17003. lodash.includes = includes;
  17004. lodash.indexOf = indexOf;
  17005. lodash.inRange = inRange;
  17006. lodash.invoke = invoke;
  17007. lodash.isArguments = isArguments;
  17008. lodash.isArray = isArray;
  17009. lodash.isArrayBuffer = isArrayBuffer;
  17010. lodash.isArrayLike = isArrayLike;
  17011. lodash.isArrayLikeObject = isArrayLikeObject;
  17012. lodash.isBoolean = isBoolean;
  17013. lodash.isBuffer = isBuffer;
  17014. lodash.isDate = isDate;
  17015. lodash.isElement = isElement;
  17016. lodash.isEmpty = isEmpty;
  17017. lodash.isEqual = isEqual;
  17018. lodash.isEqualWith = isEqualWith;
  17019. lodash.isError = isError;
  17020. lodash.isFinite = isFinite;
  17021. lodash.isFunction = isFunction;
  17022. lodash.isInteger = isInteger;
  17023. lodash.isLength = isLength;
  17024. lodash.isMap = isMap;
  17025. lodash.isMatch = isMatch;
  17026. lodash.isMatchWith = isMatchWith;
  17027. lodash.isNaN = isNaN;
  17028. lodash.isNative = isNative;
  17029. lodash.isNil = isNil;
  17030. lodash.isNull = isNull;
  17031. lodash.isNumber = isNumber;
  17032. lodash.isObject = isObject;
  17033. lodash.isObjectLike = isObjectLike;
  17034. lodash.isPlainObject = isPlainObject;
  17035. lodash.isRegExp = isRegExp;
  17036. lodash.isSafeInteger = isSafeInteger;
  17037. lodash.isSet = isSet;
  17038. lodash.isString = isString;
  17039. lodash.isSymbol = isSymbol;
  17040. lodash.isTypedArray = isTypedArray;
  17041. lodash.isUndefined = isUndefined;
  17042. lodash.isWeakMap = isWeakMap;
  17043. lodash.isWeakSet = isWeakSet;
  17044. lodash.join = join;
  17045. lodash.kebabCase = kebabCase;
  17046. lodash.last = last;
  17047. lodash.lastIndexOf = lastIndexOf;
  17048. lodash.lowerCase = lowerCase;
  17049. lodash.lowerFirst = lowerFirst;
  17050. lodash.lt = lt;
  17051. lodash.lte = lte;
  17052. lodash.max = max;
  17053. lodash.maxBy = maxBy;
  17054. lodash.mean = mean;
  17055. lodash.meanBy = meanBy;
  17056. lodash.min = min;
  17057. lodash.minBy = minBy;
  17058. lodash.stubArray = stubArray;
  17059. lodash.stubFalse = stubFalse;
  17060. lodash.stubObject = stubObject;
  17061. lodash.stubString = stubString;
  17062. lodash.stubTrue = stubTrue;
  17063. lodash.multiply = multiply;
  17064. lodash.nth = nth;
  17065. lodash.noConflict = noConflict;
  17066. lodash.noop = noop;
  17067. lodash.now = now;
  17068. lodash.pad = pad;
  17069. lodash.padEnd = padEnd;
  17070. lodash.padStart = padStart;
  17071. lodash.parseInt = parseInt;
  17072. lodash.random = random;
  17073. lodash.reduce = reduce;
  17074. lodash.reduceRight = reduceRight;
  17075. lodash.repeat = repeat;
  17076. lodash.replace = replace;
  17077. lodash.result = result;
  17078. lodash.round = round;
  17079. lodash.runInContext = runInContext;
  17080. lodash.sample = sample;
  17081. lodash.size = size;
  17082. lodash.snakeCase = snakeCase;
  17083. lodash.some = some;
  17084. lodash.sortedIndex = sortedIndex;
  17085. lodash.sortedIndexBy = sortedIndexBy;
  17086. lodash.sortedIndexOf = sortedIndexOf;
  17087. lodash.sortedLastIndex = sortedLastIndex;
  17088. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17089. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17090. lodash.startCase = startCase;
  17091. lodash.startsWith = startsWith;
  17092. lodash.subtract = subtract;
  17093. lodash.sum = sum;
  17094. lodash.sumBy = sumBy;
  17095. lodash.template = template;
  17096. lodash.times = times;
  17097. lodash.toFinite = toFinite;
  17098. lodash.toInteger = toInteger;
  17099. lodash.toLength = toLength;
  17100. lodash.toLower = toLower;
  17101. lodash.toNumber = toNumber;
  17102. lodash.toSafeInteger = toSafeInteger;
  17103. lodash.toString = toString;
  17104. lodash.toUpper = toUpper;
  17105. lodash.trim = trim;
  17106. lodash.trimEnd = trimEnd;
  17107. lodash.trimStart = trimStart;
  17108. lodash.truncate = truncate;
  17109. lodash.unescape = unescape;
  17110. lodash.uniqueId = uniqueId;
  17111. lodash.upperCase = upperCase;
  17112. lodash.upperFirst = upperFirst;
  17113. // Add aliases.
  17114. lodash.each = forEach;
  17115. lodash.eachRight = forEachRight;
  17116. lodash.first = head;
  17117. mixin(lodash, (function() {
  17118. var source = {};
  17119. baseForOwn(lodash, function(func, methodName) {
  17120. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17121. source[methodName] = func;
  17122. }
  17123. });
  17124. return source;
  17125. }()), { 'chain': false });
  17126. /*------------------------------------------------------------------------*/
  17127. /**
  17128. * The semantic version number.
  17129. *
  17130. * @static
  17131. * @memberOf _
  17132. * @type {string}
  17133. */
  17134. lodash.VERSION = VERSION;
  17135. // Assign default placeholders.
  17136. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17137. lodash[methodName].placeholder = lodash;
  17138. });
  17139. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17140. arrayEach(['drop', 'take'], function(methodName, index) {
  17141. LazyWrapper.prototype[methodName] = function(n) {
  17142. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17143. var result = (this.__filtered__ && !index)
  17144. ? new LazyWrapper(this)
  17145. : this.clone();
  17146. if (result.__filtered__) {
  17147. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17148. } else {
  17149. result.__views__.push({
  17150. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17151. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17152. });
  17153. }
  17154. return result;
  17155. };
  17156. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17157. return this.reverse()[methodName](n).reverse();
  17158. };
  17159. });
  17160. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17161. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17162. var type = index + 1,
  17163. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17164. LazyWrapper.prototype[methodName] = function(iteratee) {
  17165. var result = this.clone();
  17166. result.__iteratees__.push({
  17167. 'iteratee': getIteratee(iteratee, 3),
  17168. 'type': type
  17169. });
  17170. result.__filtered__ = result.__filtered__ || isFilter;
  17171. return result;
  17172. };
  17173. });
  17174. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17175. arrayEach(['head', 'last'], function(methodName, index) {
  17176. var takeName = 'take' + (index ? 'Right' : '');
  17177. LazyWrapper.prototype[methodName] = function() {
  17178. return this[takeName](1).value()[0];
  17179. };
  17180. });
  17181. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17182. arrayEach(['initial', 'tail'], function(methodName, index) {
  17183. var dropName = 'drop' + (index ? '' : 'Right');
  17184. LazyWrapper.prototype[methodName] = function() {
  17185. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17186. };
  17187. });
  17188. LazyWrapper.prototype.compact = function() {
  17189. return this.filter(identity);
  17190. };
  17191. LazyWrapper.prototype.find = function(predicate) {
  17192. return this.filter(predicate).head();
  17193. };
  17194. LazyWrapper.prototype.findLast = function(predicate) {
  17195. return this.reverse().find(predicate);
  17196. };
  17197. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17198. if (typeof path == 'function') {
  17199. return new LazyWrapper(this);
  17200. }
  17201. return this.map(function(value) {
  17202. return baseInvoke(value, path, args);
  17203. });
  17204. });
  17205. LazyWrapper.prototype.reject = function(predicate) {
  17206. return this.filter(negate(getIteratee(predicate)));
  17207. };
  17208. LazyWrapper.prototype.slice = function(start, end) {
  17209. start = toInteger(start);
  17210. var result = this;
  17211. if (result.__filtered__ && (start > 0 || end < 0)) {
  17212. return new LazyWrapper(result);
  17213. }
  17214. if (start < 0) {
  17215. result = result.takeRight(-start);
  17216. } else if (start) {
  17217. result = result.drop(start);
  17218. }
  17219. if (end !== undefined) {
  17220. end = toInteger(end);
  17221. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17222. }
  17223. return result;
  17224. };
  17225. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17226. return this.reverse().takeWhile(predicate).reverse();
  17227. };
  17228. LazyWrapper.prototype.toArray = function() {
  17229. return this.take(MAX_ARRAY_LENGTH);
  17230. };
  17231. // Add `LazyWrapper` methods to `lodash.prototype`.
  17232. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17233. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17234. isTaker = /^(?:head|last)$/.test(methodName),
  17235. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17236. retUnwrapped = isTaker || /^find/.test(methodName);
  17237. if (!lodashFunc) {
  17238. return;
  17239. }
  17240. lodash.prototype[methodName] = function() {
  17241. var value = this.__wrapped__,
  17242. args = isTaker ? [1] : arguments,
  17243. isLazy = value instanceof LazyWrapper,
  17244. iteratee = args[0],
  17245. useLazy = isLazy || isArray(value);
  17246. var interceptor = function(value) {
  17247. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17248. return (isTaker && chainAll) ? result[0] : result;
  17249. };
  17250. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17251. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17252. isLazy = useLazy = false;
  17253. }
  17254. var chainAll = this.__chain__,
  17255. isHybrid = !!this.__actions__.length,
  17256. isUnwrapped = retUnwrapped && !chainAll,
  17257. onlyLazy = isLazy && !isHybrid;
  17258. if (!retUnwrapped && useLazy) {
  17259. value = onlyLazy ? value : new LazyWrapper(this);
  17260. var result = func.apply(value, args);
  17261. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17262. return new LodashWrapper(result, chainAll);
  17263. }
  17264. if (isUnwrapped && onlyLazy) {
  17265. return func.apply(this, args);
  17266. }
  17267. result = this.thru(interceptor);
  17268. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17269. };
  17270. });
  17271. // Add `Array` methods to `lodash.prototype`.
  17272. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17273. var func = arrayProto[methodName],
  17274. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17275. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17276. lodash.prototype[methodName] = function() {
  17277. var args = arguments;
  17278. if (retUnwrapped && !this.__chain__) {
  17279. var value = this.value();
  17280. return func.apply(isArray(value) ? value : [], args);
  17281. }
  17282. return this[chainName](function(value) {
  17283. return func.apply(isArray(value) ? value : [], args);
  17284. });
  17285. };
  17286. });
  17287. // Map minified method names to their real names.
  17288. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17289. var lodashFunc = lodash[methodName];
  17290. if (lodashFunc) {
  17291. var key = lodashFunc.name + '';
  17292. if (!hasOwnProperty.call(realNames, key)) {
  17293. realNames[key] = [];
  17294. }
  17295. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17296. }
  17297. });
  17298. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17299. 'name': 'wrapper',
  17300. 'func': undefined
  17301. }];
  17302. // Add methods to `LazyWrapper`.
  17303. LazyWrapper.prototype.clone = lazyClone;
  17304. LazyWrapper.prototype.reverse = lazyReverse;
  17305. LazyWrapper.prototype.value = lazyValue;
  17306. // Add chain sequence methods to the `lodash` wrapper.
  17307. lodash.prototype.at = wrapperAt;
  17308. lodash.prototype.chain = wrapperChain;
  17309. lodash.prototype.commit = wrapperCommit;
  17310. lodash.prototype.next = wrapperNext;
  17311. lodash.prototype.plant = wrapperPlant;
  17312. lodash.prototype.reverse = wrapperReverse;
  17313. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17314. // Add lazy aliases.
  17315. lodash.prototype.first = lodash.prototype.head;
  17316. if (symIterator) {
  17317. lodash.prototype[symIterator] = wrapperToIterator;
  17318. }
  17319. return lodash;
  17320. });
  17321. /*--------------------------------------------------------------------------*/
  17322. // Export lodash.
  17323. var _ = runInContext();
  17324. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17325. if (true) {
  17326. // Expose Lodash on the global object to prevent errors when Lodash is
  17327. // loaded by a script tag in the presence of an AMD loader.
  17328. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17329. // Use `_.noConflict` to remove Lodash from the global object.
  17330. root._ = _;
  17331. // Define as an anonymous module so, through path mapping, it can be
  17332. // referenced as the "underscore" module.
  17333. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17334. return _;
  17335. }).call(exports, __webpack_require__, exports, module),
  17336. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17337. }
  17338. // Check for `exports` after `define` in case a build optimizer adds it.
  17339. else {}
  17340. }.call(this));
  17341. /***/ }),
  17342. /***/ "./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":
  17343. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17344. !*** ./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 ***!
  17345. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17346. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17347. "use strict";
  17348. __webpack_require__.r(__webpack_exports__);
  17349. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17350. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17351. /* harmony export */ });
  17352. /* 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");
  17353. /* 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__);
  17354. /* 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");
  17355. var options = {};
  17356. options.insert = "head";
  17357. options.singleton = false;
  17358. 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);
  17359. /* 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 || {});
  17360. /***/ }),
  17361. /***/ "./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":
  17362. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17363. !*** ./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 ***!
  17364. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17365. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17366. "use strict";
  17367. __webpack_require__.r(__webpack_exports__);
  17368. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17369. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17370. /* harmony export */ });
  17371. /* 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");
  17372. /* 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__);
  17373. /* 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");
  17374. var options = {};
  17375. options.insert = "head";
  17376. options.singleton = false;
  17377. 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);
  17378. /* 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 || {});
  17379. /***/ }),
  17380. /***/ "./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":
  17381. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17382. !*** ./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 ***!
  17383. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17384. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17385. "use strict";
  17386. __webpack_require__.r(__webpack_exports__);
  17387. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17388. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17389. /* harmony export */ });
  17390. /* 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");
  17391. /* 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__);
  17392. /* 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");
  17393. var options = {};
  17394. options.insert = "head";
  17395. options.singleton = false;
  17396. 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);
  17397. /* 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 || {});
  17398. /***/ }),
  17399. /***/ "./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":
  17400. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17401. !*** ./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 ***!
  17402. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17403. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17404. "use strict";
  17405. __webpack_require__.r(__webpack_exports__);
  17406. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17407. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17408. /* harmony export */ });
  17409. /* 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");
  17410. /* 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__);
  17411. /* 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");
  17412. var options = {};
  17413. options.insert = "head";
  17414. options.singleton = false;
  17415. 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);
  17416. /* 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 || {});
  17417. /***/ }),
  17418. /***/ "./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":
  17419. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17420. !*** ./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 ***!
  17421. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17422. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17423. "use strict";
  17424. __webpack_require__.r(__webpack_exports__);
  17425. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17426. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17427. /* harmony export */ });
  17428. /* 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");
  17429. /* 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__);
  17430. /* 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");
  17431. var options = {};
  17432. options.insert = "head";
  17433. options.singleton = false;
  17434. 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);
  17435. /* 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 || {});
  17436. /***/ }),
  17437. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17438. /*!******************************************************!*\
  17439. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17440. \******************************************************/
  17441. /***/ ((__unused_webpack_module, exports) => {
  17442. "use strict";
  17443. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17444. // runtime helper for setting properties on components
  17445. // in a tree-shakable way
  17446. exports["default"] = (sfc, props) => {
  17447. const target = sfc.__vccOpts || sfc;
  17448. for (const [key, val] of props) {
  17449. target[key] = val;
  17450. }
  17451. return target;
  17452. };
  17453. /***/ }),
  17454. /***/ "./resources/js/components/AppButtonLink.vue":
  17455. /*!***************************************************!*\
  17456. !*** ./resources/js/components/AppButtonLink.vue ***!
  17457. \***************************************************/
  17458. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17459. "use strict";
  17460. __webpack_require__.r(__webpack_exports__);
  17461. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17462. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17463. /* harmony export */ });
  17464. /* 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");
  17465. /* 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");
  17466. /* 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");
  17467. ;
  17468. 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"]])
  17469. /* hot reload */
  17470. if (false) {}
  17471. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17472. /***/ }),
  17473. /***/ "./resources/js/components/AppFooter.vue":
  17474. /*!***********************************************!*\
  17475. !*** ./resources/js/components/AppFooter.vue ***!
  17476. \***********************************************/
  17477. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17478. "use strict";
  17479. __webpack_require__.r(__webpack_exports__);
  17480. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17481. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17482. /* harmony export */ });
  17483. /* 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");
  17484. /* 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");
  17485. /* 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");
  17486. const script = {}
  17487. ;
  17488. 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"]])
  17489. /* hot reload */
  17490. if (false) {}
  17491. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17492. /***/ }),
  17493. /***/ "./resources/js/components/AppMessage.vue":
  17494. /*!************************************************!*\
  17495. !*** ./resources/js/components/AppMessage.vue ***!
  17496. \************************************************/
  17497. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17498. "use strict";
  17499. __webpack_require__.r(__webpack_exports__);
  17500. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17501. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17502. /* harmony export */ });
  17503. /* 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");
  17504. /* 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");
  17505. /* 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");
  17506. ;
  17507. 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"]])
  17508. /* hot reload */
  17509. if (false) {}
  17510. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17511. /***/ }),
  17512. /***/ "./resources/js/components/AppPagination.vue":
  17513. /*!***************************************************!*\
  17514. !*** ./resources/js/components/AppPagination.vue ***!
  17515. \***************************************************/
  17516. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17517. "use strict";
  17518. __webpack_require__.r(__webpack_exports__);
  17519. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17520. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17521. /* harmony export */ });
  17522. /* 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");
  17523. /* 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");
  17524. /* 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");
  17525. ;
  17526. 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"]])
  17527. /* hot reload */
  17528. if (false) {}
  17529. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17530. /***/ }),
  17531. /***/ "./resources/js/components/AppSidebar.vue":
  17532. /*!************************************************!*\
  17533. !*** ./resources/js/components/AppSidebar.vue ***!
  17534. \************************************************/
  17535. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17536. "use strict";
  17537. __webpack_require__.r(__webpack_exports__);
  17538. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17539. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17540. /* harmony export */ });
  17541. /* 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");
  17542. /* 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");
  17543. /* 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");
  17544. /* 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");
  17545. ;
  17546. 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"]])
  17547. /* hot reload */
  17548. if (false) {}
  17549. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17550. /***/ }),
  17551. /***/ "./resources/js/components/AppSubSidebar.vue":
  17552. /*!***************************************************!*\
  17553. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17554. \***************************************************/
  17555. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17556. "use strict";
  17557. __webpack_require__.r(__webpack_exports__);
  17558. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17559. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17560. /* harmony export */ });
  17561. /* 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");
  17562. /* 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");
  17563. /* 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");
  17564. /* 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");
  17565. ;
  17566. 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"]])
  17567. /* hot reload */
  17568. if (false) {}
  17569. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17570. /***/ }),
  17571. /***/ "./resources/js/components/AppTopBar.vue":
  17572. /*!***********************************************!*\
  17573. !*** ./resources/js/components/AppTopBar.vue ***!
  17574. \***********************************************/
  17575. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17576. "use strict";
  17577. __webpack_require__.r(__webpack_exports__);
  17578. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17579. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17580. /* harmony export */ });
  17581. /* 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");
  17582. /* 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");
  17583. /* 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");
  17584. /* 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");
  17585. ;
  17586. 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"]])
  17587. /* hot reload */
  17588. if (false) {}
  17589. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17590. /***/ }),
  17591. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17592. /*!**************************************************!*\
  17593. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17594. \**************************************************/
  17595. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17596. "use strict";
  17597. __webpack_require__.r(__webpack_exports__);
  17598. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17599. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17600. /* harmony export */ });
  17601. /* 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");
  17602. /* 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");
  17603. /* 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");
  17604. /* 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");
  17605. ;
  17606. 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"]])
  17607. /* hot reload */
  17608. if (false) {}
  17609. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17610. /***/ }),
  17611. /***/ "./resources/js/pages/member/Index.vue":
  17612. /*!*********************************************!*\
  17613. !*** ./resources/js/pages/member/Index.vue ***!
  17614. \*********************************************/
  17615. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17616. "use strict";
  17617. __webpack_require__.r(__webpack_exports__);
  17618. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17619. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17620. /* harmony export */ });
  17621. /* harmony import */ var _Index_vue_vue_type_template_id_7b0e4c66__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=7b0e4c66 */ "./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66");
  17622. /* 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/member/Index.vue?vue&type=script&setup=true&lang=js");
  17623. /* 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");
  17624. ;
  17625. 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_7b0e4c66__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/member/Index.vue"]])
  17626. /* hot reload */
  17627. if (false) {}
  17628. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17629. /***/ }),
  17630. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17631. /*!**************************************************************************************!*\
  17632. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17633. \**************************************************************************************/
  17634. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17635. "use strict";
  17636. __webpack_require__.r(__webpack_exports__);
  17637. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17638. /* 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"])
  17639. /* harmony export */ });
  17640. /* 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");
  17641. /***/ }),
  17642. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17643. /*!***********************************************************************************!*\
  17644. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17645. \***********************************************************************************/
  17646. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17647. "use strict";
  17648. __webpack_require__.r(__webpack_exports__);
  17649. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17650. /* 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"])
  17651. /* harmony export */ });
  17652. /* 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");
  17653. /***/ }),
  17654. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17655. /*!**************************************************************************************!*\
  17656. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17657. \**************************************************************************************/
  17658. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17659. "use strict";
  17660. __webpack_require__.r(__webpack_exports__);
  17661. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17662. /* 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"])
  17663. /* harmony export */ });
  17664. /* 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");
  17665. /***/ }),
  17666. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17667. /*!***********************************************************************************!*\
  17668. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17669. \***********************************************************************************/
  17670. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17671. "use strict";
  17672. __webpack_require__.r(__webpack_exports__);
  17673. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17674. /* 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"])
  17675. /* harmony export */ });
  17676. /* 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");
  17677. /***/ }),
  17678. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17679. /*!**************************************************************************************!*\
  17680. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17681. \**************************************************************************************/
  17682. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17683. "use strict";
  17684. __webpack_require__.r(__webpack_exports__);
  17685. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17686. /* 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"])
  17687. /* harmony export */ });
  17688. /* 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");
  17689. /***/ }),
  17690. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17691. /*!**********************************************************************************!*\
  17692. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17693. \**********************************************************************************/
  17694. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17695. "use strict";
  17696. __webpack_require__.r(__webpack_exports__);
  17697. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17698. /* 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"])
  17699. /* harmony export */ });
  17700. /* 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");
  17701. /***/ }),
  17702. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17703. /*!*************************************************************************************!*\
  17704. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17705. \*************************************************************************************/
  17706. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17707. "use strict";
  17708. __webpack_require__.r(__webpack_exports__);
  17709. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17710. /* 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"])
  17711. /* harmony export */ });
  17712. /* 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");
  17713. /***/ }),
  17714. /***/ "./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js":
  17715. /*!********************************************************************************!*\
  17716. !*** ./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js ***!
  17717. \********************************************************************************/
  17718. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17719. "use strict";
  17720. __webpack_require__.r(__webpack_exports__);
  17721. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17722. /* 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"])
  17723. /* harmony export */ });
  17724. /* 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/member/Index.vue?vue&type=script&setup=true&lang=js");
  17725. /***/ }),
  17726. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17727. /*!*********************************************************************************!*\
  17728. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17729. \*********************************************************************************/
  17730. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17731. "use strict";
  17732. __webpack_require__.r(__webpack_exports__);
  17733. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17734. /* 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)
  17735. /* harmony export */ });
  17736. /* 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");
  17737. /***/ }),
  17738. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17739. /*!*****************************************************************************************!*\
  17740. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17741. \*****************************************************************************************/
  17742. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17743. "use strict";
  17744. __webpack_require__.r(__webpack_exports__);
  17745. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17746. /* 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)
  17747. /* harmony export */ });
  17748. /* 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");
  17749. /***/ }),
  17750. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17751. /*!******************************************************************************!*\
  17752. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17753. \******************************************************************************/
  17754. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17755. "use strict";
  17756. __webpack_require__.r(__webpack_exports__);
  17757. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17758. /* 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)
  17759. /* harmony export */ });
  17760. /* 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");
  17761. /***/ }),
  17762. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17763. /*!*********************************************************************************!*\
  17764. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17765. \*********************************************************************************/
  17766. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17767. "use strict";
  17768. __webpack_require__.r(__webpack_exports__);
  17769. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17770. /* 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)
  17771. /* harmony export */ });
  17772. /* 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");
  17773. /***/ }),
  17774. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17775. /*!******************************************************************************************!*\
  17776. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17777. \******************************************************************************************/
  17778. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17779. "use strict";
  17780. __webpack_require__.r(__webpack_exports__);
  17781. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17782. /* 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)
  17783. /* harmony export */ });
  17784. /* 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");
  17785. /***/ }),
  17786. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17787. /*!*********************************************************************************************!*\
  17788. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17789. \*********************************************************************************************/
  17790. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17791. "use strict";
  17792. __webpack_require__.r(__webpack_exports__);
  17793. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17794. /* 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)
  17795. /* harmony export */ });
  17796. /* 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");
  17797. /***/ }),
  17798. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17799. /*!*****************************************************************************************!*\
  17800. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17801. \*****************************************************************************************/
  17802. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17803. "use strict";
  17804. __webpack_require__.r(__webpack_exports__);
  17805. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17806. /* 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)
  17807. /* harmony export */ });
  17808. /* 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");
  17809. /***/ }),
  17810. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17811. /*!********************************************************************************************!*\
  17812. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17813. \********************************************************************************************/
  17814. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17815. "use strict";
  17816. __webpack_require__.r(__webpack_exports__);
  17817. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17818. /* 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)
  17819. /* harmony export */ });
  17820. /* 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");
  17821. /***/ }),
  17822. /***/ "./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66":
  17823. /*!***************************************************************************!*\
  17824. !*** ./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66 ***!
  17825. \***************************************************************************/
  17826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17827. "use strict";
  17828. __webpack_require__.r(__webpack_exports__);
  17829. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17830. /* 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_7b0e4c66__WEBPACK_IMPORTED_MODULE_0__.render)
  17831. /* harmony export */ });
  17832. /* 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_7b0e4c66__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=7b0e4c66 */ "./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/member/Index.vue?vue&type=template&id=7b0e4c66");
  17833. /***/ }),
  17834. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17835. /*!********************************************************************************************************!*\
  17836. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17837. \********************************************************************************************************/
  17838. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17839. "use strict";
  17840. __webpack_require__.r(__webpack_exports__);
  17841. /* 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");
  17842. /***/ }),
  17843. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17844. /*!*********************************************************************************************************!*\
  17845. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17846. \*********************************************************************************************************/
  17847. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17848. "use strict";
  17849. __webpack_require__.r(__webpack_exports__);
  17850. /* 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");
  17851. /***/ }),
  17852. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17853. /*!************************************************************************************************************!*\
  17854. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17855. \************************************************************************************************************/
  17856. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17857. "use strict";
  17858. __webpack_require__.r(__webpack_exports__);
  17859. /* 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");
  17860. /***/ }),
  17861. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17862. /*!********************************************************************************************************!*\
  17863. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17864. \********************************************************************************************************/
  17865. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17866. "use strict";
  17867. __webpack_require__.r(__webpack_exports__);
  17868. /* 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");
  17869. /***/ }),
  17870. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17871. /*!***********************************************************************************************************!*\
  17872. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17873. \***********************************************************************************************************/
  17874. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17875. "use strict";
  17876. __webpack_require__.r(__webpack_exports__);
  17877. /* 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");
  17878. /***/ })
  17879. }]);