resources_js_pages_member_Index_vue.js 694KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330
  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.initialSearch),
  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, "Profil Saya", -1
  692. /* HOISTED */
  693. );
  694. });
  695. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  696. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  697. "class": "pi pi-sign-out"
  698. }, null, -1
  699. /* HOISTED */
  700. );
  701. });
  702. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  703. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  704. /* HOISTED */
  705. );
  706. });
  707. function render(_ctx, _cache, $props, $setup, $data, $options) {
  708. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  709. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  710. href: "/",
  711. "class": "layout-topbar-logo"
  712. }, {
  713. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  714. return [_hoisted_2, _hoisted_3];
  715. }),
  716. _: 1
  717. /* STABLE */
  718. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  719. "class": "p-link layout-menu-button layout-topbar-button",
  720. onClick: _cache[0] || (_cache[0] = function ($event) {
  721. return _ctx.$emit('menu-toggle', $event);
  722. })
  723. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  724. selector: '@next',
  725. enterClass: 'hidden',
  726. enterActiveClass: 'scalein',
  727. leaveToClass: 'hidden',
  728. leaveActiveClass: 'fadeout',
  729. hideOnOutsideClick: true
  730. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  731. /* TEXT */
  732. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  733. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  734. "class": "p-link layout-topbar-button"
  735. }, {
  736. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  737. return [_hoisted_12, _hoisted_13];
  738. }),
  739. _: 1
  740. /* STABLE */
  741. }, 8
  742. /* PROPS */
  743. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  744. href: _ctx.route('logout'),
  745. as: "button",
  746. method: "post",
  747. "class": "p-link layout-topbar-button"
  748. }, {
  749. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  750. return [_hoisted_14, _hoisted_15];
  751. }),
  752. _: 1
  753. /* STABLE */
  754. }, 8
  755. /* PROPS */
  756. , ["href"])])])]);
  757. }
  758. /***/ }),
  759. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  760. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  761. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  762. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  763. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  764. "use strict";
  765. __webpack_require__.r(__webpack_exports__);
  766. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  767. /* harmony export */ "render": () => (/* binding */ render)
  768. /* harmony export */ });
  769. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  770. var _withScopeId = function _withScopeId(n) {
  771. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  772. };
  773. var _hoisted_1 = {
  774. "class": "layout-sidebar"
  775. };
  776. var _hoisted_2 = {
  777. "class": "layout-main-container"
  778. };
  779. var _hoisted_3 = {
  780. "class": "layout-main"
  781. };
  782. var _hoisted_4 = {
  783. key: 0,
  784. "class": "layout-mask p-component-overlay"
  785. };
  786. function render(_ctx, _cache, $props, $setup, $data, $options) {
  787. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  788. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  789. onClick: $setup.onWrapperClick
  790. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  791. onMenuToggle: $setup.onMenuToggle
  792. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  793. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  794. }, null, 8
  795. /* PROPS */
  796. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  797. name: "layout-mask"
  798. }, {
  799. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  800. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  801. }),
  802. _: 1
  803. /* STABLE */
  804. })], 2
  805. /* CLASS */
  806. );
  807. }
  808. /***/ }),
  809. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66":
  810. /*!*****************************************************************************************************************************************************************************************************************************************************************************!*\
  811. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66 ***!
  812. \*****************************************************************************************************************************************************************************************************************************************************************************/
  813. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  814. "use strict";
  815. __webpack_require__.r(__webpack_exports__);
  816. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  817. /* harmony export */ "render": () => (/* binding */ render)
  818. /* harmony export */ });
  819. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  820. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Daftar Member", -1
  821. /* HOISTED */
  822. );
  823. var _hoisted_2 = {
  824. "class": "grid"
  825. };
  826. var _hoisted_3 = {
  827. "class": "col-12 md:col-8"
  828. };
  829. var _hoisted_4 = {
  830. "class": "flex align-items-center"
  831. };
  832. var _hoisted_5 = {
  833. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  834. };
  835. function render(_ctx, _cache, $props, $setup, $data, $options) {
  836. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  837. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  838. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  839. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  840. title: "Daftar Member"
  841. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  842. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  843. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  844. "responsive-layout": "scroll",
  845. "column-resize-mode": "expand",
  846. value: $props.members.data,
  847. "row-hover": true,
  848. "striped-rows": true
  849. }, {
  850. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  851. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  852. "class": "w-full md:w-27rem",
  853. placeholder: "cari, contoh: 08xx, tina",
  854. modelValue: $setup.search,
  855. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  856. return $setup.search = $event;
  857. })
  858. }, null, 8
  859. /* PROPS */
  860. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  861. label: "Tambah Member",
  862. "class": "p-button-outlined",
  863. icon: "pi pi-pencil",
  864. href: _ctx.route('members.create')
  865. }, null, 8
  866. /* PROPS */
  867. , ["href"])])])];
  868. }),
  869. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  871. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  872. field: value.field,
  873. header: value.header,
  874. key: value.field
  875. }, null, 8
  876. /* PROPS */
  877. , ["field", "header"]);
  878. }), 128
  879. /* KEYED_FRAGMENT */
  880. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  881. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  882. var data = _ref.data;
  883. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  884. icon: "pi pi-pencil",
  885. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  886. href: _ctx.route('members.edit', data.id)
  887. }, null, 8
  888. /* PROPS */
  889. , ["href"])];
  890. }),
  891. _: 1
  892. /* STABLE */
  893. })];
  894. }),
  895. _: 1
  896. /* STABLE */
  897. }, 8
  898. /* PROPS */
  899. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  900. links: $props.members.links
  901. }, null, 8
  902. /* PROPS */
  903. , ["links"])];
  904. }),
  905. _: 1
  906. /* STABLE */
  907. })], 64
  908. /* STABLE_FRAGMENT */
  909. );
  910. }
  911. /***/ }),
  912. /***/ "./resources/js/components/useSearchText.js":
  913. /*!**************************************************!*\
  914. !*** ./resources/js/components/useSearchText.js ***!
  915. \**************************************************/
  916. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  917. "use strict";
  918. __webpack_require__.r(__webpack_exports__);
  919. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  920. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  921. /* harmony export */ });
  922. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  923. function useSearchText(initialSearch) {
  924. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(initialSearch);
  925. return {
  926. search: search
  927. };
  928. }
  929. /***/ }),
  930. /***/ "./resources/js/pages/member/tableHeader.js":
  931. /*!**************************************************!*\
  932. !*** ./resources/js/pages/member/tableHeader.js ***!
  933. \**************************************************/
  934. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  935. "use strict";
  936. __webpack_require__.r(__webpack_exports__);
  937. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  938. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  939. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  940. /* harmony export */ });
  941. var indexTable = [{
  942. field: 'updatedAt',
  943. header: 'Diperbaharui'
  944. }, {
  945. field: 'name',
  946. header: 'Nama'
  947. }, {
  948. field: 'phone',
  949. header: 'Nomor HP'
  950. }, {
  951. field: 'platNumber',
  952. header: 'Plat Kendaraan'
  953. }, {
  954. field: 'type',
  955. header: 'Jenis Member'
  956. }, {
  957. field: 'price',
  958. header: 'Tarif Member'
  959. }, {
  960. field: 'expDate',
  961. header: 'Berakhir'
  962. }];
  963. var platNumberTable = [{
  964. field: 'platNumber',
  965. header: 'Plat Kendaraan'
  966. }, {
  967. field: 'typeVehicle',
  968. header: 'Jenis Kendaraan'
  969. }];
  970. /***/ }),
  971. /***/ "./resources/js/utils/menu.js":
  972. /*!************************************!*\
  973. !*** ./resources/js/utils/menu.js ***!
  974. \************************************/
  975. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  976. "use strict";
  977. __webpack_require__.r(__webpack_exports__);
  978. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  979. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  980. /* harmony export */ });
  981. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  982. // Admin
  983. 1: [{
  984. label: 'Home',
  985. items: [{
  986. label: 'Dashboard',
  987. icon: 'pi pi-home',
  988. to: '/dashboards',
  989. component: 'home/Index'
  990. }]
  991. }, {
  992. label: 'Master',
  993. items: [{
  994. label: 'User',
  995. icon: 'pi pi-user',
  996. to: '/users',
  997. component: 'user/Index'
  998. }]
  999. }],
  1000. // Supervisor
  1001. 2: [{
  1002. label: 'Home',
  1003. items: [{
  1004. label: 'Dashboard',
  1005. icon: 'pi pi-home',
  1006. to: '/dashboards',
  1007. component: 'home/Index'
  1008. }]
  1009. }, {
  1010. label: 'Menu',
  1011. items: [{
  1012. label: 'Pengeluaran',
  1013. icon: 'pi pi-wallet',
  1014. to: '/expenses',
  1015. component: 'expense/Index'
  1016. }, {
  1017. label: 'Laporan',
  1018. icon: 'pi pi-book',
  1019. items: [{
  1020. label: 'Mutasi',
  1021. icon: 'pi pi-circle',
  1022. to: '/reports/mutations',
  1023. component: 'mutation/Report'
  1024. }]
  1025. }]
  1026. }, {
  1027. label: 'Master',
  1028. items: [{
  1029. label: 'Jenis Kendaraan',
  1030. icon: 'pi pi-car',
  1031. to: '/type-vehicles',
  1032. component: 'typevehicle/Index'
  1033. }, {
  1034. label: 'Jenis Member',
  1035. icon: 'pi pi-id-card',
  1036. to: '/type-members',
  1037. component: 'typemember/Index'
  1038. }]
  1039. }, {
  1040. label: 'Pengaturan',
  1041. items: [{
  1042. label: 'Tarif Parkir',
  1043. icon: 'pi pi-car',
  1044. to: '/parking-fees/create',
  1045. component: 'parkingfee/Create'
  1046. }]
  1047. }],
  1048. // Operator
  1049. 3: [{
  1050. label: 'Home',
  1051. items: [{
  1052. label: 'Dashboard',
  1053. icon: 'pi pi-home',
  1054. to: '/dashboards',
  1055. component: 'home/Index'
  1056. }]
  1057. }, {
  1058. label: 'Menu',
  1059. items: [{
  1060. label: 'Pengeluaran',
  1061. icon: 'pi pi-wallet',
  1062. to: '/expenses',
  1063. component: 'expense/Index'
  1064. }, {
  1065. label: 'Member',
  1066. icon: 'pi pi-id-card',
  1067. to: '/members',
  1068. component: 'member/Index'
  1069. }, {
  1070. label: 'Top Up',
  1071. icon: 'pi pi-car',
  1072. to: '/top-ups',
  1073. component: 'topup/Index'
  1074. }]
  1075. }]
  1076. });
  1077. /***/ }),
  1078. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1079. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1080. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1081. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1082. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1083. "use strict";
  1084. __webpack_require__.r(__webpack_exports__);
  1085. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1086. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1087. /* harmony export */ });
  1088. /* 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");
  1089. /* 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__);
  1090. // Imports
  1091. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1092. // Module
  1093. ___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}", ""]);
  1094. // Exports
  1095. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1096. /***/ }),
  1097. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1098. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1099. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1100. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1101. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1102. "use strict";
  1103. __webpack_require__.r(__webpack_exports__);
  1104. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1105. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1106. /* harmony export */ });
  1107. /* 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");
  1108. /* 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__);
  1109. // Imports
  1110. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1111. // Module
  1112. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1113. // Exports
  1114. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1115. /***/ }),
  1116. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1117. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1118. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1119. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1120. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1121. "use strict";
  1122. __webpack_require__.r(__webpack_exports__);
  1123. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1124. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1125. /* harmony export */ });
  1126. /* 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");
  1127. /* 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__);
  1128. // Imports
  1129. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1130. // Module
  1131. ___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}", ""]);
  1132. // Exports
  1133. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1134. /***/ }),
  1135. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1136. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1137. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1138. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1139. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1140. "use strict";
  1141. __webpack_require__.r(__webpack_exports__);
  1142. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1143. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1144. /* harmony export */ });
  1145. /* 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");
  1146. /* 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__);
  1147. // Imports
  1148. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1149. // Module
  1150. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1151. // Exports
  1152. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1153. /***/ }),
  1154. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1155. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1156. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1157. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1158. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1159. "use strict";
  1160. __webpack_require__.r(__webpack_exports__);
  1161. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1162. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1163. /* harmony export */ });
  1164. /* 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");
  1165. /* 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__);
  1166. // Imports
  1167. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1168. // Module
  1169. ___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}", ""]);
  1170. // Exports
  1171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1172. /***/ }),
  1173. /***/ "./node_modules/lodash/lodash.js":
  1174. /*!***************************************!*\
  1175. !*** ./node_modules/lodash/lodash.js ***!
  1176. \***************************************/
  1177. /***/ (function(module, exports, __webpack_require__) {
  1178. /* module decorator */ module = __webpack_require__.nmd(module);
  1179. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1180. * @license
  1181. * Lodash <https://lodash.com/>
  1182. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1183. * Released under MIT license <https://lodash.com/license>
  1184. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1185. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1186. */
  1187. ;(function() {
  1188. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1189. var undefined;
  1190. /** Used as the semantic version number. */
  1191. var VERSION = '4.17.21';
  1192. /** Used as the size to enable large array optimizations. */
  1193. var LARGE_ARRAY_SIZE = 200;
  1194. /** Error message constants. */
  1195. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1196. FUNC_ERROR_TEXT = 'Expected a function',
  1197. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1198. /** Used to stand-in for `undefined` hash values. */
  1199. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1200. /** Used as the maximum memoize cache size. */
  1201. var MAX_MEMOIZE_SIZE = 500;
  1202. /** Used as the internal argument placeholder. */
  1203. var PLACEHOLDER = '__lodash_placeholder__';
  1204. /** Used to compose bitmasks for cloning. */
  1205. var CLONE_DEEP_FLAG = 1,
  1206. CLONE_FLAT_FLAG = 2,
  1207. CLONE_SYMBOLS_FLAG = 4;
  1208. /** Used to compose bitmasks for value comparisons. */
  1209. var COMPARE_PARTIAL_FLAG = 1,
  1210. COMPARE_UNORDERED_FLAG = 2;
  1211. /** Used to compose bitmasks for function metadata. */
  1212. var WRAP_BIND_FLAG = 1,
  1213. WRAP_BIND_KEY_FLAG = 2,
  1214. WRAP_CURRY_BOUND_FLAG = 4,
  1215. WRAP_CURRY_FLAG = 8,
  1216. WRAP_CURRY_RIGHT_FLAG = 16,
  1217. WRAP_PARTIAL_FLAG = 32,
  1218. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1219. WRAP_ARY_FLAG = 128,
  1220. WRAP_REARG_FLAG = 256,
  1221. WRAP_FLIP_FLAG = 512;
  1222. /** Used as default options for `_.truncate`. */
  1223. var DEFAULT_TRUNC_LENGTH = 30,
  1224. DEFAULT_TRUNC_OMISSION = '...';
  1225. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1226. var HOT_COUNT = 800,
  1227. HOT_SPAN = 16;
  1228. /** Used to indicate the type of lazy iteratees. */
  1229. var LAZY_FILTER_FLAG = 1,
  1230. LAZY_MAP_FLAG = 2,
  1231. LAZY_WHILE_FLAG = 3;
  1232. /** Used as references for various `Number` constants. */
  1233. var INFINITY = 1 / 0,
  1234. MAX_SAFE_INTEGER = 9007199254740991,
  1235. MAX_INTEGER = 1.7976931348623157e+308,
  1236. NAN = 0 / 0;
  1237. /** Used as references for the maximum length and index of an array. */
  1238. var MAX_ARRAY_LENGTH = 4294967295,
  1239. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1240. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1241. /** Used to associate wrap methods with their bit flags. */
  1242. var wrapFlags = [
  1243. ['ary', WRAP_ARY_FLAG],
  1244. ['bind', WRAP_BIND_FLAG],
  1245. ['bindKey', WRAP_BIND_KEY_FLAG],
  1246. ['curry', WRAP_CURRY_FLAG],
  1247. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1248. ['flip', WRAP_FLIP_FLAG],
  1249. ['partial', WRAP_PARTIAL_FLAG],
  1250. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1251. ['rearg', WRAP_REARG_FLAG]
  1252. ];
  1253. /** `Object#toString` result references. */
  1254. var argsTag = '[object Arguments]',
  1255. arrayTag = '[object Array]',
  1256. asyncTag = '[object AsyncFunction]',
  1257. boolTag = '[object Boolean]',
  1258. dateTag = '[object Date]',
  1259. domExcTag = '[object DOMException]',
  1260. errorTag = '[object Error]',
  1261. funcTag = '[object Function]',
  1262. genTag = '[object GeneratorFunction]',
  1263. mapTag = '[object Map]',
  1264. numberTag = '[object Number]',
  1265. nullTag = '[object Null]',
  1266. objectTag = '[object Object]',
  1267. promiseTag = '[object Promise]',
  1268. proxyTag = '[object Proxy]',
  1269. regexpTag = '[object RegExp]',
  1270. setTag = '[object Set]',
  1271. stringTag = '[object String]',
  1272. symbolTag = '[object Symbol]',
  1273. undefinedTag = '[object Undefined]',
  1274. weakMapTag = '[object WeakMap]',
  1275. weakSetTag = '[object WeakSet]';
  1276. var arrayBufferTag = '[object ArrayBuffer]',
  1277. dataViewTag = '[object DataView]',
  1278. float32Tag = '[object Float32Array]',
  1279. float64Tag = '[object Float64Array]',
  1280. int8Tag = '[object Int8Array]',
  1281. int16Tag = '[object Int16Array]',
  1282. int32Tag = '[object Int32Array]',
  1283. uint8Tag = '[object Uint8Array]',
  1284. uint8ClampedTag = '[object Uint8ClampedArray]',
  1285. uint16Tag = '[object Uint16Array]',
  1286. uint32Tag = '[object Uint32Array]';
  1287. /** Used to match empty string literals in compiled template source. */
  1288. var reEmptyStringLeading = /\b__p \+= '';/g,
  1289. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1290. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1291. /** Used to match HTML entities and HTML characters. */
  1292. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1293. reUnescapedHtml = /[&<>"']/g,
  1294. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1295. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1296. /** Used to match template delimiters. */
  1297. var reEscape = /<%-([\s\S]+?)%>/g,
  1298. reEvaluate = /<%([\s\S]+?)%>/g,
  1299. reInterpolate = /<%=([\s\S]+?)%>/g;
  1300. /** Used to match property names within property paths. */
  1301. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1302. reIsPlainProp = /^\w*$/,
  1303. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1304. /**
  1305. * Used to match `RegExp`
  1306. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1307. */
  1308. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1309. reHasRegExpChar = RegExp(reRegExpChar.source);
  1310. /** Used to match leading whitespace. */
  1311. var reTrimStart = /^\s+/;
  1312. /** Used to match a single whitespace character. */
  1313. var reWhitespace = /\s/;
  1314. /** Used to match wrap detail comments. */
  1315. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1316. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1317. reSplitDetails = /,? & /;
  1318. /** Used to match words composed of alphanumeric characters. */
  1319. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1320. /**
  1321. * Used to validate the `validate` option in `_.template` variable.
  1322. *
  1323. * Forbids characters which could potentially change the meaning of the function argument definition:
  1324. * - "()," (modification of function parameters)
  1325. * - "=" (default value)
  1326. * - "[]{}" (destructuring of function parameters)
  1327. * - "/" (beginning of a comment)
  1328. * - whitespace
  1329. */
  1330. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1331. /** Used to match backslashes in property paths. */
  1332. var reEscapeChar = /\\(\\)?/g;
  1333. /**
  1334. * Used to match
  1335. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1336. */
  1337. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1338. /** Used to match `RegExp` flags from their coerced string values. */
  1339. var reFlags = /\w*$/;
  1340. /** Used to detect bad signed hexadecimal string values. */
  1341. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1342. /** Used to detect binary string values. */
  1343. var reIsBinary = /^0b[01]+$/i;
  1344. /** Used to detect host constructors (Safari). */
  1345. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1346. /** Used to detect octal string values. */
  1347. var reIsOctal = /^0o[0-7]+$/i;
  1348. /** Used to detect unsigned integer values. */
  1349. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1350. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1351. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1352. /** Used to ensure capturing order of template delimiters. */
  1353. var reNoMatch = /($^)/;
  1354. /** Used to match unescaped characters in compiled string literals. */
  1355. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1356. /** Used to compose unicode character classes. */
  1357. var rsAstralRange = '\\ud800-\\udfff',
  1358. rsComboMarksRange = '\\u0300-\\u036f',
  1359. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1360. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1361. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1362. rsDingbatRange = '\\u2700-\\u27bf',
  1363. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1364. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1365. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1366. rsPunctuationRange = '\\u2000-\\u206f',
  1367. 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',
  1368. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1369. rsVarRange = '\\ufe0e\\ufe0f',
  1370. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1371. /** Used to compose unicode capture groups. */
  1372. var rsApos = "['\u2019]",
  1373. rsAstral = '[' + rsAstralRange + ']',
  1374. rsBreak = '[' + rsBreakRange + ']',
  1375. rsCombo = '[' + rsComboRange + ']',
  1376. rsDigits = '\\d+',
  1377. rsDingbat = '[' + rsDingbatRange + ']',
  1378. rsLower = '[' + rsLowerRange + ']',
  1379. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1380. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1381. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1382. rsNonAstral = '[^' + rsAstralRange + ']',
  1383. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1384. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1385. rsUpper = '[' + rsUpperRange + ']',
  1386. rsZWJ = '\\u200d';
  1387. /** Used to compose unicode regexes. */
  1388. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1389. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1390. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1391. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1392. reOptMod = rsModifier + '?',
  1393. rsOptVar = '[' + rsVarRange + ']?',
  1394. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1395. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1396. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1397. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1398. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1399. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1400. /** Used to match apostrophes. */
  1401. var reApos = RegExp(rsApos, 'g');
  1402. /**
  1403. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1404. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1405. */
  1406. var reComboMark = RegExp(rsCombo, 'g');
  1407. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1408. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1409. /** Used to match complex or compound words. */
  1410. var reUnicodeWord = RegExp([
  1411. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1412. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1413. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1414. rsUpper + '+' + rsOptContrUpper,
  1415. rsOrdUpper,
  1416. rsOrdLower,
  1417. rsDigits,
  1418. rsEmoji
  1419. ].join('|'), 'g');
  1420. /** 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/). */
  1421. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1422. /** Used to detect strings that need a more robust regexp to match words. */
  1423. 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 ]/;
  1424. /** Used to assign default `context` object properties. */
  1425. var contextProps = [
  1426. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1427. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1428. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1429. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1430. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1431. ];
  1432. /** Used to make template sourceURLs easier to identify. */
  1433. var templateCounter = -1;
  1434. /** Used to identify `toStringTag` values of typed arrays. */
  1435. var typedArrayTags = {};
  1436. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1437. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1438. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1439. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1440. typedArrayTags[uint32Tag] = true;
  1441. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1442. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1443. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1444. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1445. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1446. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1447. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1448. typedArrayTags[weakMapTag] = false;
  1449. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1450. var cloneableTags = {};
  1451. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1452. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1453. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1454. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1455. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1456. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1457. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1458. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1459. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1460. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1461. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1462. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1463. cloneableTags[weakMapTag] = false;
  1464. /** Used to map Latin Unicode letters to basic Latin letters. */
  1465. var deburredLetters = {
  1466. // Latin-1 Supplement block.
  1467. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1468. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1469. '\xc7': 'C', '\xe7': 'c',
  1470. '\xd0': 'D', '\xf0': 'd',
  1471. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1472. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1473. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1474. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1475. '\xd1': 'N', '\xf1': 'n',
  1476. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1477. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1478. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1479. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1480. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1481. '\xc6': 'Ae', '\xe6': 'ae',
  1482. '\xde': 'Th', '\xfe': 'th',
  1483. '\xdf': 'ss',
  1484. // Latin Extended-A block.
  1485. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1486. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1487. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1488. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1489. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1490. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1491. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1492. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1493. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1494. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1495. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1496. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1497. '\u0134': 'J', '\u0135': 'j',
  1498. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1499. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1500. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1501. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1502. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1503. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1504. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1505. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1506. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1507. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1508. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1509. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1510. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1511. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1512. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1513. '\u0174': 'W', '\u0175': 'w',
  1514. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1515. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1516. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1517. '\u0132': 'IJ', '\u0133': 'ij',
  1518. '\u0152': 'Oe', '\u0153': 'oe',
  1519. '\u0149': "'n", '\u017f': 's'
  1520. };
  1521. /** Used to map characters to HTML entities. */
  1522. var htmlEscapes = {
  1523. '&': '&amp;',
  1524. '<': '&lt;',
  1525. '>': '&gt;',
  1526. '"': '&quot;',
  1527. "'": '&#39;'
  1528. };
  1529. /** Used to map HTML entities to characters. */
  1530. var htmlUnescapes = {
  1531. '&amp;': '&',
  1532. '&lt;': '<',
  1533. '&gt;': '>',
  1534. '&quot;': '"',
  1535. '&#39;': "'"
  1536. };
  1537. /** Used to escape characters for inclusion in compiled string literals. */
  1538. var stringEscapes = {
  1539. '\\': '\\',
  1540. "'": "'",
  1541. '\n': 'n',
  1542. '\r': 'r',
  1543. '\u2028': 'u2028',
  1544. '\u2029': 'u2029'
  1545. };
  1546. /** Built-in method references without a dependency on `root`. */
  1547. var freeParseFloat = parseFloat,
  1548. freeParseInt = parseInt;
  1549. /** Detect free variable `global` from Node.js. */
  1550. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1551. /** Detect free variable `self`. */
  1552. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1553. /** Used as a reference to the global object. */
  1554. var root = freeGlobal || freeSelf || Function('return this')();
  1555. /** Detect free variable `exports`. */
  1556. var freeExports = true && exports && !exports.nodeType && exports;
  1557. /** Detect free variable `module`. */
  1558. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1559. /** Detect the popular CommonJS extension `module.exports`. */
  1560. var moduleExports = freeModule && freeModule.exports === freeExports;
  1561. /** Detect free variable `process` from Node.js. */
  1562. var freeProcess = moduleExports && freeGlobal.process;
  1563. /** Used to access faster Node.js helpers. */
  1564. var nodeUtil = (function() {
  1565. try {
  1566. // Use `util.types` for Node.js 10+.
  1567. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1568. if (types) {
  1569. return types;
  1570. }
  1571. // Legacy `process.binding('util')` for Node.js < 10.
  1572. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1573. } catch (e) {}
  1574. }());
  1575. /* Node.js helper references. */
  1576. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1577. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1578. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1579. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1580. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1581. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1582. /*--------------------------------------------------------------------------*/
  1583. /**
  1584. * A faster alternative to `Function#apply`, this function invokes `func`
  1585. * with the `this` binding of `thisArg` and the arguments of `args`.
  1586. *
  1587. * @private
  1588. * @param {Function} func The function to invoke.
  1589. * @param {*} thisArg The `this` binding of `func`.
  1590. * @param {Array} args The arguments to invoke `func` with.
  1591. * @returns {*} Returns the result of `func`.
  1592. */
  1593. function apply(func, thisArg, args) {
  1594. switch (args.length) {
  1595. case 0: return func.call(thisArg);
  1596. case 1: return func.call(thisArg, args[0]);
  1597. case 2: return func.call(thisArg, args[0], args[1]);
  1598. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1599. }
  1600. return func.apply(thisArg, args);
  1601. }
  1602. /**
  1603. * A specialized version of `baseAggregator` for arrays.
  1604. *
  1605. * @private
  1606. * @param {Array} [array] The array to iterate over.
  1607. * @param {Function} setter The function to set `accumulator` values.
  1608. * @param {Function} iteratee The iteratee to transform keys.
  1609. * @param {Object} accumulator The initial aggregated object.
  1610. * @returns {Function} Returns `accumulator`.
  1611. */
  1612. function arrayAggregator(array, setter, iteratee, accumulator) {
  1613. var index = -1,
  1614. length = array == null ? 0 : array.length;
  1615. while (++index < length) {
  1616. var value = array[index];
  1617. setter(accumulator, value, iteratee(value), array);
  1618. }
  1619. return accumulator;
  1620. }
  1621. /**
  1622. * A specialized version of `_.forEach` for arrays without support for
  1623. * iteratee shorthands.
  1624. *
  1625. * @private
  1626. * @param {Array} [array] The array to iterate over.
  1627. * @param {Function} iteratee The function invoked per iteration.
  1628. * @returns {Array} Returns `array`.
  1629. */
  1630. function arrayEach(array, iteratee) {
  1631. var index = -1,
  1632. length = array == null ? 0 : array.length;
  1633. while (++index < length) {
  1634. if (iteratee(array[index], index, array) === false) {
  1635. break;
  1636. }
  1637. }
  1638. return array;
  1639. }
  1640. /**
  1641. * A specialized version of `_.forEachRight` for arrays without support for
  1642. * iteratee shorthands.
  1643. *
  1644. * @private
  1645. * @param {Array} [array] The array to iterate over.
  1646. * @param {Function} iteratee The function invoked per iteration.
  1647. * @returns {Array} Returns `array`.
  1648. */
  1649. function arrayEachRight(array, iteratee) {
  1650. var length = array == null ? 0 : array.length;
  1651. while (length--) {
  1652. if (iteratee(array[length], length, array) === false) {
  1653. break;
  1654. }
  1655. }
  1656. return array;
  1657. }
  1658. /**
  1659. * A specialized version of `_.every` for arrays without support for
  1660. * iteratee shorthands.
  1661. *
  1662. * @private
  1663. * @param {Array} [array] The array to iterate over.
  1664. * @param {Function} predicate The function invoked per iteration.
  1665. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1666. * else `false`.
  1667. */
  1668. function arrayEvery(array, predicate) {
  1669. var index = -1,
  1670. length = array == null ? 0 : array.length;
  1671. while (++index < length) {
  1672. if (!predicate(array[index], index, array)) {
  1673. return false;
  1674. }
  1675. }
  1676. return true;
  1677. }
  1678. /**
  1679. * A specialized version of `_.filter` for arrays without support for
  1680. * iteratee shorthands.
  1681. *
  1682. * @private
  1683. * @param {Array} [array] The array to iterate over.
  1684. * @param {Function} predicate The function invoked per iteration.
  1685. * @returns {Array} Returns the new filtered array.
  1686. */
  1687. function arrayFilter(array, predicate) {
  1688. var index = -1,
  1689. length = array == null ? 0 : array.length,
  1690. resIndex = 0,
  1691. result = [];
  1692. while (++index < length) {
  1693. var value = array[index];
  1694. if (predicate(value, index, array)) {
  1695. result[resIndex++] = value;
  1696. }
  1697. }
  1698. return result;
  1699. }
  1700. /**
  1701. * A specialized version of `_.includes` for arrays without support for
  1702. * specifying an index to search from.
  1703. *
  1704. * @private
  1705. * @param {Array} [array] The array to inspect.
  1706. * @param {*} target The value to search for.
  1707. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1708. */
  1709. function arrayIncludes(array, value) {
  1710. var length = array == null ? 0 : array.length;
  1711. return !!length && baseIndexOf(array, value, 0) > -1;
  1712. }
  1713. /**
  1714. * This function is like `arrayIncludes` except that it accepts a comparator.
  1715. *
  1716. * @private
  1717. * @param {Array} [array] The array to inspect.
  1718. * @param {*} target The value to search for.
  1719. * @param {Function} comparator The comparator invoked per element.
  1720. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1721. */
  1722. function arrayIncludesWith(array, value, comparator) {
  1723. var index = -1,
  1724. length = array == null ? 0 : array.length;
  1725. while (++index < length) {
  1726. if (comparator(value, array[index])) {
  1727. return true;
  1728. }
  1729. }
  1730. return false;
  1731. }
  1732. /**
  1733. * A specialized version of `_.map` for arrays without support for iteratee
  1734. * shorthands.
  1735. *
  1736. * @private
  1737. * @param {Array} [array] The array to iterate over.
  1738. * @param {Function} iteratee The function invoked per iteration.
  1739. * @returns {Array} Returns the new mapped array.
  1740. */
  1741. function arrayMap(array, iteratee) {
  1742. var index = -1,
  1743. length = array == null ? 0 : array.length,
  1744. result = Array(length);
  1745. while (++index < length) {
  1746. result[index] = iteratee(array[index], index, array);
  1747. }
  1748. return result;
  1749. }
  1750. /**
  1751. * Appends the elements of `values` to `array`.
  1752. *
  1753. * @private
  1754. * @param {Array} array The array to modify.
  1755. * @param {Array} values The values to append.
  1756. * @returns {Array} Returns `array`.
  1757. */
  1758. function arrayPush(array, values) {
  1759. var index = -1,
  1760. length = values.length,
  1761. offset = array.length;
  1762. while (++index < length) {
  1763. array[offset + index] = values[index];
  1764. }
  1765. return array;
  1766. }
  1767. /**
  1768. * A specialized version of `_.reduce` for arrays without support for
  1769. * iteratee shorthands.
  1770. *
  1771. * @private
  1772. * @param {Array} [array] The array to iterate over.
  1773. * @param {Function} iteratee The function invoked per iteration.
  1774. * @param {*} [accumulator] The initial value.
  1775. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1776. * the initial value.
  1777. * @returns {*} Returns the accumulated value.
  1778. */
  1779. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1780. var index = -1,
  1781. length = array == null ? 0 : array.length;
  1782. if (initAccum && length) {
  1783. accumulator = array[++index];
  1784. }
  1785. while (++index < length) {
  1786. accumulator = iteratee(accumulator, array[index], index, array);
  1787. }
  1788. return accumulator;
  1789. }
  1790. /**
  1791. * A specialized version of `_.reduceRight` for arrays without support for
  1792. * iteratee shorthands.
  1793. *
  1794. * @private
  1795. * @param {Array} [array] The array to iterate over.
  1796. * @param {Function} iteratee The function invoked per iteration.
  1797. * @param {*} [accumulator] The initial value.
  1798. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1799. * the initial value.
  1800. * @returns {*} Returns the accumulated value.
  1801. */
  1802. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1803. var length = array == null ? 0 : array.length;
  1804. if (initAccum && length) {
  1805. accumulator = array[--length];
  1806. }
  1807. while (length--) {
  1808. accumulator = iteratee(accumulator, array[length], length, array);
  1809. }
  1810. return accumulator;
  1811. }
  1812. /**
  1813. * A specialized version of `_.some` for arrays without support for iteratee
  1814. * shorthands.
  1815. *
  1816. * @private
  1817. * @param {Array} [array] The array to iterate over.
  1818. * @param {Function} predicate The function invoked per iteration.
  1819. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1820. * else `false`.
  1821. */
  1822. function arraySome(array, predicate) {
  1823. var index = -1,
  1824. length = array == null ? 0 : array.length;
  1825. while (++index < length) {
  1826. if (predicate(array[index], index, array)) {
  1827. return true;
  1828. }
  1829. }
  1830. return false;
  1831. }
  1832. /**
  1833. * Gets the size of an ASCII `string`.
  1834. *
  1835. * @private
  1836. * @param {string} string The string inspect.
  1837. * @returns {number} Returns the string size.
  1838. */
  1839. var asciiSize = baseProperty('length');
  1840. /**
  1841. * Converts an ASCII `string` to an array.
  1842. *
  1843. * @private
  1844. * @param {string} string The string to convert.
  1845. * @returns {Array} Returns the converted array.
  1846. */
  1847. function asciiToArray(string) {
  1848. return string.split('');
  1849. }
  1850. /**
  1851. * Splits an ASCII `string` into an array of its words.
  1852. *
  1853. * @private
  1854. * @param {string} The string to inspect.
  1855. * @returns {Array} Returns the words of `string`.
  1856. */
  1857. function asciiWords(string) {
  1858. return string.match(reAsciiWord) || [];
  1859. }
  1860. /**
  1861. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1862. * without support for iteratee shorthands, which iterates over `collection`
  1863. * using `eachFunc`.
  1864. *
  1865. * @private
  1866. * @param {Array|Object} collection The collection to inspect.
  1867. * @param {Function} predicate The function invoked per iteration.
  1868. * @param {Function} eachFunc The function to iterate over `collection`.
  1869. * @returns {*} Returns the found element or its key, else `undefined`.
  1870. */
  1871. function baseFindKey(collection, predicate, eachFunc) {
  1872. var result;
  1873. eachFunc(collection, function(value, key, collection) {
  1874. if (predicate(value, key, collection)) {
  1875. result = key;
  1876. return false;
  1877. }
  1878. });
  1879. return result;
  1880. }
  1881. /**
  1882. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1883. * support for iteratee shorthands.
  1884. *
  1885. * @private
  1886. * @param {Array} array The array to inspect.
  1887. * @param {Function} predicate The function invoked per iteration.
  1888. * @param {number} fromIndex The index to search from.
  1889. * @param {boolean} [fromRight] Specify iterating from right to left.
  1890. * @returns {number} Returns the index of the matched value, else `-1`.
  1891. */
  1892. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1893. var length = array.length,
  1894. index = fromIndex + (fromRight ? 1 : -1);
  1895. while ((fromRight ? index-- : ++index < length)) {
  1896. if (predicate(array[index], index, array)) {
  1897. return index;
  1898. }
  1899. }
  1900. return -1;
  1901. }
  1902. /**
  1903. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1904. *
  1905. * @private
  1906. * @param {Array} array The array to inspect.
  1907. * @param {*} value The value to search for.
  1908. * @param {number} fromIndex The index to search from.
  1909. * @returns {number} Returns the index of the matched value, else `-1`.
  1910. */
  1911. function baseIndexOf(array, value, fromIndex) {
  1912. return value === value
  1913. ? strictIndexOf(array, value, fromIndex)
  1914. : baseFindIndex(array, baseIsNaN, fromIndex);
  1915. }
  1916. /**
  1917. * This function is like `baseIndexOf` except that it accepts a comparator.
  1918. *
  1919. * @private
  1920. * @param {Array} array The array to inspect.
  1921. * @param {*} value The value to search for.
  1922. * @param {number} fromIndex The index to search from.
  1923. * @param {Function} comparator The comparator invoked per element.
  1924. * @returns {number} Returns the index of the matched value, else `-1`.
  1925. */
  1926. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1927. var index = fromIndex - 1,
  1928. length = array.length;
  1929. while (++index < length) {
  1930. if (comparator(array[index], value)) {
  1931. return index;
  1932. }
  1933. }
  1934. return -1;
  1935. }
  1936. /**
  1937. * The base implementation of `_.isNaN` without support for number objects.
  1938. *
  1939. * @private
  1940. * @param {*} value The value to check.
  1941. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1942. */
  1943. function baseIsNaN(value) {
  1944. return value !== value;
  1945. }
  1946. /**
  1947. * The base implementation of `_.mean` and `_.meanBy` without support for
  1948. * iteratee shorthands.
  1949. *
  1950. * @private
  1951. * @param {Array} array The array to iterate over.
  1952. * @param {Function} iteratee The function invoked per iteration.
  1953. * @returns {number} Returns the mean.
  1954. */
  1955. function baseMean(array, iteratee) {
  1956. var length = array == null ? 0 : array.length;
  1957. return length ? (baseSum(array, iteratee) / length) : NAN;
  1958. }
  1959. /**
  1960. * The base implementation of `_.property` without support for deep paths.
  1961. *
  1962. * @private
  1963. * @param {string} key The key of the property to get.
  1964. * @returns {Function} Returns the new accessor function.
  1965. */
  1966. function baseProperty(key) {
  1967. return function(object) {
  1968. return object == null ? undefined : object[key];
  1969. };
  1970. }
  1971. /**
  1972. * The base implementation of `_.propertyOf` without support for deep paths.
  1973. *
  1974. * @private
  1975. * @param {Object} object The object to query.
  1976. * @returns {Function} Returns the new accessor function.
  1977. */
  1978. function basePropertyOf(object) {
  1979. return function(key) {
  1980. return object == null ? undefined : object[key];
  1981. };
  1982. }
  1983. /**
  1984. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1985. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1986. *
  1987. * @private
  1988. * @param {Array|Object} collection The collection to iterate over.
  1989. * @param {Function} iteratee The function invoked per iteration.
  1990. * @param {*} accumulator The initial value.
  1991. * @param {boolean} initAccum Specify using the first or last element of
  1992. * `collection` as the initial value.
  1993. * @param {Function} eachFunc The function to iterate over `collection`.
  1994. * @returns {*} Returns the accumulated value.
  1995. */
  1996. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1997. eachFunc(collection, function(value, index, collection) {
  1998. accumulator = initAccum
  1999. ? (initAccum = false, value)
  2000. : iteratee(accumulator, value, index, collection);
  2001. });
  2002. return accumulator;
  2003. }
  2004. /**
  2005. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2006. * sort order of `array` and replaces criteria objects with their corresponding
  2007. * values.
  2008. *
  2009. * @private
  2010. * @param {Array} array The array to sort.
  2011. * @param {Function} comparer The function to define sort order.
  2012. * @returns {Array} Returns `array`.
  2013. */
  2014. function baseSortBy(array, comparer) {
  2015. var length = array.length;
  2016. array.sort(comparer);
  2017. while (length--) {
  2018. array[length] = array[length].value;
  2019. }
  2020. return array;
  2021. }
  2022. /**
  2023. * The base implementation of `_.sum` and `_.sumBy` without support for
  2024. * iteratee shorthands.
  2025. *
  2026. * @private
  2027. * @param {Array} array The array to iterate over.
  2028. * @param {Function} iteratee The function invoked per iteration.
  2029. * @returns {number} Returns the sum.
  2030. */
  2031. function baseSum(array, iteratee) {
  2032. var result,
  2033. index = -1,
  2034. length = array.length;
  2035. while (++index < length) {
  2036. var current = iteratee(array[index]);
  2037. if (current !== undefined) {
  2038. result = result === undefined ? current : (result + current);
  2039. }
  2040. }
  2041. return result;
  2042. }
  2043. /**
  2044. * The base implementation of `_.times` without support for iteratee shorthands
  2045. * or max array length checks.
  2046. *
  2047. * @private
  2048. * @param {number} n The number of times to invoke `iteratee`.
  2049. * @param {Function} iteratee The function invoked per iteration.
  2050. * @returns {Array} Returns the array of results.
  2051. */
  2052. function baseTimes(n, iteratee) {
  2053. var index = -1,
  2054. result = Array(n);
  2055. while (++index < n) {
  2056. result[index] = iteratee(index);
  2057. }
  2058. return result;
  2059. }
  2060. /**
  2061. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2062. * of key-value pairs for `object` corresponding to the property names of `props`.
  2063. *
  2064. * @private
  2065. * @param {Object} object The object to query.
  2066. * @param {Array} props The property names to get values for.
  2067. * @returns {Object} Returns the key-value pairs.
  2068. */
  2069. function baseToPairs(object, props) {
  2070. return arrayMap(props, function(key) {
  2071. return [key, object[key]];
  2072. });
  2073. }
  2074. /**
  2075. * The base implementation of `_.trim`.
  2076. *
  2077. * @private
  2078. * @param {string} string The string to trim.
  2079. * @returns {string} Returns the trimmed string.
  2080. */
  2081. function baseTrim(string) {
  2082. return string
  2083. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2084. : string;
  2085. }
  2086. /**
  2087. * The base implementation of `_.unary` without support for storing metadata.
  2088. *
  2089. * @private
  2090. * @param {Function} func The function to cap arguments for.
  2091. * @returns {Function} Returns the new capped function.
  2092. */
  2093. function baseUnary(func) {
  2094. return function(value) {
  2095. return func(value);
  2096. };
  2097. }
  2098. /**
  2099. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2100. * array of `object` property values corresponding to the property names
  2101. * of `props`.
  2102. *
  2103. * @private
  2104. * @param {Object} object The object to query.
  2105. * @param {Array} props The property names to get values for.
  2106. * @returns {Object} Returns the array of property values.
  2107. */
  2108. function baseValues(object, props) {
  2109. return arrayMap(props, function(key) {
  2110. return object[key];
  2111. });
  2112. }
  2113. /**
  2114. * Checks if a `cache` value for `key` exists.
  2115. *
  2116. * @private
  2117. * @param {Object} cache The cache to query.
  2118. * @param {string} key The key of the entry to check.
  2119. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2120. */
  2121. function cacheHas(cache, key) {
  2122. return cache.has(key);
  2123. }
  2124. /**
  2125. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2126. * that is not found in the character symbols.
  2127. *
  2128. * @private
  2129. * @param {Array} strSymbols The string symbols to inspect.
  2130. * @param {Array} chrSymbols The character symbols to find.
  2131. * @returns {number} Returns the index of the first unmatched string symbol.
  2132. */
  2133. function charsStartIndex(strSymbols, chrSymbols) {
  2134. var index = -1,
  2135. length = strSymbols.length;
  2136. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2137. return index;
  2138. }
  2139. /**
  2140. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2141. * that is not found in the character symbols.
  2142. *
  2143. * @private
  2144. * @param {Array} strSymbols The string symbols to inspect.
  2145. * @param {Array} chrSymbols The character symbols to find.
  2146. * @returns {number} Returns the index of the last unmatched string symbol.
  2147. */
  2148. function charsEndIndex(strSymbols, chrSymbols) {
  2149. var index = strSymbols.length;
  2150. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2151. return index;
  2152. }
  2153. /**
  2154. * Gets the number of `placeholder` occurrences in `array`.
  2155. *
  2156. * @private
  2157. * @param {Array} array The array to inspect.
  2158. * @param {*} placeholder The placeholder to search for.
  2159. * @returns {number} Returns the placeholder count.
  2160. */
  2161. function countHolders(array, placeholder) {
  2162. var length = array.length,
  2163. result = 0;
  2164. while (length--) {
  2165. if (array[length] === placeholder) {
  2166. ++result;
  2167. }
  2168. }
  2169. return result;
  2170. }
  2171. /**
  2172. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2173. * letters to basic Latin letters.
  2174. *
  2175. * @private
  2176. * @param {string} letter The matched letter to deburr.
  2177. * @returns {string} Returns the deburred letter.
  2178. */
  2179. var deburrLetter = basePropertyOf(deburredLetters);
  2180. /**
  2181. * Used by `_.escape` to convert characters to HTML entities.
  2182. *
  2183. * @private
  2184. * @param {string} chr The matched character to escape.
  2185. * @returns {string} Returns the escaped character.
  2186. */
  2187. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2188. /**
  2189. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2190. *
  2191. * @private
  2192. * @param {string} chr The matched character to escape.
  2193. * @returns {string} Returns the escaped character.
  2194. */
  2195. function escapeStringChar(chr) {
  2196. return '\\' + stringEscapes[chr];
  2197. }
  2198. /**
  2199. * Gets the value at `key` of `object`.
  2200. *
  2201. * @private
  2202. * @param {Object} [object] The object to query.
  2203. * @param {string} key The key of the property to get.
  2204. * @returns {*} Returns the property value.
  2205. */
  2206. function getValue(object, key) {
  2207. return object == null ? undefined : object[key];
  2208. }
  2209. /**
  2210. * Checks if `string` contains Unicode symbols.
  2211. *
  2212. * @private
  2213. * @param {string} string The string to inspect.
  2214. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2215. */
  2216. function hasUnicode(string) {
  2217. return reHasUnicode.test(string);
  2218. }
  2219. /**
  2220. * Checks if `string` contains a word composed of Unicode symbols.
  2221. *
  2222. * @private
  2223. * @param {string} string The string to inspect.
  2224. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2225. */
  2226. function hasUnicodeWord(string) {
  2227. return reHasUnicodeWord.test(string);
  2228. }
  2229. /**
  2230. * Converts `iterator` to an array.
  2231. *
  2232. * @private
  2233. * @param {Object} iterator The iterator to convert.
  2234. * @returns {Array} Returns the converted array.
  2235. */
  2236. function iteratorToArray(iterator) {
  2237. var data,
  2238. result = [];
  2239. while (!(data = iterator.next()).done) {
  2240. result.push(data.value);
  2241. }
  2242. return result;
  2243. }
  2244. /**
  2245. * Converts `map` to its key-value pairs.
  2246. *
  2247. * @private
  2248. * @param {Object} map The map to convert.
  2249. * @returns {Array} Returns the key-value pairs.
  2250. */
  2251. function mapToArray(map) {
  2252. var index = -1,
  2253. result = Array(map.size);
  2254. map.forEach(function(value, key) {
  2255. result[++index] = [key, value];
  2256. });
  2257. return result;
  2258. }
  2259. /**
  2260. * Creates a unary function that invokes `func` with its argument transformed.
  2261. *
  2262. * @private
  2263. * @param {Function} func The function to wrap.
  2264. * @param {Function} transform The argument transform.
  2265. * @returns {Function} Returns the new function.
  2266. */
  2267. function overArg(func, transform) {
  2268. return function(arg) {
  2269. return func(transform(arg));
  2270. };
  2271. }
  2272. /**
  2273. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2274. * and returns an array of their indexes.
  2275. *
  2276. * @private
  2277. * @param {Array} array The array to modify.
  2278. * @param {*} placeholder The placeholder to replace.
  2279. * @returns {Array} Returns the new array of placeholder indexes.
  2280. */
  2281. function replaceHolders(array, placeholder) {
  2282. var index = -1,
  2283. length = array.length,
  2284. resIndex = 0,
  2285. result = [];
  2286. while (++index < length) {
  2287. var value = array[index];
  2288. if (value === placeholder || value === PLACEHOLDER) {
  2289. array[index] = PLACEHOLDER;
  2290. result[resIndex++] = index;
  2291. }
  2292. }
  2293. return result;
  2294. }
  2295. /**
  2296. * Converts `set` to an array of its values.
  2297. *
  2298. * @private
  2299. * @param {Object} set The set to convert.
  2300. * @returns {Array} Returns the values.
  2301. */
  2302. function setToArray(set) {
  2303. var index = -1,
  2304. result = Array(set.size);
  2305. set.forEach(function(value) {
  2306. result[++index] = value;
  2307. });
  2308. return result;
  2309. }
  2310. /**
  2311. * Converts `set` to its value-value pairs.
  2312. *
  2313. * @private
  2314. * @param {Object} set The set to convert.
  2315. * @returns {Array} Returns the value-value pairs.
  2316. */
  2317. function setToPairs(set) {
  2318. var index = -1,
  2319. result = Array(set.size);
  2320. set.forEach(function(value) {
  2321. result[++index] = [value, value];
  2322. });
  2323. return result;
  2324. }
  2325. /**
  2326. * A specialized version of `_.indexOf` which performs strict equality
  2327. * comparisons of values, i.e. `===`.
  2328. *
  2329. * @private
  2330. * @param {Array} array The array to inspect.
  2331. * @param {*} value The value to search for.
  2332. * @param {number} fromIndex The index to search from.
  2333. * @returns {number} Returns the index of the matched value, else `-1`.
  2334. */
  2335. function strictIndexOf(array, value, fromIndex) {
  2336. var index = fromIndex - 1,
  2337. length = array.length;
  2338. while (++index < length) {
  2339. if (array[index] === value) {
  2340. return index;
  2341. }
  2342. }
  2343. return -1;
  2344. }
  2345. /**
  2346. * A specialized version of `_.lastIndexOf` which performs strict equality
  2347. * comparisons of values, i.e. `===`.
  2348. *
  2349. * @private
  2350. * @param {Array} array The array to inspect.
  2351. * @param {*} value The value to search for.
  2352. * @param {number} fromIndex The index to search from.
  2353. * @returns {number} Returns the index of the matched value, else `-1`.
  2354. */
  2355. function strictLastIndexOf(array, value, fromIndex) {
  2356. var index = fromIndex + 1;
  2357. while (index--) {
  2358. if (array[index] === value) {
  2359. return index;
  2360. }
  2361. }
  2362. return index;
  2363. }
  2364. /**
  2365. * Gets the number of symbols in `string`.
  2366. *
  2367. * @private
  2368. * @param {string} string The string to inspect.
  2369. * @returns {number} Returns the string size.
  2370. */
  2371. function stringSize(string) {
  2372. return hasUnicode(string)
  2373. ? unicodeSize(string)
  2374. : asciiSize(string);
  2375. }
  2376. /**
  2377. * Converts `string` to an array.
  2378. *
  2379. * @private
  2380. * @param {string} string The string to convert.
  2381. * @returns {Array} Returns the converted array.
  2382. */
  2383. function stringToArray(string) {
  2384. return hasUnicode(string)
  2385. ? unicodeToArray(string)
  2386. : asciiToArray(string);
  2387. }
  2388. /**
  2389. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2390. * character of `string`.
  2391. *
  2392. * @private
  2393. * @param {string} string The string to inspect.
  2394. * @returns {number} Returns the index of the last non-whitespace character.
  2395. */
  2396. function trimmedEndIndex(string) {
  2397. var index = string.length;
  2398. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2399. return index;
  2400. }
  2401. /**
  2402. * Used by `_.unescape` to convert HTML entities to characters.
  2403. *
  2404. * @private
  2405. * @param {string} chr The matched character to unescape.
  2406. * @returns {string} Returns the unescaped character.
  2407. */
  2408. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2409. /**
  2410. * Gets the size of a Unicode `string`.
  2411. *
  2412. * @private
  2413. * @param {string} string The string inspect.
  2414. * @returns {number} Returns the string size.
  2415. */
  2416. function unicodeSize(string) {
  2417. var result = reUnicode.lastIndex = 0;
  2418. while (reUnicode.test(string)) {
  2419. ++result;
  2420. }
  2421. return result;
  2422. }
  2423. /**
  2424. * Converts a Unicode `string` to an array.
  2425. *
  2426. * @private
  2427. * @param {string} string The string to convert.
  2428. * @returns {Array} Returns the converted array.
  2429. */
  2430. function unicodeToArray(string) {
  2431. return string.match(reUnicode) || [];
  2432. }
  2433. /**
  2434. * Splits a Unicode `string` into an array of its words.
  2435. *
  2436. * @private
  2437. * @param {string} The string to inspect.
  2438. * @returns {Array} Returns the words of `string`.
  2439. */
  2440. function unicodeWords(string) {
  2441. return string.match(reUnicodeWord) || [];
  2442. }
  2443. /*--------------------------------------------------------------------------*/
  2444. /**
  2445. * Create a new pristine `lodash` function using the `context` object.
  2446. *
  2447. * @static
  2448. * @memberOf _
  2449. * @since 1.1.0
  2450. * @category Util
  2451. * @param {Object} [context=root] The context object.
  2452. * @returns {Function} Returns a new `lodash` function.
  2453. * @example
  2454. *
  2455. * _.mixin({ 'foo': _.constant('foo') });
  2456. *
  2457. * var lodash = _.runInContext();
  2458. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2459. *
  2460. * _.isFunction(_.foo);
  2461. * // => true
  2462. * _.isFunction(_.bar);
  2463. * // => false
  2464. *
  2465. * lodash.isFunction(lodash.foo);
  2466. * // => false
  2467. * lodash.isFunction(lodash.bar);
  2468. * // => true
  2469. *
  2470. * // Create a suped-up `defer` in Node.js.
  2471. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2472. */
  2473. var runInContext = (function runInContext(context) {
  2474. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2475. /** Built-in constructor references. */
  2476. var Array = context.Array,
  2477. Date = context.Date,
  2478. Error = context.Error,
  2479. Function = context.Function,
  2480. Math = context.Math,
  2481. Object = context.Object,
  2482. RegExp = context.RegExp,
  2483. String = context.String,
  2484. TypeError = context.TypeError;
  2485. /** Used for built-in method references. */
  2486. var arrayProto = Array.prototype,
  2487. funcProto = Function.prototype,
  2488. objectProto = Object.prototype;
  2489. /** Used to detect overreaching core-js shims. */
  2490. var coreJsData = context['__core-js_shared__'];
  2491. /** Used to resolve the decompiled source of functions. */
  2492. var funcToString = funcProto.toString;
  2493. /** Used to check objects for own properties. */
  2494. var hasOwnProperty = objectProto.hasOwnProperty;
  2495. /** Used to generate unique IDs. */
  2496. var idCounter = 0;
  2497. /** Used to detect methods masquerading as native. */
  2498. var maskSrcKey = (function() {
  2499. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2500. return uid ? ('Symbol(src)_1.' + uid) : '';
  2501. }());
  2502. /**
  2503. * Used to resolve the
  2504. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2505. * of values.
  2506. */
  2507. var nativeObjectToString = objectProto.toString;
  2508. /** Used to infer the `Object` constructor. */
  2509. var objectCtorString = funcToString.call(Object);
  2510. /** Used to restore the original `_` reference in `_.noConflict`. */
  2511. var oldDash = root._;
  2512. /** Used to detect if a method is native. */
  2513. var reIsNative = RegExp('^' +
  2514. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2515. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2516. );
  2517. /** Built-in value references. */
  2518. var Buffer = moduleExports ? context.Buffer : undefined,
  2519. Symbol = context.Symbol,
  2520. Uint8Array = context.Uint8Array,
  2521. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2522. getPrototype = overArg(Object.getPrototypeOf, Object),
  2523. objectCreate = Object.create,
  2524. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2525. splice = arrayProto.splice,
  2526. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2527. symIterator = Symbol ? Symbol.iterator : undefined,
  2528. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2529. var defineProperty = (function() {
  2530. try {
  2531. var func = getNative(Object, 'defineProperty');
  2532. func({}, '', {});
  2533. return func;
  2534. } catch (e) {}
  2535. }());
  2536. /** Mocked built-ins. */
  2537. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2538. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2539. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2540. /* Built-in method references for those with the same name as other `lodash` methods. */
  2541. var nativeCeil = Math.ceil,
  2542. nativeFloor = Math.floor,
  2543. nativeGetSymbols = Object.getOwnPropertySymbols,
  2544. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2545. nativeIsFinite = context.isFinite,
  2546. nativeJoin = arrayProto.join,
  2547. nativeKeys = overArg(Object.keys, Object),
  2548. nativeMax = Math.max,
  2549. nativeMin = Math.min,
  2550. nativeNow = Date.now,
  2551. nativeParseInt = context.parseInt,
  2552. nativeRandom = Math.random,
  2553. nativeReverse = arrayProto.reverse;
  2554. /* Built-in method references that are verified to be native. */
  2555. var DataView = getNative(context, 'DataView'),
  2556. Map = getNative(context, 'Map'),
  2557. Promise = getNative(context, 'Promise'),
  2558. Set = getNative(context, 'Set'),
  2559. WeakMap = getNative(context, 'WeakMap'),
  2560. nativeCreate = getNative(Object, 'create');
  2561. /** Used to store function metadata. */
  2562. var metaMap = WeakMap && new WeakMap;
  2563. /** Used to lookup unminified function names. */
  2564. var realNames = {};
  2565. /** Used to detect maps, sets, and weakmaps. */
  2566. var dataViewCtorString = toSource(DataView),
  2567. mapCtorString = toSource(Map),
  2568. promiseCtorString = toSource(Promise),
  2569. setCtorString = toSource(Set),
  2570. weakMapCtorString = toSource(WeakMap);
  2571. /** Used to convert symbols to primitives and strings. */
  2572. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2573. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2574. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2575. /*------------------------------------------------------------------------*/
  2576. /**
  2577. * Creates a `lodash` object which wraps `value` to enable implicit method
  2578. * chain sequences. Methods that operate on and return arrays, collections,
  2579. * and functions can be chained together. Methods that retrieve a single value
  2580. * or may return a primitive value will automatically end the chain sequence
  2581. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2582. * with `_#value`.
  2583. *
  2584. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2585. * enabled using `_.chain`.
  2586. *
  2587. * The execution of chained methods is lazy, that is, it's deferred until
  2588. * `_#value` is implicitly or explicitly called.
  2589. *
  2590. * Lazy evaluation allows several methods to support shortcut fusion.
  2591. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2592. * the creation of intermediate arrays and can greatly reduce the number of
  2593. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2594. * fusion if the section is applied to an array and iteratees accept only
  2595. * one argument. The heuristic for whether a section qualifies for shortcut
  2596. * fusion is subject to change.
  2597. *
  2598. * Chaining is supported in custom builds as long as the `_#value` method is
  2599. * directly or indirectly included in the build.
  2600. *
  2601. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2602. *
  2603. * The wrapper `Array` methods are:
  2604. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2605. *
  2606. * The wrapper `String` methods are:
  2607. * `replace` and `split`
  2608. *
  2609. * The wrapper methods that support shortcut fusion are:
  2610. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2611. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2612. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2613. *
  2614. * The chainable wrapper methods are:
  2615. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2616. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2617. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2618. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2619. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2620. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2621. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2622. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2623. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2624. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2625. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2626. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2627. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2628. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2629. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2630. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2631. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2632. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2633. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2634. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2635. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2636. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2637. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2638. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2639. *
  2640. * The wrapper methods that are **not** chainable by default are:
  2641. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2642. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2643. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2644. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2645. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2646. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2647. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2648. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2649. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2650. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2651. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2652. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2653. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2654. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2655. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2656. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2657. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2658. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2659. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2660. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2661. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2662. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2663. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2664. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2665. * `upperFirst`, `value`, and `words`
  2666. *
  2667. * @name _
  2668. * @constructor
  2669. * @category Seq
  2670. * @param {*} value The value to wrap in a `lodash` instance.
  2671. * @returns {Object} Returns the new `lodash` wrapper instance.
  2672. * @example
  2673. *
  2674. * function square(n) {
  2675. * return n * n;
  2676. * }
  2677. *
  2678. * var wrapped = _([1, 2, 3]);
  2679. *
  2680. * // Returns an unwrapped value.
  2681. * wrapped.reduce(_.add);
  2682. * // => 6
  2683. *
  2684. * // Returns a wrapped value.
  2685. * var squares = wrapped.map(square);
  2686. *
  2687. * _.isArray(squares);
  2688. * // => false
  2689. *
  2690. * _.isArray(squares.value());
  2691. * // => true
  2692. */
  2693. function lodash(value) {
  2694. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2695. if (value instanceof LodashWrapper) {
  2696. return value;
  2697. }
  2698. if (hasOwnProperty.call(value, '__wrapped__')) {
  2699. return wrapperClone(value);
  2700. }
  2701. }
  2702. return new LodashWrapper(value);
  2703. }
  2704. /**
  2705. * The base implementation of `_.create` without support for assigning
  2706. * properties to the created object.
  2707. *
  2708. * @private
  2709. * @param {Object} proto The object to inherit from.
  2710. * @returns {Object} Returns the new object.
  2711. */
  2712. var baseCreate = (function() {
  2713. function object() {}
  2714. return function(proto) {
  2715. if (!isObject(proto)) {
  2716. return {};
  2717. }
  2718. if (objectCreate) {
  2719. return objectCreate(proto);
  2720. }
  2721. object.prototype = proto;
  2722. var result = new object;
  2723. object.prototype = undefined;
  2724. return result;
  2725. };
  2726. }());
  2727. /**
  2728. * The function whose prototype chain sequence wrappers inherit from.
  2729. *
  2730. * @private
  2731. */
  2732. function baseLodash() {
  2733. // No operation performed.
  2734. }
  2735. /**
  2736. * The base constructor for creating `lodash` wrapper objects.
  2737. *
  2738. * @private
  2739. * @param {*} value The value to wrap.
  2740. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2741. */
  2742. function LodashWrapper(value, chainAll) {
  2743. this.__wrapped__ = value;
  2744. this.__actions__ = [];
  2745. this.__chain__ = !!chainAll;
  2746. this.__index__ = 0;
  2747. this.__values__ = undefined;
  2748. }
  2749. /**
  2750. * By default, the template delimiters used by lodash are like those in
  2751. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2752. * following template settings to use alternative delimiters.
  2753. *
  2754. * @static
  2755. * @memberOf _
  2756. * @type {Object}
  2757. */
  2758. lodash.templateSettings = {
  2759. /**
  2760. * Used to detect `data` property values to be HTML-escaped.
  2761. *
  2762. * @memberOf _.templateSettings
  2763. * @type {RegExp}
  2764. */
  2765. 'escape': reEscape,
  2766. /**
  2767. * Used to detect code to be evaluated.
  2768. *
  2769. * @memberOf _.templateSettings
  2770. * @type {RegExp}
  2771. */
  2772. 'evaluate': reEvaluate,
  2773. /**
  2774. * Used to detect `data` property values to inject.
  2775. *
  2776. * @memberOf _.templateSettings
  2777. * @type {RegExp}
  2778. */
  2779. 'interpolate': reInterpolate,
  2780. /**
  2781. * Used to reference the data object in the template text.
  2782. *
  2783. * @memberOf _.templateSettings
  2784. * @type {string}
  2785. */
  2786. 'variable': '',
  2787. /**
  2788. * Used to import variables into the compiled template.
  2789. *
  2790. * @memberOf _.templateSettings
  2791. * @type {Object}
  2792. */
  2793. 'imports': {
  2794. /**
  2795. * A reference to the `lodash` function.
  2796. *
  2797. * @memberOf _.templateSettings.imports
  2798. * @type {Function}
  2799. */
  2800. '_': lodash
  2801. }
  2802. };
  2803. // Ensure wrappers are instances of `baseLodash`.
  2804. lodash.prototype = baseLodash.prototype;
  2805. lodash.prototype.constructor = lodash;
  2806. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2807. LodashWrapper.prototype.constructor = LodashWrapper;
  2808. /*------------------------------------------------------------------------*/
  2809. /**
  2810. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2811. *
  2812. * @private
  2813. * @constructor
  2814. * @param {*} value The value to wrap.
  2815. */
  2816. function LazyWrapper(value) {
  2817. this.__wrapped__ = value;
  2818. this.__actions__ = [];
  2819. this.__dir__ = 1;
  2820. this.__filtered__ = false;
  2821. this.__iteratees__ = [];
  2822. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2823. this.__views__ = [];
  2824. }
  2825. /**
  2826. * Creates a clone of the lazy wrapper object.
  2827. *
  2828. * @private
  2829. * @name clone
  2830. * @memberOf LazyWrapper
  2831. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2832. */
  2833. function lazyClone() {
  2834. var result = new LazyWrapper(this.__wrapped__);
  2835. result.__actions__ = copyArray(this.__actions__);
  2836. result.__dir__ = this.__dir__;
  2837. result.__filtered__ = this.__filtered__;
  2838. result.__iteratees__ = copyArray(this.__iteratees__);
  2839. result.__takeCount__ = this.__takeCount__;
  2840. result.__views__ = copyArray(this.__views__);
  2841. return result;
  2842. }
  2843. /**
  2844. * Reverses the direction of lazy iteration.
  2845. *
  2846. * @private
  2847. * @name reverse
  2848. * @memberOf LazyWrapper
  2849. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2850. */
  2851. function lazyReverse() {
  2852. if (this.__filtered__) {
  2853. var result = new LazyWrapper(this);
  2854. result.__dir__ = -1;
  2855. result.__filtered__ = true;
  2856. } else {
  2857. result = this.clone();
  2858. result.__dir__ *= -1;
  2859. }
  2860. return result;
  2861. }
  2862. /**
  2863. * Extracts the unwrapped value from its lazy wrapper.
  2864. *
  2865. * @private
  2866. * @name value
  2867. * @memberOf LazyWrapper
  2868. * @returns {*} Returns the unwrapped value.
  2869. */
  2870. function lazyValue() {
  2871. var array = this.__wrapped__.value(),
  2872. dir = this.__dir__,
  2873. isArr = isArray(array),
  2874. isRight = dir < 0,
  2875. arrLength = isArr ? array.length : 0,
  2876. view = getView(0, arrLength, this.__views__),
  2877. start = view.start,
  2878. end = view.end,
  2879. length = end - start,
  2880. index = isRight ? end : (start - 1),
  2881. iteratees = this.__iteratees__,
  2882. iterLength = iteratees.length,
  2883. resIndex = 0,
  2884. takeCount = nativeMin(length, this.__takeCount__);
  2885. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2886. return baseWrapperValue(array, this.__actions__);
  2887. }
  2888. var result = [];
  2889. outer:
  2890. while (length-- && resIndex < takeCount) {
  2891. index += dir;
  2892. var iterIndex = -1,
  2893. value = array[index];
  2894. while (++iterIndex < iterLength) {
  2895. var data = iteratees[iterIndex],
  2896. iteratee = data.iteratee,
  2897. type = data.type,
  2898. computed = iteratee(value);
  2899. if (type == LAZY_MAP_FLAG) {
  2900. value = computed;
  2901. } else if (!computed) {
  2902. if (type == LAZY_FILTER_FLAG) {
  2903. continue outer;
  2904. } else {
  2905. break outer;
  2906. }
  2907. }
  2908. }
  2909. result[resIndex++] = value;
  2910. }
  2911. return result;
  2912. }
  2913. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2914. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2915. LazyWrapper.prototype.constructor = LazyWrapper;
  2916. /*------------------------------------------------------------------------*/
  2917. /**
  2918. * Creates a hash object.
  2919. *
  2920. * @private
  2921. * @constructor
  2922. * @param {Array} [entries] The key-value pairs to cache.
  2923. */
  2924. function Hash(entries) {
  2925. var index = -1,
  2926. length = entries == null ? 0 : entries.length;
  2927. this.clear();
  2928. while (++index < length) {
  2929. var entry = entries[index];
  2930. this.set(entry[0], entry[1]);
  2931. }
  2932. }
  2933. /**
  2934. * Removes all key-value entries from the hash.
  2935. *
  2936. * @private
  2937. * @name clear
  2938. * @memberOf Hash
  2939. */
  2940. function hashClear() {
  2941. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2942. this.size = 0;
  2943. }
  2944. /**
  2945. * Removes `key` and its value from the hash.
  2946. *
  2947. * @private
  2948. * @name delete
  2949. * @memberOf Hash
  2950. * @param {Object} hash The hash to modify.
  2951. * @param {string} key The key of the value to remove.
  2952. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2953. */
  2954. function hashDelete(key) {
  2955. var result = this.has(key) && delete this.__data__[key];
  2956. this.size -= result ? 1 : 0;
  2957. return result;
  2958. }
  2959. /**
  2960. * Gets the hash value for `key`.
  2961. *
  2962. * @private
  2963. * @name get
  2964. * @memberOf Hash
  2965. * @param {string} key The key of the value to get.
  2966. * @returns {*} Returns the entry value.
  2967. */
  2968. function hashGet(key) {
  2969. var data = this.__data__;
  2970. if (nativeCreate) {
  2971. var result = data[key];
  2972. return result === HASH_UNDEFINED ? undefined : result;
  2973. }
  2974. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2975. }
  2976. /**
  2977. * Checks if a hash value for `key` exists.
  2978. *
  2979. * @private
  2980. * @name has
  2981. * @memberOf Hash
  2982. * @param {string} key The key of the entry to check.
  2983. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2984. */
  2985. function hashHas(key) {
  2986. var data = this.__data__;
  2987. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2988. }
  2989. /**
  2990. * Sets the hash `key` to `value`.
  2991. *
  2992. * @private
  2993. * @name set
  2994. * @memberOf Hash
  2995. * @param {string} key The key of the value to set.
  2996. * @param {*} value The value to set.
  2997. * @returns {Object} Returns the hash instance.
  2998. */
  2999. function hashSet(key, value) {
  3000. var data = this.__data__;
  3001. this.size += this.has(key) ? 0 : 1;
  3002. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3003. return this;
  3004. }
  3005. // Add methods to `Hash`.
  3006. Hash.prototype.clear = hashClear;
  3007. Hash.prototype['delete'] = hashDelete;
  3008. Hash.prototype.get = hashGet;
  3009. Hash.prototype.has = hashHas;
  3010. Hash.prototype.set = hashSet;
  3011. /*------------------------------------------------------------------------*/
  3012. /**
  3013. * Creates an list cache object.
  3014. *
  3015. * @private
  3016. * @constructor
  3017. * @param {Array} [entries] The key-value pairs to cache.
  3018. */
  3019. function ListCache(entries) {
  3020. var index = -1,
  3021. length = entries == null ? 0 : entries.length;
  3022. this.clear();
  3023. while (++index < length) {
  3024. var entry = entries[index];
  3025. this.set(entry[0], entry[1]);
  3026. }
  3027. }
  3028. /**
  3029. * Removes all key-value entries from the list cache.
  3030. *
  3031. * @private
  3032. * @name clear
  3033. * @memberOf ListCache
  3034. */
  3035. function listCacheClear() {
  3036. this.__data__ = [];
  3037. this.size = 0;
  3038. }
  3039. /**
  3040. * Removes `key` and its value from the list cache.
  3041. *
  3042. * @private
  3043. * @name delete
  3044. * @memberOf ListCache
  3045. * @param {string} key The key of the value to remove.
  3046. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3047. */
  3048. function listCacheDelete(key) {
  3049. var data = this.__data__,
  3050. index = assocIndexOf(data, key);
  3051. if (index < 0) {
  3052. return false;
  3053. }
  3054. var lastIndex = data.length - 1;
  3055. if (index == lastIndex) {
  3056. data.pop();
  3057. } else {
  3058. splice.call(data, index, 1);
  3059. }
  3060. --this.size;
  3061. return true;
  3062. }
  3063. /**
  3064. * Gets the list cache value for `key`.
  3065. *
  3066. * @private
  3067. * @name get
  3068. * @memberOf ListCache
  3069. * @param {string} key The key of the value to get.
  3070. * @returns {*} Returns the entry value.
  3071. */
  3072. function listCacheGet(key) {
  3073. var data = this.__data__,
  3074. index = assocIndexOf(data, key);
  3075. return index < 0 ? undefined : data[index][1];
  3076. }
  3077. /**
  3078. * Checks if a list cache value for `key` exists.
  3079. *
  3080. * @private
  3081. * @name has
  3082. * @memberOf ListCache
  3083. * @param {string} key The key of the entry to check.
  3084. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3085. */
  3086. function listCacheHas(key) {
  3087. return assocIndexOf(this.__data__, key) > -1;
  3088. }
  3089. /**
  3090. * Sets the list cache `key` to `value`.
  3091. *
  3092. * @private
  3093. * @name set
  3094. * @memberOf ListCache
  3095. * @param {string} key The key of the value to set.
  3096. * @param {*} value The value to set.
  3097. * @returns {Object} Returns the list cache instance.
  3098. */
  3099. function listCacheSet(key, value) {
  3100. var data = this.__data__,
  3101. index = assocIndexOf(data, key);
  3102. if (index < 0) {
  3103. ++this.size;
  3104. data.push([key, value]);
  3105. } else {
  3106. data[index][1] = value;
  3107. }
  3108. return this;
  3109. }
  3110. // Add methods to `ListCache`.
  3111. ListCache.prototype.clear = listCacheClear;
  3112. ListCache.prototype['delete'] = listCacheDelete;
  3113. ListCache.prototype.get = listCacheGet;
  3114. ListCache.prototype.has = listCacheHas;
  3115. ListCache.prototype.set = listCacheSet;
  3116. /*------------------------------------------------------------------------*/
  3117. /**
  3118. * Creates a map cache object to store key-value pairs.
  3119. *
  3120. * @private
  3121. * @constructor
  3122. * @param {Array} [entries] The key-value pairs to cache.
  3123. */
  3124. function MapCache(entries) {
  3125. var index = -1,
  3126. length = entries == null ? 0 : entries.length;
  3127. this.clear();
  3128. while (++index < length) {
  3129. var entry = entries[index];
  3130. this.set(entry[0], entry[1]);
  3131. }
  3132. }
  3133. /**
  3134. * Removes all key-value entries from the map.
  3135. *
  3136. * @private
  3137. * @name clear
  3138. * @memberOf MapCache
  3139. */
  3140. function mapCacheClear() {
  3141. this.size = 0;
  3142. this.__data__ = {
  3143. 'hash': new Hash,
  3144. 'map': new (Map || ListCache),
  3145. 'string': new Hash
  3146. };
  3147. }
  3148. /**
  3149. * Removes `key` and its value from the map.
  3150. *
  3151. * @private
  3152. * @name delete
  3153. * @memberOf MapCache
  3154. * @param {string} key The key of the value to remove.
  3155. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3156. */
  3157. function mapCacheDelete(key) {
  3158. var result = getMapData(this, key)['delete'](key);
  3159. this.size -= result ? 1 : 0;
  3160. return result;
  3161. }
  3162. /**
  3163. * Gets the map value for `key`.
  3164. *
  3165. * @private
  3166. * @name get
  3167. * @memberOf MapCache
  3168. * @param {string} key The key of the value to get.
  3169. * @returns {*} Returns the entry value.
  3170. */
  3171. function mapCacheGet(key) {
  3172. return getMapData(this, key).get(key);
  3173. }
  3174. /**
  3175. * Checks if a map value for `key` exists.
  3176. *
  3177. * @private
  3178. * @name has
  3179. * @memberOf MapCache
  3180. * @param {string} key The key of the entry to check.
  3181. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3182. */
  3183. function mapCacheHas(key) {
  3184. return getMapData(this, key).has(key);
  3185. }
  3186. /**
  3187. * Sets the map `key` to `value`.
  3188. *
  3189. * @private
  3190. * @name set
  3191. * @memberOf MapCache
  3192. * @param {string} key The key of the value to set.
  3193. * @param {*} value The value to set.
  3194. * @returns {Object} Returns the map cache instance.
  3195. */
  3196. function mapCacheSet(key, value) {
  3197. var data = getMapData(this, key),
  3198. size = data.size;
  3199. data.set(key, value);
  3200. this.size += data.size == size ? 0 : 1;
  3201. return this;
  3202. }
  3203. // Add methods to `MapCache`.
  3204. MapCache.prototype.clear = mapCacheClear;
  3205. MapCache.prototype['delete'] = mapCacheDelete;
  3206. MapCache.prototype.get = mapCacheGet;
  3207. MapCache.prototype.has = mapCacheHas;
  3208. MapCache.prototype.set = mapCacheSet;
  3209. /*------------------------------------------------------------------------*/
  3210. /**
  3211. *
  3212. * Creates an array cache object to store unique values.
  3213. *
  3214. * @private
  3215. * @constructor
  3216. * @param {Array} [values] The values to cache.
  3217. */
  3218. function SetCache(values) {
  3219. var index = -1,
  3220. length = values == null ? 0 : values.length;
  3221. this.__data__ = new MapCache;
  3222. while (++index < length) {
  3223. this.add(values[index]);
  3224. }
  3225. }
  3226. /**
  3227. * Adds `value` to the array cache.
  3228. *
  3229. * @private
  3230. * @name add
  3231. * @memberOf SetCache
  3232. * @alias push
  3233. * @param {*} value The value to cache.
  3234. * @returns {Object} Returns the cache instance.
  3235. */
  3236. function setCacheAdd(value) {
  3237. this.__data__.set(value, HASH_UNDEFINED);
  3238. return this;
  3239. }
  3240. /**
  3241. * Checks if `value` is in the array cache.
  3242. *
  3243. * @private
  3244. * @name has
  3245. * @memberOf SetCache
  3246. * @param {*} value The value to search for.
  3247. * @returns {number} Returns `true` if `value` is found, else `false`.
  3248. */
  3249. function setCacheHas(value) {
  3250. return this.__data__.has(value);
  3251. }
  3252. // Add methods to `SetCache`.
  3253. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3254. SetCache.prototype.has = setCacheHas;
  3255. /*------------------------------------------------------------------------*/
  3256. /**
  3257. * Creates a stack cache object to store key-value pairs.
  3258. *
  3259. * @private
  3260. * @constructor
  3261. * @param {Array} [entries] The key-value pairs to cache.
  3262. */
  3263. function Stack(entries) {
  3264. var data = this.__data__ = new ListCache(entries);
  3265. this.size = data.size;
  3266. }
  3267. /**
  3268. * Removes all key-value entries from the stack.
  3269. *
  3270. * @private
  3271. * @name clear
  3272. * @memberOf Stack
  3273. */
  3274. function stackClear() {
  3275. this.__data__ = new ListCache;
  3276. this.size = 0;
  3277. }
  3278. /**
  3279. * Removes `key` and its value from the stack.
  3280. *
  3281. * @private
  3282. * @name delete
  3283. * @memberOf Stack
  3284. * @param {string} key The key of the value to remove.
  3285. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3286. */
  3287. function stackDelete(key) {
  3288. var data = this.__data__,
  3289. result = data['delete'](key);
  3290. this.size = data.size;
  3291. return result;
  3292. }
  3293. /**
  3294. * Gets the stack value for `key`.
  3295. *
  3296. * @private
  3297. * @name get
  3298. * @memberOf Stack
  3299. * @param {string} key The key of the value to get.
  3300. * @returns {*} Returns the entry value.
  3301. */
  3302. function stackGet(key) {
  3303. return this.__data__.get(key);
  3304. }
  3305. /**
  3306. * Checks if a stack value for `key` exists.
  3307. *
  3308. * @private
  3309. * @name has
  3310. * @memberOf Stack
  3311. * @param {string} key The key of the entry to check.
  3312. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3313. */
  3314. function stackHas(key) {
  3315. return this.__data__.has(key);
  3316. }
  3317. /**
  3318. * Sets the stack `key` to `value`.
  3319. *
  3320. * @private
  3321. * @name set
  3322. * @memberOf Stack
  3323. * @param {string} key The key of the value to set.
  3324. * @param {*} value The value to set.
  3325. * @returns {Object} Returns the stack cache instance.
  3326. */
  3327. function stackSet(key, value) {
  3328. var data = this.__data__;
  3329. if (data instanceof ListCache) {
  3330. var pairs = data.__data__;
  3331. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3332. pairs.push([key, value]);
  3333. this.size = ++data.size;
  3334. return this;
  3335. }
  3336. data = this.__data__ = new MapCache(pairs);
  3337. }
  3338. data.set(key, value);
  3339. this.size = data.size;
  3340. return this;
  3341. }
  3342. // Add methods to `Stack`.
  3343. Stack.prototype.clear = stackClear;
  3344. Stack.prototype['delete'] = stackDelete;
  3345. Stack.prototype.get = stackGet;
  3346. Stack.prototype.has = stackHas;
  3347. Stack.prototype.set = stackSet;
  3348. /*------------------------------------------------------------------------*/
  3349. /**
  3350. * Creates an array of the enumerable property names of the array-like `value`.
  3351. *
  3352. * @private
  3353. * @param {*} value The value to query.
  3354. * @param {boolean} inherited Specify returning inherited property names.
  3355. * @returns {Array} Returns the array of property names.
  3356. */
  3357. function arrayLikeKeys(value, inherited) {
  3358. var isArr = isArray(value),
  3359. isArg = !isArr && isArguments(value),
  3360. isBuff = !isArr && !isArg && isBuffer(value),
  3361. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3362. skipIndexes = isArr || isArg || isBuff || isType,
  3363. result = skipIndexes ? baseTimes(value.length, String) : [],
  3364. length = result.length;
  3365. for (var key in value) {
  3366. if ((inherited || hasOwnProperty.call(value, key)) &&
  3367. !(skipIndexes && (
  3368. // Safari 9 has enumerable `arguments.length` in strict mode.
  3369. key == 'length' ||
  3370. // Node.js 0.10 has enumerable non-index properties on buffers.
  3371. (isBuff && (key == 'offset' || key == 'parent')) ||
  3372. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3373. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3374. // Skip index properties.
  3375. isIndex(key, length)
  3376. ))) {
  3377. result.push(key);
  3378. }
  3379. }
  3380. return result;
  3381. }
  3382. /**
  3383. * A specialized version of `_.sample` for arrays.
  3384. *
  3385. * @private
  3386. * @param {Array} array The array to sample.
  3387. * @returns {*} Returns the random element.
  3388. */
  3389. function arraySample(array) {
  3390. var length = array.length;
  3391. return length ? array[baseRandom(0, length - 1)] : undefined;
  3392. }
  3393. /**
  3394. * A specialized version of `_.sampleSize` for arrays.
  3395. *
  3396. * @private
  3397. * @param {Array} array The array to sample.
  3398. * @param {number} n The number of elements to sample.
  3399. * @returns {Array} Returns the random elements.
  3400. */
  3401. function arraySampleSize(array, n) {
  3402. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3403. }
  3404. /**
  3405. * A specialized version of `_.shuffle` for arrays.
  3406. *
  3407. * @private
  3408. * @param {Array} array The array to shuffle.
  3409. * @returns {Array} Returns the new shuffled array.
  3410. */
  3411. function arrayShuffle(array) {
  3412. return shuffleSelf(copyArray(array));
  3413. }
  3414. /**
  3415. * This function is like `assignValue` except that it doesn't assign
  3416. * `undefined` values.
  3417. *
  3418. * @private
  3419. * @param {Object} object The object to modify.
  3420. * @param {string} key The key of the property to assign.
  3421. * @param {*} value The value to assign.
  3422. */
  3423. function assignMergeValue(object, key, value) {
  3424. if ((value !== undefined && !eq(object[key], value)) ||
  3425. (value === undefined && !(key in object))) {
  3426. baseAssignValue(object, key, value);
  3427. }
  3428. }
  3429. /**
  3430. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3431. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3432. * for equality comparisons.
  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 assignValue(object, key, value) {
  3440. var objValue = object[key];
  3441. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3442. (value === undefined && !(key in object))) {
  3443. baseAssignValue(object, key, value);
  3444. }
  3445. }
  3446. /**
  3447. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3448. *
  3449. * @private
  3450. * @param {Array} array The array to inspect.
  3451. * @param {*} key The key to search for.
  3452. * @returns {number} Returns the index of the matched value, else `-1`.
  3453. */
  3454. function assocIndexOf(array, key) {
  3455. var length = array.length;
  3456. while (length--) {
  3457. if (eq(array[length][0], key)) {
  3458. return length;
  3459. }
  3460. }
  3461. return -1;
  3462. }
  3463. /**
  3464. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3465. * by `iteratee` and values set by `setter`.
  3466. *
  3467. * @private
  3468. * @param {Array|Object} collection The collection to iterate over.
  3469. * @param {Function} setter The function to set `accumulator` values.
  3470. * @param {Function} iteratee The iteratee to transform keys.
  3471. * @param {Object} accumulator The initial aggregated object.
  3472. * @returns {Function} Returns `accumulator`.
  3473. */
  3474. function baseAggregator(collection, setter, iteratee, accumulator) {
  3475. baseEach(collection, function(value, key, collection) {
  3476. setter(accumulator, value, iteratee(value), collection);
  3477. });
  3478. return accumulator;
  3479. }
  3480. /**
  3481. * The base implementation of `_.assign` without support for multiple sources
  3482. * or `customizer` functions.
  3483. *
  3484. * @private
  3485. * @param {Object} object The destination object.
  3486. * @param {Object} source The source object.
  3487. * @returns {Object} Returns `object`.
  3488. */
  3489. function baseAssign(object, source) {
  3490. return object && copyObject(source, keys(source), object);
  3491. }
  3492. /**
  3493. * The base implementation of `_.assignIn` without support for multiple sources
  3494. * or `customizer` functions.
  3495. *
  3496. * @private
  3497. * @param {Object} object The destination object.
  3498. * @param {Object} source The source object.
  3499. * @returns {Object} Returns `object`.
  3500. */
  3501. function baseAssignIn(object, source) {
  3502. return object && copyObject(source, keysIn(source), object);
  3503. }
  3504. /**
  3505. * The base implementation of `assignValue` and `assignMergeValue` without
  3506. * value checks.
  3507. *
  3508. * @private
  3509. * @param {Object} object The object to modify.
  3510. * @param {string} key The key of the property to assign.
  3511. * @param {*} value The value to assign.
  3512. */
  3513. function baseAssignValue(object, key, value) {
  3514. if (key == '__proto__' && defineProperty) {
  3515. defineProperty(object, key, {
  3516. 'configurable': true,
  3517. 'enumerable': true,
  3518. 'value': value,
  3519. 'writable': true
  3520. });
  3521. } else {
  3522. object[key] = value;
  3523. }
  3524. }
  3525. /**
  3526. * The base implementation of `_.at` without support for individual paths.
  3527. *
  3528. * @private
  3529. * @param {Object} object The object to iterate over.
  3530. * @param {string[]} paths The property paths to pick.
  3531. * @returns {Array} Returns the picked elements.
  3532. */
  3533. function baseAt(object, paths) {
  3534. var index = -1,
  3535. length = paths.length,
  3536. result = Array(length),
  3537. skip = object == null;
  3538. while (++index < length) {
  3539. result[index] = skip ? undefined : get(object, paths[index]);
  3540. }
  3541. return result;
  3542. }
  3543. /**
  3544. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3545. *
  3546. * @private
  3547. * @param {number} number The number to clamp.
  3548. * @param {number} [lower] The lower bound.
  3549. * @param {number} upper The upper bound.
  3550. * @returns {number} Returns the clamped number.
  3551. */
  3552. function baseClamp(number, lower, upper) {
  3553. if (number === number) {
  3554. if (upper !== undefined) {
  3555. number = number <= upper ? number : upper;
  3556. }
  3557. if (lower !== undefined) {
  3558. number = number >= lower ? number : lower;
  3559. }
  3560. }
  3561. return number;
  3562. }
  3563. /**
  3564. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3565. * traversed objects.
  3566. *
  3567. * @private
  3568. * @param {*} value The value to clone.
  3569. * @param {boolean} bitmask The bitmask flags.
  3570. * 1 - Deep clone
  3571. * 2 - Flatten inherited properties
  3572. * 4 - Clone symbols
  3573. * @param {Function} [customizer] The function to customize cloning.
  3574. * @param {string} [key] The key of `value`.
  3575. * @param {Object} [object] The parent object of `value`.
  3576. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3577. * @returns {*} Returns the cloned value.
  3578. */
  3579. function baseClone(value, bitmask, customizer, key, object, stack) {
  3580. var result,
  3581. isDeep = bitmask & CLONE_DEEP_FLAG,
  3582. isFlat = bitmask & CLONE_FLAT_FLAG,
  3583. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3584. if (customizer) {
  3585. result = object ? customizer(value, key, object, stack) : customizer(value);
  3586. }
  3587. if (result !== undefined) {
  3588. return result;
  3589. }
  3590. if (!isObject(value)) {
  3591. return value;
  3592. }
  3593. var isArr = isArray(value);
  3594. if (isArr) {
  3595. result = initCloneArray(value);
  3596. if (!isDeep) {
  3597. return copyArray(value, result);
  3598. }
  3599. } else {
  3600. var tag = getTag(value),
  3601. isFunc = tag == funcTag || tag == genTag;
  3602. if (isBuffer(value)) {
  3603. return cloneBuffer(value, isDeep);
  3604. }
  3605. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3606. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3607. if (!isDeep) {
  3608. return isFlat
  3609. ? copySymbolsIn(value, baseAssignIn(result, value))
  3610. : copySymbols(value, baseAssign(result, value));
  3611. }
  3612. } else {
  3613. if (!cloneableTags[tag]) {
  3614. return object ? value : {};
  3615. }
  3616. result = initCloneByTag(value, tag, isDeep);
  3617. }
  3618. }
  3619. // Check for circular references and return its corresponding clone.
  3620. stack || (stack = new Stack);
  3621. var stacked = stack.get(value);
  3622. if (stacked) {
  3623. return stacked;
  3624. }
  3625. stack.set(value, result);
  3626. if (isSet(value)) {
  3627. value.forEach(function(subValue) {
  3628. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3629. });
  3630. } else if (isMap(value)) {
  3631. value.forEach(function(subValue, key) {
  3632. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3633. });
  3634. }
  3635. var keysFunc = isFull
  3636. ? (isFlat ? getAllKeysIn : getAllKeys)
  3637. : (isFlat ? keysIn : keys);
  3638. var props = isArr ? undefined : keysFunc(value);
  3639. arrayEach(props || value, function(subValue, key) {
  3640. if (props) {
  3641. key = subValue;
  3642. subValue = value[key];
  3643. }
  3644. // Recursively populate clone (susceptible to call stack limits).
  3645. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3646. });
  3647. return result;
  3648. }
  3649. /**
  3650. * The base implementation of `_.conforms` which doesn't clone `source`.
  3651. *
  3652. * @private
  3653. * @param {Object} source The object of property predicates to conform to.
  3654. * @returns {Function} Returns the new spec function.
  3655. */
  3656. function baseConforms(source) {
  3657. var props = keys(source);
  3658. return function(object) {
  3659. return baseConformsTo(object, source, props);
  3660. };
  3661. }
  3662. /**
  3663. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3664. *
  3665. * @private
  3666. * @param {Object} object The object to inspect.
  3667. * @param {Object} source The object of property predicates to conform to.
  3668. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3669. */
  3670. function baseConformsTo(object, source, props) {
  3671. var length = props.length;
  3672. if (object == null) {
  3673. return !length;
  3674. }
  3675. object = Object(object);
  3676. while (length--) {
  3677. var key = props[length],
  3678. predicate = source[key],
  3679. value = object[key];
  3680. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3681. return false;
  3682. }
  3683. }
  3684. return true;
  3685. }
  3686. /**
  3687. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3688. * to provide to `func`.
  3689. *
  3690. * @private
  3691. * @param {Function} func The function to delay.
  3692. * @param {number} wait The number of milliseconds to delay invocation.
  3693. * @param {Array} args The arguments to provide to `func`.
  3694. * @returns {number|Object} Returns the timer id or timeout object.
  3695. */
  3696. function baseDelay(func, wait, args) {
  3697. if (typeof func != 'function') {
  3698. throw new TypeError(FUNC_ERROR_TEXT);
  3699. }
  3700. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3701. }
  3702. /**
  3703. * The base implementation of methods like `_.difference` without support
  3704. * for excluding multiple arrays or iteratee shorthands.
  3705. *
  3706. * @private
  3707. * @param {Array} array The array to inspect.
  3708. * @param {Array} values The values to exclude.
  3709. * @param {Function} [iteratee] The iteratee invoked per element.
  3710. * @param {Function} [comparator] The comparator invoked per element.
  3711. * @returns {Array} Returns the new array of filtered values.
  3712. */
  3713. function baseDifference(array, values, iteratee, comparator) {
  3714. var index = -1,
  3715. includes = arrayIncludes,
  3716. isCommon = true,
  3717. length = array.length,
  3718. result = [],
  3719. valuesLength = values.length;
  3720. if (!length) {
  3721. return result;
  3722. }
  3723. if (iteratee) {
  3724. values = arrayMap(values, baseUnary(iteratee));
  3725. }
  3726. if (comparator) {
  3727. includes = arrayIncludesWith;
  3728. isCommon = false;
  3729. }
  3730. else if (values.length >= LARGE_ARRAY_SIZE) {
  3731. includes = cacheHas;
  3732. isCommon = false;
  3733. values = new SetCache(values);
  3734. }
  3735. outer:
  3736. while (++index < length) {
  3737. var value = array[index],
  3738. computed = iteratee == null ? value : iteratee(value);
  3739. value = (comparator || value !== 0) ? value : 0;
  3740. if (isCommon && computed === computed) {
  3741. var valuesIndex = valuesLength;
  3742. while (valuesIndex--) {
  3743. if (values[valuesIndex] === computed) {
  3744. continue outer;
  3745. }
  3746. }
  3747. result.push(value);
  3748. }
  3749. else if (!includes(values, computed, comparator)) {
  3750. result.push(value);
  3751. }
  3752. }
  3753. return result;
  3754. }
  3755. /**
  3756. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3757. *
  3758. * @private
  3759. * @param {Array|Object} collection The collection to iterate over.
  3760. * @param {Function} iteratee The function invoked per iteration.
  3761. * @returns {Array|Object} Returns `collection`.
  3762. */
  3763. var baseEach = createBaseEach(baseForOwn);
  3764. /**
  3765. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3766. *
  3767. * @private
  3768. * @param {Array|Object} collection The collection to iterate over.
  3769. * @param {Function} iteratee The function invoked per iteration.
  3770. * @returns {Array|Object} Returns `collection`.
  3771. */
  3772. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3773. /**
  3774. * The base implementation of `_.every` without support for iteratee shorthands.
  3775. *
  3776. * @private
  3777. * @param {Array|Object} collection The collection to iterate over.
  3778. * @param {Function} predicate The function invoked per iteration.
  3779. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3780. * else `false`
  3781. */
  3782. function baseEvery(collection, predicate) {
  3783. var result = true;
  3784. baseEach(collection, function(value, index, collection) {
  3785. result = !!predicate(value, index, collection);
  3786. return result;
  3787. });
  3788. return result;
  3789. }
  3790. /**
  3791. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3792. * `comparator` to determine the extremum value.
  3793. *
  3794. * @private
  3795. * @param {Array} array The array to iterate over.
  3796. * @param {Function} iteratee The iteratee invoked per iteration.
  3797. * @param {Function} comparator The comparator used to compare values.
  3798. * @returns {*} Returns the extremum value.
  3799. */
  3800. function baseExtremum(array, iteratee, comparator) {
  3801. var index = -1,
  3802. length = array.length;
  3803. while (++index < length) {
  3804. var value = array[index],
  3805. current = iteratee(value);
  3806. if (current != null && (computed === undefined
  3807. ? (current === current && !isSymbol(current))
  3808. : comparator(current, computed)
  3809. )) {
  3810. var computed = current,
  3811. result = value;
  3812. }
  3813. }
  3814. return result;
  3815. }
  3816. /**
  3817. * The base implementation of `_.fill` without an iteratee call guard.
  3818. *
  3819. * @private
  3820. * @param {Array} array The array to fill.
  3821. * @param {*} value The value to fill `array` with.
  3822. * @param {number} [start=0] The start position.
  3823. * @param {number} [end=array.length] The end position.
  3824. * @returns {Array} Returns `array`.
  3825. */
  3826. function baseFill(array, value, start, end) {
  3827. var length = array.length;
  3828. start = toInteger(start);
  3829. if (start < 0) {
  3830. start = -start > length ? 0 : (length + start);
  3831. }
  3832. end = (end === undefined || end > length) ? length : toInteger(end);
  3833. if (end < 0) {
  3834. end += length;
  3835. }
  3836. end = start > end ? 0 : toLength(end);
  3837. while (start < end) {
  3838. array[start++] = value;
  3839. }
  3840. return array;
  3841. }
  3842. /**
  3843. * The base implementation of `_.filter` without support for iteratee shorthands.
  3844. *
  3845. * @private
  3846. * @param {Array|Object} collection The collection to iterate over.
  3847. * @param {Function} predicate The function invoked per iteration.
  3848. * @returns {Array} Returns the new filtered array.
  3849. */
  3850. function baseFilter(collection, predicate) {
  3851. var result = [];
  3852. baseEach(collection, function(value, index, collection) {
  3853. if (predicate(value, index, collection)) {
  3854. result.push(value);
  3855. }
  3856. });
  3857. return result;
  3858. }
  3859. /**
  3860. * The base implementation of `_.flatten` with support for restricting flattening.
  3861. *
  3862. * @private
  3863. * @param {Array} array The array to flatten.
  3864. * @param {number} depth The maximum recursion depth.
  3865. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3866. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3867. * @param {Array} [result=[]] The initial result value.
  3868. * @returns {Array} Returns the new flattened array.
  3869. */
  3870. function baseFlatten(array, depth, predicate, isStrict, result) {
  3871. var index = -1,
  3872. length = array.length;
  3873. predicate || (predicate = isFlattenable);
  3874. result || (result = []);
  3875. while (++index < length) {
  3876. var value = array[index];
  3877. if (depth > 0 && predicate(value)) {
  3878. if (depth > 1) {
  3879. // Recursively flatten arrays (susceptible to call stack limits).
  3880. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3881. } else {
  3882. arrayPush(result, value);
  3883. }
  3884. } else if (!isStrict) {
  3885. result[result.length] = value;
  3886. }
  3887. }
  3888. return result;
  3889. }
  3890. /**
  3891. * The base implementation of `baseForOwn` which iterates over `object`
  3892. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3893. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3894. *
  3895. * @private
  3896. * @param {Object} object The object to iterate over.
  3897. * @param {Function} iteratee The function invoked per iteration.
  3898. * @param {Function} keysFunc The function to get the keys of `object`.
  3899. * @returns {Object} Returns `object`.
  3900. */
  3901. var baseFor = createBaseFor();
  3902. /**
  3903. * This function is like `baseFor` except that it iterates over properties
  3904. * in the opposite order.
  3905. *
  3906. * @private
  3907. * @param {Object} object The object to iterate over.
  3908. * @param {Function} iteratee The function invoked per iteration.
  3909. * @param {Function} keysFunc The function to get the keys of `object`.
  3910. * @returns {Object} Returns `object`.
  3911. */
  3912. var baseForRight = createBaseFor(true);
  3913. /**
  3914. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3915. *
  3916. * @private
  3917. * @param {Object} object The object to iterate over.
  3918. * @param {Function} iteratee The function invoked per iteration.
  3919. * @returns {Object} Returns `object`.
  3920. */
  3921. function baseForOwn(object, iteratee) {
  3922. return object && baseFor(object, iteratee, keys);
  3923. }
  3924. /**
  3925. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3926. *
  3927. * @private
  3928. * @param {Object} object The object to iterate over.
  3929. * @param {Function} iteratee The function invoked per iteration.
  3930. * @returns {Object} Returns `object`.
  3931. */
  3932. function baseForOwnRight(object, iteratee) {
  3933. return object && baseForRight(object, iteratee, keys);
  3934. }
  3935. /**
  3936. * The base implementation of `_.functions` which creates an array of
  3937. * `object` function property names filtered from `props`.
  3938. *
  3939. * @private
  3940. * @param {Object} object The object to inspect.
  3941. * @param {Array} props The property names to filter.
  3942. * @returns {Array} Returns the function names.
  3943. */
  3944. function baseFunctions(object, props) {
  3945. return arrayFilter(props, function(key) {
  3946. return isFunction(object[key]);
  3947. });
  3948. }
  3949. /**
  3950. * The base implementation of `_.get` without support for default values.
  3951. *
  3952. * @private
  3953. * @param {Object} object The object to query.
  3954. * @param {Array|string} path The path of the property to get.
  3955. * @returns {*} Returns the resolved value.
  3956. */
  3957. function baseGet(object, path) {
  3958. path = castPath(path, object);
  3959. var index = 0,
  3960. length = path.length;
  3961. while (object != null && index < length) {
  3962. object = object[toKey(path[index++])];
  3963. }
  3964. return (index && index == length) ? object : undefined;
  3965. }
  3966. /**
  3967. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3968. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3969. * symbols of `object`.
  3970. *
  3971. * @private
  3972. * @param {Object} object The object to query.
  3973. * @param {Function} keysFunc The function to get the keys of `object`.
  3974. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3975. * @returns {Array} Returns the array of property names and symbols.
  3976. */
  3977. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3978. var result = keysFunc(object);
  3979. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3980. }
  3981. /**
  3982. * The base implementation of `getTag` without fallbacks for buggy environments.
  3983. *
  3984. * @private
  3985. * @param {*} value The value to query.
  3986. * @returns {string} Returns the `toStringTag`.
  3987. */
  3988. function baseGetTag(value) {
  3989. if (value == null) {
  3990. return value === undefined ? undefinedTag : nullTag;
  3991. }
  3992. return (symToStringTag && symToStringTag in Object(value))
  3993. ? getRawTag(value)
  3994. : objectToString(value);
  3995. }
  3996. /**
  3997. * The base implementation of `_.gt` which doesn't coerce arguments.
  3998. *
  3999. * @private
  4000. * @param {*} value The value to compare.
  4001. * @param {*} other The other value to compare.
  4002. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4003. * else `false`.
  4004. */
  4005. function baseGt(value, other) {
  4006. return value > other;
  4007. }
  4008. /**
  4009. * The base implementation of `_.has` without support for deep paths.
  4010. *
  4011. * @private
  4012. * @param {Object} [object] The object to query.
  4013. * @param {Array|string} key The key to check.
  4014. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4015. */
  4016. function baseHas(object, key) {
  4017. return object != null && hasOwnProperty.call(object, key);
  4018. }
  4019. /**
  4020. * The base implementation of `_.hasIn` without support for deep paths.
  4021. *
  4022. * @private
  4023. * @param {Object} [object] The object to query.
  4024. * @param {Array|string} key The key to check.
  4025. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4026. */
  4027. function baseHasIn(object, key) {
  4028. return object != null && key in Object(object);
  4029. }
  4030. /**
  4031. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4032. *
  4033. * @private
  4034. * @param {number} number The number to check.
  4035. * @param {number} start The start of the range.
  4036. * @param {number} end The end of the range.
  4037. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4038. */
  4039. function baseInRange(number, start, end) {
  4040. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4041. }
  4042. /**
  4043. * The base implementation of methods like `_.intersection`, without support
  4044. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4045. *
  4046. * @private
  4047. * @param {Array} arrays The arrays to inspect.
  4048. * @param {Function} [iteratee] The iteratee invoked per element.
  4049. * @param {Function} [comparator] The comparator invoked per element.
  4050. * @returns {Array} Returns the new array of shared values.
  4051. */
  4052. function baseIntersection(arrays, iteratee, comparator) {
  4053. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4054. length = arrays[0].length,
  4055. othLength = arrays.length,
  4056. othIndex = othLength,
  4057. caches = Array(othLength),
  4058. maxLength = Infinity,
  4059. result = [];
  4060. while (othIndex--) {
  4061. var array = arrays[othIndex];
  4062. if (othIndex && iteratee) {
  4063. array = arrayMap(array, baseUnary(iteratee));
  4064. }
  4065. maxLength = nativeMin(array.length, maxLength);
  4066. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4067. ? new SetCache(othIndex && array)
  4068. : undefined;
  4069. }
  4070. array = arrays[0];
  4071. var index = -1,
  4072. seen = caches[0];
  4073. outer:
  4074. while (++index < length && result.length < maxLength) {
  4075. var value = array[index],
  4076. computed = iteratee ? iteratee(value) : value;
  4077. value = (comparator || value !== 0) ? value : 0;
  4078. if (!(seen
  4079. ? cacheHas(seen, computed)
  4080. : includes(result, computed, comparator)
  4081. )) {
  4082. othIndex = othLength;
  4083. while (--othIndex) {
  4084. var cache = caches[othIndex];
  4085. if (!(cache
  4086. ? cacheHas(cache, computed)
  4087. : includes(arrays[othIndex], computed, comparator))
  4088. ) {
  4089. continue outer;
  4090. }
  4091. }
  4092. if (seen) {
  4093. seen.push(computed);
  4094. }
  4095. result.push(value);
  4096. }
  4097. }
  4098. return result;
  4099. }
  4100. /**
  4101. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4102. * `object` with values transformed by `iteratee` and set by `setter`.
  4103. *
  4104. * @private
  4105. * @param {Object} object The object to iterate over.
  4106. * @param {Function} setter The function to set `accumulator` values.
  4107. * @param {Function} iteratee The iteratee to transform values.
  4108. * @param {Object} accumulator The initial inverted object.
  4109. * @returns {Function} Returns `accumulator`.
  4110. */
  4111. function baseInverter(object, setter, iteratee, accumulator) {
  4112. baseForOwn(object, function(value, key, object) {
  4113. setter(accumulator, iteratee(value), key, object);
  4114. });
  4115. return accumulator;
  4116. }
  4117. /**
  4118. * The base implementation of `_.invoke` without support for individual
  4119. * method arguments.
  4120. *
  4121. * @private
  4122. * @param {Object} object The object to query.
  4123. * @param {Array|string} path The path of the method to invoke.
  4124. * @param {Array} args The arguments to invoke the method with.
  4125. * @returns {*} Returns the result of the invoked method.
  4126. */
  4127. function baseInvoke(object, path, args) {
  4128. path = castPath(path, object);
  4129. object = parent(object, path);
  4130. var func = object == null ? object : object[toKey(last(path))];
  4131. return func == null ? undefined : apply(func, object, args);
  4132. }
  4133. /**
  4134. * The base implementation of `_.isArguments`.
  4135. *
  4136. * @private
  4137. * @param {*} value The value to check.
  4138. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4139. */
  4140. function baseIsArguments(value) {
  4141. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4142. }
  4143. /**
  4144. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4145. *
  4146. * @private
  4147. * @param {*} value The value to check.
  4148. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4149. */
  4150. function baseIsArrayBuffer(value) {
  4151. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4152. }
  4153. /**
  4154. * The base implementation of `_.isDate` without Node.js optimizations.
  4155. *
  4156. * @private
  4157. * @param {*} value The value to check.
  4158. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4159. */
  4160. function baseIsDate(value) {
  4161. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4162. }
  4163. /**
  4164. * The base implementation of `_.isEqual` which supports partial comparisons
  4165. * and tracks traversed objects.
  4166. *
  4167. * @private
  4168. * @param {*} value The value to compare.
  4169. * @param {*} other The other value to compare.
  4170. * @param {boolean} bitmask The bitmask flags.
  4171. * 1 - Unordered comparison
  4172. * 2 - Partial comparison
  4173. * @param {Function} [customizer] The function to customize comparisons.
  4174. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4175. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4176. */
  4177. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4178. if (value === other) {
  4179. return true;
  4180. }
  4181. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4182. return value !== value && other !== other;
  4183. }
  4184. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4185. }
  4186. /**
  4187. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4188. * deep comparisons and tracks traversed objects enabling objects with circular
  4189. * references to be compared.
  4190. *
  4191. * @private
  4192. * @param {Object} object The object to compare.
  4193. * @param {Object} other The other object to compare.
  4194. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4195. * @param {Function} customizer The function to customize comparisons.
  4196. * @param {Function} equalFunc The function to determine equivalents of values.
  4197. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4198. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4199. */
  4200. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4201. var objIsArr = isArray(object),
  4202. othIsArr = isArray(other),
  4203. objTag = objIsArr ? arrayTag : getTag(object),
  4204. othTag = othIsArr ? arrayTag : getTag(other);
  4205. objTag = objTag == argsTag ? objectTag : objTag;
  4206. othTag = othTag == argsTag ? objectTag : othTag;
  4207. var objIsObj = objTag == objectTag,
  4208. othIsObj = othTag == objectTag,
  4209. isSameTag = objTag == othTag;
  4210. if (isSameTag && isBuffer(object)) {
  4211. if (!isBuffer(other)) {
  4212. return false;
  4213. }
  4214. objIsArr = true;
  4215. objIsObj = false;
  4216. }
  4217. if (isSameTag && !objIsObj) {
  4218. stack || (stack = new Stack);
  4219. return (objIsArr || isTypedArray(object))
  4220. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4221. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4222. }
  4223. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4224. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4225. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4226. if (objIsWrapped || othIsWrapped) {
  4227. var objUnwrapped = objIsWrapped ? object.value() : object,
  4228. othUnwrapped = othIsWrapped ? other.value() : other;
  4229. stack || (stack = new Stack);
  4230. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4231. }
  4232. }
  4233. if (!isSameTag) {
  4234. return false;
  4235. }
  4236. stack || (stack = new Stack);
  4237. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4238. }
  4239. /**
  4240. * The base implementation of `_.isMap` without Node.js optimizations.
  4241. *
  4242. * @private
  4243. * @param {*} value The value to check.
  4244. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4245. */
  4246. function baseIsMap(value) {
  4247. return isObjectLike(value) && getTag(value) == mapTag;
  4248. }
  4249. /**
  4250. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4251. *
  4252. * @private
  4253. * @param {Object} object The object to inspect.
  4254. * @param {Object} source The object of property values to match.
  4255. * @param {Array} matchData The property names, values, and compare flags to match.
  4256. * @param {Function} [customizer] The function to customize comparisons.
  4257. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4258. */
  4259. function baseIsMatch(object, source, matchData, customizer) {
  4260. var index = matchData.length,
  4261. length = index,
  4262. noCustomizer = !customizer;
  4263. if (object == null) {
  4264. return !length;
  4265. }
  4266. object = Object(object);
  4267. while (index--) {
  4268. var data = matchData[index];
  4269. if ((noCustomizer && data[2])
  4270. ? data[1] !== object[data[0]]
  4271. : !(data[0] in object)
  4272. ) {
  4273. return false;
  4274. }
  4275. }
  4276. while (++index < length) {
  4277. data = matchData[index];
  4278. var key = data[0],
  4279. objValue = object[key],
  4280. srcValue = data[1];
  4281. if (noCustomizer && data[2]) {
  4282. if (objValue === undefined && !(key in object)) {
  4283. return false;
  4284. }
  4285. } else {
  4286. var stack = new Stack;
  4287. if (customizer) {
  4288. var result = customizer(objValue, srcValue, key, object, source, stack);
  4289. }
  4290. if (!(result === undefined
  4291. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4292. : result
  4293. )) {
  4294. return false;
  4295. }
  4296. }
  4297. }
  4298. return true;
  4299. }
  4300. /**
  4301. * The base implementation of `_.isNative` without bad shim checks.
  4302. *
  4303. * @private
  4304. * @param {*} value The value to check.
  4305. * @returns {boolean} Returns `true` if `value` is a native function,
  4306. * else `false`.
  4307. */
  4308. function baseIsNative(value) {
  4309. if (!isObject(value) || isMasked(value)) {
  4310. return false;
  4311. }
  4312. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4313. return pattern.test(toSource(value));
  4314. }
  4315. /**
  4316. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4317. *
  4318. * @private
  4319. * @param {*} value The value to check.
  4320. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4321. */
  4322. function baseIsRegExp(value) {
  4323. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4324. }
  4325. /**
  4326. * The base implementation of `_.isSet` without Node.js optimizations.
  4327. *
  4328. * @private
  4329. * @param {*} value The value to check.
  4330. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4331. */
  4332. function baseIsSet(value) {
  4333. return isObjectLike(value) && getTag(value) == setTag;
  4334. }
  4335. /**
  4336. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4337. *
  4338. * @private
  4339. * @param {*} value The value to check.
  4340. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4341. */
  4342. function baseIsTypedArray(value) {
  4343. return isObjectLike(value) &&
  4344. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4345. }
  4346. /**
  4347. * The base implementation of `_.iteratee`.
  4348. *
  4349. * @private
  4350. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4351. * @returns {Function} Returns the iteratee.
  4352. */
  4353. function baseIteratee(value) {
  4354. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4355. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4356. if (typeof value == 'function') {
  4357. return value;
  4358. }
  4359. if (value == null) {
  4360. return identity;
  4361. }
  4362. if (typeof value == 'object') {
  4363. return isArray(value)
  4364. ? baseMatchesProperty(value[0], value[1])
  4365. : baseMatches(value);
  4366. }
  4367. return property(value);
  4368. }
  4369. /**
  4370. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4371. *
  4372. * @private
  4373. * @param {Object} object The object to query.
  4374. * @returns {Array} Returns the array of property names.
  4375. */
  4376. function baseKeys(object) {
  4377. if (!isPrototype(object)) {
  4378. return nativeKeys(object);
  4379. }
  4380. var result = [];
  4381. for (var key in Object(object)) {
  4382. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4383. result.push(key);
  4384. }
  4385. }
  4386. return result;
  4387. }
  4388. /**
  4389. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4390. *
  4391. * @private
  4392. * @param {Object} object The object to query.
  4393. * @returns {Array} Returns the array of property names.
  4394. */
  4395. function baseKeysIn(object) {
  4396. if (!isObject(object)) {
  4397. return nativeKeysIn(object);
  4398. }
  4399. var isProto = isPrototype(object),
  4400. result = [];
  4401. for (var key in object) {
  4402. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4403. result.push(key);
  4404. }
  4405. }
  4406. return result;
  4407. }
  4408. /**
  4409. * The base implementation of `_.lt` which doesn't coerce arguments.
  4410. *
  4411. * @private
  4412. * @param {*} value The value to compare.
  4413. * @param {*} other The other value to compare.
  4414. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4415. * else `false`.
  4416. */
  4417. function baseLt(value, other) {
  4418. return value < other;
  4419. }
  4420. /**
  4421. * The base implementation of `_.map` without support for iteratee shorthands.
  4422. *
  4423. * @private
  4424. * @param {Array|Object} collection The collection to iterate over.
  4425. * @param {Function} iteratee The function invoked per iteration.
  4426. * @returns {Array} Returns the new mapped array.
  4427. */
  4428. function baseMap(collection, iteratee) {
  4429. var index = -1,
  4430. result = isArrayLike(collection) ? Array(collection.length) : [];
  4431. baseEach(collection, function(value, key, collection) {
  4432. result[++index] = iteratee(value, key, collection);
  4433. });
  4434. return result;
  4435. }
  4436. /**
  4437. * The base implementation of `_.matches` which doesn't clone `source`.
  4438. *
  4439. * @private
  4440. * @param {Object} source The object of property values to match.
  4441. * @returns {Function} Returns the new spec function.
  4442. */
  4443. function baseMatches(source) {
  4444. var matchData = getMatchData(source);
  4445. if (matchData.length == 1 && matchData[0][2]) {
  4446. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4447. }
  4448. return function(object) {
  4449. return object === source || baseIsMatch(object, source, matchData);
  4450. };
  4451. }
  4452. /**
  4453. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4454. *
  4455. * @private
  4456. * @param {string} path The path of the property to get.
  4457. * @param {*} srcValue The value to match.
  4458. * @returns {Function} Returns the new spec function.
  4459. */
  4460. function baseMatchesProperty(path, srcValue) {
  4461. if (isKey(path) && isStrictComparable(srcValue)) {
  4462. return matchesStrictComparable(toKey(path), srcValue);
  4463. }
  4464. return function(object) {
  4465. var objValue = get(object, path);
  4466. return (objValue === undefined && objValue === srcValue)
  4467. ? hasIn(object, path)
  4468. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4469. };
  4470. }
  4471. /**
  4472. * The base implementation of `_.merge` without support for multiple sources.
  4473. *
  4474. * @private
  4475. * @param {Object} object The destination object.
  4476. * @param {Object} source The source object.
  4477. * @param {number} srcIndex The index of `source`.
  4478. * @param {Function} [customizer] The function to customize merged values.
  4479. * @param {Object} [stack] Tracks traversed source values and their merged
  4480. * counterparts.
  4481. */
  4482. function baseMerge(object, source, srcIndex, customizer, stack) {
  4483. if (object === source) {
  4484. return;
  4485. }
  4486. baseFor(source, function(srcValue, key) {
  4487. stack || (stack = new Stack);
  4488. if (isObject(srcValue)) {
  4489. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4490. }
  4491. else {
  4492. var newValue = customizer
  4493. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4494. : undefined;
  4495. if (newValue === undefined) {
  4496. newValue = srcValue;
  4497. }
  4498. assignMergeValue(object, key, newValue);
  4499. }
  4500. }, keysIn);
  4501. }
  4502. /**
  4503. * A specialized version of `baseMerge` for arrays and objects which performs
  4504. * deep merges and tracks traversed objects enabling objects with circular
  4505. * references to be merged.
  4506. *
  4507. * @private
  4508. * @param {Object} object The destination object.
  4509. * @param {Object} source The source object.
  4510. * @param {string} key The key of the value to merge.
  4511. * @param {number} srcIndex The index of `source`.
  4512. * @param {Function} mergeFunc The function to merge values.
  4513. * @param {Function} [customizer] The function to customize assigned values.
  4514. * @param {Object} [stack] Tracks traversed source values and their merged
  4515. * counterparts.
  4516. */
  4517. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4518. var objValue = safeGet(object, key),
  4519. srcValue = safeGet(source, key),
  4520. stacked = stack.get(srcValue);
  4521. if (stacked) {
  4522. assignMergeValue(object, key, stacked);
  4523. return;
  4524. }
  4525. var newValue = customizer
  4526. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4527. : undefined;
  4528. var isCommon = newValue === undefined;
  4529. if (isCommon) {
  4530. var isArr = isArray(srcValue),
  4531. isBuff = !isArr && isBuffer(srcValue),
  4532. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4533. newValue = srcValue;
  4534. if (isArr || isBuff || isTyped) {
  4535. if (isArray(objValue)) {
  4536. newValue = objValue;
  4537. }
  4538. else if (isArrayLikeObject(objValue)) {
  4539. newValue = copyArray(objValue);
  4540. }
  4541. else if (isBuff) {
  4542. isCommon = false;
  4543. newValue = cloneBuffer(srcValue, true);
  4544. }
  4545. else if (isTyped) {
  4546. isCommon = false;
  4547. newValue = cloneTypedArray(srcValue, true);
  4548. }
  4549. else {
  4550. newValue = [];
  4551. }
  4552. }
  4553. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4554. newValue = objValue;
  4555. if (isArguments(objValue)) {
  4556. newValue = toPlainObject(objValue);
  4557. }
  4558. else if (!isObject(objValue) || isFunction(objValue)) {
  4559. newValue = initCloneObject(srcValue);
  4560. }
  4561. }
  4562. else {
  4563. isCommon = false;
  4564. }
  4565. }
  4566. if (isCommon) {
  4567. // Recursively merge objects and arrays (susceptible to call stack limits).
  4568. stack.set(srcValue, newValue);
  4569. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4570. stack['delete'](srcValue);
  4571. }
  4572. assignMergeValue(object, key, newValue);
  4573. }
  4574. /**
  4575. * The base implementation of `_.nth` which doesn't coerce arguments.
  4576. *
  4577. * @private
  4578. * @param {Array} array The array to query.
  4579. * @param {number} n The index of the element to return.
  4580. * @returns {*} Returns the nth element of `array`.
  4581. */
  4582. function baseNth(array, n) {
  4583. var length = array.length;
  4584. if (!length) {
  4585. return;
  4586. }
  4587. n += n < 0 ? length : 0;
  4588. return isIndex(n, length) ? array[n] : undefined;
  4589. }
  4590. /**
  4591. * The base implementation of `_.orderBy` without param guards.
  4592. *
  4593. * @private
  4594. * @param {Array|Object} collection The collection to iterate over.
  4595. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4596. * @param {string[]} orders The sort orders of `iteratees`.
  4597. * @returns {Array} Returns the new sorted array.
  4598. */
  4599. function baseOrderBy(collection, iteratees, orders) {
  4600. if (iteratees.length) {
  4601. iteratees = arrayMap(iteratees, function(iteratee) {
  4602. if (isArray(iteratee)) {
  4603. return function(value) {
  4604. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4605. }
  4606. }
  4607. return iteratee;
  4608. });
  4609. } else {
  4610. iteratees = [identity];
  4611. }
  4612. var index = -1;
  4613. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4614. var result = baseMap(collection, function(value, key, collection) {
  4615. var criteria = arrayMap(iteratees, function(iteratee) {
  4616. return iteratee(value);
  4617. });
  4618. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4619. });
  4620. return baseSortBy(result, function(object, other) {
  4621. return compareMultiple(object, other, orders);
  4622. });
  4623. }
  4624. /**
  4625. * The base implementation of `_.pick` without support for individual
  4626. * property identifiers.
  4627. *
  4628. * @private
  4629. * @param {Object} object The source object.
  4630. * @param {string[]} paths The property paths to pick.
  4631. * @returns {Object} Returns the new object.
  4632. */
  4633. function basePick(object, paths) {
  4634. return basePickBy(object, paths, function(value, path) {
  4635. return hasIn(object, path);
  4636. });
  4637. }
  4638. /**
  4639. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4640. *
  4641. * @private
  4642. * @param {Object} object The source object.
  4643. * @param {string[]} paths The property paths to pick.
  4644. * @param {Function} predicate The function invoked per property.
  4645. * @returns {Object} Returns the new object.
  4646. */
  4647. function basePickBy(object, paths, predicate) {
  4648. var index = -1,
  4649. length = paths.length,
  4650. result = {};
  4651. while (++index < length) {
  4652. var path = paths[index],
  4653. value = baseGet(object, path);
  4654. if (predicate(value, path)) {
  4655. baseSet(result, castPath(path, object), value);
  4656. }
  4657. }
  4658. return result;
  4659. }
  4660. /**
  4661. * A specialized version of `baseProperty` which supports deep paths.
  4662. *
  4663. * @private
  4664. * @param {Array|string} path The path of the property to get.
  4665. * @returns {Function} Returns the new accessor function.
  4666. */
  4667. function basePropertyDeep(path) {
  4668. return function(object) {
  4669. return baseGet(object, path);
  4670. };
  4671. }
  4672. /**
  4673. * The base implementation of `_.pullAllBy` without support for iteratee
  4674. * shorthands.
  4675. *
  4676. * @private
  4677. * @param {Array} array The array to modify.
  4678. * @param {Array} values The values to remove.
  4679. * @param {Function} [iteratee] The iteratee invoked per element.
  4680. * @param {Function} [comparator] The comparator invoked per element.
  4681. * @returns {Array} Returns `array`.
  4682. */
  4683. function basePullAll(array, values, iteratee, comparator) {
  4684. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4685. index = -1,
  4686. length = values.length,
  4687. seen = array;
  4688. if (array === values) {
  4689. values = copyArray(values);
  4690. }
  4691. if (iteratee) {
  4692. seen = arrayMap(array, baseUnary(iteratee));
  4693. }
  4694. while (++index < length) {
  4695. var fromIndex = 0,
  4696. value = values[index],
  4697. computed = iteratee ? iteratee(value) : value;
  4698. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4699. if (seen !== array) {
  4700. splice.call(seen, fromIndex, 1);
  4701. }
  4702. splice.call(array, fromIndex, 1);
  4703. }
  4704. }
  4705. return array;
  4706. }
  4707. /**
  4708. * The base implementation of `_.pullAt` without support for individual
  4709. * indexes or capturing the removed elements.
  4710. *
  4711. * @private
  4712. * @param {Array} array The array to modify.
  4713. * @param {number[]} indexes The indexes of elements to remove.
  4714. * @returns {Array} Returns `array`.
  4715. */
  4716. function basePullAt(array, indexes) {
  4717. var length = array ? indexes.length : 0,
  4718. lastIndex = length - 1;
  4719. while (length--) {
  4720. var index = indexes[length];
  4721. if (length == lastIndex || index !== previous) {
  4722. var previous = index;
  4723. if (isIndex(index)) {
  4724. splice.call(array, index, 1);
  4725. } else {
  4726. baseUnset(array, index);
  4727. }
  4728. }
  4729. }
  4730. return array;
  4731. }
  4732. /**
  4733. * The base implementation of `_.random` without support for returning
  4734. * floating-point numbers.
  4735. *
  4736. * @private
  4737. * @param {number} lower The lower bound.
  4738. * @param {number} upper The upper bound.
  4739. * @returns {number} Returns the random number.
  4740. */
  4741. function baseRandom(lower, upper) {
  4742. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4743. }
  4744. /**
  4745. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4746. * coerce arguments.
  4747. *
  4748. * @private
  4749. * @param {number} start The start of the range.
  4750. * @param {number} end The end of the range.
  4751. * @param {number} step The value to increment or decrement by.
  4752. * @param {boolean} [fromRight] Specify iterating from right to left.
  4753. * @returns {Array} Returns the range of numbers.
  4754. */
  4755. function baseRange(start, end, step, fromRight) {
  4756. var index = -1,
  4757. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4758. result = Array(length);
  4759. while (length--) {
  4760. result[fromRight ? length : ++index] = start;
  4761. start += step;
  4762. }
  4763. return result;
  4764. }
  4765. /**
  4766. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4767. *
  4768. * @private
  4769. * @param {string} string The string to repeat.
  4770. * @param {number} n The number of times to repeat the string.
  4771. * @returns {string} Returns the repeated string.
  4772. */
  4773. function baseRepeat(string, n) {
  4774. var result = '';
  4775. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4776. return result;
  4777. }
  4778. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4779. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4780. do {
  4781. if (n % 2) {
  4782. result += string;
  4783. }
  4784. n = nativeFloor(n / 2);
  4785. if (n) {
  4786. string += string;
  4787. }
  4788. } while (n);
  4789. return result;
  4790. }
  4791. /**
  4792. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4793. *
  4794. * @private
  4795. * @param {Function} func The function to apply a rest parameter to.
  4796. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4797. * @returns {Function} Returns the new function.
  4798. */
  4799. function baseRest(func, start) {
  4800. return setToString(overRest(func, start, identity), func + '');
  4801. }
  4802. /**
  4803. * The base implementation of `_.sample`.
  4804. *
  4805. * @private
  4806. * @param {Array|Object} collection The collection to sample.
  4807. * @returns {*} Returns the random element.
  4808. */
  4809. function baseSample(collection) {
  4810. return arraySample(values(collection));
  4811. }
  4812. /**
  4813. * The base implementation of `_.sampleSize` without param guards.
  4814. *
  4815. * @private
  4816. * @param {Array|Object} collection The collection to sample.
  4817. * @param {number} n The number of elements to sample.
  4818. * @returns {Array} Returns the random elements.
  4819. */
  4820. function baseSampleSize(collection, n) {
  4821. var array = values(collection);
  4822. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4823. }
  4824. /**
  4825. * The base implementation of `_.set`.
  4826. *
  4827. * @private
  4828. * @param {Object} object The object to modify.
  4829. * @param {Array|string} path The path of the property to set.
  4830. * @param {*} value The value to set.
  4831. * @param {Function} [customizer] The function to customize path creation.
  4832. * @returns {Object} Returns `object`.
  4833. */
  4834. function baseSet(object, path, value, customizer) {
  4835. if (!isObject(object)) {
  4836. return object;
  4837. }
  4838. path = castPath(path, object);
  4839. var index = -1,
  4840. length = path.length,
  4841. lastIndex = length - 1,
  4842. nested = object;
  4843. while (nested != null && ++index < length) {
  4844. var key = toKey(path[index]),
  4845. newValue = value;
  4846. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4847. return object;
  4848. }
  4849. if (index != lastIndex) {
  4850. var objValue = nested[key];
  4851. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4852. if (newValue === undefined) {
  4853. newValue = isObject(objValue)
  4854. ? objValue
  4855. : (isIndex(path[index + 1]) ? [] : {});
  4856. }
  4857. }
  4858. assignValue(nested, key, newValue);
  4859. nested = nested[key];
  4860. }
  4861. return object;
  4862. }
  4863. /**
  4864. * The base implementation of `setData` without support for hot loop shorting.
  4865. *
  4866. * @private
  4867. * @param {Function} func The function to associate metadata with.
  4868. * @param {*} data The metadata.
  4869. * @returns {Function} Returns `func`.
  4870. */
  4871. var baseSetData = !metaMap ? identity : function(func, data) {
  4872. metaMap.set(func, data);
  4873. return func;
  4874. };
  4875. /**
  4876. * The base implementation of `setToString` without support for hot loop shorting.
  4877. *
  4878. * @private
  4879. * @param {Function} func The function to modify.
  4880. * @param {Function} string The `toString` result.
  4881. * @returns {Function} Returns `func`.
  4882. */
  4883. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4884. return defineProperty(func, 'toString', {
  4885. 'configurable': true,
  4886. 'enumerable': false,
  4887. 'value': constant(string),
  4888. 'writable': true
  4889. });
  4890. };
  4891. /**
  4892. * The base implementation of `_.shuffle`.
  4893. *
  4894. * @private
  4895. * @param {Array|Object} collection The collection to shuffle.
  4896. * @returns {Array} Returns the new shuffled array.
  4897. */
  4898. function baseShuffle(collection) {
  4899. return shuffleSelf(values(collection));
  4900. }
  4901. /**
  4902. * The base implementation of `_.slice` without an iteratee call guard.
  4903. *
  4904. * @private
  4905. * @param {Array} array The array to slice.
  4906. * @param {number} [start=0] The start position.
  4907. * @param {number} [end=array.length] The end position.
  4908. * @returns {Array} Returns the slice of `array`.
  4909. */
  4910. function baseSlice(array, start, end) {
  4911. var index = -1,
  4912. length = array.length;
  4913. if (start < 0) {
  4914. start = -start > length ? 0 : (length + start);
  4915. }
  4916. end = end > length ? length : end;
  4917. if (end < 0) {
  4918. end += length;
  4919. }
  4920. length = start > end ? 0 : ((end - start) >>> 0);
  4921. start >>>= 0;
  4922. var result = Array(length);
  4923. while (++index < length) {
  4924. result[index] = array[index + start];
  4925. }
  4926. return result;
  4927. }
  4928. /**
  4929. * The base implementation of `_.some` without support for iteratee shorthands.
  4930. *
  4931. * @private
  4932. * @param {Array|Object} collection The collection to iterate over.
  4933. * @param {Function} predicate The function invoked per iteration.
  4934. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4935. * else `false`.
  4936. */
  4937. function baseSome(collection, predicate) {
  4938. var result;
  4939. baseEach(collection, function(value, index, collection) {
  4940. result = predicate(value, index, collection);
  4941. return !result;
  4942. });
  4943. return !!result;
  4944. }
  4945. /**
  4946. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4947. * performs a binary search of `array` to determine the index at which `value`
  4948. * should be inserted into `array` in order to maintain its sort order.
  4949. *
  4950. * @private
  4951. * @param {Array} array The sorted array to inspect.
  4952. * @param {*} value The value to evaluate.
  4953. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4954. * @returns {number} Returns the index at which `value` should be inserted
  4955. * into `array`.
  4956. */
  4957. function baseSortedIndex(array, value, retHighest) {
  4958. var low = 0,
  4959. high = array == null ? low : array.length;
  4960. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4961. while (low < high) {
  4962. var mid = (low + high) >>> 1,
  4963. computed = array[mid];
  4964. if (computed !== null && !isSymbol(computed) &&
  4965. (retHighest ? (computed <= value) : (computed < value))) {
  4966. low = mid + 1;
  4967. } else {
  4968. high = mid;
  4969. }
  4970. }
  4971. return high;
  4972. }
  4973. return baseSortedIndexBy(array, value, identity, retHighest);
  4974. }
  4975. /**
  4976. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4977. * which invokes `iteratee` for `value` and each element of `array` to compute
  4978. * their sort ranking. The iteratee is invoked with one argument; (value).
  4979. *
  4980. * @private
  4981. * @param {Array} array The sorted array to inspect.
  4982. * @param {*} value The value to evaluate.
  4983. * @param {Function} iteratee The iteratee invoked per element.
  4984. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4985. * @returns {number} Returns the index at which `value` should be inserted
  4986. * into `array`.
  4987. */
  4988. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4989. var low = 0,
  4990. high = array == null ? 0 : array.length;
  4991. if (high === 0) {
  4992. return 0;
  4993. }
  4994. value = iteratee(value);
  4995. var valIsNaN = value !== value,
  4996. valIsNull = value === null,
  4997. valIsSymbol = isSymbol(value),
  4998. valIsUndefined = value === undefined;
  4999. while (low < high) {
  5000. var mid = nativeFloor((low + high) / 2),
  5001. computed = iteratee(array[mid]),
  5002. othIsDefined = computed !== undefined,
  5003. othIsNull = computed === null,
  5004. othIsReflexive = computed === computed,
  5005. othIsSymbol = isSymbol(computed);
  5006. if (valIsNaN) {
  5007. var setLow = retHighest || othIsReflexive;
  5008. } else if (valIsUndefined) {
  5009. setLow = othIsReflexive && (retHighest || othIsDefined);
  5010. } else if (valIsNull) {
  5011. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5012. } else if (valIsSymbol) {
  5013. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5014. } else if (othIsNull || othIsSymbol) {
  5015. setLow = false;
  5016. } else {
  5017. setLow = retHighest ? (computed <= value) : (computed < value);
  5018. }
  5019. if (setLow) {
  5020. low = mid + 1;
  5021. } else {
  5022. high = mid;
  5023. }
  5024. }
  5025. return nativeMin(high, MAX_ARRAY_INDEX);
  5026. }
  5027. /**
  5028. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5029. * support for iteratee shorthands.
  5030. *
  5031. * @private
  5032. * @param {Array} array The array to inspect.
  5033. * @param {Function} [iteratee] The iteratee invoked per element.
  5034. * @returns {Array} Returns the new duplicate free array.
  5035. */
  5036. function baseSortedUniq(array, iteratee) {
  5037. var index = -1,
  5038. length = array.length,
  5039. resIndex = 0,
  5040. result = [];
  5041. while (++index < length) {
  5042. var value = array[index],
  5043. computed = iteratee ? iteratee(value) : value;
  5044. if (!index || !eq(computed, seen)) {
  5045. var seen = computed;
  5046. result[resIndex++] = value === 0 ? 0 : value;
  5047. }
  5048. }
  5049. return result;
  5050. }
  5051. /**
  5052. * The base implementation of `_.toNumber` which doesn't ensure correct
  5053. * conversions of binary, hexadecimal, or octal string values.
  5054. *
  5055. * @private
  5056. * @param {*} value The value to process.
  5057. * @returns {number} Returns the number.
  5058. */
  5059. function baseToNumber(value) {
  5060. if (typeof value == 'number') {
  5061. return value;
  5062. }
  5063. if (isSymbol(value)) {
  5064. return NAN;
  5065. }
  5066. return +value;
  5067. }
  5068. /**
  5069. * The base implementation of `_.toString` which doesn't convert nullish
  5070. * values to empty strings.
  5071. *
  5072. * @private
  5073. * @param {*} value The value to process.
  5074. * @returns {string} Returns the string.
  5075. */
  5076. function baseToString(value) {
  5077. // Exit early for strings to avoid a performance hit in some environments.
  5078. if (typeof value == 'string') {
  5079. return value;
  5080. }
  5081. if (isArray(value)) {
  5082. // Recursively convert values (susceptible to call stack limits).
  5083. return arrayMap(value, baseToString) + '';
  5084. }
  5085. if (isSymbol(value)) {
  5086. return symbolToString ? symbolToString.call(value) : '';
  5087. }
  5088. var result = (value + '');
  5089. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5090. }
  5091. /**
  5092. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5093. *
  5094. * @private
  5095. * @param {Array} array The array to inspect.
  5096. * @param {Function} [iteratee] The iteratee invoked per element.
  5097. * @param {Function} [comparator] The comparator invoked per element.
  5098. * @returns {Array} Returns the new duplicate free array.
  5099. */
  5100. function baseUniq(array, iteratee, comparator) {
  5101. var index = -1,
  5102. includes = arrayIncludes,
  5103. length = array.length,
  5104. isCommon = true,
  5105. result = [],
  5106. seen = result;
  5107. if (comparator) {
  5108. isCommon = false;
  5109. includes = arrayIncludesWith;
  5110. }
  5111. else if (length >= LARGE_ARRAY_SIZE) {
  5112. var set = iteratee ? null : createSet(array);
  5113. if (set) {
  5114. return setToArray(set);
  5115. }
  5116. isCommon = false;
  5117. includes = cacheHas;
  5118. seen = new SetCache;
  5119. }
  5120. else {
  5121. seen = iteratee ? [] : result;
  5122. }
  5123. outer:
  5124. while (++index < length) {
  5125. var value = array[index],
  5126. computed = iteratee ? iteratee(value) : value;
  5127. value = (comparator || value !== 0) ? value : 0;
  5128. if (isCommon && computed === computed) {
  5129. var seenIndex = seen.length;
  5130. while (seenIndex--) {
  5131. if (seen[seenIndex] === computed) {
  5132. continue outer;
  5133. }
  5134. }
  5135. if (iteratee) {
  5136. seen.push(computed);
  5137. }
  5138. result.push(value);
  5139. }
  5140. else if (!includes(seen, computed, comparator)) {
  5141. if (seen !== result) {
  5142. seen.push(computed);
  5143. }
  5144. result.push(value);
  5145. }
  5146. }
  5147. return result;
  5148. }
  5149. /**
  5150. * The base implementation of `_.unset`.
  5151. *
  5152. * @private
  5153. * @param {Object} object The object to modify.
  5154. * @param {Array|string} path The property path to unset.
  5155. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5156. */
  5157. function baseUnset(object, path) {
  5158. path = castPath(path, object);
  5159. object = parent(object, path);
  5160. return object == null || delete object[toKey(last(path))];
  5161. }
  5162. /**
  5163. * The base implementation of `_.update`.
  5164. *
  5165. * @private
  5166. * @param {Object} object The object to modify.
  5167. * @param {Array|string} path The path of the property to update.
  5168. * @param {Function} updater The function to produce the updated value.
  5169. * @param {Function} [customizer] The function to customize path creation.
  5170. * @returns {Object} Returns `object`.
  5171. */
  5172. function baseUpdate(object, path, updater, customizer) {
  5173. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5174. }
  5175. /**
  5176. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5177. * without support for iteratee shorthands.
  5178. *
  5179. * @private
  5180. * @param {Array} array The array to query.
  5181. * @param {Function} predicate The function invoked per iteration.
  5182. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5183. * @param {boolean} [fromRight] Specify iterating from right to left.
  5184. * @returns {Array} Returns the slice of `array`.
  5185. */
  5186. function baseWhile(array, predicate, isDrop, fromRight) {
  5187. var length = array.length,
  5188. index = fromRight ? length : -1;
  5189. while ((fromRight ? index-- : ++index < length) &&
  5190. predicate(array[index], index, array)) {}
  5191. return isDrop
  5192. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5193. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5194. }
  5195. /**
  5196. * The base implementation of `wrapperValue` which returns the result of
  5197. * performing a sequence of actions on the unwrapped `value`, where each
  5198. * successive action is supplied the return value of the previous.
  5199. *
  5200. * @private
  5201. * @param {*} value The unwrapped value.
  5202. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5203. * @returns {*} Returns the resolved value.
  5204. */
  5205. function baseWrapperValue(value, actions) {
  5206. var result = value;
  5207. if (result instanceof LazyWrapper) {
  5208. result = result.value();
  5209. }
  5210. return arrayReduce(actions, function(result, action) {
  5211. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5212. }, result);
  5213. }
  5214. /**
  5215. * The base implementation of methods like `_.xor`, without support for
  5216. * iteratee shorthands, that accepts an array of arrays to inspect.
  5217. *
  5218. * @private
  5219. * @param {Array} arrays The arrays to inspect.
  5220. * @param {Function} [iteratee] The iteratee invoked per element.
  5221. * @param {Function} [comparator] The comparator invoked per element.
  5222. * @returns {Array} Returns the new array of values.
  5223. */
  5224. function baseXor(arrays, iteratee, comparator) {
  5225. var length = arrays.length;
  5226. if (length < 2) {
  5227. return length ? baseUniq(arrays[0]) : [];
  5228. }
  5229. var index = -1,
  5230. result = Array(length);
  5231. while (++index < length) {
  5232. var array = arrays[index],
  5233. othIndex = -1;
  5234. while (++othIndex < length) {
  5235. if (othIndex != index) {
  5236. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5237. }
  5238. }
  5239. }
  5240. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5241. }
  5242. /**
  5243. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5244. *
  5245. * @private
  5246. * @param {Array} props The property identifiers.
  5247. * @param {Array} values The property values.
  5248. * @param {Function} assignFunc The function to assign values.
  5249. * @returns {Object} Returns the new object.
  5250. */
  5251. function baseZipObject(props, values, assignFunc) {
  5252. var index = -1,
  5253. length = props.length,
  5254. valsLength = values.length,
  5255. result = {};
  5256. while (++index < length) {
  5257. var value = index < valsLength ? values[index] : undefined;
  5258. assignFunc(result, props[index], value);
  5259. }
  5260. return result;
  5261. }
  5262. /**
  5263. * Casts `value` to an empty array if it's not an array like object.
  5264. *
  5265. * @private
  5266. * @param {*} value The value to inspect.
  5267. * @returns {Array|Object} Returns the cast array-like object.
  5268. */
  5269. function castArrayLikeObject(value) {
  5270. return isArrayLikeObject(value) ? value : [];
  5271. }
  5272. /**
  5273. * Casts `value` to `identity` if it's not a function.
  5274. *
  5275. * @private
  5276. * @param {*} value The value to inspect.
  5277. * @returns {Function} Returns cast function.
  5278. */
  5279. function castFunction(value) {
  5280. return typeof value == 'function' ? value : identity;
  5281. }
  5282. /**
  5283. * Casts `value` to a path array if it's not one.
  5284. *
  5285. * @private
  5286. * @param {*} value The value to inspect.
  5287. * @param {Object} [object] The object to query keys on.
  5288. * @returns {Array} Returns the cast property path array.
  5289. */
  5290. function castPath(value, object) {
  5291. if (isArray(value)) {
  5292. return value;
  5293. }
  5294. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5295. }
  5296. /**
  5297. * A `baseRest` alias which can be replaced with `identity` by module
  5298. * replacement plugins.
  5299. *
  5300. * @private
  5301. * @type {Function}
  5302. * @param {Function} func The function to apply a rest parameter to.
  5303. * @returns {Function} Returns the new function.
  5304. */
  5305. var castRest = baseRest;
  5306. /**
  5307. * Casts `array` to a slice if it's needed.
  5308. *
  5309. * @private
  5310. * @param {Array} array The array to inspect.
  5311. * @param {number} start The start position.
  5312. * @param {number} [end=array.length] The end position.
  5313. * @returns {Array} Returns the cast slice.
  5314. */
  5315. function castSlice(array, start, end) {
  5316. var length = array.length;
  5317. end = end === undefined ? length : end;
  5318. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5319. }
  5320. /**
  5321. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5322. *
  5323. * @private
  5324. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5325. */
  5326. var clearTimeout = ctxClearTimeout || function(id) {
  5327. return root.clearTimeout(id);
  5328. };
  5329. /**
  5330. * Creates a clone of `buffer`.
  5331. *
  5332. * @private
  5333. * @param {Buffer} buffer The buffer to clone.
  5334. * @param {boolean} [isDeep] Specify a deep clone.
  5335. * @returns {Buffer} Returns the cloned buffer.
  5336. */
  5337. function cloneBuffer(buffer, isDeep) {
  5338. if (isDeep) {
  5339. return buffer.slice();
  5340. }
  5341. var length = buffer.length,
  5342. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5343. buffer.copy(result);
  5344. return result;
  5345. }
  5346. /**
  5347. * Creates a clone of `arrayBuffer`.
  5348. *
  5349. * @private
  5350. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5351. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5352. */
  5353. function cloneArrayBuffer(arrayBuffer) {
  5354. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5355. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5356. return result;
  5357. }
  5358. /**
  5359. * Creates a clone of `dataView`.
  5360. *
  5361. * @private
  5362. * @param {Object} dataView The data view to clone.
  5363. * @param {boolean} [isDeep] Specify a deep clone.
  5364. * @returns {Object} Returns the cloned data view.
  5365. */
  5366. function cloneDataView(dataView, isDeep) {
  5367. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5368. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5369. }
  5370. /**
  5371. * Creates a clone of `regexp`.
  5372. *
  5373. * @private
  5374. * @param {Object} regexp The regexp to clone.
  5375. * @returns {Object} Returns the cloned regexp.
  5376. */
  5377. function cloneRegExp(regexp) {
  5378. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5379. result.lastIndex = regexp.lastIndex;
  5380. return result;
  5381. }
  5382. /**
  5383. * Creates a clone of the `symbol` object.
  5384. *
  5385. * @private
  5386. * @param {Object} symbol The symbol object to clone.
  5387. * @returns {Object} Returns the cloned symbol object.
  5388. */
  5389. function cloneSymbol(symbol) {
  5390. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5391. }
  5392. /**
  5393. * Creates a clone of `typedArray`.
  5394. *
  5395. * @private
  5396. * @param {Object} typedArray The typed array to clone.
  5397. * @param {boolean} [isDeep] Specify a deep clone.
  5398. * @returns {Object} Returns the cloned typed array.
  5399. */
  5400. function cloneTypedArray(typedArray, isDeep) {
  5401. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5402. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5403. }
  5404. /**
  5405. * Compares values to sort them in ascending order.
  5406. *
  5407. * @private
  5408. * @param {*} value The value to compare.
  5409. * @param {*} other The other value to compare.
  5410. * @returns {number} Returns the sort order indicator for `value`.
  5411. */
  5412. function compareAscending(value, other) {
  5413. if (value !== other) {
  5414. var valIsDefined = value !== undefined,
  5415. valIsNull = value === null,
  5416. valIsReflexive = value === value,
  5417. valIsSymbol = isSymbol(value);
  5418. var othIsDefined = other !== undefined,
  5419. othIsNull = other === null,
  5420. othIsReflexive = other === other,
  5421. othIsSymbol = isSymbol(other);
  5422. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5423. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5424. (valIsNull && othIsDefined && othIsReflexive) ||
  5425. (!valIsDefined && othIsReflexive) ||
  5426. !valIsReflexive) {
  5427. return 1;
  5428. }
  5429. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5430. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5431. (othIsNull && valIsDefined && valIsReflexive) ||
  5432. (!othIsDefined && valIsReflexive) ||
  5433. !othIsReflexive) {
  5434. return -1;
  5435. }
  5436. }
  5437. return 0;
  5438. }
  5439. /**
  5440. * Used by `_.orderBy` to compare multiple properties of a value to another
  5441. * and stable sort them.
  5442. *
  5443. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5444. * specify an order of "desc" for descending or "asc" for ascending sort order
  5445. * of corresponding values.
  5446. *
  5447. * @private
  5448. * @param {Object} object The object to compare.
  5449. * @param {Object} other The other object to compare.
  5450. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5451. * @returns {number} Returns the sort order indicator for `object`.
  5452. */
  5453. function compareMultiple(object, other, orders) {
  5454. var index = -1,
  5455. objCriteria = object.criteria,
  5456. othCriteria = other.criteria,
  5457. length = objCriteria.length,
  5458. ordersLength = orders.length;
  5459. while (++index < length) {
  5460. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5461. if (result) {
  5462. if (index >= ordersLength) {
  5463. return result;
  5464. }
  5465. var order = orders[index];
  5466. return result * (order == 'desc' ? -1 : 1);
  5467. }
  5468. }
  5469. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5470. // that causes it, under certain circumstances, to provide the same value for
  5471. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5472. // for more details.
  5473. //
  5474. // This also ensures a stable sort in V8 and other engines.
  5475. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5476. return object.index - other.index;
  5477. }
  5478. /**
  5479. * Creates an array that is the composition of partially applied arguments,
  5480. * placeholders, and provided arguments into a single array of arguments.
  5481. *
  5482. * @private
  5483. * @param {Array} args The provided arguments.
  5484. * @param {Array} partials The arguments to prepend to those provided.
  5485. * @param {Array} holders The `partials` placeholder indexes.
  5486. * @params {boolean} [isCurried] Specify composing for a curried function.
  5487. * @returns {Array} Returns the new array of composed arguments.
  5488. */
  5489. function composeArgs(args, partials, holders, isCurried) {
  5490. var argsIndex = -1,
  5491. argsLength = args.length,
  5492. holdersLength = holders.length,
  5493. leftIndex = -1,
  5494. leftLength = partials.length,
  5495. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5496. result = Array(leftLength + rangeLength),
  5497. isUncurried = !isCurried;
  5498. while (++leftIndex < leftLength) {
  5499. result[leftIndex] = partials[leftIndex];
  5500. }
  5501. while (++argsIndex < holdersLength) {
  5502. if (isUncurried || argsIndex < argsLength) {
  5503. result[holders[argsIndex]] = args[argsIndex];
  5504. }
  5505. }
  5506. while (rangeLength--) {
  5507. result[leftIndex++] = args[argsIndex++];
  5508. }
  5509. return result;
  5510. }
  5511. /**
  5512. * This function is like `composeArgs` except that the arguments composition
  5513. * is tailored for `_.partialRight`.
  5514. *
  5515. * @private
  5516. * @param {Array} args The provided arguments.
  5517. * @param {Array} partials The arguments to append to those provided.
  5518. * @param {Array} holders The `partials` placeholder indexes.
  5519. * @params {boolean} [isCurried] Specify composing for a curried function.
  5520. * @returns {Array} Returns the new array of composed arguments.
  5521. */
  5522. function composeArgsRight(args, partials, holders, isCurried) {
  5523. var argsIndex = -1,
  5524. argsLength = args.length,
  5525. holdersIndex = -1,
  5526. holdersLength = holders.length,
  5527. rightIndex = -1,
  5528. rightLength = partials.length,
  5529. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5530. result = Array(rangeLength + rightLength),
  5531. isUncurried = !isCurried;
  5532. while (++argsIndex < rangeLength) {
  5533. result[argsIndex] = args[argsIndex];
  5534. }
  5535. var offset = argsIndex;
  5536. while (++rightIndex < rightLength) {
  5537. result[offset + rightIndex] = partials[rightIndex];
  5538. }
  5539. while (++holdersIndex < holdersLength) {
  5540. if (isUncurried || argsIndex < argsLength) {
  5541. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5542. }
  5543. }
  5544. return result;
  5545. }
  5546. /**
  5547. * Copies the values of `source` to `array`.
  5548. *
  5549. * @private
  5550. * @param {Array} source The array to copy values from.
  5551. * @param {Array} [array=[]] The array to copy values to.
  5552. * @returns {Array} Returns `array`.
  5553. */
  5554. function copyArray(source, array) {
  5555. var index = -1,
  5556. length = source.length;
  5557. array || (array = Array(length));
  5558. while (++index < length) {
  5559. array[index] = source[index];
  5560. }
  5561. return array;
  5562. }
  5563. /**
  5564. * Copies properties of `source` to `object`.
  5565. *
  5566. * @private
  5567. * @param {Object} source The object to copy properties from.
  5568. * @param {Array} props The property identifiers to copy.
  5569. * @param {Object} [object={}] The object to copy properties to.
  5570. * @param {Function} [customizer] The function to customize copied values.
  5571. * @returns {Object} Returns `object`.
  5572. */
  5573. function copyObject(source, props, object, customizer) {
  5574. var isNew = !object;
  5575. object || (object = {});
  5576. var index = -1,
  5577. length = props.length;
  5578. while (++index < length) {
  5579. var key = props[index];
  5580. var newValue = customizer
  5581. ? customizer(object[key], source[key], key, object, source)
  5582. : undefined;
  5583. if (newValue === undefined) {
  5584. newValue = source[key];
  5585. }
  5586. if (isNew) {
  5587. baseAssignValue(object, key, newValue);
  5588. } else {
  5589. assignValue(object, key, newValue);
  5590. }
  5591. }
  5592. return object;
  5593. }
  5594. /**
  5595. * Copies own symbols of `source` to `object`.
  5596. *
  5597. * @private
  5598. * @param {Object} source The object to copy symbols from.
  5599. * @param {Object} [object={}] The object to copy symbols to.
  5600. * @returns {Object} Returns `object`.
  5601. */
  5602. function copySymbols(source, object) {
  5603. return copyObject(source, getSymbols(source), object);
  5604. }
  5605. /**
  5606. * Copies own and inherited symbols of `source` to `object`.
  5607. *
  5608. * @private
  5609. * @param {Object} source The object to copy symbols from.
  5610. * @param {Object} [object={}] The object to copy symbols to.
  5611. * @returns {Object} Returns `object`.
  5612. */
  5613. function copySymbolsIn(source, object) {
  5614. return copyObject(source, getSymbolsIn(source), object);
  5615. }
  5616. /**
  5617. * Creates a function like `_.groupBy`.
  5618. *
  5619. * @private
  5620. * @param {Function} setter The function to set accumulator values.
  5621. * @param {Function} [initializer] The accumulator object initializer.
  5622. * @returns {Function} Returns the new aggregator function.
  5623. */
  5624. function createAggregator(setter, initializer) {
  5625. return function(collection, iteratee) {
  5626. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5627. accumulator = initializer ? initializer() : {};
  5628. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5629. };
  5630. }
  5631. /**
  5632. * Creates a function like `_.assign`.
  5633. *
  5634. * @private
  5635. * @param {Function} assigner The function to assign values.
  5636. * @returns {Function} Returns the new assigner function.
  5637. */
  5638. function createAssigner(assigner) {
  5639. return baseRest(function(object, sources) {
  5640. var index = -1,
  5641. length = sources.length,
  5642. customizer = length > 1 ? sources[length - 1] : undefined,
  5643. guard = length > 2 ? sources[2] : undefined;
  5644. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5645. ? (length--, customizer)
  5646. : undefined;
  5647. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5648. customizer = length < 3 ? undefined : customizer;
  5649. length = 1;
  5650. }
  5651. object = Object(object);
  5652. while (++index < length) {
  5653. var source = sources[index];
  5654. if (source) {
  5655. assigner(object, source, index, customizer);
  5656. }
  5657. }
  5658. return object;
  5659. });
  5660. }
  5661. /**
  5662. * Creates a `baseEach` or `baseEachRight` function.
  5663. *
  5664. * @private
  5665. * @param {Function} eachFunc The function to iterate over a collection.
  5666. * @param {boolean} [fromRight] Specify iterating from right to left.
  5667. * @returns {Function} Returns the new base function.
  5668. */
  5669. function createBaseEach(eachFunc, fromRight) {
  5670. return function(collection, iteratee) {
  5671. if (collection == null) {
  5672. return collection;
  5673. }
  5674. if (!isArrayLike(collection)) {
  5675. return eachFunc(collection, iteratee);
  5676. }
  5677. var length = collection.length,
  5678. index = fromRight ? length : -1,
  5679. iterable = Object(collection);
  5680. while ((fromRight ? index-- : ++index < length)) {
  5681. if (iteratee(iterable[index], index, iterable) === false) {
  5682. break;
  5683. }
  5684. }
  5685. return collection;
  5686. };
  5687. }
  5688. /**
  5689. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5690. *
  5691. * @private
  5692. * @param {boolean} [fromRight] Specify iterating from right to left.
  5693. * @returns {Function} Returns the new base function.
  5694. */
  5695. function createBaseFor(fromRight) {
  5696. return function(object, iteratee, keysFunc) {
  5697. var index = -1,
  5698. iterable = Object(object),
  5699. props = keysFunc(object),
  5700. length = props.length;
  5701. while (length--) {
  5702. var key = props[fromRight ? length : ++index];
  5703. if (iteratee(iterable[key], key, iterable) === false) {
  5704. break;
  5705. }
  5706. }
  5707. return object;
  5708. };
  5709. }
  5710. /**
  5711. * Creates a function that wraps `func` to invoke it with the optional `this`
  5712. * binding of `thisArg`.
  5713. *
  5714. * @private
  5715. * @param {Function} func The function to wrap.
  5716. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5717. * @param {*} [thisArg] The `this` binding of `func`.
  5718. * @returns {Function} Returns the new wrapped function.
  5719. */
  5720. function createBind(func, bitmask, thisArg) {
  5721. var isBind = bitmask & WRAP_BIND_FLAG,
  5722. Ctor = createCtor(func);
  5723. function wrapper() {
  5724. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5725. return fn.apply(isBind ? thisArg : this, arguments);
  5726. }
  5727. return wrapper;
  5728. }
  5729. /**
  5730. * Creates a function like `_.lowerFirst`.
  5731. *
  5732. * @private
  5733. * @param {string} methodName The name of the `String` case method to use.
  5734. * @returns {Function} Returns the new case function.
  5735. */
  5736. function createCaseFirst(methodName) {
  5737. return function(string) {
  5738. string = toString(string);
  5739. var strSymbols = hasUnicode(string)
  5740. ? stringToArray(string)
  5741. : undefined;
  5742. var chr = strSymbols
  5743. ? strSymbols[0]
  5744. : string.charAt(0);
  5745. var trailing = strSymbols
  5746. ? castSlice(strSymbols, 1).join('')
  5747. : string.slice(1);
  5748. return chr[methodName]() + trailing;
  5749. };
  5750. }
  5751. /**
  5752. * Creates a function like `_.camelCase`.
  5753. *
  5754. * @private
  5755. * @param {Function} callback The function to combine each word.
  5756. * @returns {Function} Returns the new compounder function.
  5757. */
  5758. function createCompounder(callback) {
  5759. return function(string) {
  5760. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5761. };
  5762. }
  5763. /**
  5764. * Creates a function that produces an instance of `Ctor` regardless of
  5765. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5766. *
  5767. * @private
  5768. * @param {Function} Ctor The constructor to wrap.
  5769. * @returns {Function} Returns the new wrapped function.
  5770. */
  5771. function createCtor(Ctor) {
  5772. return function() {
  5773. // Use a `switch` statement to work with class constructors. See
  5774. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5775. // for more details.
  5776. var args = arguments;
  5777. switch (args.length) {
  5778. case 0: return new Ctor;
  5779. case 1: return new Ctor(args[0]);
  5780. case 2: return new Ctor(args[0], args[1]);
  5781. case 3: return new Ctor(args[0], args[1], args[2]);
  5782. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5783. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5784. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5785. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5786. }
  5787. var thisBinding = baseCreate(Ctor.prototype),
  5788. result = Ctor.apply(thisBinding, args);
  5789. // Mimic the constructor's `return` behavior.
  5790. // See https://es5.github.io/#x13.2.2 for more details.
  5791. return isObject(result) ? result : thisBinding;
  5792. };
  5793. }
  5794. /**
  5795. * Creates a function that wraps `func` to enable currying.
  5796. *
  5797. * @private
  5798. * @param {Function} func The function to wrap.
  5799. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5800. * @param {number} arity The arity of `func`.
  5801. * @returns {Function} Returns the new wrapped function.
  5802. */
  5803. function createCurry(func, bitmask, arity) {
  5804. var Ctor = createCtor(func);
  5805. function wrapper() {
  5806. var length = arguments.length,
  5807. args = Array(length),
  5808. index = length,
  5809. placeholder = getHolder(wrapper);
  5810. while (index--) {
  5811. args[index] = arguments[index];
  5812. }
  5813. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5814. ? []
  5815. : replaceHolders(args, placeholder);
  5816. length -= holders.length;
  5817. if (length < arity) {
  5818. return createRecurry(
  5819. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5820. args, holders, undefined, undefined, arity - length);
  5821. }
  5822. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5823. return apply(fn, this, args);
  5824. }
  5825. return wrapper;
  5826. }
  5827. /**
  5828. * Creates a `_.find` or `_.findLast` function.
  5829. *
  5830. * @private
  5831. * @param {Function} findIndexFunc The function to find the collection index.
  5832. * @returns {Function} Returns the new find function.
  5833. */
  5834. function createFind(findIndexFunc) {
  5835. return function(collection, predicate, fromIndex) {
  5836. var iterable = Object(collection);
  5837. if (!isArrayLike(collection)) {
  5838. var iteratee = getIteratee(predicate, 3);
  5839. collection = keys(collection);
  5840. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5841. }
  5842. var index = findIndexFunc(collection, predicate, fromIndex);
  5843. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5844. };
  5845. }
  5846. /**
  5847. * Creates a `_.flow` or `_.flowRight` function.
  5848. *
  5849. * @private
  5850. * @param {boolean} [fromRight] Specify iterating from right to left.
  5851. * @returns {Function} Returns the new flow function.
  5852. */
  5853. function createFlow(fromRight) {
  5854. return flatRest(function(funcs) {
  5855. var length = funcs.length,
  5856. index = length,
  5857. prereq = LodashWrapper.prototype.thru;
  5858. if (fromRight) {
  5859. funcs.reverse();
  5860. }
  5861. while (index--) {
  5862. var func = funcs[index];
  5863. if (typeof func != 'function') {
  5864. throw new TypeError(FUNC_ERROR_TEXT);
  5865. }
  5866. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5867. var wrapper = new LodashWrapper([], true);
  5868. }
  5869. }
  5870. index = wrapper ? index : length;
  5871. while (++index < length) {
  5872. func = funcs[index];
  5873. var funcName = getFuncName(func),
  5874. data = funcName == 'wrapper' ? getData(func) : undefined;
  5875. if (data && isLaziable(data[0]) &&
  5876. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5877. !data[4].length && data[9] == 1
  5878. ) {
  5879. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5880. } else {
  5881. wrapper = (func.length == 1 && isLaziable(func))
  5882. ? wrapper[funcName]()
  5883. : wrapper.thru(func);
  5884. }
  5885. }
  5886. return function() {
  5887. var args = arguments,
  5888. value = args[0];
  5889. if (wrapper && args.length == 1 && isArray(value)) {
  5890. return wrapper.plant(value).value();
  5891. }
  5892. var index = 0,
  5893. result = length ? funcs[index].apply(this, args) : value;
  5894. while (++index < length) {
  5895. result = funcs[index].call(this, result);
  5896. }
  5897. return result;
  5898. };
  5899. });
  5900. }
  5901. /**
  5902. * Creates a function that wraps `func` to invoke it with optional `this`
  5903. * binding of `thisArg`, partial application, and currying.
  5904. *
  5905. * @private
  5906. * @param {Function|string} func The function or method name to wrap.
  5907. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5908. * @param {*} [thisArg] The `this` binding of `func`.
  5909. * @param {Array} [partials] The arguments to prepend to those provided to
  5910. * the new function.
  5911. * @param {Array} [holders] The `partials` placeholder indexes.
  5912. * @param {Array} [partialsRight] The arguments to append to those provided
  5913. * to the new function.
  5914. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5915. * @param {Array} [argPos] The argument positions of the new function.
  5916. * @param {number} [ary] The arity cap of `func`.
  5917. * @param {number} [arity] The arity of `func`.
  5918. * @returns {Function} Returns the new wrapped function.
  5919. */
  5920. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5921. var isAry = bitmask & WRAP_ARY_FLAG,
  5922. isBind = bitmask & WRAP_BIND_FLAG,
  5923. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5924. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5925. isFlip = bitmask & WRAP_FLIP_FLAG,
  5926. Ctor = isBindKey ? undefined : createCtor(func);
  5927. function wrapper() {
  5928. var length = arguments.length,
  5929. args = Array(length),
  5930. index = length;
  5931. while (index--) {
  5932. args[index] = arguments[index];
  5933. }
  5934. if (isCurried) {
  5935. var placeholder = getHolder(wrapper),
  5936. holdersCount = countHolders(args, placeholder);
  5937. }
  5938. if (partials) {
  5939. args = composeArgs(args, partials, holders, isCurried);
  5940. }
  5941. if (partialsRight) {
  5942. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5943. }
  5944. length -= holdersCount;
  5945. if (isCurried && length < arity) {
  5946. var newHolders = replaceHolders(args, placeholder);
  5947. return createRecurry(
  5948. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5949. args, newHolders, argPos, ary, arity - length
  5950. );
  5951. }
  5952. var thisBinding = isBind ? thisArg : this,
  5953. fn = isBindKey ? thisBinding[func] : func;
  5954. length = args.length;
  5955. if (argPos) {
  5956. args = reorder(args, argPos);
  5957. } else if (isFlip && length > 1) {
  5958. args.reverse();
  5959. }
  5960. if (isAry && ary < length) {
  5961. args.length = ary;
  5962. }
  5963. if (this && this !== root && this instanceof wrapper) {
  5964. fn = Ctor || createCtor(fn);
  5965. }
  5966. return fn.apply(thisBinding, args);
  5967. }
  5968. return wrapper;
  5969. }
  5970. /**
  5971. * Creates a function like `_.invertBy`.
  5972. *
  5973. * @private
  5974. * @param {Function} setter The function to set accumulator values.
  5975. * @param {Function} toIteratee The function to resolve iteratees.
  5976. * @returns {Function} Returns the new inverter function.
  5977. */
  5978. function createInverter(setter, toIteratee) {
  5979. return function(object, iteratee) {
  5980. return baseInverter(object, setter, toIteratee(iteratee), {});
  5981. };
  5982. }
  5983. /**
  5984. * Creates a function that performs a mathematical operation on two values.
  5985. *
  5986. * @private
  5987. * @param {Function} operator The function to perform the operation.
  5988. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5989. * @returns {Function} Returns the new mathematical operation function.
  5990. */
  5991. function createMathOperation(operator, defaultValue) {
  5992. return function(value, other) {
  5993. var result;
  5994. if (value === undefined && other === undefined) {
  5995. return defaultValue;
  5996. }
  5997. if (value !== undefined) {
  5998. result = value;
  5999. }
  6000. if (other !== undefined) {
  6001. if (result === undefined) {
  6002. return other;
  6003. }
  6004. if (typeof value == 'string' || typeof other == 'string') {
  6005. value = baseToString(value);
  6006. other = baseToString(other);
  6007. } else {
  6008. value = baseToNumber(value);
  6009. other = baseToNumber(other);
  6010. }
  6011. result = operator(value, other);
  6012. }
  6013. return result;
  6014. };
  6015. }
  6016. /**
  6017. * Creates a function like `_.over`.
  6018. *
  6019. * @private
  6020. * @param {Function} arrayFunc The function to iterate over iteratees.
  6021. * @returns {Function} Returns the new over function.
  6022. */
  6023. function createOver(arrayFunc) {
  6024. return flatRest(function(iteratees) {
  6025. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6026. return baseRest(function(args) {
  6027. var thisArg = this;
  6028. return arrayFunc(iteratees, function(iteratee) {
  6029. return apply(iteratee, thisArg, args);
  6030. });
  6031. });
  6032. });
  6033. }
  6034. /**
  6035. * Creates the padding for `string` based on `length`. The `chars` string
  6036. * is truncated if the number of characters exceeds `length`.
  6037. *
  6038. * @private
  6039. * @param {number} length The padding length.
  6040. * @param {string} [chars=' '] The string used as padding.
  6041. * @returns {string} Returns the padding for `string`.
  6042. */
  6043. function createPadding(length, chars) {
  6044. chars = chars === undefined ? ' ' : baseToString(chars);
  6045. var charsLength = chars.length;
  6046. if (charsLength < 2) {
  6047. return charsLength ? baseRepeat(chars, length) : chars;
  6048. }
  6049. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6050. return hasUnicode(chars)
  6051. ? castSlice(stringToArray(result), 0, length).join('')
  6052. : result.slice(0, length);
  6053. }
  6054. /**
  6055. * Creates a function that wraps `func` to invoke it with the `this` binding
  6056. * of `thisArg` and `partials` prepended to the arguments it receives.
  6057. *
  6058. * @private
  6059. * @param {Function} func The function to wrap.
  6060. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6061. * @param {*} thisArg The `this` binding of `func`.
  6062. * @param {Array} partials The arguments to prepend to those provided to
  6063. * the new function.
  6064. * @returns {Function} Returns the new wrapped function.
  6065. */
  6066. function createPartial(func, bitmask, thisArg, partials) {
  6067. var isBind = bitmask & WRAP_BIND_FLAG,
  6068. Ctor = createCtor(func);
  6069. function wrapper() {
  6070. var argsIndex = -1,
  6071. argsLength = arguments.length,
  6072. leftIndex = -1,
  6073. leftLength = partials.length,
  6074. args = Array(leftLength + argsLength),
  6075. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6076. while (++leftIndex < leftLength) {
  6077. args[leftIndex] = partials[leftIndex];
  6078. }
  6079. while (argsLength--) {
  6080. args[leftIndex++] = arguments[++argsIndex];
  6081. }
  6082. return apply(fn, isBind ? thisArg : this, args);
  6083. }
  6084. return wrapper;
  6085. }
  6086. /**
  6087. * Creates a `_.range` or `_.rangeRight` function.
  6088. *
  6089. * @private
  6090. * @param {boolean} [fromRight] Specify iterating from right to left.
  6091. * @returns {Function} Returns the new range function.
  6092. */
  6093. function createRange(fromRight) {
  6094. return function(start, end, step) {
  6095. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6096. end = step = undefined;
  6097. }
  6098. // Ensure the sign of `-0` is preserved.
  6099. start = toFinite(start);
  6100. if (end === undefined) {
  6101. end = start;
  6102. start = 0;
  6103. } else {
  6104. end = toFinite(end);
  6105. }
  6106. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6107. return baseRange(start, end, step, fromRight);
  6108. };
  6109. }
  6110. /**
  6111. * Creates a function that performs a relational operation on two values.
  6112. *
  6113. * @private
  6114. * @param {Function} operator The function to perform the operation.
  6115. * @returns {Function} Returns the new relational operation function.
  6116. */
  6117. function createRelationalOperation(operator) {
  6118. return function(value, other) {
  6119. if (!(typeof value == 'string' && typeof other == 'string')) {
  6120. value = toNumber(value);
  6121. other = toNumber(other);
  6122. }
  6123. return operator(value, other);
  6124. };
  6125. }
  6126. /**
  6127. * Creates a function that wraps `func` to continue currying.
  6128. *
  6129. * @private
  6130. * @param {Function} func The function to wrap.
  6131. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6132. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6133. * @param {*} placeholder The placeholder value.
  6134. * @param {*} [thisArg] The `this` binding of `func`.
  6135. * @param {Array} [partials] The arguments to prepend to those provided to
  6136. * the new function.
  6137. * @param {Array} [holders] The `partials` placeholder indexes.
  6138. * @param {Array} [argPos] The argument positions of the new function.
  6139. * @param {number} [ary] The arity cap of `func`.
  6140. * @param {number} [arity] The arity of `func`.
  6141. * @returns {Function} Returns the new wrapped function.
  6142. */
  6143. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6144. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6145. newHolders = isCurry ? holders : undefined,
  6146. newHoldersRight = isCurry ? undefined : holders,
  6147. newPartials = isCurry ? partials : undefined,
  6148. newPartialsRight = isCurry ? undefined : partials;
  6149. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6150. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6151. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6152. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6153. }
  6154. var newData = [
  6155. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6156. newHoldersRight, argPos, ary, arity
  6157. ];
  6158. var result = wrapFunc.apply(undefined, newData);
  6159. if (isLaziable(func)) {
  6160. setData(result, newData);
  6161. }
  6162. result.placeholder = placeholder;
  6163. return setWrapToString(result, func, bitmask);
  6164. }
  6165. /**
  6166. * Creates a function like `_.round`.
  6167. *
  6168. * @private
  6169. * @param {string} methodName The name of the `Math` method to use when rounding.
  6170. * @returns {Function} Returns the new round function.
  6171. */
  6172. function createRound(methodName) {
  6173. var func = Math[methodName];
  6174. return function(number, precision) {
  6175. number = toNumber(number);
  6176. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6177. if (precision && nativeIsFinite(number)) {
  6178. // Shift with exponential notation to avoid floating-point issues.
  6179. // See [MDN](https://mdn.io/round#Examples) for more details.
  6180. var pair = (toString(number) + 'e').split('e'),
  6181. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6182. pair = (toString(value) + 'e').split('e');
  6183. return +(pair[0] + 'e' + (+pair[1] - precision));
  6184. }
  6185. return func(number);
  6186. };
  6187. }
  6188. /**
  6189. * Creates a set object of `values`.
  6190. *
  6191. * @private
  6192. * @param {Array} values The values to add to the set.
  6193. * @returns {Object} Returns the new set.
  6194. */
  6195. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6196. return new Set(values);
  6197. };
  6198. /**
  6199. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6200. *
  6201. * @private
  6202. * @param {Function} keysFunc The function to get the keys of a given object.
  6203. * @returns {Function} Returns the new pairs function.
  6204. */
  6205. function createToPairs(keysFunc) {
  6206. return function(object) {
  6207. var tag = getTag(object);
  6208. if (tag == mapTag) {
  6209. return mapToArray(object);
  6210. }
  6211. if (tag == setTag) {
  6212. return setToPairs(object);
  6213. }
  6214. return baseToPairs(object, keysFunc(object));
  6215. };
  6216. }
  6217. /**
  6218. * Creates a function that either curries or invokes `func` with optional
  6219. * `this` binding and partially applied arguments.
  6220. *
  6221. * @private
  6222. * @param {Function|string} func The function or method name to wrap.
  6223. * @param {number} bitmask The bitmask flags.
  6224. * 1 - `_.bind`
  6225. * 2 - `_.bindKey`
  6226. * 4 - `_.curry` or `_.curryRight` of a bound function
  6227. * 8 - `_.curry`
  6228. * 16 - `_.curryRight`
  6229. * 32 - `_.partial`
  6230. * 64 - `_.partialRight`
  6231. * 128 - `_.rearg`
  6232. * 256 - `_.ary`
  6233. * 512 - `_.flip`
  6234. * @param {*} [thisArg] The `this` binding of `func`.
  6235. * @param {Array} [partials] The arguments to be partially applied.
  6236. * @param {Array} [holders] The `partials` placeholder indexes.
  6237. * @param {Array} [argPos] The argument positions of the new function.
  6238. * @param {number} [ary] The arity cap of `func`.
  6239. * @param {number} [arity] The arity of `func`.
  6240. * @returns {Function} Returns the new wrapped function.
  6241. */
  6242. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6243. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6244. if (!isBindKey && typeof func != 'function') {
  6245. throw new TypeError(FUNC_ERROR_TEXT);
  6246. }
  6247. var length = partials ? partials.length : 0;
  6248. if (!length) {
  6249. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6250. partials = holders = undefined;
  6251. }
  6252. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6253. arity = arity === undefined ? arity : toInteger(arity);
  6254. length -= holders ? holders.length : 0;
  6255. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6256. var partialsRight = partials,
  6257. holdersRight = holders;
  6258. partials = holders = undefined;
  6259. }
  6260. var data = isBindKey ? undefined : getData(func);
  6261. var newData = [
  6262. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6263. argPos, ary, arity
  6264. ];
  6265. if (data) {
  6266. mergeData(newData, data);
  6267. }
  6268. func = newData[0];
  6269. bitmask = newData[1];
  6270. thisArg = newData[2];
  6271. partials = newData[3];
  6272. holders = newData[4];
  6273. arity = newData[9] = newData[9] === undefined
  6274. ? (isBindKey ? 0 : func.length)
  6275. : nativeMax(newData[9] - length, 0);
  6276. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6277. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6278. }
  6279. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6280. var result = createBind(func, bitmask, thisArg);
  6281. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6282. result = createCurry(func, bitmask, arity);
  6283. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6284. result = createPartial(func, bitmask, thisArg, partials);
  6285. } else {
  6286. result = createHybrid.apply(undefined, newData);
  6287. }
  6288. var setter = data ? baseSetData : setData;
  6289. return setWrapToString(setter(result, newData), func, bitmask);
  6290. }
  6291. /**
  6292. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6293. * of source objects to the destination object for all destination properties
  6294. * that resolve to `undefined`.
  6295. *
  6296. * @private
  6297. * @param {*} objValue The destination value.
  6298. * @param {*} srcValue The source value.
  6299. * @param {string} key The key of the property to assign.
  6300. * @param {Object} object The parent object of `objValue`.
  6301. * @returns {*} Returns the value to assign.
  6302. */
  6303. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6304. if (objValue === undefined ||
  6305. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6306. return srcValue;
  6307. }
  6308. return objValue;
  6309. }
  6310. /**
  6311. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6312. * objects into destination objects that are passed thru.
  6313. *
  6314. * @private
  6315. * @param {*} objValue The destination value.
  6316. * @param {*} srcValue The source value.
  6317. * @param {string} key The key of the property to merge.
  6318. * @param {Object} object The parent object of `objValue`.
  6319. * @param {Object} source The parent object of `srcValue`.
  6320. * @param {Object} [stack] Tracks traversed source values and their merged
  6321. * counterparts.
  6322. * @returns {*} Returns the value to assign.
  6323. */
  6324. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6325. if (isObject(objValue) && isObject(srcValue)) {
  6326. // Recursively merge objects and arrays (susceptible to call stack limits).
  6327. stack.set(srcValue, objValue);
  6328. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6329. stack['delete'](srcValue);
  6330. }
  6331. return objValue;
  6332. }
  6333. /**
  6334. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6335. * objects.
  6336. *
  6337. * @private
  6338. * @param {*} value The value to inspect.
  6339. * @param {string} key The key of the property to inspect.
  6340. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6341. */
  6342. function customOmitClone(value) {
  6343. return isPlainObject(value) ? undefined : value;
  6344. }
  6345. /**
  6346. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6347. * partial deep comparisons.
  6348. *
  6349. * @private
  6350. * @param {Array} array The array to compare.
  6351. * @param {Array} other The other array to compare.
  6352. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6353. * @param {Function} customizer The function to customize comparisons.
  6354. * @param {Function} equalFunc The function to determine equivalents of values.
  6355. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6356. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6357. */
  6358. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6359. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6360. arrLength = array.length,
  6361. othLength = other.length;
  6362. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6363. return false;
  6364. }
  6365. // Check that cyclic values are equal.
  6366. var arrStacked = stack.get(array);
  6367. var othStacked = stack.get(other);
  6368. if (arrStacked && othStacked) {
  6369. return arrStacked == other && othStacked == array;
  6370. }
  6371. var index = -1,
  6372. result = true,
  6373. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6374. stack.set(array, other);
  6375. stack.set(other, array);
  6376. // Ignore non-index properties.
  6377. while (++index < arrLength) {
  6378. var arrValue = array[index],
  6379. othValue = other[index];
  6380. if (customizer) {
  6381. var compared = isPartial
  6382. ? customizer(othValue, arrValue, index, other, array, stack)
  6383. : customizer(arrValue, othValue, index, array, other, stack);
  6384. }
  6385. if (compared !== undefined) {
  6386. if (compared) {
  6387. continue;
  6388. }
  6389. result = false;
  6390. break;
  6391. }
  6392. // Recursively compare arrays (susceptible to call stack limits).
  6393. if (seen) {
  6394. if (!arraySome(other, function(othValue, othIndex) {
  6395. if (!cacheHas(seen, othIndex) &&
  6396. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6397. return seen.push(othIndex);
  6398. }
  6399. })) {
  6400. result = false;
  6401. break;
  6402. }
  6403. } else if (!(
  6404. arrValue === othValue ||
  6405. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6406. )) {
  6407. result = false;
  6408. break;
  6409. }
  6410. }
  6411. stack['delete'](array);
  6412. stack['delete'](other);
  6413. return result;
  6414. }
  6415. /**
  6416. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6417. * the same `toStringTag`.
  6418. *
  6419. * **Note:** This function only supports comparing values with tags of
  6420. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6421. *
  6422. * @private
  6423. * @param {Object} object The object to compare.
  6424. * @param {Object} other The other object to compare.
  6425. * @param {string} tag The `toStringTag` of the objects to compare.
  6426. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6427. * @param {Function} customizer The function to customize comparisons.
  6428. * @param {Function} equalFunc The function to determine equivalents of values.
  6429. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6430. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6431. */
  6432. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6433. switch (tag) {
  6434. case dataViewTag:
  6435. if ((object.byteLength != other.byteLength) ||
  6436. (object.byteOffset != other.byteOffset)) {
  6437. return false;
  6438. }
  6439. object = object.buffer;
  6440. other = other.buffer;
  6441. case arrayBufferTag:
  6442. if ((object.byteLength != other.byteLength) ||
  6443. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6444. return false;
  6445. }
  6446. return true;
  6447. case boolTag:
  6448. case dateTag:
  6449. case numberTag:
  6450. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6451. // Invalid dates are coerced to `NaN`.
  6452. return eq(+object, +other);
  6453. case errorTag:
  6454. return object.name == other.name && object.message == other.message;
  6455. case regexpTag:
  6456. case stringTag:
  6457. // Coerce regexes to strings and treat strings, primitives and objects,
  6458. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6459. // for more details.
  6460. return object == (other + '');
  6461. case mapTag:
  6462. var convert = mapToArray;
  6463. case setTag:
  6464. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6465. convert || (convert = setToArray);
  6466. if (object.size != other.size && !isPartial) {
  6467. return false;
  6468. }
  6469. // Assume cyclic values are equal.
  6470. var stacked = stack.get(object);
  6471. if (stacked) {
  6472. return stacked == other;
  6473. }
  6474. bitmask |= COMPARE_UNORDERED_FLAG;
  6475. // Recursively compare objects (susceptible to call stack limits).
  6476. stack.set(object, other);
  6477. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6478. stack['delete'](object);
  6479. return result;
  6480. case symbolTag:
  6481. if (symbolValueOf) {
  6482. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6483. }
  6484. }
  6485. return false;
  6486. }
  6487. /**
  6488. * A specialized version of `baseIsEqualDeep` for objects with support for
  6489. * partial deep comparisons.
  6490. *
  6491. * @private
  6492. * @param {Object} object The object to compare.
  6493. * @param {Object} other The other object to compare.
  6494. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6495. * @param {Function} customizer The function to customize comparisons.
  6496. * @param {Function} equalFunc The function to determine equivalents of values.
  6497. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6498. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6499. */
  6500. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6501. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6502. objProps = getAllKeys(object),
  6503. objLength = objProps.length,
  6504. othProps = getAllKeys(other),
  6505. othLength = othProps.length;
  6506. if (objLength != othLength && !isPartial) {
  6507. return false;
  6508. }
  6509. var index = objLength;
  6510. while (index--) {
  6511. var key = objProps[index];
  6512. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6513. return false;
  6514. }
  6515. }
  6516. // Check that cyclic values are equal.
  6517. var objStacked = stack.get(object);
  6518. var othStacked = stack.get(other);
  6519. if (objStacked && othStacked) {
  6520. return objStacked == other && othStacked == object;
  6521. }
  6522. var result = true;
  6523. stack.set(object, other);
  6524. stack.set(other, object);
  6525. var skipCtor = isPartial;
  6526. while (++index < objLength) {
  6527. key = objProps[index];
  6528. var objValue = object[key],
  6529. othValue = other[key];
  6530. if (customizer) {
  6531. var compared = isPartial
  6532. ? customizer(othValue, objValue, key, other, object, stack)
  6533. : customizer(objValue, othValue, key, object, other, stack);
  6534. }
  6535. // Recursively compare objects (susceptible to call stack limits).
  6536. if (!(compared === undefined
  6537. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6538. : compared
  6539. )) {
  6540. result = false;
  6541. break;
  6542. }
  6543. skipCtor || (skipCtor = key == 'constructor');
  6544. }
  6545. if (result && !skipCtor) {
  6546. var objCtor = object.constructor,
  6547. othCtor = other.constructor;
  6548. // Non `Object` object instances with different constructors are not equal.
  6549. if (objCtor != othCtor &&
  6550. ('constructor' in object && 'constructor' in other) &&
  6551. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6552. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6553. result = false;
  6554. }
  6555. }
  6556. stack['delete'](object);
  6557. stack['delete'](other);
  6558. return result;
  6559. }
  6560. /**
  6561. * A specialized version of `baseRest` which flattens the rest array.
  6562. *
  6563. * @private
  6564. * @param {Function} func The function to apply a rest parameter to.
  6565. * @returns {Function} Returns the new function.
  6566. */
  6567. function flatRest(func) {
  6568. return setToString(overRest(func, undefined, flatten), func + '');
  6569. }
  6570. /**
  6571. * Creates an array of own enumerable property names and symbols of `object`.
  6572. *
  6573. * @private
  6574. * @param {Object} object The object to query.
  6575. * @returns {Array} Returns the array of property names and symbols.
  6576. */
  6577. function getAllKeys(object) {
  6578. return baseGetAllKeys(object, keys, getSymbols);
  6579. }
  6580. /**
  6581. * Creates an array of own and inherited enumerable property names and
  6582. * symbols of `object`.
  6583. *
  6584. * @private
  6585. * @param {Object} object The object to query.
  6586. * @returns {Array} Returns the array of property names and symbols.
  6587. */
  6588. function getAllKeysIn(object) {
  6589. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6590. }
  6591. /**
  6592. * Gets metadata for `func`.
  6593. *
  6594. * @private
  6595. * @param {Function} func The function to query.
  6596. * @returns {*} Returns the metadata for `func`.
  6597. */
  6598. var getData = !metaMap ? noop : function(func) {
  6599. return metaMap.get(func);
  6600. };
  6601. /**
  6602. * Gets the name of `func`.
  6603. *
  6604. * @private
  6605. * @param {Function} func The function to query.
  6606. * @returns {string} Returns the function name.
  6607. */
  6608. function getFuncName(func) {
  6609. var result = (func.name + ''),
  6610. array = realNames[result],
  6611. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6612. while (length--) {
  6613. var data = array[length],
  6614. otherFunc = data.func;
  6615. if (otherFunc == null || otherFunc == func) {
  6616. return data.name;
  6617. }
  6618. }
  6619. return result;
  6620. }
  6621. /**
  6622. * Gets the argument placeholder value for `func`.
  6623. *
  6624. * @private
  6625. * @param {Function} func The function to inspect.
  6626. * @returns {*} Returns the placeholder value.
  6627. */
  6628. function getHolder(func) {
  6629. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6630. return object.placeholder;
  6631. }
  6632. /**
  6633. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6634. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6635. * If arguments are provided, the chosen function is invoked with them and
  6636. * its result is returned.
  6637. *
  6638. * @private
  6639. * @param {*} [value] The value to convert to an iteratee.
  6640. * @param {number} [arity] The arity of the created iteratee.
  6641. * @returns {Function} Returns the chosen function or its result.
  6642. */
  6643. function getIteratee() {
  6644. var result = lodash.iteratee || iteratee;
  6645. result = result === iteratee ? baseIteratee : result;
  6646. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6647. }
  6648. /**
  6649. * Gets the data for `map`.
  6650. *
  6651. * @private
  6652. * @param {Object} map The map to query.
  6653. * @param {string} key The reference key.
  6654. * @returns {*} Returns the map data.
  6655. */
  6656. function getMapData(map, key) {
  6657. var data = map.__data__;
  6658. return isKeyable(key)
  6659. ? data[typeof key == 'string' ? 'string' : 'hash']
  6660. : data.map;
  6661. }
  6662. /**
  6663. * Gets the property names, values, and compare flags of `object`.
  6664. *
  6665. * @private
  6666. * @param {Object} object The object to query.
  6667. * @returns {Array} Returns the match data of `object`.
  6668. */
  6669. function getMatchData(object) {
  6670. var result = keys(object),
  6671. length = result.length;
  6672. while (length--) {
  6673. var key = result[length],
  6674. value = object[key];
  6675. result[length] = [key, value, isStrictComparable(value)];
  6676. }
  6677. return result;
  6678. }
  6679. /**
  6680. * Gets the native function at `key` of `object`.
  6681. *
  6682. * @private
  6683. * @param {Object} object The object to query.
  6684. * @param {string} key The key of the method to get.
  6685. * @returns {*} Returns the function if it's native, else `undefined`.
  6686. */
  6687. function getNative(object, key) {
  6688. var value = getValue(object, key);
  6689. return baseIsNative(value) ? value : undefined;
  6690. }
  6691. /**
  6692. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6693. *
  6694. * @private
  6695. * @param {*} value The value to query.
  6696. * @returns {string} Returns the raw `toStringTag`.
  6697. */
  6698. function getRawTag(value) {
  6699. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6700. tag = value[symToStringTag];
  6701. try {
  6702. value[symToStringTag] = undefined;
  6703. var unmasked = true;
  6704. } catch (e) {}
  6705. var result = nativeObjectToString.call(value);
  6706. if (unmasked) {
  6707. if (isOwn) {
  6708. value[symToStringTag] = tag;
  6709. } else {
  6710. delete value[symToStringTag];
  6711. }
  6712. }
  6713. return result;
  6714. }
  6715. /**
  6716. * Creates an array of the own enumerable symbols of `object`.
  6717. *
  6718. * @private
  6719. * @param {Object} object The object to query.
  6720. * @returns {Array} Returns the array of symbols.
  6721. */
  6722. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6723. if (object == null) {
  6724. return [];
  6725. }
  6726. object = Object(object);
  6727. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6728. return propertyIsEnumerable.call(object, symbol);
  6729. });
  6730. };
  6731. /**
  6732. * Creates an array of the own and inherited 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 getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6739. var result = [];
  6740. while (object) {
  6741. arrayPush(result, getSymbols(object));
  6742. object = getPrototype(object);
  6743. }
  6744. return result;
  6745. };
  6746. /**
  6747. * Gets the `toStringTag` of `value`.
  6748. *
  6749. * @private
  6750. * @param {*} value The value to query.
  6751. * @returns {string} Returns the `toStringTag`.
  6752. */
  6753. var getTag = baseGetTag;
  6754. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6755. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6756. (Map && getTag(new Map) != mapTag) ||
  6757. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6758. (Set && getTag(new Set) != setTag) ||
  6759. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6760. getTag = function(value) {
  6761. var result = baseGetTag(value),
  6762. Ctor = result == objectTag ? value.constructor : undefined,
  6763. ctorString = Ctor ? toSource(Ctor) : '';
  6764. if (ctorString) {
  6765. switch (ctorString) {
  6766. case dataViewCtorString: return dataViewTag;
  6767. case mapCtorString: return mapTag;
  6768. case promiseCtorString: return promiseTag;
  6769. case setCtorString: return setTag;
  6770. case weakMapCtorString: return weakMapTag;
  6771. }
  6772. }
  6773. return result;
  6774. };
  6775. }
  6776. /**
  6777. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6778. *
  6779. * @private
  6780. * @param {number} start The start of the view.
  6781. * @param {number} end The end of the view.
  6782. * @param {Array} transforms The transformations to apply to the view.
  6783. * @returns {Object} Returns an object containing the `start` and `end`
  6784. * positions of the view.
  6785. */
  6786. function getView(start, end, transforms) {
  6787. var index = -1,
  6788. length = transforms.length;
  6789. while (++index < length) {
  6790. var data = transforms[index],
  6791. size = data.size;
  6792. switch (data.type) {
  6793. case 'drop': start += size; break;
  6794. case 'dropRight': end -= size; break;
  6795. case 'take': end = nativeMin(end, start + size); break;
  6796. case 'takeRight': start = nativeMax(start, end - size); break;
  6797. }
  6798. }
  6799. return { 'start': start, 'end': end };
  6800. }
  6801. /**
  6802. * Extracts wrapper details from the `source` body comment.
  6803. *
  6804. * @private
  6805. * @param {string} source The source to inspect.
  6806. * @returns {Array} Returns the wrapper details.
  6807. */
  6808. function getWrapDetails(source) {
  6809. var match = source.match(reWrapDetails);
  6810. return match ? match[1].split(reSplitDetails) : [];
  6811. }
  6812. /**
  6813. * Checks if `path` exists on `object`.
  6814. *
  6815. * @private
  6816. * @param {Object} object The object to query.
  6817. * @param {Array|string} path The path to check.
  6818. * @param {Function} hasFunc The function to check properties.
  6819. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6820. */
  6821. function hasPath(object, path, hasFunc) {
  6822. path = castPath(path, object);
  6823. var index = -1,
  6824. length = path.length,
  6825. result = false;
  6826. while (++index < length) {
  6827. var key = toKey(path[index]);
  6828. if (!(result = object != null && hasFunc(object, key))) {
  6829. break;
  6830. }
  6831. object = object[key];
  6832. }
  6833. if (result || ++index != length) {
  6834. return result;
  6835. }
  6836. length = object == null ? 0 : object.length;
  6837. return !!length && isLength(length) && isIndex(key, length) &&
  6838. (isArray(object) || isArguments(object));
  6839. }
  6840. /**
  6841. * Initializes an array clone.
  6842. *
  6843. * @private
  6844. * @param {Array} array The array to clone.
  6845. * @returns {Array} Returns the initialized clone.
  6846. */
  6847. function initCloneArray(array) {
  6848. var length = array.length,
  6849. result = new array.constructor(length);
  6850. // Add properties assigned by `RegExp#exec`.
  6851. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6852. result.index = array.index;
  6853. result.input = array.input;
  6854. }
  6855. return result;
  6856. }
  6857. /**
  6858. * Initializes an object clone.
  6859. *
  6860. * @private
  6861. * @param {Object} object The object to clone.
  6862. * @returns {Object} Returns the initialized clone.
  6863. */
  6864. function initCloneObject(object) {
  6865. return (typeof object.constructor == 'function' && !isPrototype(object))
  6866. ? baseCreate(getPrototype(object))
  6867. : {};
  6868. }
  6869. /**
  6870. * Initializes an object clone based on its `toStringTag`.
  6871. *
  6872. * **Note:** This function only supports cloning values with tags of
  6873. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6874. *
  6875. * @private
  6876. * @param {Object} object The object to clone.
  6877. * @param {string} tag The `toStringTag` of the object to clone.
  6878. * @param {boolean} [isDeep] Specify a deep clone.
  6879. * @returns {Object} Returns the initialized clone.
  6880. */
  6881. function initCloneByTag(object, tag, isDeep) {
  6882. var Ctor = object.constructor;
  6883. switch (tag) {
  6884. case arrayBufferTag:
  6885. return cloneArrayBuffer(object);
  6886. case boolTag:
  6887. case dateTag:
  6888. return new Ctor(+object);
  6889. case dataViewTag:
  6890. return cloneDataView(object, isDeep);
  6891. case float32Tag: case float64Tag:
  6892. case int8Tag: case int16Tag: case int32Tag:
  6893. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6894. return cloneTypedArray(object, isDeep);
  6895. case mapTag:
  6896. return new Ctor;
  6897. case numberTag:
  6898. case stringTag:
  6899. return new Ctor(object);
  6900. case regexpTag:
  6901. return cloneRegExp(object);
  6902. case setTag:
  6903. return new Ctor;
  6904. case symbolTag:
  6905. return cloneSymbol(object);
  6906. }
  6907. }
  6908. /**
  6909. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6910. *
  6911. * @private
  6912. * @param {string} source The source to modify.
  6913. * @returns {Array} details The details to insert.
  6914. * @returns {string} Returns the modified source.
  6915. */
  6916. function insertWrapDetails(source, details) {
  6917. var length = details.length;
  6918. if (!length) {
  6919. return source;
  6920. }
  6921. var lastIndex = length - 1;
  6922. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6923. details = details.join(length > 2 ? ', ' : ' ');
  6924. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6925. }
  6926. /**
  6927. * Checks if `value` is a flattenable `arguments` object or array.
  6928. *
  6929. * @private
  6930. * @param {*} value The value to check.
  6931. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6932. */
  6933. function isFlattenable(value) {
  6934. return isArray(value) || isArguments(value) ||
  6935. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6936. }
  6937. /**
  6938. * Checks if `value` is a valid array-like index.
  6939. *
  6940. * @private
  6941. * @param {*} value The value to check.
  6942. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6943. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6944. */
  6945. function isIndex(value, length) {
  6946. var type = typeof value;
  6947. length = length == null ? MAX_SAFE_INTEGER : length;
  6948. return !!length &&
  6949. (type == 'number' ||
  6950. (type != 'symbol' && reIsUint.test(value))) &&
  6951. (value > -1 && value % 1 == 0 && value < length);
  6952. }
  6953. /**
  6954. * Checks if the given arguments are from an iteratee call.
  6955. *
  6956. * @private
  6957. * @param {*} value The potential iteratee value argument.
  6958. * @param {*} index The potential iteratee index or key argument.
  6959. * @param {*} object The potential iteratee object argument.
  6960. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6961. * else `false`.
  6962. */
  6963. function isIterateeCall(value, index, object) {
  6964. if (!isObject(object)) {
  6965. return false;
  6966. }
  6967. var type = typeof index;
  6968. if (type == 'number'
  6969. ? (isArrayLike(object) && isIndex(index, object.length))
  6970. : (type == 'string' && index in object)
  6971. ) {
  6972. return eq(object[index], value);
  6973. }
  6974. return false;
  6975. }
  6976. /**
  6977. * Checks if `value` is a property name and not a property path.
  6978. *
  6979. * @private
  6980. * @param {*} value The value to check.
  6981. * @param {Object} [object] The object to query keys on.
  6982. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6983. */
  6984. function isKey(value, object) {
  6985. if (isArray(value)) {
  6986. return false;
  6987. }
  6988. var type = typeof value;
  6989. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6990. value == null || isSymbol(value)) {
  6991. return true;
  6992. }
  6993. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6994. (object != null && value in Object(object));
  6995. }
  6996. /**
  6997. * Checks if `value` is suitable for use as unique object key.
  6998. *
  6999. * @private
  7000. * @param {*} value The value to check.
  7001. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7002. */
  7003. function isKeyable(value) {
  7004. var type = typeof value;
  7005. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7006. ? (value !== '__proto__')
  7007. : (value === null);
  7008. }
  7009. /**
  7010. * Checks if `func` has a lazy counterpart.
  7011. *
  7012. * @private
  7013. * @param {Function} func The function to check.
  7014. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7015. * else `false`.
  7016. */
  7017. function isLaziable(func) {
  7018. var funcName = getFuncName(func),
  7019. other = lodash[funcName];
  7020. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7021. return false;
  7022. }
  7023. if (func === other) {
  7024. return true;
  7025. }
  7026. var data = getData(other);
  7027. return !!data && func === data[0];
  7028. }
  7029. /**
  7030. * Checks if `func` has its source masked.
  7031. *
  7032. * @private
  7033. * @param {Function} func The function to check.
  7034. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7035. */
  7036. function isMasked(func) {
  7037. return !!maskSrcKey && (maskSrcKey in func);
  7038. }
  7039. /**
  7040. * Checks if `func` is capable of being masked.
  7041. *
  7042. * @private
  7043. * @param {*} value The value to check.
  7044. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7045. */
  7046. var isMaskable = coreJsData ? isFunction : stubFalse;
  7047. /**
  7048. * Checks if `value` is likely a prototype object.
  7049. *
  7050. * @private
  7051. * @param {*} value The value to check.
  7052. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7053. */
  7054. function isPrototype(value) {
  7055. var Ctor = value && value.constructor,
  7056. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7057. return value === proto;
  7058. }
  7059. /**
  7060. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7061. *
  7062. * @private
  7063. * @param {*} value The value to check.
  7064. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7065. * equality comparisons, else `false`.
  7066. */
  7067. function isStrictComparable(value) {
  7068. return value === value && !isObject(value);
  7069. }
  7070. /**
  7071. * A specialized version of `matchesProperty` for source values suitable
  7072. * for strict equality comparisons, i.e. `===`.
  7073. *
  7074. * @private
  7075. * @param {string} key The key of the property to get.
  7076. * @param {*} srcValue The value to match.
  7077. * @returns {Function} Returns the new spec function.
  7078. */
  7079. function matchesStrictComparable(key, srcValue) {
  7080. return function(object) {
  7081. if (object == null) {
  7082. return false;
  7083. }
  7084. return object[key] === srcValue &&
  7085. (srcValue !== undefined || (key in Object(object)));
  7086. };
  7087. }
  7088. /**
  7089. * A specialized version of `_.memoize` which clears the memoized function's
  7090. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7091. *
  7092. * @private
  7093. * @param {Function} func The function to have its output memoized.
  7094. * @returns {Function} Returns the new memoized function.
  7095. */
  7096. function memoizeCapped(func) {
  7097. var result = memoize(func, function(key) {
  7098. if (cache.size === MAX_MEMOIZE_SIZE) {
  7099. cache.clear();
  7100. }
  7101. return key;
  7102. });
  7103. var cache = result.cache;
  7104. return result;
  7105. }
  7106. /**
  7107. * Merges the function metadata of `source` into `data`.
  7108. *
  7109. * Merging metadata reduces the number of wrappers used to invoke a function.
  7110. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7111. * may be applied regardless of execution order. Methods like `_.ary` and
  7112. * `_.rearg` modify function arguments, making the order in which they are
  7113. * executed important, preventing the merging of metadata. However, we make
  7114. * an exception for a safe combined case where curried functions have `_.ary`
  7115. * and or `_.rearg` applied.
  7116. *
  7117. * @private
  7118. * @param {Array} data The destination metadata.
  7119. * @param {Array} source The source metadata.
  7120. * @returns {Array} Returns `data`.
  7121. */
  7122. function mergeData(data, source) {
  7123. var bitmask = data[1],
  7124. srcBitmask = source[1],
  7125. newBitmask = bitmask | srcBitmask,
  7126. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7127. var isCombo =
  7128. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7129. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7130. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7131. // Exit early if metadata can't be merged.
  7132. if (!(isCommon || isCombo)) {
  7133. return data;
  7134. }
  7135. // Use source `thisArg` if available.
  7136. if (srcBitmask & WRAP_BIND_FLAG) {
  7137. data[2] = source[2];
  7138. // Set when currying a bound function.
  7139. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7140. }
  7141. // Compose partial arguments.
  7142. var value = source[3];
  7143. if (value) {
  7144. var partials = data[3];
  7145. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7146. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7147. }
  7148. // Compose partial right arguments.
  7149. value = source[5];
  7150. if (value) {
  7151. partials = data[5];
  7152. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7153. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7154. }
  7155. // Use source `argPos` if available.
  7156. value = source[7];
  7157. if (value) {
  7158. data[7] = value;
  7159. }
  7160. // Use source `ary` if it's smaller.
  7161. if (srcBitmask & WRAP_ARY_FLAG) {
  7162. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7163. }
  7164. // Use source `arity` if one is not provided.
  7165. if (data[9] == null) {
  7166. data[9] = source[9];
  7167. }
  7168. // Use source `func` and merge bitmasks.
  7169. data[0] = source[0];
  7170. data[1] = newBitmask;
  7171. return data;
  7172. }
  7173. /**
  7174. * This function is like
  7175. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7176. * except that it includes inherited enumerable properties.
  7177. *
  7178. * @private
  7179. * @param {Object} object The object to query.
  7180. * @returns {Array} Returns the array of property names.
  7181. */
  7182. function nativeKeysIn(object) {
  7183. var result = [];
  7184. if (object != null) {
  7185. for (var key in Object(object)) {
  7186. result.push(key);
  7187. }
  7188. }
  7189. return result;
  7190. }
  7191. /**
  7192. * Converts `value` to a string using `Object.prototype.toString`.
  7193. *
  7194. * @private
  7195. * @param {*} value The value to convert.
  7196. * @returns {string} Returns the converted string.
  7197. */
  7198. function objectToString(value) {
  7199. return nativeObjectToString.call(value);
  7200. }
  7201. /**
  7202. * A specialized version of `baseRest` which transforms the rest array.
  7203. *
  7204. * @private
  7205. * @param {Function} func The function to apply a rest parameter to.
  7206. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7207. * @param {Function} transform The rest array transform.
  7208. * @returns {Function} Returns the new function.
  7209. */
  7210. function overRest(func, start, transform) {
  7211. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7212. return function() {
  7213. var args = arguments,
  7214. index = -1,
  7215. length = nativeMax(args.length - start, 0),
  7216. array = Array(length);
  7217. while (++index < length) {
  7218. array[index] = args[start + index];
  7219. }
  7220. index = -1;
  7221. var otherArgs = Array(start + 1);
  7222. while (++index < start) {
  7223. otherArgs[index] = args[index];
  7224. }
  7225. otherArgs[start] = transform(array);
  7226. return apply(func, this, otherArgs);
  7227. };
  7228. }
  7229. /**
  7230. * Gets the parent value at `path` of `object`.
  7231. *
  7232. * @private
  7233. * @param {Object} object The object to query.
  7234. * @param {Array} path The path to get the parent value of.
  7235. * @returns {*} Returns the parent value.
  7236. */
  7237. function parent(object, path) {
  7238. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7239. }
  7240. /**
  7241. * Reorder `array` according to the specified indexes where the element at
  7242. * the first index is assigned as the first element, the element at
  7243. * the second index is assigned as the second element, and so on.
  7244. *
  7245. * @private
  7246. * @param {Array} array The array to reorder.
  7247. * @param {Array} indexes The arranged array indexes.
  7248. * @returns {Array} Returns `array`.
  7249. */
  7250. function reorder(array, indexes) {
  7251. var arrLength = array.length,
  7252. length = nativeMin(indexes.length, arrLength),
  7253. oldArray = copyArray(array);
  7254. while (length--) {
  7255. var index = indexes[length];
  7256. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7257. }
  7258. return array;
  7259. }
  7260. /**
  7261. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7262. *
  7263. * @private
  7264. * @param {Object} object The object to query.
  7265. * @param {string} key The key of the property to get.
  7266. * @returns {*} Returns the property value.
  7267. */
  7268. function safeGet(object, key) {
  7269. if (key === 'constructor' && typeof object[key] === 'function') {
  7270. return;
  7271. }
  7272. if (key == '__proto__') {
  7273. return;
  7274. }
  7275. return object[key];
  7276. }
  7277. /**
  7278. * Sets metadata for `func`.
  7279. *
  7280. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7281. * period of time, it will trip its breaker and transition to an identity
  7282. * function to avoid garbage collection pauses in V8. See
  7283. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7284. * for more details.
  7285. *
  7286. * @private
  7287. * @param {Function} func The function to associate metadata with.
  7288. * @param {*} data The metadata.
  7289. * @returns {Function} Returns `func`.
  7290. */
  7291. var setData = shortOut(baseSetData);
  7292. /**
  7293. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7294. *
  7295. * @private
  7296. * @param {Function} func The function to delay.
  7297. * @param {number} wait The number of milliseconds to delay invocation.
  7298. * @returns {number|Object} Returns the timer id or timeout object.
  7299. */
  7300. var setTimeout = ctxSetTimeout || function(func, wait) {
  7301. return root.setTimeout(func, wait);
  7302. };
  7303. /**
  7304. * Sets the `toString` method of `func` to return `string`.
  7305. *
  7306. * @private
  7307. * @param {Function} func The function to modify.
  7308. * @param {Function} string The `toString` result.
  7309. * @returns {Function} Returns `func`.
  7310. */
  7311. var setToString = shortOut(baseSetToString);
  7312. /**
  7313. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7314. * with wrapper details in a comment at the top of the source body.
  7315. *
  7316. * @private
  7317. * @param {Function} wrapper The function to modify.
  7318. * @param {Function} reference The reference function.
  7319. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7320. * @returns {Function} Returns `wrapper`.
  7321. */
  7322. function setWrapToString(wrapper, reference, bitmask) {
  7323. var source = (reference + '');
  7324. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7325. }
  7326. /**
  7327. * Creates a function that'll short out and invoke `identity` instead
  7328. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7329. * milliseconds.
  7330. *
  7331. * @private
  7332. * @param {Function} func The function to restrict.
  7333. * @returns {Function} Returns the new shortable function.
  7334. */
  7335. function shortOut(func) {
  7336. var count = 0,
  7337. lastCalled = 0;
  7338. return function() {
  7339. var stamp = nativeNow(),
  7340. remaining = HOT_SPAN - (stamp - lastCalled);
  7341. lastCalled = stamp;
  7342. if (remaining > 0) {
  7343. if (++count >= HOT_COUNT) {
  7344. return arguments[0];
  7345. }
  7346. } else {
  7347. count = 0;
  7348. }
  7349. return func.apply(undefined, arguments);
  7350. };
  7351. }
  7352. /**
  7353. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7354. *
  7355. * @private
  7356. * @param {Array} array The array to shuffle.
  7357. * @param {number} [size=array.length] The size of `array`.
  7358. * @returns {Array} Returns `array`.
  7359. */
  7360. function shuffleSelf(array, size) {
  7361. var index = -1,
  7362. length = array.length,
  7363. lastIndex = length - 1;
  7364. size = size === undefined ? length : size;
  7365. while (++index < size) {
  7366. var rand = baseRandom(index, lastIndex),
  7367. value = array[rand];
  7368. array[rand] = array[index];
  7369. array[index] = value;
  7370. }
  7371. array.length = size;
  7372. return array;
  7373. }
  7374. /**
  7375. * Converts `string` to a property path array.
  7376. *
  7377. * @private
  7378. * @param {string} string The string to convert.
  7379. * @returns {Array} Returns the property path array.
  7380. */
  7381. var stringToPath = memoizeCapped(function(string) {
  7382. var result = [];
  7383. if (string.charCodeAt(0) === 46 /* . */) {
  7384. result.push('');
  7385. }
  7386. string.replace(rePropName, function(match, number, quote, subString) {
  7387. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7388. });
  7389. return result;
  7390. });
  7391. /**
  7392. * Converts `value` to a string key if it's not a string or symbol.
  7393. *
  7394. * @private
  7395. * @param {*} value The value to inspect.
  7396. * @returns {string|symbol} Returns the key.
  7397. */
  7398. function toKey(value) {
  7399. if (typeof value == 'string' || isSymbol(value)) {
  7400. return value;
  7401. }
  7402. var result = (value + '');
  7403. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7404. }
  7405. /**
  7406. * Converts `func` to its source code.
  7407. *
  7408. * @private
  7409. * @param {Function} func The function to convert.
  7410. * @returns {string} Returns the source code.
  7411. */
  7412. function toSource(func) {
  7413. if (func != null) {
  7414. try {
  7415. return funcToString.call(func);
  7416. } catch (e) {}
  7417. try {
  7418. return (func + '');
  7419. } catch (e) {}
  7420. }
  7421. return '';
  7422. }
  7423. /**
  7424. * Updates wrapper `details` based on `bitmask` flags.
  7425. *
  7426. * @private
  7427. * @returns {Array} details The details to modify.
  7428. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7429. * @returns {Array} Returns `details`.
  7430. */
  7431. function updateWrapDetails(details, bitmask) {
  7432. arrayEach(wrapFlags, function(pair) {
  7433. var value = '_.' + pair[0];
  7434. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7435. details.push(value);
  7436. }
  7437. });
  7438. return details.sort();
  7439. }
  7440. /**
  7441. * Creates a clone of `wrapper`.
  7442. *
  7443. * @private
  7444. * @param {Object} wrapper The wrapper to clone.
  7445. * @returns {Object} Returns the cloned wrapper.
  7446. */
  7447. function wrapperClone(wrapper) {
  7448. if (wrapper instanceof LazyWrapper) {
  7449. return wrapper.clone();
  7450. }
  7451. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7452. result.__actions__ = copyArray(wrapper.__actions__);
  7453. result.__index__ = wrapper.__index__;
  7454. result.__values__ = wrapper.__values__;
  7455. return result;
  7456. }
  7457. /*------------------------------------------------------------------------*/
  7458. /**
  7459. * Creates an array of elements split into groups the length of `size`.
  7460. * If `array` can't be split evenly, the final chunk will be the remaining
  7461. * elements.
  7462. *
  7463. * @static
  7464. * @memberOf _
  7465. * @since 3.0.0
  7466. * @category Array
  7467. * @param {Array} array The array to process.
  7468. * @param {number} [size=1] The length of each chunk
  7469. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7470. * @returns {Array} Returns the new array of chunks.
  7471. * @example
  7472. *
  7473. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7474. * // => [['a', 'b'], ['c', 'd']]
  7475. *
  7476. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7477. * // => [['a', 'b', 'c'], ['d']]
  7478. */
  7479. function chunk(array, size, guard) {
  7480. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7481. size = 1;
  7482. } else {
  7483. size = nativeMax(toInteger(size), 0);
  7484. }
  7485. var length = array == null ? 0 : array.length;
  7486. if (!length || size < 1) {
  7487. return [];
  7488. }
  7489. var index = 0,
  7490. resIndex = 0,
  7491. result = Array(nativeCeil(length / size));
  7492. while (index < length) {
  7493. result[resIndex++] = baseSlice(array, index, (index += size));
  7494. }
  7495. return result;
  7496. }
  7497. /**
  7498. * Creates an array with all falsey values removed. The values `false`, `null`,
  7499. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7500. *
  7501. * @static
  7502. * @memberOf _
  7503. * @since 0.1.0
  7504. * @category Array
  7505. * @param {Array} array The array to compact.
  7506. * @returns {Array} Returns the new array of filtered values.
  7507. * @example
  7508. *
  7509. * _.compact([0, 1, false, 2, '', 3]);
  7510. * // => [1, 2, 3]
  7511. */
  7512. function compact(array) {
  7513. var index = -1,
  7514. length = array == null ? 0 : array.length,
  7515. resIndex = 0,
  7516. result = [];
  7517. while (++index < length) {
  7518. var value = array[index];
  7519. if (value) {
  7520. result[resIndex++] = value;
  7521. }
  7522. }
  7523. return result;
  7524. }
  7525. /**
  7526. * Creates a new array concatenating `array` with any additional arrays
  7527. * and/or values.
  7528. *
  7529. * @static
  7530. * @memberOf _
  7531. * @since 4.0.0
  7532. * @category Array
  7533. * @param {Array} array The array to concatenate.
  7534. * @param {...*} [values] The values to concatenate.
  7535. * @returns {Array} Returns the new concatenated array.
  7536. * @example
  7537. *
  7538. * var array = [1];
  7539. * var other = _.concat(array, 2, [3], [[4]]);
  7540. *
  7541. * console.log(other);
  7542. * // => [1, 2, 3, [4]]
  7543. *
  7544. * console.log(array);
  7545. * // => [1]
  7546. */
  7547. function concat() {
  7548. var length = arguments.length;
  7549. if (!length) {
  7550. return [];
  7551. }
  7552. var args = Array(length - 1),
  7553. array = arguments[0],
  7554. index = length;
  7555. while (index--) {
  7556. args[index - 1] = arguments[index];
  7557. }
  7558. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7559. }
  7560. /**
  7561. * Creates an array of `array` values not included in the other given arrays
  7562. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7563. * for equality comparisons. The order and references of result values are
  7564. * determined by the first array.
  7565. *
  7566. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7567. *
  7568. * @static
  7569. * @memberOf _
  7570. * @since 0.1.0
  7571. * @category Array
  7572. * @param {Array} array The array to inspect.
  7573. * @param {...Array} [values] The values to exclude.
  7574. * @returns {Array} Returns the new array of filtered values.
  7575. * @see _.without, _.xor
  7576. * @example
  7577. *
  7578. * _.difference([2, 1], [2, 3]);
  7579. * // => [1]
  7580. */
  7581. var difference = baseRest(function(array, values) {
  7582. return isArrayLikeObject(array)
  7583. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7584. : [];
  7585. });
  7586. /**
  7587. * This method is like `_.difference` except that it accepts `iteratee` which
  7588. * is invoked for each element of `array` and `values` to generate the criterion
  7589. * by which they're compared. The order and references of result values are
  7590. * determined by the first array. The iteratee is invoked with one argument:
  7591. * (value).
  7592. *
  7593. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7594. *
  7595. * @static
  7596. * @memberOf _
  7597. * @since 4.0.0
  7598. * @category Array
  7599. * @param {Array} array The array to inspect.
  7600. * @param {...Array} [values] The values to exclude.
  7601. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7602. * @returns {Array} Returns the new array of filtered values.
  7603. * @example
  7604. *
  7605. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7606. * // => [1.2]
  7607. *
  7608. * // The `_.property` iteratee shorthand.
  7609. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7610. * // => [{ 'x': 2 }]
  7611. */
  7612. var differenceBy = baseRest(function(array, values) {
  7613. var iteratee = last(values);
  7614. if (isArrayLikeObject(iteratee)) {
  7615. iteratee = undefined;
  7616. }
  7617. return isArrayLikeObject(array)
  7618. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7619. : [];
  7620. });
  7621. /**
  7622. * This method is like `_.difference` except that it accepts `comparator`
  7623. * which is invoked to compare elements of `array` to `values`. The order and
  7624. * references of result values are determined by the first array. The comparator
  7625. * is invoked with two arguments: (arrVal, othVal).
  7626. *
  7627. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7628. *
  7629. * @static
  7630. * @memberOf _
  7631. * @since 4.0.0
  7632. * @category Array
  7633. * @param {Array} array The array to inspect.
  7634. * @param {...Array} [values] The values to exclude.
  7635. * @param {Function} [comparator] The comparator invoked per element.
  7636. * @returns {Array} Returns the new array of filtered values.
  7637. * @example
  7638. *
  7639. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7640. *
  7641. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7642. * // => [{ 'x': 2, 'y': 1 }]
  7643. */
  7644. var differenceWith = baseRest(function(array, values) {
  7645. var comparator = last(values);
  7646. if (isArrayLikeObject(comparator)) {
  7647. comparator = undefined;
  7648. }
  7649. return isArrayLikeObject(array)
  7650. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7651. : [];
  7652. });
  7653. /**
  7654. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7655. *
  7656. * @static
  7657. * @memberOf _
  7658. * @since 0.5.0
  7659. * @category Array
  7660. * @param {Array} array The array to query.
  7661. * @param {number} [n=1] The number of elements to drop.
  7662. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7663. * @returns {Array} Returns the slice of `array`.
  7664. * @example
  7665. *
  7666. * _.drop([1, 2, 3]);
  7667. * // => [2, 3]
  7668. *
  7669. * _.drop([1, 2, 3], 2);
  7670. * // => [3]
  7671. *
  7672. * _.drop([1, 2, 3], 5);
  7673. * // => []
  7674. *
  7675. * _.drop([1, 2, 3], 0);
  7676. * // => [1, 2, 3]
  7677. */
  7678. function drop(array, n, guard) {
  7679. var length = array == null ? 0 : array.length;
  7680. if (!length) {
  7681. return [];
  7682. }
  7683. n = (guard || n === undefined) ? 1 : toInteger(n);
  7684. return baseSlice(array, n < 0 ? 0 : n, length);
  7685. }
  7686. /**
  7687. * Creates a slice of `array` with `n` elements dropped from the end.
  7688. *
  7689. * @static
  7690. * @memberOf _
  7691. * @since 3.0.0
  7692. * @category Array
  7693. * @param {Array} array The array to query.
  7694. * @param {number} [n=1] The number of elements to drop.
  7695. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7696. * @returns {Array} Returns the slice of `array`.
  7697. * @example
  7698. *
  7699. * _.dropRight([1, 2, 3]);
  7700. * // => [1, 2]
  7701. *
  7702. * _.dropRight([1, 2, 3], 2);
  7703. * // => [1]
  7704. *
  7705. * _.dropRight([1, 2, 3], 5);
  7706. * // => []
  7707. *
  7708. * _.dropRight([1, 2, 3], 0);
  7709. * // => [1, 2, 3]
  7710. */
  7711. function dropRight(array, n, guard) {
  7712. var length = array == null ? 0 : array.length;
  7713. if (!length) {
  7714. return [];
  7715. }
  7716. n = (guard || n === undefined) ? 1 : toInteger(n);
  7717. n = length - n;
  7718. return baseSlice(array, 0, n < 0 ? 0 : n);
  7719. }
  7720. /**
  7721. * Creates a slice of `array` excluding elements dropped from the end.
  7722. * Elements are dropped until `predicate` returns falsey. The predicate is
  7723. * invoked with three arguments: (value, index, array).
  7724. *
  7725. * @static
  7726. * @memberOf _
  7727. * @since 3.0.0
  7728. * @category Array
  7729. * @param {Array} array The array to query.
  7730. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7731. * @returns {Array} Returns the slice of `array`.
  7732. * @example
  7733. *
  7734. * var users = [
  7735. * { 'user': 'barney', 'active': true },
  7736. * { 'user': 'fred', 'active': false },
  7737. * { 'user': 'pebbles', 'active': false }
  7738. * ];
  7739. *
  7740. * _.dropRightWhile(users, function(o) { return !o.active; });
  7741. * // => objects for ['barney']
  7742. *
  7743. * // The `_.matches` iteratee shorthand.
  7744. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7745. * // => objects for ['barney', 'fred']
  7746. *
  7747. * // The `_.matchesProperty` iteratee shorthand.
  7748. * _.dropRightWhile(users, ['active', false]);
  7749. * // => objects for ['barney']
  7750. *
  7751. * // The `_.property` iteratee shorthand.
  7752. * _.dropRightWhile(users, 'active');
  7753. * // => objects for ['barney', 'fred', 'pebbles']
  7754. */
  7755. function dropRightWhile(array, predicate) {
  7756. return (array && array.length)
  7757. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7758. : [];
  7759. }
  7760. /**
  7761. * Creates a slice of `array` excluding elements dropped from the beginning.
  7762. * Elements are dropped until `predicate` returns falsey. The predicate is
  7763. * invoked with three arguments: (value, index, array).
  7764. *
  7765. * @static
  7766. * @memberOf _
  7767. * @since 3.0.0
  7768. * @category Array
  7769. * @param {Array} array The array to query.
  7770. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7771. * @returns {Array} Returns the slice of `array`.
  7772. * @example
  7773. *
  7774. * var users = [
  7775. * { 'user': 'barney', 'active': false },
  7776. * { 'user': 'fred', 'active': false },
  7777. * { 'user': 'pebbles', 'active': true }
  7778. * ];
  7779. *
  7780. * _.dropWhile(users, function(o) { return !o.active; });
  7781. * // => objects for ['pebbles']
  7782. *
  7783. * // The `_.matches` iteratee shorthand.
  7784. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7785. * // => objects for ['fred', 'pebbles']
  7786. *
  7787. * // The `_.matchesProperty` iteratee shorthand.
  7788. * _.dropWhile(users, ['active', false]);
  7789. * // => objects for ['pebbles']
  7790. *
  7791. * // The `_.property` iteratee shorthand.
  7792. * _.dropWhile(users, 'active');
  7793. * // => objects for ['barney', 'fred', 'pebbles']
  7794. */
  7795. function dropWhile(array, predicate) {
  7796. return (array && array.length)
  7797. ? baseWhile(array, getIteratee(predicate, 3), true)
  7798. : [];
  7799. }
  7800. /**
  7801. * Fills elements of `array` with `value` from `start` up to, but not
  7802. * including, `end`.
  7803. *
  7804. * **Note:** This method mutates `array`.
  7805. *
  7806. * @static
  7807. * @memberOf _
  7808. * @since 3.2.0
  7809. * @category Array
  7810. * @param {Array} array The array to fill.
  7811. * @param {*} value The value to fill `array` with.
  7812. * @param {number} [start=0] The start position.
  7813. * @param {number} [end=array.length] The end position.
  7814. * @returns {Array} Returns `array`.
  7815. * @example
  7816. *
  7817. * var array = [1, 2, 3];
  7818. *
  7819. * _.fill(array, 'a');
  7820. * console.log(array);
  7821. * // => ['a', 'a', 'a']
  7822. *
  7823. * _.fill(Array(3), 2);
  7824. * // => [2, 2, 2]
  7825. *
  7826. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7827. * // => [4, '*', '*', 10]
  7828. */
  7829. function fill(array, value, start, end) {
  7830. var length = array == null ? 0 : array.length;
  7831. if (!length) {
  7832. return [];
  7833. }
  7834. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7835. start = 0;
  7836. end = length;
  7837. }
  7838. return baseFill(array, value, start, end);
  7839. }
  7840. /**
  7841. * This method is like `_.find` except that it returns the index of the first
  7842. * element `predicate` returns truthy for instead of the element itself.
  7843. *
  7844. * @static
  7845. * @memberOf _
  7846. * @since 1.1.0
  7847. * @category Array
  7848. * @param {Array} array The array to inspect.
  7849. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7850. * @param {number} [fromIndex=0] The index to search from.
  7851. * @returns {number} Returns the index of the found element, else `-1`.
  7852. * @example
  7853. *
  7854. * var users = [
  7855. * { 'user': 'barney', 'active': false },
  7856. * { 'user': 'fred', 'active': false },
  7857. * { 'user': 'pebbles', 'active': true }
  7858. * ];
  7859. *
  7860. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7861. * // => 0
  7862. *
  7863. * // The `_.matches` iteratee shorthand.
  7864. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7865. * // => 1
  7866. *
  7867. * // The `_.matchesProperty` iteratee shorthand.
  7868. * _.findIndex(users, ['active', false]);
  7869. * // => 0
  7870. *
  7871. * // The `_.property` iteratee shorthand.
  7872. * _.findIndex(users, 'active');
  7873. * // => 2
  7874. */
  7875. function findIndex(array, predicate, fromIndex) {
  7876. var length = array == null ? 0 : array.length;
  7877. if (!length) {
  7878. return -1;
  7879. }
  7880. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7881. if (index < 0) {
  7882. index = nativeMax(length + index, 0);
  7883. }
  7884. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7885. }
  7886. /**
  7887. * This method is like `_.findIndex` except that it iterates over elements
  7888. * of `collection` from right to left.
  7889. *
  7890. * @static
  7891. * @memberOf _
  7892. * @since 2.0.0
  7893. * @category Array
  7894. * @param {Array} array The array to inspect.
  7895. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7896. * @param {number} [fromIndex=array.length-1] The index to search from.
  7897. * @returns {number} Returns the index of the found element, else `-1`.
  7898. * @example
  7899. *
  7900. * var users = [
  7901. * { 'user': 'barney', 'active': true },
  7902. * { 'user': 'fred', 'active': false },
  7903. * { 'user': 'pebbles', 'active': false }
  7904. * ];
  7905. *
  7906. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7907. * // => 2
  7908. *
  7909. * // The `_.matches` iteratee shorthand.
  7910. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7911. * // => 0
  7912. *
  7913. * // The `_.matchesProperty` iteratee shorthand.
  7914. * _.findLastIndex(users, ['active', false]);
  7915. * // => 2
  7916. *
  7917. * // The `_.property` iteratee shorthand.
  7918. * _.findLastIndex(users, 'active');
  7919. * // => 0
  7920. */
  7921. function findLastIndex(array, predicate, fromIndex) {
  7922. var length = array == null ? 0 : array.length;
  7923. if (!length) {
  7924. return -1;
  7925. }
  7926. var index = length - 1;
  7927. if (fromIndex !== undefined) {
  7928. index = toInteger(fromIndex);
  7929. index = fromIndex < 0
  7930. ? nativeMax(length + index, 0)
  7931. : nativeMin(index, length - 1);
  7932. }
  7933. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7934. }
  7935. /**
  7936. * Flattens `array` a single level deep.
  7937. *
  7938. * @static
  7939. * @memberOf _
  7940. * @since 0.1.0
  7941. * @category Array
  7942. * @param {Array} array The array to flatten.
  7943. * @returns {Array} Returns the new flattened array.
  7944. * @example
  7945. *
  7946. * _.flatten([1, [2, [3, [4]], 5]]);
  7947. * // => [1, 2, [3, [4]], 5]
  7948. */
  7949. function flatten(array) {
  7950. var length = array == null ? 0 : array.length;
  7951. return length ? baseFlatten(array, 1) : [];
  7952. }
  7953. /**
  7954. * Recursively flattens `array`.
  7955. *
  7956. * @static
  7957. * @memberOf _
  7958. * @since 3.0.0
  7959. * @category Array
  7960. * @param {Array} array The array to flatten.
  7961. * @returns {Array} Returns the new flattened array.
  7962. * @example
  7963. *
  7964. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7965. * // => [1, 2, 3, 4, 5]
  7966. */
  7967. function flattenDeep(array) {
  7968. var length = array == null ? 0 : array.length;
  7969. return length ? baseFlatten(array, INFINITY) : [];
  7970. }
  7971. /**
  7972. * Recursively flatten `array` up to `depth` times.
  7973. *
  7974. * @static
  7975. * @memberOf _
  7976. * @since 4.4.0
  7977. * @category Array
  7978. * @param {Array} array The array to flatten.
  7979. * @param {number} [depth=1] The maximum recursion depth.
  7980. * @returns {Array} Returns the new flattened array.
  7981. * @example
  7982. *
  7983. * var array = [1, [2, [3, [4]], 5]];
  7984. *
  7985. * _.flattenDepth(array, 1);
  7986. * // => [1, 2, [3, [4]], 5]
  7987. *
  7988. * _.flattenDepth(array, 2);
  7989. * // => [1, 2, 3, [4], 5]
  7990. */
  7991. function flattenDepth(array, depth) {
  7992. var length = array == null ? 0 : array.length;
  7993. if (!length) {
  7994. return [];
  7995. }
  7996. depth = depth === undefined ? 1 : toInteger(depth);
  7997. return baseFlatten(array, depth);
  7998. }
  7999. /**
  8000. * The inverse of `_.toPairs`; this method returns an object composed
  8001. * from key-value `pairs`.
  8002. *
  8003. * @static
  8004. * @memberOf _
  8005. * @since 4.0.0
  8006. * @category Array
  8007. * @param {Array} pairs The key-value pairs.
  8008. * @returns {Object} Returns the new object.
  8009. * @example
  8010. *
  8011. * _.fromPairs([['a', 1], ['b', 2]]);
  8012. * // => { 'a': 1, 'b': 2 }
  8013. */
  8014. function fromPairs(pairs) {
  8015. var index = -1,
  8016. length = pairs == null ? 0 : pairs.length,
  8017. result = {};
  8018. while (++index < length) {
  8019. var pair = pairs[index];
  8020. result[pair[0]] = pair[1];
  8021. }
  8022. return result;
  8023. }
  8024. /**
  8025. * Gets the first element of `array`.
  8026. *
  8027. * @static
  8028. * @memberOf _
  8029. * @since 0.1.0
  8030. * @alias first
  8031. * @category Array
  8032. * @param {Array} array The array to query.
  8033. * @returns {*} Returns the first element of `array`.
  8034. * @example
  8035. *
  8036. * _.head([1, 2, 3]);
  8037. * // => 1
  8038. *
  8039. * _.head([]);
  8040. * // => undefined
  8041. */
  8042. function head(array) {
  8043. return (array && array.length) ? array[0] : undefined;
  8044. }
  8045. /**
  8046. * Gets the index at which the first occurrence of `value` is found in `array`
  8047. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8048. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8049. * offset from the end of `array`.
  8050. *
  8051. * @static
  8052. * @memberOf _
  8053. * @since 0.1.0
  8054. * @category Array
  8055. * @param {Array} array The array to inspect.
  8056. * @param {*} value The value to search for.
  8057. * @param {number} [fromIndex=0] The index to search from.
  8058. * @returns {number} Returns the index of the matched value, else `-1`.
  8059. * @example
  8060. *
  8061. * _.indexOf([1, 2, 1, 2], 2);
  8062. * // => 1
  8063. *
  8064. * // Search from the `fromIndex`.
  8065. * _.indexOf([1, 2, 1, 2], 2, 2);
  8066. * // => 3
  8067. */
  8068. function indexOf(array, value, fromIndex) {
  8069. var length = array == null ? 0 : array.length;
  8070. if (!length) {
  8071. return -1;
  8072. }
  8073. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8074. if (index < 0) {
  8075. index = nativeMax(length + index, 0);
  8076. }
  8077. return baseIndexOf(array, value, index);
  8078. }
  8079. /**
  8080. * Gets all but the last element of `array`.
  8081. *
  8082. * @static
  8083. * @memberOf _
  8084. * @since 0.1.0
  8085. * @category Array
  8086. * @param {Array} array The array to query.
  8087. * @returns {Array} Returns the slice of `array`.
  8088. * @example
  8089. *
  8090. * _.initial([1, 2, 3]);
  8091. * // => [1, 2]
  8092. */
  8093. function initial(array) {
  8094. var length = array == null ? 0 : array.length;
  8095. return length ? baseSlice(array, 0, -1) : [];
  8096. }
  8097. /**
  8098. * Creates an array of unique values that are included in all given arrays
  8099. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8100. * for equality comparisons. The order and references of result values are
  8101. * determined by the first array.
  8102. *
  8103. * @static
  8104. * @memberOf _
  8105. * @since 0.1.0
  8106. * @category Array
  8107. * @param {...Array} [arrays] The arrays to inspect.
  8108. * @returns {Array} Returns the new array of intersecting values.
  8109. * @example
  8110. *
  8111. * _.intersection([2, 1], [2, 3]);
  8112. * // => [2]
  8113. */
  8114. var intersection = baseRest(function(arrays) {
  8115. var mapped = arrayMap(arrays, castArrayLikeObject);
  8116. return (mapped.length && mapped[0] === arrays[0])
  8117. ? baseIntersection(mapped)
  8118. : [];
  8119. });
  8120. /**
  8121. * This method is like `_.intersection` except that it accepts `iteratee`
  8122. * which is invoked for each element of each `arrays` to generate the criterion
  8123. * by which they're compared. The order and references of result values are
  8124. * determined by the first array. The iteratee is invoked with one argument:
  8125. * (value).
  8126. *
  8127. * @static
  8128. * @memberOf _
  8129. * @since 4.0.0
  8130. * @category Array
  8131. * @param {...Array} [arrays] The arrays to inspect.
  8132. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8133. * @returns {Array} Returns the new array of intersecting values.
  8134. * @example
  8135. *
  8136. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8137. * // => [2.1]
  8138. *
  8139. * // The `_.property` iteratee shorthand.
  8140. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8141. * // => [{ 'x': 1 }]
  8142. */
  8143. var intersectionBy = baseRest(function(arrays) {
  8144. var iteratee = last(arrays),
  8145. mapped = arrayMap(arrays, castArrayLikeObject);
  8146. if (iteratee === last(mapped)) {
  8147. iteratee = undefined;
  8148. } else {
  8149. mapped.pop();
  8150. }
  8151. return (mapped.length && mapped[0] === arrays[0])
  8152. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8153. : [];
  8154. });
  8155. /**
  8156. * This method is like `_.intersection` except that it accepts `comparator`
  8157. * which is invoked to compare elements of `arrays`. The order and references
  8158. * of result values are determined by the first array. The comparator is
  8159. * invoked with two arguments: (arrVal, othVal).
  8160. *
  8161. * @static
  8162. * @memberOf _
  8163. * @since 4.0.0
  8164. * @category Array
  8165. * @param {...Array} [arrays] The arrays to inspect.
  8166. * @param {Function} [comparator] The comparator invoked per element.
  8167. * @returns {Array} Returns the new array of intersecting values.
  8168. * @example
  8169. *
  8170. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8171. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8172. *
  8173. * _.intersectionWith(objects, others, _.isEqual);
  8174. * // => [{ 'x': 1, 'y': 2 }]
  8175. */
  8176. var intersectionWith = baseRest(function(arrays) {
  8177. var comparator = last(arrays),
  8178. mapped = arrayMap(arrays, castArrayLikeObject);
  8179. comparator = typeof comparator == 'function' ? comparator : undefined;
  8180. if (comparator) {
  8181. mapped.pop();
  8182. }
  8183. return (mapped.length && mapped[0] === arrays[0])
  8184. ? baseIntersection(mapped, undefined, comparator)
  8185. : [];
  8186. });
  8187. /**
  8188. * Converts all elements in `array` into a string separated by `separator`.
  8189. *
  8190. * @static
  8191. * @memberOf _
  8192. * @since 4.0.0
  8193. * @category Array
  8194. * @param {Array} array The array to convert.
  8195. * @param {string} [separator=','] The element separator.
  8196. * @returns {string} Returns the joined string.
  8197. * @example
  8198. *
  8199. * _.join(['a', 'b', 'c'], '~');
  8200. * // => 'a~b~c'
  8201. */
  8202. function join(array, separator) {
  8203. return array == null ? '' : nativeJoin.call(array, separator);
  8204. }
  8205. /**
  8206. * Gets the last element of `array`.
  8207. *
  8208. * @static
  8209. * @memberOf _
  8210. * @since 0.1.0
  8211. * @category Array
  8212. * @param {Array} array The array to query.
  8213. * @returns {*} Returns the last element of `array`.
  8214. * @example
  8215. *
  8216. * _.last([1, 2, 3]);
  8217. * // => 3
  8218. */
  8219. function last(array) {
  8220. var length = array == null ? 0 : array.length;
  8221. return length ? array[length - 1] : undefined;
  8222. }
  8223. /**
  8224. * This method is like `_.indexOf` except that it iterates over elements of
  8225. * `array` from right to left.
  8226. *
  8227. * @static
  8228. * @memberOf _
  8229. * @since 0.1.0
  8230. * @category Array
  8231. * @param {Array} array The array to inspect.
  8232. * @param {*} value The value to search for.
  8233. * @param {number} [fromIndex=array.length-1] The index to search from.
  8234. * @returns {number} Returns the index of the matched value, else `-1`.
  8235. * @example
  8236. *
  8237. * _.lastIndexOf([1, 2, 1, 2], 2);
  8238. * // => 3
  8239. *
  8240. * // Search from the `fromIndex`.
  8241. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8242. * // => 1
  8243. */
  8244. function lastIndexOf(array, value, fromIndex) {
  8245. var length = array == null ? 0 : array.length;
  8246. if (!length) {
  8247. return -1;
  8248. }
  8249. var index = length;
  8250. if (fromIndex !== undefined) {
  8251. index = toInteger(fromIndex);
  8252. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8253. }
  8254. return value === value
  8255. ? strictLastIndexOf(array, value, index)
  8256. : baseFindIndex(array, baseIsNaN, index, true);
  8257. }
  8258. /**
  8259. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8260. * element from the end is returned.
  8261. *
  8262. * @static
  8263. * @memberOf _
  8264. * @since 4.11.0
  8265. * @category Array
  8266. * @param {Array} array The array to query.
  8267. * @param {number} [n=0] The index of the element to return.
  8268. * @returns {*} Returns the nth element of `array`.
  8269. * @example
  8270. *
  8271. * var array = ['a', 'b', 'c', 'd'];
  8272. *
  8273. * _.nth(array, 1);
  8274. * // => 'b'
  8275. *
  8276. * _.nth(array, -2);
  8277. * // => 'c';
  8278. */
  8279. function nth(array, n) {
  8280. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8281. }
  8282. /**
  8283. * Removes all given values from `array` using
  8284. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8285. * for equality comparisons.
  8286. *
  8287. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8288. * to remove elements from an array by predicate.
  8289. *
  8290. * @static
  8291. * @memberOf _
  8292. * @since 2.0.0
  8293. * @category Array
  8294. * @param {Array} array The array to modify.
  8295. * @param {...*} [values] The values to remove.
  8296. * @returns {Array} Returns `array`.
  8297. * @example
  8298. *
  8299. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8300. *
  8301. * _.pull(array, 'a', 'c');
  8302. * console.log(array);
  8303. * // => ['b', 'b']
  8304. */
  8305. var pull = baseRest(pullAll);
  8306. /**
  8307. * This method is like `_.pull` except that it accepts an array of values to remove.
  8308. *
  8309. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8310. *
  8311. * @static
  8312. * @memberOf _
  8313. * @since 4.0.0
  8314. * @category Array
  8315. * @param {Array} array The array to modify.
  8316. * @param {Array} values The values to remove.
  8317. * @returns {Array} Returns `array`.
  8318. * @example
  8319. *
  8320. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8321. *
  8322. * _.pullAll(array, ['a', 'c']);
  8323. * console.log(array);
  8324. * // => ['b', 'b']
  8325. */
  8326. function pullAll(array, values) {
  8327. return (array && array.length && values && values.length)
  8328. ? basePullAll(array, values)
  8329. : array;
  8330. }
  8331. /**
  8332. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8333. * invoked for each element of `array` and `values` to generate the criterion
  8334. * by which they're compared. The iteratee is invoked with one argument: (value).
  8335. *
  8336. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8337. *
  8338. * @static
  8339. * @memberOf _
  8340. * @since 4.0.0
  8341. * @category Array
  8342. * @param {Array} array The array to modify.
  8343. * @param {Array} values The values to remove.
  8344. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8345. * @returns {Array} Returns `array`.
  8346. * @example
  8347. *
  8348. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8349. *
  8350. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8351. * console.log(array);
  8352. * // => [{ 'x': 2 }]
  8353. */
  8354. function pullAllBy(array, values, iteratee) {
  8355. return (array && array.length && values && values.length)
  8356. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8357. : array;
  8358. }
  8359. /**
  8360. * This method is like `_.pullAll` except that it accepts `comparator` which
  8361. * is invoked to compare elements of `array` to `values`. The comparator is
  8362. * invoked with two arguments: (arrVal, othVal).
  8363. *
  8364. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8365. *
  8366. * @static
  8367. * @memberOf _
  8368. * @since 4.6.0
  8369. * @category Array
  8370. * @param {Array} array The array to modify.
  8371. * @param {Array} values The values to remove.
  8372. * @param {Function} [comparator] The comparator invoked per element.
  8373. * @returns {Array} Returns `array`.
  8374. * @example
  8375. *
  8376. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8377. *
  8378. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8379. * console.log(array);
  8380. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8381. */
  8382. function pullAllWith(array, values, comparator) {
  8383. return (array && array.length && values && values.length)
  8384. ? basePullAll(array, values, undefined, comparator)
  8385. : array;
  8386. }
  8387. /**
  8388. * Removes elements from `array` corresponding to `indexes` and returns an
  8389. * array of removed elements.
  8390. *
  8391. * **Note:** Unlike `_.at`, this method mutates `array`.
  8392. *
  8393. * @static
  8394. * @memberOf _
  8395. * @since 3.0.0
  8396. * @category Array
  8397. * @param {Array} array The array to modify.
  8398. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8399. * @returns {Array} Returns the new array of removed elements.
  8400. * @example
  8401. *
  8402. * var array = ['a', 'b', 'c', 'd'];
  8403. * var pulled = _.pullAt(array, [1, 3]);
  8404. *
  8405. * console.log(array);
  8406. * // => ['a', 'c']
  8407. *
  8408. * console.log(pulled);
  8409. * // => ['b', 'd']
  8410. */
  8411. var pullAt = flatRest(function(array, indexes) {
  8412. var length = array == null ? 0 : array.length,
  8413. result = baseAt(array, indexes);
  8414. basePullAt(array, arrayMap(indexes, function(index) {
  8415. return isIndex(index, length) ? +index : index;
  8416. }).sort(compareAscending));
  8417. return result;
  8418. });
  8419. /**
  8420. * Removes all elements from `array` that `predicate` returns truthy for
  8421. * and returns an array of the removed elements. The predicate is invoked
  8422. * with three arguments: (value, index, array).
  8423. *
  8424. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8425. * to pull elements from an array by value.
  8426. *
  8427. * @static
  8428. * @memberOf _
  8429. * @since 2.0.0
  8430. * @category Array
  8431. * @param {Array} array The array to modify.
  8432. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8433. * @returns {Array} Returns the new array of removed elements.
  8434. * @example
  8435. *
  8436. * var array = [1, 2, 3, 4];
  8437. * var evens = _.remove(array, function(n) {
  8438. * return n % 2 == 0;
  8439. * });
  8440. *
  8441. * console.log(array);
  8442. * // => [1, 3]
  8443. *
  8444. * console.log(evens);
  8445. * // => [2, 4]
  8446. */
  8447. function remove(array, predicate) {
  8448. var result = [];
  8449. if (!(array && array.length)) {
  8450. return result;
  8451. }
  8452. var index = -1,
  8453. indexes = [],
  8454. length = array.length;
  8455. predicate = getIteratee(predicate, 3);
  8456. while (++index < length) {
  8457. var value = array[index];
  8458. if (predicate(value, index, array)) {
  8459. result.push(value);
  8460. indexes.push(index);
  8461. }
  8462. }
  8463. basePullAt(array, indexes);
  8464. return result;
  8465. }
  8466. /**
  8467. * Reverses `array` so that the first element becomes the last, the second
  8468. * element becomes the second to last, and so on.
  8469. *
  8470. * **Note:** This method mutates `array` and is based on
  8471. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8472. *
  8473. * @static
  8474. * @memberOf _
  8475. * @since 4.0.0
  8476. * @category Array
  8477. * @param {Array} array The array to modify.
  8478. * @returns {Array} Returns `array`.
  8479. * @example
  8480. *
  8481. * var array = [1, 2, 3];
  8482. *
  8483. * _.reverse(array);
  8484. * // => [3, 2, 1]
  8485. *
  8486. * console.log(array);
  8487. * // => [3, 2, 1]
  8488. */
  8489. function reverse(array) {
  8490. return array == null ? array : nativeReverse.call(array);
  8491. }
  8492. /**
  8493. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8494. *
  8495. * **Note:** This method is used instead of
  8496. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8497. * returned.
  8498. *
  8499. * @static
  8500. * @memberOf _
  8501. * @since 3.0.0
  8502. * @category Array
  8503. * @param {Array} array The array to slice.
  8504. * @param {number} [start=0] The start position.
  8505. * @param {number} [end=array.length] The end position.
  8506. * @returns {Array} Returns the slice of `array`.
  8507. */
  8508. function slice(array, start, end) {
  8509. var length = array == null ? 0 : array.length;
  8510. if (!length) {
  8511. return [];
  8512. }
  8513. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8514. start = 0;
  8515. end = length;
  8516. }
  8517. else {
  8518. start = start == null ? 0 : toInteger(start);
  8519. end = end === undefined ? length : toInteger(end);
  8520. }
  8521. return baseSlice(array, start, end);
  8522. }
  8523. /**
  8524. * Uses a binary search to determine the lowest index at which `value`
  8525. * should be inserted into `array` in order to maintain its sort order.
  8526. *
  8527. * @static
  8528. * @memberOf _
  8529. * @since 0.1.0
  8530. * @category Array
  8531. * @param {Array} array The sorted array to inspect.
  8532. * @param {*} value The value to evaluate.
  8533. * @returns {number} Returns the index at which `value` should be inserted
  8534. * into `array`.
  8535. * @example
  8536. *
  8537. * _.sortedIndex([30, 50], 40);
  8538. * // => 1
  8539. */
  8540. function sortedIndex(array, value) {
  8541. return baseSortedIndex(array, value);
  8542. }
  8543. /**
  8544. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8545. * which is invoked for `value` and each element of `array` to compute their
  8546. * sort ranking. The iteratee is invoked with one argument: (value).
  8547. *
  8548. * @static
  8549. * @memberOf _
  8550. * @since 4.0.0
  8551. * @category Array
  8552. * @param {Array} array The sorted array to inspect.
  8553. * @param {*} value The value to evaluate.
  8554. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8555. * @returns {number} Returns the index at which `value` should be inserted
  8556. * into `array`.
  8557. * @example
  8558. *
  8559. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8560. *
  8561. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8562. * // => 0
  8563. *
  8564. * // The `_.property` iteratee shorthand.
  8565. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8566. * // => 0
  8567. */
  8568. function sortedIndexBy(array, value, iteratee) {
  8569. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8570. }
  8571. /**
  8572. * This method is like `_.indexOf` except that it performs a binary
  8573. * search on a sorted `array`.
  8574. *
  8575. * @static
  8576. * @memberOf _
  8577. * @since 4.0.0
  8578. * @category Array
  8579. * @param {Array} array The array to inspect.
  8580. * @param {*} value The value to search for.
  8581. * @returns {number} Returns the index of the matched value, else `-1`.
  8582. * @example
  8583. *
  8584. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8585. * // => 1
  8586. */
  8587. function sortedIndexOf(array, value) {
  8588. var length = array == null ? 0 : array.length;
  8589. if (length) {
  8590. var index = baseSortedIndex(array, value);
  8591. if (index < length && eq(array[index], value)) {
  8592. return index;
  8593. }
  8594. }
  8595. return -1;
  8596. }
  8597. /**
  8598. * This method is like `_.sortedIndex` except that it returns the highest
  8599. * index at which `value` should be inserted into `array` in order to
  8600. * maintain its sort order.
  8601. *
  8602. * @static
  8603. * @memberOf _
  8604. * @since 3.0.0
  8605. * @category Array
  8606. * @param {Array} array The sorted array to inspect.
  8607. * @param {*} value The value to evaluate.
  8608. * @returns {number} Returns the index at which `value` should be inserted
  8609. * into `array`.
  8610. * @example
  8611. *
  8612. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8613. * // => 4
  8614. */
  8615. function sortedLastIndex(array, value) {
  8616. return baseSortedIndex(array, value, true);
  8617. }
  8618. /**
  8619. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8620. * which is invoked for `value` and each element of `array` to compute their
  8621. * sort ranking. The iteratee is invoked with one argument: (value).
  8622. *
  8623. * @static
  8624. * @memberOf _
  8625. * @since 4.0.0
  8626. * @category Array
  8627. * @param {Array} array The sorted array to inspect.
  8628. * @param {*} value The value to evaluate.
  8629. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8630. * @returns {number} Returns the index at which `value` should be inserted
  8631. * into `array`.
  8632. * @example
  8633. *
  8634. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8635. *
  8636. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8637. * // => 1
  8638. *
  8639. * // The `_.property` iteratee shorthand.
  8640. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8641. * // => 1
  8642. */
  8643. function sortedLastIndexBy(array, value, iteratee) {
  8644. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8645. }
  8646. /**
  8647. * This method is like `_.lastIndexOf` except that it performs a binary
  8648. * search on a sorted `array`.
  8649. *
  8650. * @static
  8651. * @memberOf _
  8652. * @since 4.0.0
  8653. * @category Array
  8654. * @param {Array} array The array to inspect.
  8655. * @param {*} value The value to search for.
  8656. * @returns {number} Returns the index of the matched value, else `-1`.
  8657. * @example
  8658. *
  8659. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8660. * // => 3
  8661. */
  8662. function sortedLastIndexOf(array, value) {
  8663. var length = array == null ? 0 : array.length;
  8664. if (length) {
  8665. var index = baseSortedIndex(array, value, true) - 1;
  8666. if (eq(array[index], value)) {
  8667. return index;
  8668. }
  8669. }
  8670. return -1;
  8671. }
  8672. /**
  8673. * This method is like `_.uniq` except that it's designed and optimized
  8674. * for sorted arrays.
  8675. *
  8676. * @static
  8677. * @memberOf _
  8678. * @since 4.0.0
  8679. * @category Array
  8680. * @param {Array} array The array to inspect.
  8681. * @returns {Array} Returns the new duplicate free array.
  8682. * @example
  8683. *
  8684. * _.sortedUniq([1, 1, 2]);
  8685. * // => [1, 2]
  8686. */
  8687. function sortedUniq(array) {
  8688. return (array && array.length)
  8689. ? baseSortedUniq(array)
  8690. : [];
  8691. }
  8692. /**
  8693. * This method is like `_.uniqBy` except that it's designed and optimized
  8694. * for sorted arrays.
  8695. *
  8696. * @static
  8697. * @memberOf _
  8698. * @since 4.0.0
  8699. * @category Array
  8700. * @param {Array} array The array to inspect.
  8701. * @param {Function} [iteratee] The iteratee invoked per element.
  8702. * @returns {Array} Returns the new duplicate free array.
  8703. * @example
  8704. *
  8705. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8706. * // => [1.1, 2.3]
  8707. */
  8708. function sortedUniqBy(array, iteratee) {
  8709. return (array && array.length)
  8710. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8711. : [];
  8712. }
  8713. /**
  8714. * Gets all but the first element of `array`.
  8715. *
  8716. * @static
  8717. * @memberOf _
  8718. * @since 4.0.0
  8719. * @category Array
  8720. * @param {Array} array The array to query.
  8721. * @returns {Array} Returns the slice of `array`.
  8722. * @example
  8723. *
  8724. * _.tail([1, 2, 3]);
  8725. * // => [2, 3]
  8726. */
  8727. function tail(array) {
  8728. var length = array == null ? 0 : array.length;
  8729. return length ? baseSlice(array, 1, length) : [];
  8730. }
  8731. /**
  8732. * Creates a slice of `array` with `n` elements taken from the beginning.
  8733. *
  8734. * @static
  8735. * @memberOf _
  8736. * @since 0.1.0
  8737. * @category Array
  8738. * @param {Array} array The array to query.
  8739. * @param {number} [n=1] The number of elements to take.
  8740. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8741. * @returns {Array} Returns the slice of `array`.
  8742. * @example
  8743. *
  8744. * _.take([1, 2, 3]);
  8745. * // => [1]
  8746. *
  8747. * _.take([1, 2, 3], 2);
  8748. * // => [1, 2]
  8749. *
  8750. * _.take([1, 2, 3], 5);
  8751. * // => [1, 2, 3]
  8752. *
  8753. * _.take([1, 2, 3], 0);
  8754. * // => []
  8755. */
  8756. function take(array, n, guard) {
  8757. if (!(array && array.length)) {
  8758. return [];
  8759. }
  8760. n = (guard || n === undefined) ? 1 : toInteger(n);
  8761. return baseSlice(array, 0, n < 0 ? 0 : n);
  8762. }
  8763. /**
  8764. * Creates a slice of `array` with `n` elements taken from the end.
  8765. *
  8766. * @static
  8767. * @memberOf _
  8768. * @since 3.0.0
  8769. * @category Array
  8770. * @param {Array} array The array to query.
  8771. * @param {number} [n=1] The number of elements to take.
  8772. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8773. * @returns {Array} Returns the slice of `array`.
  8774. * @example
  8775. *
  8776. * _.takeRight([1, 2, 3]);
  8777. * // => [3]
  8778. *
  8779. * _.takeRight([1, 2, 3], 2);
  8780. * // => [2, 3]
  8781. *
  8782. * _.takeRight([1, 2, 3], 5);
  8783. * // => [1, 2, 3]
  8784. *
  8785. * _.takeRight([1, 2, 3], 0);
  8786. * // => []
  8787. */
  8788. function takeRight(array, n, guard) {
  8789. var length = array == null ? 0 : array.length;
  8790. if (!length) {
  8791. return [];
  8792. }
  8793. n = (guard || n === undefined) ? 1 : toInteger(n);
  8794. n = length - n;
  8795. return baseSlice(array, n < 0 ? 0 : n, length);
  8796. }
  8797. /**
  8798. * Creates a slice of `array` with elements taken from the end. Elements are
  8799. * taken until `predicate` returns falsey. The predicate is invoked with
  8800. * three arguments: (value, index, array).
  8801. *
  8802. * @static
  8803. * @memberOf _
  8804. * @since 3.0.0
  8805. * @category Array
  8806. * @param {Array} array The array to query.
  8807. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8808. * @returns {Array} Returns the slice of `array`.
  8809. * @example
  8810. *
  8811. * var users = [
  8812. * { 'user': 'barney', 'active': true },
  8813. * { 'user': 'fred', 'active': false },
  8814. * { 'user': 'pebbles', 'active': false }
  8815. * ];
  8816. *
  8817. * _.takeRightWhile(users, function(o) { return !o.active; });
  8818. * // => objects for ['fred', 'pebbles']
  8819. *
  8820. * // The `_.matches` iteratee shorthand.
  8821. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8822. * // => objects for ['pebbles']
  8823. *
  8824. * // The `_.matchesProperty` iteratee shorthand.
  8825. * _.takeRightWhile(users, ['active', false]);
  8826. * // => objects for ['fred', 'pebbles']
  8827. *
  8828. * // The `_.property` iteratee shorthand.
  8829. * _.takeRightWhile(users, 'active');
  8830. * // => []
  8831. */
  8832. function takeRightWhile(array, predicate) {
  8833. return (array && array.length)
  8834. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8835. : [];
  8836. }
  8837. /**
  8838. * Creates a slice of `array` with elements taken from the beginning. Elements
  8839. * are taken until `predicate` returns falsey. The predicate is invoked with
  8840. * three arguments: (value, index, array).
  8841. *
  8842. * @static
  8843. * @memberOf _
  8844. * @since 3.0.0
  8845. * @category Array
  8846. * @param {Array} array The array to query.
  8847. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8848. * @returns {Array} Returns the slice of `array`.
  8849. * @example
  8850. *
  8851. * var users = [
  8852. * { 'user': 'barney', 'active': false },
  8853. * { 'user': 'fred', 'active': false },
  8854. * { 'user': 'pebbles', 'active': true }
  8855. * ];
  8856. *
  8857. * _.takeWhile(users, function(o) { return !o.active; });
  8858. * // => objects for ['barney', 'fred']
  8859. *
  8860. * // The `_.matches` iteratee shorthand.
  8861. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8862. * // => objects for ['barney']
  8863. *
  8864. * // The `_.matchesProperty` iteratee shorthand.
  8865. * _.takeWhile(users, ['active', false]);
  8866. * // => objects for ['barney', 'fred']
  8867. *
  8868. * // The `_.property` iteratee shorthand.
  8869. * _.takeWhile(users, 'active');
  8870. * // => []
  8871. */
  8872. function takeWhile(array, predicate) {
  8873. return (array && array.length)
  8874. ? baseWhile(array, getIteratee(predicate, 3))
  8875. : [];
  8876. }
  8877. /**
  8878. * Creates an array of unique values, in order, from all given arrays using
  8879. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8880. * for equality comparisons.
  8881. *
  8882. * @static
  8883. * @memberOf _
  8884. * @since 0.1.0
  8885. * @category Array
  8886. * @param {...Array} [arrays] The arrays to inspect.
  8887. * @returns {Array} Returns the new array of combined values.
  8888. * @example
  8889. *
  8890. * _.union([2], [1, 2]);
  8891. * // => [2, 1]
  8892. */
  8893. var union = baseRest(function(arrays) {
  8894. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8895. });
  8896. /**
  8897. * This method is like `_.union` except that it accepts `iteratee` which is
  8898. * invoked for each element of each `arrays` to generate the criterion by
  8899. * which uniqueness is computed. Result values are chosen from the first
  8900. * array in which the value occurs. The iteratee is invoked with one argument:
  8901. * (value).
  8902. *
  8903. * @static
  8904. * @memberOf _
  8905. * @since 4.0.0
  8906. * @category Array
  8907. * @param {...Array} [arrays] The arrays to inspect.
  8908. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8909. * @returns {Array} Returns the new array of combined values.
  8910. * @example
  8911. *
  8912. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8913. * // => [2.1, 1.2]
  8914. *
  8915. * // The `_.property` iteratee shorthand.
  8916. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8917. * // => [{ 'x': 1 }, { 'x': 2 }]
  8918. */
  8919. var unionBy = baseRest(function(arrays) {
  8920. var iteratee = last(arrays);
  8921. if (isArrayLikeObject(iteratee)) {
  8922. iteratee = undefined;
  8923. }
  8924. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8925. });
  8926. /**
  8927. * This method is like `_.union` except that it accepts `comparator` which
  8928. * is invoked to compare elements of `arrays`. Result values are chosen from
  8929. * the first array in which the value occurs. The comparator is invoked
  8930. * with two arguments: (arrVal, othVal).
  8931. *
  8932. * @static
  8933. * @memberOf _
  8934. * @since 4.0.0
  8935. * @category Array
  8936. * @param {...Array} [arrays] The arrays to inspect.
  8937. * @param {Function} [comparator] The comparator invoked per element.
  8938. * @returns {Array} Returns the new array of combined values.
  8939. * @example
  8940. *
  8941. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8942. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8943. *
  8944. * _.unionWith(objects, others, _.isEqual);
  8945. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8946. */
  8947. var unionWith = baseRest(function(arrays) {
  8948. var comparator = last(arrays);
  8949. comparator = typeof comparator == 'function' ? comparator : undefined;
  8950. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8951. });
  8952. /**
  8953. * Creates a duplicate-free version of an array, using
  8954. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8955. * for equality comparisons, in which only the first occurrence of each element
  8956. * is kept. The order of result values is determined by the order they occur
  8957. * in the array.
  8958. *
  8959. * @static
  8960. * @memberOf _
  8961. * @since 0.1.0
  8962. * @category Array
  8963. * @param {Array} array The array to inspect.
  8964. * @returns {Array} Returns the new duplicate free array.
  8965. * @example
  8966. *
  8967. * _.uniq([2, 1, 2]);
  8968. * // => [2, 1]
  8969. */
  8970. function uniq(array) {
  8971. return (array && array.length) ? baseUniq(array) : [];
  8972. }
  8973. /**
  8974. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8975. * invoked for each element in `array` to generate the criterion by which
  8976. * uniqueness is computed. The order of result values is determined by the
  8977. * order they occur in the array. The iteratee is invoked with one argument:
  8978. * (value).
  8979. *
  8980. * @static
  8981. * @memberOf _
  8982. * @since 4.0.0
  8983. * @category Array
  8984. * @param {Array} array The array to inspect.
  8985. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8986. * @returns {Array} Returns the new duplicate free array.
  8987. * @example
  8988. *
  8989. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8990. * // => [2.1, 1.2]
  8991. *
  8992. * // The `_.property` iteratee shorthand.
  8993. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8994. * // => [{ 'x': 1 }, { 'x': 2 }]
  8995. */
  8996. function uniqBy(array, iteratee) {
  8997. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8998. }
  8999. /**
  9000. * This method is like `_.uniq` except that it accepts `comparator` which
  9001. * is invoked to compare elements of `array`. The order of result values is
  9002. * determined by the order they occur in the array.The comparator is invoked
  9003. * with two arguments: (arrVal, othVal).
  9004. *
  9005. * @static
  9006. * @memberOf _
  9007. * @since 4.0.0
  9008. * @category Array
  9009. * @param {Array} array The array to inspect.
  9010. * @param {Function} [comparator] The comparator invoked per element.
  9011. * @returns {Array} Returns the new duplicate free array.
  9012. * @example
  9013. *
  9014. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9015. *
  9016. * _.uniqWith(objects, _.isEqual);
  9017. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9018. */
  9019. function uniqWith(array, comparator) {
  9020. comparator = typeof comparator == 'function' ? comparator : undefined;
  9021. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9022. }
  9023. /**
  9024. * This method is like `_.zip` except that it accepts an array of grouped
  9025. * elements and creates an array regrouping the elements to their pre-zip
  9026. * configuration.
  9027. *
  9028. * @static
  9029. * @memberOf _
  9030. * @since 1.2.0
  9031. * @category Array
  9032. * @param {Array} array The array of grouped elements to process.
  9033. * @returns {Array} Returns the new array of regrouped elements.
  9034. * @example
  9035. *
  9036. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9037. * // => [['a', 1, true], ['b', 2, false]]
  9038. *
  9039. * _.unzip(zipped);
  9040. * // => [['a', 'b'], [1, 2], [true, false]]
  9041. */
  9042. function unzip(array) {
  9043. if (!(array && array.length)) {
  9044. return [];
  9045. }
  9046. var length = 0;
  9047. array = arrayFilter(array, function(group) {
  9048. if (isArrayLikeObject(group)) {
  9049. length = nativeMax(group.length, length);
  9050. return true;
  9051. }
  9052. });
  9053. return baseTimes(length, function(index) {
  9054. return arrayMap(array, baseProperty(index));
  9055. });
  9056. }
  9057. /**
  9058. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9059. * how regrouped values should be combined. The iteratee is invoked with the
  9060. * elements of each group: (...group).
  9061. *
  9062. * @static
  9063. * @memberOf _
  9064. * @since 3.8.0
  9065. * @category Array
  9066. * @param {Array} array The array of grouped elements to process.
  9067. * @param {Function} [iteratee=_.identity] The function to combine
  9068. * regrouped values.
  9069. * @returns {Array} Returns the new array of regrouped elements.
  9070. * @example
  9071. *
  9072. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9073. * // => [[1, 10, 100], [2, 20, 200]]
  9074. *
  9075. * _.unzipWith(zipped, _.add);
  9076. * // => [3, 30, 300]
  9077. */
  9078. function unzipWith(array, iteratee) {
  9079. if (!(array && array.length)) {
  9080. return [];
  9081. }
  9082. var result = unzip(array);
  9083. if (iteratee == null) {
  9084. return result;
  9085. }
  9086. return arrayMap(result, function(group) {
  9087. return apply(iteratee, undefined, group);
  9088. });
  9089. }
  9090. /**
  9091. * Creates an array excluding all given values using
  9092. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9093. * for equality comparisons.
  9094. *
  9095. * **Note:** Unlike `_.pull`, this method returns a new array.
  9096. *
  9097. * @static
  9098. * @memberOf _
  9099. * @since 0.1.0
  9100. * @category Array
  9101. * @param {Array} array The array to inspect.
  9102. * @param {...*} [values] The values to exclude.
  9103. * @returns {Array} Returns the new array of filtered values.
  9104. * @see _.difference, _.xor
  9105. * @example
  9106. *
  9107. * _.without([2, 1, 2, 3], 1, 2);
  9108. * // => [3]
  9109. */
  9110. var without = baseRest(function(array, values) {
  9111. return isArrayLikeObject(array)
  9112. ? baseDifference(array, values)
  9113. : [];
  9114. });
  9115. /**
  9116. * Creates an array of unique values that is the
  9117. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9118. * of the given arrays. The order of result values is determined by the order
  9119. * they occur in the arrays.
  9120. *
  9121. * @static
  9122. * @memberOf _
  9123. * @since 2.4.0
  9124. * @category Array
  9125. * @param {...Array} [arrays] The arrays to inspect.
  9126. * @returns {Array} Returns the new array of filtered values.
  9127. * @see _.difference, _.without
  9128. * @example
  9129. *
  9130. * _.xor([2, 1], [2, 3]);
  9131. * // => [1, 3]
  9132. */
  9133. var xor = baseRest(function(arrays) {
  9134. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9135. });
  9136. /**
  9137. * This method is like `_.xor` except that it accepts `iteratee` which is
  9138. * invoked for each element of each `arrays` to generate the criterion by
  9139. * which by which they're compared. The order of result values is determined
  9140. * by the order they occur in the arrays. The iteratee is invoked with one
  9141. * argument: (value).
  9142. *
  9143. * @static
  9144. * @memberOf _
  9145. * @since 4.0.0
  9146. * @category Array
  9147. * @param {...Array} [arrays] The arrays to inspect.
  9148. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9149. * @returns {Array} Returns the new array of filtered values.
  9150. * @example
  9151. *
  9152. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9153. * // => [1.2, 3.4]
  9154. *
  9155. * // The `_.property` iteratee shorthand.
  9156. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9157. * // => [{ 'x': 2 }]
  9158. */
  9159. var xorBy = baseRest(function(arrays) {
  9160. var iteratee = last(arrays);
  9161. if (isArrayLikeObject(iteratee)) {
  9162. iteratee = undefined;
  9163. }
  9164. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9165. });
  9166. /**
  9167. * This method is like `_.xor` except that it accepts `comparator` which is
  9168. * invoked to compare elements of `arrays`. The order of result values is
  9169. * determined by the order they occur in the arrays. The comparator is invoked
  9170. * with two arguments: (arrVal, othVal).
  9171. *
  9172. * @static
  9173. * @memberOf _
  9174. * @since 4.0.0
  9175. * @category Array
  9176. * @param {...Array} [arrays] The arrays to inspect.
  9177. * @param {Function} [comparator] The comparator invoked per element.
  9178. * @returns {Array} Returns the new array of filtered values.
  9179. * @example
  9180. *
  9181. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9182. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9183. *
  9184. * _.xorWith(objects, others, _.isEqual);
  9185. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9186. */
  9187. var xorWith = baseRest(function(arrays) {
  9188. var comparator = last(arrays);
  9189. comparator = typeof comparator == 'function' ? comparator : undefined;
  9190. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9191. });
  9192. /**
  9193. * Creates an array of grouped elements, the first of which contains the
  9194. * first elements of the given arrays, the second of which contains the
  9195. * second elements of the given arrays, and so on.
  9196. *
  9197. * @static
  9198. * @memberOf _
  9199. * @since 0.1.0
  9200. * @category Array
  9201. * @param {...Array} [arrays] The arrays to process.
  9202. * @returns {Array} Returns the new array of grouped elements.
  9203. * @example
  9204. *
  9205. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9206. * // => [['a', 1, true], ['b', 2, false]]
  9207. */
  9208. var zip = baseRest(unzip);
  9209. /**
  9210. * This method is like `_.fromPairs` except that it accepts two arrays,
  9211. * one of property identifiers and one of corresponding values.
  9212. *
  9213. * @static
  9214. * @memberOf _
  9215. * @since 0.4.0
  9216. * @category Array
  9217. * @param {Array} [props=[]] The property identifiers.
  9218. * @param {Array} [values=[]] The property values.
  9219. * @returns {Object} Returns the new object.
  9220. * @example
  9221. *
  9222. * _.zipObject(['a', 'b'], [1, 2]);
  9223. * // => { 'a': 1, 'b': 2 }
  9224. */
  9225. function zipObject(props, values) {
  9226. return baseZipObject(props || [], values || [], assignValue);
  9227. }
  9228. /**
  9229. * This method is like `_.zipObject` except that it supports property paths.
  9230. *
  9231. * @static
  9232. * @memberOf _
  9233. * @since 4.1.0
  9234. * @category Array
  9235. * @param {Array} [props=[]] The property identifiers.
  9236. * @param {Array} [values=[]] The property values.
  9237. * @returns {Object} Returns the new object.
  9238. * @example
  9239. *
  9240. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9241. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9242. */
  9243. function zipObjectDeep(props, values) {
  9244. return baseZipObject(props || [], values || [], baseSet);
  9245. }
  9246. /**
  9247. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9248. * how grouped values should be combined. The iteratee is invoked with the
  9249. * elements of each group: (...group).
  9250. *
  9251. * @static
  9252. * @memberOf _
  9253. * @since 3.8.0
  9254. * @category Array
  9255. * @param {...Array} [arrays] The arrays to process.
  9256. * @param {Function} [iteratee=_.identity] The function to combine
  9257. * grouped values.
  9258. * @returns {Array} Returns the new array of grouped elements.
  9259. * @example
  9260. *
  9261. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9262. * return a + b + c;
  9263. * });
  9264. * // => [111, 222]
  9265. */
  9266. var zipWith = baseRest(function(arrays) {
  9267. var length = arrays.length,
  9268. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9269. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9270. return unzipWith(arrays, iteratee);
  9271. });
  9272. /*------------------------------------------------------------------------*/
  9273. /**
  9274. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9275. * chain sequences enabled. The result of such sequences must be unwrapped
  9276. * with `_#value`.
  9277. *
  9278. * @static
  9279. * @memberOf _
  9280. * @since 1.3.0
  9281. * @category Seq
  9282. * @param {*} value The value to wrap.
  9283. * @returns {Object} Returns the new `lodash` wrapper instance.
  9284. * @example
  9285. *
  9286. * var users = [
  9287. * { 'user': 'barney', 'age': 36 },
  9288. * { 'user': 'fred', 'age': 40 },
  9289. * { 'user': 'pebbles', 'age': 1 }
  9290. * ];
  9291. *
  9292. * var youngest = _
  9293. * .chain(users)
  9294. * .sortBy('age')
  9295. * .map(function(o) {
  9296. * return o.user + ' is ' + o.age;
  9297. * })
  9298. * .head()
  9299. * .value();
  9300. * // => 'pebbles is 1'
  9301. */
  9302. function chain(value) {
  9303. var result = lodash(value);
  9304. result.__chain__ = true;
  9305. return result;
  9306. }
  9307. /**
  9308. * This method invokes `interceptor` and returns `value`. The interceptor
  9309. * is invoked with one argument; (value). The purpose of this method is to
  9310. * "tap into" a method chain sequence in order to modify intermediate results.
  9311. *
  9312. * @static
  9313. * @memberOf _
  9314. * @since 0.1.0
  9315. * @category Seq
  9316. * @param {*} value The value to provide to `interceptor`.
  9317. * @param {Function} interceptor The function to invoke.
  9318. * @returns {*} Returns `value`.
  9319. * @example
  9320. *
  9321. * _([1, 2, 3])
  9322. * .tap(function(array) {
  9323. * // Mutate input array.
  9324. * array.pop();
  9325. * })
  9326. * .reverse()
  9327. * .value();
  9328. * // => [2, 1]
  9329. */
  9330. function tap(value, interceptor) {
  9331. interceptor(value);
  9332. return value;
  9333. }
  9334. /**
  9335. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9336. * The purpose of this method is to "pass thru" values replacing intermediate
  9337. * results in a method chain sequence.
  9338. *
  9339. * @static
  9340. * @memberOf _
  9341. * @since 3.0.0
  9342. * @category Seq
  9343. * @param {*} value The value to provide to `interceptor`.
  9344. * @param {Function} interceptor The function to invoke.
  9345. * @returns {*} Returns the result of `interceptor`.
  9346. * @example
  9347. *
  9348. * _(' abc ')
  9349. * .chain()
  9350. * .trim()
  9351. * .thru(function(value) {
  9352. * return [value];
  9353. * })
  9354. * .value();
  9355. * // => ['abc']
  9356. */
  9357. function thru(value, interceptor) {
  9358. return interceptor(value);
  9359. }
  9360. /**
  9361. * This method is the wrapper version of `_.at`.
  9362. *
  9363. * @name at
  9364. * @memberOf _
  9365. * @since 1.0.0
  9366. * @category Seq
  9367. * @param {...(string|string[])} [paths] The property paths to pick.
  9368. * @returns {Object} Returns the new `lodash` wrapper instance.
  9369. * @example
  9370. *
  9371. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9372. *
  9373. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9374. * // => [3, 4]
  9375. */
  9376. var wrapperAt = flatRest(function(paths) {
  9377. var length = paths.length,
  9378. start = length ? paths[0] : 0,
  9379. value = this.__wrapped__,
  9380. interceptor = function(object) { return baseAt(object, paths); };
  9381. if (length > 1 || this.__actions__.length ||
  9382. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9383. return this.thru(interceptor);
  9384. }
  9385. value = value.slice(start, +start + (length ? 1 : 0));
  9386. value.__actions__.push({
  9387. 'func': thru,
  9388. 'args': [interceptor],
  9389. 'thisArg': undefined
  9390. });
  9391. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9392. if (length && !array.length) {
  9393. array.push(undefined);
  9394. }
  9395. return array;
  9396. });
  9397. });
  9398. /**
  9399. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9400. *
  9401. * @name chain
  9402. * @memberOf _
  9403. * @since 0.1.0
  9404. * @category Seq
  9405. * @returns {Object} Returns the new `lodash` wrapper instance.
  9406. * @example
  9407. *
  9408. * var users = [
  9409. * { 'user': 'barney', 'age': 36 },
  9410. * { 'user': 'fred', 'age': 40 }
  9411. * ];
  9412. *
  9413. * // A sequence without explicit chaining.
  9414. * _(users).head();
  9415. * // => { 'user': 'barney', 'age': 36 }
  9416. *
  9417. * // A sequence with explicit chaining.
  9418. * _(users)
  9419. * .chain()
  9420. * .head()
  9421. * .pick('user')
  9422. * .value();
  9423. * // => { 'user': 'barney' }
  9424. */
  9425. function wrapperChain() {
  9426. return chain(this);
  9427. }
  9428. /**
  9429. * Executes the chain sequence and returns the wrapped result.
  9430. *
  9431. * @name commit
  9432. * @memberOf _
  9433. * @since 3.2.0
  9434. * @category Seq
  9435. * @returns {Object} Returns the new `lodash` wrapper instance.
  9436. * @example
  9437. *
  9438. * var array = [1, 2];
  9439. * var wrapped = _(array).push(3);
  9440. *
  9441. * console.log(array);
  9442. * // => [1, 2]
  9443. *
  9444. * wrapped = wrapped.commit();
  9445. * console.log(array);
  9446. * // => [1, 2, 3]
  9447. *
  9448. * wrapped.last();
  9449. * // => 3
  9450. *
  9451. * console.log(array);
  9452. * // => [1, 2, 3]
  9453. */
  9454. function wrapperCommit() {
  9455. return new LodashWrapper(this.value(), this.__chain__);
  9456. }
  9457. /**
  9458. * Gets the next value on a wrapped object following the
  9459. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9460. *
  9461. * @name next
  9462. * @memberOf _
  9463. * @since 4.0.0
  9464. * @category Seq
  9465. * @returns {Object} Returns the next iterator value.
  9466. * @example
  9467. *
  9468. * var wrapped = _([1, 2]);
  9469. *
  9470. * wrapped.next();
  9471. * // => { 'done': false, 'value': 1 }
  9472. *
  9473. * wrapped.next();
  9474. * // => { 'done': false, 'value': 2 }
  9475. *
  9476. * wrapped.next();
  9477. * // => { 'done': true, 'value': undefined }
  9478. */
  9479. function wrapperNext() {
  9480. if (this.__values__ === undefined) {
  9481. this.__values__ = toArray(this.value());
  9482. }
  9483. var done = this.__index__ >= this.__values__.length,
  9484. value = done ? undefined : this.__values__[this.__index__++];
  9485. return { 'done': done, 'value': value };
  9486. }
  9487. /**
  9488. * Enables the wrapper to be iterable.
  9489. *
  9490. * @name Symbol.iterator
  9491. * @memberOf _
  9492. * @since 4.0.0
  9493. * @category Seq
  9494. * @returns {Object} Returns the wrapper object.
  9495. * @example
  9496. *
  9497. * var wrapped = _([1, 2]);
  9498. *
  9499. * wrapped[Symbol.iterator]() === wrapped;
  9500. * // => true
  9501. *
  9502. * Array.from(wrapped);
  9503. * // => [1, 2]
  9504. */
  9505. function wrapperToIterator() {
  9506. return this;
  9507. }
  9508. /**
  9509. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9510. *
  9511. * @name plant
  9512. * @memberOf _
  9513. * @since 3.2.0
  9514. * @category Seq
  9515. * @param {*} value The value to plant.
  9516. * @returns {Object} Returns the new `lodash` wrapper instance.
  9517. * @example
  9518. *
  9519. * function square(n) {
  9520. * return n * n;
  9521. * }
  9522. *
  9523. * var wrapped = _([1, 2]).map(square);
  9524. * var other = wrapped.plant([3, 4]);
  9525. *
  9526. * other.value();
  9527. * // => [9, 16]
  9528. *
  9529. * wrapped.value();
  9530. * // => [1, 4]
  9531. */
  9532. function wrapperPlant(value) {
  9533. var result,
  9534. parent = this;
  9535. while (parent instanceof baseLodash) {
  9536. var clone = wrapperClone(parent);
  9537. clone.__index__ = 0;
  9538. clone.__values__ = undefined;
  9539. if (result) {
  9540. previous.__wrapped__ = clone;
  9541. } else {
  9542. result = clone;
  9543. }
  9544. var previous = clone;
  9545. parent = parent.__wrapped__;
  9546. }
  9547. previous.__wrapped__ = value;
  9548. return result;
  9549. }
  9550. /**
  9551. * This method is the wrapper version of `_.reverse`.
  9552. *
  9553. * **Note:** This method mutates the wrapped array.
  9554. *
  9555. * @name reverse
  9556. * @memberOf _
  9557. * @since 0.1.0
  9558. * @category Seq
  9559. * @returns {Object} Returns the new `lodash` wrapper instance.
  9560. * @example
  9561. *
  9562. * var array = [1, 2, 3];
  9563. *
  9564. * _(array).reverse().value()
  9565. * // => [3, 2, 1]
  9566. *
  9567. * console.log(array);
  9568. * // => [3, 2, 1]
  9569. */
  9570. function wrapperReverse() {
  9571. var value = this.__wrapped__;
  9572. if (value instanceof LazyWrapper) {
  9573. var wrapped = value;
  9574. if (this.__actions__.length) {
  9575. wrapped = new LazyWrapper(this);
  9576. }
  9577. wrapped = wrapped.reverse();
  9578. wrapped.__actions__.push({
  9579. 'func': thru,
  9580. 'args': [reverse],
  9581. 'thisArg': undefined
  9582. });
  9583. return new LodashWrapper(wrapped, this.__chain__);
  9584. }
  9585. return this.thru(reverse);
  9586. }
  9587. /**
  9588. * Executes the chain sequence to resolve the unwrapped value.
  9589. *
  9590. * @name value
  9591. * @memberOf _
  9592. * @since 0.1.0
  9593. * @alias toJSON, valueOf
  9594. * @category Seq
  9595. * @returns {*} Returns the resolved unwrapped value.
  9596. * @example
  9597. *
  9598. * _([1, 2, 3]).value();
  9599. * // => [1, 2, 3]
  9600. */
  9601. function wrapperValue() {
  9602. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9603. }
  9604. /*------------------------------------------------------------------------*/
  9605. /**
  9606. * Creates an object composed of keys generated from the results of running
  9607. * each element of `collection` thru `iteratee`. The corresponding value of
  9608. * each key is the number of times the key was returned by `iteratee`. The
  9609. * iteratee is invoked with one argument: (value).
  9610. *
  9611. * @static
  9612. * @memberOf _
  9613. * @since 0.5.0
  9614. * @category Collection
  9615. * @param {Array|Object} collection The collection to iterate over.
  9616. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9617. * @returns {Object} Returns the composed aggregate object.
  9618. * @example
  9619. *
  9620. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9621. * // => { '4': 1, '6': 2 }
  9622. *
  9623. * // The `_.property` iteratee shorthand.
  9624. * _.countBy(['one', 'two', 'three'], 'length');
  9625. * // => { '3': 2, '5': 1 }
  9626. */
  9627. var countBy = createAggregator(function(result, value, key) {
  9628. if (hasOwnProperty.call(result, key)) {
  9629. ++result[key];
  9630. } else {
  9631. baseAssignValue(result, key, 1);
  9632. }
  9633. });
  9634. /**
  9635. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9636. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9637. * invoked with three arguments: (value, index|key, collection).
  9638. *
  9639. * **Note:** This method returns `true` for
  9640. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9641. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9642. * elements of empty collections.
  9643. *
  9644. * @static
  9645. * @memberOf _
  9646. * @since 0.1.0
  9647. * @category Collection
  9648. * @param {Array|Object} collection The collection to iterate over.
  9649. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9650. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9651. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9652. * else `false`.
  9653. * @example
  9654. *
  9655. * _.every([true, 1, null, 'yes'], Boolean);
  9656. * // => false
  9657. *
  9658. * var users = [
  9659. * { 'user': 'barney', 'age': 36, 'active': false },
  9660. * { 'user': 'fred', 'age': 40, 'active': false }
  9661. * ];
  9662. *
  9663. * // The `_.matches` iteratee shorthand.
  9664. * _.every(users, { 'user': 'barney', 'active': false });
  9665. * // => false
  9666. *
  9667. * // The `_.matchesProperty` iteratee shorthand.
  9668. * _.every(users, ['active', false]);
  9669. * // => true
  9670. *
  9671. * // The `_.property` iteratee shorthand.
  9672. * _.every(users, 'active');
  9673. * // => false
  9674. */
  9675. function every(collection, predicate, guard) {
  9676. var func = isArray(collection) ? arrayEvery : baseEvery;
  9677. if (guard && isIterateeCall(collection, predicate, guard)) {
  9678. predicate = undefined;
  9679. }
  9680. return func(collection, getIteratee(predicate, 3));
  9681. }
  9682. /**
  9683. * Iterates over elements of `collection`, returning an array of all elements
  9684. * `predicate` returns truthy for. The predicate is invoked with three
  9685. * arguments: (value, index|key, collection).
  9686. *
  9687. * **Note:** Unlike `_.remove`, this method returns a new array.
  9688. *
  9689. * @static
  9690. * @memberOf _
  9691. * @since 0.1.0
  9692. * @category Collection
  9693. * @param {Array|Object} collection The collection to iterate over.
  9694. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9695. * @returns {Array} Returns the new filtered array.
  9696. * @see _.reject
  9697. * @example
  9698. *
  9699. * var users = [
  9700. * { 'user': 'barney', 'age': 36, 'active': true },
  9701. * { 'user': 'fred', 'age': 40, 'active': false }
  9702. * ];
  9703. *
  9704. * _.filter(users, function(o) { return !o.active; });
  9705. * // => objects for ['fred']
  9706. *
  9707. * // The `_.matches` iteratee shorthand.
  9708. * _.filter(users, { 'age': 36, 'active': true });
  9709. * // => objects for ['barney']
  9710. *
  9711. * // The `_.matchesProperty` iteratee shorthand.
  9712. * _.filter(users, ['active', false]);
  9713. * // => objects for ['fred']
  9714. *
  9715. * // The `_.property` iteratee shorthand.
  9716. * _.filter(users, 'active');
  9717. * // => objects for ['barney']
  9718. *
  9719. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9720. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9721. * // => objects for ['fred', 'barney']
  9722. */
  9723. function filter(collection, predicate) {
  9724. var func = isArray(collection) ? arrayFilter : baseFilter;
  9725. return func(collection, getIteratee(predicate, 3));
  9726. }
  9727. /**
  9728. * Iterates over elements of `collection`, returning the first element
  9729. * `predicate` returns truthy for. The predicate is invoked with three
  9730. * arguments: (value, index|key, collection).
  9731. *
  9732. * @static
  9733. * @memberOf _
  9734. * @since 0.1.0
  9735. * @category Collection
  9736. * @param {Array|Object} collection The collection to inspect.
  9737. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9738. * @param {number} [fromIndex=0] The index to search from.
  9739. * @returns {*} Returns the matched element, else `undefined`.
  9740. * @example
  9741. *
  9742. * var users = [
  9743. * { 'user': 'barney', 'age': 36, 'active': true },
  9744. * { 'user': 'fred', 'age': 40, 'active': false },
  9745. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9746. * ];
  9747. *
  9748. * _.find(users, function(o) { return o.age < 40; });
  9749. * // => object for 'barney'
  9750. *
  9751. * // The `_.matches` iteratee shorthand.
  9752. * _.find(users, { 'age': 1, 'active': true });
  9753. * // => object for 'pebbles'
  9754. *
  9755. * // The `_.matchesProperty` iteratee shorthand.
  9756. * _.find(users, ['active', false]);
  9757. * // => object for 'fred'
  9758. *
  9759. * // The `_.property` iteratee shorthand.
  9760. * _.find(users, 'active');
  9761. * // => object for 'barney'
  9762. */
  9763. var find = createFind(findIndex);
  9764. /**
  9765. * This method is like `_.find` except that it iterates over elements of
  9766. * `collection` from right to left.
  9767. *
  9768. * @static
  9769. * @memberOf _
  9770. * @since 2.0.0
  9771. * @category Collection
  9772. * @param {Array|Object} collection The collection to inspect.
  9773. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9774. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9775. * @returns {*} Returns the matched element, else `undefined`.
  9776. * @example
  9777. *
  9778. * _.findLast([1, 2, 3, 4], function(n) {
  9779. * return n % 2 == 1;
  9780. * });
  9781. * // => 3
  9782. */
  9783. var findLast = createFind(findLastIndex);
  9784. /**
  9785. * Creates a flattened array of values by running each element in `collection`
  9786. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9787. * with three arguments: (value, index|key, collection).
  9788. *
  9789. * @static
  9790. * @memberOf _
  9791. * @since 4.0.0
  9792. * @category Collection
  9793. * @param {Array|Object} collection The collection to iterate over.
  9794. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9795. * @returns {Array} Returns the new flattened array.
  9796. * @example
  9797. *
  9798. * function duplicate(n) {
  9799. * return [n, n];
  9800. * }
  9801. *
  9802. * _.flatMap([1, 2], duplicate);
  9803. * // => [1, 1, 2, 2]
  9804. */
  9805. function flatMap(collection, iteratee) {
  9806. return baseFlatten(map(collection, iteratee), 1);
  9807. }
  9808. /**
  9809. * This method is like `_.flatMap` except that it recursively flattens the
  9810. * mapped results.
  9811. *
  9812. * @static
  9813. * @memberOf _
  9814. * @since 4.7.0
  9815. * @category Collection
  9816. * @param {Array|Object} collection The collection to iterate over.
  9817. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9818. * @returns {Array} Returns the new flattened array.
  9819. * @example
  9820. *
  9821. * function duplicate(n) {
  9822. * return [[[n, n]]];
  9823. * }
  9824. *
  9825. * _.flatMapDeep([1, 2], duplicate);
  9826. * // => [1, 1, 2, 2]
  9827. */
  9828. function flatMapDeep(collection, iteratee) {
  9829. return baseFlatten(map(collection, iteratee), INFINITY);
  9830. }
  9831. /**
  9832. * This method is like `_.flatMap` except that it recursively flattens the
  9833. * mapped results up to `depth` times.
  9834. *
  9835. * @static
  9836. * @memberOf _
  9837. * @since 4.7.0
  9838. * @category Collection
  9839. * @param {Array|Object} collection The collection to iterate over.
  9840. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9841. * @param {number} [depth=1] The maximum recursion depth.
  9842. * @returns {Array} Returns the new flattened array.
  9843. * @example
  9844. *
  9845. * function duplicate(n) {
  9846. * return [[[n, n]]];
  9847. * }
  9848. *
  9849. * _.flatMapDepth([1, 2], duplicate, 2);
  9850. * // => [[1, 1], [2, 2]]
  9851. */
  9852. function flatMapDepth(collection, iteratee, depth) {
  9853. depth = depth === undefined ? 1 : toInteger(depth);
  9854. return baseFlatten(map(collection, iteratee), depth);
  9855. }
  9856. /**
  9857. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9858. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9859. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9860. *
  9861. * **Note:** As with other "Collections" methods, objects with a "length"
  9862. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9863. * or `_.forOwn` for object iteration.
  9864. *
  9865. * @static
  9866. * @memberOf _
  9867. * @since 0.1.0
  9868. * @alias each
  9869. * @category Collection
  9870. * @param {Array|Object} collection The collection to iterate over.
  9871. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9872. * @returns {Array|Object} Returns `collection`.
  9873. * @see _.forEachRight
  9874. * @example
  9875. *
  9876. * _.forEach([1, 2], function(value) {
  9877. * console.log(value);
  9878. * });
  9879. * // => Logs `1` then `2`.
  9880. *
  9881. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9882. * console.log(key);
  9883. * });
  9884. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9885. */
  9886. function forEach(collection, iteratee) {
  9887. var func = isArray(collection) ? arrayEach : baseEach;
  9888. return func(collection, getIteratee(iteratee, 3));
  9889. }
  9890. /**
  9891. * This method is like `_.forEach` except that it iterates over elements of
  9892. * `collection` from right to left.
  9893. *
  9894. * @static
  9895. * @memberOf _
  9896. * @since 2.0.0
  9897. * @alias eachRight
  9898. * @category Collection
  9899. * @param {Array|Object} collection The collection to iterate over.
  9900. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9901. * @returns {Array|Object} Returns `collection`.
  9902. * @see _.forEach
  9903. * @example
  9904. *
  9905. * _.forEachRight([1, 2], function(value) {
  9906. * console.log(value);
  9907. * });
  9908. * // => Logs `2` then `1`.
  9909. */
  9910. function forEachRight(collection, iteratee) {
  9911. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9912. return func(collection, getIteratee(iteratee, 3));
  9913. }
  9914. /**
  9915. * Creates an object composed of keys generated from the results of running
  9916. * each element of `collection` thru `iteratee`. The order of grouped values
  9917. * is determined by the order they occur in `collection`. The corresponding
  9918. * value of each key is an array of elements responsible for generating the
  9919. * key. The iteratee is invoked with one argument: (value).
  9920. *
  9921. * @static
  9922. * @memberOf _
  9923. * @since 0.1.0
  9924. * @category Collection
  9925. * @param {Array|Object} collection The collection to iterate over.
  9926. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9927. * @returns {Object} Returns the composed aggregate object.
  9928. * @example
  9929. *
  9930. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9931. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9932. *
  9933. * // The `_.property` iteratee shorthand.
  9934. * _.groupBy(['one', 'two', 'three'], 'length');
  9935. * // => { '3': ['one', 'two'], '5': ['three'] }
  9936. */
  9937. var groupBy = createAggregator(function(result, value, key) {
  9938. if (hasOwnProperty.call(result, key)) {
  9939. result[key].push(value);
  9940. } else {
  9941. baseAssignValue(result, key, [value]);
  9942. }
  9943. });
  9944. /**
  9945. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9946. * checked for a substring of `value`, otherwise
  9947. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9948. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9949. * the offset from the end of `collection`.
  9950. *
  9951. * @static
  9952. * @memberOf _
  9953. * @since 0.1.0
  9954. * @category Collection
  9955. * @param {Array|Object|string} collection The collection to inspect.
  9956. * @param {*} value The value to search for.
  9957. * @param {number} [fromIndex=0] The index to search from.
  9958. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9959. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9960. * @example
  9961. *
  9962. * _.includes([1, 2, 3], 1);
  9963. * // => true
  9964. *
  9965. * _.includes([1, 2, 3], 1, 2);
  9966. * // => false
  9967. *
  9968. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9969. * // => true
  9970. *
  9971. * _.includes('abcd', 'bc');
  9972. * // => true
  9973. */
  9974. function includes(collection, value, fromIndex, guard) {
  9975. collection = isArrayLike(collection) ? collection : values(collection);
  9976. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9977. var length = collection.length;
  9978. if (fromIndex < 0) {
  9979. fromIndex = nativeMax(length + fromIndex, 0);
  9980. }
  9981. return isString(collection)
  9982. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9983. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9984. }
  9985. /**
  9986. * Invokes the method at `path` of each element in `collection`, returning
  9987. * an array of the results of each invoked method. Any additional arguments
  9988. * are provided to each invoked method. If `path` is a function, it's invoked
  9989. * for, and `this` bound to, each element in `collection`.
  9990. *
  9991. * @static
  9992. * @memberOf _
  9993. * @since 4.0.0
  9994. * @category Collection
  9995. * @param {Array|Object} collection The collection to iterate over.
  9996. * @param {Array|Function|string} path The path of the method to invoke or
  9997. * the function invoked per iteration.
  9998. * @param {...*} [args] The arguments to invoke each method with.
  9999. * @returns {Array} Returns the array of results.
  10000. * @example
  10001. *
  10002. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10003. * // => [[1, 5, 7], [1, 2, 3]]
  10004. *
  10005. * _.invokeMap([123, 456], String.prototype.split, '');
  10006. * // => [['1', '2', '3'], ['4', '5', '6']]
  10007. */
  10008. var invokeMap = baseRest(function(collection, path, args) {
  10009. var index = -1,
  10010. isFunc = typeof path == 'function',
  10011. result = isArrayLike(collection) ? Array(collection.length) : [];
  10012. baseEach(collection, function(value) {
  10013. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10014. });
  10015. return result;
  10016. });
  10017. /**
  10018. * Creates an object composed of keys generated from the results of running
  10019. * each element of `collection` thru `iteratee`. The corresponding value of
  10020. * each key is the last element responsible for generating the key. The
  10021. * iteratee is invoked with one argument: (value).
  10022. *
  10023. * @static
  10024. * @memberOf _
  10025. * @since 4.0.0
  10026. * @category Collection
  10027. * @param {Array|Object} collection The collection to iterate over.
  10028. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10029. * @returns {Object} Returns the composed aggregate object.
  10030. * @example
  10031. *
  10032. * var array = [
  10033. * { 'dir': 'left', 'code': 97 },
  10034. * { 'dir': 'right', 'code': 100 }
  10035. * ];
  10036. *
  10037. * _.keyBy(array, function(o) {
  10038. * return String.fromCharCode(o.code);
  10039. * });
  10040. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10041. *
  10042. * _.keyBy(array, 'dir');
  10043. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10044. */
  10045. var keyBy = createAggregator(function(result, value, key) {
  10046. baseAssignValue(result, key, value);
  10047. });
  10048. /**
  10049. * Creates an array of values by running each element in `collection` thru
  10050. * `iteratee`. The iteratee is invoked with three arguments:
  10051. * (value, index|key, collection).
  10052. *
  10053. * Many lodash methods are guarded to work as iteratees for methods like
  10054. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10055. *
  10056. * The guarded methods are:
  10057. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10058. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10059. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10060. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10061. *
  10062. * @static
  10063. * @memberOf _
  10064. * @since 0.1.0
  10065. * @category Collection
  10066. * @param {Array|Object} collection The collection to iterate over.
  10067. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10068. * @returns {Array} Returns the new mapped array.
  10069. * @example
  10070. *
  10071. * function square(n) {
  10072. * return n * n;
  10073. * }
  10074. *
  10075. * _.map([4, 8], square);
  10076. * // => [16, 64]
  10077. *
  10078. * _.map({ 'a': 4, 'b': 8 }, square);
  10079. * // => [16, 64] (iteration order is not guaranteed)
  10080. *
  10081. * var users = [
  10082. * { 'user': 'barney' },
  10083. * { 'user': 'fred' }
  10084. * ];
  10085. *
  10086. * // The `_.property` iteratee shorthand.
  10087. * _.map(users, 'user');
  10088. * // => ['barney', 'fred']
  10089. */
  10090. function map(collection, iteratee) {
  10091. var func = isArray(collection) ? arrayMap : baseMap;
  10092. return func(collection, getIteratee(iteratee, 3));
  10093. }
  10094. /**
  10095. * This method is like `_.sortBy` except that it allows specifying the sort
  10096. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10097. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10098. * descending or "asc" for ascending sort order of corresponding values.
  10099. *
  10100. * @static
  10101. * @memberOf _
  10102. * @since 4.0.0
  10103. * @category Collection
  10104. * @param {Array|Object} collection The collection to iterate over.
  10105. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10106. * The iteratees to sort by.
  10107. * @param {string[]} [orders] The sort orders of `iteratees`.
  10108. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10109. * @returns {Array} Returns the new sorted array.
  10110. * @example
  10111. *
  10112. * var users = [
  10113. * { 'user': 'fred', 'age': 48 },
  10114. * { 'user': 'barney', 'age': 34 },
  10115. * { 'user': 'fred', 'age': 40 },
  10116. * { 'user': 'barney', 'age': 36 }
  10117. * ];
  10118. *
  10119. * // Sort by `user` in ascending order and by `age` in descending order.
  10120. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10121. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10122. */
  10123. function orderBy(collection, iteratees, orders, guard) {
  10124. if (collection == null) {
  10125. return [];
  10126. }
  10127. if (!isArray(iteratees)) {
  10128. iteratees = iteratees == null ? [] : [iteratees];
  10129. }
  10130. orders = guard ? undefined : orders;
  10131. if (!isArray(orders)) {
  10132. orders = orders == null ? [] : [orders];
  10133. }
  10134. return baseOrderBy(collection, iteratees, orders);
  10135. }
  10136. /**
  10137. * Creates an array of elements split into two groups, the first of which
  10138. * contains elements `predicate` returns truthy for, the second of which
  10139. * contains elements `predicate` returns falsey for. The predicate is
  10140. * invoked with one argument: (value).
  10141. *
  10142. * @static
  10143. * @memberOf _
  10144. * @since 3.0.0
  10145. * @category Collection
  10146. * @param {Array|Object} collection The collection to iterate over.
  10147. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10148. * @returns {Array} Returns the array of grouped elements.
  10149. * @example
  10150. *
  10151. * var users = [
  10152. * { 'user': 'barney', 'age': 36, 'active': false },
  10153. * { 'user': 'fred', 'age': 40, 'active': true },
  10154. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10155. * ];
  10156. *
  10157. * _.partition(users, function(o) { return o.active; });
  10158. * // => objects for [['fred'], ['barney', 'pebbles']]
  10159. *
  10160. * // The `_.matches` iteratee shorthand.
  10161. * _.partition(users, { 'age': 1, 'active': false });
  10162. * // => objects for [['pebbles'], ['barney', 'fred']]
  10163. *
  10164. * // The `_.matchesProperty` iteratee shorthand.
  10165. * _.partition(users, ['active', false]);
  10166. * // => objects for [['barney', 'pebbles'], ['fred']]
  10167. *
  10168. * // The `_.property` iteratee shorthand.
  10169. * _.partition(users, 'active');
  10170. * // => objects for [['fred'], ['barney', 'pebbles']]
  10171. */
  10172. var partition = createAggregator(function(result, value, key) {
  10173. result[key ? 0 : 1].push(value);
  10174. }, function() { return [[], []]; });
  10175. /**
  10176. * Reduces `collection` to a value which is the accumulated result of running
  10177. * each element in `collection` thru `iteratee`, where each successive
  10178. * invocation is supplied the return value of the previous. If `accumulator`
  10179. * is not given, the first element of `collection` is used as the initial
  10180. * value. The iteratee is invoked with four arguments:
  10181. * (accumulator, value, index|key, collection).
  10182. *
  10183. * Many lodash methods are guarded to work as iteratees for methods like
  10184. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10185. *
  10186. * The guarded methods are:
  10187. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10188. * and `sortBy`
  10189. *
  10190. * @static
  10191. * @memberOf _
  10192. * @since 0.1.0
  10193. * @category Collection
  10194. * @param {Array|Object} collection The collection to iterate over.
  10195. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10196. * @param {*} [accumulator] The initial value.
  10197. * @returns {*} Returns the accumulated value.
  10198. * @see _.reduceRight
  10199. * @example
  10200. *
  10201. * _.reduce([1, 2], function(sum, n) {
  10202. * return sum + n;
  10203. * }, 0);
  10204. * // => 3
  10205. *
  10206. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10207. * (result[value] || (result[value] = [])).push(key);
  10208. * return result;
  10209. * }, {});
  10210. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10211. */
  10212. function reduce(collection, iteratee, accumulator) {
  10213. var func = isArray(collection) ? arrayReduce : baseReduce,
  10214. initAccum = arguments.length < 3;
  10215. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10216. }
  10217. /**
  10218. * This method is like `_.reduce` except that it iterates over elements of
  10219. * `collection` from right to left.
  10220. *
  10221. * @static
  10222. * @memberOf _
  10223. * @since 0.1.0
  10224. * @category Collection
  10225. * @param {Array|Object} collection The collection to iterate over.
  10226. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10227. * @param {*} [accumulator] The initial value.
  10228. * @returns {*} Returns the accumulated value.
  10229. * @see _.reduce
  10230. * @example
  10231. *
  10232. * var array = [[0, 1], [2, 3], [4, 5]];
  10233. *
  10234. * _.reduceRight(array, function(flattened, other) {
  10235. * return flattened.concat(other);
  10236. * }, []);
  10237. * // => [4, 5, 2, 3, 0, 1]
  10238. */
  10239. function reduceRight(collection, iteratee, accumulator) {
  10240. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10241. initAccum = arguments.length < 3;
  10242. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10243. }
  10244. /**
  10245. * The opposite of `_.filter`; this method returns the elements of `collection`
  10246. * that `predicate` does **not** return truthy for.
  10247. *
  10248. * @static
  10249. * @memberOf _
  10250. * @since 0.1.0
  10251. * @category Collection
  10252. * @param {Array|Object} collection The collection to iterate over.
  10253. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10254. * @returns {Array} Returns the new filtered array.
  10255. * @see _.filter
  10256. * @example
  10257. *
  10258. * var users = [
  10259. * { 'user': 'barney', 'age': 36, 'active': false },
  10260. * { 'user': 'fred', 'age': 40, 'active': true }
  10261. * ];
  10262. *
  10263. * _.reject(users, function(o) { return !o.active; });
  10264. * // => objects for ['fred']
  10265. *
  10266. * // The `_.matches` iteratee shorthand.
  10267. * _.reject(users, { 'age': 40, 'active': true });
  10268. * // => objects for ['barney']
  10269. *
  10270. * // The `_.matchesProperty` iteratee shorthand.
  10271. * _.reject(users, ['active', false]);
  10272. * // => objects for ['fred']
  10273. *
  10274. * // The `_.property` iteratee shorthand.
  10275. * _.reject(users, 'active');
  10276. * // => objects for ['barney']
  10277. */
  10278. function reject(collection, predicate) {
  10279. var func = isArray(collection) ? arrayFilter : baseFilter;
  10280. return func(collection, negate(getIteratee(predicate, 3)));
  10281. }
  10282. /**
  10283. * Gets a random element from `collection`.
  10284. *
  10285. * @static
  10286. * @memberOf _
  10287. * @since 2.0.0
  10288. * @category Collection
  10289. * @param {Array|Object} collection The collection to sample.
  10290. * @returns {*} Returns the random element.
  10291. * @example
  10292. *
  10293. * _.sample([1, 2, 3, 4]);
  10294. * // => 2
  10295. */
  10296. function sample(collection) {
  10297. var func = isArray(collection) ? arraySample : baseSample;
  10298. return func(collection);
  10299. }
  10300. /**
  10301. * Gets `n` random elements at unique keys from `collection` up to the
  10302. * size of `collection`.
  10303. *
  10304. * @static
  10305. * @memberOf _
  10306. * @since 4.0.0
  10307. * @category Collection
  10308. * @param {Array|Object} collection The collection to sample.
  10309. * @param {number} [n=1] The number of elements to sample.
  10310. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10311. * @returns {Array} Returns the random elements.
  10312. * @example
  10313. *
  10314. * _.sampleSize([1, 2, 3], 2);
  10315. * // => [3, 1]
  10316. *
  10317. * _.sampleSize([1, 2, 3], 4);
  10318. * // => [2, 3, 1]
  10319. */
  10320. function sampleSize(collection, n, guard) {
  10321. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10322. n = 1;
  10323. } else {
  10324. n = toInteger(n);
  10325. }
  10326. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10327. return func(collection, n);
  10328. }
  10329. /**
  10330. * Creates an array of shuffled values, using a version of the
  10331. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10332. *
  10333. * @static
  10334. * @memberOf _
  10335. * @since 0.1.0
  10336. * @category Collection
  10337. * @param {Array|Object} collection The collection to shuffle.
  10338. * @returns {Array} Returns the new shuffled array.
  10339. * @example
  10340. *
  10341. * _.shuffle([1, 2, 3, 4]);
  10342. * // => [4, 1, 3, 2]
  10343. */
  10344. function shuffle(collection) {
  10345. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10346. return func(collection);
  10347. }
  10348. /**
  10349. * Gets the size of `collection` by returning its length for array-like
  10350. * values or the number of own enumerable string keyed properties for objects.
  10351. *
  10352. * @static
  10353. * @memberOf _
  10354. * @since 0.1.0
  10355. * @category Collection
  10356. * @param {Array|Object|string} collection The collection to inspect.
  10357. * @returns {number} Returns the collection size.
  10358. * @example
  10359. *
  10360. * _.size([1, 2, 3]);
  10361. * // => 3
  10362. *
  10363. * _.size({ 'a': 1, 'b': 2 });
  10364. * // => 2
  10365. *
  10366. * _.size('pebbles');
  10367. * // => 7
  10368. */
  10369. function size(collection) {
  10370. if (collection == null) {
  10371. return 0;
  10372. }
  10373. if (isArrayLike(collection)) {
  10374. return isString(collection) ? stringSize(collection) : collection.length;
  10375. }
  10376. var tag = getTag(collection);
  10377. if (tag == mapTag || tag == setTag) {
  10378. return collection.size;
  10379. }
  10380. return baseKeys(collection).length;
  10381. }
  10382. /**
  10383. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10384. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10385. * invoked with three arguments: (value, index|key, collection).
  10386. *
  10387. * @static
  10388. * @memberOf _
  10389. * @since 0.1.0
  10390. * @category Collection
  10391. * @param {Array|Object} collection The collection to iterate over.
  10392. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10393. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10394. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10395. * else `false`.
  10396. * @example
  10397. *
  10398. * _.some([null, 0, 'yes', false], Boolean);
  10399. * // => true
  10400. *
  10401. * var users = [
  10402. * { 'user': 'barney', 'active': true },
  10403. * { 'user': 'fred', 'active': false }
  10404. * ];
  10405. *
  10406. * // The `_.matches` iteratee shorthand.
  10407. * _.some(users, { 'user': 'barney', 'active': false });
  10408. * // => false
  10409. *
  10410. * // The `_.matchesProperty` iteratee shorthand.
  10411. * _.some(users, ['active', false]);
  10412. * // => true
  10413. *
  10414. * // The `_.property` iteratee shorthand.
  10415. * _.some(users, 'active');
  10416. * // => true
  10417. */
  10418. function some(collection, predicate, guard) {
  10419. var func = isArray(collection) ? arraySome : baseSome;
  10420. if (guard && isIterateeCall(collection, predicate, guard)) {
  10421. predicate = undefined;
  10422. }
  10423. return func(collection, getIteratee(predicate, 3));
  10424. }
  10425. /**
  10426. * Creates an array of elements, sorted in ascending order by the results of
  10427. * running each element in a collection thru each iteratee. This method
  10428. * performs a stable sort, that is, it preserves the original sort order of
  10429. * equal elements. The iteratees are invoked with one argument: (value).
  10430. *
  10431. * @static
  10432. * @memberOf _
  10433. * @since 0.1.0
  10434. * @category Collection
  10435. * @param {Array|Object} collection The collection to iterate over.
  10436. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10437. * The iteratees to sort by.
  10438. * @returns {Array} Returns the new sorted array.
  10439. * @example
  10440. *
  10441. * var users = [
  10442. * { 'user': 'fred', 'age': 48 },
  10443. * { 'user': 'barney', 'age': 36 },
  10444. * { 'user': 'fred', 'age': 30 },
  10445. * { 'user': 'barney', 'age': 34 }
  10446. * ];
  10447. *
  10448. * _.sortBy(users, [function(o) { return o.user; }]);
  10449. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10450. *
  10451. * _.sortBy(users, ['user', 'age']);
  10452. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10453. */
  10454. var sortBy = baseRest(function(collection, iteratees) {
  10455. if (collection == null) {
  10456. return [];
  10457. }
  10458. var length = iteratees.length;
  10459. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10460. iteratees = [];
  10461. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10462. iteratees = [iteratees[0]];
  10463. }
  10464. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10465. });
  10466. /*------------------------------------------------------------------------*/
  10467. /**
  10468. * Gets the timestamp of the number of milliseconds that have elapsed since
  10469. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10470. *
  10471. * @static
  10472. * @memberOf _
  10473. * @since 2.4.0
  10474. * @category Date
  10475. * @returns {number} Returns the timestamp.
  10476. * @example
  10477. *
  10478. * _.defer(function(stamp) {
  10479. * console.log(_.now() - stamp);
  10480. * }, _.now());
  10481. * // => Logs the number of milliseconds it took for the deferred invocation.
  10482. */
  10483. var now = ctxNow || function() {
  10484. return root.Date.now();
  10485. };
  10486. /*------------------------------------------------------------------------*/
  10487. /**
  10488. * The opposite of `_.before`; this method creates a function that invokes
  10489. * `func` once it's called `n` or more times.
  10490. *
  10491. * @static
  10492. * @memberOf _
  10493. * @since 0.1.0
  10494. * @category Function
  10495. * @param {number} n The number of calls before `func` is invoked.
  10496. * @param {Function} func The function to restrict.
  10497. * @returns {Function} Returns the new restricted function.
  10498. * @example
  10499. *
  10500. * var saves = ['profile', 'settings'];
  10501. *
  10502. * var done = _.after(saves.length, function() {
  10503. * console.log('done saving!');
  10504. * });
  10505. *
  10506. * _.forEach(saves, function(type) {
  10507. * asyncSave({ 'type': type, 'complete': done });
  10508. * });
  10509. * // => Logs 'done saving!' after the two async saves have completed.
  10510. */
  10511. function after(n, func) {
  10512. if (typeof func != 'function') {
  10513. throw new TypeError(FUNC_ERROR_TEXT);
  10514. }
  10515. n = toInteger(n);
  10516. return function() {
  10517. if (--n < 1) {
  10518. return func.apply(this, arguments);
  10519. }
  10520. };
  10521. }
  10522. /**
  10523. * Creates a function that invokes `func`, with up to `n` arguments,
  10524. * ignoring any additional arguments.
  10525. *
  10526. * @static
  10527. * @memberOf _
  10528. * @since 3.0.0
  10529. * @category Function
  10530. * @param {Function} func The function to cap arguments for.
  10531. * @param {number} [n=func.length] The arity cap.
  10532. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10533. * @returns {Function} Returns the new capped function.
  10534. * @example
  10535. *
  10536. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10537. * // => [6, 8, 10]
  10538. */
  10539. function ary(func, n, guard) {
  10540. n = guard ? undefined : n;
  10541. n = (func && n == null) ? func.length : n;
  10542. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10543. }
  10544. /**
  10545. * Creates a function that invokes `func`, with the `this` binding and arguments
  10546. * of the created function, while it's called less than `n` times. Subsequent
  10547. * calls to the created function return the result of the last `func` invocation.
  10548. *
  10549. * @static
  10550. * @memberOf _
  10551. * @since 3.0.0
  10552. * @category Function
  10553. * @param {number} n The number of calls at which `func` is no longer invoked.
  10554. * @param {Function} func The function to restrict.
  10555. * @returns {Function} Returns the new restricted function.
  10556. * @example
  10557. *
  10558. * jQuery(element).on('click', _.before(5, addContactToList));
  10559. * // => Allows adding up to 4 contacts to the list.
  10560. */
  10561. function before(n, func) {
  10562. var result;
  10563. if (typeof func != 'function') {
  10564. throw new TypeError(FUNC_ERROR_TEXT);
  10565. }
  10566. n = toInteger(n);
  10567. return function() {
  10568. if (--n > 0) {
  10569. result = func.apply(this, arguments);
  10570. }
  10571. if (n <= 1) {
  10572. func = undefined;
  10573. }
  10574. return result;
  10575. };
  10576. }
  10577. /**
  10578. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10579. * and `partials` prepended to the arguments it receives.
  10580. *
  10581. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10582. * may be used as a placeholder for partially applied arguments.
  10583. *
  10584. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10585. * property of bound functions.
  10586. *
  10587. * @static
  10588. * @memberOf _
  10589. * @since 0.1.0
  10590. * @category Function
  10591. * @param {Function} func The function to bind.
  10592. * @param {*} thisArg The `this` binding of `func`.
  10593. * @param {...*} [partials] The arguments to be partially applied.
  10594. * @returns {Function} Returns the new bound function.
  10595. * @example
  10596. *
  10597. * function greet(greeting, punctuation) {
  10598. * return greeting + ' ' + this.user + punctuation;
  10599. * }
  10600. *
  10601. * var object = { 'user': 'fred' };
  10602. *
  10603. * var bound = _.bind(greet, object, 'hi');
  10604. * bound('!');
  10605. * // => 'hi fred!'
  10606. *
  10607. * // Bound with placeholders.
  10608. * var bound = _.bind(greet, object, _, '!');
  10609. * bound('hi');
  10610. * // => 'hi fred!'
  10611. */
  10612. var bind = baseRest(function(func, thisArg, partials) {
  10613. var bitmask = WRAP_BIND_FLAG;
  10614. if (partials.length) {
  10615. var holders = replaceHolders(partials, getHolder(bind));
  10616. bitmask |= WRAP_PARTIAL_FLAG;
  10617. }
  10618. return createWrap(func, bitmask, thisArg, partials, holders);
  10619. });
  10620. /**
  10621. * Creates a function that invokes the method at `object[key]` with `partials`
  10622. * prepended to the arguments it receives.
  10623. *
  10624. * This method differs from `_.bind` by allowing bound functions to reference
  10625. * methods that may be redefined or don't yet exist. See
  10626. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10627. * for more details.
  10628. *
  10629. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10630. * builds, may be used as a placeholder for partially applied arguments.
  10631. *
  10632. * @static
  10633. * @memberOf _
  10634. * @since 0.10.0
  10635. * @category Function
  10636. * @param {Object} object The object to invoke the method on.
  10637. * @param {string} key The key of the method.
  10638. * @param {...*} [partials] The arguments to be partially applied.
  10639. * @returns {Function} Returns the new bound function.
  10640. * @example
  10641. *
  10642. * var object = {
  10643. * 'user': 'fred',
  10644. * 'greet': function(greeting, punctuation) {
  10645. * return greeting + ' ' + this.user + punctuation;
  10646. * }
  10647. * };
  10648. *
  10649. * var bound = _.bindKey(object, 'greet', 'hi');
  10650. * bound('!');
  10651. * // => 'hi fred!'
  10652. *
  10653. * object.greet = function(greeting, punctuation) {
  10654. * return greeting + 'ya ' + this.user + punctuation;
  10655. * };
  10656. *
  10657. * bound('!');
  10658. * // => 'hiya fred!'
  10659. *
  10660. * // Bound with placeholders.
  10661. * var bound = _.bindKey(object, 'greet', _, '!');
  10662. * bound('hi');
  10663. * // => 'hiya fred!'
  10664. */
  10665. var bindKey = baseRest(function(object, key, partials) {
  10666. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10667. if (partials.length) {
  10668. var holders = replaceHolders(partials, getHolder(bindKey));
  10669. bitmask |= WRAP_PARTIAL_FLAG;
  10670. }
  10671. return createWrap(key, bitmask, object, partials, holders);
  10672. });
  10673. /**
  10674. * Creates a function that accepts arguments of `func` and either invokes
  10675. * `func` returning its result, if at least `arity` number of arguments have
  10676. * been provided, or returns a function that accepts the remaining `func`
  10677. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10678. * is not sufficient.
  10679. *
  10680. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10681. * may be used as a placeholder for provided arguments.
  10682. *
  10683. * **Note:** This method doesn't set the "length" property of curried functions.
  10684. *
  10685. * @static
  10686. * @memberOf _
  10687. * @since 2.0.0
  10688. * @category Function
  10689. * @param {Function} func The function to curry.
  10690. * @param {number} [arity=func.length] The arity of `func`.
  10691. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10692. * @returns {Function} Returns the new curried function.
  10693. * @example
  10694. *
  10695. * var abc = function(a, b, c) {
  10696. * return [a, b, c];
  10697. * };
  10698. *
  10699. * var curried = _.curry(abc);
  10700. *
  10701. * curried(1)(2)(3);
  10702. * // => [1, 2, 3]
  10703. *
  10704. * curried(1, 2)(3);
  10705. * // => [1, 2, 3]
  10706. *
  10707. * curried(1, 2, 3);
  10708. * // => [1, 2, 3]
  10709. *
  10710. * // Curried with placeholders.
  10711. * curried(1)(_, 3)(2);
  10712. * // => [1, 2, 3]
  10713. */
  10714. function curry(func, arity, guard) {
  10715. arity = guard ? undefined : arity;
  10716. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10717. result.placeholder = curry.placeholder;
  10718. return result;
  10719. }
  10720. /**
  10721. * This method is like `_.curry` except that arguments are applied to `func`
  10722. * in the manner of `_.partialRight` instead of `_.partial`.
  10723. *
  10724. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10725. * builds, may be used as a placeholder for provided arguments.
  10726. *
  10727. * **Note:** This method doesn't set the "length" property of curried functions.
  10728. *
  10729. * @static
  10730. * @memberOf _
  10731. * @since 3.0.0
  10732. * @category Function
  10733. * @param {Function} func The function to curry.
  10734. * @param {number} [arity=func.length] The arity of `func`.
  10735. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10736. * @returns {Function} Returns the new curried function.
  10737. * @example
  10738. *
  10739. * var abc = function(a, b, c) {
  10740. * return [a, b, c];
  10741. * };
  10742. *
  10743. * var curried = _.curryRight(abc);
  10744. *
  10745. * curried(3)(2)(1);
  10746. * // => [1, 2, 3]
  10747. *
  10748. * curried(2, 3)(1);
  10749. * // => [1, 2, 3]
  10750. *
  10751. * curried(1, 2, 3);
  10752. * // => [1, 2, 3]
  10753. *
  10754. * // Curried with placeholders.
  10755. * curried(3)(1, _)(2);
  10756. * // => [1, 2, 3]
  10757. */
  10758. function curryRight(func, arity, guard) {
  10759. arity = guard ? undefined : arity;
  10760. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10761. result.placeholder = curryRight.placeholder;
  10762. return result;
  10763. }
  10764. /**
  10765. * Creates a debounced function that delays invoking `func` until after `wait`
  10766. * milliseconds have elapsed since the last time the debounced function was
  10767. * invoked. The debounced function comes with a `cancel` method to cancel
  10768. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10769. * Provide `options` to indicate whether `func` should be invoked on the
  10770. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10771. * with the last arguments provided to the debounced function. Subsequent
  10772. * calls to the debounced function return the result of the last `func`
  10773. * invocation.
  10774. *
  10775. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10776. * invoked on the trailing edge of the timeout only if the debounced function
  10777. * is invoked more than once during the `wait` timeout.
  10778. *
  10779. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10780. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10781. *
  10782. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10783. * for details over the differences between `_.debounce` and `_.throttle`.
  10784. *
  10785. * @static
  10786. * @memberOf _
  10787. * @since 0.1.0
  10788. * @category Function
  10789. * @param {Function} func The function to debounce.
  10790. * @param {number} [wait=0] The number of milliseconds to delay.
  10791. * @param {Object} [options={}] The options object.
  10792. * @param {boolean} [options.leading=false]
  10793. * Specify invoking on the leading edge of the timeout.
  10794. * @param {number} [options.maxWait]
  10795. * The maximum time `func` is allowed to be delayed before it's invoked.
  10796. * @param {boolean} [options.trailing=true]
  10797. * Specify invoking on the trailing edge of the timeout.
  10798. * @returns {Function} Returns the new debounced function.
  10799. * @example
  10800. *
  10801. * // Avoid costly calculations while the window size is in flux.
  10802. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10803. *
  10804. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10805. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10806. * 'leading': true,
  10807. * 'trailing': false
  10808. * }));
  10809. *
  10810. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10811. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10812. * var source = new EventSource('/stream');
  10813. * jQuery(source).on('message', debounced);
  10814. *
  10815. * // Cancel the trailing debounced invocation.
  10816. * jQuery(window).on('popstate', debounced.cancel);
  10817. */
  10818. function debounce(func, wait, options) {
  10819. var lastArgs,
  10820. lastThis,
  10821. maxWait,
  10822. result,
  10823. timerId,
  10824. lastCallTime,
  10825. lastInvokeTime = 0,
  10826. leading = false,
  10827. maxing = false,
  10828. trailing = true;
  10829. if (typeof func != 'function') {
  10830. throw new TypeError(FUNC_ERROR_TEXT);
  10831. }
  10832. wait = toNumber(wait) || 0;
  10833. if (isObject(options)) {
  10834. leading = !!options.leading;
  10835. maxing = 'maxWait' in options;
  10836. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10837. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10838. }
  10839. function invokeFunc(time) {
  10840. var args = lastArgs,
  10841. thisArg = lastThis;
  10842. lastArgs = lastThis = undefined;
  10843. lastInvokeTime = time;
  10844. result = func.apply(thisArg, args);
  10845. return result;
  10846. }
  10847. function leadingEdge(time) {
  10848. // Reset any `maxWait` timer.
  10849. lastInvokeTime = time;
  10850. // Start the timer for the trailing edge.
  10851. timerId = setTimeout(timerExpired, wait);
  10852. // Invoke the leading edge.
  10853. return leading ? invokeFunc(time) : result;
  10854. }
  10855. function remainingWait(time) {
  10856. var timeSinceLastCall = time - lastCallTime,
  10857. timeSinceLastInvoke = time - lastInvokeTime,
  10858. timeWaiting = wait - timeSinceLastCall;
  10859. return maxing
  10860. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10861. : timeWaiting;
  10862. }
  10863. function shouldInvoke(time) {
  10864. var timeSinceLastCall = time - lastCallTime,
  10865. timeSinceLastInvoke = time - lastInvokeTime;
  10866. // Either this is the first call, activity has stopped and we're at the
  10867. // trailing edge, the system time has gone backwards and we're treating
  10868. // it as the trailing edge, or we've hit the `maxWait` limit.
  10869. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10870. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10871. }
  10872. function timerExpired() {
  10873. var time = now();
  10874. if (shouldInvoke(time)) {
  10875. return trailingEdge(time);
  10876. }
  10877. // Restart the timer.
  10878. timerId = setTimeout(timerExpired, remainingWait(time));
  10879. }
  10880. function trailingEdge(time) {
  10881. timerId = undefined;
  10882. // Only invoke if we have `lastArgs` which means `func` has been
  10883. // debounced at least once.
  10884. if (trailing && lastArgs) {
  10885. return invokeFunc(time);
  10886. }
  10887. lastArgs = lastThis = undefined;
  10888. return result;
  10889. }
  10890. function cancel() {
  10891. if (timerId !== undefined) {
  10892. clearTimeout(timerId);
  10893. }
  10894. lastInvokeTime = 0;
  10895. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10896. }
  10897. function flush() {
  10898. return timerId === undefined ? result : trailingEdge(now());
  10899. }
  10900. function debounced() {
  10901. var time = now(),
  10902. isInvoking = shouldInvoke(time);
  10903. lastArgs = arguments;
  10904. lastThis = this;
  10905. lastCallTime = time;
  10906. if (isInvoking) {
  10907. if (timerId === undefined) {
  10908. return leadingEdge(lastCallTime);
  10909. }
  10910. if (maxing) {
  10911. // Handle invocations in a tight loop.
  10912. clearTimeout(timerId);
  10913. timerId = setTimeout(timerExpired, wait);
  10914. return invokeFunc(lastCallTime);
  10915. }
  10916. }
  10917. if (timerId === undefined) {
  10918. timerId = setTimeout(timerExpired, wait);
  10919. }
  10920. return result;
  10921. }
  10922. debounced.cancel = cancel;
  10923. debounced.flush = flush;
  10924. return debounced;
  10925. }
  10926. /**
  10927. * Defers invoking the `func` until the current call stack has cleared. Any
  10928. * additional arguments are provided to `func` when it's invoked.
  10929. *
  10930. * @static
  10931. * @memberOf _
  10932. * @since 0.1.0
  10933. * @category Function
  10934. * @param {Function} func The function to defer.
  10935. * @param {...*} [args] The arguments to invoke `func` with.
  10936. * @returns {number} Returns the timer id.
  10937. * @example
  10938. *
  10939. * _.defer(function(text) {
  10940. * console.log(text);
  10941. * }, 'deferred');
  10942. * // => Logs 'deferred' after one millisecond.
  10943. */
  10944. var defer = baseRest(function(func, args) {
  10945. return baseDelay(func, 1, args);
  10946. });
  10947. /**
  10948. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10949. * provided to `func` when it's invoked.
  10950. *
  10951. * @static
  10952. * @memberOf _
  10953. * @since 0.1.0
  10954. * @category Function
  10955. * @param {Function} func The function to delay.
  10956. * @param {number} wait The number of milliseconds to delay invocation.
  10957. * @param {...*} [args] The arguments to invoke `func` with.
  10958. * @returns {number} Returns the timer id.
  10959. * @example
  10960. *
  10961. * _.delay(function(text) {
  10962. * console.log(text);
  10963. * }, 1000, 'later');
  10964. * // => Logs 'later' after one second.
  10965. */
  10966. var delay = baseRest(function(func, wait, args) {
  10967. return baseDelay(func, toNumber(wait) || 0, args);
  10968. });
  10969. /**
  10970. * Creates a function that invokes `func` with arguments reversed.
  10971. *
  10972. * @static
  10973. * @memberOf _
  10974. * @since 4.0.0
  10975. * @category Function
  10976. * @param {Function} func The function to flip arguments for.
  10977. * @returns {Function} Returns the new flipped function.
  10978. * @example
  10979. *
  10980. * var flipped = _.flip(function() {
  10981. * return _.toArray(arguments);
  10982. * });
  10983. *
  10984. * flipped('a', 'b', 'c', 'd');
  10985. * // => ['d', 'c', 'b', 'a']
  10986. */
  10987. function flip(func) {
  10988. return createWrap(func, WRAP_FLIP_FLAG);
  10989. }
  10990. /**
  10991. * Creates a function that memoizes the result of `func`. If `resolver` is
  10992. * provided, it determines the cache key for storing the result based on the
  10993. * arguments provided to the memoized function. By default, the first argument
  10994. * provided to the memoized function is used as the map cache key. The `func`
  10995. * is invoked with the `this` binding of the memoized function.
  10996. *
  10997. * **Note:** The cache is exposed as the `cache` property on the memoized
  10998. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10999. * constructor with one whose instances implement the
  11000. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11001. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11002. *
  11003. * @static
  11004. * @memberOf _
  11005. * @since 0.1.0
  11006. * @category Function
  11007. * @param {Function} func The function to have its output memoized.
  11008. * @param {Function} [resolver] The function to resolve the cache key.
  11009. * @returns {Function} Returns the new memoized function.
  11010. * @example
  11011. *
  11012. * var object = { 'a': 1, 'b': 2 };
  11013. * var other = { 'c': 3, 'd': 4 };
  11014. *
  11015. * var values = _.memoize(_.values);
  11016. * values(object);
  11017. * // => [1, 2]
  11018. *
  11019. * values(other);
  11020. * // => [3, 4]
  11021. *
  11022. * object.a = 2;
  11023. * values(object);
  11024. * // => [1, 2]
  11025. *
  11026. * // Modify the result cache.
  11027. * values.cache.set(object, ['a', 'b']);
  11028. * values(object);
  11029. * // => ['a', 'b']
  11030. *
  11031. * // Replace `_.memoize.Cache`.
  11032. * _.memoize.Cache = WeakMap;
  11033. */
  11034. function memoize(func, resolver) {
  11035. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11036. throw new TypeError(FUNC_ERROR_TEXT);
  11037. }
  11038. var memoized = function() {
  11039. var args = arguments,
  11040. key = resolver ? resolver.apply(this, args) : args[0],
  11041. cache = memoized.cache;
  11042. if (cache.has(key)) {
  11043. return cache.get(key);
  11044. }
  11045. var result = func.apply(this, args);
  11046. memoized.cache = cache.set(key, result) || cache;
  11047. return result;
  11048. };
  11049. memoized.cache = new (memoize.Cache || MapCache);
  11050. return memoized;
  11051. }
  11052. // Expose `MapCache`.
  11053. memoize.Cache = MapCache;
  11054. /**
  11055. * Creates a function that negates the result of the predicate `func`. The
  11056. * `func` predicate is invoked with the `this` binding and arguments of the
  11057. * created function.
  11058. *
  11059. * @static
  11060. * @memberOf _
  11061. * @since 3.0.0
  11062. * @category Function
  11063. * @param {Function} predicate The predicate to negate.
  11064. * @returns {Function} Returns the new negated function.
  11065. * @example
  11066. *
  11067. * function isEven(n) {
  11068. * return n % 2 == 0;
  11069. * }
  11070. *
  11071. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11072. * // => [1, 3, 5]
  11073. */
  11074. function negate(predicate) {
  11075. if (typeof predicate != 'function') {
  11076. throw new TypeError(FUNC_ERROR_TEXT);
  11077. }
  11078. return function() {
  11079. var args = arguments;
  11080. switch (args.length) {
  11081. case 0: return !predicate.call(this);
  11082. case 1: return !predicate.call(this, args[0]);
  11083. case 2: return !predicate.call(this, args[0], args[1]);
  11084. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11085. }
  11086. return !predicate.apply(this, args);
  11087. };
  11088. }
  11089. /**
  11090. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11091. * to the function return the value of the first invocation. The `func` is
  11092. * invoked with the `this` binding and arguments of the created function.
  11093. *
  11094. * @static
  11095. * @memberOf _
  11096. * @since 0.1.0
  11097. * @category Function
  11098. * @param {Function} func The function to restrict.
  11099. * @returns {Function} Returns the new restricted function.
  11100. * @example
  11101. *
  11102. * var initialize = _.once(createApplication);
  11103. * initialize();
  11104. * initialize();
  11105. * // => `createApplication` is invoked once
  11106. */
  11107. function once(func) {
  11108. return before(2, func);
  11109. }
  11110. /**
  11111. * Creates a function that invokes `func` with its arguments transformed.
  11112. *
  11113. * @static
  11114. * @since 4.0.0
  11115. * @memberOf _
  11116. * @category Function
  11117. * @param {Function} func The function to wrap.
  11118. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11119. * The argument transforms.
  11120. * @returns {Function} Returns the new function.
  11121. * @example
  11122. *
  11123. * function doubled(n) {
  11124. * return n * 2;
  11125. * }
  11126. *
  11127. * function square(n) {
  11128. * return n * n;
  11129. * }
  11130. *
  11131. * var func = _.overArgs(function(x, y) {
  11132. * return [x, y];
  11133. * }, [square, doubled]);
  11134. *
  11135. * func(9, 3);
  11136. * // => [81, 6]
  11137. *
  11138. * func(10, 5);
  11139. * // => [100, 10]
  11140. */
  11141. var overArgs = castRest(function(func, transforms) {
  11142. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11143. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11144. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11145. var funcsLength = transforms.length;
  11146. return baseRest(function(args) {
  11147. var index = -1,
  11148. length = nativeMin(args.length, funcsLength);
  11149. while (++index < length) {
  11150. args[index] = transforms[index].call(this, args[index]);
  11151. }
  11152. return apply(func, this, args);
  11153. });
  11154. });
  11155. /**
  11156. * Creates a function that invokes `func` with `partials` prepended to the
  11157. * arguments it receives. This method is like `_.bind` except it does **not**
  11158. * alter the `this` binding.
  11159. *
  11160. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11161. * builds, may be used as a placeholder for partially applied arguments.
  11162. *
  11163. * **Note:** This method doesn't set the "length" property of partially
  11164. * applied functions.
  11165. *
  11166. * @static
  11167. * @memberOf _
  11168. * @since 0.2.0
  11169. * @category Function
  11170. * @param {Function} func The function to partially apply arguments to.
  11171. * @param {...*} [partials] The arguments to be partially applied.
  11172. * @returns {Function} Returns the new partially applied function.
  11173. * @example
  11174. *
  11175. * function greet(greeting, name) {
  11176. * return greeting + ' ' + name;
  11177. * }
  11178. *
  11179. * var sayHelloTo = _.partial(greet, 'hello');
  11180. * sayHelloTo('fred');
  11181. * // => 'hello fred'
  11182. *
  11183. * // Partially applied with placeholders.
  11184. * var greetFred = _.partial(greet, _, 'fred');
  11185. * greetFred('hi');
  11186. * // => 'hi fred'
  11187. */
  11188. var partial = baseRest(function(func, partials) {
  11189. var holders = replaceHolders(partials, getHolder(partial));
  11190. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11191. });
  11192. /**
  11193. * This method is like `_.partial` except that partially applied arguments
  11194. * are appended to the arguments it receives.
  11195. *
  11196. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11197. * builds, may be used as a placeholder for partially applied arguments.
  11198. *
  11199. * **Note:** This method doesn't set the "length" property of partially
  11200. * applied functions.
  11201. *
  11202. * @static
  11203. * @memberOf _
  11204. * @since 1.0.0
  11205. * @category Function
  11206. * @param {Function} func The function to partially apply arguments to.
  11207. * @param {...*} [partials] The arguments to be partially applied.
  11208. * @returns {Function} Returns the new partially applied function.
  11209. * @example
  11210. *
  11211. * function greet(greeting, name) {
  11212. * return greeting + ' ' + name;
  11213. * }
  11214. *
  11215. * var greetFred = _.partialRight(greet, 'fred');
  11216. * greetFred('hi');
  11217. * // => 'hi fred'
  11218. *
  11219. * // Partially applied with placeholders.
  11220. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11221. * sayHelloTo('fred');
  11222. * // => 'hello fred'
  11223. */
  11224. var partialRight = baseRest(function(func, partials) {
  11225. var holders = replaceHolders(partials, getHolder(partialRight));
  11226. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11227. });
  11228. /**
  11229. * Creates a function that invokes `func` with arguments arranged according
  11230. * to the specified `indexes` where the argument value at the first index is
  11231. * provided as the first argument, the argument value at the second index is
  11232. * provided as the second argument, and so on.
  11233. *
  11234. * @static
  11235. * @memberOf _
  11236. * @since 3.0.0
  11237. * @category Function
  11238. * @param {Function} func The function to rearrange arguments for.
  11239. * @param {...(number|number[])} indexes The arranged argument indexes.
  11240. * @returns {Function} Returns the new function.
  11241. * @example
  11242. *
  11243. * var rearged = _.rearg(function(a, b, c) {
  11244. * return [a, b, c];
  11245. * }, [2, 0, 1]);
  11246. *
  11247. * rearged('b', 'c', 'a')
  11248. * // => ['a', 'b', 'c']
  11249. */
  11250. var rearg = flatRest(function(func, indexes) {
  11251. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11252. });
  11253. /**
  11254. * Creates a function that invokes `func` with the `this` binding of the
  11255. * created function and arguments from `start` and beyond provided as
  11256. * an array.
  11257. *
  11258. * **Note:** This method is based on the
  11259. * [rest parameter](https://mdn.io/rest_parameters).
  11260. *
  11261. * @static
  11262. * @memberOf _
  11263. * @since 4.0.0
  11264. * @category Function
  11265. * @param {Function} func The function to apply a rest parameter to.
  11266. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11267. * @returns {Function} Returns the new function.
  11268. * @example
  11269. *
  11270. * var say = _.rest(function(what, names) {
  11271. * return what + ' ' + _.initial(names).join(', ') +
  11272. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11273. * });
  11274. *
  11275. * say('hello', 'fred', 'barney', 'pebbles');
  11276. * // => 'hello fred, barney, & pebbles'
  11277. */
  11278. function rest(func, start) {
  11279. if (typeof func != 'function') {
  11280. throw new TypeError(FUNC_ERROR_TEXT);
  11281. }
  11282. start = start === undefined ? start : toInteger(start);
  11283. return baseRest(func, start);
  11284. }
  11285. /**
  11286. * Creates a function that invokes `func` with the `this` binding of the
  11287. * create function and an array of arguments much like
  11288. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11289. *
  11290. * **Note:** This method is based on the
  11291. * [spread operator](https://mdn.io/spread_operator).
  11292. *
  11293. * @static
  11294. * @memberOf _
  11295. * @since 3.2.0
  11296. * @category Function
  11297. * @param {Function} func The function to spread arguments over.
  11298. * @param {number} [start=0] The start position of the spread.
  11299. * @returns {Function} Returns the new function.
  11300. * @example
  11301. *
  11302. * var say = _.spread(function(who, what) {
  11303. * return who + ' says ' + what;
  11304. * });
  11305. *
  11306. * say(['fred', 'hello']);
  11307. * // => 'fred says hello'
  11308. *
  11309. * var numbers = Promise.all([
  11310. * Promise.resolve(40),
  11311. * Promise.resolve(36)
  11312. * ]);
  11313. *
  11314. * numbers.then(_.spread(function(x, y) {
  11315. * return x + y;
  11316. * }));
  11317. * // => a Promise of 76
  11318. */
  11319. function spread(func, start) {
  11320. if (typeof func != 'function') {
  11321. throw new TypeError(FUNC_ERROR_TEXT);
  11322. }
  11323. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11324. return baseRest(function(args) {
  11325. var array = args[start],
  11326. otherArgs = castSlice(args, 0, start);
  11327. if (array) {
  11328. arrayPush(otherArgs, array);
  11329. }
  11330. return apply(func, this, otherArgs);
  11331. });
  11332. }
  11333. /**
  11334. * Creates a throttled function that only invokes `func` at most once per
  11335. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11336. * method to cancel delayed `func` invocations and a `flush` method to
  11337. * immediately invoke them. Provide `options` to indicate whether `func`
  11338. * should be invoked on the leading and/or trailing edge of the `wait`
  11339. * timeout. The `func` is invoked with the last arguments provided to the
  11340. * throttled function. Subsequent calls to the throttled function return the
  11341. * result of the last `func` invocation.
  11342. *
  11343. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11344. * invoked on the trailing edge of the timeout only if the throttled function
  11345. * is invoked more than once during the `wait` timeout.
  11346. *
  11347. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11348. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11349. *
  11350. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11351. * for details over the differences between `_.throttle` and `_.debounce`.
  11352. *
  11353. * @static
  11354. * @memberOf _
  11355. * @since 0.1.0
  11356. * @category Function
  11357. * @param {Function} func The function to throttle.
  11358. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11359. * @param {Object} [options={}] The options object.
  11360. * @param {boolean} [options.leading=true]
  11361. * Specify invoking on the leading edge of the timeout.
  11362. * @param {boolean} [options.trailing=true]
  11363. * Specify invoking on the trailing edge of the timeout.
  11364. * @returns {Function} Returns the new throttled function.
  11365. * @example
  11366. *
  11367. * // Avoid excessively updating the position while scrolling.
  11368. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11369. *
  11370. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11371. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11372. * jQuery(element).on('click', throttled);
  11373. *
  11374. * // Cancel the trailing throttled invocation.
  11375. * jQuery(window).on('popstate', throttled.cancel);
  11376. */
  11377. function throttle(func, wait, options) {
  11378. var leading = true,
  11379. trailing = true;
  11380. if (typeof func != 'function') {
  11381. throw new TypeError(FUNC_ERROR_TEXT);
  11382. }
  11383. if (isObject(options)) {
  11384. leading = 'leading' in options ? !!options.leading : leading;
  11385. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11386. }
  11387. return debounce(func, wait, {
  11388. 'leading': leading,
  11389. 'maxWait': wait,
  11390. 'trailing': trailing
  11391. });
  11392. }
  11393. /**
  11394. * Creates a function that accepts up to one argument, ignoring any
  11395. * additional arguments.
  11396. *
  11397. * @static
  11398. * @memberOf _
  11399. * @since 4.0.0
  11400. * @category Function
  11401. * @param {Function} func The function to cap arguments for.
  11402. * @returns {Function} Returns the new capped function.
  11403. * @example
  11404. *
  11405. * _.map(['6', '8', '10'], _.unary(parseInt));
  11406. * // => [6, 8, 10]
  11407. */
  11408. function unary(func) {
  11409. return ary(func, 1);
  11410. }
  11411. /**
  11412. * Creates a function that provides `value` to `wrapper` as its first
  11413. * argument. Any additional arguments provided to the function are appended
  11414. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11415. * binding of the created function.
  11416. *
  11417. * @static
  11418. * @memberOf _
  11419. * @since 0.1.0
  11420. * @category Function
  11421. * @param {*} value The value to wrap.
  11422. * @param {Function} [wrapper=identity] The wrapper function.
  11423. * @returns {Function} Returns the new function.
  11424. * @example
  11425. *
  11426. * var p = _.wrap(_.escape, function(func, text) {
  11427. * return '<p>' + func(text) + '</p>';
  11428. * });
  11429. *
  11430. * p('fred, barney, & pebbles');
  11431. * // => '<p>fred, barney, &amp; pebbles</p>'
  11432. */
  11433. function wrap(value, wrapper) {
  11434. return partial(castFunction(wrapper), value);
  11435. }
  11436. /*------------------------------------------------------------------------*/
  11437. /**
  11438. * Casts `value` as an array if it's not one.
  11439. *
  11440. * @static
  11441. * @memberOf _
  11442. * @since 4.4.0
  11443. * @category Lang
  11444. * @param {*} value The value to inspect.
  11445. * @returns {Array} Returns the cast array.
  11446. * @example
  11447. *
  11448. * _.castArray(1);
  11449. * // => [1]
  11450. *
  11451. * _.castArray({ 'a': 1 });
  11452. * // => [{ 'a': 1 }]
  11453. *
  11454. * _.castArray('abc');
  11455. * // => ['abc']
  11456. *
  11457. * _.castArray(null);
  11458. * // => [null]
  11459. *
  11460. * _.castArray(undefined);
  11461. * // => [undefined]
  11462. *
  11463. * _.castArray();
  11464. * // => []
  11465. *
  11466. * var array = [1, 2, 3];
  11467. * console.log(_.castArray(array) === array);
  11468. * // => true
  11469. */
  11470. function castArray() {
  11471. if (!arguments.length) {
  11472. return [];
  11473. }
  11474. var value = arguments[0];
  11475. return isArray(value) ? value : [value];
  11476. }
  11477. /**
  11478. * Creates a shallow clone of `value`.
  11479. *
  11480. * **Note:** This method is loosely based on the
  11481. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11482. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11483. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11484. * arrays. The own enumerable properties of `arguments` objects are cloned
  11485. * as plain objects. An empty object is returned for uncloneable values such
  11486. * as error objects, functions, DOM nodes, and WeakMaps.
  11487. *
  11488. * @static
  11489. * @memberOf _
  11490. * @since 0.1.0
  11491. * @category Lang
  11492. * @param {*} value The value to clone.
  11493. * @returns {*} Returns the cloned value.
  11494. * @see _.cloneDeep
  11495. * @example
  11496. *
  11497. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11498. *
  11499. * var shallow = _.clone(objects);
  11500. * console.log(shallow[0] === objects[0]);
  11501. * // => true
  11502. */
  11503. function clone(value) {
  11504. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11505. }
  11506. /**
  11507. * This method is like `_.clone` except that it accepts `customizer` which
  11508. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11509. * cloning is handled by the method instead. The `customizer` is invoked with
  11510. * up to four arguments; (value [, index|key, object, stack]).
  11511. *
  11512. * @static
  11513. * @memberOf _
  11514. * @since 4.0.0
  11515. * @category Lang
  11516. * @param {*} value The value to clone.
  11517. * @param {Function} [customizer] The function to customize cloning.
  11518. * @returns {*} Returns the cloned value.
  11519. * @see _.cloneDeepWith
  11520. * @example
  11521. *
  11522. * function customizer(value) {
  11523. * if (_.isElement(value)) {
  11524. * return value.cloneNode(false);
  11525. * }
  11526. * }
  11527. *
  11528. * var el = _.cloneWith(document.body, customizer);
  11529. *
  11530. * console.log(el === document.body);
  11531. * // => false
  11532. * console.log(el.nodeName);
  11533. * // => 'BODY'
  11534. * console.log(el.childNodes.length);
  11535. * // => 0
  11536. */
  11537. function cloneWith(value, customizer) {
  11538. customizer = typeof customizer == 'function' ? customizer : undefined;
  11539. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11540. }
  11541. /**
  11542. * This method is like `_.clone` except that it recursively clones `value`.
  11543. *
  11544. * @static
  11545. * @memberOf _
  11546. * @since 1.0.0
  11547. * @category Lang
  11548. * @param {*} value The value to recursively clone.
  11549. * @returns {*} Returns the deep cloned value.
  11550. * @see _.clone
  11551. * @example
  11552. *
  11553. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11554. *
  11555. * var deep = _.cloneDeep(objects);
  11556. * console.log(deep[0] === objects[0]);
  11557. * // => false
  11558. */
  11559. function cloneDeep(value) {
  11560. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11561. }
  11562. /**
  11563. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11564. *
  11565. * @static
  11566. * @memberOf _
  11567. * @since 4.0.0
  11568. * @category Lang
  11569. * @param {*} value The value to recursively clone.
  11570. * @param {Function} [customizer] The function to customize cloning.
  11571. * @returns {*} Returns the deep cloned value.
  11572. * @see _.cloneWith
  11573. * @example
  11574. *
  11575. * function customizer(value) {
  11576. * if (_.isElement(value)) {
  11577. * return value.cloneNode(true);
  11578. * }
  11579. * }
  11580. *
  11581. * var el = _.cloneDeepWith(document.body, customizer);
  11582. *
  11583. * console.log(el === document.body);
  11584. * // => false
  11585. * console.log(el.nodeName);
  11586. * // => 'BODY'
  11587. * console.log(el.childNodes.length);
  11588. * // => 20
  11589. */
  11590. function cloneDeepWith(value, customizer) {
  11591. customizer = typeof customizer == 'function' ? customizer : undefined;
  11592. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11593. }
  11594. /**
  11595. * Checks if `object` conforms to `source` by invoking the predicate
  11596. * properties of `source` with the corresponding property values of `object`.
  11597. *
  11598. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11599. * partially applied.
  11600. *
  11601. * @static
  11602. * @memberOf _
  11603. * @since 4.14.0
  11604. * @category Lang
  11605. * @param {Object} object The object to inspect.
  11606. * @param {Object} source The object of property predicates to conform to.
  11607. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11608. * @example
  11609. *
  11610. * var object = { 'a': 1, 'b': 2 };
  11611. *
  11612. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11613. * // => true
  11614. *
  11615. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11616. * // => false
  11617. */
  11618. function conformsTo(object, source) {
  11619. return source == null || baseConformsTo(object, source, keys(source));
  11620. }
  11621. /**
  11622. * Performs a
  11623. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11624. * comparison between two values to determine if they are equivalent.
  11625. *
  11626. * @static
  11627. * @memberOf _
  11628. * @since 4.0.0
  11629. * @category Lang
  11630. * @param {*} value The value to compare.
  11631. * @param {*} other The other value to compare.
  11632. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11633. * @example
  11634. *
  11635. * var object = { 'a': 1 };
  11636. * var other = { 'a': 1 };
  11637. *
  11638. * _.eq(object, object);
  11639. * // => true
  11640. *
  11641. * _.eq(object, other);
  11642. * // => false
  11643. *
  11644. * _.eq('a', 'a');
  11645. * // => true
  11646. *
  11647. * _.eq('a', Object('a'));
  11648. * // => false
  11649. *
  11650. * _.eq(NaN, NaN);
  11651. * // => true
  11652. */
  11653. function eq(value, other) {
  11654. return value === other || (value !== value && other !== other);
  11655. }
  11656. /**
  11657. * Checks if `value` is greater than `other`.
  11658. *
  11659. * @static
  11660. * @memberOf _
  11661. * @since 3.9.0
  11662. * @category Lang
  11663. * @param {*} value The value to compare.
  11664. * @param {*} other The other value to compare.
  11665. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11666. * else `false`.
  11667. * @see _.lt
  11668. * @example
  11669. *
  11670. * _.gt(3, 1);
  11671. * // => true
  11672. *
  11673. * _.gt(3, 3);
  11674. * // => false
  11675. *
  11676. * _.gt(1, 3);
  11677. * // => false
  11678. */
  11679. var gt = createRelationalOperation(baseGt);
  11680. /**
  11681. * Checks if `value` is greater than or equal to `other`.
  11682. *
  11683. * @static
  11684. * @memberOf _
  11685. * @since 3.9.0
  11686. * @category Lang
  11687. * @param {*} value The value to compare.
  11688. * @param {*} other The other value to compare.
  11689. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11690. * `other`, else `false`.
  11691. * @see _.lte
  11692. * @example
  11693. *
  11694. * _.gte(3, 1);
  11695. * // => true
  11696. *
  11697. * _.gte(3, 3);
  11698. * // => true
  11699. *
  11700. * _.gte(1, 3);
  11701. * // => false
  11702. */
  11703. var gte = createRelationalOperation(function(value, other) {
  11704. return value >= other;
  11705. });
  11706. /**
  11707. * Checks if `value` is likely an `arguments` object.
  11708. *
  11709. * @static
  11710. * @memberOf _
  11711. * @since 0.1.0
  11712. * @category Lang
  11713. * @param {*} value The value to check.
  11714. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11715. * else `false`.
  11716. * @example
  11717. *
  11718. * _.isArguments(function() { return arguments; }());
  11719. * // => true
  11720. *
  11721. * _.isArguments([1, 2, 3]);
  11722. * // => false
  11723. */
  11724. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11725. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11726. !propertyIsEnumerable.call(value, 'callee');
  11727. };
  11728. /**
  11729. * Checks if `value` is classified as an `Array` object.
  11730. *
  11731. * @static
  11732. * @memberOf _
  11733. * @since 0.1.0
  11734. * @category Lang
  11735. * @param {*} value The value to check.
  11736. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11737. * @example
  11738. *
  11739. * _.isArray([1, 2, 3]);
  11740. * // => true
  11741. *
  11742. * _.isArray(document.body.children);
  11743. * // => false
  11744. *
  11745. * _.isArray('abc');
  11746. * // => false
  11747. *
  11748. * _.isArray(_.noop);
  11749. * // => false
  11750. */
  11751. var isArray = Array.isArray;
  11752. /**
  11753. * Checks if `value` is classified as an `ArrayBuffer` object.
  11754. *
  11755. * @static
  11756. * @memberOf _
  11757. * @since 4.3.0
  11758. * @category Lang
  11759. * @param {*} value The value to check.
  11760. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11761. * @example
  11762. *
  11763. * _.isArrayBuffer(new ArrayBuffer(2));
  11764. * // => true
  11765. *
  11766. * _.isArrayBuffer(new Array(2));
  11767. * // => false
  11768. */
  11769. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11770. /**
  11771. * Checks if `value` is array-like. A value is considered array-like if it's
  11772. * not a function and has a `value.length` that's an integer greater than or
  11773. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11774. *
  11775. * @static
  11776. * @memberOf _
  11777. * @since 4.0.0
  11778. * @category Lang
  11779. * @param {*} value The value to check.
  11780. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11781. * @example
  11782. *
  11783. * _.isArrayLike([1, 2, 3]);
  11784. * // => true
  11785. *
  11786. * _.isArrayLike(document.body.children);
  11787. * // => true
  11788. *
  11789. * _.isArrayLike('abc');
  11790. * // => true
  11791. *
  11792. * _.isArrayLike(_.noop);
  11793. * // => false
  11794. */
  11795. function isArrayLike(value) {
  11796. return value != null && isLength(value.length) && !isFunction(value);
  11797. }
  11798. /**
  11799. * This method is like `_.isArrayLike` except that it also checks if `value`
  11800. * is an object.
  11801. *
  11802. * @static
  11803. * @memberOf _
  11804. * @since 4.0.0
  11805. * @category Lang
  11806. * @param {*} value The value to check.
  11807. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11808. * else `false`.
  11809. * @example
  11810. *
  11811. * _.isArrayLikeObject([1, 2, 3]);
  11812. * // => true
  11813. *
  11814. * _.isArrayLikeObject(document.body.children);
  11815. * // => true
  11816. *
  11817. * _.isArrayLikeObject('abc');
  11818. * // => false
  11819. *
  11820. * _.isArrayLikeObject(_.noop);
  11821. * // => false
  11822. */
  11823. function isArrayLikeObject(value) {
  11824. return isObjectLike(value) && isArrayLike(value);
  11825. }
  11826. /**
  11827. * Checks if `value` is classified as a boolean primitive or object.
  11828. *
  11829. * @static
  11830. * @memberOf _
  11831. * @since 0.1.0
  11832. * @category Lang
  11833. * @param {*} value The value to check.
  11834. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11835. * @example
  11836. *
  11837. * _.isBoolean(false);
  11838. * // => true
  11839. *
  11840. * _.isBoolean(null);
  11841. * // => false
  11842. */
  11843. function isBoolean(value) {
  11844. return value === true || value === false ||
  11845. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11846. }
  11847. /**
  11848. * Checks if `value` is a buffer.
  11849. *
  11850. * @static
  11851. * @memberOf _
  11852. * @since 4.3.0
  11853. * @category Lang
  11854. * @param {*} value The value to check.
  11855. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11856. * @example
  11857. *
  11858. * _.isBuffer(new Buffer(2));
  11859. * // => true
  11860. *
  11861. * _.isBuffer(new Uint8Array(2));
  11862. * // => false
  11863. */
  11864. var isBuffer = nativeIsBuffer || stubFalse;
  11865. /**
  11866. * Checks if `value` is classified as a `Date` object.
  11867. *
  11868. * @static
  11869. * @memberOf _
  11870. * @since 0.1.0
  11871. * @category Lang
  11872. * @param {*} value The value to check.
  11873. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11874. * @example
  11875. *
  11876. * _.isDate(new Date);
  11877. * // => true
  11878. *
  11879. * _.isDate('Mon April 23 2012');
  11880. * // => false
  11881. */
  11882. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11883. /**
  11884. * Checks if `value` is likely a DOM element.
  11885. *
  11886. * @static
  11887. * @memberOf _
  11888. * @since 0.1.0
  11889. * @category Lang
  11890. * @param {*} value The value to check.
  11891. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11892. * @example
  11893. *
  11894. * _.isElement(document.body);
  11895. * // => true
  11896. *
  11897. * _.isElement('<body>');
  11898. * // => false
  11899. */
  11900. function isElement(value) {
  11901. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11902. }
  11903. /**
  11904. * Checks if `value` is an empty object, collection, map, or set.
  11905. *
  11906. * Objects are considered empty if they have no own enumerable string keyed
  11907. * properties.
  11908. *
  11909. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11910. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11911. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11912. *
  11913. * @static
  11914. * @memberOf _
  11915. * @since 0.1.0
  11916. * @category Lang
  11917. * @param {*} value The value to check.
  11918. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11919. * @example
  11920. *
  11921. * _.isEmpty(null);
  11922. * // => true
  11923. *
  11924. * _.isEmpty(true);
  11925. * // => true
  11926. *
  11927. * _.isEmpty(1);
  11928. * // => true
  11929. *
  11930. * _.isEmpty([1, 2, 3]);
  11931. * // => false
  11932. *
  11933. * _.isEmpty({ 'a': 1 });
  11934. * // => false
  11935. */
  11936. function isEmpty(value) {
  11937. if (value == null) {
  11938. return true;
  11939. }
  11940. if (isArrayLike(value) &&
  11941. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11942. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11943. return !value.length;
  11944. }
  11945. var tag = getTag(value);
  11946. if (tag == mapTag || tag == setTag) {
  11947. return !value.size;
  11948. }
  11949. if (isPrototype(value)) {
  11950. return !baseKeys(value).length;
  11951. }
  11952. for (var key in value) {
  11953. if (hasOwnProperty.call(value, key)) {
  11954. return false;
  11955. }
  11956. }
  11957. return true;
  11958. }
  11959. /**
  11960. * Performs a deep comparison between two values to determine if they are
  11961. * equivalent.
  11962. *
  11963. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11964. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11965. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11966. * by their own, not inherited, enumerable properties. Functions and DOM
  11967. * nodes are compared by strict equality, i.e. `===`.
  11968. *
  11969. * @static
  11970. * @memberOf _
  11971. * @since 0.1.0
  11972. * @category Lang
  11973. * @param {*} value The value to compare.
  11974. * @param {*} other The other value to compare.
  11975. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11976. * @example
  11977. *
  11978. * var object = { 'a': 1 };
  11979. * var other = { 'a': 1 };
  11980. *
  11981. * _.isEqual(object, other);
  11982. * // => true
  11983. *
  11984. * object === other;
  11985. * // => false
  11986. */
  11987. function isEqual(value, other) {
  11988. return baseIsEqual(value, other);
  11989. }
  11990. /**
  11991. * This method is like `_.isEqual` except that it accepts `customizer` which
  11992. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11993. * are handled by the method instead. The `customizer` is invoked with up to
  11994. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11995. *
  11996. * @static
  11997. * @memberOf _
  11998. * @since 4.0.0
  11999. * @category Lang
  12000. * @param {*} value The value to compare.
  12001. * @param {*} other The other value to compare.
  12002. * @param {Function} [customizer] The function to customize comparisons.
  12003. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12004. * @example
  12005. *
  12006. * function isGreeting(value) {
  12007. * return /^h(?:i|ello)$/.test(value);
  12008. * }
  12009. *
  12010. * function customizer(objValue, othValue) {
  12011. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12012. * return true;
  12013. * }
  12014. * }
  12015. *
  12016. * var array = ['hello', 'goodbye'];
  12017. * var other = ['hi', 'goodbye'];
  12018. *
  12019. * _.isEqualWith(array, other, customizer);
  12020. * // => true
  12021. */
  12022. function isEqualWith(value, other, customizer) {
  12023. customizer = typeof customizer == 'function' ? customizer : undefined;
  12024. var result = customizer ? customizer(value, other) : undefined;
  12025. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12026. }
  12027. /**
  12028. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12029. * `SyntaxError`, `TypeError`, or `URIError` object.
  12030. *
  12031. * @static
  12032. * @memberOf _
  12033. * @since 3.0.0
  12034. * @category Lang
  12035. * @param {*} value The value to check.
  12036. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12037. * @example
  12038. *
  12039. * _.isError(new Error);
  12040. * // => true
  12041. *
  12042. * _.isError(Error);
  12043. * // => false
  12044. */
  12045. function isError(value) {
  12046. if (!isObjectLike(value)) {
  12047. return false;
  12048. }
  12049. var tag = baseGetTag(value);
  12050. return tag == errorTag || tag == domExcTag ||
  12051. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12052. }
  12053. /**
  12054. * Checks if `value` is a finite primitive number.
  12055. *
  12056. * **Note:** This method is based on
  12057. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12058. *
  12059. * @static
  12060. * @memberOf _
  12061. * @since 0.1.0
  12062. * @category Lang
  12063. * @param {*} value The value to check.
  12064. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12065. * @example
  12066. *
  12067. * _.isFinite(3);
  12068. * // => true
  12069. *
  12070. * _.isFinite(Number.MIN_VALUE);
  12071. * // => true
  12072. *
  12073. * _.isFinite(Infinity);
  12074. * // => false
  12075. *
  12076. * _.isFinite('3');
  12077. * // => false
  12078. */
  12079. function isFinite(value) {
  12080. return typeof value == 'number' && nativeIsFinite(value);
  12081. }
  12082. /**
  12083. * Checks if `value` is classified as a `Function` object.
  12084. *
  12085. * @static
  12086. * @memberOf _
  12087. * @since 0.1.0
  12088. * @category Lang
  12089. * @param {*} value The value to check.
  12090. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12091. * @example
  12092. *
  12093. * _.isFunction(_);
  12094. * // => true
  12095. *
  12096. * _.isFunction(/abc/);
  12097. * // => false
  12098. */
  12099. function isFunction(value) {
  12100. if (!isObject(value)) {
  12101. return false;
  12102. }
  12103. // The use of `Object#toString` avoids issues with the `typeof` operator
  12104. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12105. var tag = baseGetTag(value);
  12106. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12107. }
  12108. /**
  12109. * Checks if `value` is an integer.
  12110. *
  12111. * **Note:** This method is based on
  12112. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12113. *
  12114. * @static
  12115. * @memberOf _
  12116. * @since 4.0.0
  12117. * @category Lang
  12118. * @param {*} value The value to check.
  12119. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12120. * @example
  12121. *
  12122. * _.isInteger(3);
  12123. * // => true
  12124. *
  12125. * _.isInteger(Number.MIN_VALUE);
  12126. * // => false
  12127. *
  12128. * _.isInteger(Infinity);
  12129. * // => false
  12130. *
  12131. * _.isInteger('3');
  12132. * // => false
  12133. */
  12134. function isInteger(value) {
  12135. return typeof value == 'number' && value == toInteger(value);
  12136. }
  12137. /**
  12138. * Checks if `value` is a valid array-like length.
  12139. *
  12140. * **Note:** This method is loosely based on
  12141. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12142. *
  12143. * @static
  12144. * @memberOf _
  12145. * @since 4.0.0
  12146. * @category Lang
  12147. * @param {*} value The value to check.
  12148. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12149. * @example
  12150. *
  12151. * _.isLength(3);
  12152. * // => true
  12153. *
  12154. * _.isLength(Number.MIN_VALUE);
  12155. * // => false
  12156. *
  12157. * _.isLength(Infinity);
  12158. * // => false
  12159. *
  12160. * _.isLength('3');
  12161. * // => false
  12162. */
  12163. function isLength(value) {
  12164. return typeof value == 'number' &&
  12165. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12166. }
  12167. /**
  12168. * Checks if `value` is the
  12169. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12170. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12171. *
  12172. * @static
  12173. * @memberOf _
  12174. * @since 0.1.0
  12175. * @category Lang
  12176. * @param {*} value The value to check.
  12177. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12178. * @example
  12179. *
  12180. * _.isObject({});
  12181. * // => true
  12182. *
  12183. * _.isObject([1, 2, 3]);
  12184. * // => true
  12185. *
  12186. * _.isObject(_.noop);
  12187. * // => true
  12188. *
  12189. * _.isObject(null);
  12190. * // => false
  12191. */
  12192. function isObject(value) {
  12193. var type = typeof value;
  12194. return value != null && (type == 'object' || type == 'function');
  12195. }
  12196. /**
  12197. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12198. * and has a `typeof` result of "object".
  12199. *
  12200. * @static
  12201. * @memberOf _
  12202. * @since 4.0.0
  12203. * @category Lang
  12204. * @param {*} value The value to check.
  12205. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12206. * @example
  12207. *
  12208. * _.isObjectLike({});
  12209. * // => true
  12210. *
  12211. * _.isObjectLike([1, 2, 3]);
  12212. * // => true
  12213. *
  12214. * _.isObjectLike(_.noop);
  12215. * // => false
  12216. *
  12217. * _.isObjectLike(null);
  12218. * // => false
  12219. */
  12220. function isObjectLike(value) {
  12221. return value != null && typeof value == 'object';
  12222. }
  12223. /**
  12224. * Checks if `value` is classified as a `Map` object.
  12225. *
  12226. * @static
  12227. * @memberOf _
  12228. * @since 4.3.0
  12229. * @category Lang
  12230. * @param {*} value The value to check.
  12231. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12232. * @example
  12233. *
  12234. * _.isMap(new Map);
  12235. * // => true
  12236. *
  12237. * _.isMap(new WeakMap);
  12238. * // => false
  12239. */
  12240. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12241. /**
  12242. * Performs a partial deep comparison between `object` and `source` to
  12243. * determine if `object` contains equivalent property values.
  12244. *
  12245. * **Note:** This method is equivalent to `_.matches` when `source` is
  12246. * partially applied.
  12247. *
  12248. * Partial comparisons will match empty array and empty object `source`
  12249. * values against any array or object value, respectively. See `_.isEqual`
  12250. * for a list of supported value comparisons.
  12251. *
  12252. * @static
  12253. * @memberOf _
  12254. * @since 3.0.0
  12255. * @category Lang
  12256. * @param {Object} object The object to inspect.
  12257. * @param {Object} source The object of property values to match.
  12258. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12259. * @example
  12260. *
  12261. * var object = { 'a': 1, 'b': 2 };
  12262. *
  12263. * _.isMatch(object, { 'b': 2 });
  12264. * // => true
  12265. *
  12266. * _.isMatch(object, { 'b': 1 });
  12267. * // => false
  12268. */
  12269. function isMatch(object, source) {
  12270. return object === source || baseIsMatch(object, source, getMatchData(source));
  12271. }
  12272. /**
  12273. * This method is like `_.isMatch` except that it accepts `customizer` which
  12274. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12275. * are handled by the method instead. The `customizer` is invoked with five
  12276. * arguments: (objValue, srcValue, index|key, object, source).
  12277. *
  12278. * @static
  12279. * @memberOf _
  12280. * @since 4.0.0
  12281. * @category Lang
  12282. * @param {Object} object The object to inspect.
  12283. * @param {Object} source The object of property values to match.
  12284. * @param {Function} [customizer] The function to customize comparisons.
  12285. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12286. * @example
  12287. *
  12288. * function isGreeting(value) {
  12289. * return /^h(?:i|ello)$/.test(value);
  12290. * }
  12291. *
  12292. * function customizer(objValue, srcValue) {
  12293. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12294. * return true;
  12295. * }
  12296. * }
  12297. *
  12298. * var object = { 'greeting': 'hello' };
  12299. * var source = { 'greeting': 'hi' };
  12300. *
  12301. * _.isMatchWith(object, source, customizer);
  12302. * // => true
  12303. */
  12304. function isMatchWith(object, source, customizer) {
  12305. customizer = typeof customizer == 'function' ? customizer : undefined;
  12306. return baseIsMatch(object, source, getMatchData(source), customizer);
  12307. }
  12308. /**
  12309. * Checks if `value` is `NaN`.
  12310. *
  12311. * **Note:** This method is based on
  12312. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12313. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12314. * `undefined` and other non-number values.
  12315. *
  12316. * @static
  12317. * @memberOf _
  12318. * @since 0.1.0
  12319. * @category Lang
  12320. * @param {*} value The value to check.
  12321. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12322. * @example
  12323. *
  12324. * _.isNaN(NaN);
  12325. * // => true
  12326. *
  12327. * _.isNaN(new Number(NaN));
  12328. * // => true
  12329. *
  12330. * isNaN(undefined);
  12331. * // => true
  12332. *
  12333. * _.isNaN(undefined);
  12334. * // => false
  12335. */
  12336. function isNaN(value) {
  12337. // An `NaN` primitive is the only value that is not equal to itself.
  12338. // Perform the `toStringTag` check first to avoid errors with some
  12339. // ActiveX objects in IE.
  12340. return isNumber(value) && value != +value;
  12341. }
  12342. /**
  12343. * Checks if `value` is a pristine native function.
  12344. *
  12345. * **Note:** This method can't reliably detect native functions in the presence
  12346. * of the core-js package because core-js circumvents this kind of detection.
  12347. * Despite multiple requests, the core-js maintainer has made it clear: any
  12348. * attempt to fix the detection will be obstructed. As a result, we're left
  12349. * with little choice but to throw an error. Unfortunately, this also affects
  12350. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12351. * which rely on core-js.
  12352. *
  12353. * @static
  12354. * @memberOf _
  12355. * @since 3.0.0
  12356. * @category Lang
  12357. * @param {*} value The value to check.
  12358. * @returns {boolean} Returns `true` if `value` is a native function,
  12359. * else `false`.
  12360. * @example
  12361. *
  12362. * _.isNative(Array.prototype.push);
  12363. * // => true
  12364. *
  12365. * _.isNative(_);
  12366. * // => false
  12367. */
  12368. function isNative(value) {
  12369. if (isMaskable(value)) {
  12370. throw new Error(CORE_ERROR_TEXT);
  12371. }
  12372. return baseIsNative(value);
  12373. }
  12374. /**
  12375. * Checks if `value` is `null`.
  12376. *
  12377. * @static
  12378. * @memberOf _
  12379. * @since 0.1.0
  12380. * @category Lang
  12381. * @param {*} value The value to check.
  12382. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12383. * @example
  12384. *
  12385. * _.isNull(null);
  12386. * // => true
  12387. *
  12388. * _.isNull(void 0);
  12389. * // => false
  12390. */
  12391. function isNull(value) {
  12392. return value === null;
  12393. }
  12394. /**
  12395. * Checks if `value` is `null` or `undefined`.
  12396. *
  12397. * @static
  12398. * @memberOf _
  12399. * @since 4.0.0
  12400. * @category Lang
  12401. * @param {*} value The value to check.
  12402. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12403. * @example
  12404. *
  12405. * _.isNil(null);
  12406. * // => true
  12407. *
  12408. * _.isNil(void 0);
  12409. * // => true
  12410. *
  12411. * _.isNil(NaN);
  12412. * // => false
  12413. */
  12414. function isNil(value) {
  12415. return value == null;
  12416. }
  12417. /**
  12418. * Checks if `value` is classified as a `Number` primitive or object.
  12419. *
  12420. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12421. * classified as numbers, use the `_.isFinite` method.
  12422. *
  12423. * @static
  12424. * @memberOf _
  12425. * @since 0.1.0
  12426. * @category Lang
  12427. * @param {*} value The value to check.
  12428. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12429. * @example
  12430. *
  12431. * _.isNumber(3);
  12432. * // => true
  12433. *
  12434. * _.isNumber(Number.MIN_VALUE);
  12435. * // => true
  12436. *
  12437. * _.isNumber(Infinity);
  12438. * // => true
  12439. *
  12440. * _.isNumber('3');
  12441. * // => false
  12442. */
  12443. function isNumber(value) {
  12444. return typeof value == 'number' ||
  12445. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12446. }
  12447. /**
  12448. * Checks if `value` is a plain object, that is, an object created by the
  12449. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12450. *
  12451. * @static
  12452. * @memberOf _
  12453. * @since 0.8.0
  12454. * @category Lang
  12455. * @param {*} value The value to check.
  12456. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12457. * @example
  12458. *
  12459. * function Foo() {
  12460. * this.a = 1;
  12461. * }
  12462. *
  12463. * _.isPlainObject(new Foo);
  12464. * // => false
  12465. *
  12466. * _.isPlainObject([1, 2, 3]);
  12467. * // => false
  12468. *
  12469. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12470. * // => true
  12471. *
  12472. * _.isPlainObject(Object.create(null));
  12473. * // => true
  12474. */
  12475. function isPlainObject(value) {
  12476. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12477. return false;
  12478. }
  12479. var proto = getPrototype(value);
  12480. if (proto === null) {
  12481. return true;
  12482. }
  12483. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12484. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12485. funcToString.call(Ctor) == objectCtorString;
  12486. }
  12487. /**
  12488. * Checks if `value` is classified as a `RegExp` object.
  12489. *
  12490. * @static
  12491. * @memberOf _
  12492. * @since 0.1.0
  12493. * @category Lang
  12494. * @param {*} value The value to check.
  12495. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12496. * @example
  12497. *
  12498. * _.isRegExp(/abc/);
  12499. * // => true
  12500. *
  12501. * _.isRegExp('/abc/');
  12502. * // => false
  12503. */
  12504. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12505. /**
  12506. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12507. * double precision number which isn't the result of a rounded unsafe integer.
  12508. *
  12509. * **Note:** This method is based on
  12510. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12511. *
  12512. * @static
  12513. * @memberOf _
  12514. * @since 4.0.0
  12515. * @category Lang
  12516. * @param {*} value The value to check.
  12517. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12518. * @example
  12519. *
  12520. * _.isSafeInteger(3);
  12521. * // => true
  12522. *
  12523. * _.isSafeInteger(Number.MIN_VALUE);
  12524. * // => false
  12525. *
  12526. * _.isSafeInteger(Infinity);
  12527. * // => false
  12528. *
  12529. * _.isSafeInteger('3');
  12530. * // => false
  12531. */
  12532. function isSafeInteger(value) {
  12533. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12534. }
  12535. /**
  12536. * Checks if `value` is classified as a `Set` object.
  12537. *
  12538. * @static
  12539. * @memberOf _
  12540. * @since 4.3.0
  12541. * @category Lang
  12542. * @param {*} value The value to check.
  12543. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12544. * @example
  12545. *
  12546. * _.isSet(new Set);
  12547. * // => true
  12548. *
  12549. * _.isSet(new WeakSet);
  12550. * // => false
  12551. */
  12552. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12553. /**
  12554. * Checks if `value` is classified as a `String` primitive or object.
  12555. *
  12556. * @static
  12557. * @since 0.1.0
  12558. * @memberOf _
  12559. * @category Lang
  12560. * @param {*} value The value to check.
  12561. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12562. * @example
  12563. *
  12564. * _.isString('abc');
  12565. * // => true
  12566. *
  12567. * _.isString(1);
  12568. * // => false
  12569. */
  12570. function isString(value) {
  12571. return typeof value == 'string' ||
  12572. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12573. }
  12574. /**
  12575. * Checks if `value` is classified as a `Symbol` primitive or object.
  12576. *
  12577. * @static
  12578. * @memberOf _
  12579. * @since 4.0.0
  12580. * @category Lang
  12581. * @param {*} value The value to check.
  12582. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12583. * @example
  12584. *
  12585. * _.isSymbol(Symbol.iterator);
  12586. * // => true
  12587. *
  12588. * _.isSymbol('abc');
  12589. * // => false
  12590. */
  12591. function isSymbol(value) {
  12592. return typeof value == 'symbol' ||
  12593. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12594. }
  12595. /**
  12596. * Checks if `value` is classified as a typed array.
  12597. *
  12598. * @static
  12599. * @memberOf _
  12600. * @since 3.0.0
  12601. * @category Lang
  12602. * @param {*} value The value to check.
  12603. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12604. * @example
  12605. *
  12606. * _.isTypedArray(new Uint8Array);
  12607. * // => true
  12608. *
  12609. * _.isTypedArray([]);
  12610. * // => false
  12611. */
  12612. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12613. /**
  12614. * Checks if `value` is `undefined`.
  12615. *
  12616. * @static
  12617. * @since 0.1.0
  12618. * @memberOf _
  12619. * @category Lang
  12620. * @param {*} value The value to check.
  12621. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12622. * @example
  12623. *
  12624. * _.isUndefined(void 0);
  12625. * // => true
  12626. *
  12627. * _.isUndefined(null);
  12628. * // => false
  12629. */
  12630. function isUndefined(value) {
  12631. return value === undefined;
  12632. }
  12633. /**
  12634. * Checks if `value` is classified as a `WeakMap` object.
  12635. *
  12636. * @static
  12637. * @memberOf _
  12638. * @since 4.3.0
  12639. * @category Lang
  12640. * @param {*} value The value to check.
  12641. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12642. * @example
  12643. *
  12644. * _.isWeakMap(new WeakMap);
  12645. * // => true
  12646. *
  12647. * _.isWeakMap(new Map);
  12648. * // => false
  12649. */
  12650. function isWeakMap(value) {
  12651. return isObjectLike(value) && getTag(value) == weakMapTag;
  12652. }
  12653. /**
  12654. * Checks if `value` is classified as a `WeakSet` object.
  12655. *
  12656. * @static
  12657. * @memberOf _
  12658. * @since 4.3.0
  12659. * @category Lang
  12660. * @param {*} value The value to check.
  12661. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12662. * @example
  12663. *
  12664. * _.isWeakSet(new WeakSet);
  12665. * // => true
  12666. *
  12667. * _.isWeakSet(new Set);
  12668. * // => false
  12669. */
  12670. function isWeakSet(value) {
  12671. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12672. }
  12673. /**
  12674. * Checks if `value` is less than `other`.
  12675. *
  12676. * @static
  12677. * @memberOf _
  12678. * @since 3.9.0
  12679. * @category Lang
  12680. * @param {*} value The value to compare.
  12681. * @param {*} other The other value to compare.
  12682. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12683. * else `false`.
  12684. * @see _.gt
  12685. * @example
  12686. *
  12687. * _.lt(1, 3);
  12688. * // => true
  12689. *
  12690. * _.lt(3, 3);
  12691. * // => false
  12692. *
  12693. * _.lt(3, 1);
  12694. * // => false
  12695. */
  12696. var lt = createRelationalOperation(baseLt);
  12697. /**
  12698. * Checks if `value` is less than or equal to `other`.
  12699. *
  12700. * @static
  12701. * @memberOf _
  12702. * @since 3.9.0
  12703. * @category Lang
  12704. * @param {*} value The value to compare.
  12705. * @param {*} other The other value to compare.
  12706. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12707. * `other`, else `false`.
  12708. * @see _.gte
  12709. * @example
  12710. *
  12711. * _.lte(1, 3);
  12712. * // => true
  12713. *
  12714. * _.lte(3, 3);
  12715. * // => true
  12716. *
  12717. * _.lte(3, 1);
  12718. * // => false
  12719. */
  12720. var lte = createRelationalOperation(function(value, other) {
  12721. return value <= other;
  12722. });
  12723. /**
  12724. * Converts `value` to an array.
  12725. *
  12726. * @static
  12727. * @since 0.1.0
  12728. * @memberOf _
  12729. * @category Lang
  12730. * @param {*} value The value to convert.
  12731. * @returns {Array} Returns the converted array.
  12732. * @example
  12733. *
  12734. * _.toArray({ 'a': 1, 'b': 2 });
  12735. * // => [1, 2]
  12736. *
  12737. * _.toArray('abc');
  12738. * // => ['a', 'b', 'c']
  12739. *
  12740. * _.toArray(1);
  12741. * // => []
  12742. *
  12743. * _.toArray(null);
  12744. * // => []
  12745. */
  12746. function toArray(value) {
  12747. if (!value) {
  12748. return [];
  12749. }
  12750. if (isArrayLike(value)) {
  12751. return isString(value) ? stringToArray(value) : copyArray(value);
  12752. }
  12753. if (symIterator && value[symIterator]) {
  12754. return iteratorToArray(value[symIterator]());
  12755. }
  12756. var tag = getTag(value),
  12757. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12758. return func(value);
  12759. }
  12760. /**
  12761. * Converts `value` to a finite number.
  12762. *
  12763. * @static
  12764. * @memberOf _
  12765. * @since 4.12.0
  12766. * @category Lang
  12767. * @param {*} value The value to convert.
  12768. * @returns {number} Returns the converted number.
  12769. * @example
  12770. *
  12771. * _.toFinite(3.2);
  12772. * // => 3.2
  12773. *
  12774. * _.toFinite(Number.MIN_VALUE);
  12775. * // => 5e-324
  12776. *
  12777. * _.toFinite(Infinity);
  12778. * // => 1.7976931348623157e+308
  12779. *
  12780. * _.toFinite('3.2');
  12781. * // => 3.2
  12782. */
  12783. function toFinite(value) {
  12784. if (!value) {
  12785. return value === 0 ? value : 0;
  12786. }
  12787. value = toNumber(value);
  12788. if (value === INFINITY || value === -INFINITY) {
  12789. var sign = (value < 0 ? -1 : 1);
  12790. return sign * MAX_INTEGER;
  12791. }
  12792. return value === value ? value : 0;
  12793. }
  12794. /**
  12795. * Converts `value` to an integer.
  12796. *
  12797. * **Note:** This method is loosely based on
  12798. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12799. *
  12800. * @static
  12801. * @memberOf _
  12802. * @since 4.0.0
  12803. * @category Lang
  12804. * @param {*} value The value to convert.
  12805. * @returns {number} Returns the converted integer.
  12806. * @example
  12807. *
  12808. * _.toInteger(3.2);
  12809. * // => 3
  12810. *
  12811. * _.toInteger(Number.MIN_VALUE);
  12812. * // => 0
  12813. *
  12814. * _.toInteger(Infinity);
  12815. * // => 1.7976931348623157e+308
  12816. *
  12817. * _.toInteger('3.2');
  12818. * // => 3
  12819. */
  12820. function toInteger(value) {
  12821. var result = toFinite(value),
  12822. remainder = result % 1;
  12823. return result === result ? (remainder ? result - remainder : result) : 0;
  12824. }
  12825. /**
  12826. * Converts `value` to an integer suitable for use as the length of an
  12827. * array-like object.
  12828. *
  12829. * **Note:** This method is based on
  12830. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12831. *
  12832. * @static
  12833. * @memberOf _
  12834. * @since 4.0.0
  12835. * @category Lang
  12836. * @param {*} value The value to convert.
  12837. * @returns {number} Returns the converted integer.
  12838. * @example
  12839. *
  12840. * _.toLength(3.2);
  12841. * // => 3
  12842. *
  12843. * _.toLength(Number.MIN_VALUE);
  12844. * // => 0
  12845. *
  12846. * _.toLength(Infinity);
  12847. * // => 4294967295
  12848. *
  12849. * _.toLength('3.2');
  12850. * // => 3
  12851. */
  12852. function toLength(value) {
  12853. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12854. }
  12855. /**
  12856. * Converts `value` to a number.
  12857. *
  12858. * @static
  12859. * @memberOf _
  12860. * @since 4.0.0
  12861. * @category Lang
  12862. * @param {*} value The value to process.
  12863. * @returns {number} Returns the number.
  12864. * @example
  12865. *
  12866. * _.toNumber(3.2);
  12867. * // => 3.2
  12868. *
  12869. * _.toNumber(Number.MIN_VALUE);
  12870. * // => 5e-324
  12871. *
  12872. * _.toNumber(Infinity);
  12873. * // => Infinity
  12874. *
  12875. * _.toNumber('3.2');
  12876. * // => 3.2
  12877. */
  12878. function toNumber(value) {
  12879. if (typeof value == 'number') {
  12880. return value;
  12881. }
  12882. if (isSymbol(value)) {
  12883. return NAN;
  12884. }
  12885. if (isObject(value)) {
  12886. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12887. value = isObject(other) ? (other + '') : other;
  12888. }
  12889. if (typeof value != 'string') {
  12890. return value === 0 ? value : +value;
  12891. }
  12892. value = baseTrim(value);
  12893. var isBinary = reIsBinary.test(value);
  12894. return (isBinary || reIsOctal.test(value))
  12895. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12896. : (reIsBadHex.test(value) ? NAN : +value);
  12897. }
  12898. /**
  12899. * Converts `value` to a plain object flattening inherited enumerable string
  12900. * keyed properties of `value` to own properties of the plain object.
  12901. *
  12902. * @static
  12903. * @memberOf _
  12904. * @since 3.0.0
  12905. * @category Lang
  12906. * @param {*} value The value to convert.
  12907. * @returns {Object} Returns the converted plain object.
  12908. * @example
  12909. *
  12910. * function Foo() {
  12911. * this.b = 2;
  12912. * }
  12913. *
  12914. * Foo.prototype.c = 3;
  12915. *
  12916. * _.assign({ 'a': 1 }, new Foo);
  12917. * // => { 'a': 1, 'b': 2 }
  12918. *
  12919. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12920. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12921. */
  12922. function toPlainObject(value) {
  12923. return copyObject(value, keysIn(value));
  12924. }
  12925. /**
  12926. * Converts `value` to a safe integer. A safe integer can be compared and
  12927. * represented correctly.
  12928. *
  12929. * @static
  12930. * @memberOf _
  12931. * @since 4.0.0
  12932. * @category Lang
  12933. * @param {*} value The value to convert.
  12934. * @returns {number} Returns the converted integer.
  12935. * @example
  12936. *
  12937. * _.toSafeInteger(3.2);
  12938. * // => 3
  12939. *
  12940. * _.toSafeInteger(Number.MIN_VALUE);
  12941. * // => 0
  12942. *
  12943. * _.toSafeInteger(Infinity);
  12944. * // => 9007199254740991
  12945. *
  12946. * _.toSafeInteger('3.2');
  12947. * // => 3
  12948. */
  12949. function toSafeInteger(value) {
  12950. return value
  12951. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12952. : (value === 0 ? value : 0);
  12953. }
  12954. /**
  12955. * Converts `value` to a string. An empty string is returned for `null`
  12956. * and `undefined` values. The sign of `-0` is preserved.
  12957. *
  12958. * @static
  12959. * @memberOf _
  12960. * @since 4.0.0
  12961. * @category Lang
  12962. * @param {*} value The value to convert.
  12963. * @returns {string} Returns the converted string.
  12964. * @example
  12965. *
  12966. * _.toString(null);
  12967. * // => ''
  12968. *
  12969. * _.toString(-0);
  12970. * // => '-0'
  12971. *
  12972. * _.toString([1, 2, 3]);
  12973. * // => '1,2,3'
  12974. */
  12975. function toString(value) {
  12976. return value == null ? '' : baseToString(value);
  12977. }
  12978. /*------------------------------------------------------------------------*/
  12979. /**
  12980. * Assigns own enumerable string keyed properties of source objects to the
  12981. * destination object. Source objects are applied from left to right.
  12982. * Subsequent sources overwrite property assignments of previous sources.
  12983. *
  12984. * **Note:** This method mutates `object` and is loosely based on
  12985. * [`Object.assign`](https://mdn.io/Object/assign).
  12986. *
  12987. * @static
  12988. * @memberOf _
  12989. * @since 0.10.0
  12990. * @category Object
  12991. * @param {Object} object The destination object.
  12992. * @param {...Object} [sources] The source objects.
  12993. * @returns {Object} Returns `object`.
  12994. * @see _.assignIn
  12995. * @example
  12996. *
  12997. * function Foo() {
  12998. * this.a = 1;
  12999. * }
  13000. *
  13001. * function Bar() {
  13002. * this.c = 3;
  13003. * }
  13004. *
  13005. * Foo.prototype.b = 2;
  13006. * Bar.prototype.d = 4;
  13007. *
  13008. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13009. * // => { 'a': 1, 'c': 3 }
  13010. */
  13011. var assign = createAssigner(function(object, source) {
  13012. if (isPrototype(source) || isArrayLike(source)) {
  13013. copyObject(source, keys(source), object);
  13014. return;
  13015. }
  13016. for (var key in source) {
  13017. if (hasOwnProperty.call(source, key)) {
  13018. assignValue(object, key, source[key]);
  13019. }
  13020. }
  13021. });
  13022. /**
  13023. * This method is like `_.assign` except that it iterates over own and
  13024. * inherited source properties.
  13025. *
  13026. * **Note:** This method mutates `object`.
  13027. *
  13028. * @static
  13029. * @memberOf _
  13030. * @since 4.0.0
  13031. * @alias extend
  13032. * @category Object
  13033. * @param {Object} object The destination object.
  13034. * @param {...Object} [sources] The source objects.
  13035. * @returns {Object} Returns `object`.
  13036. * @see _.assign
  13037. * @example
  13038. *
  13039. * function Foo() {
  13040. * this.a = 1;
  13041. * }
  13042. *
  13043. * function Bar() {
  13044. * this.c = 3;
  13045. * }
  13046. *
  13047. * Foo.prototype.b = 2;
  13048. * Bar.prototype.d = 4;
  13049. *
  13050. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13051. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13052. */
  13053. var assignIn = createAssigner(function(object, source) {
  13054. copyObject(source, keysIn(source), object);
  13055. });
  13056. /**
  13057. * This method is like `_.assignIn` except that it accepts `customizer`
  13058. * which is invoked to produce the assigned values. If `customizer` returns
  13059. * `undefined`, assignment is handled by the method instead. The `customizer`
  13060. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13061. *
  13062. * **Note:** This method mutates `object`.
  13063. *
  13064. * @static
  13065. * @memberOf _
  13066. * @since 4.0.0
  13067. * @alias extendWith
  13068. * @category Object
  13069. * @param {Object} object The destination object.
  13070. * @param {...Object} sources The source objects.
  13071. * @param {Function} [customizer] The function to customize assigned values.
  13072. * @returns {Object} Returns `object`.
  13073. * @see _.assignWith
  13074. * @example
  13075. *
  13076. * function customizer(objValue, srcValue) {
  13077. * return _.isUndefined(objValue) ? srcValue : objValue;
  13078. * }
  13079. *
  13080. * var defaults = _.partialRight(_.assignInWith, customizer);
  13081. *
  13082. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13083. * // => { 'a': 1, 'b': 2 }
  13084. */
  13085. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13086. copyObject(source, keysIn(source), object, customizer);
  13087. });
  13088. /**
  13089. * This method is like `_.assign` except that it accepts `customizer`
  13090. * which is invoked to produce the assigned values. If `customizer` returns
  13091. * `undefined`, assignment is handled by the method instead. The `customizer`
  13092. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13093. *
  13094. * **Note:** This method mutates `object`.
  13095. *
  13096. * @static
  13097. * @memberOf _
  13098. * @since 4.0.0
  13099. * @category Object
  13100. * @param {Object} object The destination object.
  13101. * @param {...Object} sources The source objects.
  13102. * @param {Function} [customizer] The function to customize assigned values.
  13103. * @returns {Object} Returns `object`.
  13104. * @see _.assignInWith
  13105. * @example
  13106. *
  13107. * function customizer(objValue, srcValue) {
  13108. * return _.isUndefined(objValue) ? srcValue : objValue;
  13109. * }
  13110. *
  13111. * var defaults = _.partialRight(_.assignWith, customizer);
  13112. *
  13113. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13114. * // => { 'a': 1, 'b': 2 }
  13115. */
  13116. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13117. copyObject(source, keys(source), object, customizer);
  13118. });
  13119. /**
  13120. * Creates an array of values corresponding to `paths` of `object`.
  13121. *
  13122. * @static
  13123. * @memberOf _
  13124. * @since 1.0.0
  13125. * @category Object
  13126. * @param {Object} object The object to iterate over.
  13127. * @param {...(string|string[])} [paths] The property paths to pick.
  13128. * @returns {Array} Returns the picked values.
  13129. * @example
  13130. *
  13131. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13132. *
  13133. * _.at(object, ['a[0].b.c', 'a[1]']);
  13134. * // => [3, 4]
  13135. */
  13136. var at = flatRest(baseAt);
  13137. /**
  13138. * Creates an object that inherits from the `prototype` object. If a
  13139. * `properties` object is given, its own enumerable string keyed properties
  13140. * are assigned to the created object.
  13141. *
  13142. * @static
  13143. * @memberOf _
  13144. * @since 2.3.0
  13145. * @category Object
  13146. * @param {Object} prototype The object to inherit from.
  13147. * @param {Object} [properties] The properties to assign to the object.
  13148. * @returns {Object} Returns the new object.
  13149. * @example
  13150. *
  13151. * function Shape() {
  13152. * this.x = 0;
  13153. * this.y = 0;
  13154. * }
  13155. *
  13156. * function Circle() {
  13157. * Shape.call(this);
  13158. * }
  13159. *
  13160. * Circle.prototype = _.create(Shape.prototype, {
  13161. * 'constructor': Circle
  13162. * });
  13163. *
  13164. * var circle = new Circle;
  13165. * circle instanceof Circle;
  13166. * // => true
  13167. *
  13168. * circle instanceof Shape;
  13169. * // => true
  13170. */
  13171. function create(prototype, properties) {
  13172. var result = baseCreate(prototype);
  13173. return properties == null ? result : baseAssign(result, properties);
  13174. }
  13175. /**
  13176. * Assigns own and inherited enumerable string keyed properties of source
  13177. * objects to the destination object for all destination properties that
  13178. * resolve to `undefined`. Source objects are applied from left to right.
  13179. * Once a property is set, additional values of the same property are ignored.
  13180. *
  13181. * **Note:** This method mutates `object`.
  13182. *
  13183. * @static
  13184. * @since 0.1.0
  13185. * @memberOf _
  13186. * @category Object
  13187. * @param {Object} object The destination object.
  13188. * @param {...Object} [sources] The source objects.
  13189. * @returns {Object} Returns `object`.
  13190. * @see _.defaultsDeep
  13191. * @example
  13192. *
  13193. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13194. * // => { 'a': 1, 'b': 2 }
  13195. */
  13196. var defaults = baseRest(function(object, sources) {
  13197. object = Object(object);
  13198. var index = -1;
  13199. var length = sources.length;
  13200. var guard = length > 2 ? sources[2] : undefined;
  13201. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13202. length = 1;
  13203. }
  13204. while (++index < length) {
  13205. var source = sources[index];
  13206. var props = keysIn(source);
  13207. var propsIndex = -1;
  13208. var propsLength = props.length;
  13209. while (++propsIndex < propsLength) {
  13210. var key = props[propsIndex];
  13211. var value = object[key];
  13212. if (value === undefined ||
  13213. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13214. object[key] = source[key];
  13215. }
  13216. }
  13217. }
  13218. return object;
  13219. });
  13220. /**
  13221. * This method is like `_.defaults` except that it recursively assigns
  13222. * default properties.
  13223. *
  13224. * **Note:** This method mutates `object`.
  13225. *
  13226. * @static
  13227. * @memberOf _
  13228. * @since 3.10.0
  13229. * @category Object
  13230. * @param {Object} object The destination object.
  13231. * @param {...Object} [sources] The source objects.
  13232. * @returns {Object} Returns `object`.
  13233. * @see _.defaults
  13234. * @example
  13235. *
  13236. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13237. * // => { 'a': { 'b': 2, 'c': 3 } }
  13238. */
  13239. var defaultsDeep = baseRest(function(args) {
  13240. args.push(undefined, customDefaultsMerge);
  13241. return apply(mergeWith, undefined, args);
  13242. });
  13243. /**
  13244. * This method is like `_.find` except that it returns the key of the first
  13245. * element `predicate` returns truthy for instead of the element itself.
  13246. *
  13247. * @static
  13248. * @memberOf _
  13249. * @since 1.1.0
  13250. * @category Object
  13251. * @param {Object} object The object to inspect.
  13252. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13253. * @returns {string|undefined} Returns the key of the matched element,
  13254. * else `undefined`.
  13255. * @example
  13256. *
  13257. * var users = {
  13258. * 'barney': { 'age': 36, 'active': true },
  13259. * 'fred': { 'age': 40, 'active': false },
  13260. * 'pebbles': { 'age': 1, 'active': true }
  13261. * };
  13262. *
  13263. * _.findKey(users, function(o) { return o.age < 40; });
  13264. * // => 'barney' (iteration order is not guaranteed)
  13265. *
  13266. * // The `_.matches` iteratee shorthand.
  13267. * _.findKey(users, { 'age': 1, 'active': true });
  13268. * // => 'pebbles'
  13269. *
  13270. * // The `_.matchesProperty` iteratee shorthand.
  13271. * _.findKey(users, ['active', false]);
  13272. * // => 'fred'
  13273. *
  13274. * // The `_.property` iteratee shorthand.
  13275. * _.findKey(users, 'active');
  13276. * // => 'barney'
  13277. */
  13278. function findKey(object, predicate) {
  13279. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13280. }
  13281. /**
  13282. * This method is like `_.findKey` except that it iterates over elements of
  13283. * a collection in the opposite order.
  13284. *
  13285. * @static
  13286. * @memberOf _
  13287. * @since 2.0.0
  13288. * @category Object
  13289. * @param {Object} object The object to inspect.
  13290. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13291. * @returns {string|undefined} Returns the key of the matched element,
  13292. * else `undefined`.
  13293. * @example
  13294. *
  13295. * var users = {
  13296. * 'barney': { 'age': 36, 'active': true },
  13297. * 'fred': { 'age': 40, 'active': false },
  13298. * 'pebbles': { 'age': 1, 'active': true }
  13299. * };
  13300. *
  13301. * _.findLastKey(users, function(o) { return o.age < 40; });
  13302. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13303. *
  13304. * // The `_.matches` iteratee shorthand.
  13305. * _.findLastKey(users, { 'age': 36, 'active': true });
  13306. * // => 'barney'
  13307. *
  13308. * // The `_.matchesProperty` iteratee shorthand.
  13309. * _.findLastKey(users, ['active', false]);
  13310. * // => 'fred'
  13311. *
  13312. * // The `_.property` iteratee shorthand.
  13313. * _.findLastKey(users, 'active');
  13314. * // => 'pebbles'
  13315. */
  13316. function findLastKey(object, predicate) {
  13317. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13318. }
  13319. /**
  13320. * Iterates over own and inherited enumerable string keyed properties of an
  13321. * object and invokes `iteratee` for each property. The iteratee is invoked
  13322. * with three arguments: (value, key, object). Iteratee functions may exit
  13323. * iteration early by explicitly returning `false`.
  13324. *
  13325. * @static
  13326. * @memberOf _
  13327. * @since 0.3.0
  13328. * @category Object
  13329. * @param {Object} object The object to iterate over.
  13330. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13331. * @returns {Object} Returns `object`.
  13332. * @see _.forInRight
  13333. * @example
  13334. *
  13335. * function Foo() {
  13336. * this.a = 1;
  13337. * this.b = 2;
  13338. * }
  13339. *
  13340. * Foo.prototype.c = 3;
  13341. *
  13342. * _.forIn(new Foo, function(value, key) {
  13343. * console.log(key);
  13344. * });
  13345. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13346. */
  13347. function forIn(object, iteratee) {
  13348. return object == null
  13349. ? object
  13350. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13351. }
  13352. /**
  13353. * This method is like `_.forIn` except that it iterates over properties of
  13354. * `object` in the opposite order.
  13355. *
  13356. * @static
  13357. * @memberOf _
  13358. * @since 2.0.0
  13359. * @category Object
  13360. * @param {Object} object The object to iterate over.
  13361. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13362. * @returns {Object} Returns `object`.
  13363. * @see _.forIn
  13364. * @example
  13365. *
  13366. * function Foo() {
  13367. * this.a = 1;
  13368. * this.b = 2;
  13369. * }
  13370. *
  13371. * Foo.prototype.c = 3;
  13372. *
  13373. * _.forInRight(new Foo, function(value, key) {
  13374. * console.log(key);
  13375. * });
  13376. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13377. */
  13378. function forInRight(object, iteratee) {
  13379. return object == null
  13380. ? object
  13381. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13382. }
  13383. /**
  13384. * Iterates over own enumerable string keyed properties of an object and
  13385. * invokes `iteratee` for each property. The iteratee is invoked with three
  13386. * arguments: (value, key, object). Iteratee functions may exit iteration
  13387. * early by explicitly returning `false`.
  13388. *
  13389. * @static
  13390. * @memberOf _
  13391. * @since 0.3.0
  13392. * @category Object
  13393. * @param {Object} object The object to iterate over.
  13394. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13395. * @returns {Object} Returns `object`.
  13396. * @see _.forOwnRight
  13397. * @example
  13398. *
  13399. * function Foo() {
  13400. * this.a = 1;
  13401. * this.b = 2;
  13402. * }
  13403. *
  13404. * Foo.prototype.c = 3;
  13405. *
  13406. * _.forOwn(new Foo, function(value, key) {
  13407. * console.log(key);
  13408. * });
  13409. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13410. */
  13411. function forOwn(object, iteratee) {
  13412. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13413. }
  13414. /**
  13415. * This method is like `_.forOwn` except that it iterates over properties of
  13416. * `object` in the opposite order.
  13417. *
  13418. * @static
  13419. * @memberOf _
  13420. * @since 2.0.0
  13421. * @category Object
  13422. * @param {Object} object The object to iterate over.
  13423. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13424. * @returns {Object} Returns `object`.
  13425. * @see _.forOwn
  13426. * @example
  13427. *
  13428. * function Foo() {
  13429. * this.a = 1;
  13430. * this.b = 2;
  13431. * }
  13432. *
  13433. * Foo.prototype.c = 3;
  13434. *
  13435. * _.forOwnRight(new Foo, function(value, key) {
  13436. * console.log(key);
  13437. * });
  13438. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13439. */
  13440. function forOwnRight(object, iteratee) {
  13441. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13442. }
  13443. /**
  13444. * Creates an array of function property names from own enumerable properties
  13445. * of `object`.
  13446. *
  13447. * @static
  13448. * @since 0.1.0
  13449. * @memberOf _
  13450. * @category Object
  13451. * @param {Object} object The object to inspect.
  13452. * @returns {Array} Returns the function names.
  13453. * @see _.functionsIn
  13454. * @example
  13455. *
  13456. * function Foo() {
  13457. * this.a = _.constant('a');
  13458. * this.b = _.constant('b');
  13459. * }
  13460. *
  13461. * Foo.prototype.c = _.constant('c');
  13462. *
  13463. * _.functions(new Foo);
  13464. * // => ['a', 'b']
  13465. */
  13466. function functions(object) {
  13467. return object == null ? [] : baseFunctions(object, keys(object));
  13468. }
  13469. /**
  13470. * Creates an array of function property names from own and inherited
  13471. * enumerable properties of `object`.
  13472. *
  13473. * @static
  13474. * @memberOf _
  13475. * @since 4.0.0
  13476. * @category Object
  13477. * @param {Object} object The object to inspect.
  13478. * @returns {Array} Returns the function names.
  13479. * @see _.functions
  13480. * @example
  13481. *
  13482. * function Foo() {
  13483. * this.a = _.constant('a');
  13484. * this.b = _.constant('b');
  13485. * }
  13486. *
  13487. * Foo.prototype.c = _.constant('c');
  13488. *
  13489. * _.functionsIn(new Foo);
  13490. * // => ['a', 'b', 'c']
  13491. */
  13492. function functionsIn(object) {
  13493. return object == null ? [] : baseFunctions(object, keysIn(object));
  13494. }
  13495. /**
  13496. * Gets the value at `path` of `object`. If the resolved value is
  13497. * `undefined`, the `defaultValue` is returned in its place.
  13498. *
  13499. * @static
  13500. * @memberOf _
  13501. * @since 3.7.0
  13502. * @category Object
  13503. * @param {Object} object The object to query.
  13504. * @param {Array|string} path The path of the property to get.
  13505. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13506. * @returns {*} Returns the resolved value.
  13507. * @example
  13508. *
  13509. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13510. *
  13511. * _.get(object, 'a[0].b.c');
  13512. * // => 3
  13513. *
  13514. * _.get(object, ['a', '0', 'b', 'c']);
  13515. * // => 3
  13516. *
  13517. * _.get(object, 'a.b.c', 'default');
  13518. * // => 'default'
  13519. */
  13520. function get(object, path, defaultValue) {
  13521. var result = object == null ? undefined : baseGet(object, path);
  13522. return result === undefined ? defaultValue : result;
  13523. }
  13524. /**
  13525. * Checks if `path` is a direct property of `object`.
  13526. *
  13527. * @static
  13528. * @since 0.1.0
  13529. * @memberOf _
  13530. * @category Object
  13531. * @param {Object} object The object to query.
  13532. * @param {Array|string} path The path to check.
  13533. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13534. * @example
  13535. *
  13536. * var object = { 'a': { 'b': 2 } };
  13537. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13538. *
  13539. * _.has(object, 'a');
  13540. * // => true
  13541. *
  13542. * _.has(object, 'a.b');
  13543. * // => true
  13544. *
  13545. * _.has(object, ['a', 'b']);
  13546. * // => true
  13547. *
  13548. * _.has(other, 'a');
  13549. * // => false
  13550. */
  13551. function has(object, path) {
  13552. return object != null && hasPath(object, path, baseHas);
  13553. }
  13554. /**
  13555. * Checks if `path` is a direct or inherited property of `object`.
  13556. *
  13557. * @static
  13558. * @memberOf _
  13559. * @since 4.0.0
  13560. * @category Object
  13561. * @param {Object} object The object to query.
  13562. * @param {Array|string} path The path to check.
  13563. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13564. * @example
  13565. *
  13566. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13567. *
  13568. * _.hasIn(object, 'a');
  13569. * // => true
  13570. *
  13571. * _.hasIn(object, 'a.b');
  13572. * // => true
  13573. *
  13574. * _.hasIn(object, ['a', 'b']);
  13575. * // => true
  13576. *
  13577. * _.hasIn(object, 'b');
  13578. * // => false
  13579. */
  13580. function hasIn(object, path) {
  13581. return object != null && hasPath(object, path, baseHasIn);
  13582. }
  13583. /**
  13584. * Creates an object composed of the inverted keys and values of `object`.
  13585. * If `object` contains duplicate values, subsequent values overwrite
  13586. * property assignments of previous values.
  13587. *
  13588. * @static
  13589. * @memberOf _
  13590. * @since 0.7.0
  13591. * @category Object
  13592. * @param {Object} object The object to invert.
  13593. * @returns {Object} Returns the new inverted object.
  13594. * @example
  13595. *
  13596. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13597. *
  13598. * _.invert(object);
  13599. * // => { '1': 'c', '2': 'b' }
  13600. */
  13601. var invert = createInverter(function(result, value, key) {
  13602. if (value != null &&
  13603. typeof value.toString != 'function') {
  13604. value = nativeObjectToString.call(value);
  13605. }
  13606. result[value] = key;
  13607. }, constant(identity));
  13608. /**
  13609. * This method is like `_.invert` except that the inverted object is generated
  13610. * from the results of running each element of `object` thru `iteratee`. The
  13611. * corresponding inverted value of each inverted key is an array of keys
  13612. * responsible for generating the inverted value. The iteratee is invoked
  13613. * with one argument: (value).
  13614. *
  13615. * @static
  13616. * @memberOf _
  13617. * @since 4.1.0
  13618. * @category Object
  13619. * @param {Object} object The object to invert.
  13620. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13621. * @returns {Object} Returns the new inverted object.
  13622. * @example
  13623. *
  13624. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13625. *
  13626. * _.invertBy(object);
  13627. * // => { '1': ['a', 'c'], '2': ['b'] }
  13628. *
  13629. * _.invertBy(object, function(value) {
  13630. * return 'group' + value;
  13631. * });
  13632. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13633. */
  13634. var invertBy = createInverter(function(result, value, key) {
  13635. if (value != null &&
  13636. typeof value.toString != 'function') {
  13637. value = nativeObjectToString.call(value);
  13638. }
  13639. if (hasOwnProperty.call(result, value)) {
  13640. result[value].push(key);
  13641. } else {
  13642. result[value] = [key];
  13643. }
  13644. }, getIteratee);
  13645. /**
  13646. * Invokes the method at `path` of `object`.
  13647. *
  13648. * @static
  13649. * @memberOf _
  13650. * @since 4.0.0
  13651. * @category Object
  13652. * @param {Object} object The object to query.
  13653. * @param {Array|string} path The path of the method to invoke.
  13654. * @param {...*} [args] The arguments to invoke the method with.
  13655. * @returns {*} Returns the result of the invoked method.
  13656. * @example
  13657. *
  13658. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13659. *
  13660. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13661. * // => [2, 3]
  13662. */
  13663. var invoke = baseRest(baseInvoke);
  13664. /**
  13665. * Creates an array of the own enumerable property names of `object`.
  13666. *
  13667. * **Note:** Non-object values are coerced to objects. See the
  13668. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13669. * for more details.
  13670. *
  13671. * @static
  13672. * @since 0.1.0
  13673. * @memberOf _
  13674. * @category Object
  13675. * @param {Object} object The object to query.
  13676. * @returns {Array} Returns the array of property names.
  13677. * @example
  13678. *
  13679. * function Foo() {
  13680. * this.a = 1;
  13681. * this.b = 2;
  13682. * }
  13683. *
  13684. * Foo.prototype.c = 3;
  13685. *
  13686. * _.keys(new Foo);
  13687. * // => ['a', 'b'] (iteration order is not guaranteed)
  13688. *
  13689. * _.keys('hi');
  13690. * // => ['0', '1']
  13691. */
  13692. function keys(object) {
  13693. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13694. }
  13695. /**
  13696. * Creates an array of the own and inherited enumerable property names of `object`.
  13697. *
  13698. * **Note:** Non-object values are coerced to objects.
  13699. *
  13700. * @static
  13701. * @memberOf _
  13702. * @since 3.0.0
  13703. * @category Object
  13704. * @param {Object} object The object to query.
  13705. * @returns {Array} Returns the array of property names.
  13706. * @example
  13707. *
  13708. * function Foo() {
  13709. * this.a = 1;
  13710. * this.b = 2;
  13711. * }
  13712. *
  13713. * Foo.prototype.c = 3;
  13714. *
  13715. * _.keysIn(new Foo);
  13716. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13717. */
  13718. function keysIn(object) {
  13719. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13720. }
  13721. /**
  13722. * The opposite of `_.mapValues`; this method creates an object with the
  13723. * same values as `object` and keys generated by running each own enumerable
  13724. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13725. * with three arguments: (value, key, object).
  13726. *
  13727. * @static
  13728. * @memberOf _
  13729. * @since 3.8.0
  13730. * @category Object
  13731. * @param {Object} object The object to iterate over.
  13732. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13733. * @returns {Object} Returns the new mapped object.
  13734. * @see _.mapValues
  13735. * @example
  13736. *
  13737. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13738. * return key + value;
  13739. * });
  13740. * // => { 'a1': 1, 'b2': 2 }
  13741. */
  13742. function mapKeys(object, iteratee) {
  13743. var result = {};
  13744. iteratee = getIteratee(iteratee, 3);
  13745. baseForOwn(object, function(value, key, object) {
  13746. baseAssignValue(result, iteratee(value, key, object), value);
  13747. });
  13748. return result;
  13749. }
  13750. /**
  13751. * Creates an object with the same keys as `object` and values generated
  13752. * by running each own enumerable string keyed property of `object` thru
  13753. * `iteratee`. The iteratee is invoked with three arguments:
  13754. * (value, key, object).
  13755. *
  13756. * @static
  13757. * @memberOf _
  13758. * @since 2.4.0
  13759. * @category Object
  13760. * @param {Object} object The object to iterate over.
  13761. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13762. * @returns {Object} Returns the new mapped object.
  13763. * @see _.mapKeys
  13764. * @example
  13765. *
  13766. * var users = {
  13767. * 'fred': { 'user': 'fred', 'age': 40 },
  13768. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13769. * };
  13770. *
  13771. * _.mapValues(users, function(o) { return o.age; });
  13772. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13773. *
  13774. * // The `_.property` iteratee shorthand.
  13775. * _.mapValues(users, 'age');
  13776. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13777. */
  13778. function mapValues(object, iteratee) {
  13779. var result = {};
  13780. iteratee = getIteratee(iteratee, 3);
  13781. baseForOwn(object, function(value, key, object) {
  13782. baseAssignValue(result, key, iteratee(value, key, object));
  13783. });
  13784. return result;
  13785. }
  13786. /**
  13787. * This method is like `_.assign` except that it recursively merges own and
  13788. * inherited enumerable string keyed properties of source objects into the
  13789. * destination object. Source properties that resolve to `undefined` are
  13790. * skipped if a destination value exists. Array and plain object properties
  13791. * are merged recursively. Other objects and value types are overridden by
  13792. * assignment. Source objects are applied from left to right. Subsequent
  13793. * sources overwrite property assignments of previous sources.
  13794. *
  13795. * **Note:** This method mutates `object`.
  13796. *
  13797. * @static
  13798. * @memberOf _
  13799. * @since 0.5.0
  13800. * @category Object
  13801. * @param {Object} object The destination object.
  13802. * @param {...Object} [sources] The source objects.
  13803. * @returns {Object} Returns `object`.
  13804. * @example
  13805. *
  13806. * var object = {
  13807. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13808. * };
  13809. *
  13810. * var other = {
  13811. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13812. * };
  13813. *
  13814. * _.merge(object, other);
  13815. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13816. */
  13817. var merge = createAssigner(function(object, source, srcIndex) {
  13818. baseMerge(object, source, srcIndex);
  13819. });
  13820. /**
  13821. * This method is like `_.merge` except that it accepts `customizer` which
  13822. * is invoked to produce the merged values of the destination and source
  13823. * properties. If `customizer` returns `undefined`, merging is handled by the
  13824. * method instead. The `customizer` is invoked with six arguments:
  13825. * (objValue, srcValue, key, object, source, stack).
  13826. *
  13827. * **Note:** This method mutates `object`.
  13828. *
  13829. * @static
  13830. * @memberOf _
  13831. * @since 4.0.0
  13832. * @category Object
  13833. * @param {Object} object The destination object.
  13834. * @param {...Object} sources The source objects.
  13835. * @param {Function} customizer The function to customize assigned values.
  13836. * @returns {Object} Returns `object`.
  13837. * @example
  13838. *
  13839. * function customizer(objValue, srcValue) {
  13840. * if (_.isArray(objValue)) {
  13841. * return objValue.concat(srcValue);
  13842. * }
  13843. * }
  13844. *
  13845. * var object = { 'a': [1], 'b': [2] };
  13846. * var other = { 'a': [3], 'b': [4] };
  13847. *
  13848. * _.mergeWith(object, other, customizer);
  13849. * // => { 'a': [1, 3], 'b': [2, 4] }
  13850. */
  13851. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13852. baseMerge(object, source, srcIndex, customizer);
  13853. });
  13854. /**
  13855. * The opposite of `_.pick`; this method creates an object composed of the
  13856. * own and inherited enumerable property paths of `object` that are not omitted.
  13857. *
  13858. * **Note:** This method is considerably slower than `_.pick`.
  13859. *
  13860. * @static
  13861. * @since 0.1.0
  13862. * @memberOf _
  13863. * @category Object
  13864. * @param {Object} object The source object.
  13865. * @param {...(string|string[])} [paths] The property paths to omit.
  13866. * @returns {Object} Returns the new object.
  13867. * @example
  13868. *
  13869. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13870. *
  13871. * _.omit(object, ['a', 'c']);
  13872. * // => { 'b': '2' }
  13873. */
  13874. var omit = flatRest(function(object, paths) {
  13875. var result = {};
  13876. if (object == null) {
  13877. return result;
  13878. }
  13879. var isDeep = false;
  13880. paths = arrayMap(paths, function(path) {
  13881. path = castPath(path, object);
  13882. isDeep || (isDeep = path.length > 1);
  13883. return path;
  13884. });
  13885. copyObject(object, getAllKeysIn(object), result);
  13886. if (isDeep) {
  13887. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13888. }
  13889. var length = paths.length;
  13890. while (length--) {
  13891. baseUnset(result, paths[length]);
  13892. }
  13893. return result;
  13894. });
  13895. /**
  13896. * The opposite of `_.pickBy`; this method creates an object composed of
  13897. * the own and inherited enumerable string keyed properties of `object` that
  13898. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13899. * arguments: (value, key).
  13900. *
  13901. * @static
  13902. * @memberOf _
  13903. * @since 4.0.0
  13904. * @category Object
  13905. * @param {Object} object The source object.
  13906. * @param {Function} [predicate=_.identity] The function invoked per property.
  13907. * @returns {Object} Returns the new object.
  13908. * @example
  13909. *
  13910. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13911. *
  13912. * _.omitBy(object, _.isNumber);
  13913. * // => { 'b': '2' }
  13914. */
  13915. function omitBy(object, predicate) {
  13916. return pickBy(object, negate(getIteratee(predicate)));
  13917. }
  13918. /**
  13919. * Creates an object composed of the picked `object` properties.
  13920. *
  13921. * @static
  13922. * @since 0.1.0
  13923. * @memberOf _
  13924. * @category Object
  13925. * @param {Object} object The source object.
  13926. * @param {...(string|string[])} [paths] The property paths to pick.
  13927. * @returns {Object} Returns the new object.
  13928. * @example
  13929. *
  13930. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13931. *
  13932. * _.pick(object, ['a', 'c']);
  13933. * // => { 'a': 1, 'c': 3 }
  13934. */
  13935. var pick = flatRest(function(object, paths) {
  13936. return object == null ? {} : basePick(object, paths);
  13937. });
  13938. /**
  13939. * Creates an object composed of the `object` properties `predicate` returns
  13940. * truthy for. The predicate is invoked with two arguments: (value, key).
  13941. *
  13942. * @static
  13943. * @memberOf _
  13944. * @since 4.0.0
  13945. * @category Object
  13946. * @param {Object} object The source object.
  13947. * @param {Function} [predicate=_.identity] The function invoked per property.
  13948. * @returns {Object} Returns the new object.
  13949. * @example
  13950. *
  13951. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13952. *
  13953. * _.pickBy(object, _.isNumber);
  13954. * // => { 'a': 1, 'c': 3 }
  13955. */
  13956. function pickBy(object, predicate) {
  13957. if (object == null) {
  13958. return {};
  13959. }
  13960. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13961. return [prop];
  13962. });
  13963. predicate = getIteratee(predicate);
  13964. return basePickBy(object, props, function(value, path) {
  13965. return predicate(value, path[0]);
  13966. });
  13967. }
  13968. /**
  13969. * This method is like `_.get` except that if the resolved value is a
  13970. * function it's invoked with the `this` binding of its parent object and
  13971. * its result is returned.
  13972. *
  13973. * @static
  13974. * @since 0.1.0
  13975. * @memberOf _
  13976. * @category Object
  13977. * @param {Object} object The object to query.
  13978. * @param {Array|string} path The path of the property to resolve.
  13979. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13980. * @returns {*} Returns the resolved value.
  13981. * @example
  13982. *
  13983. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13984. *
  13985. * _.result(object, 'a[0].b.c1');
  13986. * // => 3
  13987. *
  13988. * _.result(object, 'a[0].b.c2');
  13989. * // => 4
  13990. *
  13991. * _.result(object, 'a[0].b.c3', 'default');
  13992. * // => 'default'
  13993. *
  13994. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13995. * // => 'default'
  13996. */
  13997. function result(object, path, defaultValue) {
  13998. path = castPath(path, object);
  13999. var index = -1,
  14000. length = path.length;
  14001. // Ensure the loop is entered when path is empty.
  14002. if (!length) {
  14003. length = 1;
  14004. object = undefined;
  14005. }
  14006. while (++index < length) {
  14007. var value = object == null ? undefined : object[toKey(path[index])];
  14008. if (value === undefined) {
  14009. index = length;
  14010. value = defaultValue;
  14011. }
  14012. object = isFunction(value) ? value.call(object) : value;
  14013. }
  14014. return object;
  14015. }
  14016. /**
  14017. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14018. * it's created. Arrays are created for missing index properties while objects
  14019. * are created for all other missing properties. Use `_.setWith` to customize
  14020. * `path` creation.
  14021. *
  14022. * **Note:** This method mutates `object`.
  14023. *
  14024. * @static
  14025. * @memberOf _
  14026. * @since 3.7.0
  14027. * @category Object
  14028. * @param {Object} object The object to modify.
  14029. * @param {Array|string} path The path of the property to set.
  14030. * @param {*} value The value to set.
  14031. * @returns {Object} Returns `object`.
  14032. * @example
  14033. *
  14034. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14035. *
  14036. * _.set(object, 'a[0].b.c', 4);
  14037. * console.log(object.a[0].b.c);
  14038. * // => 4
  14039. *
  14040. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14041. * console.log(object.x[0].y.z);
  14042. * // => 5
  14043. */
  14044. function set(object, path, value) {
  14045. return object == null ? object : baseSet(object, path, value);
  14046. }
  14047. /**
  14048. * This method is like `_.set` except that it accepts `customizer` which is
  14049. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14050. * path creation is handled by the method instead. The `customizer` is invoked
  14051. * with three arguments: (nsValue, key, nsObject).
  14052. *
  14053. * **Note:** This method mutates `object`.
  14054. *
  14055. * @static
  14056. * @memberOf _
  14057. * @since 4.0.0
  14058. * @category Object
  14059. * @param {Object} object The object to modify.
  14060. * @param {Array|string} path The path of the property to set.
  14061. * @param {*} value The value to set.
  14062. * @param {Function} [customizer] The function to customize assigned values.
  14063. * @returns {Object} Returns `object`.
  14064. * @example
  14065. *
  14066. * var object = {};
  14067. *
  14068. * _.setWith(object, '[0][1]', 'a', Object);
  14069. * // => { '0': { '1': 'a' } }
  14070. */
  14071. function setWith(object, path, value, customizer) {
  14072. customizer = typeof customizer == 'function' ? customizer : undefined;
  14073. return object == null ? object : baseSet(object, path, value, customizer);
  14074. }
  14075. /**
  14076. * Creates an array of own enumerable string keyed-value pairs for `object`
  14077. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14078. * entries are returned.
  14079. *
  14080. * @static
  14081. * @memberOf _
  14082. * @since 4.0.0
  14083. * @alias entries
  14084. * @category Object
  14085. * @param {Object} object The object to query.
  14086. * @returns {Array} Returns the key-value pairs.
  14087. * @example
  14088. *
  14089. * function Foo() {
  14090. * this.a = 1;
  14091. * this.b = 2;
  14092. * }
  14093. *
  14094. * Foo.prototype.c = 3;
  14095. *
  14096. * _.toPairs(new Foo);
  14097. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14098. */
  14099. var toPairs = createToPairs(keys);
  14100. /**
  14101. * Creates an array of own and inherited enumerable string keyed-value pairs
  14102. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14103. * or set, its entries are returned.
  14104. *
  14105. * @static
  14106. * @memberOf _
  14107. * @since 4.0.0
  14108. * @alias entriesIn
  14109. * @category Object
  14110. * @param {Object} object The object to query.
  14111. * @returns {Array} Returns the key-value pairs.
  14112. * @example
  14113. *
  14114. * function Foo() {
  14115. * this.a = 1;
  14116. * this.b = 2;
  14117. * }
  14118. *
  14119. * Foo.prototype.c = 3;
  14120. *
  14121. * _.toPairsIn(new Foo);
  14122. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14123. */
  14124. var toPairsIn = createToPairs(keysIn);
  14125. /**
  14126. * An alternative to `_.reduce`; this method transforms `object` to a new
  14127. * `accumulator` object which is the result of running each of its own
  14128. * enumerable string keyed properties thru `iteratee`, with each invocation
  14129. * potentially mutating the `accumulator` object. If `accumulator` is not
  14130. * provided, a new object with the same `[[Prototype]]` will be used. The
  14131. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14132. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14133. *
  14134. * @static
  14135. * @memberOf _
  14136. * @since 1.3.0
  14137. * @category Object
  14138. * @param {Object} object The object to iterate over.
  14139. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14140. * @param {*} [accumulator] The custom accumulator value.
  14141. * @returns {*} Returns the accumulated value.
  14142. * @example
  14143. *
  14144. * _.transform([2, 3, 4], function(result, n) {
  14145. * result.push(n *= n);
  14146. * return n % 2 == 0;
  14147. * }, []);
  14148. * // => [4, 9]
  14149. *
  14150. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14151. * (result[value] || (result[value] = [])).push(key);
  14152. * }, {});
  14153. * // => { '1': ['a', 'c'], '2': ['b'] }
  14154. */
  14155. function transform(object, iteratee, accumulator) {
  14156. var isArr = isArray(object),
  14157. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14158. iteratee = getIteratee(iteratee, 4);
  14159. if (accumulator == null) {
  14160. var Ctor = object && object.constructor;
  14161. if (isArrLike) {
  14162. accumulator = isArr ? new Ctor : [];
  14163. }
  14164. else if (isObject(object)) {
  14165. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14166. }
  14167. else {
  14168. accumulator = {};
  14169. }
  14170. }
  14171. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14172. return iteratee(accumulator, value, index, object);
  14173. });
  14174. return accumulator;
  14175. }
  14176. /**
  14177. * Removes the property at `path` of `object`.
  14178. *
  14179. * **Note:** This method mutates `object`.
  14180. *
  14181. * @static
  14182. * @memberOf _
  14183. * @since 4.0.0
  14184. * @category Object
  14185. * @param {Object} object The object to modify.
  14186. * @param {Array|string} path The path of the property to unset.
  14187. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14188. * @example
  14189. *
  14190. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14191. * _.unset(object, 'a[0].b.c');
  14192. * // => true
  14193. *
  14194. * console.log(object);
  14195. * // => { 'a': [{ 'b': {} }] };
  14196. *
  14197. * _.unset(object, ['a', '0', 'b', 'c']);
  14198. * // => true
  14199. *
  14200. * console.log(object);
  14201. * // => { 'a': [{ 'b': {} }] };
  14202. */
  14203. function unset(object, path) {
  14204. return object == null ? true : baseUnset(object, path);
  14205. }
  14206. /**
  14207. * This method is like `_.set` except that accepts `updater` to produce the
  14208. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14209. * is invoked with one argument: (value).
  14210. *
  14211. * **Note:** This method mutates `object`.
  14212. *
  14213. * @static
  14214. * @memberOf _
  14215. * @since 4.6.0
  14216. * @category Object
  14217. * @param {Object} object The object to modify.
  14218. * @param {Array|string} path The path of the property to set.
  14219. * @param {Function} updater The function to produce the updated value.
  14220. * @returns {Object} Returns `object`.
  14221. * @example
  14222. *
  14223. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14224. *
  14225. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14226. * console.log(object.a[0].b.c);
  14227. * // => 9
  14228. *
  14229. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14230. * console.log(object.x[0].y.z);
  14231. * // => 0
  14232. */
  14233. function update(object, path, updater) {
  14234. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14235. }
  14236. /**
  14237. * This method is like `_.update` except that it accepts `customizer` which is
  14238. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14239. * path creation is handled by the method instead. The `customizer` is invoked
  14240. * with three arguments: (nsValue, key, nsObject).
  14241. *
  14242. * **Note:** This method mutates `object`.
  14243. *
  14244. * @static
  14245. * @memberOf _
  14246. * @since 4.6.0
  14247. * @category Object
  14248. * @param {Object} object The object to modify.
  14249. * @param {Array|string} path The path of the property to set.
  14250. * @param {Function} updater The function to produce the updated value.
  14251. * @param {Function} [customizer] The function to customize assigned values.
  14252. * @returns {Object} Returns `object`.
  14253. * @example
  14254. *
  14255. * var object = {};
  14256. *
  14257. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14258. * // => { '0': { '1': 'a' } }
  14259. */
  14260. function updateWith(object, path, updater, customizer) {
  14261. customizer = typeof customizer == 'function' ? customizer : undefined;
  14262. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14263. }
  14264. /**
  14265. * Creates an array of the own enumerable string keyed property values of `object`.
  14266. *
  14267. * **Note:** Non-object values are coerced to objects.
  14268. *
  14269. * @static
  14270. * @since 0.1.0
  14271. * @memberOf _
  14272. * @category Object
  14273. * @param {Object} object The object to query.
  14274. * @returns {Array} Returns the array of property values.
  14275. * @example
  14276. *
  14277. * function Foo() {
  14278. * this.a = 1;
  14279. * this.b = 2;
  14280. * }
  14281. *
  14282. * Foo.prototype.c = 3;
  14283. *
  14284. * _.values(new Foo);
  14285. * // => [1, 2] (iteration order is not guaranteed)
  14286. *
  14287. * _.values('hi');
  14288. * // => ['h', 'i']
  14289. */
  14290. function values(object) {
  14291. return object == null ? [] : baseValues(object, keys(object));
  14292. }
  14293. /**
  14294. * Creates an array of the own and inherited enumerable string keyed property
  14295. * values of `object`.
  14296. *
  14297. * **Note:** Non-object values are coerced to objects.
  14298. *
  14299. * @static
  14300. * @memberOf _
  14301. * @since 3.0.0
  14302. * @category Object
  14303. * @param {Object} object The object to query.
  14304. * @returns {Array} Returns the array of property values.
  14305. * @example
  14306. *
  14307. * function Foo() {
  14308. * this.a = 1;
  14309. * this.b = 2;
  14310. * }
  14311. *
  14312. * Foo.prototype.c = 3;
  14313. *
  14314. * _.valuesIn(new Foo);
  14315. * // => [1, 2, 3] (iteration order is not guaranteed)
  14316. */
  14317. function valuesIn(object) {
  14318. return object == null ? [] : baseValues(object, keysIn(object));
  14319. }
  14320. /*------------------------------------------------------------------------*/
  14321. /**
  14322. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14323. *
  14324. * @static
  14325. * @memberOf _
  14326. * @since 4.0.0
  14327. * @category Number
  14328. * @param {number} number The number to clamp.
  14329. * @param {number} [lower] The lower bound.
  14330. * @param {number} upper The upper bound.
  14331. * @returns {number} Returns the clamped number.
  14332. * @example
  14333. *
  14334. * _.clamp(-10, -5, 5);
  14335. * // => -5
  14336. *
  14337. * _.clamp(10, -5, 5);
  14338. * // => 5
  14339. */
  14340. function clamp(number, lower, upper) {
  14341. if (upper === undefined) {
  14342. upper = lower;
  14343. lower = undefined;
  14344. }
  14345. if (upper !== undefined) {
  14346. upper = toNumber(upper);
  14347. upper = upper === upper ? upper : 0;
  14348. }
  14349. if (lower !== undefined) {
  14350. lower = toNumber(lower);
  14351. lower = lower === lower ? lower : 0;
  14352. }
  14353. return baseClamp(toNumber(number), lower, upper);
  14354. }
  14355. /**
  14356. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14357. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14358. * If `start` is greater than `end` the params are swapped to support
  14359. * negative ranges.
  14360. *
  14361. * @static
  14362. * @memberOf _
  14363. * @since 3.3.0
  14364. * @category Number
  14365. * @param {number} number The number to check.
  14366. * @param {number} [start=0] The start of the range.
  14367. * @param {number} end The end of the range.
  14368. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14369. * @see _.range, _.rangeRight
  14370. * @example
  14371. *
  14372. * _.inRange(3, 2, 4);
  14373. * // => true
  14374. *
  14375. * _.inRange(4, 8);
  14376. * // => true
  14377. *
  14378. * _.inRange(4, 2);
  14379. * // => false
  14380. *
  14381. * _.inRange(2, 2);
  14382. * // => false
  14383. *
  14384. * _.inRange(1.2, 2);
  14385. * // => true
  14386. *
  14387. * _.inRange(5.2, 4);
  14388. * // => false
  14389. *
  14390. * _.inRange(-3, -2, -6);
  14391. * // => true
  14392. */
  14393. function inRange(number, start, end) {
  14394. start = toFinite(start);
  14395. if (end === undefined) {
  14396. end = start;
  14397. start = 0;
  14398. } else {
  14399. end = toFinite(end);
  14400. }
  14401. number = toNumber(number);
  14402. return baseInRange(number, start, end);
  14403. }
  14404. /**
  14405. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14406. * If only one argument is provided a number between `0` and the given number
  14407. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14408. * floats, a floating-point number is returned instead of an integer.
  14409. *
  14410. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14411. * floating-point values which can produce unexpected results.
  14412. *
  14413. * @static
  14414. * @memberOf _
  14415. * @since 0.7.0
  14416. * @category Number
  14417. * @param {number} [lower=0] The lower bound.
  14418. * @param {number} [upper=1] The upper bound.
  14419. * @param {boolean} [floating] Specify returning a floating-point number.
  14420. * @returns {number} Returns the random number.
  14421. * @example
  14422. *
  14423. * _.random(0, 5);
  14424. * // => an integer between 0 and 5
  14425. *
  14426. * _.random(5);
  14427. * // => also an integer between 0 and 5
  14428. *
  14429. * _.random(5, true);
  14430. * // => a floating-point number between 0 and 5
  14431. *
  14432. * _.random(1.2, 5.2);
  14433. * // => a floating-point number between 1.2 and 5.2
  14434. */
  14435. function random(lower, upper, floating) {
  14436. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14437. upper = floating = undefined;
  14438. }
  14439. if (floating === undefined) {
  14440. if (typeof upper == 'boolean') {
  14441. floating = upper;
  14442. upper = undefined;
  14443. }
  14444. else if (typeof lower == 'boolean') {
  14445. floating = lower;
  14446. lower = undefined;
  14447. }
  14448. }
  14449. if (lower === undefined && upper === undefined) {
  14450. lower = 0;
  14451. upper = 1;
  14452. }
  14453. else {
  14454. lower = toFinite(lower);
  14455. if (upper === undefined) {
  14456. upper = lower;
  14457. lower = 0;
  14458. } else {
  14459. upper = toFinite(upper);
  14460. }
  14461. }
  14462. if (lower > upper) {
  14463. var temp = lower;
  14464. lower = upper;
  14465. upper = temp;
  14466. }
  14467. if (floating || lower % 1 || upper % 1) {
  14468. var rand = nativeRandom();
  14469. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14470. }
  14471. return baseRandom(lower, upper);
  14472. }
  14473. /*------------------------------------------------------------------------*/
  14474. /**
  14475. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14476. *
  14477. * @static
  14478. * @memberOf _
  14479. * @since 3.0.0
  14480. * @category String
  14481. * @param {string} [string=''] The string to convert.
  14482. * @returns {string} Returns the camel cased string.
  14483. * @example
  14484. *
  14485. * _.camelCase('Foo Bar');
  14486. * // => 'fooBar'
  14487. *
  14488. * _.camelCase('--foo-bar--');
  14489. * // => 'fooBar'
  14490. *
  14491. * _.camelCase('__FOO_BAR__');
  14492. * // => 'fooBar'
  14493. */
  14494. var camelCase = createCompounder(function(result, word, index) {
  14495. word = word.toLowerCase();
  14496. return result + (index ? capitalize(word) : word);
  14497. });
  14498. /**
  14499. * Converts the first character of `string` to upper case and the remaining
  14500. * to lower case.
  14501. *
  14502. * @static
  14503. * @memberOf _
  14504. * @since 3.0.0
  14505. * @category String
  14506. * @param {string} [string=''] The string to capitalize.
  14507. * @returns {string} Returns the capitalized string.
  14508. * @example
  14509. *
  14510. * _.capitalize('FRED');
  14511. * // => 'Fred'
  14512. */
  14513. function capitalize(string) {
  14514. return upperFirst(toString(string).toLowerCase());
  14515. }
  14516. /**
  14517. * Deburrs `string` by converting
  14518. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14519. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14520. * letters to basic Latin letters and removing
  14521. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14522. *
  14523. * @static
  14524. * @memberOf _
  14525. * @since 3.0.0
  14526. * @category String
  14527. * @param {string} [string=''] The string to deburr.
  14528. * @returns {string} Returns the deburred string.
  14529. * @example
  14530. *
  14531. * _.deburr('déjà vu');
  14532. * // => 'deja vu'
  14533. */
  14534. function deburr(string) {
  14535. string = toString(string);
  14536. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14537. }
  14538. /**
  14539. * Checks if `string` ends with the given target string.
  14540. *
  14541. * @static
  14542. * @memberOf _
  14543. * @since 3.0.0
  14544. * @category String
  14545. * @param {string} [string=''] The string to inspect.
  14546. * @param {string} [target] The string to search for.
  14547. * @param {number} [position=string.length] The position to search up to.
  14548. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14549. * else `false`.
  14550. * @example
  14551. *
  14552. * _.endsWith('abc', 'c');
  14553. * // => true
  14554. *
  14555. * _.endsWith('abc', 'b');
  14556. * // => false
  14557. *
  14558. * _.endsWith('abc', 'b', 2);
  14559. * // => true
  14560. */
  14561. function endsWith(string, target, position) {
  14562. string = toString(string);
  14563. target = baseToString(target);
  14564. var length = string.length;
  14565. position = position === undefined
  14566. ? length
  14567. : baseClamp(toInteger(position), 0, length);
  14568. var end = position;
  14569. position -= target.length;
  14570. return position >= 0 && string.slice(position, end) == target;
  14571. }
  14572. /**
  14573. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14574. * corresponding HTML entities.
  14575. *
  14576. * **Note:** No other characters are escaped. To escape additional
  14577. * characters use a third-party library like [_he_](https://mths.be/he).
  14578. *
  14579. * Though the ">" character is escaped for symmetry, characters like
  14580. * ">" and "/" don't need escaping in HTML and have no special meaning
  14581. * unless they're part of a tag or unquoted attribute value. See
  14582. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14583. * (under "semi-related fun fact") for more details.
  14584. *
  14585. * When working with HTML you should always
  14586. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14587. * XSS vectors.
  14588. *
  14589. * @static
  14590. * @since 0.1.0
  14591. * @memberOf _
  14592. * @category String
  14593. * @param {string} [string=''] The string to escape.
  14594. * @returns {string} Returns the escaped string.
  14595. * @example
  14596. *
  14597. * _.escape('fred, barney, & pebbles');
  14598. * // => 'fred, barney, &amp; pebbles'
  14599. */
  14600. function escape(string) {
  14601. string = toString(string);
  14602. return (string && reHasUnescapedHtml.test(string))
  14603. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14604. : string;
  14605. }
  14606. /**
  14607. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14608. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14609. *
  14610. * @static
  14611. * @memberOf _
  14612. * @since 3.0.0
  14613. * @category String
  14614. * @param {string} [string=''] The string to escape.
  14615. * @returns {string} Returns the escaped string.
  14616. * @example
  14617. *
  14618. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14619. * // => '\[lodash\]\(https://lodash\.com/\)'
  14620. */
  14621. function escapeRegExp(string) {
  14622. string = toString(string);
  14623. return (string && reHasRegExpChar.test(string))
  14624. ? string.replace(reRegExpChar, '\\$&')
  14625. : string;
  14626. }
  14627. /**
  14628. * Converts `string` to
  14629. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14630. *
  14631. * @static
  14632. * @memberOf _
  14633. * @since 3.0.0
  14634. * @category String
  14635. * @param {string} [string=''] The string to convert.
  14636. * @returns {string} Returns the kebab cased string.
  14637. * @example
  14638. *
  14639. * _.kebabCase('Foo Bar');
  14640. * // => 'foo-bar'
  14641. *
  14642. * _.kebabCase('fooBar');
  14643. * // => 'foo-bar'
  14644. *
  14645. * _.kebabCase('__FOO_BAR__');
  14646. * // => 'foo-bar'
  14647. */
  14648. var kebabCase = createCompounder(function(result, word, index) {
  14649. return result + (index ? '-' : '') + word.toLowerCase();
  14650. });
  14651. /**
  14652. * Converts `string`, as space separated words, to lower case.
  14653. *
  14654. * @static
  14655. * @memberOf _
  14656. * @since 4.0.0
  14657. * @category String
  14658. * @param {string} [string=''] The string to convert.
  14659. * @returns {string} Returns the lower cased string.
  14660. * @example
  14661. *
  14662. * _.lowerCase('--Foo-Bar--');
  14663. * // => 'foo bar'
  14664. *
  14665. * _.lowerCase('fooBar');
  14666. * // => 'foo bar'
  14667. *
  14668. * _.lowerCase('__FOO_BAR__');
  14669. * // => 'foo bar'
  14670. */
  14671. var lowerCase = createCompounder(function(result, word, index) {
  14672. return result + (index ? ' ' : '') + word.toLowerCase();
  14673. });
  14674. /**
  14675. * Converts the first character of `string` to lower case.
  14676. *
  14677. * @static
  14678. * @memberOf _
  14679. * @since 4.0.0
  14680. * @category String
  14681. * @param {string} [string=''] The string to convert.
  14682. * @returns {string} Returns the converted string.
  14683. * @example
  14684. *
  14685. * _.lowerFirst('Fred');
  14686. * // => 'fred'
  14687. *
  14688. * _.lowerFirst('FRED');
  14689. * // => 'fRED'
  14690. */
  14691. var lowerFirst = createCaseFirst('toLowerCase');
  14692. /**
  14693. * Pads `string` on the left and right sides if it's shorter than `length`.
  14694. * Padding characters are truncated if they can't be evenly divided by `length`.
  14695. *
  14696. * @static
  14697. * @memberOf _
  14698. * @since 3.0.0
  14699. * @category String
  14700. * @param {string} [string=''] The string to pad.
  14701. * @param {number} [length=0] The padding length.
  14702. * @param {string} [chars=' '] The string used as padding.
  14703. * @returns {string} Returns the padded string.
  14704. * @example
  14705. *
  14706. * _.pad('abc', 8);
  14707. * // => ' abc '
  14708. *
  14709. * _.pad('abc', 8, '_-');
  14710. * // => '_-abc_-_'
  14711. *
  14712. * _.pad('abc', 3);
  14713. * // => 'abc'
  14714. */
  14715. function pad(string, length, chars) {
  14716. string = toString(string);
  14717. length = toInteger(length);
  14718. var strLength = length ? stringSize(string) : 0;
  14719. if (!length || strLength >= length) {
  14720. return string;
  14721. }
  14722. var mid = (length - strLength) / 2;
  14723. return (
  14724. createPadding(nativeFloor(mid), chars) +
  14725. string +
  14726. createPadding(nativeCeil(mid), chars)
  14727. );
  14728. }
  14729. /**
  14730. * Pads `string` on the right side if it's shorter than `length`. Padding
  14731. * characters are truncated if they exceed `length`.
  14732. *
  14733. * @static
  14734. * @memberOf _
  14735. * @since 4.0.0
  14736. * @category String
  14737. * @param {string} [string=''] The string to pad.
  14738. * @param {number} [length=0] The padding length.
  14739. * @param {string} [chars=' '] The string used as padding.
  14740. * @returns {string} Returns the padded string.
  14741. * @example
  14742. *
  14743. * _.padEnd('abc', 6);
  14744. * // => 'abc '
  14745. *
  14746. * _.padEnd('abc', 6, '_-');
  14747. * // => 'abc_-_'
  14748. *
  14749. * _.padEnd('abc', 3);
  14750. * // => 'abc'
  14751. */
  14752. function padEnd(string, length, chars) {
  14753. string = toString(string);
  14754. length = toInteger(length);
  14755. var strLength = length ? stringSize(string) : 0;
  14756. return (length && strLength < length)
  14757. ? (string + createPadding(length - strLength, chars))
  14758. : string;
  14759. }
  14760. /**
  14761. * Pads `string` on the left side if it's shorter than `length`. Padding
  14762. * characters are truncated if they exceed `length`.
  14763. *
  14764. * @static
  14765. * @memberOf _
  14766. * @since 4.0.0
  14767. * @category String
  14768. * @param {string} [string=''] The string to pad.
  14769. * @param {number} [length=0] The padding length.
  14770. * @param {string} [chars=' '] The string used as padding.
  14771. * @returns {string} Returns the padded string.
  14772. * @example
  14773. *
  14774. * _.padStart('abc', 6);
  14775. * // => ' abc'
  14776. *
  14777. * _.padStart('abc', 6, '_-');
  14778. * // => '_-_abc'
  14779. *
  14780. * _.padStart('abc', 3);
  14781. * // => 'abc'
  14782. */
  14783. function padStart(string, length, chars) {
  14784. string = toString(string);
  14785. length = toInteger(length);
  14786. var strLength = length ? stringSize(string) : 0;
  14787. return (length && strLength < length)
  14788. ? (createPadding(length - strLength, chars) + string)
  14789. : string;
  14790. }
  14791. /**
  14792. * Converts `string` to an integer of the specified radix. If `radix` is
  14793. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14794. * hexadecimal, in which case a `radix` of `16` is used.
  14795. *
  14796. * **Note:** This method aligns with the
  14797. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14798. *
  14799. * @static
  14800. * @memberOf _
  14801. * @since 1.1.0
  14802. * @category String
  14803. * @param {string} string The string to convert.
  14804. * @param {number} [radix=10] The radix to interpret `value` by.
  14805. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14806. * @returns {number} Returns the converted integer.
  14807. * @example
  14808. *
  14809. * _.parseInt('08');
  14810. * // => 8
  14811. *
  14812. * _.map(['6', '08', '10'], _.parseInt);
  14813. * // => [6, 8, 10]
  14814. */
  14815. function parseInt(string, radix, guard) {
  14816. if (guard || radix == null) {
  14817. radix = 0;
  14818. } else if (radix) {
  14819. radix = +radix;
  14820. }
  14821. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14822. }
  14823. /**
  14824. * Repeats the given string `n` times.
  14825. *
  14826. * @static
  14827. * @memberOf _
  14828. * @since 3.0.0
  14829. * @category String
  14830. * @param {string} [string=''] The string to repeat.
  14831. * @param {number} [n=1] The number of times to repeat the string.
  14832. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14833. * @returns {string} Returns the repeated string.
  14834. * @example
  14835. *
  14836. * _.repeat('*', 3);
  14837. * // => '***'
  14838. *
  14839. * _.repeat('abc', 2);
  14840. * // => 'abcabc'
  14841. *
  14842. * _.repeat('abc', 0);
  14843. * // => ''
  14844. */
  14845. function repeat(string, n, guard) {
  14846. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14847. n = 1;
  14848. } else {
  14849. n = toInteger(n);
  14850. }
  14851. return baseRepeat(toString(string), n);
  14852. }
  14853. /**
  14854. * Replaces matches for `pattern` in `string` with `replacement`.
  14855. *
  14856. * **Note:** This method is based on
  14857. * [`String#replace`](https://mdn.io/String/replace).
  14858. *
  14859. * @static
  14860. * @memberOf _
  14861. * @since 4.0.0
  14862. * @category String
  14863. * @param {string} [string=''] The string to modify.
  14864. * @param {RegExp|string} pattern The pattern to replace.
  14865. * @param {Function|string} replacement The match replacement.
  14866. * @returns {string} Returns the modified string.
  14867. * @example
  14868. *
  14869. * _.replace('Hi Fred', 'Fred', 'Barney');
  14870. * // => 'Hi Barney'
  14871. */
  14872. function replace() {
  14873. var args = arguments,
  14874. string = toString(args[0]);
  14875. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14876. }
  14877. /**
  14878. * Converts `string` to
  14879. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14880. *
  14881. * @static
  14882. * @memberOf _
  14883. * @since 3.0.0
  14884. * @category String
  14885. * @param {string} [string=''] The string to convert.
  14886. * @returns {string} Returns the snake cased string.
  14887. * @example
  14888. *
  14889. * _.snakeCase('Foo Bar');
  14890. * // => 'foo_bar'
  14891. *
  14892. * _.snakeCase('fooBar');
  14893. * // => 'foo_bar'
  14894. *
  14895. * _.snakeCase('--FOO-BAR--');
  14896. * // => 'foo_bar'
  14897. */
  14898. var snakeCase = createCompounder(function(result, word, index) {
  14899. return result + (index ? '_' : '') + word.toLowerCase();
  14900. });
  14901. /**
  14902. * Splits `string` by `separator`.
  14903. *
  14904. * **Note:** This method is based on
  14905. * [`String#split`](https://mdn.io/String/split).
  14906. *
  14907. * @static
  14908. * @memberOf _
  14909. * @since 4.0.0
  14910. * @category String
  14911. * @param {string} [string=''] The string to split.
  14912. * @param {RegExp|string} separator The separator pattern to split by.
  14913. * @param {number} [limit] The length to truncate results to.
  14914. * @returns {Array} Returns the string segments.
  14915. * @example
  14916. *
  14917. * _.split('a-b-c', '-', 2);
  14918. * // => ['a', 'b']
  14919. */
  14920. function split(string, separator, limit) {
  14921. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14922. separator = limit = undefined;
  14923. }
  14924. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14925. if (!limit) {
  14926. return [];
  14927. }
  14928. string = toString(string);
  14929. if (string && (
  14930. typeof separator == 'string' ||
  14931. (separator != null && !isRegExp(separator))
  14932. )) {
  14933. separator = baseToString(separator);
  14934. if (!separator && hasUnicode(string)) {
  14935. return castSlice(stringToArray(string), 0, limit);
  14936. }
  14937. }
  14938. return string.split(separator, limit);
  14939. }
  14940. /**
  14941. * Converts `string` to
  14942. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14943. *
  14944. * @static
  14945. * @memberOf _
  14946. * @since 3.1.0
  14947. * @category String
  14948. * @param {string} [string=''] The string to convert.
  14949. * @returns {string} Returns the start cased string.
  14950. * @example
  14951. *
  14952. * _.startCase('--foo-bar--');
  14953. * // => 'Foo Bar'
  14954. *
  14955. * _.startCase('fooBar');
  14956. * // => 'Foo Bar'
  14957. *
  14958. * _.startCase('__FOO_BAR__');
  14959. * // => 'FOO BAR'
  14960. */
  14961. var startCase = createCompounder(function(result, word, index) {
  14962. return result + (index ? ' ' : '') + upperFirst(word);
  14963. });
  14964. /**
  14965. * Checks if `string` starts with the given target string.
  14966. *
  14967. * @static
  14968. * @memberOf _
  14969. * @since 3.0.0
  14970. * @category String
  14971. * @param {string} [string=''] The string to inspect.
  14972. * @param {string} [target] The string to search for.
  14973. * @param {number} [position=0] The position to search from.
  14974. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14975. * else `false`.
  14976. * @example
  14977. *
  14978. * _.startsWith('abc', 'a');
  14979. * // => true
  14980. *
  14981. * _.startsWith('abc', 'b');
  14982. * // => false
  14983. *
  14984. * _.startsWith('abc', 'b', 1);
  14985. * // => true
  14986. */
  14987. function startsWith(string, target, position) {
  14988. string = toString(string);
  14989. position = position == null
  14990. ? 0
  14991. : baseClamp(toInteger(position), 0, string.length);
  14992. target = baseToString(target);
  14993. return string.slice(position, position + target.length) == target;
  14994. }
  14995. /**
  14996. * Creates a compiled template function that can interpolate data properties
  14997. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14998. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14999. * properties may be accessed as free variables in the template. If a setting
  15000. * object is given, it takes precedence over `_.templateSettings` values.
  15001. *
  15002. * **Note:** In the development build `_.template` utilizes
  15003. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15004. * for easier debugging.
  15005. *
  15006. * For more information on precompiling templates see
  15007. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15008. *
  15009. * For more information on Chrome extension sandboxes see
  15010. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15011. *
  15012. * @static
  15013. * @since 0.1.0
  15014. * @memberOf _
  15015. * @category String
  15016. * @param {string} [string=''] The template string.
  15017. * @param {Object} [options={}] The options object.
  15018. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15019. * The HTML "escape" delimiter.
  15020. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15021. * The "evaluate" delimiter.
  15022. * @param {Object} [options.imports=_.templateSettings.imports]
  15023. * An object to import into the template as free variables.
  15024. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15025. * The "interpolate" delimiter.
  15026. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15027. * The sourceURL of the compiled template.
  15028. * @param {string} [options.variable='obj']
  15029. * The data object variable name.
  15030. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15031. * @returns {Function} Returns the compiled template function.
  15032. * @example
  15033. *
  15034. * // Use the "interpolate" delimiter to create a compiled template.
  15035. * var compiled = _.template('hello <%= user %>!');
  15036. * compiled({ 'user': 'fred' });
  15037. * // => 'hello fred!'
  15038. *
  15039. * // Use the HTML "escape" delimiter to escape data property values.
  15040. * var compiled = _.template('<b><%- value %></b>');
  15041. * compiled({ 'value': '<script>' });
  15042. * // => '<b>&lt;script&gt;</b>'
  15043. *
  15044. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15045. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15046. * compiled({ 'users': ['fred', 'barney'] });
  15047. * // => '<li>fred</li><li>barney</li>'
  15048. *
  15049. * // Use the internal `print` function in "evaluate" delimiters.
  15050. * var compiled = _.template('<% print("hello " + user); %>!');
  15051. * compiled({ 'user': 'barney' });
  15052. * // => 'hello barney!'
  15053. *
  15054. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15055. * // Disable support by replacing the "interpolate" delimiter.
  15056. * var compiled = _.template('hello ${ user }!');
  15057. * compiled({ 'user': 'pebbles' });
  15058. * // => 'hello pebbles!'
  15059. *
  15060. * // Use backslashes to treat delimiters as plain text.
  15061. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15062. * compiled({ 'value': 'ignored' });
  15063. * // => '<%- value %>'
  15064. *
  15065. * // Use the `imports` option to import `jQuery` as `jq`.
  15066. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15067. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15068. * compiled({ 'users': ['fred', 'barney'] });
  15069. * // => '<li>fred</li><li>barney</li>'
  15070. *
  15071. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15072. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15073. * compiled(data);
  15074. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15075. *
  15076. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15077. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15078. * compiled.source;
  15079. * // => function(data) {
  15080. * // var __t, __p = '';
  15081. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15082. * // return __p;
  15083. * // }
  15084. *
  15085. * // Use custom template delimiters.
  15086. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15087. * var compiled = _.template('hello {{ user }}!');
  15088. * compiled({ 'user': 'mustache' });
  15089. * // => 'hello mustache!'
  15090. *
  15091. * // Use the `source` property to inline compiled templates for meaningful
  15092. * // line numbers in error messages and stack traces.
  15093. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15094. * var JST = {\
  15095. * "main": ' + _.template(mainText).source + '\
  15096. * };\
  15097. * ');
  15098. */
  15099. function template(string, options, guard) {
  15100. // Based on John Resig's `tmpl` implementation
  15101. // (http://ejohn.org/blog/javascript-micro-templating/)
  15102. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15103. var settings = lodash.templateSettings;
  15104. if (guard && isIterateeCall(string, options, guard)) {
  15105. options = undefined;
  15106. }
  15107. string = toString(string);
  15108. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15109. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15110. importsKeys = keys(imports),
  15111. importsValues = baseValues(imports, importsKeys);
  15112. var isEscaping,
  15113. isEvaluating,
  15114. index = 0,
  15115. interpolate = options.interpolate || reNoMatch,
  15116. source = "__p += '";
  15117. // Compile the regexp to match each delimiter.
  15118. var reDelimiters = RegExp(
  15119. (options.escape || reNoMatch).source + '|' +
  15120. interpolate.source + '|' +
  15121. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15122. (options.evaluate || reNoMatch).source + '|$'
  15123. , 'g');
  15124. // Use a sourceURL for easier debugging.
  15125. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15126. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15127. // and escape the comment, thus injecting code that gets evaled.
  15128. var sourceURL = '//# sourceURL=' +
  15129. (hasOwnProperty.call(options, 'sourceURL')
  15130. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15131. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15132. ) + '\n';
  15133. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15134. interpolateValue || (interpolateValue = esTemplateValue);
  15135. // Escape characters that can't be included in string literals.
  15136. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15137. // Replace delimiters with snippets.
  15138. if (escapeValue) {
  15139. isEscaping = true;
  15140. source += "' +\n__e(" + escapeValue + ") +\n'";
  15141. }
  15142. if (evaluateValue) {
  15143. isEvaluating = true;
  15144. source += "';\n" + evaluateValue + ";\n__p += '";
  15145. }
  15146. if (interpolateValue) {
  15147. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15148. }
  15149. index = offset + match.length;
  15150. // The JS engine embedded in Adobe products needs `match` returned in
  15151. // order to produce the correct `offset` value.
  15152. return match;
  15153. });
  15154. source += "';\n";
  15155. // If `variable` is not specified wrap a with-statement around the generated
  15156. // code to add the data object to the top of the scope chain.
  15157. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15158. if (!variable) {
  15159. source = 'with (obj) {\n' + source + '\n}\n';
  15160. }
  15161. // Throw an error if a forbidden character was found in `variable`, to prevent
  15162. // potential command injection attacks.
  15163. else if (reForbiddenIdentifierChars.test(variable)) {
  15164. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15165. }
  15166. // Cleanup code by stripping empty strings.
  15167. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15168. .replace(reEmptyStringMiddle, '$1')
  15169. .replace(reEmptyStringTrailing, '$1;');
  15170. // Frame code as the function body.
  15171. source = 'function(' + (variable || 'obj') + ') {\n' +
  15172. (variable
  15173. ? ''
  15174. : 'obj || (obj = {});\n'
  15175. ) +
  15176. "var __t, __p = ''" +
  15177. (isEscaping
  15178. ? ', __e = _.escape'
  15179. : ''
  15180. ) +
  15181. (isEvaluating
  15182. ? ', __j = Array.prototype.join;\n' +
  15183. "function print() { __p += __j.call(arguments, '') }\n"
  15184. : ';\n'
  15185. ) +
  15186. source +
  15187. 'return __p\n}';
  15188. var result = attempt(function() {
  15189. return Function(importsKeys, sourceURL + 'return ' + source)
  15190. .apply(undefined, importsValues);
  15191. });
  15192. // Provide the compiled function's source by its `toString` method or
  15193. // the `source` property as a convenience for inlining compiled templates.
  15194. result.source = source;
  15195. if (isError(result)) {
  15196. throw result;
  15197. }
  15198. return result;
  15199. }
  15200. /**
  15201. * Converts `string`, as a whole, to lower case just like
  15202. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15203. *
  15204. * @static
  15205. * @memberOf _
  15206. * @since 4.0.0
  15207. * @category String
  15208. * @param {string} [string=''] The string to convert.
  15209. * @returns {string} Returns the lower cased string.
  15210. * @example
  15211. *
  15212. * _.toLower('--Foo-Bar--');
  15213. * // => '--foo-bar--'
  15214. *
  15215. * _.toLower('fooBar');
  15216. * // => 'foobar'
  15217. *
  15218. * _.toLower('__FOO_BAR__');
  15219. * // => '__foo_bar__'
  15220. */
  15221. function toLower(value) {
  15222. return toString(value).toLowerCase();
  15223. }
  15224. /**
  15225. * Converts `string`, as a whole, to upper case just like
  15226. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15227. *
  15228. * @static
  15229. * @memberOf _
  15230. * @since 4.0.0
  15231. * @category String
  15232. * @param {string} [string=''] The string to convert.
  15233. * @returns {string} Returns the upper cased string.
  15234. * @example
  15235. *
  15236. * _.toUpper('--foo-bar--');
  15237. * // => '--FOO-BAR--'
  15238. *
  15239. * _.toUpper('fooBar');
  15240. * // => 'FOOBAR'
  15241. *
  15242. * _.toUpper('__foo_bar__');
  15243. * // => '__FOO_BAR__'
  15244. */
  15245. function toUpper(value) {
  15246. return toString(value).toUpperCase();
  15247. }
  15248. /**
  15249. * Removes leading and trailing whitespace or specified characters from `string`.
  15250. *
  15251. * @static
  15252. * @memberOf _
  15253. * @since 3.0.0
  15254. * @category String
  15255. * @param {string} [string=''] The string to trim.
  15256. * @param {string} [chars=whitespace] The characters to trim.
  15257. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15258. * @returns {string} Returns the trimmed string.
  15259. * @example
  15260. *
  15261. * _.trim(' abc ');
  15262. * // => 'abc'
  15263. *
  15264. * _.trim('-_-abc-_-', '_-');
  15265. * // => 'abc'
  15266. *
  15267. * _.map([' foo ', ' bar '], _.trim);
  15268. * // => ['foo', 'bar']
  15269. */
  15270. function trim(string, chars, guard) {
  15271. string = toString(string);
  15272. if (string && (guard || chars === undefined)) {
  15273. return baseTrim(string);
  15274. }
  15275. if (!string || !(chars = baseToString(chars))) {
  15276. return string;
  15277. }
  15278. var strSymbols = stringToArray(string),
  15279. chrSymbols = stringToArray(chars),
  15280. start = charsStartIndex(strSymbols, chrSymbols),
  15281. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15282. return castSlice(strSymbols, start, end).join('');
  15283. }
  15284. /**
  15285. * Removes trailing whitespace or specified characters from `string`.
  15286. *
  15287. * @static
  15288. * @memberOf _
  15289. * @since 4.0.0
  15290. * @category String
  15291. * @param {string} [string=''] The string to trim.
  15292. * @param {string} [chars=whitespace] The characters to trim.
  15293. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15294. * @returns {string} Returns the trimmed string.
  15295. * @example
  15296. *
  15297. * _.trimEnd(' abc ');
  15298. * // => ' abc'
  15299. *
  15300. * _.trimEnd('-_-abc-_-', '_-');
  15301. * // => '-_-abc'
  15302. */
  15303. function trimEnd(string, chars, guard) {
  15304. string = toString(string);
  15305. if (string && (guard || chars === undefined)) {
  15306. return string.slice(0, trimmedEndIndex(string) + 1);
  15307. }
  15308. if (!string || !(chars = baseToString(chars))) {
  15309. return string;
  15310. }
  15311. var strSymbols = stringToArray(string),
  15312. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15313. return castSlice(strSymbols, 0, end).join('');
  15314. }
  15315. /**
  15316. * Removes leading whitespace or specified characters from `string`.
  15317. *
  15318. * @static
  15319. * @memberOf _
  15320. * @since 4.0.0
  15321. * @category String
  15322. * @param {string} [string=''] The string to trim.
  15323. * @param {string} [chars=whitespace] The characters to trim.
  15324. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15325. * @returns {string} Returns the trimmed string.
  15326. * @example
  15327. *
  15328. * _.trimStart(' abc ');
  15329. * // => 'abc '
  15330. *
  15331. * _.trimStart('-_-abc-_-', '_-');
  15332. * // => 'abc-_-'
  15333. */
  15334. function trimStart(string, chars, guard) {
  15335. string = toString(string);
  15336. if (string && (guard || chars === undefined)) {
  15337. return string.replace(reTrimStart, '');
  15338. }
  15339. if (!string || !(chars = baseToString(chars))) {
  15340. return string;
  15341. }
  15342. var strSymbols = stringToArray(string),
  15343. start = charsStartIndex(strSymbols, stringToArray(chars));
  15344. return castSlice(strSymbols, start).join('');
  15345. }
  15346. /**
  15347. * Truncates `string` if it's longer than the given maximum string length.
  15348. * The last characters of the truncated string are replaced with the omission
  15349. * string which defaults to "...".
  15350. *
  15351. * @static
  15352. * @memberOf _
  15353. * @since 4.0.0
  15354. * @category String
  15355. * @param {string} [string=''] The string to truncate.
  15356. * @param {Object} [options={}] The options object.
  15357. * @param {number} [options.length=30] The maximum string length.
  15358. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15359. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15360. * @returns {string} Returns the truncated string.
  15361. * @example
  15362. *
  15363. * _.truncate('hi-diddly-ho there, neighborino');
  15364. * // => 'hi-diddly-ho there, neighbo...'
  15365. *
  15366. * _.truncate('hi-diddly-ho there, neighborino', {
  15367. * 'length': 24,
  15368. * 'separator': ' '
  15369. * });
  15370. * // => 'hi-diddly-ho there,...'
  15371. *
  15372. * _.truncate('hi-diddly-ho there, neighborino', {
  15373. * 'length': 24,
  15374. * 'separator': /,? +/
  15375. * });
  15376. * // => 'hi-diddly-ho there...'
  15377. *
  15378. * _.truncate('hi-diddly-ho there, neighborino', {
  15379. * 'omission': ' [...]'
  15380. * });
  15381. * // => 'hi-diddly-ho there, neig [...]'
  15382. */
  15383. function truncate(string, options) {
  15384. var length = DEFAULT_TRUNC_LENGTH,
  15385. omission = DEFAULT_TRUNC_OMISSION;
  15386. if (isObject(options)) {
  15387. var separator = 'separator' in options ? options.separator : separator;
  15388. length = 'length' in options ? toInteger(options.length) : length;
  15389. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15390. }
  15391. string = toString(string);
  15392. var strLength = string.length;
  15393. if (hasUnicode(string)) {
  15394. var strSymbols = stringToArray(string);
  15395. strLength = strSymbols.length;
  15396. }
  15397. if (length >= strLength) {
  15398. return string;
  15399. }
  15400. var end = length - stringSize(omission);
  15401. if (end < 1) {
  15402. return omission;
  15403. }
  15404. var result = strSymbols
  15405. ? castSlice(strSymbols, 0, end).join('')
  15406. : string.slice(0, end);
  15407. if (separator === undefined) {
  15408. return result + omission;
  15409. }
  15410. if (strSymbols) {
  15411. end += (result.length - end);
  15412. }
  15413. if (isRegExp(separator)) {
  15414. if (string.slice(end).search(separator)) {
  15415. var match,
  15416. substring = result;
  15417. if (!separator.global) {
  15418. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15419. }
  15420. separator.lastIndex = 0;
  15421. while ((match = separator.exec(substring))) {
  15422. var newEnd = match.index;
  15423. }
  15424. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15425. }
  15426. } else if (string.indexOf(baseToString(separator), end) != end) {
  15427. var index = result.lastIndexOf(separator);
  15428. if (index > -1) {
  15429. result = result.slice(0, index);
  15430. }
  15431. }
  15432. return result + omission;
  15433. }
  15434. /**
  15435. * The inverse of `_.escape`; this method converts the HTML entities
  15436. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15437. * their corresponding characters.
  15438. *
  15439. * **Note:** No other HTML entities are unescaped. To unescape additional
  15440. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15441. *
  15442. * @static
  15443. * @memberOf _
  15444. * @since 0.6.0
  15445. * @category String
  15446. * @param {string} [string=''] The string to unescape.
  15447. * @returns {string} Returns the unescaped string.
  15448. * @example
  15449. *
  15450. * _.unescape('fred, barney, &amp; pebbles');
  15451. * // => 'fred, barney, & pebbles'
  15452. */
  15453. function unescape(string) {
  15454. string = toString(string);
  15455. return (string && reHasEscapedHtml.test(string))
  15456. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15457. : string;
  15458. }
  15459. /**
  15460. * Converts `string`, as space separated words, to upper case.
  15461. *
  15462. * @static
  15463. * @memberOf _
  15464. * @since 4.0.0
  15465. * @category String
  15466. * @param {string} [string=''] The string to convert.
  15467. * @returns {string} Returns the upper cased string.
  15468. * @example
  15469. *
  15470. * _.upperCase('--foo-bar');
  15471. * // => 'FOO BAR'
  15472. *
  15473. * _.upperCase('fooBar');
  15474. * // => 'FOO BAR'
  15475. *
  15476. * _.upperCase('__foo_bar__');
  15477. * // => 'FOO BAR'
  15478. */
  15479. var upperCase = createCompounder(function(result, word, index) {
  15480. return result + (index ? ' ' : '') + word.toUpperCase();
  15481. });
  15482. /**
  15483. * Converts the first character of `string` to upper case.
  15484. *
  15485. * @static
  15486. * @memberOf _
  15487. * @since 4.0.0
  15488. * @category String
  15489. * @param {string} [string=''] The string to convert.
  15490. * @returns {string} Returns the converted string.
  15491. * @example
  15492. *
  15493. * _.upperFirst('fred');
  15494. * // => 'Fred'
  15495. *
  15496. * _.upperFirst('FRED');
  15497. * // => 'FRED'
  15498. */
  15499. var upperFirst = createCaseFirst('toUpperCase');
  15500. /**
  15501. * Splits `string` into an array of its words.
  15502. *
  15503. * @static
  15504. * @memberOf _
  15505. * @since 3.0.0
  15506. * @category String
  15507. * @param {string} [string=''] The string to inspect.
  15508. * @param {RegExp|string} [pattern] The pattern to match words.
  15509. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15510. * @returns {Array} Returns the words of `string`.
  15511. * @example
  15512. *
  15513. * _.words('fred, barney, & pebbles');
  15514. * // => ['fred', 'barney', 'pebbles']
  15515. *
  15516. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15517. * // => ['fred', 'barney', '&', 'pebbles']
  15518. */
  15519. function words(string, pattern, guard) {
  15520. string = toString(string);
  15521. pattern = guard ? undefined : pattern;
  15522. if (pattern === undefined) {
  15523. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15524. }
  15525. return string.match(pattern) || [];
  15526. }
  15527. /*------------------------------------------------------------------------*/
  15528. /**
  15529. * Attempts to invoke `func`, returning either the result or the caught error
  15530. * object. Any additional arguments are provided to `func` when it's invoked.
  15531. *
  15532. * @static
  15533. * @memberOf _
  15534. * @since 3.0.0
  15535. * @category Util
  15536. * @param {Function} func The function to attempt.
  15537. * @param {...*} [args] The arguments to invoke `func` with.
  15538. * @returns {*} Returns the `func` result or error object.
  15539. * @example
  15540. *
  15541. * // Avoid throwing errors for invalid selectors.
  15542. * var elements = _.attempt(function(selector) {
  15543. * return document.querySelectorAll(selector);
  15544. * }, '>_>');
  15545. *
  15546. * if (_.isError(elements)) {
  15547. * elements = [];
  15548. * }
  15549. */
  15550. var attempt = baseRest(function(func, args) {
  15551. try {
  15552. return apply(func, undefined, args);
  15553. } catch (e) {
  15554. return isError(e) ? e : new Error(e);
  15555. }
  15556. });
  15557. /**
  15558. * Binds methods of an object to the object itself, overwriting the existing
  15559. * method.
  15560. *
  15561. * **Note:** This method doesn't set the "length" property of bound functions.
  15562. *
  15563. * @static
  15564. * @since 0.1.0
  15565. * @memberOf _
  15566. * @category Util
  15567. * @param {Object} object The object to bind and assign the bound methods to.
  15568. * @param {...(string|string[])} methodNames The object method names to bind.
  15569. * @returns {Object} Returns `object`.
  15570. * @example
  15571. *
  15572. * var view = {
  15573. * 'label': 'docs',
  15574. * 'click': function() {
  15575. * console.log('clicked ' + this.label);
  15576. * }
  15577. * };
  15578. *
  15579. * _.bindAll(view, ['click']);
  15580. * jQuery(element).on('click', view.click);
  15581. * // => Logs 'clicked docs' when clicked.
  15582. */
  15583. var bindAll = flatRest(function(object, methodNames) {
  15584. arrayEach(methodNames, function(key) {
  15585. key = toKey(key);
  15586. baseAssignValue(object, key, bind(object[key], object));
  15587. });
  15588. return object;
  15589. });
  15590. /**
  15591. * Creates a function that iterates over `pairs` and invokes the corresponding
  15592. * function of the first predicate to return truthy. The predicate-function
  15593. * pairs are invoked with the `this` binding and arguments of the created
  15594. * function.
  15595. *
  15596. * @static
  15597. * @memberOf _
  15598. * @since 4.0.0
  15599. * @category Util
  15600. * @param {Array} pairs The predicate-function pairs.
  15601. * @returns {Function} Returns the new composite function.
  15602. * @example
  15603. *
  15604. * var func = _.cond([
  15605. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15606. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15607. * [_.stubTrue, _.constant('no match')]
  15608. * ]);
  15609. *
  15610. * func({ 'a': 1, 'b': 2 });
  15611. * // => 'matches A'
  15612. *
  15613. * func({ 'a': 0, 'b': 1 });
  15614. * // => 'matches B'
  15615. *
  15616. * func({ 'a': '1', 'b': '2' });
  15617. * // => 'no match'
  15618. */
  15619. function cond(pairs) {
  15620. var length = pairs == null ? 0 : pairs.length,
  15621. toIteratee = getIteratee();
  15622. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15623. if (typeof pair[1] != 'function') {
  15624. throw new TypeError(FUNC_ERROR_TEXT);
  15625. }
  15626. return [toIteratee(pair[0]), pair[1]];
  15627. });
  15628. return baseRest(function(args) {
  15629. var index = -1;
  15630. while (++index < length) {
  15631. var pair = pairs[index];
  15632. if (apply(pair[0], this, args)) {
  15633. return apply(pair[1], this, args);
  15634. }
  15635. }
  15636. });
  15637. }
  15638. /**
  15639. * Creates a function that invokes the predicate properties of `source` with
  15640. * the corresponding property values of a given object, returning `true` if
  15641. * all predicates return truthy, else `false`.
  15642. *
  15643. * **Note:** The created function is equivalent to `_.conformsTo` with
  15644. * `source` partially applied.
  15645. *
  15646. * @static
  15647. * @memberOf _
  15648. * @since 4.0.0
  15649. * @category Util
  15650. * @param {Object} source The object of property predicates to conform to.
  15651. * @returns {Function} Returns the new spec function.
  15652. * @example
  15653. *
  15654. * var objects = [
  15655. * { 'a': 2, 'b': 1 },
  15656. * { 'a': 1, 'b': 2 }
  15657. * ];
  15658. *
  15659. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15660. * // => [{ 'a': 1, 'b': 2 }]
  15661. */
  15662. function conforms(source) {
  15663. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15664. }
  15665. /**
  15666. * Creates a function that returns `value`.
  15667. *
  15668. * @static
  15669. * @memberOf _
  15670. * @since 2.4.0
  15671. * @category Util
  15672. * @param {*} value The value to return from the new function.
  15673. * @returns {Function} Returns the new constant function.
  15674. * @example
  15675. *
  15676. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15677. *
  15678. * console.log(objects);
  15679. * // => [{ 'a': 1 }, { 'a': 1 }]
  15680. *
  15681. * console.log(objects[0] === objects[1]);
  15682. * // => true
  15683. */
  15684. function constant(value) {
  15685. return function() {
  15686. return value;
  15687. };
  15688. }
  15689. /**
  15690. * Checks `value` to determine whether a default value should be returned in
  15691. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15692. * or `undefined`.
  15693. *
  15694. * @static
  15695. * @memberOf _
  15696. * @since 4.14.0
  15697. * @category Util
  15698. * @param {*} value The value to check.
  15699. * @param {*} defaultValue The default value.
  15700. * @returns {*} Returns the resolved value.
  15701. * @example
  15702. *
  15703. * _.defaultTo(1, 10);
  15704. * // => 1
  15705. *
  15706. * _.defaultTo(undefined, 10);
  15707. * // => 10
  15708. */
  15709. function defaultTo(value, defaultValue) {
  15710. return (value == null || value !== value) ? defaultValue : value;
  15711. }
  15712. /**
  15713. * Creates a function that returns the result of invoking the given functions
  15714. * with the `this` binding of the created function, where each successive
  15715. * invocation is supplied the return value of the previous.
  15716. *
  15717. * @static
  15718. * @memberOf _
  15719. * @since 3.0.0
  15720. * @category Util
  15721. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15722. * @returns {Function} Returns the new composite function.
  15723. * @see _.flowRight
  15724. * @example
  15725. *
  15726. * function square(n) {
  15727. * return n * n;
  15728. * }
  15729. *
  15730. * var addSquare = _.flow([_.add, square]);
  15731. * addSquare(1, 2);
  15732. * // => 9
  15733. */
  15734. var flow = createFlow();
  15735. /**
  15736. * This method is like `_.flow` except that it creates a function that
  15737. * invokes the given functions from right to left.
  15738. *
  15739. * @static
  15740. * @since 3.0.0
  15741. * @memberOf _
  15742. * @category Util
  15743. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15744. * @returns {Function} Returns the new composite function.
  15745. * @see _.flow
  15746. * @example
  15747. *
  15748. * function square(n) {
  15749. * return n * n;
  15750. * }
  15751. *
  15752. * var addSquare = _.flowRight([square, _.add]);
  15753. * addSquare(1, 2);
  15754. * // => 9
  15755. */
  15756. var flowRight = createFlow(true);
  15757. /**
  15758. * This method returns the first argument it receives.
  15759. *
  15760. * @static
  15761. * @since 0.1.0
  15762. * @memberOf _
  15763. * @category Util
  15764. * @param {*} value Any value.
  15765. * @returns {*} Returns `value`.
  15766. * @example
  15767. *
  15768. * var object = { 'a': 1 };
  15769. *
  15770. * console.log(_.identity(object) === object);
  15771. * // => true
  15772. */
  15773. function identity(value) {
  15774. return value;
  15775. }
  15776. /**
  15777. * Creates a function that invokes `func` with the arguments of the created
  15778. * function. If `func` is a property name, the created function returns the
  15779. * property value for a given element. If `func` is an array or object, the
  15780. * created function returns `true` for elements that contain the equivalent
  15781. * source properties, otherwise it returns `false`.
  15782. *
  15783. * @static
  15784. * @since 4.0.0
  15785. * @memberOf _
  15786. * @category Util
  15787. * @param {*} [func=_.identity] The value to convert to a callback.
  15788. * @returns {Function} Returns the callback.
  15789. * @example
  15790. *
  15791. * var users = [
  15792. * { 'user': 'barney', 'age': 36, 'active': true },
  15793. * { 'user': 'fred', 'age': 40, 'active': false }
  15794. * ];
  15795. *
  15796. * // The `_.matches` iteratee shorthand.
  15797. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15798. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15799. *
  15800. * // The `_.matchesProperty` iteratee shorthand.
  15801. * _.filter(users, _.iteratee(['user', 'fred']));
  15802. * // => [{ 'user': 'fred', 'age': 40 }]
  15803. *
  15804. * // The `_.property` iteratee shorthand.
  15805. * _.map(users, _.iteratee('user'));
  15806. * // => ['barney', 'fred']
  15807. *
  15808. * // Create custom iteratee shorthands.
  15809. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15810. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15811. * return func.test(string);
  15812. * };
  15813. * });
  15814. *
  15815. * _.filter(['abc', 'def'], /ef/);
  15816. * // => ['def']
  15817. */
  15818. function iteratee(func) {
  15819. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15820. }
  15821. /**
  15822. * Creates a function that performs a partial deep comparison between a given
  15823. * object and `source`, returning `true` if the given object has equivalent
  15824. * property values, else `false`.
  15825. *
  15826. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15827. * partially applied.
  15828. *
  15829. * Partial comparisons will match empty array and empty object `source`
  15830. * values against any array or object value, respectively. See `_.isEqual`
  15831. * for a list of supported value comparisons.
  15832. *
  15833. * **Note:** Multiple values can be checked by combining several matchers
  15834. * using `_.overSome`
  15835. *
  15836. * @static
  15837. * @memberOf _
  15838. * @since 3.0.0
  15839. * @category Util
  15840. * @param {Object} source The object of property values to match.
  15841. * @returns {Function} Returns the new spec function.
  15842. * @example
  15843. *
  15844. * var objects = [
  15845. * { 'a': 1, 'b': 2, 'c': 3 },
  15846. * { 'a': 4, 'b': 5, 'c': 6 }
  15847. * ];
  15848. *
  15849. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15850. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15851. *
  15852. * // Checking for several possible values
  15853. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15854. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15855. */
  15856. function matches(source) {
  15857. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15858. }
  15859. /**
  15860. * Creates a function that performs a partial deep comparison between the
  15861. * value at `path` of a given object to `srcValue`, returning `true` if the
  15862. * object value is equivalent, else `false`.
  15863. *
  15864. * **Note:** Partial comparisons will match empty array and empty object
  15865. * `srcValue` values against any array or object value, respectively. See
  15866. * `_.isEqual` for a list of supported value comparisons.
  15867. *
  15868. * **Note:** Multiple values can be checked by combining several matchers
  15869. * using `_.overSome`
  15870. *
  15871. * @static
  15872. * @memberOf _
  15873. * @since 3.2.0
  15874. * @category Util
  15875. * @param {Array|string} path The path of the property to get.
  15876. * @param {*} srcValue The value to match.
  15877. * @returns {Function} Returns the new spec function.
  15878. * @example
  15879. *
  15880. * var objects = [
  15881. * { 'a': 1, 'b': 2, 'c': 3 },
  15882. * { 'a': 4, 'b': 5, 'c': 6 }
  15883. * ];
  15884. *
  15885. * _.find(objects, _.matchesProperty('a', 4));
  15886. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15887. *
  15888. * // Checking for several possible values
  15889. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15890. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15891. */
  15892. function matchesProperty(path, srcValue) {
  15893. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15894. }
  15895. /**
  15896. * Creates a function that invokes the method at `path` of a given object.
  15897. * Any additional arguments are provided to the invoked method.
  15898. *
  15899. * @static
  15900. * @memberOf _
  15901. * @since 3.7.0
  15902. * @category Util
  15903. * @param {Array|string} path The path of the method to invoke.
  15904. * @param {...*} [args] The arguments to invoke the method with.
  15905. * @returns {Function} Returns the new invoker function.
  15906. * @example
  15907. *
  15908. * var objects = [
  15909. * { 'a': { 'b': _.constant(2) } },
  15910. * { 'a': { 'b': _.constant(1) } }
  15911. * ];
  15912. *
  15913. * _.map(objects, _.method('a.b'));
  15914. * // => [2, 1]
  15915. *
  15916. * _.map(objects, _.method(['a', 'b']));
  15917. * // => [2, 1]
  15918. */
  15919. var method = baseRest(function(path, args) {
  15920. return function(object) {
  15921. return baseInvoke(object, path, args);
  15922. };
  15923. });
  15924. /**
  15925. * The opposite of `_.method`; this method creates a function that invokes
  15926. * the method at a given path of `object`. Any additional arguments are
  15927. * provided to the invoked method.
  15928. *
  15929. * @static
  15930. * @memberOf _
  15931. * @since 3.7.0
  15932. * @category Util
  15933. * @param {Object} object The object to query.
  15934. * @param {...*} [args] The arguments to invoke the method with.
  15935. * @returns {Function} Returns the new invoker function.
  15936. * @example
  15937. *
  15938. * var array = _.times(3, _.constant),
  15939. * object = { 'a': array, 'b': array, 'c': array };
  15940. *
  15941. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15942. * // => [2, 0]
  15943. *
  15944. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15945. * // => [2, 0]
  15946. */
  15947. var methodOf = baseRest(function(object, args) {
  15948. return function(path) {
  15949. return baseInvoke(object, path, args);
  15950. };
  15951. });
  15952. /**
  15953. * Adds all own enumerable string keyed function properties of a source
  15954. * object to the destination object. If `object` is a function, then methods
  15955. * are added to its prototype as well.
  15956. *
  15957. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15958. * avoid conflicts caused by modifying the original.
  15959. *
  15960. * @static
  15961. * @since 0.1.0
  15962. * @memberOf _
  15963. * @category Util
  15964. * @param {Function|Object} [object=lodash] The destination object.
  15965. * @param {Object} source The object of functions to add.
  15966. * @param {Object} [options={}] The options object.
  15967. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15968. * @returns {Function|Object} Returns `object`.
  15969. * @example
  15970. *
  15971. * function vowels(string) {
  15972. * return _.filter(string, function(v) {
  15973. * return /[aeiou]/i.test(v);
  15974. * });
  15975. * }
  15976. *
  15977. * _.mixin({ 'vowels': vowels });
  15978. * _.vowels('fred');
  15979. * // => ['e']
  15980. *
  15981. * _('fred').vowels().value();
  15982. * // => ['e']
  15983. *
  15984. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15985. * _('fred').vowels();
  15986. * // => ['e']
  15987. */
  15988. function mixin(object, source, options) {
  15989. var props = keys(source),
  15990. methodNames = baseFunctions(source, props);
  15991. if (options == null &&
  15992. !(isObject(source) && (methodNames.length || !props.length))) {
  15993. options = source;
  15994. source = object;
  15995. object = this;
  15996. methodNames = baseFunctions(source, keys(source));
  15997. }
  15998. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15999. isFunc = isFunction(object);
  16000. arrayEach(methodNames, function(methodName) {
  16001. var func = source[methodName];
  16002. object[methodName] = func;
  16003. if (isFunc) {
  16004. object.prototype[methodName] = function() {
  16005. var chainAll = this.__chain__;
  16006. if (chain || chainAll) {
  16007. var result = object(this.__wrapped__),
  16008. actions = result.__actions__ = copyArray(this.__actions__);
  16009. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16010. result.__chain__ = chainAll;
  16011. return result;
  16012. }
  16013. return func.apply(object, arrayPush([this.value()], arguments));
  16014. };
  16015. }
  16016. });
  16017. return object;
  16018. }
  16019. /**
  16020. * Reverts the `_` variable to its previous value and returns a reference to
  16021. * the `lodash` function.
  16022. *
  16023. * @static
  16024. * @since 0.1.0
  16025. * @memberOf _
  16026. * @category Util
  16027. * @returns {Function} Returns the `lodash` function.
  16028. * @example
  16029. *
  16030. * var lodash = _.noConflict();
  16031. */
  16032. function noConflict() {
  16033. if (root._ === this) {
  16034. root._ = oldDash;
  16035. }
  16036. return this;
  16037. }
  16038. /**
  16039. * This method returns `undefined`.
  16040. *
  16041. * @static
  16042. * @memberOf _
  16043. * @since 2.3.0
  16044. * @category Util
  16045. * @example
  16046. *
  16047. * _.times(2, _.noop);
  16048. * // => [undefined, undefined]
  16049. */
  16050. function noop() {
  16051. // No operation performed.
  16052. }
  16053. /**
  16054. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16055. * the nth argument from the end is returned.
  16056. *
  16057. * @static
  16058. * @memberOf _
  16059. * @since 4.0.0
  16060. * @category Util
  16061. * @param {number} [n=0] The index of the argument to return.
  16062. * @returns {Function} Returns the new pass-thru function.
  16063. * @example
  16064. *
  16065. * var func = _.nthArg(1);
  16066. * func('a', 'b', 'c', 'd');
  16067. * // => 'b'
  16068. *
  16069. * var func = _.nthArg(-2);
  16070. * func('a', 'b', 'c', 'd');
  16071. * // => 'c'
  16072. */
  16073. function nthArg(n) {
  16074. n = toInteger(n);
  16075. return baseRest(function(args) {
  16076. return baseNth(args, n);
  16077. });
  16078. }
  16079. /**
  16080. * Creates a function that invokes `iteratees` with the arguments it receives
  16081. * and returns their results.
  16082. *
  16083. * @static
  16084. * @memberOf _
  16085. * @since 4.0.0
  16086. * @category Util
  16087. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16088. * The iteratees to invoke.
  16089. * @returns {Function} Returns the new function.
  16090. * @example
  16091. *
  16092. * var func = _.over([Math.max, Math.min]);
  16093. *
  16094. * func(1, 2, 3, 4);
  16095. * // => [4, 1]
  16096. */
  16097. var over = createOver(arrayMap);
  16098. /**
  16099. * Creates a function that checks if **all** of the `predicates` return
  16100. * truthy when invoked with the arguments it receives.
  16101. *
  16102. * Following shorthands are possible for providing predicates.
  16103. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16104. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16105. *
  16106. * @static
  16107. * @memberOf _
  16108. * @since 4.0.0
  16109. * @category Util
  16110. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16111. * The predicates to check.
  16112. * @returns {Function} Returns the new function.
  16113. * @example
  16114. *
  16115. * var func = _.overEvery([Boolean, isFinite]);
  16116. *
  16117. * func('1');
  16118. * // => true
  16119. *
  16120. * func(null);
  16121. * // => false
  16122. *
  16123. * func(NaN);
  16124. * // => false
  16125. */
  16126. var overEvery = createOver(arrayEvery);
  16127. /**
  16128. * Creates a function that checks if **any** of the `predicates` return
  16129. * truthy when invoked with the arguments it receives.
  16130. *
  16131. * Following shorthands are possible for providing predicates.
  16132. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16133. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16134. *
  16135. * @static
  16136. * @memberOf _
  16137. * @since 4.0.0
  16138. * @category Util
  16139. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16140. * The predicates to check.
  16141. * @returns {Function} Returns the new function.
  16142. * @example
  16143. *
  16144. * var func = _.overSome([Boolean, isFinite]);
  16145. *
  16146. * func('1');
  16147. * // => true
  16148. *
  16149. * func(null);
  16150. * // => true
  16151. *
  16152. * func(NaN);
  16153. * // => false
  16154. *
  16155. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16156. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16157. */
  16158. var overSome = createOver(arraySome);
  16159. /**
  16160. * Creates a function that returns the value at `path` of a given object.
  16161. *
  16162. * @static
  16163. * @memberOf _
  16164. * @since 2.4.0
  16165. * @category Util
  16166. * @param {Array|string} path The path of the property to get.
  16167. * @returns {Function} Returns the new accessor function.
  16168. * @example
  16169. *
  16170. * var objects = [
  16171. * { 'a': { 'b': 2 } },
  16172. * { 'a': { 'b': 1 } }
  16173. * ];
  16174. *
  16175. * _.map(objects, _.property('a.b'));
  16176. * // => [2, 1]
  16177. *
  16178. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16179. * // => [1, 2]
  16180. */
  16181. function property(path) {
  16182. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16183. }
  16184. /**
  16185. * The opposite of `_.property`; this method creates a function that returns
  16186. * the value at a given path of `object`.
  16187. *
  16188. * @static
  16189. * @memberOf _
  16190. * @since 3.0.0
  16191. * @category Util
  16192. * @param {Object} object The object to query.
  16193. * @returns {Function} Returns the new accessor function.
  16194. * @example
  16195. *
  16196. * var array = [0, 1, 2],
  16197. * object = { 'a': array, 'b': array, 'c': array };
  16198. *
  16199. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16200. * // => [2, 0]
  16201. *
  16202. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16203. * // => [2, 0]
  16204. */
  16205. function propertyOf(object) {
  16206. return function(path) {
  16207. return object == null ? undefined : baseGet(object, path);
  16208. };
  16209. }
  16210. /**
  16211. * Creates an array of numbers (positive and/or negative) progressing from
  16212. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16213. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16214. * it's set to `start` with `start` then set to `0`.
  16215. *
  16216. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16217. * floating-point values which can produce unexpected results.
  16218. *
  16219. * @static
  16220. * @since 0.1.0
  16221. * @memberOf _
  16222. * @category Util
  16223. * @param {number} [start=0] The start of the range.
  16224. * @param {number} end The end of the range.
  16225. * @param {number} [step=1] The value to increment or decrement by.
  16226. * @returns {Array} Returns the range of numbers.
  16227. * @see _.inRange, _.rangeRight
  16228. * @example
  16229. *
  16230. * _.range(4);
  16231. * // => [0, 1, 2, 3]
  16232. *
  16233. * _.range(-4);
  16234. * // => [0, -1, -2, -3]
  16235. *
  16236. * _.range(1, 5);
  16237. * // => [1, 2, 3, 4]
  16238. *
  16239. * _.range(0, 20, 5);
  16240. * // => [0, 5, 10, 15]
  16241. *
  16242. * _.range(0, -4, -1);
  16243. * // => [0, -1, -2, -3]
  16244. *
  16245. * _.range(1, 4, 0);
  16246. * // => [1, 1, 1]
  16247. *
  16248. * _.range(0);
  16249. * // => []
  16250. */
  16251. var range = createRange();
  16252. /**
  16253. * This method is like `_.range` except that it populates values in
  16254. * descending order.
  16255. *
  16256. * @static
  16257. * @memberOf _
  16258. * @since 4.0.0
  16259. * @category Util
  16260. * @param {number} [start=0] The start of the range.
  16261. * @param {number} end The end of the range.
  16262. * @param {number} [step=1] The value to increment or decrement by.
  16263. * @returns {Array} Returns the range of numbers.
  16264. * @see _.inRange, _.range
  16265. * @example
  16266. *
  16267. * _.rangeRight(4);
  16268. * // => [3, 2, 1, 0]
  16269. *
  16270. * _.rangeRight(-4);
  16271. * // => [-3, -2, -1, 0]
  16272. *
  16273. * _.rangeRight(1, 5);
  16274. * // => [4, 3, 2, 1]
  16275. *
  16276. * _.rangeRight(0, 20, 5);
  16277. * // => [15, 10, 5, 0]
  16278. *
  16279. * _.rangeRight(0, -4, -1);
  16280. * // => [-3, -2, -1, 0]
  16281. *
  16282. * _.rangeRight(1, 4, 0);
  16283. * // => [1, 1, 1]
  16284. *
  16285. * _.rangeRight(0);
  16286. * // => []
  16287. */
  16288. var rangeRight = createRange(true);
  16289. /**
  16290. * This method returns a new empty array.
  16291. *
  16292. * @static
  16293. * @memberOf _
  16294. * @since 4.13.0
  16295. * @category Util
  16296. * @returns {Array} Returns the new empty array.
  16297. * @example
  16298. *
  16299. * var arrays = _.times(2, _.stubArray);
  16300. *
  16301. * console.log(arrays);
  16302. * // => [[], []]
  16303. *
  16304. * console.log(arrays[0] === arrays[1]);
  16305. * // => false
  16306. */
  16307. function stubArray() {
  16308. return [];
  16309. }
  16310. /**
  16311. * This method returns `false`.
  16312. *
  16313. * @static
  16314. * @memberOf _
  16315. * @since 4.13.0
  16316. * @category Util
  16317. * @returns {boolean} Returns `false`.
  16318. * @example
  16319. *
  16320. * _.times(2, _.stubFalse);
  16321. * // => [false, false]
  16322. */
  16323. function stubFalse() {
  16324. return false;
  16325. }
  16326. /**
  16327. * This method returns a new empty object.
  16328. *
  16329. * @static
  16330. * @memberOf _
  16331. * @since 4.13.0
  16332. * @category Util
  16333. * @returns {Object} Returns the new empty object.
  16334. * @example
  16335. *
  16336. * var objects = _.times(2, _.stubObject);
  16337. *
  16338. * console.log(objects);
  16339. * // => [{}, {}]
  16340. *
  16341. * console.log(objects[0] === objects[1]);
  16342. * // => false
  16343. */
  16344. function stubObject() {
  16345. return {};
  16346. }
  16347. /**
  16348. * This method returns an empty string.
  16349. *
  16350. * @static
  16351. * @memberOf _
  16352. * @since 4.13.0
  16353. * @category Util
  16354. * @returns {string} Returns the empty string.
  16355. * @example
  16356. *
  16357. * _.times(2, _.stubString);
  16358. * // => ['', '']
  16359. */
  16360. function stubString() {
  16361. return '';
  16362. }
  16363. /**
  16364. * This method returns `true`.
  16365. *
  16366. * @static
  16367. * @memberOf _
  16368. * @since 4.13.0
  16369. * @category Util
  16370. * @returns {boolean} Returns `true`.
  16371. * @example
  16372. *
  16373. * _.times(2, _.stubTrue);
  16374. * // => [true, true]
  16375. */
  16376. function stubTrue() {
  16377. return true;
  16378. }
  16379. /**
  16380. * Invokes the iteratee `n` times, returning an array of the results of
  16381. * each invocation. The iteratee is invoked with one argument; (index).
  16382. *
  16383. * @static
  16384. * @since 0.1.0
  16385. * @memberOf _
  16386. * @category Util
  16387. * @param {number} n The number of times to invoke `iteratee`.
  16388. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16389. * @returns {Array} Returns the array of results.
  16390. * @example
  16391. *
  16392. * _.times(3, String);
  16393. * // => ['0', '1', '2']
  16394. *
  16395. * _.times(4, _.constant(0));
  16396. * // => [0, 0, 0, 0]
  16397. */
  16398. function times(n, iteratee) {
  16399. n = toInteger(n);
  16400. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16401. return [];
  16402. }
  16403. var index = MAX_ARRAY_LENGTH,
  16404. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16405. iteratee = getIteratee(iteratee);
  16406. n -= MAX_ARRAY_LENGTH;
  16407. var result = baseTimes(length, iteratee);
  16408. while (++index < n) {
  16409. iteratee(index);
  16410. }
  16411. return result;
  16412. }
  16413. /**
  16414. * Converts `value` to a property path array.
  16415. *
  16416. * @static
  16417. * @memberOf _
  16418. * @since 4.0.0
  16419. * @category Util
  16420. * @param {*} value The value to convert.
  16421. * @returns {Array} Returns the new property path array.
  16422. * @example
  16423. *
  16424. * _.toPath('a.b.c');
  16425. * // => ['a', 'b', 'c']
  16426. *
  16427. * _.toPath('a[0].b.c');
  16428. * // => ['a', '0', 'b', 'c']
  16429. */
  16430. function toPath(value) {
  16431. if (isArray(value)) {
  16432. return arrayMap(value, toKey);
  16433. }
  16434. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16435. }
  16436. /**
  16437. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16438. *
  16439. * @static
  16440. * @since 0.1.0
  16441. * @memberOf _
  16442. * @category Util
  16443. * @param {string} [prefix=''] The value to prefix the ID with.
  16444. * @returns {string} Returns the unique ID.
  16445. * @example
  16446. *
  16447. * _.uniqueId('contact_');
  16448. * // => 'contact_104'
  16449. *
  16450. * _.uniqueId();
  16451. * // => '105'
  16452. */
  16453. function uniqueId(prefix) {
  16454. var id = ++idCounter;
  16455. return toString(prefix) + id;
  16456. }
  16457. /*------------------------------------------------------------------------*/
  16458. /**
  16459. * Adds two numbers.
  16460. *
  16461. * @static
  16462. * @memberOf _
  16463. * @since 3.4.0
  16464. * @category Math
  16465. * @param {number} augend The first number in an addition.
  16466. * @param {number} addend The second number in an addition.
  16467. * @returns {number} Returns the total.
  16468. * @example
  16469. *
  16470. * _.add(6, 4);
  16471. * // => 10
  16472. */
  16473. var add = createMathOperation(function(augend, addend) {
  16474. return augend + addend;
  16475. }, 0);
  16476. /**
  16477. * Computes `number` rounded up to `precision`.
  16478. *
  16479. * @static
  16480. * @memberOf _
  16481. * @since 3.10.0
  16482. * @category Math
  16483. * @param {number} number The number to round up.
  16484. * @param {number} [precision=0] The precision to round up to.
  16485. * @returns {number} Returns the rounded up number.
  16486. * @example
  16487. *
  16488. * _.ceil(4.006);
  16489. * // => 5
  16490. *
  16491. * _.ceil(6.004, 2);
  16492. * // => 6.01
  16493. *
  16494. * _.ceil(6040, -2);
  16495. * // => 6100
  16496. */
  16497. var ceil = createRound('ceil');
  16498. /**
  16499. * Divide two numbers.
  16500. *
  16501. * @static
  16502. * @memberOf _
  16503. * @since 4.7.0
  16504. * @category Math
  16505. * @param {number} dividend The first number in a division.
  16506. * @param {number} divisor The second number in a division.
  16507. * @returns {number} Returns the quotient.
  16508. * @example
  16509. *
  16510. * _.divide(6, 4);
  16511. * // => 1.5
  16512. */
  16513. var divide = createMathOperation(function(dividend, divisor) {
  16514. return dividend / divisor;
  16515. }, 1);
  16516. /**
  16517. * Computes `number` rounded down to `precision`.
  16518. *
  16519. * @static
  16520. * @memberOf _
  16521. * @since 3.10.0
  16522. * @category Math
  16523. * @param {number} number The number to round down.
  16524. * @param {number} [precision=0] The precision to round down to.
  16525. * @returns {number} Returns the rounded down number.
  16526. * @example
  16527. *
  16528. * _.floor(4.006);
  16529. * // => 4
  16530. *
  16531. * _.floor(0.046, 2);
  16532. * // => 0.04
  16533. *
  16534. * _.floor(4060, -2);
  16535. * // => 4000
  16536. */
  16537. var floor = createRound('floor');
  16538. /**
  16539. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16540. * `undefined` is returned.
  16541. *
  16542. * @static
  16543. * @since 0.1.0
  16544. * @memberOf _
  16545. * @category Math
  16546. * @param {Array} array The array to iterate over.
  16547. * @returns {*} Returns the maximum value.
  16548. * @example
  16549. *
  16550. * _.max([4, 2, 8, 6]);
  16551. * // => 8
  16552. *
  16553. * _.max([]);
  16554. * // => undefined
  16555. */
  16556. function max(array) {
  16557. return (array && array.length)
  16558. ? baseExtremum(array, identity, baseGt)
  16559. : undefined;
  16560. }
  16561. /**
  16562. * This method is like `_.max` except that it accepts `iteratee` which is
  16563. * invoked for each element in `array` to generate the criterion by which
  16564. * the value is ranked. The iteratee is invoked with one argument: (value).
  16565. *
  16566. * @static
  16567. * @memberOf _
  16568. * @since 4.0.0
  16569. * @category Math
  16570. * @param {Array} array The array to iterate over.
  16571. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16572. * @returns {*} Returns the maximum value.
  16573. * @example
  16574. *
  16575. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16576. *
  16577. * _.maxBy(objects, function(o) { return o.n; });
  16578. * // => { 'n': 2 }
  16579. *
  16580. * // The `_.property` iteratee shorthand.
  16581. * _.maxBy(objects, 'n');
  16582. * // => { 'n': 2 }
  16583. */
  16584. function maxBy(array, iteratee) {
  16585. return (array && array.length)
  16586. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16587. : undefined;
  16588. }
  16589. /**
  16590. * Computes the mean of the values in `array`.
  16591. *
  16592. * @static
  16593. * @memberOf _
  16594. * @since 4.0.0
  16595. * @category Math
  16596. * @param {Array} array The array to iterate over.
  16597. * @returns {number} Returns the mean.
  16598. * @example
  16599. *
  16600. * _.mean([4, 2, 8, 6]);
  16601. * // => 5
  16602. */
  16603. function mean(array) {
  16604. return baseMean(array, identity);
  16605. }
  16606. /**
  16607. * This method is like `_.mean` except that it accepts `iteratee` which is
  16608. * invoked for each element in `array` to generate the value to be averaged.
  16609. * The iteratee is invoked with one argument: (value).
  16610. *
  16611. * @static
  16612. * @memberOf _
  16613. * @since 4.7.0
  16614. * @category Math
  16615. * @param {Array} array The array to iterate over.
  16616. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16617. * @returns {number} Returns the mean.
  16618. * @example
  16619. *
  16620. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16621. *
  16622. * _.meanBy(objects, function(o) { return o.n; });
  16623. * // => 5
  16624. *
  16625. * // The `_.property` iteratee shorthand.
  16626. * _.meanBy(objects, 'n');
  16627. * // => 5
  16628. */
  16629. function meanBy(array, iteratee) {
  16630. return baseMean(array, getIteratee(iteratee, 2));
  16631. }
  16632. /**
  16633. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16634. * `undefined` is returned.
  16635. *
  16636. * @static
  16637. * @since 0.1.0
  16638. * @memberOf _
  16639. * @category Math
  16640. * @param {Array} array The array to iterate over.
  16641. * @returns {*} Returns the minimum value.
  16642. * @example
  16643. *
  16644. * _.min([4, 2, 8, 6]);
  16645. * // => 2
  16646. *
  16647. * _.min([]);
  16648. * // => undefined
  16649. */
  16650. function min(array) {
  16651. return (array && array.length)
  16652. ? baseExtremum(array, identity, baseLt)
  16653. : undefined;
  16654. }
  16655. /**
  16656. * This method is like `_.min` except that it accepts `iteratee` which is
  16657. * invoked for each element in `array` to generate the criterion by which
  16658. * the value is ranked. The iteratee is invoked with one argument: (value).
  16659. *
  16660. * @static
  16661. * @memberOf _
  16662. * @since 4.0.0
  16663. * @category Math
  16664. * @param {Array} array The array to iterate over.
  16665. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16666. * @returns {*} Returns the minimum value.
  16667. * @example
  16668. *
  16669. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16670. *
  16671. * _.minBy(objects, function(o) { return o.n; });
  16672. * // => { 'n': 1 }
  16673. *
  16674. * // The `_.property` iteratee shorthand.
  16675. * _.minBy(objects, 'n');
  16676. * // => { 'n': 1 }
  16677. */
  16678. function minBy(array, iteratee) {
  16679. return (array && array.length)
  16680. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16681. : undefined;
  16682. }
  16683. /**
  16684. * Multiply two numbers.
  16685. *
  16686. * @static
  16687. * @memberOf _
  16688. * @since 4.7.0
  16689. * @category Math
  16690. * @param {number} multiplier The first number in a multiplication.
  16691. * @param {number} multiplicand The second number in a multiplication.
  16692. * @returns {number} Returns the product.
  16693. * @example
  16694. *
  16695. * _.multiply(6, 4);
  16696. * // => 24
  16697. */
  16698. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16699. return multiplier * multiplicand;
  16700. }, 1);
  16701. /**
  16702. * Computes `number` rounded to `precision`.
  16703. *
  16704. * @static
  16705. * @memberOf _
  16706. * @since 3.10.0
  16707. * @category Math
  16708. * @param {number} number The number to round.
  16709. * @param {number} [precision=0] The precision to round to.
  16710. * @returns {number} Returns the rounded number.
  16711. * @example
  16712. *
  16713. * _.round(4.006);
  16714. * // => 4
  16715. *
  16716. * _.round(4.006, 2);
  16717. * // => 4.01
  16718. *
  16719. * _.round(4060, -2);
  16720. * // => 4100
  16721. */
  16722. var round = createRound('round');
  16723. /**
  16724. * Subtract two numbers.
  16725. *
  16726. * @static
  16727. * @memberOf _
  16728. * @since 4.0.0
  16729. * @category Math
  16730. * @param {number} minuend The first number in a subtraction.
  16731. * @param {number} subtrahend The second number in a subtraction.
  16732. * @returns {number} Returns the difference.
  16733. * @example
  16734. *
  16735. * _.subtract(6, 4);
  16736. * // => 2
  16737. */
  16738. var subtract = createMathOperation(function(minuend, subtrahend) {
  16739. return minuend - subtrahend;
  16740. }, 0);
  16741. /**
  16742. * Computes the sum of the values in `array`.
  16743. *
  16744. * @static
  16745. * @memberOf _
  16746. * @since 3.4.0
  16747. * @category Math
  16748. * @param {Array} array The array to iterate over.
  16749. * @returns {number} Returns the sum.
  16750. * @example
  16751. *
  16752. * _.sum([4, 2, 8, 6]);
  16753. * // => 20
  16754. */
  16755. function sum(array) {
  16756. return (array && array.length)
  16757. ? baseSum(array, identity)
  16758. : 0;
  16759. }
  16760. /**
  16761. * This method is like `_.sum` except that it accepts `iteratee` which is
  16762. * invoked for each element in `array` to generate the value to be summed.
  16763. * The iteratee is invoked with one argument: (value).
  16764. *
  16765. * @static
  16766. * @memberOf _
  16767. * @since 4.0.0
  16768. * @category Math
  16769. * @param {Array} array The array to iterate over.
  16770. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16771. * @returns {number} Returns the sum.
  16772. * @example
  16773. *
  16774. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16775. *
  16776. * _.sumBy(objects, function(o) { return o.n; });
  16777. * // => 20
  16778. *
  16779. * // The `_.property` iteratee shorthand.
  16780. * _.sumBy(objects, 'n');
  16781. * // => 20
  16782. */
  16783. function sumBy(array, iteratee) {
  16784. return (array && array.length)
  16785. ? baseSum(array, getIteratee(iteratee, 2))
  16786. : 0;
  16787. }
  16788. /*------------------------------------------------------------------------*/
  16789. // Add methods that return wrapped values in chain sequences.
  16790. lodash.after = after;
  16791. lodash.ary = ary;
  16792. lodash.assign = assign;
  16793. lodash.assignIn = assignIn;
  16794. lodash.assignInWith = assignInWith;
  16795. lodash.assignWith = assignWith;
  16796. lodash.at = at;
  16797. lodash.before = before;
  16798. lodash.bind = bind;
  16799. lodash.bindAll = bindAll;
  16800. lodash.bindKey = bindKey;
  16801. lodash.castArray = castArray;
  16802. lodash.chain = chain;
  16803. lodash.chunk = chunk;
  16804. lodash.compact = compact;
  16805. lodash.concat = concat;
  16806. lodash.cond = cond;
  16807. lodash.conforms = conforms;
  16808. lodash.constant = constant;
  16809. lodash.countBy = countBy;
  16810. lodash.create = create;
  16811. lodash.curry = curry;
  16812. lodash.curryRight = curryRight;
  16813. lodash.debounce = debounce;
  16814. lodash.defaults = defaults;
  16815. lodash.defaultsDeep = defaultsDeep;
  16816. lodash.defer = defer;
  16817. lodash.delay = delay;
  16818. lodash.difference = difference;
  16819. lodash.differenceBy = differenceBy;
  16820. lodash.differenceWith = differenceWith;
  16821. lodash.drop = drop;
  16822. lodash.dropRight = dropRight;
  16823. lodash.dropRightWhile = dropRightWhile;
  16824. lodash.dropWhile = dropWhile;
  16825. lodash.fill = fill;
  16826. lodash.filter = filter;
  16827. lodash.flatMap = flatMap;
  16828. lodash.flatMapDeep = flatMapDeep;
  16829. lodash.flatMapDepth = flatMapDepth;
  16830. lodash.flatten = flatten;
  16831. lodash.flattenDeep = flattenDeep;
  16832. lodash.flattenDepth = flattenDepth;
  16833. lodash.flip = flip;
  16834. lodash.flow = flow;
  16835. lodash.flowRight = flowRight;
  16836. lodash.fromPairs = fromPairs;
  16837. lodash.functions = functions;
  16838. lodash.functionsIn = functionsIn;
  16839. lodash.groupBy = groupBy;
  16840. lodash.initial = initial;
  16841. lodash.intersection = intersection;
  16842. lodash.intersectionBy = intersectionBy;
  16843. lodash.intersectionWith = intersectionWith;
  16844. lodash.invert = invert;
  16845. lodash.invertBy = invertBy;
  16846. lodash.invokeMap = invokeMap;
  16847. lodash.iteratee = iteratee;
  16848. lodash.keyBy = keyBy;
  16849. lodash.keys = keys;
  16850. lodash.keysIn = keysIn;
  16851. lodash.map = map;
  16852. lodash.mapKeys = mapKeys;
  16853. lodash.mapValues = mapValues;
  16854. lodash.matches = matches;
  16855. lodash.matchesProperty = matchesProperty;
  16856. lodash.memoize = memoize;
  16857. lodash.merge = merge;
  16858. lodash.mergeWith = mergeWith;
  16859. lodash.method = method;
  16860. lodash.methodOf = methodOf;
  16861. lodash.mixin = mixin;
  16862. lodash.negate = negate;
  16863. lodash.nthArg = nthArg;
  16864. lodash.omit = omit;
  16865. lodash.omitBy = omitBy;
  16866. lodash.once = once;
  16867. lodash.orderBy = orderBy;
  16868. lodash.over = over;
  16869. lodash.overArgs = overArgs;
  16870. lodash.overEvery = overEvery;
  16871. lodash.overSome = overSome;
  16872. lodash.partial = partial;
  16873. lodash.partialRight = partialRight;
  16874. lodash.partition = partition;
  16875. lodash.pick = pick;
  16876. lodash.pickBy = pickBy;
  16877. lodash.property = property;
  16878. lodash.propertyOf = propertyOf;
  16879. lodash.pull = pull;
  16880. lodash.pullAll = pullAll;
  16881. lodash.pullAllBy = pullAllBy;
  16882. lodash.pullAllWith = pullAllWith;
  16883. lodash.pullAt = pullAt;
  16884. lodash.range = range;
  16885. lodash.rangeRight = rangeRight;
  16886. lodash.rearg = rearg;
  16887. lodash.reject = reject;
  16888. lodash.remove = remove;
  16889. lodash.rest = rest;
  16890. lodash.reverse = reverse;
  16891. lodash.sampleSize = sampleSize;
  16892. lodash.set = set;
  16893. lodash.setWith = setWith;
  16894. lodash.shuffle = shuffle;
  16895. lodash.slice = slice;
  16896. lodash.sortBy = sortBy;
  16897. lodash.sortedUniq = sortedUniq;
  16898. lodash.sortedUniqBy = sortedUniqBy;
  16899. lodash.split = split;
  16900. lodash.spread = spread;
  16901. lodash.tail = tail;
  16902. lodash.take = take;
  16903. lodash.takeRight = takeRight;
  16904. lodash.takeRightWhile = takeRightWhile;
  16905. lodash.takeWhile = takeWhile;
  16906. lodash.tap = tap;
  16907. lodash.throttle = throttle;
  16908. lodash.thru = thru;
  16909. lodash.toArray = toArray;
  16910. lodash.toPairs = toPairs;
  16911. lodash.toPairsIn = toPairsIn;
  16912. lodash.toPath = toPath;
  16913. lodash.toPlainObject = toPlainObject;
  16914. lodash.transform = transform;
  16915. lodash.unary = unary;
  16916. lodash.union = union;
  16917. lodash.unionBy = unionBy;
  16918. lodash.unionWith = unionWith;
  16919. lodash.uniq = uniq;
  16920. lodash.uniqBy = uniqBy;
  16921. lodash.uniqWith = uniqWith;
  16922. lodash.unset = unset;
  16923. lodash.unzip = unzip;
  16924. lodash.unzipWith = unzipWith;
  16925. lodash.update = update;
  16926. lodash.updateWith = updateWith;
  16927. lodash.values = values;
  16928. lodash.valuesIn = valuesIn;
  16929. lodash.without = without;
  16930. lodash.words = words;
  16931. lodash.wrap = wrap;
  16932. lodash.xor = xor;
  16933. lodash.xorBy = xorBy;
  16934. lodash.xorWith = xorWith;
  16935. lodash.zip = zip;
  16936. lodash.zipObject = zipObject;
  16937. lodash.zipObjectDeep = zipObjectDeep;
  16938. lodash.zipWith = zipWith;
  16939. // Add aliases.
  16940. lodash.entries = toPairs;
  16941. lodash.entriesIn = toPairsIn;
  16942. lodash.extend = assignIn;
  16943. lodash.extendWith = assignInWith;
  16944. // Add methods to `lodash.prototype`.
  16945. mixin(lodash, lodash);
  16946. /*------------------------------------------------------------------------*/
  16947. // Add methods that return unwrapped values in chain sequences.
  16948. lodash.add = add;
  16949. lodash.attempt = attempt;
  16950. lodash.camelCase = camelCase;
  16951. lodash.capitalize = capitalize;
  16952. lodash.ceil = ceil;
  16953. lodash.clamp = clamp;
  16954. lodash.clone = clone;
  16955. lodash.cloneDeep = cloneDeep;
  16956. lodash.cloneDeepWith = cloneDeepWith;
  16957. lodash.cloneWith = cloneWith;
  16958. lodash.conformsTo = conformsTo;
  16959. lodash.deburr = deburr;
  16960. lodash.defaultTo = defaultTo;
  16961. lodash.divide = divide;
  16962. lodash.endsWith = endsWith;
  16963. lodash.eq = eq;
  16964. lodash.escape = escape;
  16965. lodash.escapeRegExp = escapeRegExp;
  16966. lodash.every = every;
  16967. lodash.find = find;
  16968. lodash.findIndex = findIndex;
  16969. lodash.findKey = findKey;
  16970. lodash.findLast = findLast;
  16971. lodash.findLastIndex = findLastIndex;
  16972. lodash.findLastKey = findLastKey;
  16973. lodash.floor = floor;
  16974. lodash.forEach = forEach;
  16975. lodash.forEachRight = forEachRight;
  16976. lodash.forIn = forIn;
  16977. lodash.forInRight = forInRight;
  16978. lodash.forOwn = forOwn;
  16979. lodash.forOwnRight = forOwnRight;
  16980. lodash.get = get;
  16981. lodash.gt = gt;
  16982. lodash.gte = gte;
  16983. lodash.has = has;
  16984. lodash.hasIn = hasIn;
  16985. lodash.head = head;
  16986. lodash.identity = identity;
  16987. lodash.includes = includes;
  16988. lodash.indexOf = indexOf;
  16989. lodash.inRange = inRange;
  16990. lodash.invoke = invoke;
  16991. lodash.isArguments = isArguments;
  16992. lodash.isArray = isArray;
  16993. lodash.isArrayBuffer = isArrayBuffer;
  16994. lodash.isArrayLike = isArrayLike;
  16995. lodash.isArrayLikeObject = isArrayLikeObject;
  16996. lodash.isBoolean = isBoolean;
  16997. lodash.isBuffer = isBuffer;
  16998. lodash.isDate = isDate;
  16999. lodash.isElement = isElement;
  17000. lodash.isEmpty = isEmpty;
  17001. lodash.isEqual = isEqual;
  17002. lodash.isEqualWith = isEqualWith;
  17003. lodash.isError = isError;
  17004. lodash.isFinite = isFinite;
  17005. lodash.isFunction = isFunction;
  17006. lodash.isInteger = isInteger;
  17007. lodash.isLength = isLength;
  17008. lodash.isMap = isMap;
  17009. lodash.isMatch = isMatch;
  17010. lodash.isMatchWith = isMatchWith;
  17011. lodash.isNaN = isNaN;
  17012. lodash.isNative = isNative;
  17013. lodash.isNil = isNil;
  17014. lodash.isNull = isNull;
  17015. lodash.isNumber = isNumber;
  17016. lodash.isObject = isObject;
  17017. lodash.isObjectLike = isObjectLike;
  17018. lodash.isPlainObject = isPlainObject;
  17019. lodash.isRegExp = isRegExp;
  17020. lodash.isSafeInteger = isSafeInteger;
  17021. lodash.isSet = isSet;
  17022. lodash.isString = isString;
  17023. lodash.isSymbol = isSymbol;
  17024. lodash.isTypedArray = isTypedArray;
  17025. lodash.isUndefined = isUndefined;
  17026. lodash.isWeakMap = isWeakMap;
  17027. lodash.isWeakSet = isWeakSet;
  17028. lodash.join = join;
  17029. lodash.kebabCase = kebabCase;
  17030. lodash.last = last;
  17031. lodash.lastIndexOf = lastIndexOf;
  17032. lodash.lowerCase = lowerCase;
  17033. lodash.lowerFirst = lowerFirst;
  17034. lodash.lt = lt;
  17035. lodash.lte = lte;
  17036. lodash.max = max;
  17037. lodash.maxBy = maxBy;
  17038. lodash.mean = mean;
  17039. lodash.meanBy = meanBy;
  17040. lodash.min = min;
  17041. lodash.minBy = minBy;
  17042. lodash.stubArray = stubArray;
  17043. lodash.stubFalse = stubFalse;
  17044. lodash.stubObject = stubObject;
  17045. lodash.stubString = stubString;
  17046. lodash.stubTrue = stubTrue;
  17047. lodash.multiply = multiply;
  17048. lodash.nth = nth;
  17049. lodash.noConflict = noConflict;
  17050. lodash.noop = noop;
  17051. lodash.now = now;
  17052. lodash.pad = pad;
  17053. lodash.padEnd = padEnd;
  17054. lodash.padStart = padStart;
  17055. lodash.parseInt = parseInt;
  17056. lodash.random = random;
  17057. lodash.reduce = reduce;
  17058. lodash.reduceRight = reduceRight;
  17059. lodash.repeat = repeat;
  17060. lodash.replace = replace;
  17061. lodash.result = result;
  17062. lodash.round = round;
  17063. lodash.runInContext = runInContext;
  17064. lodash.sample = sample;
  17065. lodash.size = size;
  17066. lodash.snakeCase = snakeCase;
  17067. lodash.some = some;
  17068. lodash.sortedIndex = sortedIndex;
  17069. lodash.sortedIndexBy = sortedIndexBy;
  17070. lodash.sortedIndexOf = sortedIndexOf;
  17071. lodash.sortedLastIndex = sortedLastIndex;
  17072. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17073. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17074. lodash.startCase = startCase;
  17075. lodash.startsWith = startsWith;
  17076. lodash.subtract = subtract;
  17077. lodash.sum = sum;
  17078. lodash.sumBy = sumBy;
  17079. lodash.template = template;
  17080. lodash.times = times;
  17081. lodash.toFinite = toFinite;
  17082. lodash.toInteger = toInteger;
  17083. lodash.toLength = toLength;
  17084. lodash.toLower = toLower;
  17085. lodash.toNumber = toNumber;
  17086. lodash.toSafeInteger = toSafeInteger;
  17087. lodash.toString = toString;
  17088. lodash.toUpper = toUpper;
  17089. lodash.trim = trim;
  17090. lodash.trimEnd = trimEnd;
  17091. lodash.trimStart = trimStart;
  17092. lodash.truncate = truncate;
  17093. lodash.unescape = unescape;
  17094. lodash.uniqueId = uniqueId;
  17095. lodash.upperCase = upperCase;
  17096. lodash.upperFirst = upperFirst;
  17097. // Add aliases.
  17098. lodash.each = forEach;
  17099. lodash.eachRight = forEachRight;
  17100. lodash.first = head;
  17101. mixin(lodash, (function() {
  17102. var source = {};
  17103. baseForOwn(lodash, function(func, methodName) {
  17104. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17105. source[methodName] = func;
  17106. }
  17107. });
  17108. return source;
  17109. }()), { 'chain': false });
  17110. /*------------------------------------------------------------------------*/
  17111. /**
  17112. * The semantic version number.
  17113. *
  17114. * @static
  17115. * @memberOf _
  17116. * @type {string}
  17117. */
  17118. lodash.VERSION = VERSION;
  17119. // Assign default placeholders.
  17120. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17121. lodash[methodName].placeholder = lodash;
  17122. });
  17123. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17124. arrayEach(['drop', 'take'], function(methodName, index) {
  17125. LazyWrapper.prototype[methodName] = function(n) {
  17126. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17127. var result = (this.__filtered__ && !index)
  17128. ? new LazyWrapper(this)
  17129. : this.clone();
  17130. if (result.__filtered__) {
  17131. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17132. } else {
  17133. result.__views__.push({
  17134. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17135. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17136. });
  17137. }
  17138. return result;
  17139. };
  17140. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17141. return this.reverse()[methodName](n).reverse();
  17142. };
  17143. });
  17144. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17145. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17146. var type = index + 1,
  17147. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17148. LazyWrapper.prototype[methodName] = function(iteratee) {
  17149. var result = this.clone();
  17150. result.__iteratees__.push({
  17151. 'iteratee': getIteratee(iteratee, 3),
  17152. 'type': type
  17153. });
  17154. result.__filtered__ = result.__filtered__ || isFilter;
  17155. return result;
  17156. };
  17157. });
  17158. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17159. arrayEach(['head', 'last'], function(methodName, index) {
  17160. var takeName = 'take' + (index ? 'Right' : '');
  17161. LazyWrapper.prototype[methodName] = function() {
  17162. return this[takeName](1).value()[0];
  17163. };
  17164. });
  17165. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17166. arrayEach(['initial', 'tail'], function(methodName, index) {
  17167. var dropName = 'drop' + (index ? '' : 'Right');
  17168. LazyWrapper.prototype[methodName] = function() {
  17169. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17170. };
  17171. });
  17172. LazyWrapper.prototype.compact = function() {
  17173. return this.filter(identity);
  17174. };
  17175. LazyWrapper.prototype.find = function(predicate) {
  17176. return this.filter(predicate).head();
  17177. };
  17178. LazyWrapper.prototype.findLast = function(predicate) {
  17179. return this.reverse().find(predicate);
  17180. };
  17181. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17182. if (typeof path == 'function') {
  17183. return new LazyWrapper(this);
  17184. }
  17185. return this.map(function(value) {
  17186. return baseInvoke(value, path, args);
  17187. });
  17188. });
  17189. LazyWrapper.prototype.reject = function(predicate) {
  17190. return this.filter(negate(getIteratee(predicate)));
  17191. };
  17192. LazyWrapper.prototype.slice = function(start, end) {
  17193. start = toInteger(start);
  17194. var result = this;
  17195. if (result.__filtered__ && (start > 0 || end < 0)) {
  17196. return new LazyWrapper(result);
  17197. }
  17198. if (start < 0) {
  17199. result = result.takeRight(-start);
  17200. } else if (start) {
  17201. result = result.drop(start);
  17202. }
  17203. if (end !== undefined) {
  17204. end = toInteger(end);
  17205. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17206. }
  17207. return result;
  17208. };
  17209. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17210. return this.reverse().takeWhile(predicate).reverse();
  17211. };
  17212. LazyWrapper.prototype.toArray = function() {
  17213. return this.take(MAX_ARRAY_LENGTH);
  17214. };
  17215. // Add `LazyWrapper` methods to `lodash.prototype`.
  17216. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17217. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17218. isTaker = /^(?:head|last)$/.test(methodName),
  17219. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17220. retUnwrapped = isTaker || /^find/.test(methodName);
  17221. if (!lodashFunc) {
  17222. return;
  17223. }
  17224. lodash.prototype[methodName] = function() {
  17225. var value = this.__wrapped__,
  17226. args = isTaker ? [1] : arguments,
  17227. isLazy = value instanceof LazyWrapper,
  17228. iteratee = args[0],
  17229. useLazy = isLazy || isArray(value);
  17230. var interceptor = function(value) {
  17231. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17232. return (isTaker && chainAll) ? result[0] : result;
  17233. };
  17234. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17235. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17236. isLazy = useLazy = false;
  17237. }
  17238. var chainAll = this.__chain__,
  17239. isHybrid = !!this.__actions__.length,
  17240. isUnwrapped = retUnwrapped && !chainAll,
  17241. onlyLazy = isLazy && !isHybrid;
  17242. if (!retUnwrapped && useLazy) {
  17243. value = onlyLazy ? value : new LazyWrapper(this);
  17244. var result = func.apply(value, args);
  17245. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17246. return new LodashWrapper(result, chainAll);
  17247. }
  17248. if (isUnwrapped && onlyLazy) {
  17249. return func.apply(this, args);
  17250. }
  17251. result = this.thru(interceptor);
  17252. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17253. };
  17254. });
  17255. // Add `Array` methods to `lodash.prototype`.
  17256. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17257. var func = arrayProto[methodName],
  17258. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17259. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17260. lodash.prototype[methodName] = function() {
  17261. var args = arguments;
  17262. if (retUnwrapped && !this.__chain__) {
  17263. var value = this.value();
  17264. return func.apply(isArray(value) ? value : [], args);
  17265. }
  17266. return this[chainName](function(value) {
  17267. return func.apply(isArray(value) ? value : [], args);
  17268. });
  17269. };
  17270. });
  17271. // Map minified method names to their real names.
  17272. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17273. var lodashFunc = lodash[methodName];
  17274. if (lodashFunc) {
  17275. var key = lodashFunc.name + '';
  17276. if (!hasOwnProperty.call(realNames, key)) {
  17277. realNames[key] = [];
  17278. }
  17279. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17280. }
  17281. });
  17282. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17283. 'name': 'wrapper',
  17284. 'func': undefined
  17285. }];
  17286. // Add methods to `LazyWrapper`.
  17287. LazyWrapper.prototype.clone = lazyClone;
  17288. LazyWrapper.prototype.reverse = lazyReverse;
  17289. LazyWrapper.prototype.value = lazyValue;
  17290. // Add chain sequence methods to the `lodash` wrapper.
  17291. lodash.prototype.at = wrapperAt;
  17292. lodash.prototype.chain = wrapperChain;
  17293. lodash.prototype.commit = wrapperCommit;
  17294. lodash.prototype.next = wrapperNext;
  17295. lodash.prototype.plant = wrapperPlant;
  17296. lodash.prototype.reverse = wrapperReverse;
  17297. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17298. // Add lazy aliases.
  17299. lodash.prototype.first = lodash.prototype.head;
  17300. if (symIterator) {
  17301. lodash.prototype[symIterator] = wrapperToIterator;
  17302. }
  17303. return lodash;
  17304. });
  17305. /*--------------------------------------------------------------------------*/
  17306. // Export lodash.
  17307. var _ = runInContext();
  17308. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17309. if (true) {
  17310. // Expose Lodash on the global object to prevent errors when Lodash is
  17311. // loaded by a script tag in the presence of an AMD loader.
  17312. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17313. // Use `_.noConflict` to remove Lodash from the global object.
  17314. root._ = _;
  17315. // Define as an anonymous module so, through path mapping, it can be
  17316. // referenced as the "underscore" module.
  17317. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17318. return _;
  17319. }).call(exports, __webpack_require__, exports, module),
  17320. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17321. }
  17322. // Check for `exports` after `define` in case a build optimizer adds it.
  17323. else {}
  17324. }.call(this));
  17325. /***/ }),
  17326. /***/ "./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":
  17327. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17328. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17329. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17330. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17331. "use strict";
  17332. __webpack_require__.r(__webpack_exports__);
  17333. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17334. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17335. /* harmony export */ });
  17336. /* 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");
  17337. /* 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__);
  17338. /* 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");
  17339. var options = {};
  17340. options.insert = "head";
  17341. options.singleton = false;
  17342. 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);
  17343. /* 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 || {});
  17344. /***/ }),
  17345. /***/ "./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":
  17346. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17347. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17348. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17349. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17350. "use strict";
  17351. __webpack_require__.r(__webpack_exports__);
  17352. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17353. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17354. /* harmony export */ });
  17355. /* 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");
  17356. /* 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__);
  17357. /* 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");
  17358. var options = {};
  17359. options.insert = "head";
  17360. options.singleton = false;
  17361. 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);
  17362. /* 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 || {});
  17363. /***/ }),
  17364. /***/ "./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":
  17365. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17366. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17367. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17368. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17369. "use strict";
  17370. __webpack_require__.r(__webpack_exports__);
  17371. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17372. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17373. /* harmony export */ });
  17374. /* 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");
  17375. /* 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__);
  17376. /* 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");
  17377. var options = {};
  17378. options.insert = "head";
  17379. options.singleton = false;
  17380. 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);
  17381. /* 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 || {});
  17382. /***/ }),
  17383. /***/ "./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":
  17384. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17385. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17386. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17387. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17388. "use strict";
  17389. __webpack_require__.r(__webpack_exports__);
  17390. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17391. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17392. /* harmony export */ });
  17393. /* 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");
  17394. /* 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__);
  17395. /* 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");
  17396. var options = {};
  17397. options.insert = "head";
  17398. options.singleton = false;
  17399. 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);
  17400. /* 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 || {});
  17401. /***/ }),
  17402. /***/ "./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":
  17403. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17404. !*** ./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 ***!
  17405. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17407. "use strict";
  17408. __webpack_require__.r(__webpack_exports__);
  17409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17410. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17411. /* harmony export */ });
  17412. /* 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");
  17413. /* 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__);
  17414. /* 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");
  17415. var options = {};
  17416. options.insert = "head";
  17417. options.singleton = false;
  17418. 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);
  17419. /* 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 || {});
  17420. /***/ }),
  17421. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17422. /*!******************************************************!*\
  17423. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17424. \******************************************************/
  17425. /***/ ((__unused_webpack_module, exports) => {
  17426. "use strict";
  17427. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17428. // runtime helper for setting properties on components
  17429. // in a tree-shakable way
  17430. exports["default"] = (sfc, props) => {
  17431. const target = sfc.__vccOpts || sfc;
  17432. for (const [key, val] of props) {
  17433. target[key] = val;
  17434. }
  17435. return target;
  17436. };
  17437. /***/ }),
  17438. /***/ "./resources/js/components/AppButtonLink.vue":
  17439. /*!***************************************************!*\
  17440. !*** ./resources/js/components/AppButtonLink.vue ***!
  17441. \***************************************************/
  17442. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17443. "use strict";
  17444. __webpack_require__.r(__webpack_exports__);
  17445. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17446. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17447. /* harmony export */ });
  17448. /* 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");
  17449. /* 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");
  17450. /* 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");
  17451. ;
  17452. 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"]])
  17453. /* hot reload */
  17454. if (false) {}
  17455. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17456. /***/ }),
  17457. /***/ "./resources/js/components/AppFooter.vue":
  17458. /*!***********************************************!*\
  17459. !*** ./resources/js/components/AppFooter.vue ***!
  17460. \***********************************************/
  17461. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17462. "use strict";
  17463. __webpack_require__.r(__webpack_exports__);
  17464. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17465. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17466. /* harmony export */ });
  17467. /* 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");
  17468. /* 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");
  17469. /* 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");
  17470. const script = {}
  17471. ;
  17472. 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"]])
  17473. /* hot reload */
  17474. if (false) {}
  17475. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17476. /***/ }),
  17477. /***/ "./resources/js/components/AppMessage.vue":
  17478. /*!************************************************!*\
  17479. !*** ./resources/js/components/AppMessage.vue ***!
  17480. \************************************************/
  17481. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17482. "use strict";
  17483. __webpack_require__.r(__webpack_exports__);
  17484. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17485. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17486. /* harmony export */ });
  17487. /* 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");
  17488. /* 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");
  17489. /* 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");
  17490. ;
  17491. 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"]])
  17492. /* hot reload */
  17493. if (false) {}
  17494. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17495. /***/ }),
  17496. /***/ "./resources/js/components/AppPagination.vue":
  17497. /*!***************************************************!*\
  17498. !*** ./resources/js/components/AppPagination.vue ***!
  17499. \***************************************************/
  17500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17501. "use strict";
  17502. __webpack_require__.r(__webpack_exports__);
  17503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17504. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17505. /* harmony export */ });
  17506. /* 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");
  17507. /* 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");
  17508. /* 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");
  17509. ;
  17510. 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"]])
  17511. /* hot reload */
  17512. if (false) {}
  17513. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17514. /***/ }),
  17515. /***/ "./resources/js/components/AppSidebar.vue":
  17516. /*!************************************************!*\
  17517. !*** ./resources/js/components/AppSidebar.vue ***!
  17518. \************************************************/
  17519. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17520. "use strict";
  17521. __webpack_require__.r(__webpack_exports__);
  17522. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17523. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17524. /* harmony export */ });
  17525. /* 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");
  17526. /* 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");
  17527. /* 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");
  17528. /* 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");
  17529. ;
  17530. 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"]])
  17531. /* hot reload */
  17532. if (false) {}
  17533. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17534. /***/ }),
  17535. /***/ "./resources/js/components/AppSubSidebar.vue":
  17536. /*!***************************************************!*\
  17537. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17538. \***************************************************/
  17539. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17540. "use strict";
  17541. __webpack_require__.r(__webpack_exports__);
  17542. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17543. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17544. /* harmony export */ });
  17545. /* 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");
  17546. /* 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");
  17547. /* 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");
  17548. /* 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");
  17549. ;
  17550. 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"]])
  17551. /* hot reload */
  17552. if (false) {}
  17553. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17554. /***/ }),
  17555. /***/ "./resources/js/components/AppTopBar.vue":
  17556. /*!***********************************************!*\
  17557. !*** ./resources/js/components/AppTopBar.vue ***!
  17558. \***********************************************/
  17559. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17560. "use strict";
  17561. __webpack_require__.r(__webpack_exports__);
  17562. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17563. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17564. /* harmony export */ });
  17565. /* 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");
  17566. /* 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");
  17567. /* 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");
  17568. /* 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");
  17569. ;
  17570. 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"]])
  17571. /* hot reload */
  17572. if (false) {}
  17573. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17574. /***/ }),
  17575. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17576. /*!**************************************************!*\
  17577. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17578. \**************************************************/
  17579. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17580. "use strict";
  17581. __webpack_require__.r(__webpack_exports__);
  17582. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17583. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17584. /* harmony export */ });
  17585. /* 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");
  17586. /* 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");
  17587. /* 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");
  17588. /* 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");
  17589. ;
  17590. 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"]])
  17591. /* hot reload */
  17592. if (false) {}
  17593. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17594. /***/ }),
  17595. /***/ "./resources/js/pages/member/Index.vue":
  17596. /*!*********************************************!*\
  17597. !*** ./resources/js/pages/member/Index.vue ***!
  17598. \*********************************************/
  17599. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17600. "use strict";
  17601. __webpack_require__.r(__webpack_exports__);
  17602. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17603. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17604. /* harmony export */ });
  17605. /* 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");
  17606. /* 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");
  17607. /* 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");
  17608. ;
  17609. 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"]])
  17610. /* hot reload */
  17611. if (false) {}
  17612. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17613. /***/ }),
  17614. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17615. /*!**************************************************************************************!*\
  17616. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17617. \**************************************************************************************/
  17618. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17619. "use strict";
  17620. __webpack_require__.r(__webpack_exports__);
  17621. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17622. /* 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"])
  17623. /* harmony export */ });
  17624. /* 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");
  17625. /***/ }),
  17626. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17627. /*!***********************************************************************************!*\
  17628. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17629. \***********************************************************************************/
  17630. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17631. "use strict";
  17632. __webpack_require__.r(__webpack_exports__);
  17633. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17634. /* 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"])
  17635. /* harmony export */ });
  17636. /* 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");
  17637. /***/ }),
  17638. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17639. /*!**************************************************************************************!*\
  17640. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17641. \**************************************************************************************/
  17642. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17643. "use strict";
  17644. __webpack_require__.r(__webpack_exports__);
  17645. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17646. /* 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"])
  17647. /* harmony export */ });
  17648. /* 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");
  17649. /***/ }),
  17650. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17651. /*!***********************************************************************************!*\
  17652. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17653. \***********************************************************************************/
  17654. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17655. "use strict";
  17656. __webpack_require__.r(__webpack_exports__);
  17657. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17658. /* 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"])
  17659. /* harmony export */ });
  17660. /* 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");
  17661. /***/ }),
  17662. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17663. /*!**************************************************************************************!*\
  17664. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17665. \**************************************************************************************/
  17666. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17667. "use strict";
  17668. __webpack_require__.r(__webpack_exports__);
  17669. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17670. /* 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"])
  17671. /* harmony export */ });
  17672. /* 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");
  17673. /***/ }),
  17674. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17675. /*!**********************************************************************************!*\
  17676. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17677. \**********************************************************************************/
  17678. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17679. "use strict";
  17680. __webpack_require__.r(__webpack_exports__);
  17681. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17682. /* 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"])
  17683. /* harmony export */ });
  17684. /* 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");
  17685. /***/ }),
  17686. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17687. /*!*************************************************************************************!*\
  17688. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17689. \*************************************************************************************/
  17690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17691. "use strict";
  17692. __webpack_require__.r(__webpack_exports__);
  17693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17694. /* 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"])
  17695. /* harmony export */ });
  17696. /* 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");
  17697. /***/ }),
  17698. /***/ "./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js":
  17699. /*!********************************************************************************!*\
  17700. !*** ./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js ***!
  17701. \********************************************************************************/
  17702. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17703. "use strict";
  17704. __webpack_require__.r(__webpack_exports__);
  17705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17706. /* 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"])
  17707. /* harmony export */ });
  17708. /* 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");
  17709. /***/ }),
  17710. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17711. /*!*********************************************************************************!*\
  17712. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17713. \*********************************************************************************/
  17714. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17715. "use strict";
  17716. __webpack_require__.r(__webpack_exports__);
  17717. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17718. /* 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)
  17719. /* harmony export */ });
  17720. /* 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");
  17721. /***/ }),
  17722. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17723. /*!*****************************************************************************************!*\
  17724. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17725. \*****************************************************************************************/
  17726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17727. "use strict";
  17728. __webpack_require__.r(__webpack_exports__);
  17729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17730. /* 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)
  17731. /* harmony export */ });
  17732. /* 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");
  17733. /***/ }),
  17734. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17735. /*!******************************************************************************!*\
  17736. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17737. \******************************************************************************/
  17738. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17739. "use strict";
  17740. __webpack_require__.r(__webpack_exports__);
  17741. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17742. /* 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)
  17743. /* harmony export */ });
  17744. /* 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");
  17745. /***/ }),
  17746. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17747. /*!*********************************************************************************!*\
  17748. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17749. \*********************************************************************************/
  17750. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17751. "use strict";
  17752. __webpack_require__.r(__webpack_exports__);
  17753. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17754. /* 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)
  17755. /* harmony export */ });
  17756. /* 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");
  17757. /***/ }),
  17758. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17759. /*!******************************************************************************************!*\
  17760. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17761. \******************************************************************************************/
  17762. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17763. "use strict";
  17764. __webpack_require__.r(__webpack_exports__);
  17765. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17766. /* 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)
  17767. /* harmony export */ });
  17768. /* 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");
  17769. /***/ }),
  17770. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17771. /*!*********************************************************************************************!*\
  17772. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17773. \*********************************************************************************************/
  17774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17775. "use strict";
  17776. __webpack_require__.r(__webpack_exports__);
  17777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17778. /* 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)
  17779. /* harmony export */ });
  17780. /* 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");
  17781. /***/ }),
  17782. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17783. /*!*****************************************************************************************!*\
  17784. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17785. \*****************************************************************************************/
  17786. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17787. "use strict";
  17788. __webpack_require__.r(__webpack_exports__);
  17789. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17790. /* 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)
  17791. /* harmony export */ });
  17792. /* 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");
  17793. /***/ }),
  17794. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17795. /*!********************************************************************************************!*\
  17796. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17797. \********************************************************************************************/
  17798. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17799. "use strict";
  17800. __webpack_require__.r(__webpack_exports__);
  17801. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17802. /* 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)
  17803. /* harmony export */ });
  17804. /* 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");
  17805. /***/ }),
  17806. /***/ "./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66":
  17807. /*!***************************************************************************!*\
  17808. !*** ./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66 ***!
  17809. \***************************************************************************/
  17810. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17811. "use strict";
  17812. __webpack_require__.r(__webpack_exports__);
  17813. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17814. /* 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)
  17815. /* harmony export */ });
  17816. /* 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");
  17817. /***/ }),
  17818. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17819. /*!********************************************************************************************************!*\
  17820. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17821. \********************************************************************************************************/
  17822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17823. "use strict";
  17824. __webpack_require__.r(__webpack_exports__);
  17825. /* 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");
  17826. /***/ }),
  17827. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17828. /*!*********************************************************************************************************!*\
  17829. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17830. \*********************************************************************************************************/
  17831. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17832. "use strict";
  17833. __webpack_require__.r(__webpack_exports__);
  17834. /* 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");
  17835. /***/ }),
  17836. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17837. /*!************************************************************************************************************!*\
  17838. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17839. \************************************************************************************************************/
  17840. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17841. "use strict";
  17842. __webpack_require__.r(__webpack_exports__);
  17843. /* 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");
  17844. /***/ }),
  17845. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17846. /*!********************************************************************************************************!*\
  17847. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17848. \********************************************************************************************************/
  17849. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17850. "use strict";
  17851. __webpack_require__.r(__webpack_exports__);
  17852. /* 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");
  17853. /***/ }),
  17854. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17855. /*!***********************************************************************************************************!*\
  17856. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17857. \***********************************************************************************************************/
  17858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17859. "use strict";
  17860. __webpack_require__.r(__webpack_exports__);
  17861. /* 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");
  17862. /***/ })
  17863. }]);