resources_js_pages_member_Index_vue.js 694KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_member_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js":
  259. /*!************************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js ***!
  261. \************************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  269. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/member/tableHeader.js");
  274. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  275. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  276. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  277. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. members: Object,
  281. initialSearch: String
  282. },
  283. setup: function setup(__props, _ref) {
  284. var expose = _ref.expose;
  285. expose();
  286. var props = __props;
  287. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  288. search = _useSearchText.search;
  289. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  290. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/members', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  291. search: search.value
  292. }), {
  293. preserveState: true
  294. });
  295. });
  296. var __returned__ = {
  297. props: props,
  298. search: search,
  299. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  300. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  301. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  302. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  303. indexTable: _tableHeader__WEBPACK_IMPORTED_MODULE_4__.indexTable,
  304. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  305. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  306. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  307. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  308. };
  309. Object.defineProperty(__returned__, '__isScriptSetup', {
  310. enumerable: false,
  311. value: true
  312. });
  313. return __returned__;
  314. }
  315. });
  316. /***/ }),
  317. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  318. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  319. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  320. \***********************************************************************************************************************************************************************************************************************************************************************************/
  321. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  322. "use strict";
  323. __webpack_require__.r(__webpack_exports__);
  324. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  325. /* harmony export */ "render": () => (/* binding */ render)
  326. /* harmony export */ });
  327. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  328. var _hoisted_1 = {
  329. key: 1,
  330. "class": "p-button-label"
  331. };
  332. var _hoisted_2 = {
  333. key: 1,
  334. "class": "p-button-label"
  335. };
  336. function render(_ctx, _cache, $props, $setup, $data, $options) {
  337. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  338. key: 0,
  339. "class": "p-button p-component",
  340. as: "button",
  341. type: "button"
  342. }, {
  343. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  344. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  345. key: 0,
  346. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  347. }, null, 2
  348. /* CLASS */
  349. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  350. /* TEXT */
  351. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  352. }),
  353. _: 1
  354. /* STABLE */
  355. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  356. key: 1,
  357. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  358. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  359. key: 0,
  360. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  361. }, null, 2
  362. /* CLASS */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  364. /* TEXT */
  365. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  366. /* CLASS */
  367. ));
  368. }
  369. /***/ }),
  370. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  371. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  372. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  373. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  374. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  375. "use strict";
  376. __webpack_require__.r(__webpack_exports__);
  377. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  378. /* harmony export */ "render": () => (/* binding */ render)
  379. /* harmony export */ });
  380. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  381. var _withScopeId = function _withScopeId(n) {
  382. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  383. };
  384. var _hoisted_1 = {
  385. "class": "layout-footer"
  386. };
  387. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  388. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  389. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  390. href: "https://dijitalcode.com",
  391. target: "_blank",
  392. "class": "font-medium ml-2"
  393. }, "DijitalCODE", -1
  394. /* HOISTED */
  395. );
  396. });
  397. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  398. function render(_ctx, _cache) {
  399. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  400. }
  401. /***/ }),
  402. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  403. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  404. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  405. \********************************************************************************************************************************************************************************************************************************************************************************/
  406. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  407. "use strict";
  408. __webpack_require__.r(__webpack_exports__);
  409. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  410. /* harmony export */ "render": () => (/* binding */ render)
  411. /* harmony export */ });
  412. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  413. var _hoisted_1 = {
  414. key: 0
  415. };
  416. var _hoisted_2 = {
  417. key: 1
  418. };
  419. function render(_ctx, _cache, $props, $setup, $data, $options) {
  420. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  421. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  422. key: 0,
  423. severity: "success",
  424. onClose: $setup.onClose
  425. }, {
  426. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  427. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  428. /* TEXT */
  429. )];
  430. }),
  431. _: 1
  432. /* STABLE */
  433. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  434. key: 1,
  435. severity: "error",
  436. onClose: $setup.onClose
  437. }, {
  438. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  439. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  440. /* TEXT */
  441. )];
  442. }),
  443. _: 1
  444. /* STABLE */
  445. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  446. key: 2,
  447. severity: "error",
  448. onClose: $setup.onClose
  449. }, {
  450. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  451. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  452. /* TEXT */
  453. ))];
  454. }),
  455. _: 1
  456. /* STABLE */
  457. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  458. /* STABLE_FRAGMENT */
  459. );
  460. }
  461. /***/ }),
  462. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  463. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  464. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  465. \***********************************************************************************************************************************************************************************************************************************************************************************/
  466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  467. "use strict";
  468. __webpack_require__.r(__webpack_exports__);
  469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  470. /* harmony export */ "render": () => (/* binding */ render)
  471. /* harmony export */ });
  472. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  473. var _hoisted_1 = {
  474. key: 0,
  475. "class": "p-paginator p-component flex justify-content-start"
  476. };
  477. var _hoisted_2 = {
  478. "class": "p-paginator-pages"
  479. };
  480. var _hoisted_3 = ["innerHTML"];
  481. function render(_ctx, _cache, $props, $setup, $data, $options) {
  482. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  483. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  484. key: "link-".concat(key),
  485. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  486. 'p-disabled': link
  487. }]),
  488. innerHTML: link.label
  489. }, null, 10
  490. /* CLASS, PROPS */
  491. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  492. key: "link-".concat(key),
  493. href: link.url,
  494. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  495. 'p-highlight': link.active
  496. }, "p-paginator-page p-paginator-element p-link"]),
  497. innerHTML: link.label
  498. }, null, 8
  499. /* PROPS */
  500. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  501. /* STABLE_FRAGMENT */
  502. );
  503. }), 256
  504. /* UNKEYED_FRAGMENT */
  505. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  506. }
  507. /***/ }),
  508. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  509. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  510. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  511. \********************************************************************************************************************************************************************************************************************************************************************************************/
  512. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  513. "use strict";
  514. __webpack_require__.r(__webpack_exports__);
  515. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  516. /* harmony export */ "render": () => (/* binding */ render)
  517. /* harmony export */ });
  518. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  519. function render(_ctx, _cache, $props, $setup, $data, $options) {
  520. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  521. "class": "layout-menu",
  522. items: $props.menu,
  523. root: true
  524. }, null, 8
  525. /* PROPS */
  526. , ["items"])]);
  527. }
  528. /***/ }),
  529. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  530. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  531. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  532. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  533. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  534. "use strict";
  535. __webpack_require__.r(__webpack_exports__);
  536. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  537. /* harmony export */ "render": () => (/* binding */ render)
  538. /* harmony export */ });
  539. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  540. var _withScopeId = function _withScopeId(n) {
  541. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  542. };
  543. var _hoisted_1 = {
  544. key: 0
  545. };
  546. var _hoisted_2 = ["aria-label"];
  547. var _hoisted_3 = ["aria-label"];
  548. function render(_ctx, _cache, $props, $setup, $data, $options) {
  549. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  550. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  551. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  552. key: i,
  553. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  554. 'layout-menuitem-category': $props.root
  555. }]),
  556. role: "none"
  557. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  558. key: 0
  559. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  560. "class": "layout-menuitem-root-text",
  561. "aria-label": item.label
  562. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  563. /* TEXT, PROPS */
  564. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  565. items: item.items
  566. }, null, 8
  567. /* PROPS */
  568. , ["items"])], 64
  569. /* STABLE_FRAGMENT */
  570. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  571. key: 1
  572. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  573. key: 0,
  574. role: "menuitem",
  575. href: item.to,
  576. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  577. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  578. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  579. }]),
  580. "aria-label": item.label
  581. }, {
  582. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  583. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  584. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  585. }, null, 2
  586. /* CLASS */
  587. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  588. /* TEXT */
  589. )];
  590. }),
  591. _: 2
  592. /* DYNAMIC */
  593. }, 1032
  594. /* PROPS, DYNAMIC_SLOTS */
  595. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  596. key: 1,
  597. href: "#",
  598. role: "menuitem",
  599. "aria-label": item.label
  600. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  601. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  602. }, null, 2
  603. /* CLASS */
  604. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  605. /* TEXT */
  606. )], 8
  607. /* PROPS */
  608. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  609. items: item.items
  610. }, null, 8
  611. /* PROPS */
  612. , ["items"])], 64
  613. /* STABLE_FRAGMENT */
  614. ))], 2
  615. /* CLASS */
  616. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  617. /* STABLE_FRAGMENT */
  618. );
  619. }), 256
  620. /* UNKEYED_FRAGMENT */
  621. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  622. }
  623. /***/ }),
  624. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  625. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  626. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  627. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  629. "use strict";
  630. __webpack_require__.r(__webpack_exports__);
  631. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  632. /* harmony export */ "render": () => (/* binding */ render)
  633. /* harmony export */ });
  634. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  635. var _withScopeId = function _withScopeId(n) {
  636. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  637. };
  638. var _hoisted_1 = {
  639. "class": "layout-topbar"
  640. };
  641. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  642. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  643. alt: "Logo",
  644. src: "/images/logo.svg",
  645. "class": "md:mr-3"
  646. }, null, -1
  647. /* HOISTED */
  648. );
  649. });
  650. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  651. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  652. /* HOISTED */
  653. );
  654. });
  655. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  656. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  657. "class": "pi pi-bars"
  658. }, null, -1
  659. /* HOISTED */
  660. );
  661. });
  662. var _hoisted_5 = [_hoisted_4];
  663. var _hoisted_6 = {
  664. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  665. };
  666. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  667. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": "pi pi-ellipsis-v"
  669. }, null, -1
  670. /* HOISTED */
  671. );
  672. });
  673. var _hoisted_8 = [_hoisted_7];
  674. var _hoisted_9 = {
  675. "class": "layout-topbar-menu hidden lg:flex origin-top"
  676. };
  677. var _hoisted_10 = {
  678. "class": "align-self-center"
  679. };
  680. var _hoisted_11 = {
  681. "class": "hidden lg:inline"
  682. };
  683. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  684. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": "pi pi-user"
  686. }, null, -1
  687. /* HOISTED */
  688. );
  689. });
  690. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  691. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  692. /* HOISTED */
  693. );
  694. });
  695. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  696. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  697. "class": "pi pi-sign-out"
  698. }, null, -1
  699. /* HOISTED */
  700. );
  701. });
  702. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  703. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  704. /* HOISTED */
  705. );
  706. });
  707. function render(_ctx, _cache, $props, $setup, $data, $options) {
  708. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  709. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  710. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  711. href: "/",
  712. "class": "layout-topbar-logo"
  713. }, {
  714. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  715. return [_hoisted_2, _hoisted_3];
  716. }),
  717. _: 1
  718. /* STABLE */
  719. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  720. "class": "p-link layout-menu-button layout-topbar-button",
  721. onClick: _cache[0] || (_cache[0] = function ($event) {
  722. return _ctx.$emit('menu-toggle', $event);
  723. })
  724. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  725. selector: '@next',
  726. enterClass: 'hidden',
  727. enterActiveClass: 'scalein',
  728. leaveToClass: 'hidden',
  729. leaveActiveClass: 'fadeout',
  730. hideOnOutsideClick: true
  731. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  732. /* TEXT */
  733. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  734. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  735. "class": "p-link layout-topbar-button"
  736. }, {
  737. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  738. return [_hoisted_12, _hoisted_13];
  739. }),
  740. _: 1
  741. /* STABLE */
  742. }, 8
  743. /* PROPS */
  744. , ["href"])), [[_directive_tooltip, {
  745. value: 'Ubah Profil',
  746. "class": 'layout-topbar-menu-tooltip'
  747. }, void 0, {
  748. bottom: true
  749. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  750. href: _ctx.route('logout'),
  751. as: "button",
  752. method: "post",
  753. "class": "p-link layout-topbar-button"
  754. }, {
  755. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  756. return [_hoisted_14, _hoisted_15];
  757. }),
  758. _: 1
  759. /* STABLE */
  760. }, 8
  761. /* PROPS */
  762. , ["href"])), [[_directive_tooltip, {
  763. value: 'Keluar',
  764. "class": 'layout-topbar-menu-tooltip'
  765. }, void 0, {
  766. bottom: true
  767. }]])])])]);
  768. }
  769. /***/ }),
  770. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  771. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  772. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  773. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  775. "use strict";
  776. __webpack_require__.r(__webpack_exports__);
  777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  778. /* harmony export */ "render": () => (/* binding */ render)
  779. /* harmony export */ });
  780. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  781. var _withScopeId = function _withScopeId(n) {
  782. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  783. };
  784. var _hoisted_1 = {
  785. "class": "layout-sidebar"
  786. };
  787. var _hoisted_2 = {
  788. "class": "layout-main-container"
  789. };
  790. var _hoisted_3 = {
  791. "class": "layout-main"
  792. };
  793. var _hoisted_4 = {
  794. key: 0,
  795. "class": "layout-mask p-component-overlay"
  796. };
  797. function render(_ctx, _cache, $props, $setup, $data, $options) {
  798. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  799. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  800. onClick: $setup.onWrapperClick
  801. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  802. onMenuToggle: $setup.onMenuToggle
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  804. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  805. }, null, 8
  806. /* PROPS */
  807. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  808. name: "layout-mask"
  809. }, {
  810. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  811. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  812. }),
  813. _: 1
  814. /* STABLE */
  815. })], 2
  816. /* CLASS */
  817. );
  818. }
  819. /***/ }),
  820. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66":
  821. /*!*****************************************************************************************************************************************************************************************************************************************************************************!*\
  822. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66 ***!
  823. \*****************************************************************************************************************************************************************************************************************************************************************************/
  824. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  825. "use strict";
  826. __webpack_require__.r(__webpack_exports__);
  827. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  828. /* harmony export */ "render": () => (/* binding */ render)
  829. /* harmony export */ });
  830. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  831. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Daftar Member", -1
  832. /* HOISTED */
  833. );
  834. var _hoisted_2 = {
  835. "class": "grid"
  836. };
  837. var _hoisted_3 = {
  838. "class": "col-12 md:col-8"
  839. };
  840. var _hoisted_4 = {
  841. "class": "flex align-items-center"
  842. };
  843. var _hoisted_5 = {
  844. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  845. };
  846. function render(_ctx, _cache, $props, $setup, $data, $options) {
  847. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  848. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  849. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  850. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  851. title: "Daftar Member"
  852. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  853. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  854. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  855. "responsive-layout": "scroll",
  856. "column-resize-mode": "expand",
  857. value: $props.members.data,
  858. "row-hover": true,
  859. "striped-rows": true
  860. }, {
  861. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  862. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  863. "class": "w-full md:w-27rem",
  864. placeholder: "cari, contoh: tina",
  865. modelValue: $setup.search,
  866. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  867. return $setup.search = $event;
  868. })
  869. }, null, 8
  870. /* PROPS */
  871. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  872. label: "Tambah Member",
  873. "class": "p-button-outlined",
  874. icon: "pi pi-pencil",
  875. href: _ctx.route('members.create')
  876. }, null, 8
  877. /* PROPS */
  878. , ["href"])])])];
  879. }),
  880. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  881. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  883. field: value.field,
  884. header: value.header,
  885. key: value.field
  886. }, null, 8
  887. /* PROPS */
  888. , ["field", "header"]);
  889. }), 128
  890. /* KEYED_FRAGMENT */
  891. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  892. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  893. var data = _ref.data;
  894. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  895. icon: "pi pi-pencil",
  896. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  897. href: _ctx.route('members.edit', data.id)
  898. }, null, 8
  899. /* PROPS */
  900. , ["href"])];
  901. }),
  902. _: 1
  903. /* STABLE */
  904. })];
  905. }),
  906. _: 1
  907. /* STABLE */
  908. }, 8
  909. /* PROPS */
  910. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  911. links: $props.members.links
  912. }, null, 8
  913. /* PROPS */
  914. , ["links"])];
  915. }),
  916. _: 1
  917. /* STABLE */
  918. })], 64
  919. /* STABLE_FRAGMENT */
  920. );
  921. }
  922. /***/ }),
  923. /***/ "./resources/js/components/useSearchText.js":
  924. /*!**************************************************!*\
  925. !*** ./resources/js/components/useSearchText.js ***!
  926. \**************************************************/
  927. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  928. "use strict";
  929. __webpack_require__.r(__webpack_exports__);
  930. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  931. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  932. /* harmony export */ });
  933. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  934. function useSearchText(props) {
  935. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  936. return {
  937. search: search
  938. };
  939. }
  940. /***/ }),
  941. /***/ "./resources/js/pages/member/tableHeader.js":
  942. /*!**************************************************!*\
  943. !*** ./resources/js/pages/member/tableHeader.js ***!
  944. \**************************************************/
  945. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  946. "use strict";
  947. __webpack_require__.r(__webpack_exports__);
  948. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  949. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  950. /* harmony export */ "platNumberTable": () => (/* binding */ platNumberTable)
  951. /* harmony export */ });
  952. var indexTable = [{
  953. field: 'updatedAt',
  954. header: 'Diperbaharui'
  955. }, {
  956. field: 'name',
  957. header: 'Nama'
  958. }, {
  959. field: 'platNumber',
  960. header: 'Plat Kendaraan'
  961. }, {
  962. field: 'type',
  963. header: 'Jenis Member'
  964. }, {
  965. field: 'price',
  966. header: 'Tarif Member'
  967. }, {
  968. field: 'expDate',
  969. header: 'Berakhir'
  970. }];
  971. var platNumberTable = [{
  972. field: 'platNumber',
  973. header: 'Plat Kendaraan'
  974. }, {
  975. field: 'typeVehicle',
  976. header: 'Jenis Kendaraan'
  977. }];
  978. /***/ }),
  979. /***/ "./resources/js/utils/menu.js":
  980. /*!************************************!*\
  981. !*** ./resources/js/utils/menu.js ***!
  982. \************************************/
  983. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  984. "use strict";
  985. __webpack_require__.r(__webpack_exports__);
  986. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  987. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  988. /* harmony export */ });
  989. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  990. // Admin
  991. 1: [{
  992. label: 'Home',
  993. items: [{
  994. label: 'Dashboard',
  995. icon: 'pi pi-home',
  996. to: '/dashboards',
  997. component: 'home/Index'
  998. }]
  999. }, {
  1000. label: 'Master',
  1001. items: [{
  1002. label: 'User',
  1003. icon: 'pi pi-user',
  1004. to: '/users',
  1005. component: 'user/Index'
  1006. }]
  1007. }],
  1008. // Supervisor
  1009. 2: [{
  1010. label: 'Home',
  1011. items: [{
  1012. label: 'Dashboard',
  1013. icon: 'pi pi-home',
  1014. to: '/dashboards',
  1015. component: 'home/Index'
  1016. }]
  1017. }, {
  1018. label: 'Menu',
  1019. items: [{
  1020. label: 'Pengeluaran',
  1021. icon: 'pi pi-wallet',
  1022. to: '/expenses',
  1023. component: 'expense/Index'
  1024. }, {
  1025. label: 'Laporan',
  1026. icon: 'pi pi-book',
  1027. items: [{
  1028. label: 'Mutasi',
  1029. icon: 'pi pi-circle',
  1030. to: '/reports/mutations',
  1031. component: 'mutation/Report'
  1032. }]
  1033. }]
  1034. }, {
  1035. label: 'Master',
  1036. items: [{
  1037. label: 'Jenis Kendaraan',
  1038. icon: 'pi pi-car',
  1039. to: '/type-vehicles',
  1040. component: 'typevehicle/Index'
  1041. }, {
  1042. label: 'Jenis Member',
  1043. icon: 'pi pi-id-card',
  1044. to: '/type-members',
  1045. component: 'typemember/Index'
  1046. }]
  1047. }, {
  1048. label: 'Pengaturan',
  1049. items: [{
  1050. label: 'Tarif Parkir',
  1051. icon: 'pi pi-car',
  1052. to: '/parking-fees/create',
  1053. component: 'parkingfee/Create'
  1054. }]
  1055. }],
  1056. // Operator
  1057. 3: [{
  1058. label: 'Home',
  1059. items: [{
  1060. label: 'Dashboard',
  1061. icon: 'pi pi-home',
  1062. to: '/dashboards',
  1063. component: 'home/Index'
  1064. }]
  1065. }, {
  1066. label: 'Transaksi',
  1067. items: [{
  1068. label: 'Transaksi masuk dan keluar',
  1069. icon: 'pi pi-car',
  1070. to: '/transactions/create',
  1071. component: 'transaction/Create'
  1072. }]
  1073. }, {
  1074. label: 'Menu',
  1075. items: [{
  1076. label: 'Pengeluaran',
  1077. icon: 'pi pi-wallet',
  1078. to: '/expenses',
  1079. component: 'expense/Index'
  1080. }, {
  1081. label: 'Member',
  1082. icon: 'pi pi-id-card',
  1083. to: '/members',
  1084. component: 'member/Index'
  1085. }, {
  1086. label: 'Top Up',
  1087. icon: 'pi pi-car',
  1088. to: '/top-ups',
  1089. component: 'topup/Index'
  1090. }]
  1091. }, {
  1092. label: 'Not Production',
  1093. items: [{
  1094. label: 'Test Transactions',
  1095. icon: 'pi pi-car',
  1096. to: '/test-transactions/create',
  1097. component: 'test-transaction/Create'
  1098. }]
  1099. }]
  1100. });
  1101. /***/ }),
  1102. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1103. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1104. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1105. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1106. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1107. "use strict";
  1108. __webpack_require__.r(__webpack_exports__);
  1109. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1110. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1111. /* harmony export */ });
  1112. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1113. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1114. // Imports
  1115. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1116. // Module
  1117. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-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}", ""]);
  1118. // Exports
  1119. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1120. /***/ }),
  1121. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1122. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1123. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1124. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1125. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1126. "use strict";
  1127. __webpack_require__.r(__webpack_exports__);
  1128. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1129. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1130. /* harmony export */ });
  1131. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1132. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1133. // Imports
  1134. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1135. // Module
  1136. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1137. // Exports
  1138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1139. /***/ }),
  1140. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1141. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1142. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1143. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1144. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1145. "use strict";
  1146. __webpack_require__.r(__webpack_exports__);
  1147. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1148. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1149. /* harmony export */ });
  1150. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1151. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1152. // Imports
  1153. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1154. // Module
  1155. ___CSS_LOADER_EXPORT___.push([module.id, "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}", ""]);
  1156. // Exports
  1157. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1158. /***/ }),
  1159. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1160. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1161. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1162. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1163. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1164. "use strict";
  1165. __webpack_require__.r(__webpack_exports__);
  1166. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1167. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1168. /* harmony export */ });
  1169. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1170. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1171. // Imports
  1172. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1173. // Module
  1174. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1175. // Exports
  1176. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1177. /***/ }),
  1178. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1179. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1180. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1181. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1182. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1183. "use strict";
  1184. __webpack_require__.r(__webpack_exports__);
  1185. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1186. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1187. /* harmony export */ });
  1188. /* 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");
  1189. /* 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__);
  1190. // Imports
  1191. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1192. // Module
  1193. ___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}", ""]);
  1194. // Exports
  1195. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1196. /***/ }),
  1197. /***/ "./node_modules/lodash/lodash.js":
  1198. /*!***************************************!*\
  1199. !*** ./node_modules/lodash/lodash.js ***!
  1200. \***************************************/
  1201. /***/ (function(module, exports, __webpack_require__) {
  1202. /* module decorator */ module = __webpack_require__.nmd(module);
  1203. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1204. * @license
  1205. * Lodash <https://lodash.com/>
  1206. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1207. * Released under MIT license <https://lodash.com/license>
  1208. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1209. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1210. */
  1211. ;(function() {
  1212. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1213. var undefined;
  1214. /** Used as the semantic version number. */
  1215. var VERSION = '4.17.21';
  1216. /** Used as the size to enable large array optimizations. */
  1217. var LARGE_ARRAY_SIZE = 200;
  1218. /** Error message constants. */
  1219. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1220. FUNC_ERROR_TEXT = 'Expected a function',
  1221. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1222. /** Used to stand-in for `undefined` hash values. */
  1223. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1224. /** Used as the maximum memoize cache size. */
  1225. var MAX_MEMOIZE_SIZE = 500;
  1226. /** Used as the internal argument placeholder. */
  1227. var PLACEHOLDER = '__lodash_placeholder__';
  1228. /** Used to compose bitmasks for cloning. */
  1229. var CLONE_DEEP_FLAG = 1,
  1230. CLONE_FLAT_FLAG = 2,
  1231. CLONE_SYMBOLS_FLAG = 4;
  1232. /** Used to compose bitmasks for value comparisons. */
  1233. var COMPARE_PARTIAL_FLAG = 1,
  1234. COMPARE_UNORDERED_FLAG = 2;
  1235. /** Used to compose bitmasks for function metadata. */
  1236. var WRAP_BIND_FLAG = 1,
  1237. WRAP_BIND_KEY_FLAG = 2,
  1238. WRAP_CURRY_BOUND_FLAG = 4,
  1239. WRAP_CURRY_FLAG = 8,
  1240. WRAP_CURRY_RIGHT_FLAG = 16,
  1241. WRAP_PARTIAL_FLAG = 32,
  1242. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1243. WRAP_ARY_FLAG = 128,
  1244. WRAP_REARG_FLAG = 256,
  1245. WRAP_FLIP_FLAG = 512;
  1246. /** Used as default options for `_.truncate`. */
  1247. var DEFAULT_TRUNC_LENGTH = 30,
  1248. DEFAULT_TRUNC_OMISSION = '...';
  1249. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1250. var HOT_COUNT = 800,
  1251. HOT_SPAN = 16;
  1252. /** Used to indicate the type of lazy iteratees. */
  1253. var LAZY_FILTER_FLAG = 1,
  1254. LAZY_MAP_FLAG = 2,
  1255. LAZY_WHILE_FLAG = 3;
  1256. /** Used as references for various `Number` constants. */
  1257. var INFINITY = 1 / 0,
  1258. MAX_SAFE_INTEGER = 9007199254740991,
  1259. MAX_INTEGER = 1.7976931348623157e+308,
  1260. NAN = 0 / 0;
  1261. /** Used as references for the maximum length and index of an array. */
  1262. var MAX_ARRAY_LENGTH = 4294967295,
  1263. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1264. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1265. /** Used to associate wrap methods with their bit flags. */
  1266. var wrapFlags = [
  1267. ['ary', WRAP_ARY_FLAG],
  1268. ['bind', WRAP_BIND_FLAG],
  1269. ['bindKey', WRAP_BIND_KEY_FLAG],
  1270. ['curry', WRAP_CURRY_FLAG],
  1271. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1272. ['flip', WRAP_FLIP_FLAG],
  1273. ['partial', WRAP_PARTIAL_FLAG],
  1274. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1275. ['rearg', WRAP_REARG_FLAG]
  1276. ];
  1277. /** `Object#toString` result references. */
  1278. var argsTag = '[object Arguments]',
  1279. arrayTag = '[object Array]',
  1280. asyncTag = '[object AsyncFunction]',
  1281. boolTag = '[object Boolean]',
  1282. dateTag = '[object Date]',
  1283. domExcTag = '[object DOMException]',
  1284. errorTag = '[object Error]',
  1285. funcTag = '[object Function]',
  1286. genTag = '[object GeneratorFunction]',
  1287. mapTag = '[object Map]',
  1288. numberTag = '[object Number]',
  1289. nullTag = '[object Null]',
  1290. objectTag = '[object Object]',
  1291. promiseTag = '[object Promise]',
  1292. proxyTag = '[object Proxy]',
  1293. regexpTag = '[object RegExp]',
  1294. setTag = '[object Set]',
  1295. stringTag = '[object String]',
  1296. symbolTag = '[object Symbol]',
  1297. undefinedTag = '[object Undefined]',
  1298. weakMapTag = '[object WeakMap]',
  1299. weakSetTag = '[object WeakSet]';
  1300. var arrayBufferTag = '[object ArrayBuffer]',
  1301. dataViewTag = '[object DataView]',
  1302. float32Tag = '[object Float32Array]',
  1303. float64Tag = '[object Float64Array]',
  1304. int8Tag = '[object Int8Array]',
  1305. int16Tag = '[object Int16Array]',
  1306. int32Tag = '[object Int32Array]',
  1307. uint8Tag = '[object Uint8Array]',
  1308. uint8ClampedTag = '[object Uint8ClampedArray]',
  1309. uint16Tag = '[object Uint16Array]',
  1310. uint32Tag = '[object Uint32Array]';
  1311. /** Used to match empty string literals in compiled template source. */
  1312. var reEmptyStringLeading = /\b__p \+= '';/g,
  1313. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1314. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1315. /** Used to match HTML entities and HTML characters. */
  1316. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1317. reUnescapedHtml = /[&<>"']/g,
  1318. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1319. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1320. /** Used to match template delimiters. */
  1321. var reEscape = /<%-([\s\S]+?)%>/g,
  1322. reEvaluate = /<%([\s\S]+?)%>/g,
  1323. reInterpolate = /<%=([\s\S]+?)%>/g;
  1324. /** Used to match property names within property paths. */
  1325. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1326. reIsPlainProp = /^\w*$/,
  1327. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1328. /**
  1329. * Used to match `RegExp`
  1330. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1331. */
  1332. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1333. reHasRegExpChar = RegExp(reRegExpChar.source);
  1334. /** Used to match leading whitespace. */
  1335. var reTrimStart = /^\s+/;
  1336. /** Used to match a single whitespace character. */
  1337. var reWhitespace = /\s/;
  1338. /** Used to match wrap detail comments. */
  1339. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1340. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1341. reSplitDetails = /,? & /;
  1342. /** Used to match words composed of alphanumeric characters. */
  1343. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1344. /**
  1345. * Used to validate the `validate` option in `_.template` variable.
  1346. *
  1347. * Forbids characters which could potentially change the meaning of the function argument definition:
  1348. * - "()," (modification of function parameters)
  1349. * - "=" (default value)
  1350. * - "[]{}" (destructuring of function parameters)
  1351. * - "/" (beginning of a comment)
  1352. * - whitespace
  1353. */
  1354. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1355. /** Used to match backslashes in property paths. */
  1356. var reEscapeChar = /\\(\\)?/g;
  1357. /**
  1358. * Used to match
  1359. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1360. */
  1361. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1362. /** Used to match `RegExp` flags from their coerced string values. */
  1363. var reFlags = /\w*$/;
  1364. /** Used to detect bad signed hexadecimal string values. */
  1365. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1366. /** Used to detect binary string values. */
  1367. var reIsBinary = /^0b[01]+$/i;
  1368. /** Used to detect host constructors (Safari). */
  1369. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1370. /** Used to detect octal string values. */
  1371. var reIsOctal = /^0o[0-7]+$/i;
  1372. /** Used to detect unsigned integer values. */
  1373. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1374. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1375. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1376. /** Used to ensure capturing order of template delimiters. */
  1377. var reNoMatch = /($^)/;
  1378. /** Used to match unescaped characters in compiled string literals. */
  1379. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1380. /** Used to compose unicode character classes. */
  1381. var rsAstralRange = '\\ud800-\\udfff',
  1382. rsComboMarksRange = '\\u0300-\\u036f',
  1383. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1384. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1385. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1386. rsDingbatRange = '\\u2700-\\u27bf',
  1387. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1388. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1389. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1390. rsPunctuationRange = '\\u2000-\\u206f',
  1391. 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',
  1392. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1393. rsVarRange = '\\ufe0e\\ufe0f',
  1394. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1395. /** Used to compose unicode capture groups. */
  1396. var rsApos = "['\u2019]",
  1397. rsAstral = '[' + rsAstralRange + ']',
  1398. rsBreak = '[' + rsBreakRange + ']',
  1399. rsCombo = '[' + rsComboRange + ']',
  1400. rsDigits = '\\d+',
  1401. rsDingbat = '[' + rsDingbatRange + ']',
  1402. rsLower = '[' + rsLowerRange + ']',
  1403. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1404. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1405. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1406. rsNonAstral = '[^' + rsAstralRange + ']',
  1407. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1408. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1409. rsUpper = '[' + rsUpperRange + ']',
  1410. rsZWJ = '\\u200d';
  1411. /** Used to compose unicode regexes. */
  1412. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1413. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1414. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1415. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1416. reOptMod = rsModifier + '?',
  1417. rsOptVar = '[' + rsVarRange + ']?',
  1418. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1419. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1420. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1421. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1422. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1423. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1424. /** Used to match apostrophes. */
  1425. var reApos = RegExp(rsApos, 'g');
  1426. /**
  1427. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1428. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1429. */
  1430. var reComboMark = RegExp(rsCombo, 'g');
  1431. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1432. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1433. /** Used to match complex or compound words. */
  1434. var reUnicodeWord = RegExp([
  1435. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1436. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1437. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1438. rsUpper + '+' + rsOptContrUpper,
  1439. rsOrdUpper,
  1440. rsOrdLower,
  1441. rsDigits,
  1442. rsEmoji
  1443. ].join('|'), 'g');
  1444. /** 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/). */
  1445. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1446. /** Used to detect strings that need a more robust regexp to match words. */
  1447. 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 ]/;
  1448. /** Used to assign default `context` object properties. */
  1449. var contextProps = [
  1450. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1451. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1452. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1453. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1454. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1455. ];
  1456. /** Used to make template sourceURLs easier to identify. */
  1457. var templateCounter = -1;
  1458. /** Used to identify `toStringTag` values of typed arrays. */
  1459. var typedArrayTags = {};
  1460. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1461. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1462. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1463. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1464. typedArrayTags[uint32Tag] = true;
  1465. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1466. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1467. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1468. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1469. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1470. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1471. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1472. typedArrayTags[weakMapTag] = false;
  1473. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1474. var cloneableTags = {};
  1475. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1476. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1477. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1478. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1479. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1480. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1481. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1482. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1483. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1484. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1485. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1486. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1487. cloneableTags[weakMapTag] = false;
  1488. /** Used to map Latin Unicode letters to basic Latin letters. */
  1489. var deburredLetters = {
  1490. // Latin-1 Supplement block.
  1491. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1492. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1493. '\xc7': 'C', '\xe7': 'c',
  1494. '\xd0': 'D', '\xf0': 'd',
  1495. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1496. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1497. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1498. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1499. '\xd1': 'N', '\xf1': 'n',
  1500. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1501. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1502. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1503. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1504. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1505. '\xc6': 'Ae', '\xe6': 'ae',
  1506. '\xde': 'Th', '\xfe': 'th',
  1507. '\xdf': 'ss',
  1508. // Latin Extended-A block.
  1509. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1510. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1511. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1512. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1513. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1514. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1515. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1516. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1517. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1518. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1519. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1520. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1521. '\u0134': 'J', '\u0135': 'j',
  1522. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1523. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1524. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1525. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1526. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1527. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1528. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1529. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1530. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1531. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1532. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1533. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1534. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1535. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1536. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1537. '\u0174': 'W', '\u0175': 'w',
  1538. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1539. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1540. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1541. '\u0132': 'IJ', '\u0133': 'ij',
  1542. '\u0152': 'Oe', '\u0153': 'oe',
  1543. '\u0149': "'n", '\u017f': 's'
  1544. };
  1545. /** Used to map characters to HTML entities. */
  1546. var htmlEscapes = {
  1547. '&': '&amp;',
  1548. '<': '&lt;',
  1549. '>': '&gt;',
  1550. '"': '&quot;',
  1551. "'": '&#39;'
  1552. };
  1553. /** Used to map HTML entities to characters. */
  1554. var htmlUnescapes = {
  1555. '&amp;': '&',
  1556. '&lt;': '<',
  1557. '&gt;': '>',
  1558. '&quot;': '"',
  1559. '&#39;': "'"
  1560. };
  1561. /** Used to escape characters for inclusion in compiled string literals. */
  1562. var stringEscapes = {
  1563. '\\': '\\',
  1564. "'": "'",
  1565. '\n': 'n',
  1566. '\r': 'r',
  1567. '\u2028': 'u2028',
  1568. '\u2029': 'u2029'
  1569. };
  1570. /** Built-in method references without a dependency on `root`. */
  1571. var freeParseFloat = parseFloat,
  1572. freeParseInt = parseInt;
  1573. /** Detect free variable `global` from Node.js. */
  1574. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1575. /** Detect free variable `self`. */
  1576. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1577. /** Used as a reference to the global object. */
  1578. var root = freeGlobal || freeSelf || Function('return this')();
  1579. /** Detect free variable `exports`. */
  1580. var freeExports = true && exports && !exports.nodeType && exports;
  1581. /** Detect free variable `module`. */
  1582. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1583. /** Detect the popular CommonJS extension `module.exports`. */
  1584. var moduleExports = freeModule && freeModule.exports === freeExports;
  1585. /** Detect free variable `process` from Node.js. */
  1586. var freeProcess = moduleExports && freeGlobal.process;
  1587. /** Used to access faster Node.js helpers. */
  1588. var nodeUtil = (function() {
  1589. try {
  1590. // Use `util.types` for Node.js 10+.
  1591. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1592. if (types) {
  1593. return types;
  1594. }
  1595. // Legacy `process.binding('util')` for Node.js < 10.
  1596. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1597. } catch (e) {}
  1598. }());
  1599. /* Node.js helper references. */
  1600. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1601. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1602. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1603. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1604. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1605. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1606. /*--------------------------------------------------------------------------*/
  1607. /**
  1608. * A faster alternative to `Function#apply`, this function invokes `func`
  1609. * with the `this` binding of `thisArg` and the arguments of `args`.
  1610. *
  1611. * @private
  1612. * @param {Function} func The function to invoke.
  1613. * @param {*} thisArg The `this` binding of `func`.
  1614. * @param {Array} args The arguments to invoke `func` with.
  1615. * @returns {*} Returns the result of `func`.
  1616. */
  1617. function apply(func, thisArg, args) {
  1618. switch (args.length) {
  1619. case 0: return func.call(thisArg);
  1620. case 1: return func.call(thisArg, args[0]);
  1621. case 2: return func.call(thisArg, args[0], args[1]);
  1622. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1623. }
  1624. return func.apply(thisArg, args);
  1625. }
  1626. /**
  1627. * A specialized version of `baseAggregator` for arrays.
  1628. *
  1629. * @private
  1630. * @param {Array} [array] The array to iterate over.
  1631. * @param {Function} setter The function to set `accumulator` values.
  1632. * @param {Function} iteratee The iteratee to transform keys.
  1633. * @param {Object} accumulator The initial aggregated object.
  1634. * @returns {Function} Returns `accumulator`.
  1635. */
  1636. function arrayAggregator(array, setter, iteratee, accumulator) {
  1637. var index = -1,
  1638. length = array == null ? 0 : array.length;
  1639. while (++index < length) {
  1640. var value = array[index];
  1641. setter(accumulator, value, iteratee(value), array);
  1642. }
  1643. return accumulator;
  1644. }
  1645. /**
  1646. * A specialized version of `_.forEach` for arrays without support for
  1647. * iteratee shorthands.
  1648. *
  1649. * @private
  1650. * @param {Array} [array] The array to iterate over.
  1651. * @param {Function} iteratee The function invoked per iteration.
  1652. * @returns {Array} Returns `array`.
  1653. */
  1654. function arrayEach(array, iteratee) {
  1655. var index = -1,
  1656. length = array == null ? 0 : array.length;
  1657. while (++index < length) {
  1658. if (iteratee(array[index], index, array) === false) {
  1659. break;
  1660. }
  1661. }
  1662. return array;
  1663. }
  1664. /**
  1665. * A specialized version of `_.forEachRight` for arrays without support for
  1666. * iteratee shorthands.
  1667. *
  1668. * @private
  1669. * @param {Array} [array] The array to iterate over.
  1670. * @param {Function} iteratee The function invoked per iteration.
  1671. * @returns {Array} Returns `array`.
  1672. */
  1673. function arrayEachRight(array, iteratee) {
  1674. var length = array == null ? 0 : array.length;
  1675. while (length--) {
  1676. if (iteratee(array[length], length, array) === false) {
  1677. break;
  1678. }
  1679. }
  1680. return array;
  1681. }
  1682. /**
  1683. * A specialized version of `_.every` for arrays without support for
  1684. * iteratee shorthands.
  1685. *
  1686. * @private
  1687. * @param {Array} [array] The array to iterate over.
  1688. * @param {Function} predicate The function invoked per iteration.
  1689. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1690. * else `false`.
  1691. */
  1692. function arrayEvery(array, predicate) {
  1693. var index = -1,
  1694. length = array == null ? 0 : array.length;
  1695. while (++index < length) {
  1696. if (!predicate(array[index], index, array)) {
  1697. return false;
  1698. }
  1699. }
  1700. return true;
  1701. }
  1702. /**
  1703. * A specialized version of `_.filter` for arrays without support for
  1704. * iteratee shorthands.
  1705. *
  1706. * @private
  1707. * @param {Array} [array] The array to iterate over.
  1708. * @param {Function} predicate The function invoked per iteration.
  1709. * @returns {Array} Returns the new filtered array.
  1710. */
  1711. function arrayFilter(array, predicate) {
  1712. var index = -1,
  1713. length = array == null ? 0 : array.length,
  1714. resIndex = 0,
  1715. result = [];
  1716. while (++index < length) {
  1717. var value = array[index];
  1718. if (predicate(value, index, array)) {
  1719. result[resIndex++] = value;
  1720. }
  1721. }
  1722. return result;
  1723. }
  1724. /**
  1725. * A specialized version of `_.includes` for arrays without support for
  1726. * specifying an index to search from.
  1727. *
  1728. * @private
  1729. * @param {Array} [array] The array to inspect.
  1730. * @param {*} target The value to search for.
  1731. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1732. */
  1733. function arrayIncludes(array, value) {
  1734. var length = array == null ? 0 : array.length;
  1735. return !!length && baseIndexOf(array, value, 0) > -1;
  1736. }
  1737. /**
  1738. * This function is like `arrayIncludes` except that it accepts a comparator.
  1739. *
  1740. * @private
  1741. * @param {Array} [array] The array to inspect.
  1742. * @param {*} target The value to search for.
  1743. * @param {Function} comparator The comparator invoked per element.
  1744. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1745. */
  1746. function arrayIncludesWith(array, value, comparator) {
  1747. var index = -1,
  1748. length = array == null ? 0 : array.length;
  1749. while (++index < length) {
  1750. if (comparator(value, array[index])) {
  1751. return true;
  1752. }
  1753. }
  1754. return false;
  1755. }
  1756. /**
  1757. * A specialized version of `_.map` for arrays without support for iteratee
  1758. * shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} [array] The array to iterate over.
  1762. * @param {Function} iteratee The function invoked per iteration.
  1763. * @returns {Array} Returns the new mapped array.
  1764. */
  1765. function arrayMap(array, iteratee) {
  1766. var index = -1,
  1767. length = array == null ? 0 : array.length,
  1768. result = Array(length);
  1769. while (++index < length) {
  1770. result[index] = iteratee(array[index], index, array);
  1771. }
  1772. return result;
  1773. }
  1774. /**
  1775. * Appends the elements of `values` to `array`.
  1776. *
  1777. * @private
  1778. * @param {Array} array The array to modify.
  1779. * @param {Array} values The values to append.
  1780. * @returns {Array} Returns `array`.
  1781. */
  1782. function arrayPush(array, values) {
  1783. var index = -1,
  1784. length = values.length,
  1785. offset = array.length;
  1786. while (++index < length) {
  1787. array[offset + index] = values[index];
  1788. }
  1789. return array;
  1790. }
  1791. /**
  1792. * A specialized version of `_.reduce` for arrays without support for
  1793. * iteratee shorthands.
  1794. *
  1795. * @private
  1796. * @param {Array} [array] The array to iterate over.
  1797. * @param {Function} iteratee The function invoked per iteration.
  1798. * @param {*} [accumulator] The initial value.
  1799. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1800. * the initial value.
  1801. * @returns {*} Returns the accumulated value.
  1802. */
  1803. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1804. var index = -1,
  1805. length = array == null ? 0 : array.length;
  1806. if (initAccum && length) {
  1807. accumulator = array[++index];
  1808. }
  1809. while (++index < length) {
  1810. accumulator = iteratee(accumulator, array[index], index, array);
  1811. }
  1812. return accumulator;
  1813. }
  1814. /**
  1815. * A specialized version of `_.reduceRight` for arrays without support for
  1816. * iteratee shorthands.
  1817. *
  1818. * @private
  1819. * @param {Array} [array] The array to iterate over.
  1820. * @param {Function} iteratee The function invoked per iteration.
  1821. * @param {*} [accumulator] The initial value.
  1822. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1823. * the initial value.
  1824. * @returns {*} Returns the accumulated value.
  1825. */
  1826. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1827. var length = array == null ? 0 : array.length;
  1828. if (initAccum && length) {
  1829. accumulator = array[--length];
  1830. }
  1831. while (length--) {
  1832. accumulator = iteratee(accumulator, array[length], length, array);
  1833. }
  1834. return accumulator;
  1835. }
  1836. /**
  1837. * A specialized version of `_.some` for arrays without support for iteratee
  1838. * shorthands.
  1839. *
  1840. * @private
  1841. * @param {Array} [array] The array to iterate over.
  1842. * @param {Function} predicate The function invoked per iteration.
  1843. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1844. * else `false`.
  1845. */
  1846. function arraySome(array, predicate) {
  1847. var index = -1,
  1848. length = array == null ? 0 : array.length;
  1849. while (++index < length) {
  1850. if (predicate(array[index], index, array)) {
  1851. return true;
  1852. }
  1853. }
  1854. return false;
  1855. }
  1856. /**
  1857. * Gets the size of an ASCII `string`.
  1858. *
  1859. * @private
  1860. * @param {string} string The string inspect.
  1861. * @returns {number} Returns the string size.
  1862. */
  1863. var asciiSize = baseProperty('length');
  1864. /**
  1865. * Converts an ASCII `string` to an array.
  1866. *
  1867. * @private
  1868. * @param {string} string The string to convert.
  1869. * @returns {Array} Returns the converted array.
  1870. */
  1871. function asciiToArray(string) {
  1872. return string.split('');
  1873. }
  1874. /**
  1875. * Splits an ASCII `string` into an array of its words.
  1876. *
  1877. * @private
  1878. * @param {string} The string to inspect.
  1879. * @returns {Array} Returns the words of `string`.
  1880. */
  1881. function asciiWords(string) {
  1882. return string.match(reAsciiWord) || [];
  1883. }
  1884. /**
  1885. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1886. * without support for iteratee shorthands, which iterates over `collection`
  1887. * using `eachFunc`.
  1888. *
  1889. * @private
  1890. * @param {Array|Object} collection The collection to inspect.
  1891. * @param {Function} predicate The function invoked per iteration.
  1892. * @param {Function} eachFunc The function to iterate over `collection`.
  1893. * @returns {*} Returns the found element or its key, else `undefined`.
  1894. */
  1895. function baseFindKey(collection, predicate, eachFunc) {
  1896. var result;
  1897. eachFunc(collection, function(value, key, collection) {
  1898. if (predicate(value, key, collection)) {
  1899. result = key;
  1900. return false;
  1901. }
  1902. });
  1903. return result;
  1904. }
  1905. /**
  1906. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1907. * support for iteratee shorthands.
  1908. *
  1909. * @private
  1910. * @param {Array} array The array to inspect.
  1911. * @param {Function} predicate The function invoked per iteration.
  1912. * @param {number} fromIndex The index to search from.
  1913. * @param {boolean} [fromRight] Specify iterating from right to left.
  1914. * @returns {number} Returns the index of the matched value, else `-1`.
  1915. */
  1916. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1917. var length = array.length,
  1918. index = fromIndex + (fromRight ? 1 : -1);
  1919. while ((fromRight ? index-- : ++index < length)) {
  1920. if (predicate(array[index], index, array)) {
  1921. return index;
  1922. }
  1923. }
  1924. return -1;
  1925. }
  1926. /**
  1927. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1928. *
  1929. * @private
  1930. * @param {Array} array The array to inspect.
  1931. * @param {*} value The value to search for.
  1932. * @param {number} fromIndex The index to search from.
  1933. * @returns {number} Returns the index of the matched value, else `-1`.
  1934. */
  1935. function baseIndexOf(array, value, fromIndex) {
  1936. return value === value
  1937. ? strictIndexOf(array, value, fromIndex)
  1938. : baseFindIndex(array, baseIsNaN, fromIndex);
  1939. }
  1940. /**
  1941. * This function is like `baseIndexOf` except that it accepts a comparator.
  1942. *
  1943. * @private
  1944. * @param {Array} array The array to inspect.
  1945. * @param {*} value The value to search for.
  1946. * @param {number} fromIndex The index to search from.
  1947. * @param {Function} comparator The comparator invoked per element.
  1948. * @returns {number} Returns the index of the matched value, else `-1`.
  1949. */
  1950. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1951. var index = fromIndex - 1,
  1952. length = array.length;
  1953. while (++index < length) {
  1954. if (comparator(array[index], value)) {
  1955. return index;
  1956. }
  1957. }
  1958. return -1;
  1959. }
  1960. /**
  1961. * The base implementation of `_.isNaN` without support for number objects.
  1962. *
  1963. * @private
  1964. * @param {*} value The value to check.
  1965. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1966. */
  1967. function baseIsNaN(value) {
  1968. return value !== value;
  1969. }
  1970. /**
  1971. * The base implementation of `_.mean` and `_.meanBy` without support for
  1972. * iteratee shorthands.
  1973. *
  1974. * @private
  1975. * @param {Array} array The array to iterate over.
  1976. * @param {Function} iteratee The function invoked per iteration.
  1977. * @returns {number} Returns the mean.
  1978. */
  1979. function baseMean(array, iteratee) {
  1980. var length = array == null ? 0 : array.length;
  1981. return length ? (baseSum(array, iteratee) / length) : NAN;
  1982. }
  1983. /**
  1984. * The base implementation of `_.property` without support for deep paths.
  1985. *
  1986. * @private
  1987. * @param {string} key The key of the property to get.
  1988. * @returns {Function} Returns the new accessor function.
  1989. */
  1990. function baseProperty(key) {
  1991. return function(object) {
  1992. return object == null ? undefined : object[key];
  1993. };
  1994. }
  1995. /**
  1996. * The base implementation of `_.propertyOf` without support for deep paths.
  1997. *
  1998. * @private
  1999. * @param {Object} object The object to query.
  2000. * @returns {Function} Returns the new accessor function.
  2001. */
  2002. function basePropertyOf(object) {
  2003. return function(key) {
  2004. return object == null ? undefined : object[key];
  2005. };
  2006. }
  2007. /**
  2008. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2009. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2010. *
  2011. * @private
  2012. * @param {Array|Object} collection The collection to iterate over.
  2013. * @param {Function} iteratee The function invoked per iteration.
  2014. * @param {*} accumulator The initial value.
  2015. * @param {boolean} initAccum Specify using the first or last element of
  2016. * `collection` as the initial value.
  2017. * @param {Function} eachFunc The function to iterate over `collection`.
  2018. * @returns {*} Returns the accumulated value.
  2019. */
  2020. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2021. eachFunc(collection, function(value, index, collection) {
  2022. accumulator = initAccum
  2023. ? (initAccum = false, value)
  2024. : iteratee(accumulator, value, index, collection);
  2025. });
  2026. return accumulator;
  2027. }
  2028. /**
  2029. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2030. * sort order of `array` and replaces criteria objects with their corresponding
  2031. * values.
  2032. *
  2033. * @private
  2034. * @param {Array} array The array to sort.
  2035. * @param {Function} comparer The function to define sort order.
  2036. * @returns {Array} Returns `array`.
  2037. */
  2038. function baseSortBy(array, comparer) {
  2039. var length = array.length;
  2040. array.sort(comparer);
  2041. while (length--) {
  2042. array[length] = array[length].value;
  2043. }
  2044. return array;
  2045. }
  2046. /**
  2047. * The base implementation of `_.sum` and `_.sumBy` without support for
  2048. * iteratee shorthands.
  2049. *
  2050. * @private
  2051. * @param {Array} array The array to iterate over.
  2052. * @param {Function} iteratee The function invoked per iteration.
  2053. * @returns {number} Returns the sum.
  2054. */
  2055. function baseSum(array, iteratee) {
  2056. var result,
  2057. index = -1,
  2058. length = array.length;
  2059. while (++index < length) {
  2060. var current = iteratee(array[index]);
  2061. if (current !== undefined) {
  2062. result = result === undefined ? current : (result + current);
  2063. }
  2064. }
  2065. return result;
  2066. }
  2067. /**
  2068. * The base implementation of `_.times` without support for iteratee shorthands
  2069. * or max array length checks.
  2070. *
  2071. * @private
  2072. * @param {number} n The number of times to invoke `iteratee`.
  2073. * @param {Function} iteratee The function invoked per iteration.
  2074. * @returns {Array} Returns the array of results.
  2075. */
  2076. function baseTimes(n, iteratee) {
  2077. var index = -1,
  2078. result = Array(n);
  2079. while (++index < n) {
  2080. result[index] = iteratee(index);
  2081. }
  2082. return result;
  2083. }
  2084. /**
  2085. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2086. * of key-value pairs for `object` corresponding to the property names of `props`.
  2087. *
  2088. * @private
  2089. * @param {Object} object The object to query.
  2090. * @param {Array} props The property names to get values for.
  2091. * @returns {Object} Returns the key-value pairs.
  2092. */
  2093. function baseToPairs(object, props) {
  2094. return arrayMap(props, function(key) {
  2095. return [key, object[key]];
  2096. });
  2097. }
  2098. /**
  2099. * The base implementation of `_.trim`.
  2100. *
  2101. * @private
  2102. * @param {string} string The string to trim.
  2103. * @returns {string} Returns the trimmed string.
  2104. */
  2105. function baseTrim(string) {
  2106. return string
  2107. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2108. : string;
  2109. }
  2110. /**
  2111. * The base implementation of `_.unary` without support for storing metadata.
  2112. *
  2113. * @private
  2114. * @param {Function} func The function to cap arguments for.
  2115. * @returns {Function} Returns the new capped function.
  2116. */
  2117. function baseUnary(func) {
  2118. return function(value) {
  2119. return func(value);
  2120. };
  2121. }
  2122. /**
  2123. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2124. * array of `object` property values corresponding to the property names
  2125. * of `props`.
  2126. *
  2127. * @private
  2128. * @param {Object} object The object to query.
  2129. * @param {Array} props The property names to get values for.
  2130. * @returns {Object} Returns the array of property values.
  2131. */
  2132. function baseValues(object, props) {
  2133. return arrayMap(props, function(key) {
  2134. return object[key];
  2135. });
  2136. }
  2137. /**
  2138. * Checks if a `cache` value for `key` exists.
  2139. *
  2140. * @private
  2141. * @param {Object} cache The cache to query.
  2142. * @param {string} key The key of the entry to check.
  2143. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2144. */
  2145. function cacheHas(cache, key) {
  2146. return cache.has(key);
  2147. }
  2148. /**
  2149. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2150. * that is not found in the character symbols.
  2151. *
  2152. * @private
  2153. * @param {Array} strSymbols The string symbols to inspect.
  2154. * @param {Array} chrSymbols The character symbols to find.
  2155. * @returns {number} Returns the index of the first unmatched string symbol.
  2156. */
  2157. function charsStartIndex(strSymbols, chrSymbols) {
  2158. var index = -1,
  2159. length = strSymbols.length;
  2160. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2161. return index;
  2162. }
  2163. /**
  2164. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2165. * that is not found in the character symbols.
  2166. *
  2167. * @private
  2168. * @param {Array} strSymbols The string symbols to inspect.
  2169. * @param {Array} chrSymbols The character symbols to find.
  2170. * @returns {number} Returns the index of the last unmatched string symbol.
  2171. */
  2172. function charsEndIndex(strSymbols, chrSymbols) {
  2173. var index = strSymbols.length;
  2174. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2175. return index;
  2176. }
  2177. /**
  2178. * Gets the number of `placeholder` occurrences in `array`.
  2179. *
  2180. * @private
  2181. * @param {Array} array The array to inspect.
  2182. * @param {*} placeholder The placeholder to search for.
  2183. * @returns {number} Returns the placeholder count.
  2184. */
  2185. function countHolders(array, placeholder) {
  2186. var length = array.length,
  2187. result = 0;
  2188. while (length--) {
  2189. if (array[length] === placeholder) {
  2190. ++result;
  2191. }
  2192. }
  2193. return result;
  2194. }
  2195. /**
  2196. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2197. * letters to basic Latin letters.
  2198. *
  2199. * @private
  2200. * @param {string} letter The matched letter to deburr.
  2201. * @returns {string} Returns the deburred letter.
  2202. */
  2203. var deburrLetter = basePropertyOf(deburredLetters);
  2204. /**
  2205. * Used by `_.escape` to convert characters to HTML entities.
  2206. *
  2207. * @private
  2208. * @param {string} chr The matched character to escape.
  2209. * @returns {string} Returns the escaped character.
  2210. */
  2211. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2212. /**
  2213. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2214. *
  2215. * @private
  2216. * @param {string} chr The matched character to escape.
  2217. * @returns {string} Returns the escaped character.
  2218. */
  2219. function escapeStringChar(chr) {
  2220. return '\\' + stringEscapes[chr];
  2221. }
  2222. /**
  2223. * Gets the value at `key` of `object`.
  2224. *
  2225. * @private
  2226. * @param {Object} [object] The object to query.
  2227. * @param {string} key The key of the property to get.
  2228. * @returns {*} Returns the property value.
  2229. */
  2230. function getValue(object, key) {
  2231. return object == null ? undefined : object[key];
  2232. }
  2233. /**
  2234. * Checks if `string` contains Unicode symbols.
  2235. *
  2236. * @private
  2237. * @param {string} string The string to inspect.
  2238. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2239. */
  2240. function hasUnicode(string) {
  2241. return reHasUnicode.test(string);
  2242. }
  2243. /**
  2244. * Checks if `string` contains a word composed of Unicode symbols.
  2245. *
  2246. * @private
  2247. * @param {string} string The string to inspect.
  2248. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2249. */
  2250. function hasUnicodeWord(string) {
  2251. return reHasUnicodeWord.test(string);
  2252. }
  2253. /**
  2254. * Converts `iterator` to an array.
  2255. *
  2256. * @private
  2257. * @param {Object} iterator The iterator to convert.
  2258. * @returns {Array} Returns the converted array.
  2259. */
  2260. function iteratorToArray(iterator) {
  2261. var data,
  2262. result = [];
  2263. while (!(data = iterator.next()).done) {
  2264. result.push(data.value);
  2265. }
  2266. return result;
  2267. }
  2268. /**
  2269. * Converts `map` to its key-value pairs.
  2270. *
  2271. * @private
  2272. * @param {Object} map The map to convert.
  2273. * @returns {Array} Returns the key-value pairs.
  2274. */
  2275. function mapToArray(map) {
  2276. var index = -1,
  2277. result = Array(map.size);
  2278. map.forEach(function(value, key) {
  2279. result[++index] = [key, value];
  2280. });
  2281. return result;
  2282. }
  2283. /**
  2284. * Creates a unary function that invokes `func` with its argument transformed.
  2285. *
  2286. * @private
  2287. * @param {Function} func The function to wrap.
  2288. * @param {Function} transform The argument transform.
  2289. * @returns {Function} Returns the new function.
  2290. */
  2291. function overArg(func, transform) {
  2292. return function(arg) {
  2293. return func(transform(arg));
  2294. };
  2295. }
  2296. /**
  2297. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2298. * and returns an array of their indexes.
  2299. *
  2300. * @private
  2301. * @param {Array} array The array to modify.
  2302. * @param {*} placeholder The placeholder to replace.
  2303. * @returns {Array} Returns the new array of placeholder indexes.
  2304. */
  2305. function replaceHolders(array, placeholder) {
  2306. var index = -1,
  2307. length = array.length,
  2308. resIndex = 0,
  2309. result = [];
  2310. while (++index < length) {
  2311. var value = array[index];
  2312. if (value === placeholder || value === PLACEHOLDER) {
  2313. array[index] = PLACEHOLDER;
  2314. result[resIndex++] = index;
  2315. }
  2316. }
  2317. return result;
  2318. }
  2319. /**
  2320. * Converts `set` to an array of its values.
  2321. *
  2322. * @private
  2323. * @param {Object} set The set to convert.
  2324. * @returns {Array} Returns the values.
  2325. */
  2326. function setToArray(set) {
  2327. var index = -1,
  2328. result = Array(set.size);
  2329. set.forEach(function(value) {
  2330. result[++index] = value;
  2331. });
  2332. return result;
  2333. }
  2334. /**
  2335. * Converts `set` to its value-value pairs.
  2336. *
  2337. * @private
  2338. * @param {Object} set The set to convert.
  2339. * @returns {Array} Returns the value-value pairs.
  2340. */
  2341. function setToPairs(set) {
  2342. var index = -1,
  2343. result = Array(set.size);
  2344. set.forEach(function(value) {
  2345. result[++index] = [value, value];
  2346. });
  2347. return result;
  2348. }
  2349. /**
  2350. * A specialized version of `_.indexOf` which performs strict equality
  2351. * comparisons of values, i.e. `===`.
  2352. *
  2353. * @private
  2354. * @param {Array} array The array to inspect.
  2355. * @param {*} value The value to search for.
  2356. * @param {number} fromIndex The index to search from.
  2357. * @returns {number} Returns the index of the matched value, else `-1`.
  2358. */
  2359. function strictIndexOf(array, value, fromIndex) {
  2360. var index = fromIndex - 1,
  2361. length = array.length;
  2362. while (++index < length) {
  2363. if (array[index] === value) {
  2364. return index;
  2365. }
  2366. }
  2367. return -1;
  2368. }
  2369. /**
  2370. * A specialized version of `_.lastIndexOf` which performs strict equality
  2371. * comparisons of values, i.e. `===`.
  2372. *
  2373. * @private
  2374. * @param {Array} array The array to inspect.
  2375. * @param {*} value The value to search for.
  2376. * @param {number} fromIndex The index to search from.
  2377. * @returns {number} Returns the index of the matched value, else `-1`.
  2378. */
  2379. function strictLastIndexOf(array, value, fromIndex) {
  2380. var index = fromIndex + 1;
  2381. while (index--) {
  2382. if (array[index] === value) {
  2383. return index;
  2384. }
  2385. }
  2386. return index;
  2387. }
  2388. /**
  2389. * Gets the number of symbols in `string`.
  2390. *
  2391. * @private
  2392. * @param {string} string The string to inspect.
  2393. * @returns {number} Returns the string size.
  2394. */
  2395. function stringSize(string) {
  2396. return hasUnicode(string)
  2397. ? unicodeSize(string)
  2398. : asciiSize(string);
  2399. }
  2400. /**
  2401. * Converts `string` to an array.
  2402. *
  2403. * @private
  2404. * @param {string} string The string to convert.
  2405. * @returns {Array} Returns the converted array.
  2406. */
  2407. function stringToArray(string) {
  2408. return hasUnicode(string)
  2409. ? unicodeToArray(string)
  2410. : asciiToArray(string);
  2411. }
  2412. /**
  2413. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2414. * character of `string`.
  2415. *
  2416. * @private
  2417. * @param {string} string The string to inspect.
  2418. * @returns {number} Returns the index of the last non-whitespace character.
  2419. */
  2420. function trimmedEndIndex(string) {
  2421. var index = string.length;
  2422. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2423. return index;
  2424. }
  2425. /**
  2426. * Used by `_.unescape` to convert HTML entities to characters.
  2427. *
  2428. * @private
  2429. * @param {string} chr The matched character to unescape.
  2430. * @returns {string} Returns the unescaped character.
  2431. */
  2432. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2433. /**
  2434. * Gets the size of a Unicode `string`.
  2435. *
  2436. * @private
  2437. * @param {string} string The string inspect.
  2438. * @returns {number} Returns the string size.
  2439. */
  2440. function unicodeSize(string) {
  2441. var result = reUnicode.lastIndex = 0;
  2442. while (reUnicode.test(string)) {
  2443. ++result;
  2444. }
  2445. return result;
  2446. }
  2447. /**
  2448. * Converts a Unicode `string` to an array.
  2449. *
  2450. * @private
  2451. * @param {string} string The string to convert.
  2452. * @returns {Array} Returns the converted array.
  2453. */
  2454. function unicodeToArray(string) {
  2455. return string.match(reUnicode) || [];
  2456. }
  2457. /**
  2458. * Splits a Unicode `string` into an array of its words.
  2459. *
  2460. * @private
  2461. * @param {string} The string to inspect.
  2462. * @returns {Array} Returns the words of `string`.
  2463. */
  2464. function unicodeWords(string) {
  2465. return string.match(reUnicodeWord) || [];
  2466. }
  2467. /*--------------------------------------------------------------------------*/
  2468. /**
  2469. * Create a new pristine `lodash` function using the `context` object.
  2470. *
  2471. * @static
  2472. * @memberOf _
  2473. * @since 1.1.0
  2474. * @category Util
  2475. * @param {Object} [context=root] The context object.
  2476. * @returns {Function} Returns a new `lodash` function.
  2477. * @example
  2478. *
  2479. * _.mixin({ 'foo': _.constant('foo') });
  2480. *
  2481. * var lodash = _.runInContext();
  2482. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2483. *
  2484. * _.isFunction(_.foo);
  2485. * // => true
  2486. * _.isFunction(_.bar);
  2487. * // => false
  2488. *
  2489. * lodash.isFunction(lodash.foo);
  2490. * // => false
  2491. * lodash.isFunction(lodash.bar);
  2492. * // => true
  2493. *
  2494. * // Create a suped-up `defer` in Node.js.
  2495. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2496. */
  2497. var runInContext = (function runInContext(context) {
  2498. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2499. /** Built-in constructor references. */
  2500. var Array = context.Array,
  2501. Date = context.Date,
  2502. Error = context.Error,
  2503. Function = context.Function,
  2504. Math = context.Math,
  2505. Object = context.Object,
  2506. RegExp = context.RegExp,
  2507. String = context.String,
  2508. TypeError = context.TypeError;
  2509. /** Used for built-in method references. */
  2510. var arrayProto = Array.prototype,
  2511. funcProto = Function.prototype,
  2512. objectProto = Object.prototype;
  2513. /** Used to detect overreaching core-js shims. */
  2514. var coreJsData = context['__core-js_shared__'];
  2515. /** Used to resolve the decompiled source of functions. */
  2516. var funcToString = funcProto.toString;
  2517. /** Used to check objects for own properties. */
  2518. var hasOwnProperty = objectProto.hasOwnProperty;
  2519. /** Used to generate unique IDs. */
  2520. var idCounter = 0;
  2521. /** Used to detect methods masquerading as native. */
  2522. var maskSrcKey = (function() {
  2523. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2524. return uid ? ('Symbol(src)_1.' + uid) : '';
  2525. }());
  2526. /**
  2527. * Used to resolve the
  2528. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2529. * of values.
  2530. */
  2531. var nativeObjectToString = objectProto.toString;
  2532. /** Used to infer the `Object` constructor. */
  2533. var objectCtorString = funcToString.call(Object);
  2534. /** Used to restore the original `_` reference in `_.noConflict`. */
  2535. var oldDash = root._;
  2536. /** Used to detect if a method is native. */
  2537. var reIsNative = RegExp('^' +
  2538. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2539. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2540. );
  2541. /** Built-in value references. */
  2542. var Buffer = moduleExports ? context.Buffer : undefined,
  2543. Symbol = context.Symbol,
  2544. Uint8Array = context.Uint8Array,
  2545. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2546. getPrototype = overArg(Object.getPrototypeOf, Object),
  2547. objectCreate = Object.create,
  2548. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2549. splice = arrayProto.splice,
  2550. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2551. symIterator = Symbol ? Symbol.iterator : undefined,
  2552. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2553. var defineProperty = (function() {
  2554. try {
  2555. var func = getNative(Object, 'defineProperty');
  2556. func({}, '', {});
  2557. return func;
  2558. } catch (e) {}
  2559. }());
  2560. /** Mocked built-ins. */
  2561. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2562. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2563. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2564. /* Built-in method references for those with the same name as other `lodash` methods. */
  2565. var nativeCeil = Math.ceil,
  2566. nativeFloor = Math.floor,
  2567. nativeGetSymbols = Object.getOwnPropertySymbols,
  2568. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2569. nativeIsFinite = context.isFinite,
  2570. nativeJoin = arrayProto.join,
  2571. nativeKeys = overArg(Object.keys, Object),
  2572. nativeMax = Math.max,
  2573. nativeMin = Math.min,
  2574. nativeNow = Date.now,
  2575. nativeParseInt = context.parseInt,
  2576. nativeRandom = Math.random,
  2577. nativeReverse = arrayProto.reverse;
  2578. /* Built-in method references that are verified to be native. */
  2579. var DataView = getNative(context, 'DataView'),
  2580. Map = getNative(context, 'Map'),
  2581. Promise = getNative(context, 'Promise'),
  2582. Set = getNative(context, 'Set'),
  2583. WeakMap = getNative(context, 'WeakMap'),
  2584. nativeCreate = getNative(Object, 'create');
  2585. /** Used to store function metadata. */
  2586. var metaMap = WeakMap && new WeakMap;
  2587. /** Used to lookup unminified function names. */
  2588. var realNames = {};
  2589. /** Used to detect maps, sets, and weakmaps. */
  2590. var dataViewCtorString = toSource(DataView),
  2591. mapCtorString = toSource(Map),
  2592. promiseCtorString = toSource(Promise),
  2593. setCtorString = toSource(Set),
  2594. weakMapCtorString = toSource(WeakMap);
  2595. /** Used to convert symbols to primitives and strings. */
  2596. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2597. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2598. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2599. /*------------------------------------------------------------------------*/
  2600. /**
  2601. * Creates a `lodash` object which wraps `value` to enable implicit method
  2602. * chain sequences. Methods that operate on and return arrays, collections,
  2603. * and functions can be chained together. Methods that retrieve a single value
  2604. * or may return a primitive value will automatically end the chain sequence
  2605. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2606. * with `_#value`.
  2607. *
  2608. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2609. * enabled using `_.chain`.
  2610. *
  2611. * The execution of chained methods is lazy, that is, it's deferred until
  2612. * `_#value` is implicitly or explicitly called.
  2613. *
  2614. * Lazy evaluation allows several methods to support shortcut fusion.
  2615. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2616. * the creation of intermediate arrays and can greatly reduce the number of
  2617. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2618. * fusion if the section is applied to an array and iteratees accept only
  2619. * one argument. The heuristic for whether a section qualifies for shortcut
  2620. * fusion is subject to change.
  2621. *
  2622. * Chaining is supported in custom builds as long as the `_#value` method is
  2623. * directly or indirectly included in the build.
  2624. *
  2625. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2626. *
  2627. * The wrapper `Array` methods are:
  2628. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2629. *
  2630. * The wrapper `String` methods are:
  2631. * `replace` and `split`
  2632. *
  2633. * The wrapper methods that support shortcut fusion are:
  2634. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2635. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2636. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2637. *
  2638. * The chainable wrapper methods are:
  2639. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2640. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2641. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2642. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2643. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2644. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2645. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2646. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2647. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2648. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2649. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2650. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2651. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2652. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2653. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2654. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2655. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2656. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2657. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2658. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2659. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2660. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2661. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2662. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2663. *
  2664. * The wrapper methods that are **not** chainable by default are:
  2665. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2666. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2667. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2668. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2669. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2670. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2671. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2672. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2673. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2674. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2675. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2676. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2677. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2678. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2679. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2680. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2681. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2682. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2683. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2684. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2685. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2686. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2687. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2688. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2689. * `upperFirst`, `value`, and `words`
  2690. *
  2691. * @name _
  2692. * @constructor
  2693. * @category Seq
  2694. * @param {*} value The value to wrap in a `lodash` instance.
  2695. * @returns {Object} Returns the new `lodash` wrapper instance.
  2696. * @example
  2697. *
  2698. * function square(n) {
  2699. * return n * n;
  2700. * }
  2701. *
  2702. * var wrapped = _([1, 2, 3]);
  2703. *
  2704. * // Returns an unwrapped value.
  2705. * wrapped.reduce(_.add);
  2706. * // => 6
  2707. *
  2708. * // Returns a wrapped value.
  2709. * var squares = wrapped.map(square);
  2710. *
  2711. * _.isArray(squares);
  2712. * // => false
  2713. *
  2714. * _.isArray(squares.value());
  2715. * // => true
  2716. */
  2717. function lodash(value) {
  2718. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2719. if (value instanceof LodashWrapper) {
  2720. return value;
  2721. }
  2722. if (hasOwnProperty.call(value, '__wrapped__')) {
  2723. return wrapperClone(value);
  2724. }
  2725. }
  2726. return new LodashWrapper(value);
  2727. }
  2728. /**
  2729. * The base implementation of `_.create` without support for assigning
  2730. * properties to the created object.
  2731. *
  2732. * @private
  2733. * @param {Object} proto The object to inherit from.
  2734. * @returns {Object} Returns the new object.
  2735. */
  2736. var baseCreate = (function() {
  2737. function object() {}
  2738. return function(proto) {
  2739. if (!isObject(proto)) {
  2740. return {};
  2741. }
  2742. if (objectCreate) {
  2743. return objectCreate(proto);
  2744. }
  2745. object.prototype = proto;
  2746. var result = new object;
  2747. object.prototype = undefined;
  2748. return result;
  2749. };
  2750. }());
  2751. /**
  2752. * The function whose prototype chain sequence wrappers inherit from.
  2753. *
  2754. * @private
  2755. */
  2756. function baseLodash() {
  2757. // No operation performed.
  2758. }
  2759. /**
  2760. * The base constructor for creating `lodash` wrapper objects.
  2761. *
  2762. * @private
  2763. * @param {*} value The value to wrap.
  2764. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2765. */
  2766. function LodashWrapper(value, chainAll) {
  2767. this.__wrapped__ = value;
  2768. this.__actions__ = [];
  2769. this.__chain__ = !!chainAll;
  2770. this.__index__ = 0;
  2771. this.__values__ = undefined;
  2772. }
  2773. /**
  2774. * By default, the template delimiters used by lodash are like those in
  2775. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2776. * following template settings to use alternative delimiters.
  2777. *
  2778. * @static
  2779. * @memberOf _
  2780. * @type {Object}
  2781. */
  2782. lodash.templateSettings = {
  2783. /**
  2784. * Used to detect `data` property values to be HTML-escaped.
  2785. *
  2786. * @memberOf _.templateSettings
  2787. * @type {RegExp}
  2788. */
  2789. 'escape': reEscape,
  2790. /**
  2791. * Used to detect code to be evaluated.
  2792. *
  2793. * @memberOf _.templateSettings
  2794. * @type {RegExp}
  2795. */
  2796. 'evaluate': reEvaluate,
  2797. /**
  2798. * Used to detect `data` property values to inject.
  2799. *
  2800. * @memberOf _.templateSettings
  2801. * @type {RegExp}
  2802. */
  2803. 'interpolate': reInterpolate,
  2804. /**
  2805. * Used to reference the data object in the template text.
  2806. *
  2807. * @memberOf _.templateSettings
  2808. * @type {string}
  2809. */
  2810. 'variable': '',
  2811. /**
  2812. * Used to import variables into the compiled template.
  2813. *
  2814. * @memberOf _.templateSettings
  2815. * @type {Object}
  2816. */
  2817. 'imports': {
  2818. /**
  2819. * A reference to the `lodash` function.
  2820. *
  2821. * @memberOf _.templateSettings.imports
  2822. * @type {Function}
  2823. */
  2824. '_': lodash
  2825. }
  2826. };
  2827. // Ensure wrappers are instances of `baseLodash`.
  2828. lodash.prototype = baseLodash.prototype;
  2829. lodash.prototype.constructor = lodash;
  2830. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2831. LodashWrapper.prototype.constructor = LodashWrapper;
  2832. /*------------------------------------------------------------------------*/
  2833. /**
  2834. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2835. *
  2836. * @private
  2837. * @constructor
  2838. * @param {*} value The value to wrap.
  2839. */
  2840. function LazyWrapper(value) {
  2841. this.__wrapped__ = value;
  2842. this.__actions__ = [];
  2843. this.__dir__ = 1;
  2844. this.__filtered__ = false;
  2845. this.__iteratees__ = [];
  2846. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2847. this.__views__ = [];
  2848. }
  2849. /**
  2850. * Creates a clone of the lazy wrapper object.
  2851. *
  2852. * @private
  2853. * @name clone
  2854. * @memberOf LazyWrapper
  2855. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2856. */
  2857. function lazyClone() {
  2858. var result = new LazyWrapper(this.__wrapped__);
  2859. result.__actions__ = copyArray(this.__actions__);
  2860. result.__dir__ = this.__dir__;
  2861. result.__filtered__ = this.__filtered__;
  2862. result.__iteratees__ = copyArray(this.__iteratees__);
  2863. result.__takeCount__ = this.__takeCount__;
  2864. result.__views__ = copyArray(this.__views__);
  2865. return result;
  2866. }
  2867. /**
  2868. * Reverses the direction of lazy iteration.
  2869. *
  2870. * @private
  2871. * @name reverse
  2872. * @memberOf LazyWrapper
  2873. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2874. */
  2875. function lazyReverse() {
  2876. if (this.__filtered__) {
  2877. var result = new LazyWrapper(this);
  2878. result.__dir__ = -1;
  2879. result.__filtered__ = true;
  2880. } else {
  2881. result = this.clone();
  2882. result.__dir__ *= -1;
  2883. }
  2884. return result;
  2885. }
  2886. /**
  2887. * Extracts the unwrapped value from its lazy wrapper.
  2888. *
  2889. * @private
  2890. * @name value
  2891. * @memberOf LazyWrapper
  2892. * @returns {*} Returns the unwrapped value.
  2893. */
  2894. function lazyValue() {
  2895. var array = this.__wrapped__.value(),
  2896. dir = this.__dir__,
  2897. isArr = isArray(array),
  2898. isRight = dir < 0,
  2899. arrLength = isArr ? array.length : 0,
  2900. view = getView(0, arrLength, this.__views__),
  2901. start = view.start,
  2902. end = view.end,
  2903. length = end - start,
  2904. index = isRight ? end : (start - 1),
  2905. iteratees = this.__iteratees__,
  2906. iterLength = iteratees.length,
  2907. resIndex = 0,
  2908. takeCount = nativeMin(length, this.__takeCount__);
  2909. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2910. return baseWrapperValue(array, this.__actions__);
  2911. }
  2912. var result = [];
  2913. outer:
  2914. while (length-- && resIndex < takeCount) {
  2915. index += dir;
  2916. var iterIndex = -1,
  2917. value = array[index];
  2918. while (++iterIndex < iterLength) {
  2919. var data = iteratees[iterIndex],
  2920. iteratee = data.iteratee,
  2921. type = data.type,
  2922. computed = iteratee(value);
  2923. if (type == LAZY_MAP_FLAG) {
  2924. value = computed;
  2925. } else if (!computed) {
  2926. if (type == LAZY_FILTER_FLAG) {
  2927. continue outer;
  2928. } else {
  2929. break outer;
  2930. }
  2931. }
  2932. }
  2933. result[resIndex++] = value;
  2934. }
  2935. return result;
  2936. }
  2937. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2938. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2939. LazyWrapper.prototype.constructor = LazyWrapper;
  2940. /*------------------------------------------------------------------------*/
  2941. /**
  2942. * Creates a hash object.
  2943. *
  2944. * @private
  2945. * @constructor
  2946. * @param {Array} [entries] The key-value pairs to cache.
  2947. */
  2948. function Hash(entries) {
  2949. var index = -1,
  2950. length = entries == null ? 0 : entries.length;
  2951. this.clear();
  2952. while (++index < length) {
  2953. var entry = entries[index];
  2954. this.set(entry[0], entry[1]);
  2955. }
  2956. }
  2957. /**
  2958. * Removes all key-value entries from the hash.
  2959. *
  2960. * @private
  2961. * @name clear
  2962. * @memberOf Hash
  2963. */
  2964. function hashClear() {
  2965. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2966. this.size = 0;
  2967. }
  2968. /**
  2969. * Removes `key` and its value from the hash.
  2970. *
  2971. * @private
  2972. * @name delete
  2973. * @memberOf Hash
  2974. * @param {Object} hash The hash to modify.
  2975. * @param {string} key The key of the value to remove.
  2976. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2977. */
  2978. function hashDelete(key) {
  2979. var result = this.has(key) && delete this.__data__[key];
  2980. this.size -= result ? 1 : 0;
  2981. return result;
  2982. }
  2983. /**
  2984. * Gets the hash value for `key`.
  2985. *
  2986. * @private
  2987. * @name get
  2988. * @memberOf Hash
  2989. * @param {string} key The key of the value to get.
  2990. * @returns {*} Returns the entry value.
  2991. */
  2992. function hashGet(key) {
  2993. var data = this.__data__;
  2994. if (nativeCreate) {
  2995. var result = data[key];
  2996. return result === HASH_UNDEFINED ? undefined : result;
  2997. }
  2998. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2999. }
  3000. /**
  3001. * Checks if a hash value for `key` exists.
  3002. *
  3003. * @private
  3004. * @name has
  3005. * @memberOf Hash
  3006. * @param {string} key The key of the entry to check.
  3007. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3008. */
  3009. function hashHas(key) {
  3010. var data = this.__data__;
  3011. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3012. }
  3013. /**
  3014. * Sets the hash `key` to `value`.
  3015. *
  3016. * @private
  3017. * @name set
  3018. * @memberOf Hash
  3019. * @param {string} key The key of the value to set.
  3020. * @param {*} value The value to set.
  3021. * @returns {Object} Returns the hash instance.
  3022. */
  3023. function hashSet(key, value) {
  3024. var data = this.__data__;
  3025. this.size += this.has(key) ? 0 : 1;
  3026. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3027. return this;
  3028. }
  3029. // Add methods to `Hash`.
  3030. Hash.prototype.clear = hashClear;
  3031. Hash.prototype['delete'] = hashDelete;
  3032. Hash.prototype.get = hashGet;
  3033. Hash.prototype.has = hashHas;
  3034. Hash.prototype.set = hashSet;
  3035. /*------------------------------------------------------------------------*/
  3036. /**
  3037. * Creates an list cache object.
  3038. *
  3039. * @private
  3040. * @constructor
  3041. * @param {Array} [entries] The key-value pairs to cache.
  3042. */
  3043. function ListCache(entries) {
  3044. var index = -1,
  3045. length = entries == null ? 0 : entries.length;
  3046. this.clear();
  3047. while (++index < length) {
  3048. var entry = entries[index];
  3049. this.set(entry[0], entry[1]);
  3050. }
  3051. }
  3052. /**
  3053. * Removes all key-value entries from the list cache.
  3054. *
  3055. * @private
  3056. * @name clear
  3057. * @memberOf ListCache
  3058. */
  3059. function listCacheClear() {
  3060. this.__data__ = [];
  3061. this.size = 0;
  3062. }
  3063. /**
  3064. * Removes `key` and its value from the list cache.
  3065. *
  3066. * @private
  3067. * @name delete
  3068. * @memberOf ListCache
  3069. * @param {string} key The key of the value to remove.
  3070. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3071. */
  3072. function listCacheDelete(key) {
  3073. var data = this.__data__,
  3074. index = assocIndexOf(data, key);
  3075. if (index < 0) {
  3076. return false;
  3077. }
  3078. var lastIndex = data.length - 1;
  3079. if (index == lastIndex) {
  3080. data.pop();
  3081. } else {
  3082. splice.call(data, index, 1);
  3083. }
  3084. --this.size;
  3085. return true;
  3086. }
  3087. /**
  3088. * Gets the list cache value for `key`.
  3089. *
  3090. * @private
  3091. * @name get
  3092. * @memberOf ListCache
  3093. * @param {string} key The key of the value to get.
  3094. * @returns {*} Returns the entry value.
  3095. */
  3096. function listCacheGet(key) {
  3097. var data = this.__data__,
  3098. index = assocIndexOf(data, key);
  3099. return index < 0 ? undefined : data[index][1];
  3100. }
  3101. /**
  3102. * Checks if a list cache value for `key` exists.
  3103. *
  3104. * @private
  3105. * @name has
  3106. * @memberOf ListCache
  3107. * @param {string} key The key of the entry to check.
  3108. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3109. */
  3110. function listCacheHas(key) {
  3111. return assocIndexOf(this.__data__, key) > -1;
  3112. }
  3113. /**
  3114. * Sets the list cache `key` to `value`.
  3115. *
  3116. * @private
  3117. * @name set
  3118. * @memberOf ListCache
  3119. * @param {string} key The key of the value to set.
  3120. * @param {*} value The value to set.
  3121. * @returns {Object} Returns the list cache instance.
  3122. */
  3123. function listCacheSet(key, value) {
  3124. var data = this.__data__,
  3125. index = assocIndexOf(data, key);
  3126. if (index < 0) {
  3127. ++this.size;
  3128. data.push([key, value]);
  3129. } else {
  3130. data[index][1] = value;
  3131. }
  3132. return this;
  3133. }
  3134. // Add methods to `ListCache`.
  3135. ListCache.prototype.clear = listCacheClear;
  3136. ListCache.prototype['delete'] = listCacheDelete;
  3137. ListCache.prototype.get = listCacheGet;
  3138. ListCache.prototype.has = listCacheHas;
  3139. ListCache.prototype.set = listCacheSet;
  3140. /*------------------------------------------------------------------------*/
  3141. /**
  3142. * Creates a map cache object to store key-value pairs.
  3143. *
  3144. * @private
  3145. * @constructor
  3146. * @param {Array} [entries] The key-value pairs to cache.
  3147. */
  3148. function MapCache(entries) {
  3149. var index = -1,
  3150. length = entries == null ? 0 : entries.length;
  3151. this.clear();
  3152. while (++index < length) {
  3153. var entry = entries[index];
  3154. this.set(entry[0], entry[1]);
  3155. }
  3156. }
  3157. /**
  3158. * Removes all key-value entries from the map.
  3159. *
  3160. * @private
  3161. * @name clear
  3162. * @memberOf MapCache
  3163. */
  3164. function mapCacheClear() {
  3165. this.size = 0;
  3166. this.__data__ = {
  3167. 'hash': new Hash,
  3168. 'map': new (Map || ListCache),
  3169. 'string': new Hash
  3170. };
  3171. }
  3172. /**
  3173. * Removes `key` and its value from the map.
  3174. *
  3175. * @private
  3176. * @name delete
  3177. * @memberOf MapCache
  3178. * @param {string} key The key of the value to remove.
  3179. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3180. */
  3181. function mapCacheDelete(key) {
  3182. var result = getMapData(this, key)['delete'](key);
  3183. this.size -= result ? 1 : 0;
  3184. return result;
  3185. }
  3186. /**
  3187. * Gets the map value for `key`.
  3188. *
  3189. * @private
  3190. * @name get
  3191. * @memberOf MapCache
  3192. * @param {string} key The key of the value to get.
  3193. * @returns {*} Returns the entry value.
  3194. */
  3195. function mapCacheGet(key) {
  3196. return getMapData(this, key).get(key);
  3197. }
  3198. /**
  3199. * Checks if a map value for `key` exists.
  3200. *
  3201. * @private
  3202. * @name has
  3203. * @memberOf MapCache
  3204. * @param {string} key The key of the entry to check.
  3205. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3206. */
  3207. function mapCacheHas(key) {
  3208. return getMapData(this, key).has(key);
  3209. }
  3210. /**
  3211. * Sets the map `key` to `value`.
  3212. *
  3213. * @private
  3214. * @name set
  3215. * @memberOf MapCache
  3216. * @param {string} key The key of the value to set.
  3217. * @param {*} value The value to set.
  3218. * @returns {Object} Returns the map cache instance.
  3219. */
  3220. function mapCacheSet(key, value) {
  3221. var data = getMapData(this, key),
  3222. size = data.size;
  3223. data.set(key, value);
  3224. this.size += data.size == size ? 0 : 1;
  3225. return this;
  3226. }
  3227. // Add methods to `MapCache`.
  3228. MapCache.prototype.clear = mapCacheClear;
  3229. MapCache.prototype['delete'] = mapCacheDelete;
  3230. MapCache.prototype.get = mapCacheGet;
  3231. MapCache.prototype.has = mapCacheHas;
  3232. MapCache.prototype.set = mapCacheSet;
  3233. /*------------------------------------------------------------------------*/
  3234. /**
  3235. *
  3236. * Creates an array cache object to store unique values.
  3237. *
  3238. * @private
  3239. * @constructor
  3240. * @param {Array} [values] The values to cache.
  3241. */
  3242. function SetCache(values) {
  3243. var index = -1,
  3244. length = values == null ? 0 : values.length;
  3245. this.__data__ = new MapCache;
  3246. while (++index < length) {
  3247. this.add(values[index]);
  3248. }
  3249. }
  3250. /**
  3251. * Adds `value` to the array cache.
  3252. *
  3253. * @private
  3254. * @name add
  3255. * @memberOf SetCache
  3256. * @alias push
  3257. * @param {*} value The value to cache.
  3258. * @returns {Object} Returns the cache instance.
  3259. */
  3260. function setCacheAdd(value) {
  3261. this.__data__.set(value, HASH_UNDEFINED);
  3262. return this;
  3263. }
  3264. /**
  3265. * Checks if `value` is in the array cache.
  3266. *
  3267. * @private
  3268. * @name has
  3269. * @memberOf SetCache
  3270. * @param {*} value The value to search for.
  3271. * @returns {number} Returns `true` if `value` is found, else `false`.
  3272. */
  3273. function setCacheHas(value) {
  3274. return this.__data__.has(value);
  3275. }
  3276. // Add methods to `SetCache`.
  3277. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3278. SetCache.prototype.has = setCacheHas;
  3279. /*------------------------------------------------------------------------*/
  3280. /**
  3281. * Creates a stack cache object to store key-value pairs.
  3282. *
  3283. * @private
  3284. * @constructor
  3285. * @param {Array} [entries] The key-value pairs to cache.
  3286. */
  3287. function Stack(entries) {
  3288. var data = this.__data__ = new ListCache(entries);
  3289. this.size = data.size;
  3290. }
  3291. /**
  3292. * Removes all key-value entries from the stack.
  3293. *
  3294. * @private
  3295. * @name clear
  3296. * @memberOf Stack
  3297. */
  3298. function stackClear() {
  3299. this.__data__ = new ListCache;
  3300. this.size = 0;
  3301. }
  3302. /**
  3303. * Removes `key` and its value from the stack.
  3304. *
  3305. * @private
  3306. * @name delete
  3307. * @memberOf Stack
  3308. * @param {string} key The key of the value to remove.
  3309. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3310. */
  3311. function stackDelete(key) {
  3312. var data = this.__data__,
  3313. result = data['delete'](key);
  3314. this.size = data.size;
  3315. return result;
  3316. }
  3317. /**
  3318. * Gets the stack value for `key`.
  3319. *
  3320. * @private
  3321. * @name get
  3322. * @memberOf Stack
  3323. * @param {string} key The key of the value to get.
  3324. * @returns {*} Returns the entry value.
  3325. */
  3326. function stackGet(key) {
  3327. return this.__data__.get(key);
  3328. }
  3329. /**
  3330. * Checks if a stack value for `key` exists.
  3331. *
  3332. * @private
  3333. * @name has
  3334. * @memberOf Stack
  3335. * @param {string} key The key of the entry to check.
  3336. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3337. */
  3338. function stackHas(key) {
  3339. return this.__data__.has(key);
  3340. }
  3341. /**
  3342. * Sets the stack `key` to `value`.
  3343. *
  3344. * @private
  3345. * @name set
  3346. * @memberOf Stack
  3347. * @param {string} key The key of the value to set.
  3348. * @param {*} value The value to set.
  3349. * @returns {Object} Returns the stack cache instance.
  3350. */
  3351. function stackSet(key, value) {
  3352. var data = this.__data__;
  3353. if (data instanceof ListCache) {
  3354. var pairs = data.__data__;
  3355. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3356. pairs.push([key, value]);
  3357. this.size = ++data.size;
  3358. return this;
  3359. }
  3360. data = this.__data__ = new MapCache(pairs);
  3361. }
  3362. data.set(key, value);
  3363. this.size = data.size;
  3364. return this;
  3365. }
  3366. // Add methods to `Stack`.
  3367. Stack.prototype.clear = stackClear;
  3368. Stack.prototype['delete'] = stackDelete;
  3369. Stack.prototype.get = stackGet;
  3370. Stack.prototype.has = stackHas;
  3371. Stack.prototype.set = stackSet;
  3372. /*------------------------------------------------------------------------*/
  3373. /**
  3374. * Creates an array of the enumerable property names of the array-like `value`.
  3375. *
  3376. * @private
  3377. * @param {*} value The value to query.
  3378. * @param {boolean} inherited Specify returning inherited property names.
  3379. * @returns {Array} Returns the array of property names.
  3380. */
  3381. function arrayLikeKeys(value, inherited) {
  3382. var isArr = isArray(value),
  3383. isArg = !isArr && isArguments(value),
  3384. isBuff = !isArr && !isArg && isBuffer(value),
  3385. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3386. skipIndexes = isArr || isArg || isBuff || isType,
  3387. result = skipIndexes ? baseTimes(value.length, String) : [],
  3388. length = result.length;
  3389. for (var key in value) {
  3390. if ((inherited || hasOwnProperty.call(value, key)) &&
  3391. !(skipIndexes && (
  3392. // Safari 9 has enumerable `arguments.length` in strict mode.
  3393. key == 'length' ||
  3394. // Node.js 0.10 has enumerable non-index properties on buffers.
  3395. (isBuff && (key == 'offset' || key == 'parent')) ||
  3396. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3397. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3398. // Skip index properties.
  3399. isIndex(key, length)
  3400. ))) {
  3401. result.push(key);
  3402. }
  3403. }
  3404. return result;
  3405. }
  3406. /**
  3407. * A specialized version of `_.sample` for arrays.
  3408. *
  3409. * @private
  3410. * @param {Array} array The array to sample.
  3411. * @returns {*} Returns the random element.
  3412. */
  3413. function arraySample(array) {
  3414. var length = array.length;
  3415. return length ? array[baseRandom(0, length - 1)] : undefined;
  3416. }
  3417. /**
  3418. * A specialized version of `_.sampleSize` for arrays.
  3419. *
  3420. * @private
  3421. * @param {Array} array The array to sample.
  3422. * @param {number} n The number of elements to sample.
  3423. * @returns {Array} Returns the random elements.
  3424. */
  3425. function arraySampleSize(array, n) {
  3426. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3427. }
  3428. /**
  3429. * A specialized version of `_.shuffle` for arrays.
  3430. *
  3431. * @private
  3432. * @param {Array} array The array to shuffle.
  3433. * @returns {Array} Returns the new shuffled array.
  3434. */
  3435. function arrayShuffle(array) {
  3436. return shuffleSelf(copyArray(array));
  3437. }
  3438. /**
  3439. * This function is like `assignValue` except that it doesn't assign
  3440. * `undefined` values.
  3441. *
  3442. * @private
  3443. * @param {Object} object The object to modify.
  3444. * @param {string} key The key of the property to assign.
  3445. * @param {*} value The value to assign.
  3446. */
  3447. function assignMergeValue(object, key, value) {
  3448. if ((value !== undefined && !eq(object[key], value)) ||
  3449. (value === undefined && !(key in object))) {
  3450. baseAssignValue(object, key, value);
  3451. }
  3452. }
  3453. /**
  3454. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3455. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3456. * for equality comparisons.
  3457. *
  3458. * @private
  3459. * @param {Object} object The object to modify.
  3460. * @param {string} key The key of the property to assign.
  3461. * @param {*} value The value to assign.
  3462. */
  3463. function assignValue(object, key, value) {
  3464. var objValue = object[key];
  3465. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3466. (value === undefined && !(key in object))) {
  3467. baseAssignValue(object, key, value);
  3468. }
  3469. }
  3470. /**
  3471. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3472. *
  3473. * @private
  3474. * @param {Array} array The array to inspect.
  3475. * @param {*} key The key to search for.
  3476. * @returns {number} Returns the index of the matched value, else `-1`.
  3477. */
  3478. function assocIndexOf(array, key) {
  3479. var length = array.length;
  3480. while (length--) {
  3481. if (eq(array[length][0], key)) {
  3482. return length;
  3483. }
  3484. }
  3485. return -1;
  3486. }
  3487. /**
  3488. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3489. * by `iteratee` and values set by `setter`.
  3490. *
  3491. * @private
  3492. * @param {Array|Object} collection The collection to iterate over.
  3493. * @param {Function} setter The function to set `accumulator` values.
  3494. * @param {Function} iteratee The iteratee to transform keys.
  3495. * @param {Object} accumulator The initial aggregated object.
  3496. * @returns {Function} Returns `accumulator`.
  3497. */
  3498. function baseAggregator(collection, setter, iteratee, accumulator) {
  3499. baseEach(collection, function(value, key, collection) {
  3500. setter(accumulator, value, iteratee(value), collection);
  3501. });
  3502. return accumulator;
  3503. }
  3504. /**
  3505. * The base implementation of `_.assign` without support for multiple sources
  3506. * or `customizer` functions.
  3507. *
  3508. * @private
  3509. * @param {Object} object The destination object.
  3510. * @param {Object} source The source object.
  3511. * @returns {Object} Returns `object`.
  3512. */
  3513. function baseAssign(object, source) {
  3514. return object && copyObject(source, keys(source), object);
  3515. }
  3516. /**
  3517. * The base implementation of `_.assignIn` without support for multiple sources
  3518. * or `customizer` functions.
  3519. *
  3520. * @private
  3521. * @param {Object} object The destination object.
  3522. * @param {Object} source The source object.
  3523. * @returns {Object} Returns `object`.
  3524. */
  3525. function baseAssignIn(object, source) {
  3526. return object && copyObject(source, keysIn(source), object);
  3527. }
  3528. /**
  3529. * The base implementation of `assignValue` and `assignMergeValue` without
  3530. * value checks.
  3531. *
  3532. * @private
  3533. * @param {Object} object The object to modify.
  3534. * @param {string} key The key of the property to assign.
  3535. * @param {*} value The value to assign.
  3536. */
  3537. function baseAssignValue(object, key, value) {
  3538. if (key == '__proto__' && defineProperty) {
  3539. defineProperty(object, key, {
  3540. 'configurable': true,
  3541. 'enumerable': true,
  3542. 'value': value,
  3543. 'writable': true
  3544. });
  3545. } else {
  3546. object[key] = value;
  3547. }
  3548. }
  3549. /**
  3550. * The base implementation of `_.at` without support for individual paths.
  3551. *
  3552. * @private
  3553. * @param {Object} object The object to iterate over.
  3554. * @param {string[]} paths The property paths to pick.
  3555. * @returns {Array} Returns the picked elements.
  3556. */
  3557. function baseAt(object, paths) {
  3558. var index = -1,
  3559. length = paths.length,
  3560. result = Array(length),
  3561. skip = object == null;
  3562. while (++index < length) {
  3563. result[index] = skip ? undefined : get(object, paths[index]);
  3564. }
  3565. return result;
  3566. }
  3567. /**
  3568. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3569. *
  3570. * @private
  3571. * @param {number} number The number to clamp.
  3572. * @param {number} [lower] The lower bound.
  3573. * @param {number} upper The upper bound.
  3574. * @returns {number} Returns the clamped number.
  3575. */
  3576. function baseClamp(number, lower, upper) {
  3577. if (number === number) {
  3578. if (upper !== undefined) {
  3579. number = number <= upper ? number : upper;
  3580. }
  3581. if (lower !== undefined) {
  3582. number = number >= lower ? number : lower;
  3583. }
  3584. }
  3585. return number;
  3586. }
  3587. /**
  3588. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3589. * traversed objects.
  3590. *
  3591. * @private
  3592. * @param {*} value The value to clone.
  3593. * @param {boolean} bitmask The bitmask flags.
  3594. * 1 - Deep clone
  3595. * 2 - Flatten inherited properties
  3596. * 4 - Clone symbols
  3597. * @param {Function} [customizer] The function to customize cloning.
  3598. * @param {string} [key] The key of `value`.
  3599. * @param {Object} [object] The parent object of `value`.
  3600. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3601. * @returns {*} Returns the cloned value.
  3602. */
  3603. function baseClone(value, bitmask, customizer, key, object, stack) {
  3604. var result,
  3605. isDeep = bitmask & CLONE_DEEP_FLAG,
  3606. isFlat = bitmask & CLONE_FLAT_FLAG,
  3607. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3608. if (customizer) {
  3609. result = object ? customizer(value, key, object, stack) : customizer(value);
  3610. }
  3611. if (result !== undefined) {
  3612. return result;
  3613. }
  3614. if (!isObject(value)) {
  3615. return value;
  3616. }
  3617. var isArr = isArray(value);
  3618. if (isArr) {
  3619. result = initCloneArray(value);
  3620. if (!isDeep) {
  3621. return copyArray(value, result);
  3622. }
  3623. } else {
  3624. var tag = getTag(value),
  3625. isFunc = tag == funcTag || tag == genTag;
  3626. if (isBuffer(value)) {
  3627. return cloneBuffer(value, isDeep);
  3628. }
  3629. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3630. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3631. if (!isDeep) {
  3632. return isFlat
  3633. ? copySymbolsIn(value, baseAssignIn(result, value))
  3634. : copySymbols(value, baseAssign(result, value));
  3635. }
  3636. } else {
  3637. if (!cloneableTags[tag]) {
  3638. return object ? value : {};
  3639. }
  3640. result = initCloneByTag(value, tag, isDeep);
  3641. }
  3642. }
  3643. // Check for circular references and return its corresponding clone.
  3644. stack || (stack = new Stack);
  3645. var stacked = stack.get(value);
  3646. if (stacked) {
  3647. return stacked;
  3648. }
  3649. stack.set(value, result);
  3650. if (isSet(value)) {
  3651. value.forEach(function(subValue) {
  3652. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3653. });
  3654. } else if (isMap(value)) {
  3655. value.forEach(function(subValue, key) {
  3656. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3657. });
  3658. }
  3659. var keysFunc = isFull
  3660. ? (isFlat ? getAllKeysIn : getAllKeys)
  3661. : (isFlat ? keysIn : keys);
  3662. var props = isArr ? undefined : keysFunc(value);
  3663. arrayEach(props || value, function(subValue, key) {
  3664. if (props) {
  3665. key = subValue;
  3666. subValue = value[key];
  3667. }
  3668. // Recursively populate clone (susceptible to call stack limits).
  3669. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3670. });
  3671. return result;
  3672. }
  3673. /**
  3674. * The base implementation of `_.conforms` which doesn't clone `source`.
  3675. *
  3676. * @private
  3677. * @param {Object} source The object of property predicates to conform to.
  3678. * @returns {Function} Returns the new spec function.
  3679. */
  3680. function baseConforms(source) {
  3681. var props = keys(source);
  3682. return function(object) {
  3683. return baseConformsTo(object, source, props);
  3684. };
  3685. }
  3686. /**
  3687. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3688. *
  3689. * @private
  3690. * @param {Object} object The object to inspect.
  3691. * @param {Object} source The object of property predicates to conform to.
  3692. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3693. */
  3694. function baseConformsTo(object, source, props) {
  3695. var length = props.length;
  3696. if (object == null) {
  3697. return !length;
  3698. }
  3699. object = Object(object);
  3700. while (length--) {
  3701. var key = props[length],
  3702. predicate = source[key],
  3703. value = object[key];
  3704. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3705. return false;
  3706. }
  3707. }
  3708. return true;
  3709. }
  3710. /**
  3711. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3712. * to provide to `func`.
  3713. *
  3714. * @private
  3715. * @param {Function} func The function to delay.
  3716. * @param {number} wait The number of milliseconds to delay invocation.
  3717. * @param {Array} args The arguments to provide to `func`.
  3718. * @returns {number|Object} Returns the timer id or timeout object.
  3719. */
  3720. function baseDelay(func, wait, args) {
  3721. if (typeof func != 'function') {
  3722. throw new TypeError(FUNC_ERROR_TEXT);
  3723. }
  3724. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3725. }
  3726. /**
  3727. * The base implementation of methods like `_.difference` without support
  3728. * for excluding multiple arrays or iteratee shorthands.
  3729. *
  3730. * @private
  3731. * @param {Array} array The array to inspect.
  3732. * @param {Array} values The values to exclude.
  3733. * @param {Function} [iteratee] The iteratee invoked per element.
  3734. * @param {Function} [comparator] The comparator invoked per element.
  3735. * @returns {Array} Returns the new array of filtered values.
  3736. */
  3737. function baseDifference(array, values, iteratee, comparator) {
  3738. var index = -1,
  3739. includes = arrayIncludes,
  3740. isCommon = true,
  3741. length = array.length,
  3742. result = [],
  3743. valuesLength = values.length;
  3744. if (!length) {
  3745. return result;
  3746. }
  3747. if (iteratee) {
  3748. values = arrayMap(values, baseUnary(iteratee));
  3749. }
  3750. if (comparator) {
  3751. includes = arrayIncludesWith;
  3752. isCommon = false;
  3753. }
  3754. else if (values.length >= LARGE_ARRAY_SIZE) {
  3755. includes = cacheHas;
  3756. isCommon = false;
  3757. values = new SetCache(values);
  3758. }
  3759. outer:
  3760. while (++index < length) {
  3761. var value = array[index],
  3762. computed = iteratee == null ? value : iteratee(value);
  3763. value = (comparator || value !== 0) ? value : 0;
  3764. if (isCommon && computed === computed) {
  3765. var valuesIndex = valuesLength;
  3766. while (valuesIndex--) {
  3767. if (values[valuesIndex] === computed) {
  3768. continue outer;
  3769. }
  3770. }
  3771. result.push(value);
  3772. }
  3773. else if (!includes(values, computed, comparator)) {
  3774. result.push(value);
  3775. }
  3776. }
  3777. return result;
  3778. }
  3779. /**
  3780. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3781. *
  3782. * @private
  3783. * @param {Array|Object} collection The collection to iterate over.
  3784. * @param {Function} iteratee The function invoked per iteration.
  3785. * @returns {Array|Object} Returns `collection`.
  3786. */
  3787. var baseEach = createBaseEach(baseForOwn);
  3788. /**
  3789. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3790. *
  3791. * @private
  3792. * @param {Array|Object} collection The collection to iterate over.
  3793. * @param {Function} iteratee The function invoked per iteration.
  3794. * @returns {Array|Object} Returns `collection`.
  3795. */
  3796. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3797. /**
  3798. * The base implementation of `_.every` without support for iteratee shorthands.
  3799. *
  3800. * @private
  3801. * @param {Array|Object} collection The collection to iterate over.
  3802. * @param {Function} predicate The function invoked per iteration.
  3803. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3804. * else `false`
  3805. */
  3806. function baseEvery(collection, predicate) {
  3807. var result = true;
  3808. baseEach(collection, function(value, index, collection) {
  3809. result = !!predicate(value, index, collection);
  3810. return result;
  3811. });
  3812. return result;
  3813. }
  3814. /**
  3815. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3816. * `comparator` to determine the extremum value.
  3817. *
  3818. * @private
  3819. * @param {Array} array The array to iterate over.
  3820. * @param {Function} iteratee The iteratee invoked per iteration.
  3821. * @param {Function} comparator The comparator used to compare values.
  3822. * @returns {*} Returns the extremum value.
  3823. */
  3824. function baseExtremum(array, iteratee, comparator) {
  3825. var index = -1,
  3826. length = array.length;
  3827. while (++index < length) {
  3828. var value = array[index],
  3829. current = iteratee(value);
  3830. if (current != null && (computed === undefined
  3831. ? (current === current && !isSymbol(current))
  3832. : comparator(current, computed)
  3833. )) {
  3834. var computed = current,
  3835. result = value;
  3836. }
  3837. }
  3838. return result;
  3839. }
  3840. /**
  3841. * The base implementation of `_.fill` without an iteratee call guard.
  3842. *
  3843. * @private
  3844. * @param {Array} array The array to fill.
  3845. * @param {*} value The value to fill `array` with.
  3846. * @param {number} [start=0] The start position.
  3847. * @param {number} [end=array.length] The end position.
  3848. * @returns {Array} Returns `array`.
  3849. */
  3850. function baseFill(array, value, start, end) {
  3851. var length = array.length;
  3852. start = toInteger(start);
  3853. if (start < 0) {
  3854. start = -start > length ? 0 : (length + start);
  3855. }
  3856. end = (end === undefined || end > length) ? length : toInteger(end);
  3857. if (end < 0) {
  3858. end += length;
  3859. }
  3860. end = start > end ? 0 : toLength(end);
  3861. while (start < end) {
  3862. array[start++] = value;
  3863. }
  3864. return array;
  3865. }
  3866. /**
  3867. * The base implementation of `_.filter` without support for iteratee shorthands.
  3868. *
  3869. * @private
  3870. * @param {Array|Object} collection The collection to iterate over.
  3871. * @param {Function} predicate The function invoked per iteration.
  3872. * @returns {Array} Returns the new filtered array.
  3873. */
  3874. function baseFilter(collection, predicate) {
  3875. var result = [];
  3876. baseEach(collection, function(value, index, collection) {
  3877. if (predicate(value, index, collection)) {
  3878. result.push(value);
  3879. }
  3880. });
  3881. return result;
  3882. }
  3883. /**
  3884. * The base implementation of `_.flatten` with support for restricting flattening.
  3885. *
  3886. * @private
  3887. * @param {Array} array The array to flatten.
  3888. * @param {number} depth The maximum recursion depth.
  3889. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3890. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3891. * @param {Array} [result=[]] The initial result value.
  3892. * @returns {Array} Returns the new flattened array.
  3893. */
  3894. function baseFlatten(array, depth, predicate, isStrict, result) {
  3895. var index = -1,
  3896. length = array.length;
  3897. predicate || (predicate = isFlattenable);
  3898. result || (result = []);
  3899. while (++index < length) {
  3900. var value = array[index];
  3901. if (depth > 0 && predicate(value)) {
  3902. if (depth > 1) {
  3903. // Recursively flatten arrays (susceptible to call stack limits).
  3904. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3905. } else {
  3906. arrayPush(result, value);
  3907. }
  3908. } else if (!isStrict) {
  3909. result[result.length] = value;
  3910. }
  3911. }
  3912. return result;
  3913. }
  3914. /**
  3915. * The base implementation of `baseForOwn` which iterates over `object`
  3916. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3917. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3918. *
  3919. * @private
  3920. * @param {Object} object The object to iterate over.
  3921. * @param {Function} iteratee The function invoked per iteration.
  3922. * @param {Function} keysFunc The function to get the keys of `object`.
  3923. * @returns {Object} Returns `object`.
  3924. */
  3925. var baseFor = createBaseFor();
  3926. /**
  3927. * This function is like `baseFor` except that it iterates over properties
  3928. * in the opposite order.
  3929. *
  3930. * @private
  3931. * @param {Object} object The object to iterate over.
  3932. * @param {Function} iteratee The function invoked per iteration.
  3933. * @param {Function} keysFunc The function to get the keys of `object`.
  3934. * @returns {Object} Returns `object`.
  3935. */
  3936. var baseForRight = createBaseFor(true);
  3937. /**
  3938. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3939. *
  3940. * @private
  3941. * @param {Object} object The object to iterate over.
  3942. * @param {Function} iteratee The function invoked per iteration.
  3943. * @returns {Object} Returns `object`.
  3944. */
  3945. function baseForOwn(object, iteratee) {
  3946. return object && baseFor(object, iteratee, keys);
  3947. }
  3948. /**
  3949. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3950. *
  3951. * @private
  3952. * @param {Object} object The object to iterate over.
  3953. * @param {Function} iteratee The function invoked per iteration.
  3954. * @returns {Object} Returns `object`.
  3955. */
  3956. function baseForOwnRight(object, iteratee) {
  3957. return object && baseForRight(object, iteratee, keys);
  3958. }
  3959. /**
  3960. * The base implementation of `_.functions` which creates an array of
  3961. * `object` function property names filtered from `props`.
  3962. *
  3963. * @private
  3964. * @param {Object} object The object to inspect.
  3965. * @param {Array} props The property names to filter.
  3966. * @returns {Array} Returns the function names.
  3967. */
  3968. function baseFunctions(object, props) {
  3969. return arrayFilter(props, function(key) {
  3970. return isFunction(object[key]);
  3971. });
  3972. }
  3973. /**
  3974. * The base implementation of `_.get` without support for default values.
  3975. *
  3976. * @private
  3977. * @param {Object} object The object to query.
  3978. * @param {Array|string} path The path of the property to get.
  3979. * @returns {*} Returns the resolved value.
  3980. */
  3981. function baseGet(object, path) {
  3982. path = castPath(path, object);
  3983. var index = 0,
  3984. length = path.length;
  3985. while (object != null && index < length) {
  3986. object = object[toKey(path[index++])];
  3987. }
  3988. return (index && index == length) ? object : undefined;
  3989. }
  3990. /**
  3991. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3992. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3993. * symbols of `object`.
  3994. *
  3995. * @private
  3996. * @param {Object} object The object to query.
  3997. * @param {Function} keysFunc The function to get the keys of `object`.
  3998. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3999. * @returns {Array} Returns the array of property names and symbols.
  4000. */
  4001. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4002. var result = keysFunc(object);
  4003. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4004. }
  4005. /**
  4006. * The base implementation of `getTag` without fallbacks for buggy environments.
  4007. *
  4008. * @private
  4009. * @param {*} value The value to query.
  4010. * @returns {string} Returns the `toStringTag`.
  4011. */
  4012. function baseGetTag(value) {
  4013. if (value == null) {
  4014. return value === undefined ? undefinedTag : nullTag;
  4015. }
  4016. return (symToStringTag && symToStringTag in Object(value))
  4017. ? getRawTag(value)
  4018. : objectToString(value);
  4019. }
  4020. /**
  4021. * The base implementation of `_.gt` which doesn't coerce arguments.
  4022. *
  4023. * @private
  4024. * @param {*} value The value to compare.
  4025. * @param {*} other The other value to compare.
  4026. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4027. * else `false`.
  4028. */
  4029. function baseGt(value, other) {
  4030. return value > other;
  4031. }
  4032. /**
  4033. * The base implementation of `_.has` without support for deep paths.
  4034. *
  4035. * @private
  4036. * @param {Object} [object] The object to query.
  4037. * @param {Array|string} key The key to check.
  4038. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4039. */
  4040. function baseHas(object, key) {
  4041. return object != null && hasOwnProperty.call(object, key);
  4042. }
  4043. /**
  4044. * The base implementation of `_.hasIn` without support for deep paths.
  4045. *
  4046. * @private
  4047. * @param {Object} [object] The object to query.
  4048. * @param {Array|string} key The key to check.
  4049. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4050. */
  4051. function baseHasIn(object, key) {
  4052. return object != null && key in Object(object);
  4053. }
  4054. /**
  4055. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4056. *
  4057. * @private
  4058. * @param {number} number The number to check.
  4059. * @param {number} start The start of the range.
  4060. * @param {number} end The end of the range.
  4061. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4062. */
  4063. function baseInRange(number, start, end) {
  4064. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4065. }
  4066. /**
  4067. * The base implementation of methods like `_.intersection`, without support
  4068. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4069. *
  4070. * @private
  4071. * @param {Array} arrays The arrays to inspect.
  4072. * @param {Function} [iteratee] The iteratee invoked per element.
  4073. * @param {Function} [comparator] The comparator invoked per element.
  4074. * @returns {Array} Returns the new array of shared values.
  4075. */
  4076. function baseIntersection(arrays, iteratee, comparator) {
  4077. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4078. length = arrays[0].length,
  4079. othLength = arrays.length,
  4080. othIndex = othLength,
  4081. caches = Array(othLength),
  4082. maxLength = Infinity,
  4083. result = [];
  4084. while (othIndex--) {
  4085. var array = arrays[othIndex];
  4086. if (othIndex && iteratee) {
  4087. array = arrayMap(array, baseUnary(iteratee));
  4088. }
  4089. maxLength = nativeMin(array.length, maxLength);
  4090. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4091. ? new SetCache(othIndex && array)
  4092. : undefined;
  4093. }
  4094. array = arrays[0];
  4095. var index = -1,
  4096. seen = caches[0];
  4097. outer:
  4098. while (++index < length && result.length < maxLength) {
  4099. var value = array[index],
  4100. computed = iteratee ? iteratee(value) : value;
  4101. value = (comparator || value !== 0) ? value : 0;
  4102. if (!(seen
  4103. ? cacheHas(seen, computed)
  4104. : includes(result, computed, comparator)
  4105. )) {
  4106. othIndex = othLength;
  4107. while (--othIndex) {
  4108. var cache = caches[othIndex];
  4109. if (!(cache
  4110. ? cacheHas(cache, computed)
  4111. : includes(arrays[othIndex], computed, comparator))
  4112. ) {
  4113. continue outer;
  4114. }
  4115. }
  4116. if (seen) {
  4117. seen.push(computed);
  4118. }
  4119. result.push(value);
  4120. }
  4121. }
  4122. return result;
  4123. }
  4124. /**
  4125. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4126. * `object` with values transformed by `iteratee` and set by `setter`.
  4127. *
  4128. * @private
  4129. * @param {Object} object The object to iterate over.
  4130. * @param {Function} setter The function to set `accumulator` values.
  4131. * @param {Function} iteratee The iteratee to transform values.
  4132. * @param {Object} accumulator The initial inverted object.
  4133. * @returns {Function} Returns `accumulator`.
  4134. */
  4135. function baseInverter(object, setter, iteratee, accumulator) {
  4136. baseForOwn(object, function(value, key, object) {
  4137. setter(accumulator, iteratee(value), key, object);
  4138. });
  4139. return accumulator;
  4140. }
  4141. /**
  4142. * The base implementation of `_.invoke` without support for individual
  4143. * method arguments.
  4144. *
  4145. * @private
  4146. * @param {Object} object The object to query.
  4147. * @param {Array|string} path The path of the method to invoke.
  4148. * @param {Array} args The arguments to invoke the method with.
  4149. * @returns {*} Returns the result of the invoked method.
  4150. */
  4151. function baseInvoke(object, path, args) {
  4152. path = castPath(path, object);
  4153. object = parent(object, path);
  4154. var func = object == null ? object : object[toKey(last(path))];
  4155. return func == null ? undefined : apply(func, object, args);
  4156. }
  4157. /**
  4158. * The base implementation of `_.isArguments`.
  4159. *
  4160. * @private
  4161. * @param {*} value The value to check.
  4162. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4163. */
  4164. function baseIsArguments(value) {
  4165. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4166. }
  4167. /**
  4168. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4169. *
  4170. * @private
  4171. * @param {*} value The value to check.
  4172. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4173. */
  4174. function baseIsArrayBuffer(value) {
  4175. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4176. }
  4177. /**
  4178. * The base implementation of `_.isDate` without Node.js optimizations.
  4179. *
  4180. * @private
  4181. * @param {*} value The value to check.
  4182. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4183. */
  4184. function baseIsDate(value) {
  4185. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4186. }
  4187. /**
  4188. * The base implementation of `_.isEqual` which supports partial comparisons
  4189. * and tracks traversed objects.
  4190. *
  4191. * @private
  4192. * @param {*} value The value to compare.
  4193. * @param {*} other The other value to compare.
  4194. * @param {boolean} bitmask The bitmask flags.
  4195. * 1 - Unordered comparison
  4196. * 2 - Partial comparison
  4197. * @param {Function} [customizer] The function to customize comparisons.
  4198. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4199. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4200. */
  4201. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4202. if (value === other) {
  4203. return true;
  4204. }
  4205. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4206. return value !== value && other !== other;
  4207. }
  4208. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4209. }
  4210. /**
  4211. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4212. * deep comparisons and tracks traversed objects enabling objects with circular
  4213. * references to be compared.
  4214. *
  4215. * @private
  4216. * @param {Object} object The object to compare.
  4217. * @param {Object} other The other object to compare.
  4218. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4219. * @param {Function} customizer The function to customize comparisons.
  4220. * @param {Function} equalFunc The function to determine equivalents of values.
  4221. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4222. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4223. */
  4224. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4225. var objIsArr = isArray(object),
  4226. othIsArr = isArray(other),
  4227. objTag = objIsArr ? arrayTag : getTag(object),
  4228. othTag = othIsArr ? arrayTag : getTag(other);
  4229. objTag = objTag == argsTag ? objectTag : objTag;
  4230. othTag = othTag == argsTag ? objectTag : othTag;
  4231. var objIsObj = objTag == objectTag,
  4232. othIsObj = othTag == objectTag,
  4233. isSameTag = objTag == othTag;
  4234. if (isSameTag && isBuffer(object)) {
  4235. if (!isBuffer(other)) {
  4236. return false;
  4237. }
  4238. objIsArr = true;
  4239. objIsObj = false;
  4240. }
  4241. if (isSameTag && !objIsObj) {
  4242. stack || (stack = new Stack);
  4243. return (objIsArr || isTypedArray(object))
  4244. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4245. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4246. }
  4247. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4248. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4249. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4250. if (objIsWrapped || othIsWrapped) {
  4251. var objUnwrapped = objIsWrapped ? object.value() : object,
  4252. othUnwrapped = othIsWrapped ? other.value() : other;
  4253. stack || (stack = new Stack);
  4254. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4255. }
  4256. }
  4257. if (!isSameTag) {
  4258. return false;
  4259. }
  4260. stack || (stack = new Stack);
  4261. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4262. }
  4263. /**
  4264. * The base implementation of `_.isMap` without Node.js optimizations.
  4265. *
  4266. * @private
  4267. * @param {*} value The value to check.
  4268. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4269. */
  4270. function baseIsMap(value) {
  4271. return isObjectLike(value) && getTag(value) == mapTag;
  4272. }
  4273. /**
  4274. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4275. *
  4276. * @private
  4277. * @param {Object} object The object to inspect.
  4278. * @param {Object} source The object of property values to match.
  4279. * @param {Array} matchData The property names, values, and compare flags to match.
  4280. * @param {Function} [customizer] The function to customize comparisons.
  4281. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4282. */
  4283. function baseIsMatch(object, source, matchData, customizer) {
  4284. var index = matchData.length,
  4285. length = index,
  4286. noCustomizer = !customizer;
  4287. if (object == null) {
  4288. return !length;
  4289. }
  4290. object = Object(object);
  4291. while (index--) {
  4292. var data = matchData[index];
  4293. if ((noCustomizer && data[2])
  4294. ? data[1] !== object[data[0]]
  4295. : !(data[0] in object)
  4296. ) {
  4297. return false;
  4298. }
  4299. }
  4300. while (++index < length) {
  4301. data = matchData[index];
  4302. var key = data[0],
  4303. objValue = object[key],
  4304. srcValue = data[1];
  4305. if (noCustomizer && data[2]) {
  4306. if (objValue === undefined && !(key in object)) {
  4307. return false;
  4308. }
  4309. } else {
  4310. var stack = new Stack;
  4311. if (customizer) {
  4312. var result = customizer(objValue, srcValue, key, object, source, stack);
  4313. }
  4314. if (!(result === undefined
  4315. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4316. : result
  4317. )) {
  4318. return false;
  4319. }
  4320. }
  4321. }
  4322. return true;
  4323. }
  4324. /**
  4325. * The base implementation of `_.isNative` without bad shim checks.
  4326. *
  4327. * @private
  4328. * @param {*} value The value to check.
  4329. * @returns {boolean} Returns `true` if `value` is a native function,
  4330. * else `false`.
  4331. */
  4332. function baseIsNative(value) {
  4333. if (!isObject(value) || isMasked(value)) {
  4334. return false;
  4335. }
  4336. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4337. return pattern.test(toSource(value));
  4338. }
  4339. /**
  4340. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4341. *
  4342. * @private
  4343. * @param {*} value The value to check.
  4344. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4345. */
  4346. function baseIsRegExp(value) {
  4347. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4348. }
  4349. /**
  4350. * The base implementation of `_.isSet` without Node.js optimizations.
  4351. *
  4352. * @private
  4353. * @param {*} value The value to check.
  4354. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4355. */
  4356. function baseIsSet(value) {
  4357. return isObjectLike(value) && getTag(value) == setTag;
  4358. }
  4359. /**
  4360. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4361. *
  4362. * @private
  4363. * @param {*} value The value to check.
  4364. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4365. */
  4366. function baseIsTypedArray(value) {
  4367. return isObjectLike(value) &&
  4368. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4369. }
  4370. /**
  4371. * The base implementation of `_.iteratee`.
  4372. *
  4373. * @private
  4374. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4375. * @returns {Function} Returns the iteratee.
  4376. */
  4377. function baseIteratee(value) {
  4378. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4379. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4380. if (typeof value == 'function') {
  4381. return value;
  4382. }
  4383. if (value == null) {
  4384. return identity;
  4385. }
  4386. if (typeof value == 'object') {
  4387. return isArray(value)
  4388. ? baseMatchesProperty(value[0], value[1])
  4389. : baseMatches(value);
  4390. }
  4391. return property(value);
  4392. }
  4393. /**
  4394. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4395. *
  4396. * @private
  4397. * @param {Object} object The object to query.
  4398. * @returns {Array} Returns the array of property names.
  4399. */
  4400. function baseKeys(object) {
  4401. if (!isPrototype(object)) {
  4402. return nativeKeys(object);
  4403. }
  4404. var result = [];
  4405. for (var key in Object(object)) {
  4406. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4407. result.push(key);
  4408. }
  4409. }
  4410. return result;
  4411. }
  4412. /**
  4413. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4414. *
  4415. * @private
  4416. * @param {Object} object The object to query.
  4417. * @returns {Array} Returns the array of property names.
  4418. */
  4419. function baseKeysIn(object) {
  4420. if (!isObject(object)) {
  4421. return nativeKeysIn(object);
  4422. }
  4423. var isProto = isPrototype(object),
  4424. result = [];
  4425. for (var key in object) {
  4426. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4427. result.push(key);
  4428. }
  4429. }
  4430. return result;
  4431. }
  4432. /**
  4433. * The base implementation of `_.lt` which doesn't coerce arguments.
  4434. *
  4435. * @private
  4436. * @param {*} value The value to compare.
  4437. * @param {*} other The other value to compare.
  4438. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4439. * else `false`.
  4440. */
  4441. function baseLt(value, other) {
  4442. return value < other;
  4443. }
  4444. /**
  4445. * The base implementation of `_.map` without support for iteratee shorthands.
  4446. *
  4447. * @private
  4448. * @param {Array|Object} collection The collection to iterate over.
  4449. * @param {Function} iteratee The function invoked per iteration.
  4450. * @returns {Array} Returns the new mapped array.
  4451. */
  4452. function baseMap(collection, iteratee) {
  4453. var index = -1,
  4454. result = isArrayLike(collection) ? Array(collection.length) : [];
  4455. baseEach(collection, function(value, key, collection) {
  4456. result[++index] = iteratee(value, key, collection);
  4457. });
  4458. return result;
  4459. }
  4460. /**
  4461. * The base implementation of `_.matches` which doesn't clone `source`.
  4462. *
  4463. * @private
  4464. * @param {Object} source The object of property values to match.
  4465. * @returns {Function} Returns the new spec function.
  4466. */
  4467. function baseMatches(source) {
  4468. var matchData = getMatchData(source);
  4469. if (matchData.length == 1 && matchData[0][2]) {
  4470. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4471. }
  4472. return function(object) {
  4473. return object === source || baseIsMatch(object, source, matchData);
  4474. };
  4475. }
  4476. /**
  4477. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4478. *
  4479. * @private
  4480. * @param {string} path The path of the property to get.
  4481. * @param {*} srcValue The value to match.
  4482. * @returns {Function} Returns the new spec function.
  4483. */
  4484. function baseMatchesProperty(path, srcValue) {
  4485. if (isKey(path) && isStrictComparable(srcValue)) {
  4486. return matchesStrictComparable(toKey(path), srcValue);
  4487. }
  4488. return function(object) {
  4489. var objValue = get(object, path);
  4490. return (objValue === undefined && objValue === srcValue)
  4491. ? hasIn(object, path)
  4492. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4493. };
  4494. }
  4495. /**
  4496. * The base implementation of `_.merge` without support for multiple sources.
  4497. *
  4498. * @private
  4499. * @param {Object} object The destination object.
  4500. * @param {Object} source The source object.
  4501. * @param {number} srcIndex The index of `source`.
  4502. * @param {Function} [customizer] The function to customize merged values.
  4503. * @param {Object} [stack] Tracks traversed source values and their merged
  4504. * counterparts.
  4505. */
  4506. function baseMerge(object, source, srcIndex, customizer, stack) {
  4507. if (object === source) {
  4508. return;
  4509. }
  4510. baseFor(source, function(srcValue, key) {
  4511. stack || (stack = new Stack);
  4512. if (isObject(srcValue)) {
  4513. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4514. }
  4515. else {
  4516. var newValue = customizer
  4517. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4518. : undefined;
  4519. if (newValue === undefined) {
  4520. newValue = srcValue;
  4521. }
  4522. assignMergeValue(object, key, newValue);
  4523. }
  4524. }, keysIn);
  4525. }
  4526. /**
  4527. * A specialized version of `baseMerge` for arrays and objects which performs
  4528. * deep merges and tracks traversed objects enabling objects with circular
  4529. * references to be merged.
  4530. *
  4531. * @private
  4532. * @param {Object} object The destination object.
  4533. * @param {Object} source The source object.
  4534. * @param {string} key The key of the value to merge.
  4535. * @param {number} srcIndex The index of `source`.
  4536. * @param {Function} mergeFunc The function to merge values.
  4537. * @param {Function} [customizer] The function to customize assigned values.
  4538. * @param {Object} [stack] Tracks traversed source values and their merged
  4539. * counterparts.
  4540. */
  4541. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4542. var objValue = safeGet(object, key),
  4543. srcValue = safeGet(source, key),
  4544. stacked = stack.get(srcValue);
  4545. if (stacked) {
  4546. assignMergeValue(object, key, stacked);
  4547. return;
  4548. }
  4549. var newValue = customizer
  4550. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4551. : undefined;
  4552. var isCommon = newValue === undefined;
  4553. if (isCommon) {
  4554. var isArr = isArray(srcValue),
  4555. isBuff = !isArr && isBuffer(srcValue),
  4556. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4557. newValue = srcValue;
  4558. if (isArr || isBuff || isTyped) {
  4559. if (isArray(objValue)) {
  4560. newValue = objValue;
  4561. }
  4562. else if (isArrayLikeObject(objValue)) {
  4563. newValue = copyArray(objValue);
  4564. }
  4565. else if (isBuff) {
  4566. isCommon = false;
  4567. newValue = cloneBuffer(srcValue, true);
  4568. }
  4569. else if (isTyped) {
  4570. isCommon = false;
  4571. newValue = cloneTypedArray(srcValue, true);
  4572. }
  4573. else {
  4574. newValue = [];
  4575. }
  4576. }
  4577. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4578. newValue = objValue;
  4579. if (isArguments(objValue)) {
  4580. newValue = toPlainObject(objValue);
  4581. }
  4582. else if (!isObject(objValue) || isFunction(objValue)) {
  4583. newValue = initCloneObject(srcValue);
  4584. }
  4585. }
  4586. else {
  4587. isCommon = false;
  4588. }
  4589. }
  4590. if (isCommon) {
  4591. // Recursively merge objects and arrays (susceptible to call stack limits).
  4592. stack.set(srcValue, newValue);
  4593. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4594. stack['delete'](srcValue);
  4595. }
  4596. assignMergeValue(object, key, newValue);
  4597. }
  4598. /**
  4599. * The base implementation of `_.nth` which doesn't coerce arguments.
  4600. *
  4601. * @private
  4602. * @param {Array} array The array to query.
  4603. * @param {number} n The index of the element to return.
  4604. * @returns {*} Returns the nth element of `array`.
  4605. */
  4606. function baseNth(array, n) {
  4607. var length = array.length;
  4608. if (!length) {
  4609. return;
  4610. }
  4611. n += n < 0 ? length : 0;
  4612. return isIndex(n, length) ? array[n] : undefined;
  4613. }
  4614. /**
  4615. * The base implementation of `_.orderBy` without param guards.
  4616. *
  4617. * @private
  4618. * @param {Array|Object} collection The collection to iterate over.
  4619. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4620. * @param {string[]} orders The sort orders of `iteratees`.
  4621. * @returns {Array} Returns the new sorted array.
  4622. */
  4623. function baseOrderBy(collection, iteratees, orders) {
  4624. if (iteratees.length) {
  4625. iteratees = arrayMap(iteratees, function(iteratee) {
  4626. if (isArray(iteratee)) {
  4627. return function(value) {
  4628. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4629. }
  4630. }
  4631. return iteratee;
  4632. });
  4633. } else {
  4634. iteratees = [identity];
  4635. }
  4636. var index = -1;
  4637. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4638. var result = baseMap(collection, function(value, key, collection) {
  4639. var criteria = arrayMap(iteratees, function(iteratee) {
  4640. return iteratee(value);
  4641. });
  4642. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4643. });
  4644. return baseSortBy(result, function(object, other) {
  4645. return compareMultiple(object, other, orders);
  4646. });
  4647. }
  4648. /**
  4649. * The base implementation of `_.pick` without support for individual
  4650. * property identifiers.
  4651. *
  4652. * @private
  4653. * @param {Object} object The source object.
  4654. * @param {string[]} paths The property paths to pick.
  4655. * @returns {Object} Returns the new object.
  4656. */
  4657. function basePick(object, paths) {
  4658. return basePickBy(object, paths, function(value, path) {
  4659. return hasIn(object, path);
  4660. });
  4661. }
  4662. /**
  4663. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4664. *
  4665. * @private
  4666. * @param {Object} object The source object.
  4667. * @param {string[]} paths The property paths to pick.
  4668. * @param {Function} predicate The function invoked per property.
  4669. * @returns {Object} Returns the new object.
  4670. */
  4671. function basePickBy(object, paths, predicate) {
  4672. var index = -1,
  4673. length = paths.length,
  4674. result = {};
  4675. while (++index < length) {
  4676. var path = paths[index],
  4677. value = baseGet(object, path);
  4678. if (predicate(value, path)) {
  4679. baseSet(result, castPath(path, object), value);
  4680. }
  4681. }
  4682. return result;
  4683. }
  4684. /**
  4685. * A specialized version of `baseProperty` which supports deep paths.
  4686. *
  4687. * @private
  4688. * @param {Array|string} path The path of the property to get.
  4689. * @returns {Function} Returns the new accessor function.
  4690. */
  4691. function basePropertyDeep(path) {
  4692. return function(object) {
  4693. return baseGet(object, path);
  4694. };
  4695. }
  4696. /**
  4697. * The base implementation of `_.pullAllBy` without support for iteratee
  4698. * shorthands.
  4699. *
  4700. * @private
  4701. * @param {Array} array The array to modify.
  4702. * @param {Array} values The values to remove.
  4703. * @param {Function} [iteratee] The iteratee invoked per element.
  4704. * @param {Function} [comparator] The comparator invoked per element.
  4705. * @returns {Array} Returns `array`.
  4706. */
  4707. function basePullAll(array, values, iteratee, comparator) {
  4708. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4709. index = -1,
  4710. length = values.length,
  4711. seen = array;
  4712. if (array === values) {
  4713. values = copyArray(values);
  4714. }
  4715. if (iteratee) {
  4716. seen = arrayMap(array, baseUnary(iteratee));
  4717. }
  4718. while (++index < length) {
  4719. var fromIndex = 0,
  4720. value = values[index],
  4721. computed = iteratee ? iteratee(value) : value;
  4722. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4723. if (seen !== array) {
  4724. splice.call(seen, fromIndex, 1);
  4725. }
  4726. splice.call(array, fromIndex, 1);
  4727. }
  4728. }
  4729. return array;
  4730. }
  4731. /**
  4732. * The base implementation of `_.pullAt` without support for individual
  4733. * indexes or capturing the removed elements.
  4734. *
  4735. * @private
  4736. * @param {Array} array The array to modify.
  4737. * @param {number[]} indexes The indexes of elements to remove.
  4738. * @returns {Array} Returns `array`.
  4739. */
  4740. function basePullAt(array, indexes) {
  4741. var length = array ? indexes.length : 0,
  4742. lastIndex = length - 1;
  4743. while (length--) {
  4744. var index = indexes[length];
  4745. if (length == lastIndex || index !== previous) {
  4746. var previous = index;
  4747. if (isIndex(index)) {
  4748. splice.call(array, index, 1);
  4749. } else {
  4750. baseUnset(array, index);
  4751. }
  4752. }
  4753. }
  4754. return array;
  4755. }
  4756. /**
  4757. * The base implementation of `_.random` without support for returning
  4758. * floating-point numbers.
  4759. *
  4760. * @private
  4761. * @param {number} lower The lower bound.
  4762. * @param {number} upper The upper bound.
  4763. * @returns {number} Returns the random number.
  4764. */
  4765. function baseRandom(lower, upper) {
  4766. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4767. }
  4768. /**
  4769. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4770. * coerce arguments.
  4771. *
  4772. * @private
  4773. * @param {number} start The start of the range.
  4774. * @param {number} end The end of the range.
  4775. * @param {number} step The value to increment or decrement by.
  4776. * @param {boolean} [fromRight] Specify iterating from right to left.
  4777. * @returns {Array} Returns the range of numbers.
  4778. */
  4779. function baseRange(start, end, step, fromRight) {
  4780. var index = -1,
  4781. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4782. result = Array(length);
  4783. while (length--) {
  4784. result[fromRight ? length : ++index] = start;
  4785. start += step;
  4786. }
  4787. return result;
  4788. }
  4789. /**
  4790. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4791. *
  4792. * @private
  4793. * @param {string} string The string to repeat.
  4794. * @param {number} n The number of times to repeat the string.
  4795. * @returns {string} Returns the repeated string.
  4796. */
  4797. function baseRepeat(string, n) {
  4798. var result = '';
  4799. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4800. return result;
  4801. }
  4802. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4803. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4804. do {
  4805. if (n % 2) {
  4806. result += string;
  4807. }
  4808. n = nativeFloor(n / 2);
  4809. if (n) {
  4810. string += string;
  4811. }
  4812. } while (n);
  4813. return result;
  4814. }
  4815. /**
  4816. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4817. *
  4818. * @private
  4819. * @param {Function} func The function to apply a rest parameter to.
  4820. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4821. * @returns {Function} Returns the new function.
  4822. */
  4823. function baseRest(func, start) {
  4824. return setToString(overRest(func, start, identity), func + '');
  4825. }
  4826. /**
  4827. * The base implementation of `_.sample`.
  4828. *
  4829. * @private
  4830. * @param {Array|Object} collection The collection to sample.
  4831. * @returns {*} Returns the random element.
  4832. */
  4833. function baseSample(collection) {
  4834. return arraySample(values(collection));
  4835. }
  4836. /**
  4837. * The base implementation of `_.sampleSize` without param guards.
  4838. *
  4839. * @private
  4840. * @param {Array|Object} collection The collection to sample.
  4841. * @param {number} n The number of elements to sample.
  4842. * @returns {Array} Returns the random elements.
  4843. */
  4844. function baseSampleSize(collection, n) {
  4845. var array = values(collection);
  4846. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4847. }
  4848. /**
  4849. * The base implementation of `_.set`.
  4850. *
  4851. * @private
  4852. * @param {Object} object The object to modify.
  4853. * @param {Array|string} path The path of the property to set.
  4854. * @param {*} value The value to set.
  4855. * @param {Function} [customizer] The function to customize path creation.
  4856. * @returns {Object} Returns `object`.
  4857. */
  4858. function baseSet(object, path, value, customizer) {
  4859. if (!isObject(object)) {
  4860. return object;
  4861. }
  4862. path = castPath(path, object);
  4863. var index = -1,
  4864. length = path.length,
  4865. lastIndex = length - 1,
  4866. nested = object;
  4867. while (nested != null && ++index < length) {
  4868. var key = toKey(path[index]),
  4869. newValue = value;
  4870. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4871. return object;
  4872. }
  4873. if (index != lastIndex) {
  4874. var objValue = nested[key];
  4875. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4876. if (newValue === undefined) {
  4877. newValue = isObject(objValue)
  4878. ? objValue
  4879. : (isIndex(path[index + 1]) ? [] : {});
  4880. }
  4881. }
  4882. assignValue(nested, key, newValue);
  4883. nested = nested[key];
  4884. }
  4885. return object;
  4886. }
  4887. /**
  4888. * The base implementation of `setData` without support for hot loop shorting.
  4889. *
  4890. * @private
  4891. * @param {Function} func The function to associate metadata with.
  4892. * @param {*} data The metadata.
  4893. * @returns {Function} Returns `func`.
  4894. */
  4895. var baseSetData = !metaMap ? identity : function(func, data) {
  4896. metaMap.set(func, data);
  4897. return func;
  4898. };
  4899. /**
  4900. * The base implementation of `setToString` without support for hot loop shorting.
  4901. *
  4902. * @private
  4903. * @param {Function} func The function to modify.
  4904. * @param {Function} string The `toString` result.
  4905. * @returns {Function} Returns `func`.
  4906. */
  4907. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4908. return defineProperty(func, 'toString', {
  4909. 'configurable': true,
  4910. 'enumerable': false,
  4911. 'value': constant(string),
  4912. 'writable': true
  4913. });
  4914. };
  4915. /**
  4916. * The base implementation of `_.shuffle`.
  4917. *
  4918. * @private
  4919. * @param {Array|Object} collection The collection to shuffle.
  4920. * @returns {Array} Returns the new shuffled array.
  4921. */
  4922. function baseShuffle(collection) {
  4923. return shuffleSelf(values(collection));
  4924. }
  4925. /**
  4926. * The base implementation of `_.slice` without an iteratee call guard.
  4927. *
  4928. * @private
  4929. * @param {Array} array The array to slice.
  4930. * @param {number} [start=0] The start position.
  4931. * @param {number} [end=array.length] The end position.
  4932. * @returns {Array} Returns the slice of `array`.
  4933. */
  4934. function baseSlice(array, start, end) {
  4935. var index = -1,
  4936. length = array.length;
  4937. if (start < 0) {
  4938. start = -start > length ? 0 : (length + start);
  4939. }
  4940. end = end > length ? length : end;
  4941. if (end < 0) {
  4942. end += length;
  4943. }
  4944. length = start > end ? 0 : ((end - start) >>> 0);
  4945. start >>>= 0;
  4946. var result = Array(length);
  4947. while (++index < length) {
  4948. result[index] = array[index + start];
  4949. }
  4950. return result;
  4951. }
  4952. /**
  4953. * The base implementation of `_.some` without support for iteratee shorthands.
  4954. *
  4955. * @private
  4956. * @param {Array|Object} collection The collection to iterate over.
  4957. * @param {Function} predicate The function invoked per iteration.
  4958. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4959. * else `false`.
  4960. */
  4961. function baseSome(collection, predicate) {
  4962. var result;
  4963. baseEach(collection, function(value, index, collection) {
  4964. result = predicate(value, index, collection);
  4965. return !result;
  4966. });
  4967. return !!result;
  4968. }
  4969. /**
  4970. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4971. * performs a binary search of `array` to determine the index at which `value`
  4972. * should be inserted into `array` in order to maintain its sort order.
  4973. *
  4974. * @private
  4975. * @param {Array} array The sorted array to inspect.
  4976. * @param {*} value The value to evaluate.
  4977. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4978. * @returns {number} Returns the index at which `value` should be inserted
  4979. * into `array`.
  4980. */
  4981. function baseSortedIndex(array, value, retHighest) {
  4982. var low = 0,
  4983. high = array == null ? low : array.length;
  4984. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4985. while (low < high) {
  4986. var mid = (low + high) >>> 1,
  4987. computed = array[mid];
  4988. if (computed !== null && !isSymbol(computed) &&
  4989. (retHighest ? (computed <= value) : (computed < value))) {
  4990. low = mid + 1;
  4991. } else {
  4992. high = mid;
  4993. }
  4994. }
  4995. return high;
  4996. }
  4997. return baseSortedIndexBy(array, value, identity, retHighest);
  4998. }
  4999. /**
  5000. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5001. * which invokes `iteratee` for `value` and each element of `array` to compute
  5002. * their sort ranking. The iteratee is invoked with one argument; (value).
  5003. *
  5004. * @private
  5005. * @param {Array} array The sorted array to inspect.
  5006. * @param {*} value The value to evaluate.
  5007. * @param {Function} iteratee The iteratee invoked per element.
  5008. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5009. * @returns {number} Returns the index at which `value` should be inserted
  5010. * into `array`.
  5011. */
  5012. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5013. var low = 0,
  5014. high = array == null ? 0 : array.length;
  5015. if (high === 0) {
  5016. return 0;
  5017. }
  5018. value = iteratee(value);
  5019. var valIsNaN = value !== value,
  5020. valIsNull = value === null,
  5021. valIsSymbol = isSymbol(value),
  5022. valIsUndefined = value === undefined;
  5023. while (low < high) {
  5024. var mid = nativeFloor((low + high) / 2),
  5025. computed = iteratee(array[mid]),
  5026. othIsDefined = computed !== undefined,
  5027. othIsNull = computed === null,
  5028. othIsReflexive = computed === computed,
  5029. othIsSymbol = isSymbol(computed);
  5030. if (valIsNaN) {
  5031. var setLow = retHighest || othIsReflexive;
  5032. } else if (valIsUndefined) {
  5033. setLow = othIsReflexive && (retHighest || othIsDefined);
  5034. } else if (valIsNull) {
  5035. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5036. } else if (valIsSymbol) {
  5037. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5038. } else if (othIsNull || othIsSymbol) {
  5039. setLow = false;
  5040. } else {
  5041. setLow = retHighest ? (computed <= value) : (computed < value);
  5042. }
  5043. if (setLow) {
  5044. low = mid + 1;
  5045. } else {
  5046. high = mid;
  5047. }
  5048. }
  5049. return nativeMin(high, MAX_ARRAY_INDEX);
  5050. }
  5051. /**
  5052. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5053. * support for iteratee shorthands.
  5054. *
  5055. * @private
  5056. * @param {Array} array The array to inspect.
  5057. * @param {Function} [iteratee] The iteratee invoked per element.
  5058. * @returns {Array} Returns the new duplicate free array.
  5059. */
  5060. function baseSortedUniq(array, iteratee) {
  5061. var index = -1,
  5062. length = array.length,
  5063. resIndex = 0,
  5064. result = [];
  5065. while (++index < length) {
  5066. var value = array[index],
  5067. computed = iteratee ? iteratee(value) : value;
  5068. if (!index || !eq(computed, seen)) {
  5069. var seen = computed;
  5070. result[resIndex++] = value === 0 ? 0 : value;
  5071. }
  5072. }
  5073. return result;
  5074. }
  5075. /**
  5076. * The base implementation of `_.toNumber` which doesn't ensure correct
  5077. * conversions of binary, hexadecimal, or octal string values.
  5078. *
  5079. * @private
  5080. * @param {*} value The value to process.
  5081. * @returns {number} Returns the number.
  5082. */
  5083. function baseToNumber(value) {
  5084. if (typeof value == 'number') {
  5085. return value;
  5086. }
  5087. if (isSymbol(value)) {
  5088. return NAN;
  5089. }
  5090. return +value;
  5091. }
  5092. /**
  5093. * The base implementation of `_.toString` which doesn't convert nullish
  5094. * values to empty strings.
  5095. *
  5096. * @private
  5097. * @param {*} value The value to process.
  5098. * @returns {string} Returns the string.
  5099. */
  5100. function baseToString(value) {
  5101. // Exit early for strings to avoid a performance hit in some environments.
  5102. if (typeof value == 'string') {
  5103. return value;
  5104. }
  5105. if (isArray(value)) {
  5106. // Recursively convert values (susceptible to call stack limits).
  5107. return arrayMap(value, baseToString) + '';
  5108. }
  5109. if (isSymbol(value)) {
  5110. return symbolToString ? symbolToString.call(value) : '';
  5111. }
  5112. var result = (value + '');
  5113. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5114. }
  5115. /**
  5116. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5117. *
  5118. * @private
  5119. * @param {Array} array The array to inspect.
  5120. * @param {Function} [iteratee] The iteratee invoked per element.
  5121. * @param {Function} [comparator] The comparator invoked per element.
  5122. * @returns {Array} Returns the new duplicate free array.
  5123. */
  5124. function baseUniq(array, iteratee, comparator) {
  5125. var index = -1,
  5126. includes = arrayIncludes,
  5127. length = array.length,
  5128. isCommon = true,
  5129. result = [],
  5130. seen = result;
  5131. if (comparator) {
  5132. isCommon = false;
  5133. includes = arrayIncludesWith;
  5134. }
  5135. else if (length >= LARGE_ARRAY_SIZE) {
  5136. var set = iteratee ? null : createSet(array);
  5137. if (set) {
  5138. return setToArray(set);
  5139. }
  5140. isCommon = false;
  5141. includes = cacheHas;
  5142. seen = new SetCache;
  5143. }
  5144. else {
  5145. seen = iteratee ? [] : result;
  5146. }
  5147. outer:
  5148. while (++index < length) {
  5149. var value = array[index],
  5150. computed = iteratee ? iteratee(value) : value;
  5151. value = (comparator || value !== 0) ? value : 0;
  5152. if (isCommon && computed === computed) {
  5153. var seenIndex = seen.length;
  5154. while (seenIndex--) {
  5155. if (seen[seenIndex] === computed) {
  5156. continue outer;
  5157. }
  5158. }
  5159. if (iteratee) {
  5160. seen.push(computed);
  5161. }
  5162. result.push(value);
  5163. }
  5164. else if (!includes(seen, computed, comparator)) {
  5165. if (seen !== result) {
  5166. seen.push(computed);
  5167. }
  5168. result.push(value);
  5169. }
  5170. }
  5171. return result;
  5172. }
  5173. /**
  5174. * The base implementation of `_.unset`.
  5175. *
  5176. * @private
  5177. * @param {Object} object The object to modify.
  5178. * @param {Array|string} path The property path to unset.
  5179. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5180. */
  5181. function baseUnset(object, path) {
  5182. path = castPath(path, object);
  5183. object = parent(object, path);
  5184. return object == null || delete object[toKey(last(path))];
  5185. }
  5186. /**
  5187. * The base implementation of `_.update`.
  5188. *
  5189. * @private
  5190. * @param {Object} object The object to modify.
  5191. * @param {Array|string} path The path of the property to update.
  5192. * @param {Function} updater The function to produce the updated value.
  5193. * @param {Function} [customizer] The function to customize path creation.
  5194. * @returns {Object} Returns `object`.
  5195. */
  5196. function baseUpdate(object, path, updater, customizer) {
  5197. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5198. }
  5199. /**
  5200. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5201. * without support for iteratee shorthands.
  5202. *
  5203. * @private
  5204. * @param {Array} array The array to query.
  5205. * @param {Function} predicate The function invoked per iteration.
  5206. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5207. * @param {boolean} [fromRight] Specify iterating from right to left.
  5208. * @returns {Array} Returns the slice of `array`.
  5209. */
  5210. function baseWhile(array, predicate, isDrop, fromRight) {
  5211. var length = array.length,
  5212. index = fromRight ? length : -1;
  5213. while ((fromRight ? index-- : ++index < length) &&
  5214. predicate(array[index], index, array)) {}
  5215. return isDrop
  5216. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5217. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5218. }
  5219. /**
  5220. * The base implementation of `wrapperValue` which returns the result of
  5221. * performing a sequence of actions on the unwrapped `value`, where each
  5222. * successive action is supplied the return value of the previous.
  5223. *
  5224. * @private
  5225. * @param {*} value The unwrapped value.
  5226. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5227. * @returns {*} Returns the resolved value.
  5228. */
  5229. function baseWrapperValue(value, actions) {
  5230. var result = value;
  5231. if (result instanceof LazyWrapper) {
  5232. result = result.value();
  5233. }
  5234. return arrayReduce(actions, function(result, action) {
  5235. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5236. }, result);
  5237. }
  5238. /**
  5239. * The base implementation of methods like `_.xor`, without support for
  5240. * iteratee shorthands, that accepts an array of arrays to inspect.
  5241. *
  5242. * @private
  5243. * @param {Array} arrays The arrays to inspect.
  5244. * @param {Function} [iteratee] The iteratee invoked per element.
  5245. * @param {Function} [comparator] The comparator invoked per element.
  5246. * @returns {Array} Returns the new array of values.
  5247. */
  5248. function baseXor(arrays, iteratee, comparator) {
  5249. var length = arrays.length;
  5250. if (length < 2) {
  5251. return length ? baseUniq(arrays[0]) : [];
  5252. }
  5253. var index = -1,
  5254. result = Array(length);
  5255. while (++index < length) {
  5256. var array = arrays[index],
  5257. othIndex = -1;
  5258. while (++othIndex < length) {
  5259. if (othIndex != index) {
  5260. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5261. }
  5262. }
  5263. }
  5264. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5265. }
  5266. /**
  5267. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5268. *
  5269. * @private
  5270. * @param {Array} props The property identifiers.
  5271. * @param {Array} values The property values.
  5272. * @param {Function} assignFunc The function to assign values.
  5273. * @returns {Object} Returns the new object.
  5274. */
  5275. function baseZipObject(props, values, assignFunc) {
  5276. var index = -1,
  5277. length = props.length,
  5278. valsLength = values.length,
  5279. result = {};
  5280. while (++index < length) {
  5281. var value = index < valsLength ? values[index] : undefined;
  5282. assignFunc(result, props[index], value);
  5283. }
  5284. return result;
  5285. }
  5286. /**
  5287. * Casts `value` to an empty array if it's not an array like object.
  5288. *
  5289. * @private
  5290. * @param {*} value The value to inspect.
  5291. * @returns {Array|Object} Returns the cast array-like object.
  5292. */
  5293. function castArrayLikeObject(value) {
  5294. return isArrayLikeObject(value) ? value : [];
  5295. }
  5296. /**
  5297. * Casts `value` to `identity` if it's not a function.
  5298. *
  5299. * @private
  5300. * @param {*} value The value to inspect.
  5301. * @returns {Function} Returns cast function.
  5302. */
  5303. function castFunction(value) {
  5304. return typeof value == 'function' ? value : identity;
  5305. }
  5306. /**
  5307. * Casts `value` to a path array if it's not one.
  5308. *
  5309. * @private
  5310. * @param {*} value The value to inspect.
  5311. * @param {Object} [object] The object to query keys on.
  5312. * @returns {Array} Returns the cast property path array.
  5313. */
  5314. function castPath(value, object) {
  5315. if (isArray(value)) {
  5316. return value;
  5317. }
  5318. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5319. }
  5320. /**
  5321. * A `baseRest` alias which can be replaced with `identity` by module
  5322. * replacement plugins.
  5323. *
  5324. * @private
  5325. * @type {Function}
  5326. * @param {Function} func The function to apply a rest parameter to.
  5327. * @returns {Function} Returns the new function.
  5328. */
  5329. var castRest = baseRest;
  5330. /**
  5331. * Casts `array` to a slice if it's needed.
  5332. *
  5333. * @private
  5334. * @param {Array} array The array to inspect.
  5335. * @param {number} start The start position.
  5336. * @param {number} [end=array.length] The end position.
  5337. * @returns {Array} Returns the cast slice.
  5338. */
  5339. function castSlice(array, start, end) {
  5340. var length = array.length;
  5341. end = end === undefined ? length : end;
  5342. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5343. }
  5344. /**
  5345. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5346. *
  5347. * @private
  5348. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5349. */
  5350. var clearTimeout = ctxClearTimeout || function(id) {
  5351. return root.clearTimeout(id);
  5352. };
  5353. /**
  5354. * Creates a clone of `buffer`.
  5355. *
  5356. * @private
  5357. * @param {Buffer} buffer The buffer to clone.
  5358. * @param {boolean} [isDeep] Specify a deep clone.
  5359. * @returns {Buffer} Returns the cloned buffer.
  5360. */
  5361. function cloneBuffer(buffer, isDeep) {
  5362. if (isDeep) {
  5363. return buffer.slice();
  5364. }
  5365. var length = buffer.length,
  5366. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5367. buffer.copy(result);
  5368. return result;
  5369. }
  5370. /**
  5371. * Creates a clone of `arrayBuffer`.
  5372. *
  5373. * @private
  5374. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5375. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5376. */
  5377. function cloneArrayBuffer(arrayBuffer) {
  5378. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5379. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5380. return result;
  5381. }
  5382. /**
  5383. * Creates a clone of `dataView`.
  5384. *
  5385. * @private
  5386. * @param {Object} dataView The data view to clone.
  5387. * @param {boolean} [isDeep] Specify a deep clone.
  5388. * @returns {Object} Returns the cloned data view.
  5389. */
  5390. function cloneDataView(dataView, isDeep) {
  5391. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5392. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5393. }
  5394. /**
  5395. * Creates a clone of `regexp`.
  5396. *
  5397. * @private
  5398. * @param {Object} regexp The regexp to clone.
  5399. * @returns {Object} Returns the cloned regexp.
  5400. */
  5401. function cloneRegExp(regexp) {
  5402. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5403. result.lastIndex = regexp.lastIndex;
  5404. return result;
  5405. }
  5406. /**
  5407. * Creates a clone of the `symbol` object.
  5408. *
  5409. * @private
  5410. * @param {Object} symbol The symbol object to clone.
  5411. * @returns {Object} Returns the cloned symbol object.
  5412. */
  5413. function cloneSymbol(symbol) {
  5414. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5415. }
  5416. /**
  5417. * Creates a clone of `typedArray`.
  5418. *
  5419. * @private
  5420. * @param {Object} typedArray The typed array to clone.
  5421. * @param {boolean} [isDeep] Specify a deep clone.
  5422. * @returns {Object} Returns the cloned typed array.
  5423. */
  5424. function cloneTypedArray(typedArray, isDeep) {
  5425. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5426. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5427. }
  5428. /**
  5429. * Compares values to sort them in ascending order.
  5430. *
  5431. * @private
  5432. * @param {*} value The value to compare.
  5433. * @param {*} other The other value to compare.
  5434. * @returns {number} Returns the sort order indicator for `value`.
  5435. */
  5436. function compareAscending(value, other) {
  5437. if (value !== other) {
  5438. var valIsDefined = value !== undefined,
  5439. valIsNull = value === null,
  5440. valIsReflexive = value === value,
  5441. valIsSymbol = isSymbol(value);
  5442. var othIsDefined = other !== undefined,
  5443. othIsNull = other === null,
  5444. othIsReflexive = other === other,
  5445. othIsSymbol = isSymbol(other);
  5446. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5447. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5448. (valIsNull && othIsDefined && othIsReflexive) ||
  5449. (!valIsDefined && othIsReflexive) ||
  5450. !valIsReflexive) {
  5451. return 1;
  5452. }
  5453. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5454. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5455. (othIsNull && valIsDefined && valIsReflexive) ||
  5456. (!othIsDefined && valIsReflexive) ||
  5457. !othIsReflexive) {
  5458. return -1;
  5459. }
  5460. }
  5461. return 0;
  5462. }
  5463. /**
  5464. * Used by `_.orderBy` to compare multiple properties of a value to another
  5465. * and stable sort them.
  5466. *
  5467. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5468. * specify an order of "desc" for descending or "asc" for ascending sort order
  5469. * of corresponding values.
  5470. *
  5471. * @private
  5472. * @param {Object} object The object to compare.
  5473. * @param {Object} other The other object to compare.
  5474. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5475. * @returns {number} Returns the sort order indicator for `object`.
  5476. */
  5477. function compareMultiple(object, other, orders) {
  5478. var index = -1,
  5479. objCriteria = object.criteria,
  5480. othCriteria = other.criteria,
  5481. length = objCriteria.length,
  5482. ordersLength = orders.length;
  5483. while (++index < length) {
  5484. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5485. if (result) {
  5486. if (index >= ordersLength) {
  5487. return result;
  5488. }
  5489. var order = orders[index];
  5490. return result * (order == 'desc' ? -1 : 1);
  5491. }
  5492. }
  5493. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5494. // that causes it, under certain circumstances, to provide the same value for
  5495. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5496. // for more details.
  5497. //
  5498. // This also ensures a stable sort in V8 and other engines.
  5499. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5500. return object.index - other.index;
  5501. }
  5502. /**
  5503. * Creates an array that is the composition of partially applied arguments,
  5504. * placeholders, and provided arguments into a single array of arguments.
  5505. *
  5506. * @private
  5507. * @param {Array} args The provided arguments.
  5508. * @param {Array} partials The arguments to prepend to those provided.
  5509. * @param {Array} holders The `partials` placeholder indexes.
  5510. * @params {boolean} [isCurried] Specify composing for a curried function.
  5511. * @returns {Array} Returns the new array of composed arguments.
  5512. */
  5513. function composeArgs(args, partials, holders, isCurried) {
  5514. var argsIndex = -1,
  5515. argsLength = args.length,
  5516. holdersLength = holders.length,
  5517. leftIndex = -1,
  5518. leftLength = partials.length,
  5519. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5520. result = Array(leftLength + rangeLength),
  5521. isUncurried = !isCurried;
  5522. while (++leftIndex < leftLength) {
  5523. result[leftIndex] = partials[leftIndex];
  5524. }
  5525. while (++argsIndex < holdersLength) {
  5526. if (isUncurried || argsIndex < argsLength) {
  5527. result[holders[argsIndex]] = args[argsIndex];
  5528. }
  5529. }
  5530. while (rangeLength--) {
  5531. result[leftIndex++] = args[argsIndex++];
  5532. }
  5533. return result;
  5534. }
  5535. /**
  5536. * This function is like `composeArgs` except that the arguments composition
  5537. * is tailored for `_.partialRight`.
  5538. *
  5539. * @private
  5540. * @param {Array} args The provided arguments.
  5541. * @param {Array} partials The arguments to append to those provided.
  5542. * @param {Array} holders The `partials` placeholder indexes.
  5543. * @params {boolean} [isCurried] Specify composing for a curried function.
  5544. * @returns {Array} Returns the new array of composed arguments.
  5545. */
  5546. function composeArgsRight(args, partials, holders, isCurried) {
  5547. var argsIndex = -1,
  5548. argsLength = args.length,
  5549. holdersIndex = -1,
  5550. holdersLength = holders.length,
  5551. rightIndex = -1,
  5552. rightLength = partials.length,
  5553. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5554. result = Array(rangeLength + rightLength),
  5555. isUncurried = !isCurried;
  5556. while (++argsIndex < rangeLength) {
  5557. result[argsIndex] = args[argsIndex];
  5558. }
  5559. var offset = argsIndex;
  5560. while (++rightIndex < rightLength) {
  5561. result[offset + rightIndex] = partials[rightIndex];
  5562. }
  5563. while (++holdersIndex < holdersLength) {
  5564. if (isUncurried || argsIndex < argsLength) {
  5565. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5566. }
  5567. }
  5568. return result;
  5569. }
  5570. /**
  5571. * Copies the values of `source` to `array`.
  5572. *
  5573. * @private
  5574. * @param {Array} source The array to copy values from.
  5575. * @param {Array} [array=[]] The array to copy values to.
  5576. * @returns {Array} Returns `array`.
  5577. */
  5578. function copyArray(source, array) {
  5579. var index = -1,
  5580. length = source.length;
  5581. array || (array = Array(length));
  5582. while (++index < length) {
  5583. array[index] = source[index];
  5584. }
  5585. return array;
  5586. }
  5587. /**
  5588. * Copies properties of `source` to `object`.
  5589. *
  5590. * @private
  5591. * @param {Object} source The object to copy properties from.
  5592. * @param {Array} props The property identifiers to copy.
  5593. * @param {Object} [object={}] The object to copy properties to.
  5594. * @param {Function} [customizer] The function to customize copied values.
  5595. * @returns {Object} Returns `object`.
  5596. */
  5597. function copyObject(source, props, object, customizer) {
  5598. var isNew = !object;
  5599. object || (object = {});
  5600. var index = -1,
  5601. length = props.length;
  5602. while (++index < length) {
  5603. var key = props[index];
  5604. var newValue = customizer
  5605. ? customizer(object[key], source[key], key, object, source)
  5606. : undefined;
  5607. if (newValue === undefined) {
  5608. newValue = source[key];
  5609. }
  5610. if (isNew) {
  5611. baseAssignValue(object, key, newValue);
  5612. } else {
  5613. assignValue(object, key, newValue);
  5614. }
  5615. }
  5616. return object;
  5617. }
  5618. /**
  5619. * Copies own symbols of `source` to `object`.
  5620. *
  5621. * @private
  5622. * @param {Object} source The object to copy symbols from.
  5623. * @param {Object} [object={}] The object to copy symbols to.
  5624. * @returns {Object} Returns `object`.
  5625. */
  5626. function copySymbols(source, object) {
  5627. return copyObject(source, getSymbols(source), object);
  5628. }
  5629. /**
  5630. * Copies own and inherited symbols of `source` to `object`.
  5631. *
  5632. * @private
  5633. * @param {Object} source The object to copy symbols from.
  5634. * @param {Object} [object={}] The object to copy symbols to.
  5635. * @returns {Object} Returns `object`.
  5636. */
  5637. function copySymbolsIn(source, object) {
  5638. return copyObject(source, getSymbolsIn(source), object);
  5639. }
  5640. /**
  5641. * Creates a function like `_.groupBy`.
  5642. *
  5643. * @private
  5644. * @param {Function} setter The function to set accumulator values.
  5645. * @param {Function} [initializer] The accumulator object initializer.
  5646. * @returns {Function} Returns the new aggregator function.
  5647. */
  5648. function createAggregator(setter, initializer) {
  5649. return function(collection, iteratee) {
  5650. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5651. accumulator = initializer ? initializer() : {};
  5652. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5653. };
  5654. }
  5655. /**
  5656. * Creates a function like `_.assign`.
  5657. *
  5658. * @private
  5659. * @param {Function} assigner The function to assign values.
  5660. * @returns {Function} Returns the new assigner function.
  5661. */
  5662. function createAssigner(assigner) {
  5663. return baseRest(function(object, sources) {
  5664. var index = -1,
  5665. length = sources.length,
  5666. customizer = length > 1 ? sources[length - 1] : undefined,
  5667. guard = length > 2 ? sources[2] : undefined;
  5668. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5669. ? (length--, customizer)
  5670. : undefined;
  5671. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5672. customizer = length < 3 ? undefined : customizer;
  5673. length = 1;
  5674. }
  5675. object = Object(object);
  5676. while (++index < length) {
  5677. var source = sources[index];
  5678. if (source) {
  5679. assigner(object, source, index, customizer);
  5680. }
  5681. }
  5682. return object;
  5683. });
  5684. }
  5685. /**
  5686. * Creates a `baseEach` or `baseEachRight` function.
  5687. *
  5688. * @private
  5689. * @param {Function} eachFunc The function to iterate over a collection.
  5690. * @param {boolean} [fromRight] Specify iterating from right to left.
  5691. * @returns {Function} Returns the new base function.
  5692. */
  5693. function createBaseEach(eachFunc, fromRight) {
  5694. return function(collection, iteratee) {
  5695. if (collection == null) {
  5696. return collection;
  5697. }
  5698. if (!isArrayLike(collection)) {
  5699. return eachFunc(collection, iteratee);
  5700. }
  5701. var length = collection.length,
  5702. index = fromRight ? length : -1,
  5703. iterable = Object(collection);
  5704. while ((fromRight ? index-- : ++index < length)) {
  5705. if (iteratee(iterable[index], index, iterable) === false) {
  5706. break;
  5707. }
  5708. }
  5709. return collection;
  5710. };
  5711. }
  5712. /**
  5713. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5714. *
  5715. * @private
  5716. * @param {boolean} [fromRight] Specify iterating from right to left.
  5717. * @returns {Function} Returns the new base function.
  5718. */
  5719. function createBaseFor(fromRight) {
  5720. return function(object, iteratee, keysFunc) {
  5721. var index = -1,
  5722. iterable = Object(object),
  5723. props = keysFunc(object),
  5724. length = props.length;
  5725. while (length--) {
  5726. var key = props[fromRight ? length : ++index];
  5727. if (iteratee(iterable[key], key, iterable) === false) {
  5728. break;
  5729. }
  5730. }
  5731. return object;
  5732. };
  5733. }
  5734. /**
  5735. * Creates a function that wraps `func` to invoke it with the optional `this`
  5736. * binding of `thisArg`.
  5737. *
  5738. * @private
  5739. * @param {Function} func The function to wrap.
  5740. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5741. * @param {*} [thisArg] The `this` binding of `func`.
  5742. * @returns {Function} Returns the new wrapped function.
  5743. */
  5744. function createBind(func, bitmask, thisArg) {
  5745. var isBind = bitmask & WRAP_BIND_FLAG,
  5746. Ctor = createCtor(func);
  5747. function wrapper() {
  5748. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5749. return fn.apply(isBind ? thisArg : this, arguments);
  5750. }
  5751. return wrapper;
  5752. }
  5753. /**
  5754. * Creates a function like `_.lowerFirst`.
  5755. *
  5756. * @private
  5757. * @param {string} methodName The name of the `String` case method to use.
  5758. * @returns {Function} Returns the new case function.
  5759. */
  5760. function createCaseFirst(methodName) {
  5761. return function(string) {
  5762. string = toString(string);
  5763. var strSymbols = hasUnicode(string)
  5764. ? stringToArray(string)
  5765. : undefined;
  5766. var chr = strSymbols
  5767. ? strSymbols[0]
  5768. : string.charAt(0);
  5769. var trailing = strSymbols
  5770. ? castSlice(strSymbols, 1).join('')
  5771. : string.slice(1);
  5772. return chr[methodName]() + trailing;
  5773. };
  5774. }
  5775. /**
  5776. * Creates a function like `_.camelCase`.
  5777. *
  5778. * @private
  5779. * @param {Function} callback The function to combine each word.
  5780. * @returns {Function} Returns the new compounder function.
  5781. */
  5782. function createCompounder(callback) {
  5783. return function(string) {
  5784. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5785. };
  5786. }
  5787. /**
  5788. * Creates a function that produces an instance of `Ctor` regardless of
  5789. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5790. *
  5791. * @private
  5792. * @param {Function} Ctor The constructor to wrap.
  5793. * @returns {Function} Returns the new wrapped function.
  5794. */
  5795. function createCtor(Ctor) {
  5796. return function() {
  5797. // Use a `switch` statement to work with class constructors. See
  5798. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5799. // for more details.
  5800. var args = arguments;
  5801. switch (args.length) {
  5802. case 0: return new Ctor;
  5803. case 1: return new Ctor(args[0]);
  5804. case 2: return new Ctor(args[0], args[1]);
  5805. case 3: return new Ctor(args[0], args[1], args[2]);
  5806. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5807. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5808. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5809. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5810. }
  5811. var thisBinding = baseCreate(Ctor.prototype),
  5812. result = Ctor.apply(thisBinding, args);
  5813. // Mimic the constructor's `return` behavior.
  5814. // See https://es5.github.io/#x13.2.2 for more details.
  5815. return isObject(result) ? result : thisBinding;
  5816. };
  5817. }
  5818. /**
  5819. * Creates a function that wraps `func` to enable currying.
  5820. *
  5821. * @private
  5822. * @param {Function} func The function to wrap.
  5823. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5824. * @param {number} arity The arity of `func`.
  5825. * @returns {Function} Returns the new wrapped function.
  5826. */
  5827. function createCurry(func, bitmask, arity) {
  5828. var Ctor = createCtor(func);
  5829. function wrapper() {
  5830. var length = arguments.length,
  5831. args = Array(length),
  5832. index = length,
  5833. placeholder = getHolder(wrapper);
  5834. while (index--) {
  5835. args[index] = arguments[index];
  5836. }
  5837. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5838. ? []
  5839. : replaceHolders(args, placeholder);
  5840. length -= holders.length;
  5841. if (length < arity) {
  5842. return createRecurry(
  5843. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5844. args, holders, undefined, undefined, arity - length);
  5845. }
  5846. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5847. return apply(fn, this, args);
  5848. }
  5849. return wrapper;
  5850. }
  5851. /**
  5852. * Creates a `_.find` or `_.findLast` function.
  5853. *
  5854. * @private
  5855. * @param {Function} findIndexFunc The function to find the collection index.
  5856. * @returns {Function} Returns the new find function.
  5857. */
  5858. function createFind(findIndexFunc) {
  5859. return function(collection, predicate, fromIndex) {
  5860. var iterable = Object(collection);
  5861. if (!isArrayLike(collection)) {
  5862. var iteratee = getIteratee(predicate, 3);
  5863. collection = keys(collection);
  5864. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5865. }
  5866. var index = findIndexFunc(collection, predicate, fromIndex);
  5867. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5868. };
  5869. }
  5870. /**
  5871. * Creates a `_.flow` or `_.flowRight` function.
  5872. *
  5873. * @private
  5874. * @param {boolean} [fromRight] Specify iterating from right to left.
  5875. * @returns {Function} Returns the new flow function.
  5876. */
  5877. function createFlow(fromRight) {
  5878. return flatRest(function(funcs) {
  5879. var length = funcs.length,
  5880. index = length,
  5881. prereq = LodashWrapper.prototype.thru;
  5882. if (fromRight) {
  5883. funcs.reverse();
  5884. }
  5885. while (index--) {
  5886. var func = funcs[index];
  5887. if (typeof func != 'function') {
  5888. throw new TypeError(FUNC_ERROR_TEXT);
  5889. }
  5890. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5891. var wrapper = new LodashWrapper([], true);
  5892. }
  5893. }
  5894. index = wrapper ? index : length;
  5895. while (++index < length) {
  5896. func = funcs[index];
  5897. var funcName = getFuncName(func),
  5898. data = funcName == 'wrapper' ? getData(func) : undefined;
  5899. if (data && isLaziable(data[0]) &&
  5900. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5901. !data[4].length && data[9] == 1
  5902. ) {
  5903. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5904. } else {
  5905. wrapper = (func.length == 1 && isLaziable(func))
  5906. ? wrapper[funcName]()
  5907. : wrapper.thru(func);
  5908. }
  5909. }
  5910. return function() {
  5911. var args = arguments,
  5912. value = args[0];
  5913. if (wrapper && args.length == 1 && isArray(value)) {
  5914. return wrapper.plant(value).value();
  5915. }
  5916. var index = 0,
  5917. result = length ? funcs[index].apply(this, args) : value;
  5918. while (++index < length) {
  5919. result = funcs[index].call(this, result);
  5920. }
  5921. return result;
  5922. };
  5923. });
  5924. }
  5925. /**
  5926. * Creates a function that wraps `func` to invoke it with optional `this`
  5927. * binding of `thisArg`, partial application, and currying.
  5928. *
  5929. * @private
  5930. * @param {Function|string} func The function or method name to wrap.
  5931. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5932. * @param {*} [thisArg] The `this` binding of `func`.
  5933. * @param {Array} [partials] The arguments to prepend to those provided to
  5934. * the new function.
  5935. * @param {Array} [holders] The `partials` placeholder indexes.
  5936. * @param {Array} [partialsRight] The arguments to append to those provided
  5937. * to the new function.
  5938. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5939. * @param {Array} [argPos] The argument positions of the new function.
  5940. * @param {number} [ary] The arity cap of `func`.
  5941. * @param {number} [arity] The arity of `func`.
  5942. * @returns {Function} Returns the new wrapped function.
  5943. */
  5944. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5945. var isAry = bitmask & WRAP_ARY_FLAG,
  5946. isBind = bitmask & WRAP_BIND_FLAG,
  5947. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5948. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5949. isFlip = bitmask & WRAP_FLIP_FLAG,
  5950. Ctor = isBindKey ? undefined : createCtor(func);
  5951. function wrapper() {
  5952. var length = arguments.length,
  5953. args = Array(length),
  5954. index = length;
  5955. while (index--) {
  5956. args[index] = arguments[index];
  5957. }
  5958. if (isCurried) {
  5959. var placeholder = getHolder(wrapper),
  5960. holdersCount = countHolders(args, placeholder);
  5961. }
  5962. if (partials) {
  5963. args = composeArgs(args, partials, holders, isCurried);
  5964. }
  5965. if (partialsRight) {
  5966. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5967. }
  5968. length -= holdersCount;
  5969. if (isCurried && length < arity) {
  5970. var newHolders = replaceHolders(args, placeholder);
  5971. return createRecurry(
  5972. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5973. args, newHolders, argPos, ary, arity - length
  5974. );
  5975. }
  5976. var thisBinding = isBind ? thisArg : this,
  5977. fn = isBindKey ? thisBinding[func] : func;
  5978. length = args.length;
  5979. if (argPos) {
  5980. args = reorder(args, argPos);
  5981. } else if (isFlip && length > 1) {
  5982. args.reverse();
  5983. }
  5984. if (isAry && ary < length) {
  5985. args.length = ary;
  5986. }
  5987. if (this && this !== root && this instanceof wrapper) {
  5988. fn = Ctor || createCtor(fn);
  5989. }
  5990. return fn.apply(thisBinding, args);
  5991. }
  5992. return wrapper;
  5993. }
  5994. /**
  5995. * Creates a function like `_.invertBy`.
  5996. *
  5997. * @private
  5998. * @param {Function} setter The function to set accumulator values.
  5999. * @param {Function} toIteratee The function to resolve iteratees.
  6000. * @returns {Function} Returns the new inverter function.
  6001. */
  6002. function createInverter(setter, toIteratee) {
  6003. return function(object, iteratee) {
  6004. return baseInverter(object, setter, toIteratee(iteratee), {});
  6005. };
  6006. }
  6007. /**
  6008. * Creates a function that performs a mathematical operation on two values.
  6009. *
  6010. * @private
  6011. * @param {Function} operator The function to perform the operation.
  6012. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6013. * @returns {Function} Returns the new mathematical operation function.
  6014. */
  6015. function createMathOperation(operator, defaultValue) {
  6016. return function(value, other) {
  6017. var result;
  6018. if (value === undefined && other === undefined) {
  6019. return defaultValue;
  6020. }
  6021. if (value !== undefined) {
  6022. result = value;
  6023. }
  6024. if (other !== undefined) {
  6025. if (result === undefined) {
  6026. return other;
  6027. }
  6028. if (typeof value == 'string' || typeof other == 'string') {
  6029. value = baseToString(value);
  6030. other = baseToString(other);
  6031. } else {
  6032. value = baseToNumber(value);
  6033. other = baseToNumber(other);
  6034. }
  6035. result = operator(value, other);
  6036. }
  6037. return result;
  6038. };
  6039. }
  6040. /**
  6041. * Creates a function like `_.over`.
  6042. *
  6043. * @private
  6044. * @param {Function} arrayFunc The function to iterate over iteratees.
  6045. * @returns {Function} Returns the new over function.
  6046. */
  6047. function createOver(arrayFunc) {
  6048. return flatRest(function(iteratees) {
  6049. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6050. return baseRest(function(args) {
  6051. var thisArg = this;
  6052. return arrayFunc(iteratees, function(iteratee) {
  6053. return apply(iteratee, thisArg, args);
  6054. });
  6055. });
  6056. });
  6057. }
  6058. /**
  6059. * Creates the padding for `string` based on `length`. The `chars` string
  6060. * is truncated if the number of characters exceeds `length`.
  6061. *
  6062. * @private
  6063. * @param {number} length The padding length.
  6064. * @param {string} [chars=' '] The string used as padding.
  6065. * @returns {string} Returns the padding for `string`.
  6066. */
  6067. function createPadding(length, chars) {
  6068. chars = chars === undefined ? ' ' : baseToString(chars);
  6069. var charsLength = chars.length;
  6070. if (charsLength < 2) {
  6071. return charsLength ? baseRepeat(chars, length) : chars;
  6072. }
  6073. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6074. return hasUnicode(chars)
  6075. ? castSlice(stringToArray(result), 0, length).join('')
  6076. : result.slice(0, length);
  6077. }
  6078. /**
  6079. * Creates a function that wraps `func` to invoke it with the `this` binding
  6080. * of `thisArg` and `partials` prepended to the arguments it receives.
  6081. *
  6082. * @private
  6083. * @param {Function} func The function to wrap.
  6084. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6085. * @param {*} thisArg The `this` binding of `func`.
  6086. * @param {Array} partials The arguments to prepend to those provided to
  6087. * the new function.
  6088. * @returns {Function} Returns the new wrapped function.
  6089. */
  6090. function createPartial(func, bitmask, thisArg, partials) {
  6091. var isBind = bitmask & WRAP_BIND_FLAG,
  6092. Ctor = createCtor(func);
  6093. function wrapper() {
  6094. var argsIndex = -1,
  6095. argsLength = arguments.length,
  6096. leftIndex = -1,
  6097. leftLength = partials.length,
  6098. args = Array(leftLength + argsLength),
  6099. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6100. while (++leftIndex < leftLength) {
  6101. args[leftIndex] = partials[leftIndex];
  6102. }
  6103. while (argsLength--) {
  6104. args[leftIndex++] = arguments[++argsIndex];
  6105. }
  6106. return apply(fn, isBind ? thisArg : this, args);
  6107. }
  6108. return wrapper;
  6109. }
  6110. /**
  6111. * Creates a `_.range` or `_.rangeRight` function.
  6112. *
  6113. * @private
  6114. * @param {boolean} [fromRight] Specify iterating from right to left.
  6115. * @returns {Function} Returns the new range function.
  6116. */
  6117. function createRange(fromRight) {
  6118. return function(start, end, step) {
  6119. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6120. end = step = undefined;
  6121. }
  6122. // Ensure the sign of `-0` is preserved.
  6123. start = toFinite(start);
  6124. if (end === undefined) {
  6125. end = start;
  6126. start = 0;
  6127. } else {
  6128. end = toFinite(end);
  6129. }
  6130. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6131. return baseRange(start, end, step, fromRight);
  6132. };
  6133. }
  6134. /**
  6135. * Creates a function that performs a relational operation on two values.
  6136. *
  6137. * @private
  6138. * @param {Function} operator The function to perform the operation.
  6139. * @returns {Function} Returns the new relational operation function.
  6140. */
  6141. function createRelationalOperation(operator) {
  6142. return function(value, other) {
  6143. if (!(typeof value == 'string' && typeof other == 'string')) {
  6144. value = toNumber(value);
  6145. other = toNumber(other);
  6146. }
  6147. return operator(value, other);
  6148. };
  6149. }
  6150. /**
  6151. * Creates a function that wraps `func` to continue currying.
  6152. *
  6153. * @private
  6154. * @param {Function} func The function to wrap.
  6155. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6156. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6157. * @param {*} placeholder The placeholder value.
  6158. * @param {*} [thisArg] The `this` binding of `func`.
  6159. * @param {Array} [partials] The arguments to prepend to those provided to
  6160. * the new function.
  6161. * @param {Array} [holders] The `partials` placeholder indexes.
  6162. * @param {Array} [argPos] The argument positions of the new function.
  6163. * @param {number} [ary] The arity cap of `func`.
  6164. * @param {number} [arity] The arity of `func`.
  6165. * @returns {Function} Returns the new wrapped function.
  6166. */
  6167. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6168. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6169. newHolders = isCurry ? holders : undefined,
  6170. newHoldersRight = isCurry ? undefined : holders,
  6171. newPartials = isCurry ? partials : undefined,
  6172. newPartialsRight = isCurry ? undefined : partials;
  6173. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6174. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6175. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6176. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6177. }
  6178. var newData = [
  6179. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6180. newHoldersRight, argPos, ary, arity
  6181. ];
  6182. var result = wrapFunc.apply(undefined, newData);
  6183. if (isLaziable(func)) {
  6184. setData(result, newData);
  6185. }
  6186. result.placeholder = placeholder;
  6187. return setWrapToString(result, func, bitmask);
  6188. }
  6189. /**
  6190. * Creates a function like `_.round`.
  6191. *
  6192. * @private
  6193. * @param {string} methodName The name of the `Math` method to use when rounding.
  6194. * @returns {Function} Returns the new round function.
  6195. */
  6196. function createRound(methodName) {
  6197. var func = Math[methodName];
  6198. return function(number, precision) {
  6199. number = toNumber(number);
  6200. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6201. if (precision && nativeIsFinite(number)) {
  6202. // Shift with exponential notation to avoid floating-point issues.
  6203. // See [MDN](https://mdn.io/round#Examples) for more details.
  6204. var pair = (toString(number) + 'e').split('e'),
  6205. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6206. pair = (toString(value) + 'e').split('e');
  6207. return +(pair[0] + 'e' + (+pair[1] - precision));
  6208. }
  6209. return func(number);
  6210. };
  6211. }
  6212. /**
  6213. * Creates a set object of `values`.
  6214. *
  6215. * @private
  6216. * @param {Array} values The values to add to the set.
  6217. * @returns {Object} Returns the new set.
  6218. */
  6219. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6220. return new Set(values);
  6221. };
  6222. /**
  6223. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6224. *
  6225. * @private
  6226. * @param {Function} keysFunc The function to get the keys of a given object.
  6227. * @returns {Function} Returns the new pairs function.
  6228. */
  6229. function createToPairs(keysFunc) {
  6230. return function(object) {
  6231. var tag = getTag(object);
  6232. if (tag == mapTag) {
  6233. return mapToArray(object);
  6234. }
  6235. if (tag == setTag) {
  6236. return setToPairs(object);
  6237. }
  6238. return baseToPairs(object, keysFunc(object));
  6239. };
  6240. }
  6241. /**
  6242. * Creates a function that either curries or invokes `func` with optional
  6243. * `this` binding and partially applied arguments.
  6244. *
  6245. * @private
  6246. * @param {Function|string} func The function or method name to wrap.
  6247. * @param {number} bitmask The bitmask flags.
  6248. * 1 - `_.bind`
  6249. * 2 - `_.bindKey`
  6250. * 4 - `_.curry` or `_.curryRight` of a bound function
  6251. * 8 - `_.curry`
  6252. * 16 - `_.curryRight`
  6253. * 32 - `_.partial`
  6254. * 64 - `_.partialRight`
  6255. * 128 - `_.rearg`
  6256. * 256 - `_.ary`
  6257. * 512 - `_.flip`
  6258. * @param {*} [thisArg] The `this` binding of `func`.
  6259. * @param {Array} [partials] The arguments to be partially applied.
  6260. * @param {Array} [holders] The `partials` placeholder indexes.
  6261. * @param {Array} [argPos] The argument positions of the new function.
  6262. * @param {number} [ary] The arity cap of `func`.
  6263. * @param {number} [arity] The arity of `func`.
  6264. * @returns {Function} Returns the new wrapped function.
  6265. */
  6266. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6267. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6268. if (!isBindKey && typeof func != 'function') {
  6269. throw new TypeError(FUNC_ERROR_TEXT);
  6270. }
  6271. var length = partials ? partials.length : 0;
  6272. if (!length) {
  6273. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6274. partials = holders = undefined;
  6275. }
  6276. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6277. arity = arity === undefined ? arity : toInteger(arity);
  6278. length -= holders ? holders.length : 0;
  6279. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6280. var partialsRight = partials,
  6281. holdersRight = holders;
  6282. partials = holders = undefined;
  6283. }
  6284. var data = isBindKey ? undefined : getData(func);
  6285. var newData = [
  6286. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6287. argPos, ary, arity
  6288. ];
  6289. if (data) {
  6290. mergeData(newData, data);
  6291. }
  6292. func = newData[0];
  6293. bitmask = newData[1];
  6294. thisArg = newData[2];
  6295. partials = newData[3];
  6296. holders = newData[4];
  6297. arity = newData[9] = newData[9] === undefined
  6298. ? (isBindKey ? 0 : func.length)
  6299. : nativeMax(newData[9] - length, 0);
  6300. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6301. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6302. }
  6303. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6304. var result = createBind(func, bitmask, thisArg);
  6305. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6306. result = createCurry(func, bitmask, arity);
  6307. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6308. result = createPartial(func, bitmask, thisArg, partials);
  6309. } else {
  6310. result = createHybrid.apply(undefined, newData);
  6311. }
  6312. var setter = data ? baseSetData : setData;
  6313. return setWrapToString(setter(result, newData), func, bitmask);
  6314. }
  6315. /**
  6316. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6317. * of source objects to the destination object for all destination properties
  6318. * that resolve to `undefined`.
  6319. *
  6320. * @private
  6321. * @param {*} objValue The destination value.
  6322. * @param {*} srcValue The source value.
  6323. * @param {string} key The key of the property to assign.
  6324. * @param {Object} object The parent object of `objValue`.
  6325. * @returns {*} Returns the value to assign.
  6326. */
  6327. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6328. if (objValue === undefined ||
  6329. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6330. return srcValue;
  6331. }
  6332. return objValue;
  6333. }
  6334. /**
  6335. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6336. * objects into destination objects that are passed thru.
  6337. *
  6338. * @private
  6339. * @param {*} objValue The destination value.
  6340. * @param {*} srcValue The source value.
  6341. * @param {string} key The key of the property to merge.
  6342. * @param {Object} object The parent object of `objValue`.
  6343. * @param {Object} source The parent object of `srcValue`.
  6344. * @param {Object} [stack] Tracks traversed source values and their merged
  6345. * counterparts.
  6346. * @returns {*} Returns the value to assign.
  6347. */
  6348. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6349. if (isObject(objValue) && isObject(srcValue)) {
  6350. // Recursively merge objects and arrays (susceptible to call stack limits).
  6351. stack.set(srcValue, objValue);
  6352. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6353. stack['delete'](srcValue);
  6354. }
  6355. return objValue;
  6356. }
  6357. /**
  6358. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6359. * objects.
  6360. *
  6361. * @private
  6362. * @param {*} value The value to inspect.
  6363. * @param {string} key The key of the property to inspect.
  6364. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6365. */
  6366. function customOmitClone(value) {
  6367. return isPlainObject(value) ? undefined : value;
  6368. }
  6369. /**
  6370. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6371. * partial deep comparisons.
  6372. *
  6373. * @private
  6374. * @param {Array} array The array to compare.
  6375. * @param {Array} other The other array to compare.
  6376. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6377. * @param {Function} customizer The function to customize comparisons.
  6378. * @param {Function} equalFunc The function to determine equivalents of values.
  6379. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6380. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6381. */
  6382. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6383. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6384. arrLength = array.length,
  6385. othLength = other.length;
  6386. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6387. return false;
  6388. }
  6389. // Check that cyclic values are equal.
  6390. var arrStacked = stack.get(array);
  6391. var othStacked = stack.get(other);
  6392. if (arrStacked && othStacked) {
  6393. return arrStacked == other && othStacked == array;
  6394. }
  6395. var index = -1,
  6396. result = true,
  6397. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6398. stack.set(array, other);
  6399. stack.set(other, array);
  6400. // Ignore non-index properties.
  6401. while (++index < arrLength) {
  6402. var arrValue = array[index],
  6403. othValue = other[index];
  6404. if (customizer) {
  6405. var compared = isPartial
  6406. ? customizer(othValue, arrValue, index, other, array, stack)
  6407. : customizer(arrValue, othValue, index, array, other, stack);
  6408. }
  6409. if (compared !== undefined) {
  6410. if (compared) {
  6411. continue;
  6412. }
  6413. result = false;
  6414. break;
  6415. }
  6416. // Recursively compare arrays (susceptible to call stack limits).
  6417. if (seen) {
  6418. if (!arraySome(other, function(othValue, othIndex) {
  6419. if (!cacheHas(seen, othIndex) &&
  6420. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6421. return seen.push(othIndex);
  6422. }
  6423. })) {
  6424. result = false;
  6425. break;
  6426. }
  6427. } else if (!(
  6428. arrValue === othValue ||
  6429. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6430. )) {
  6431. result = false;
  6432. break;
  6433. }
  6434. }
  6435. stack['delete'](array);
  6436. stack['delete'](other);
  6437. return result;
  6438. }
  6439. /**
  6440. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6441. * the same `toStringTag`.
  6442. *
  6443. * **Note:** This function only supports comparing values with tags of
  6444. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6445. *
  6446. * @private
  6447. * @param {Object} object The object to compare.
  6448. * @param {Object} other The other object to compare.
  6449. * @param {string} tag The `toStringTag` of the objects to compare.
  6450. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6451. * @param {Function} customizer The function to customize comparisons.
  6452. * @param {Function} equalFunc The function to determine equivalents of values.
  6453. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6454. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6455. */
  6456. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6457. switch (tag) {
  6458. case dataViewTag:
  6459. if ((object.byteLength != other.byteLength) ||
  6460. (object.byteOffset != other.byteOffset)) {
  6461. return false;
  6462. }
  6463. object = object.buffer;
  6464. other = other.buffer;
  6465. case arrayBufferTag:
  6466. if ((object.byteLength != other.byteLength) ||
  6467. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6468. return false;
  6469. }
  6470. return true;
  6471. case boolTag:
  6472. case dateTag:
  6473. case numberTag:
  6474. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6475. // Invalid dates are coerced to `NaN`.
  6476. return eq(+object, +other);
  6477. case errorTag:
  6478. return object.name == other.name && object.message == other.message;
  6479. case regexpTag:
  6480. case stringTag:
  6481. // Coerce regexes to strings and treat strings, primitives and objects,
  6482. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6483. // for more details.
  6484. return object == (other + '');
  6485. case mapTag:
  6486. var convert = mapToArray;
  6487. case setTag:
  6488. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6489. convert || (convert = setToArray);
  6490. if (object.size != other.size && !isPartial) {
  6491. return false;
  6492. }
  6493. // Assume cyclic values are equal.
  6494. var stacked = stack.get(object);
  6495. if (stacked) {
  6496. return stacked == other;
  6497. }
  6498. bitmask |= COMPARE_UNORDERED_FLAG;
  6499. // Recursively compare objects (susceptible to call stack limits).
  6500. stack.set(object, other);
  6501. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6502. stack['delete'](object);
  6503. return result;
  6504. case symbolTag:
  6505. if (symbolValueOf) {
  6506. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6507. }
  6508. }
  6509. return false;
  6510. }
  6511. /**
  6512. * A specialized version of `baseIsEqualDeep` for objects with support for
  6513. * partial deep comparisons.
  6514. *
  6515. * @private
  6516. * @param {Object} object The object to compare.
  6517. * @param {Object} other The other object to compare.
  6518. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6519. * @param {Function} customizer The function to customize comparisons.
  6520. * @param {Function} equalFunc The function to determine equivalents of values.
  6521. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6522. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6523. */
  6524. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6525. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6526. objProps = getAllKeys(object),
  6527. objLength = objProps.length,
  6528. othProps = getAllKeys(other),
  6529. othLength = othProps.length;
  6530. if (objLength != othLength && !isPartial) {
  6531. return false;
  6532. }
  6533. var index = objLength;
  6534. while (index--) {
  6535. var key = objProps[index];
  6536. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6537. return false;
  6538. }
  6539. }
  6540. // Check that cyclic values are equal.
  6541. var objStacked = stack.get(object);
  6542. var othStacked = stack.get(other);
  6543. if (objStacked && othStacked) {
  6544. return objStacked == other && othStacked == object;
  6545. }
  6546. var result = true;
  6547. stack.set(object, other);
  6548. stack.set(other, object);
  6549. var skipCtor = isPartial;
  6550. while (++index < objLength) {
  6551. key = objProps[index];
  6552. var objValue = object[key],
  6553. othValue = other[key];
  6554. if (customizer) {
  6555. var compared = isPartial
  6556. ? customizer(othValue, objValue, key, other, object, stack)
  6557. : customizer(objValue, othValue, key, object, other, stack);
  6558. }
  6559. // Recursively compare objects (susceptible to call stack limits).
  6560. if (!(compared === undefined
  6561. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6562. : compared
  6563. )) {
  6564. result = false;
  6565. break;
  6566. }
  6567. skipCtor || (skipCtor = key == 'constructor');
  6568. }
  6569. if (result && !skipCtor) {
  6570. var objCtor = object.constructor,
  6571. othCtor = other.constructor;
  6572. // Non `Object` object instances with different constructors are not equal.
  6573. if (objCtor != othCtor &&
  6574. ('constructor' in object && 'constructor' in other) &&
  6575. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6576. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6577. result = false;
  6578. }
  6579. }
  6580. stack['delete'](object);
  6581. stack['delete'](other);
  6582. return result;
  6583. }
  6584. /**
  6585. * A specialized version of `baseRest` which flattens the rest array.
  6586. *
  6587. * @private
  6588. * @param {Function} func The function to apply a rest parameter to.
  6589. * @returns {Function} Returns the new function.
  6590. */
  6591. function flatRest(func) {
  6592. return setToString(overRest(func, undefined, flatten), func + '');
  6593. }
  6594. /**
  6595. * Creates an array of own enumerable property names and symbols of `object`.
  6596. *
  6597. * @private
  6598. * @param {Object} object The object to query.
  6599. * @returns {Array} Returns the array of property names and symbols.
  6600. */
  6601. function getAllKeys(object) {
  6602. return baseGetAllKeys(object, keys, getSymbols);
  6603. }
  6604. /**
  6605. * Creates an array of own and inherited enumerable property names and
  6606. * symbols of `object`.
  6607. *
  6608. * @private
  6609. * @param {Object} object The object to query.
  6610. * @returns {Array} Returns the array of property names and symbols.
  6611. */
  6612. function getAllKeysIn(object) {
  6613. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6614. }
  6615. /**
  6616. * Gets metadata for `func`.
  6617. *
  6618. * @private
  6619. * @param {Function} func The function to query.
  6620. * @returns {*} Returns the metadata for `func`.
  6621. */
  6622. var getData = !metaMap ? noop : function(func) {
  6623. return metaMap.get(func);
  6624. };
  6625. /**
  6626. * Gets the name of `func`.
  6627. *
  6628. * @private
  6629. * @param {Function} func The function to query.
  6630. * @returns {string} Returns the function name.
  6631. */
  6632. function getFuncName(func) {
  6633. var result = (func.name + ''),
  6634. array = realNames[result],
  6635. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6636. while (length--) {
  6637. var data = array[length],
  6638. otherFunc = data.func;
  6639. if (otherFunc == null || otherFunc == func) {
  6640. return data.name;
  6641. }
  6642. }
  6643. return result;
  6644. }
  6645. /**
  6646. * Gets the argument placeholder value for `func`.
  6647. *
  6648. * @private
  6649. * @param {Function} func The function to inspect.
  6650. * @returns {*} Returns the placeholder value.
  6651. */
  6652. function getHolder(func) {
  6653. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6654. return object.placeholder;
  6655. }
  6656. /**
  6657. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6658. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6659. * If arguments are provided, the chosen function is invoked with them and
  6660. * its result is returned.
  6661. *
  6662. * @private
  6663. * @param {*} [value] The value to convert to an iteratee.
  6664. * @param {number} [arity] The arity of the created iteratee.
  6665. * @returns {Function} Returns the chosen function or its result.
  6666. */
  6667. function getIteratee() {
  6668. var result = lodash.iteratee || iteratee;
  6669. result = result === iteratee ? baseIteratee : result;
  6670. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6671. }
  6672. /**
  6673. * Gets the data for `map`.
  6674. *
  6675. * @private
  6676. * @param {Object} map The map to query.
  6677. * @param {string} key The reference key.
  6678. * @returns {*} Returns the map data.
  6679. */
  6680. function getMapData(map, key) {
  6681. var data = map.__data__;
  6682. return isKeyable(key)
  6683. ? data[typeof key == 'string' ? 'string' : 'hash']
  6684. : data.map;
  6685. }
  6686. /**
  6687. * Gets the property names, values, and compare flags of `object`.
  6688. *
  6689. * @private
  6690. * @param {Object} object The object to query.
  6691. * @returns {Array} Returns the match data of `object`.
  6692. */
  6693. function getMatchData(object) {
  6694. var result = keys(object),
  6695. length = result.length;
  6696. while (length--) {
  6697. var key = result[length],
  6698. value = object[key];
  6699. result[length] = [key, value, isStrictComparable(value)];
  6700. }
  6701. return result;
  6702. }
  6703. /**
  6704. * Gets the native function at `key` of `object`.
  6705. *
  6706. * @private
  6707. * @param {Object} object The object to query.
  6708. * @param {string} key The key of the method to get.
  6709. * @returns {*} Returns the function if it's native, else `undefined`.
  6710. */
  6711. function getNative(object, key) {
  6712. var value = getValue(object, key);
  6713. return baseIsNative(value) ? value : undefined;
  6714. }
  6715. /**
  6716. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6717. *
  6718. * @private
  6719. * @param {*} value The value to query.
  6720. * @returns {string} Returns the raw `toStringTag`.
  6721. */
  6722. function getRawTag(value) {
  6723. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6724. tag = value[symToStringTag];
  6725. try {
  6726. value[symToStringTag] = undefined;
  6727. var unmasked = true;
  6728. } catch (e) {}
  6729. var result = nativeObjectToString.call(value);
  6730. if (unmasked) {
  6731. if (isOwn) {
  6732. value[symToStringTag] = tag;
  6733. } else {
  6734. delete value[symToStringTag];
  6735. }
  6736. }
  6737. return result;
  6738. }
  6739. /**
  6740. * Creates an array of the own enumerable symbols of `object`.
  6741. *
  6742. * @private
  6743. * @param {Object} object The object to query.
  6744. * @returns {Array} Returns the array of symbols.
  6745. */
  6746. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6747. if (object == null) {
  6748. return [];
  6749. }
  6750. object = Object(object);
  6751. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6752. return propertyIsEnumerable.call(object, symbol);
  6753. });
  6754. };
  6755. /**
  6756. * Creates an array of the own and inherited enumerable symbols of `object`.
  6757. *
  6758. * @private
  6759. * @param {Object} object The object to query.
  6760. * @returns {Array} Returns the array of symbols.
  6761. */
  6762. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6763. var result = [];
  6764. while (object) {
  6765. arrayPush(result, getSymbols(object));
  6766. object = getPrototype(object);
  6767. }
  6768. return result;
  6769. };
  6770. /**
  6771. * Gets the `toStringTag` of `value`.
  6772. *
  6773. * @private
  6774. * @param {*} value The value to query.
  6775. * @returns {string} Returns the `toStringTag`.
  6776. */
  6777. var getTag = baseGetTag;
  6778. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6779. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6780. (Map && getTag(new Map) != mapTag) ||
  6781. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6782. (Set && getTag(new Set) != setTag) ||
  6783. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6784. getTag = function(value) {
  6785. var result = baseGetTag(value),
  6786. Ctor = result == objectTag ? value.constructor : undefined,
  6787. ctorString = Ctor ? toSource(Ctor) : '';
  6788. if (ctorString) {
  6789. switch (ctorString) {
  6790. case dataViewCtorString: return dataViewTag;
  6791. case mapCtorString: return mapTag;
  6792. case promiseCtorString: return promiseTag;
  6793. case setCtorString: return setTag;
  6794. case weakMapCtorString: return weakMapTag;
  6795. }
  6796. }
  6797. return result;
  6798. };
  6799. }
  6800. /**
  6801. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6802. *
  6803. * @private
  6804. * @param {number} start The start of the view.
  6805. * @param {number} end The end of the view.
  6806. * @param {Array} transforms The transformations to apply to the view.
  6807. * @returns {Object} Returns an object containing the `start` and `end`
  6808. * positions of the view.
  6809. */
  6810. function getView(start, end, transforms) {
  6811. var index = -1,
  6812. length = transforms.length;
  6813. while (++index < length) {
  6814. var data = transforms[index],
  6815. size = data.size;
  6816. switch (data.type) {
  6817. case 'drop': start += size; break;
  6818. case 'dropRight': end -= size; break;
  6819. case 'take': end = nativeMin(end, start + size); break;
  6820. case 'takeRight': start = nativeMax(start, end - size); break;
  6821. }
  6822. }
  6823. return { 'start': start, 'end': end };
  6824. }
  6825. /**
  6826. * Extracts wrapper details from the `source` body comment.
  6827. *
  6828. * @private
  6829. * @param {string} source The source to inspect.
  6830. * @returns {Array} Returns the wrapper details.
  6831. */
  6832. function getWrapDetails(source) {
  6833. var match = source.match(reWrapDetails);
  6834. return match ? match[1].split(reSplitDetails) : [];
  6835. }
  6836. /**
  6837. * Checks if `path` exists on `object`.
  6838. *
  6839. * @private
  6840. * @param {Object} object The object to query.
  6841. * @param {Array|string} path The path to check.
  6842. * @param {Function} hasFunc The function to check properties.
  6843. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6844. */
  6845. function hasPath(object, path, hasFunc) {
  6846. path = castPath(path, object);
  6847. var index = -1,
  6848. length = path.length,
  6849. result = false;
  6850. while (++index < length) {
  6851. var key = toKey(path[index]);
  6852. if (!(result = object != null && hasFunc(object, key))) {
  6853. break;
  6854. }
  6855. object = object[key];
  6856. }
  6857. if (result || ++index != length) {
  6858. return result;
  6859. }
  6860. length = object == null ? 0 : object.length;
  6861. return !!length && isLength(length) && isIndex(key, length) &&
  6862. (isArray(object) || isArguments(object));
  6863. }
  6864. /**
  6865. * Initializes an array clone.
  6866. *
  6867. * @private
  6868. * @param {Array} array The array to clone.
  6869. * @returns {Array} Returns the initialized clone.
  6870. */
  6871. function initCloneArray(array) {
  6872. var length = array.length,
  6873. result = new array.constructor(length);
  6874. // Add properties assigned by `RegExp#exec`.
  6875. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6876. result.index = array.index;
  6877. result.input = array.input;
  6878. }
  6879. return result;
  6880. }
  6881. /**
  6882. * Initializes an object clone.
  6883. *
  6884. * @private
  6885. * @param {Object} object The object to clone.
  6886. * @returns {Object} Returns the initialized clone.
  6887. */
  6888. function initCloneObject(object) {
  6889. return (typeof object.constructor == 'function' && !isPrototype(object))
  6890. ? baseCreate(getPrototype(object))
  6891. : {};
  6892. }
  6893. /**
  6894. * Initializes an object clone based on its `toStringTag`.
  6895. *
  6896. * **Note:** This function only supports cloning values with tags of
  6897. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6898. *
  6899. * @private
  6900. * @param {Object} object The object to clone.
  6901. * @param {string} tag The `toStringTag` of the object to clone.
  6902. * @param {boolean} [isDeep] Specify a deep clone.
  6903. * @returns {Object} Returns the initialized clone.
  6904. */
  6905. function initCloneByTag(object, tag, isDeep) {
  6906. var Ctor = object.constructor;
  6907. switch (tag) {
  6908. case arrayBufferTag:
  6909. return cloneArrayBuffer(object);
  6910. case boolTag:
  6911. case dateTag:
  6912. return new Ctor(+object);
  6913. case dataViewTag:
  6914. return cloneDataView(object, isDeep);
  6915. case float32Tag: case float64Tag:
  6916. case int8Tag: case int16Tag: case int32Tag:
  6917. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6918. return cloneTypedArray(object, isDeep);
  6919. case mapTag:
  6920. return new Ctor;
  6921. case numberTag:
  6922. case stringTag:
  6923. return new Ctor(object);
  6924. case regexpTag:
  6925. return cloneRegExp(object);
  6926. case setTag:
  6927. return new Ctor;
  6928. case symbolTag:
  6929. return cloneSymbol(object);
  6930. }
  6931. }
  6932. /**
  6933. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6934. *
  6935. * @private
  6936. * @param {string} source The source to modify.
  6937. * @returns {Array} details The details to insert.
  6938. * @returns {string} Returns the modified source.
  6939. */
  6940. function insertWrapDetails(source, details) {
  6941. var length = details.length;
  6942. if (!length) {
  6943. return source;
  6944. }
  6945. var lastIndex = length - 1;
  6946. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6947. details = details.join(length > 2 ? ', ' : ' ');
  6948. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6949. }
  6950. /**
  6951. * Checks if `value` is a flattenable `arguments` object or array.
  6952. *
  6953. * @private
  6954. * @param {*} value The value to check.
  6955. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6956. */
  6957. function isFlattenable(value) {
  6958. return isArray(value) || isArguments(value) ||
  6959. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6960. }
  6961. /**
  6962. * Checks if `value` is a valid array-like index.
  6963. *
  6964. * @private
  6965. * @param {*} value The value to check.
  6966. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6967. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6968. */
  6969. function isIndex(value, length) {
  6970. var type = typeof value;
  6971. length = length == null ? MAX_SAFE_INTEGER : length;
  6972. return !!length &&
  6973. (type == 'number' ||
  6974. (type != 'symbol' && reIsUint.test(value))) &&
  6975. (value > -1 && value % 1 == 0 && value < length);
  6976. }
  6977. /**
  6978. * Checks if the given arguments are from an iteratee call.
  6979. *
  6980. * @private
  6981. * @param {*} value The potential iteratee value argument.
  6982. * @param {*} index The potential iteratee index or key argument.
  6983. * @param {*} object The potential iteratee object argument.
  6984. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6985. * else `false`.
  6986. */
  6987. function isIterateeCall(value, index, object) {
  6988. if (!isObject(object)) {
  6989. return false;
  6990. }
  6991. var type = typeof index;
  6992. if (type == 'number'
  6993. ? (isArrayLike(object) && isIndex(index, object.length))
  6994. : (type == 'string' && index in object)
  6995. ) {
  6996. return eq(object[index], value);
  6997. }
  6998. return false;
  6999. }
  7000. /**
  7001. * Checks if `value` is a property name and not a property path.
  7002. *
  7003. * @private
  7004. * @param {*} value The value to check.
  7005. * @param {Object} [object] The object to query keys on.
  7006. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7007. */
  7008. function isKey(value, object) {
  7009. if (isArray(value)) {
  7010. return false;
  7011. }
  7012. var type = typeof value;
  7013. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7014. value == null || isSymbol(value)) {
  7015. return true;
  7016. }
  7017. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7018. (object != null && value in Object(object));
  7019. }
  7020. /**
  7021. * Checks if `value` is suitable for use as unique object key.
  7022. *
  7023. * @private
  7024. * @param {*} value The value to check.
  7025. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7026. */
  7027. function isKeyable(value) {
  7028. var type = typeof value;
  7029. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7030. ? (value !== '__proto__')
  7031. : (value === null);
  7032. }
  7033. /**
  7034. * Checks if `func` has a lazy counterpart.
  7035. *
  7036. * @private
  7037. * @param {Function} func The function to check.
  7038. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7039. * else `false`.
  7040. */
  7041. function isLaziable(func) {
  7042. var funcName = getFuncName(func),
  7043. other = lodash[funcName];
  7044. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7045. return false;
  7046. }
  7047. if (func === other) {
  7048. return true;
  7049. }
  7050. var data = getData(other);
  7051. return !!data && func === data[0];
  7052. }
  7053. /**
  7054. * Checks if `func` has its source masked.
  7055. *
  7056. * @private
  7057. * @param {Function} func The function to check.
  7058. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7059. */
  7060. function isMasked(func) {
  7061. return !!maskSrcKey && (maskSrcKey in func);
  7062. }
  7063. /**
  7064. * Checks if `func` is capable of being masked.
  7065. *
  7066. * @private
  7067. * @param {*} value The value to check.
  7068. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7069. */
  7070. var isMaskable = coreJsData ? isFunction : stubFalse;
  7071. /**
  7072. * Checks if `value` is likely a prototype object.
  7073. *
  7074. * @private
  7075. * @param {*} value The value to check.
  7076. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7077. */
  7078. function isPrototype(value) {
  7079. var Ctor = value && value.constructor,
  7080. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7081. return value === proto;
  7082. }
  7083. /**
  7084. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7085. *
  7086. * @private
  7087. * @param {*} value The value to check.
  7088. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7089. * equality comparisons, else `false`.
  7090. */
  7091. function isStrictComparable(value) {
  7092. return value === value && !isObject(value);
  7093. }
  7094. /**
  7095. * A specialized version of `matchesProperty` for source values suitable
  7096. * for strict equality comparisons, i.e. `===`.
  7097. *
  7098. * @private
  7099. * @param {string} key The key of the property to get.
  7100. * @param {*} srcValue The value to match.
  7101. * @returns {Function} Returns the new spec function.
  7102. */
  7103. function matchesStrictComparable(key, srcValue) {
  7104. return function(object) {
  7105. if (object == null) {
  7106. return false;
  7107. }
  7108. return object[key] === srcValue &&
  7109. (srcValue !== undefined || (key in Object(object)));
  7110. };
  7111. }
  7112. /**
  7113. * A specialized version of `_.memoize` which clears the memoized function's
  7114. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7115. *
  7116. * @private
  7117. * @param {Function} func The function to have its output memoized.
  7118. * @returns {Function} Returns the new memoized function.
  7119. */
  7120. function memoizeCapped(func) {
  7121. var result = memoize(func, function(key) {
  7122. if (cache.size === MAX_MEMOIZE_SIZE) {
  7123. cache.clear();
  7124. }
  7125. return key;
  7126. });
  7127. var cache = result.cache;
  7128. return result;
  7129. }
  7130. /**
  7131. * Merges the function metadata of `source` into `data`.
  7132. *
  7133. * Merging metadata reduces the number of wrappers used to invoke a function.
  7134. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7135. * may be applied regardless of execution order. Methods like `_.ary` and
  7136. * `_.rearg` modify function arguments, making the order in which they are
  7137. * executed important, preventing the merging of metadata. However, we make
  7138. * an exception for a safe combined case where curried functions have `_.ary`
  7139. * and or `_.rearg` applied.
  7140. *
  7141. * @private
  7142. * @param {Array} data The destination metadata.
  7143. * @param {Array} source The source metadata.
  7144. * @returns {Array} Returns `data`.
  7145. */
  7146. function mergeData(data, source) {
  7147. var bitmask = data[1],
  7148. srcBitmask = source[1],
  7149. newBitmask = bitmask | srcBitmask,
  7150. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7151. var isCombo =
  7152. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7153. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7154. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7155. // Exit early if metadata can't be merged.
  7156. if (!(isCommon || isCombo)) {
  7157. return data;
  7158. }
  7159. // Use source `thisArg` if available.
  7160. if (srcBitmask & WRAP_BIND_FLAG) {
  7161. data[2] = source[2];
  7162. // Set when currying a bound function.
  7163. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7164. }
  7165. // Compose partial arguments.
  7166. var value = source[3];
  7167. if (value) {
  7168. var partials = data[3];
  7169. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7170. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7171. }
  7172. // Compose partial right arguments.
  7173. value = source[5];
  7174. if (value) {
  7175. partials = data[5];
  7176. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7177. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7178. }
  7179. // Use source `argPos` if available.
  7180. value = source[7];
  7181. if (value) {
  7182. data[7] = value;
  7183. }
  7184. // Use source `ary` if it's smaller.
  7185. if (srcBitmask & WRAP_ARY_FLAG) {
  7186. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7187. }
  7188. // Use source `arity` if one is not provided.
  7189. if (data[9] == null) {
  7190. data[9] = source[9];
  7191. }
  7192. // Use source `func` and merge bitmasks.
  7193. data[0] = source[0];
  7194. data[1] = newBitmask;
  7195. return data;
  7196. }
  7197. /**
  7198. * This function is like
  7199. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7200. * except that it includes inherited enumerable properties.
  7201. *
  7202. * @private
  7203. * @param {Object} object The object to query.
  7204. * @returns {Array} Returns the array of property names.
  7205. */
  7206. function nativeKeysIn(object) {
  7207. var result = [];
  7208. if (object != null) {
  7209. for (var key in Object(object)) {
  7210. result.push(key);
  7211. }
  7212. }
  7213. return result;
  7214. }
  7215. /**
  7216. * Converts `value` to a string using `Object.prototype.toString`.
  7217. *
  7218. * @private
  7219. * @param {*} value The value to convert.
  7220. * @returns {string} Returns the converted string.
  7221. */
  7222. function objectToString(value) {
  7223. return nativeObjectToString.call(value);
  7224. }
  7225. /**
  7226. * A specialized version of `baseRest` which transforms the rest array.
  7227. *
  7228. * @private
  7229. * @param {Function} func The function to apply a rest parameter to.
  7230. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7231. * @param {Function} transform The rest array transform.
  7232. * @returns {Function} Returns the new function.
  7233. */
  7234. function overRest(func, start, transform) {
  7235. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7236. return function() {
  7237. var args = arguments,
  7238. index = -1,
  7239. length = nativeMax(args.length - start, 0),
  7240. array = Array(length);
  7241. while (++index < length) {
  7242. array[index] = args[start + index];
  7243. }
  7244. index = -1;
  7245. var otherArgs = Array(start + 1);
  7246. while (++index < start) {
  7247. otherArgs[index] = args[index];
  7248. }
  7249. otherArgs[start] = transform(array);
  7250. return apply(func, this, otherArgs);
  7251. };
  7252. }
  7253. /**
  7254. * Gets the parent value at `path` of `object`.
  7255. *
  7256. * @private
  7257. * @param {Object} object The object to query.
  7258. * @param {Array} path The path to get the parent value of.
  7259. * @returns {*} Returns the parent value.
  7260. */
  7261. function parent(object, path) {
  7262. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7263. }
  7264. /**
  7265. * Reorder `array` according to the specified indexes where the element at
  7266. * the first index is assigned as the first element, the element at
  7267. * the second index is assigned as the second element, and so on.
  7268. *
  7269. * @private
  7270. * @param {Array} array The array to reorder.
  7271. * @param {Array} indexes The arranged array indexes.
  7272. * @returns {Array} Returns `array`.
  7273. */
  7274. function reorder(array, indexes) {
  7275. var arrLength = array.length,
  7276. length = nativeMin(indexes.length, arrLength),
  7277. oldArray = copyArray(array);
  7278. while (length--) {
  7279. var index = indexes[length];
  7280. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7281. }
  7282. return array;
  7283. }
  7284. /**
  7285. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7286. *
  7287. * @private
  7288. * @param {Object} object The object to query.
  7289. * @param {string} key The key of the property to get.
  7290. * @returns {*} Returns the property value.
  7291. */
  7292. function safeGet(object, key) {
  7293. if (key === 'constructor' && typeof object[key] === 'function') {
  7294. return;
  7295. }
  7296. if (key == '__proto__') {
  7297. return;
  7298. }
  7299. return object[key];
  7300. }
  7301. /**
  7302. * Sets metadata for `func`.
  7303. *
  7304. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7305. * period of time, it will trip its breaker and transition to an identity
  7306. * function to avoid garbage collection pauses in V8. See
  7307. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7308. * for more details.
  7309. *
  7310. * @private
  7311. * @param {Function} func The function to associate metadata with.
  7312. * @param {*} data The metadata.
  7313. * @returns {Function} Returns `func`.
  7314. */
  7315. var setData = shortOut(baseSetData);
  7316. /**
  7317. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7318. *
  7319. * @private
  7320. * @param {Function} func The function to delay.
  7321. * @param {number} wait The number of milliseconds to delay invocation.
  7322. * @returns {number|Object} Returns the timer id or timeout object.
  7323. */
  7324. var setTimeout = ctxSetTimeout || function(func, wait) {
  7325. return root.setTimeout(func, wait);
  7326. };
  7327. /**
  7328. * Sets the `toString` method of `func` to return `string`.
  7329. *
  7330. * @private
  7331. * @param {Function} func The function to modify.
  7332. * @param {Function} string The `toString` result.
  7333. * @returns {Function} Returns `func`.
  7334. */
  7335. var setToString = shortOut(baseSetToString);
  7336. /**
  7337. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7338. * with wrapper details in a comment at the top of the source body.
  7339. *
  7340. * @private
  7341. * @param {Function} wrapper The function to modify.
  7342. * @param {Function} reference The reference function.
  7343. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7344. * @returns {Function} Returns `wrapper`.
  7345. */
  7346. function setWrapToString(wrapper, reference, bitmask) {
  7347. var source = (reference + '');
  7348. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7349. }
  7350. /**
  7351. * Creates a function that'll short out and invoke `identity` instead
  7352. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7353. * milliseconds.
  7354. *
  7355. * @private
  7356. * @param {Function} func The function to restrict.
  7357. * @returns {Function} Returns the new shortable function.
  7358. */
  7359. function shortOut(func) {
  7360. var count = 0,
  7361. lastCalled = 0;
  7362. return function() {
  7363. var stamp = nativeNow(),
  7364. remaining = HOT_SPAN - (stamp - lastCalled);
  7365. lastCalled = stamp;
  7366. if (remaining > 0) {
  7367. if (++count >= HOT_COUNT) {
  7368. return arguments[0];
  7369. }
  7370. } else {
  7371. count = 0;
  7372. }
  7373. return func.apply(undefined, arguments);
  7374. };
  7375. }
  7376. /**
  7377. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7378. *
  7379. * @private
  7380. * @param {Array} array The array to shuffle.
  7381. * @param {number} [size=array.length] The size of `array`.
  7382. * @returns {Array} Returns `array`.
  7383. */
  7384. function shuffleSelf(array, size) {
  7385. var index = -1,
  7386. length = array.length,
  7387. lastIndex = length - 1;
  7388. size = size === undefined ? length : size;
  7389. while (++index < size) {
  7390. var rand = baseRandom(index, lastIndex),
  7391. value = array[rand];
  7392. array[rand] = array[index];
  7393. array[index] = value;
  7394. }
  7395. array.length = size;
  7396. return array;
  7397. }
  7398. /**
  7399. * Converts `string` to a property path array.
  7400. *
  7401. * @private
  7402. * @param {string} string The string to convert.
  7403. * @returns {Array} Returns the property path array.
  7404. */
  7405. var stringToPath = memoizeCapped(function(string) {
  7406. var result = [];
  7407. if (string.charCodeAt(0) === 46 /* . */) {
  7408. result.push('');
  7409. }
  7410. string.replace(rePropName, function(match, number, quote, subString) {
  7411. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7412. });
  7413. return result;
  7414. });
  7415. /**
  7416. * Converts `value` to a string key if it's not a string or symbol.
  7417. *
  7418. * @private
  7419. * @param {*} value The value to inspect.
  7420. * @returns {string|symbol} Returns the key.
  7421. */
  7422. function toKey(value) {
  7423. if (typeof value == 'string' || isSymbol(value)) {
  7424. return value;
  7425. }
  7426. var result = (value + '');
  7427. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7428. }
  7429. /**
  7430. * Converts `func` to its source code.
  7431. *
  7432. * @private
  7433. * @param {Function} func The function to convert.
  7434. * @returns {string} Returns the source code.
  7435. */
  7436. function toSource(func) {
  7437. if (func != null) {
  7438. try {
  7439. return funcToString.call(func);
  7440. } catch (e) {}
  7441. try {
  7442. return (func + '');
  7443. } catch (e) {}
  7444. }
  7445. return '';
  7446. }
  7447. /**
  7448. * Updates wrapper `details` based on `bitmask` flags.
  7449. *
  7450. * @private
  7451. * @returns {Array} details The details to modify.
  7452. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7453. * @returns {Array} Returns `details`.
  7454. */
  7455. function updateWrapDetails(details, bitmask) {
  7456. arrayEach(wrapFlags, function(pair) {
  7457. var value = '_.' + pair[0];
  7458. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7459. details.push(value);
  7460. }
  7461. });
  7462. return details.sort();
  7463. }
  7464. /**
  7465. * Creates a clone of `wrapper`.
  7466. *
  7467. * @private
  7468. * @param {Object} wrapper The wrapper to clone.
  7469. * @returns {Object} Returns the cloned wrapper.
  7470. */
  7471. function wrapperClone(wrapper) {
  7472. if (wrapper instanceof LazyWrapper) {
  7473. return wrapper.clone();
  7474. }
  7475. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7476. result.__actions__ = copyArray(wrapper.__actions__);
  7477. result.__index__ = wrapper.__index__;
  7478. result.__values__ = wrapper.__values__;
  7479. return result;
  7480. }
  7481. /*------------------------------------------------------------------------*/
  7482. /**
  7483. * Creates an array of elements split into groups the length of `size`.
  7484. * If `array` can't be split evenly, the final chunk will be the remaining
  7485. * elements.
  7486. *
  7487. * @static
  7488. * @memberOf _
  7489. * @since 3.0.0
  7490. * @category Array
  7491. * @param {Array} array The array to process.
  7492. * @param {number} [size=1] The length of each chunk
  7493. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7494. * @returns {Array} Returns the new array of chunks.
  7495. * @example
  7496. *
  7497. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7498. * // => [['a', 'b'], ['c', 'd']]
  7499. *
  7500. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7501. * // => [['a', 'b', 'c'], ['d']]
  7502. */
  7503. function chunk(array, size, guard) {
  7504. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7505. size = 1;
  7506. } else {
  7507. size = nativeMax(toInteger(size), 0);
  7508. }
  7509. var length = array == null ? 0 : array.length;
  7510. if (!length || size < 1) {
  7511. return [];
  7512. }
  7513. var index = 0,
  7514. resIndex = 0,
  7515. result = Array(nativeCeil(length / size));
  7516. while (index < length) {
  7517. result[resIndex++] = baseSlice(array, index, (index += size));
  7518. }
  7519. return result;
  7520. }
  7521. /**
  7522. * Creates an array with all falsey values removed. The values `false`, `null`,
  7523. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7524. *
  7525. * @static
  7526. * @memberOf _
  7527. * @since 0.1.0
  7528. * @category Array
  7529. * @param {Array} array The array to compact.
  7530. * @returns {Array} Returns the new array of filtered values.
  7531. * @example
  7532. *
  7533. * _.compact([0, 1, false, 2, '', 3]);
  7534. * // => [1, 2, 3]
  7535. */
  7536. function compact(array) {
  7537. var index = -1,
  7538. length = array == null ? 0 : array.length,
  7539. resIndex = 0,
  7540. result = [];
  7541. while (++index < length) {
  7542. var value = array[index];
  7543. if (value) {
  7544. result[resIndex++] = value;
  7545. }
  7546. }
  7547. return result;
  7548. }
  7549. /**
  7550. * Creates a new array concatenating `array` with any additional arrays
  7551. * and/or values.
  7552. *
  7553. * @static
  7554. * @memberOf _
  7555. * @since 4.0.0
  7556. * @category Array
  7557. * @param {Array} array The array to concatenate.
  7558. * @param {...*} [values] The values to concatenate.
  7559. * @returns {Array} Returns the new concatenated array.
  7560. * @example
  7561. *
  7562. * var array = [1];
  7563. * var other = _.concat(array, 2, [3], [[4]]);
  7564. *
  7565. * console.log(other);
  7566. * // => [1, 2, 3, [4]]
  7567. *
  7568. * console.log(array);
  7569. * // => [1]
  7570. */
  7571. function concat() {
  7572. var length = arguments.length;
  7573. if (!length) {
  7574. return [];
  7575. }
  7576. var args = Array(length - 1),
  7577. array = arguments[0],
  7578. index = length;
  7579. while (index--) {
  7580. args[index - 1] = arguments[index];
  7581. }
  7582. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7583. }
  7584. /**
  7585. * Creates an array of `array` values not included in the other given arrays
  7586. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7587. * for equality comparisons. The order and references of result values are
  7588. * determined by the first array.
  7589. *
  7590. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7591. *
  7592. * @static
  7593. * @memberOf _
  7594. * @since 0.1.0
  7595. * @category Array
  7596. * @param {Array} array The array to inspect.
  7597. * @param {...Array} [values] The values to exclude.
  7598. * @returns {Array} Returns the new array of filtered values.
  7599. * @see _.without, _.xor
  7600. * @example
  7601. *
  7602. * _.difference([2, 1], [2, 3]);
  7603. * // => [1]
  7604. */
  7605. var difference = baseRest(function(array, values) {
  7606. return isArrayLikeObject(array)
  7607. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7608. : [];
  7609. });
  7610. /**
  7611. * This method is like `_.difference` except that it accepts `iteratee` which
  7612. * is invoked for each element of `array` and `values` to generate the criterion
  7613. * by which they're compared. The order and references of result values are
  7614. * determined by the first array. The iteratee is invoked with one argument:
  7615. * (value).
  7616. *
  7617. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7618. *
  7619. * @static
  7620. * @memberOf _
  7621. * @since 4.0.0
  7622. * @category Array
  7623. * @param {Array} array The array to inspect.
  7624. * @param {...Array} [values] The values to exclude.
  7625. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7626. * @returns {Array} Returns the new array of filtered values.
  7627. * @example
  7628. *
  7629. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7630. * // => [1.2]
  7631. *
  7632. * // The `_.property` iteratee shorthand.
  7633. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7634. * // => [{ 'x': 2 }]
  7635. */
  7636. var differenceBy = baseRest(function(array, values) {
  7637. var iteratee = last(values);
  7638. if (isArrayLikeObject(iteratee)) {
  7639. iteratee = undefined;
  7640. }
  7641. return isArrayLikeObject(array)
  7642. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7643. : [];
  7644. });
  7645. /**
  7646. * This method is like `_.difference` except that it accepts `comparator`
  7647. * which is invoked to compare elements of `array` to `values`. The order and
  7648. * references of result values are determined by the first array. The comparator
  7649. * is invoked with two arguments: (arrVal, othVal).
  7650. *
  7651. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7652. *
  7653. * @static
  7654. * @memberOf _
  7655. * @since 4.0.0
  7656. * @category Array
  7657. * @param {Array} array The array to inspect.
  7658. * @param {...Array} [values] The values to exclude.
  7659. * @param {Function} [comparator] The comparator invoked per element.
  7660. * @returns {Array} Returns the new array of filtered values.
  7661. * @example
  7662. *
  7663. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7664. *
  7665. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7666. * // => [{ 'x': 2, 'y': 1 }]
  7667. */
  7668. var differenceWith = baseRest(function(array, values) {
  7669. var comparator = last(values);
  7670. if (isArrayLikeObject(comparator)) {
  7671. comparator = undefined;
  7672. }
  7673. return isArrayLikeObject(array)
  7674. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7675. : [];
  7676. });
  7677. /**
  7678. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7679. *
  7680. * @static
  7681. * @memberOf _
  7682. * @since 0.5.0
  7683. * @category Array
  7684. * @param {Array} array The array to query.
  7685. * @param {number} [n=1] The number of elements to drop.
  7686. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7687. * @returns {Array} Returns the slice of `array`.
  7688. * @example
  7689. *
  7690. * _.drop([1, 2, 3]);
  7691. * // => [2, 3]
  7692. *
  7693. * _.drop([1, 2, 3], 2);
  7694. * // => [3]
  7695. *
  7696. * _.drop([1, 2, 3], 5);
  7697. * // => []
  7698. *
  7699. * _.drop([1, 2, 3], 0);
  7700. * // => [1, 2, 3]
  7701. */
  7702. function drop(array, n, guard) {
  7703. var length = array == null ? 0 : array.length;
  7704. if (!length) {
  7705. return [];
  7706. }
  7707. n = (guard || n === undefined) ? 1 : toInteger(n);
  7708. return baseSlice(array, n < 0 ? 0 : n, length);
  7709. }
  7710. /**
  7711. * Creates a slice of `array` with `n` elements dropped from the end.
  7712. *
  7713. * @static
  7714. * @memberOf _
  7715. * @since 3.0.0
  7716. * @category Array
  7717. * @param {Array} array The array to query.
  7718. * @param {number} [n=1] The number of elements to drop.
  7719. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7720. * @returns {Array} Returns the slice of `array`.
  7721. * @example
  7722. *
  7723. * _.dropRight([1, 2, 3]);
  7724. * // => [1, 2]
  7725. *
  7726. * _.dropRight([1, 2, 3], 2);
  7727. * // => [1]
  7728. *
  7729. * _.dropRight([1, 2, 3], 5);
  7730. * // => []
  7731. *
  7732. * _.dropRight([1, 2, 3], 0);
  7733. * // => [1, 2, 3]
  7734. */
  7735. function dropRight(array, n, guard) {
  7736. var length = array == null ? 0 : array.length;
  7737. if (!length) {
  7738. return [];
  7739. }
  7740. n = (guard || n === undefined) ? 1 : toInteger(n);
  7741. n = length - n;
  7742. return baseSlice(array, 0, n < 0 ? 0 : n);
  7743. }
  7744. /**
  7745. * Creates a slice of `array` excluding elements dropped from the end.
  7746. * Elements are dropped until `predicate` returns falsey. The predicate is
  7747. * invoked with three arguments: (value, index, array).
  7748. *
  7749. * @static
  7750. * @memberOf _
  7751. * @since 3.0.0
  7752. * @category Array
  7753. * @param {Array} array The array to query.
  7754. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7755. * @returns {Array} Returns the slice of `array`.
  7756. * @example
  7757. *
  7758. * var users = [
  7759. * { 'user': 'barney', 'active': true },
  7760. * { 'user': 'fred', 'active': false },
  7761. * { 'user': 'pebbles', 'active': false }
  7762. * ];
  7763. *
  7764. * _.dropRightWhile(users, function(o) { return !o.active; });
  7765. * // => objects for ['barney']
  7766. *
  7767. * // The `_.matches` iteratee shorthand.
  7768. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7769. * // => objects for ['barney', 'fred']
  7770. *
  7771. * // The `_.matchesProperty` iteratee shorthand.
  7772. * _.dropRightWhile(users, ['active', false]);
  7773. * // => objects for ['barney']
  7774. *
  7775. * // The `_.property` iteratee shorthand.
  7776. * _.dropRightWhile(users, 'active');
  7777. * // => objects for ['barney', 'fred', 'pebbles']
  7778. */
  7779. function dropRightWhile(array, predicate) {
  7780. return (array && array.length)
  7781. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7782. : [];
  7783. }
  7784. /**
  7785. * Creates a slice of `array` excluding elements dropped from the beginning.
  7786. * Elements are dropped until `predicate` returns falsey. The predicate is
  7787. * invoked with three arguments: (value, index, array).
  7788. *
  7789. * @static
  7790. * @memberOf _
  7791. * @since 3.0.0
  7792. * @category Array
  7793. * @param {Array} array The array to query.
  7794. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7795. * @returns {Array} Returns the slice of `array`.
  7796. * @example
  7797. *
  7798. * var users = [
  7799. * { 'user': 'barney', 'active': false },
  7800. * { 'user': 'fred', 'active': false },
  7801. * { 'user': 'pebbles', 'active': true }
  7802. * ];
  7803. *
  7804. * _.dropWhile(users, function(o) { return !o.active; });
  7805. * // => objects for ['pebbles']
  7806. *
  7807. * // The `_.matches` iteratee shorthand.
  7808. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7809. * // => objects for ['fred', 'pebbles']
  7810. *
  7811. * // The `_.matchesProperty` iteratee shorthand.
  7812. * _.dropWhile(users, ['active', false]);
  7813. * // => objects for ['pebbles']
  7814. *
  7815. * // The `_.property` iteratee shorthand.
  7816. * _.dropWhile(users, 'active');
  7817. * // => objects for ['barney', 'fred', 'pebbles']
  7818. */
  7819. function dropWhile(array, predicate) {
  7820. return (array && array.length)
  7821. ? baseWhile(array, getIteratee(predicate, 3), true)
  7822. : [];
  7823. }
  7824. /**
  7825. * Fills elements of `array` with `value` from `start` up to, but not
  7826. * including, `end`.
  7827. *
  7828. * **Note:** This method mutates `array`.
  7829. *
  7830. * @static
  7831. * @memberOf _
  7832. * @since 3.2.0
  7833. * @category Array
  7834. * @param {Array} array The array to fill.
  7835. * @param {*} value The value to fill `array` with.
  7836. * @param {number} [start=0] The start position.
  7837. * @param {number} [end=array.length] The end position.
  7838. * @returns {Array} Returns `array`.
  7839. * @example
  7840. *
  7841. * var array = [1, 2, 3];
  7842. *
  7843. * _.fill(array, 'a');
  7844. * console.log(array);
  7845. * // => ['a', 'a', 'a']
  7846. *
  7847. * _.fill(Array(3), 2);
  7848. * // => [2, 2, 2]
  7849. *
  7850. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7851. * // => [4, '*', '*', 10]
  7852. */
  7853. function fill(array, value, start, end) {
  7854. var length = array == null ? 0 : array.length;
  7855. if (!length) {
  7856. return [];
  7857. }
  7858. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7859. start = 0;
  7860. end = length;
  7861. }
  7862. return baseFill(array, value, start, end);
  7863. }
  7864. /**
  7865. * This method is like `_.find` except that it returns the index of the first
  7866. * element `predicate` returns truthy for instead of the element itself.
  7867. *
  7868. * @static
  7869. * @memberOf _
  7870. * @since 1.1.0
  7871. * @category Array
  7872. * @param {Array} array The array to inspect.
  7873. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7874. * @param {number} [fromIndex=0] The index to search from.
  7875. * @returns {number} Returns the index of the found element, else `-1`.
  7876. * @example
  7877. *
  7878. * var users = [
  7879. * { 'user': 'barney', 'active': false },
  7880. * { 'user': 'fred', 'active': false },
  7881. * { 'user': 'pebbles', 'active': true }
  7882. * ];
  7883. *
  7884. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7885. * // => 0
  7886. *
  7887. * // The `_.matches` iteratee shorthand.
  7888. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7889. * // => 1
  7890. *
  7891. * // The `_.matchesProperty` iteratee shorthand.
  7892. * _.findIndex(users, ['active', false]);
  7893. * // => 0
  7894. *
  7895. * // The `_.property` iteratee shorthand.
  7896. * _.findIndex(users, 'active');
  7897. * // => 2
  7898. */
  7899. function findIndex(array, predicate, fromIndex) {
  7900. var length = array == null ? 0 : array.length;
  7901. if (!length) {
  7902. return -1;
  7903. }
  7904. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7905. if (index < 0) {
  7906. index = nativeMax(length + index, 0);
  7907. }
  7908. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7909. }
  7910. /**
  7911. * This method is like `_.findIndex` except that it iterates over elements
  7912. * of `collection` from right to left.
  7913. *
  7914. * @static
  7915. * @memberOf _
  7916. * @since 2.0.0
  7917. * @category Array
  7918. * @param {Array} array The array to inspect.
  7919. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7920. * @param {number} [fromIndex=array.length-1] The index to search from.
  7921. * @returns {number} Returns the index of the found element, else `-1`.
  7922. * @example
  7923. *
  7924. * var users = [
  7925. * { 'user': 'barney', 'active': true },
  7926. * { 'user': 'fred', 'active': false },
  7927. * { 'user': 'pebbles', 'active': false }
  7928. * ];
  7929. *
  7930. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7931. * // => 2
  7932. *
  7933. * // The `_.matches` iteratee shorthand.
  7934. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7935. * // => 0
  7936. *
  7937. * // The `_.matchesProperty` iteratee shorthand.
  7938. * _.findLastIndex(users, ['active', false]);
  7939. * // => 2
  7940. *
  7941. * // The `_.property` iteratee shorthand.
  7942. * _.findLastIndex(users, 'active');
  7943. * // => 0
  7944. */
  7945. function findLastIndex(array, predicate, fromIndex) {
  7946. var length = array == null ? 0 : array.length;
  7947. if (!length) {
  7948. return -1;
  7949. }
  7950. var index = length - 1;
  7951. if (fromIndex !== undefined) {
  7952. index = toInteger(fromIndex);
  7953. index = fromIndex < 0
  7954. ? nativeMax(length + index, 0)
  7955. : nativeMin(index, length - 1);
  7956. }
  7957. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7958. }
  7959. /**
  7960. * Flattens `array` a single level deep.
  7961. *
  7962. * @static
  7963. * @memberOf _
  7964. * @since 0.1.0
  7965. * @category Array
  7966. * @param {Array} array The array to flatten.
  7967. * @returns {Array} Returns the new flattened array.
  7968. * @example
  7969. *
  7970. * _.flatten([1, [2, [3, [4]], 5]]);
  7971. * // => [1, 2, [3, [4]], 5]
  7972. */
  7973. function flatten(array) {
  7974. var length = array == null ? 0 : array.length;
  7975. return length ? baseFlatten(array, 1) : [];
  7976. }
  7977. /**
  7978. * Recursively flattens `array`.
  7979. *
  7980. * @static
  7981. * @memberOf _
  7982. * @since 3.0.0
  7983. * @category Array
  7984. * @param {Array} array The array to flatten.
  7985. * @returns {Array} Returns the new flattened array.
  7986. * @example
  7987. *
  7988. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7989. * // => [1, 2, 3, 4, 5]
  7990. */
  7991. function flattenDeep(array) {
  7992. var length = array == null ? 0 : array.length;
  7993. return length ? baseFlatten(array, INFINITY) : [];
  7994. }
  7995. /**
  7996. * Recursively flatten `array` up to `depth` times.
  7997. *
  7998. * @static
  7999. * @memberOf _
  8000. * @since 4.4.0
  8001. * @category Array
  8002. * @param {Array} array The array to flatten.
  8003. * @param {number} [depth=1] The maximum recursion depth.
  8004. * @returns {Array} Returns the new flattened array.
  8005. * @example
  8006. *
  8007. * var array = [1, [2, [3, [4]], 5]];
  8008. *
  8009. * _.flattenDepth(array, 1);
  8010. * // => [1, 2, [3, [4]], 5]
  8011. *
  8012. * _.flattenDepth(array, 2);
  8013. * // => [1, 2, 3, [4], 5]
  8014. */
  8015. function flattenDepth(array, depth) {
  8016. var length = array == null ? 0 : array.length;
  8017. if (!length) {
  8018. return [];
  8019. }
  8020. depth = depth === undefined ? 1 : toInteger(depth);
  8021. return baseFlatten(array, depth);
  8022. }
  8023. /**
  8024. * The inverse of `_.toPairs`; this method returns an object composed
  8025. * from key-value `pairs`.
  8026. *
  8027. * @static
  8028. * @memberOf _
  8029. * @since 4.0.0
  8030. * @category Array
  8031. * @param {Array} pairs The key-value pairs.
  8032. * @returns {Object} Returns the new object.
  8033. * @example
  8034. *
  8035. * _.fromPairs([['a', 1], ['b', 2]]);
  8036. * // => { 'a': 1, 'b': 2 }
  8037. */
  8038. function fromPairs(pairs) {
  8039. var index = -1,
  8040. length = pairs == null ? 0 : pairs.length,
  8041. result = {};
  8042. while (++index < length) {
  8043. var pair = pairs[index];
  8044. result[pair[0]] = pair[1];
  8045. }
  8046. return result;
  8047. }
  8048. /**
  8049. * Gets the first element of `array`.
  8050. *
  8051. * @static
  8052. * @memberOf _
  8053. * @since 0.1.0
  8054. * @alias first
  8055. * @category Array
  8056. * @param {Array} array The array to query.
  8057. * @returns {*} Returns the first element of `array`.
  8058. * @example
  8059. *
  8060. * _.head([1, 2, 3]);
  8061. * // => 1
  8062. *
  8063. * _.head([]);
  8064. * // => undefined
  8065. */
  8066. function head(array) {
  8067. return (array && array.length) ? array[0] : undefined;
  8068. }
  8069. /**
  8070. * Gets the index at which the first occurrence of `value` is found in `array`
  8071. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8072. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8073. * offset from the end of `array`.
  8074. *
  8075. * @static
  8076. * @memberOf _
  8077. * @since 0.1.0
  8078. * @category Array
  8079. * @param {Array} array The array to inspect.
  8080. * @param {*} value The value to search for.
  8081. * @param {number} [fromIndex=0] The index to search from.
  8082. * @returns {number} Returns the index of the matched value, else `-1`.
  8083. * @example
  8084. *
  8085. * _.indexOf([1, 2, 1, 2], 2);
  8086. * // => 1
  8087. *
  8088. * // Search from the `fromIndex`.
  8089. * _.indexOf([1, 2, 1, 2], 2, 2);
  8090. * // => 3
  8091. */
  8092. function indexOf(array, value, fromIndex) {
  8093. var length = array == null ? 0 : array.length;
  8094. if (!length) {
  8095. return -1;
  8096. }
  8097. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8098. if (index < 0) {
  8099. index = nativeMax(length + index, 0);
  8100. }
  8101. return baseIndexOf(array, value, index);
  8102. }
  8103. /**
  8104. * Gets all but the last element of `array`.
  8105. *
  8106. * @static
  8107. * @memberOf _
  8108. * @since 0.1.0
  8109. * @category Array
  8110. * @param {Array} array The array to query.
  8111. * @returns {Array} Returns the slice of `array`.
  8112. * @example
  8113. *
  8114. * _.initial([1, 2, 3]);
  8115. * // => [1, 2]
  8116. */
  8117. function initial(array) {
  8118. var length = array == null ? 0 : array.length;
  8119. return length ? baseSlice(array, 0, -1) : [];
  8120. }
  8121. /**
  8122. * Creates an array of unique values that are included in all given arrays
  8123. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8124. * for equality comparisons. The order and references of result values are
  8125. * determined by the first array.
  8126. *
  8127. * @static
  8128. * @memberOf _
  8129. * @since 0.1.0
  8130. * @category Array
  8131. * @param {...Array} [arrays] The arrays to inspect.
  8132. * @returns {Array} Returns the new array of intersecting values.
  8133. * @example
  8134. *
  8135. * _.intersection([2, 1], [2, 3]);
  8136. * // => [2]
  8137. */
  8138. var intersection = baseRest(function(arrays) {
  8139. var mapped = arrayMap(arrays, castArrayLikeObject);
  8140. return (mapped.length && mapped[0] === arrays[0])
  8141. ? baseIntersection(mapped)
  8142. : [];
  8143. });
  8144. /**
  8145. * This method is like `_.intersection` except that it accepts `iteratee`
  8146. * which is invoked for each element of each `arrays` to generate the criterion
  8147. * by which they're compared. The order and references of result values are
  8148. * determined by the first array. The iteratee is invoked with one argument:
  8149. * (value).
  8150. *
  8151. * @static
  8152. * @memberOf _
  8153. * @since 4.0.0
  8154. * @category Array
  8155. * @param {...Array} [arrays] The arrays to inspect.
  8156. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8157. * @returns {Array} Returns the new array of intersecting values.
  8158. * @example
  8159. *
  8160. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8161. * // => [2.1]
  8162. *
  8163. * // The `_.property` iteratee shorthand.
  8164. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8165. * // => [{ 'x': 1 }]
  8166. */
  8167. var intersectionBy = baseRest(function(arrays) {
  8168. var iteratee = last(arrays),
  8169. mapped = arrayMap(arrays, castArrayLikeObject);
  8170. if (iteratee === last(mapped)) {
  8171. iteratee = undefined;
  8172. } else {
  8173. mapped.pop();
  8174. }
  8175. return (mapped.length && mapped[0] === arrays[0])
  8176. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8177. : [];
  8178. });
  8179. /**
  8180. * This method is like `_.intersection` except that it accepts `comparator`
  8181. * which is invoked to compare elements of `arrays`. The order and references
  8182. * of result values are determined by the first array. The comparator is
  8183. * invoked with two arguments: (arrVal, othVal).
  8184. *
  8185. * @static
  8186. * @memberOf _
  8187. * @since 4.0.0
  8188. * @category Array
  8189. * @param {...Array} [arrays] The arrays to inspect.
  8190. * @param {Function} [comparator] The comparator invoked per element.
  8191. * @returns {Array} Returns the new array of intersecting values.
  8192. * @example
  8193. *
  8194. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8195. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8196. *
  8197. * _.intersectionWith(objects, others, _.isEqual);
  8198. * // => [{ 'x': 1, 'y': 2 }]
  8199. */
  8200. var intersectionWith = baseRest(function(arrays) {
  8201. var comparator = last(arrays),
  8202. mapped = arrayMap(arrays, castArrayLikeObject);
  8203. comparator = typeof comparator == 'function' ? comparator : undefined;
  8204. if (comparator) {
  8205. mapped.pop();
  8206. }
  8207. return (mapped.length && mapped[0] === arrays[0])
  8208. ? baseIntersection(mapped, undefined, comparator)
  8209. : [];
  8210. });
  8211. /**
  8212. * Converts all elements in `array` into a string separated by `separator`.
  8213. *
  8214. * @static
  8215. * @memberOf _
  8216. * @since 4.0.0
  8217. * @category Array
  8218. * @param {Array} array The array to convert.
  8219. * @param {string} [separator=','] The element separator.
  8220. * @returns {string} Returns the joined string.
  8221. * @example
  8222. *
  8223. * _.join(['a', 'b', 'c'], '~');
  8224. * // => 'a~b~c'
  8225. */
  8226. function join(array, separator) {
  8227. return array == null ? '' : nativeJoin.call(array, separator);
  8228. }
  8229. /**
  8230. * Gets the last element of `array`.
  8231. *
  8232. * @static
  8233. * @memberOf _
  8234. * @since 0.1.0
  8235. * @category Array
  8236. * @param {Array} array The array to query.
  8237. * @returns {*} Returns the last element of `array`.
  8238. * @example
  8239. *
  8240. * _.last([1, 2, 3]);
  8241. * // => 3
  8242. */
  8243. function last(array) {
  8244. var length = array == null ? 0 : array.length;
  8245. return length ? array[length - 1] : undefined;
  8246. }
  8247. /**
  8248. * This method is like `_.indexOf` except that it iterates over elements of
  8249. * `array` from right to left.
  8250. *
  8251. * @static
  8252. * @memberOf _
  8253. * @since 0.1.0
  8254. * @category Array
  8255. * @param {Array} array The array to inspect.
  8256. * @param {*} value The value to search for.
  8257. * @param {number} [fromIndex=array.length-1] The index to search from.
  8258. * @returns {number} Returns the index of the matched value, else `-1`.
  8259. * @example
  8260. *
  8261. * _.lastIndexOf([1, 2, 1, 2], 2);
  8262. * // => 3
  8263. *
  8264. * // Search from the `fromIndex`.
  8265. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8266. * // => 1
  8267. */
  8268. function lastIndexOf(array, value, fromIndex) {
  8269. var length = array == null ? 0 : array.length;
  8270. if (!length) {
  8271. return -1;
  8272. }
  8273. var index = length;
  8274. if (fromIndex !== undefined) {
  8275. index = toInteger(fromIndex);
  8276. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8277. }
  8278. return value === value
  8279. ? strictLastIndexOf(array, value, index)
  8280. : baseFindIndex(array, baseIsNaN, index, true);
  8281. }
  8282. /**
  8283. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8284. * element from the end is returned.
  8285. *
  8286. * @static
  8287. * @memberOf _
  8288. * @since 4.11.0
  8289. * @category Array
  8290. * @param {Array} array The array to query.
  8291. * @param {number} [n=0] The index of the element to return.
  8292. * @returns {*} Returns the nth element of `array`.
  8293. * @example
  8294. *
  8295. * var array = ['a', 'b', 'c', 'd'];
  8296. *
  8297. * _.nth(array, 1);
  8298. * // => 'b'
  8299. *
  8300. * _.nth(array, -2);
  8301. * // => 'c';
  8302. */
  8303. function nth(array, n) {
  8304. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8305. }
  8306. /**
  8307. * Removes all given values from `array` using
  8308. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8309. * for equality comparisons.
  8310. *
  8311. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8312. * to remove elements from an array by predicate.
  8313. *
  8314. * @static
  8315. * @memberOf _
  8316. * @since 2.0.0
  8317. * @category Array
  8318. * @param {Array} array The array to modify.
  8319. * @param {...*} [values] The values to remove.
  8320. * @returns {Array} Returns `array`.
  8321. * @example
  8322. *
  8323. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8324. *
  8325. * _.pull(array, 'a', 'c');
  8326. * console.log(array);
  8327. * // => ['b', 'b']
  8328. */
  8329. var pull = baseRest(pullAll);
  8330. /**
  8331. * This method is like `_.pull` except that it accepts an array of values to remove.
  8332. *
  8333. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8334. *
  8335. * @static
  8336. * @memberOf _
  8337. * @since 4.0.0
  8338. * @category Array
  8339. * @param {Array} array The array to modify.
  8340. * @param {Array} values The values to remove.
  8341. * @returns {Array} Returns `array`.
  8342. * @example
  8343. *
  8344. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8345. *
  8346. * _.pullAll(array, ['a', 'c']);
  8347. * console.log(array);
  8348. * // => ['b', 'b']
  8349. */
  8350. function pullAll(array, values) {
  8351. return (array && array.length && values && values.length)
  8352. ? basePullAll(array, values)
  8353. : array;
  8354. }
  8355. /**
  8356. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8357. * invoked for each element of `array` and `values` to generate the criterion
  8358. * by which they're compared. The iteratee is invoked with one argument: (value).
  8359. *
  8360. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8361. *
  8362. * @static
  8363. * @memberOf _
  8364. * @since 4.0.0
  8365. * @category Array
  8366. * @param {Array} array The array to modify.
  8367. * @param {Array} values The values to remove.
  8368. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8369. * @returns {Array} Returns `array`.
  8370. * @example
  8371. *
  8372. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8373. *
  8374. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8375. * console.log(array);
  8376. * // => [{ 'x': 2 }]
  8377. */
  8378. function pullAllBy(array, values, iteratee) {
  8379. return (array && array.length && values && values.length)
  8380. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8381. : array;
  8382. }
  8383. /**
  8384. * This method is like `_.pullAll` except that it accepts `comparator` which
  8385. * is invoked to compare elements of `array` to `values`. The comparator is
  8386. * invoked with two arguments: (arrVal, othVal).
  8387. *
  8388. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8389. *
  8390. * @static
  8391. * @memberOf _
  8392. * @since 4.6.0
  8393. * @category Array
  8394. * @param {Array} array The array to modify.
  8395. * @param {Array} values The values to remove.
  8396. * @param {Function} [comparator] The comparator invoked per element.
  8397. * @returns {Array} Returns `array`.
  8398. * @example
  8399. *
  8400. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8401. *
  8402. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8403. * console.log(array);
  8404. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8405. */
  8406. function pullAllWith(array, values, comparator) {
  8407. return (array && array.length && values && values.length)
  8408. ? basePullAll(array, values, undefined, comparator)
  8409. : array;
  8410. }
  8411. /**
  8412. * Removes elements from `array` corresponding to `indexes` and returns an
  8413. * array of removed elements.
  8414. *
  8415. * **Note:** Unlike `_.at`, this method mutates `array`.
  8416. *
  8417. * @static
  8418. * @memberOf _
  8419. * @since 3.0.0
  8420. * @category Array
  8421. * @param {Array} array The array to modify.
  8422. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8423. * @returns {Array} Returns the new array of removed elements.
  8424. * @example
  8425. *
  8426. * var array = ['a', 'b', 'c', 'd'];
  8427. * var pulled = _.pullAt(array, [1, 3]);
  8428. *
  8429. * console.log(array);
  8430. * // => ['a', 'c']
  8431. *
  8432. * console.log(pulled);
  8433. * // => ['b', 'd']
  8434. */
  8435. var pullAt = flatRest(function(array, indexes) {
  8436. var length = array == null ? 0 : array.length,
  8437. result = baseAt(array, indexes);
  8438. basePullAt(array, arrayMap(indexes, function(index) {
  8439. return isIndex(index, length) ? +index : index;
  8440. }).sort(compareAscending));
  8441. return result;
  8442. });
  8443. /**
  8444. * Removes all elements from `array` that `predicate` returns truthy for
  8445. * and returns an array of the removed elements. The predicate is invoked
  8446. * with three arguments: (value, index, array).
  8447. *
  8448. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8449. * to pull elements from an array by value.
  8450. *
  8451. * @static
  8452. * @memberOf _
  8453. * @since 2.0.0
  8454. * @category Array
  8455. * @param {Array} array The array to modify.
  8456. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8457. * @returns {Array} Returns the new array of removed elements.
  8458. * @example
  8459. *
  8460. * var array = [1, 2, 3, 4];
  8461. * var evens = _.remove(array, function(n) {
  8462. * return n % 2 == 0;
  8463. * });
  8464. *
  8465. * console.log(array);
  8466. * // => [1, 3]
  8467. *
  8468. * console.log(evens);
  8469. * // => [2, 4]
  8470. */
  8471. function remove(array, predicate) {
  8472. var result = [];
  8473. if (!(array && array.length)) {
  8474. return result;
  8475. }
  8476. var index = -1,
  8477. indexes = [],
  8478. length = array.length;
  8479. predicate = getIteratee(predicate, 3);
  8480. while (++index < length) {
  8481. var value = array[index];
  8482. if (predicate(value, index, array)) {
  8483. result.push(value);
  8484. indexes.push(index);
  8485. }
  8486. }
  8487. basePullAt(array, indexes);
  8488. return result;
  8489. }
  8490. /**
  8491. * Reverses `array` so that the first element becomes the last, the second
  8492. * element becomes the second to last, and so on.
  8493. *
  8494. * **Note:** This method mutates `array` and is based on
  8495. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8496. *
  8497. * @static
  8498. * @memberOf _
  8499. * @since 4.0.0
  8500. * @category Array
  8501. * @param {Array} array The array to modify.
  8502. * @returns {Array} Returns `array`.
  8503. * @example
  8504. *
  8505. * var array = [1, 2, 3];
  8506. *
  8507. * _.reverse(array);
  8508. * // => [3, 2, 1]
  8509. *
  8510. * console.log(array);
  8511. * // => [3, 2, 1]
  8512. */
  8513. function reverse(array) {
  8514. return array == null ? array : nativeReverse.call(array);
  8515. }
  8516. /**
  8517. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8518. *
  8519. * **Note:** This method is used instead of
  8520. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8521. * returned.
  8522. *
  8523. * @static
  8524. * @memberOf _
  8525. * @since 3.0.0
  8526. * @category Array
  8527. * @param {Array} array The array to slice.
  8528. * @param {number} [start=0] The start position.
  8529. * @param {number} [end=array.length] The end position.
  8530. * @returns {Array} Returns the slice of `array`.
  8531. */
  8532. function slice(array, start, end) {
  8533. var length = array == null ? 0 : array.length;
  8534. if (!length) {
  8535. return [];
  8536. }
  8537. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8538. start = 0;
  8539. end = length;
  8540. }
  8541. else {
  8542. start = start == null ? 0 : toInteger(start);
  8543. end = end === undefined ? length : toInteger(end);
  8544. }
  8545. return baseSlice(array, start, end);
  8546. }
  8547. /**
  8548. * Uses a binary search to determine the lowest index at which `value`
  8549. * should be inserted into `array` in order to maintain its sort order.
  8550. *
  8551. * @static
  8552. * @memberOf _
  8553. * @since 0.1.0
  8554. * @category Array
  8555. * @param {Array} array The sorted array to inspect.
  8556. * @param {*} value The value to evaluate.
  8557. * @returns {number} Returns the index at which `value` should be inserted
  8558. * into `array`.
  8559. * @example
  8560. *
  8561. * _.sortedIndex([30, 50], 40);
  8562. * // => 1
  8563. */
  8564. function sortedIndex(array, value) {
  8565. return baseSortedIndex(array, value);
  8566. }
  8567. /**
  8568. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8569. * which is invoked for `value` and each element of `array` to compute their
  8570. * sort ranking. The iteratee is invoked with one argument: (value).
  8571. *
  8572. * @static
  8573. * @memberOf _
  8574. * @since 4.0.0
  8575. * @category Array
  8576. * @param {Array} array The sorted array to inspect.
  8577. * @param {*} value The value to evaluate.
  8578. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8579. * @returns {number} Returns the index at which `value` should be inserted
  8580. * into `array`.
  8581. * @example
  8582. *
  8583. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8584. *
  8585. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8586. * // => 0
  8587. *
  8588. * // The `_.property` iteratee shorthand.
  8589. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8590. * // => 0
  8591. */
  8592. function sortedIndexBy(array, value, iteratee) {
  8593. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8594. }
  8595. /**
  8596. * This method is like `_.indexOf` except that it performs a binary
  8597. * search on a sorted `array`.
  8598. *
  8599. * @static
  8600. * @memberOf _
  8601. * @since 4.0.0
  8602. * @category Array
  8603. * @param {Array} array The array to inspect.
  8604. * @param {*} value The value to search for.
  8605. * @returns {number} Returns the index of the matched value, else `-1`.
  8606. * @example
  8607. *
  8608. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8609. * // => 1
  8610. */
  8611. function sortedIndexOf(array, value) {
  8612. var length = array == null ? 0 : array.length;
  8613. if (length) {
  8614. var index = baseSortedIndex(array, value);
  8615. if (index < length && eq(array[index], value)) {
  8616. return index;
  8617. }
  8618. }
  8619. return -1;
  8620. }
  8621. /**
  8622. * This method is like `_.sortedIndex` except that it returns the highest
  8623. * index at which `value` should be inserted into `array` in order to
  8624. * maintain its sort order.
  8625. *
  8626. * @static
  8627. * @memberOf _
  8628. * @since 3.0.0
  8629. * @category Array
  8630. * @param {Array} array The sorted array to inspect.
  8631. * @param {*} value The value to evaluate.
  8632. * @returns {number} Returns the index at which `value` should be inserted
  8633. * into `array`.
  8634. * @example
  8635. *
  8636. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8637. * // => 4
  8638. */
  8639. function sortedLastIndex(array, value) {
  8640. return baseSortedIndex(array, value, true);
  8641. }
  8642. /**
  8643. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8644. * which is invoked for `value` and each element of `array` to compute their
  8645. * sort ranking. The iteratee is invoked with one argument: (value).
  8646. *
  8647. * @static
  8648. * @memberOf _
  8649. * @since 4.0.0
  8650. * @category Array
  8651. * @param {Array} array The sorted array to inspect.
  8652. * @param {*} value The value to evaluate.
  8653. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8654. * @returns {number} Returns the index at which `value` should be inserted
  8655. * into `array`.
  8656. * @example
  8657. *
  8658. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8659. *
  8660. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8661. * // => 1
  8662. *
  8663. * // The `_.property` iteratee shorthand.
  8664. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8665. * // => 1
  8666. */
  8667. function sortedLastIndexBy(array, value, iteratee) {
  8668. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8669. }
  8670. /**
  8671. * This method is like `_.lastIndexOf` except that it performs a binary
  8672. * search on a sorted `array`.
  8673. *
  8674. * @static
  8675. * @memberOf _
  8676. * @since 4.0.0
  8677. * @category Array
  8678. * @param {Array} array The array to inspect.
  8679. * @param {*} value The value to search for.
  8680. * @returns {number} Returns the index of the matched value, else `-1`.
  8681. * @example
  8682. *
  8683. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8684. * // => 3
  8685. */
  8686. function sortedLastIndexOf(array, value) {
  8687. var length = array == null ? 0 : array.length;
  8688. if (length) {
  8689. var index = baseSortedIndex(array, value, true) - 1;
  8690. if (eq(array[index], value)) {
  8691. return index;
  8692. }
  8693. }
  8694. return -1;
  8695. }
  8696. /**
  8697. * This method is like `_.uniq` except that it's designed and optimized
  8698. * for sorted arrays.
  8699. *
  8700. * @static
  8701. * @memberOf _
  8702. * @since 4.0.0
  8703. * @category Array
  8704. * @param {Array} array The array to inspect.
  8705. * @returns {Array} Returns the new duplicate free array.
  8706. * @example
  8707. *
  8708. * _.sortedUniq([1, 1, 2]);
  8709. * // => [1, 2]
  8710. */
  8711. function sortedUniq(array) {
  8712. return (array && array.length)
  8713. ? baseSortedUniq(array)
  8714. : [];
  8715. }
  8716. /**
  8717. * This method is like `_.uniqBy` except that it's designed and optimized
  8718. * for sorted arrays.
  8719. *
  8720. * @static
  8721. * @memberOf _
  8722. * @since 4.0.0
  8723. * @category Array
  8724. * @param {Array} array The array to inspect.
  8725. * @param {Function} [iteratee] The iteratee invoked per element.
  8726. * @returns {Array} Returns the new duplicate free array.
  8727. * @example
  8728. *
  8729. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8730. * // => [1.1, 2.3]
  8731. */
  8732. function sortedUniqBy(array, iteratee) {
  8733. return (array && array.length)
  8734. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8735. : [];
  8736. }
  8737. /**
  8738. * Gets all but the first element of `array`.
  8739. *
  8740. * @static
  8741. * @memberOf _
  8742. * @since 4.0.0
  8743. * @category Array
  8744. * @param {Array} array The array to query.
  8745. * @returns {Array} Returns the slice of `array`.
  8746. * @example
  8747. *
  8748. * _.tail([1, 2, 3]);
  8749. * // => [2, 3]
  8750. */
  8751. function tail(array) {
  8752. var length = array == null ? 0 : array.length;
  8753. return length ? baseSlice(array, 1, length) : [];
  8754. }
  8755. /**
  8756. * Creates a slice of `array` with `n` elements taken from the beginning.
  8757. *
  8758. * @static
  8759. * @memberOf _
  8760. * @since 0.1.0
  8761. * @category Array
  8762. * @param {Array} array The array to query.
  8763. * @param {number} [n=1] The number of elements to take.
  8764. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8765. * @returns {Array} Returns the slice of `array`.
  8766. * @example
  8767. *
  8768. * _.take([1, 2, 3]);
  8769. * // => [1]
  8770. *
  8771. * _.take([1, 2, 3], 2);
  8772. * // => [1, 2]
  8773. *
  8774. * _.take([1, 2, 3], 5);
  8775. * // => [1, 2, 3]
  8776. *
  8777. * _.take([1, 2, 3], 0);
  8778. * // => []
  8779. */
  8780. function take(array, n, guard) {
  8781. if (!(array && array.length)) {
  8782. return [];
  8783. }
  8784. n = (guard || n === undefined) ? 1 : toInteger(n);
  8785. return baseSlice(array, 0, n < 0 ? 0 : n);
  8786. }
  8787. /**
  8788. * Creates a slice of `array` with `n` elements taken from the end.
  8789. *
  8790. * @static
  8791. * @memberOf _
  8792. * @since 3.0.0
  8793. * @category Array
  8794. * @param {Array} array The array to query.
  8795. * @param {number} [n=1] The number of elements to take.
  8796. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8797. * @returns {Array} Returns the slice of `array`.
  8798. * @example
  8799. *
  8800. * _.takeRight([1, 2, 3]);
  8801. * // => [3]
  8802. *
  8803. * _.takeRight([1, 2, 3], 2);
  8804. * // => [2, 3]
  8805. *
  8806. * _.takeRight([1, 2, 3], 5);
  8807. * // => [1, 2, 3]
  8808. *
  8809. * _.takeRight([1, 2, 3], 0);
  8810. * // => []
  8811. */
  8812. function takeRight(array, n, guard) {
  8813. var length = array == null ? 0 : array.length;
  8814. if (!length) {
  8815. return [];
  8816. }
  8817. n = (guard || n === undefined) ? 1 : toInteger(n);
  8818. n = length - n;
  8819. return baseSlice(array, n < 0 ? 0 : n, length);
  8820. }
  8821. /**
  8822. * Creates a slice of `array` with elements taken from the end. Elements are
  8823. * taken until `predicate` returns falsey. The predicate is invoked with
  8824. * three arguments: (value, index, array).
  8825. *
  8826. * @static
  8827. * @memberOf _
  8828. * @since 3.0.0
  8829. * @category Array
  8830. * @param {Array} array The array to query.
  8831. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8832. * @returns {Array} Returns the slice of `array`.
  8833. * @example
  8834. *
  8835. * var users = [
  8836. * { 'user': 'barney', 'active': true },
  8837. * { 'user': 'fred', 'active': false },
  8838. * { 'user': 'pebbles', 'active': false }
  8839. * ];
  8840. *
  8841. * _.takeRightWhile(users, function(o) { return !o.active; });
  8842. * // => objects for ['fred', 'pebbles']
  8843. *
  8844. * // The `_.matches` iteratee shorthand.
  8845. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8846. * // => objects for ['pebbles']
  8847. *
  8848. * // The `_.matchesProperty` iteratee shorthand.
  8849. * _.takeRightWhile(users, ['active', false]);
  8850. * // => objects for ['fred', 'pebbles']
  8851. *
  8852. * // The `_.property` iteratee shorthand.
  8853. * _.takeRightWhile(users, 'active');
  8854. * // => []
  8855. */
  8856. function takeRightWhile(array, predicate) {
  8857. return (array && array.length)
  8858. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8859. : [];
  8860. }
  8861. /**
  8862. * Creates a slice of `array` with elements taken from the beginning. Elements
  8863. * are taken until `predicate` returns falsey. The predicate is invoked with
  8864. * three arguments: (value, index, array).
  8865. *
  8866. * @static
  8867. * @memberOf _
  8868. * @since 3.0.0
  8869. * @category Array
  8870. * @param {Array} array The array to query.
  8871. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8872. * @returns {Array} Returns the slice of `array`.
  8873. * @example
  8874. *
  8875. * var users = [
  8876. * { 'user': 'barney', 'active': false },
  8877. * { 'user': 'fred', 'active': false },
  8878. * { 'user': 'pebbles', 'active': true }
  8879. * ];
  8880. *
  8881. * _.takeWhile(users, function(o) { return !o.active; });
  8882. * // => objects for ['barney', 'fred']
  8883. *
  8884. * // The `_.matches` iteratee shorthand.
  8885. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8886. * // => objects for ['barney']
  8887. *
  8888. * // The `_.matchesProperty` iteratee shorthand.
  8889. * _.takeWhile(users, ['active', false]);
  8890. * // => objects for ['barney', 'fred']
  8891. *
  8892. * // The `_.property` iteratee shorthand.
  8893. * _.takeWhile(users, 'active');
  8894. * // => []
  8895. */
  8896. function takeWhile(array, predicate) {
  8897. return (array && array.length)
  8898. ? baseWhile(array, getIteratee(predicate, 3))
  8899. : [];
  8900. }
  8901. /**
  8902. * Creates an array of unique values, in order, from all given arrays using
  8903. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8904. * for equality comparisons.
  8905. *
  8906. * @static
  8907. * @memberOf _
  8908. * @since 0.1.0
  8909. * @category Array
  8910. * @param {...Array} [arrays] The arrays to inspect.
  8911. * @returns {Array} Returns the new array of combined values.
  8912. * @example
  8913. *
  8914. * _.union([2], [1, 2]);
  8915. * // => [2, 1]
  8916. */
  8917. var union = baseRest(function(arrays) {
  8918. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8919. });
  8920. /**
  8921. * This method is like `_.union` except that it accepts `iteratee` which is
  8922. * invoked for each element of each `arrays` to generate the criterion by
  8923. * which uniqueness is computed. Result values are chosen from the first
  8924. * array in which the value occurs. The iteratee is invoked with one argument:
  8925. * (value).
  8926. *
  8927. * @static
  8928. * @memberOf _
  8929. * @since 4.0.0
  8930. * @category Array
  8931. * @param {...Array} [arrays] The arrays to inspect.
  8932. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8933. * @returns {Array} Returns the new array of combined values.
  8934. * @example
  8935. *
  8936. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8937. * // => [2.1, 1.2]
  8938. *
  8939. * // The `_.property` iteratee shorthand.
  8940. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8941. * // => [{ 'x': 1 }, { 'x': 2 }]
  8942. */
  8943. var unionBy = baseRest(function(arrays) {
  8944. var iteratee = last(arrays);
  8945. if (isArrayLikeObject(iteratee)) {
  8946. iteratee = undefined;
  8947. }
  8948. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8949. });
  8950. /**
  8951. * This method is like `_.union` except that it accepts `comparator` which
  8952. * is invoked to compare elements of `arrays`. Result values are chosen from
  8953. * the first array in which the value occurs. The comparator is invoked
  8954. * with two arguments: (arrVal, othVal).
  8955. *
  8956. * @static
  8957. * @memberOf _
  8958. * @since 4.0.0
  8959. * @category Array
  8960. * @param {...Array} [arrays] The arrays to inspect.
  8961. * @param {Function} [comparator] The comparator invoked per element.
  8962. * @returns {Array} Returns the new array of combined values.
  8963. * @example
  8964. *
  8965. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8966. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8967. *
  8968. * _.unionWith(objects, others, _.isEqual);
  8969. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8970. */
  8971. var unionWith = baseRest(function(arrays) {
  8972. var comparator = last(arrays);
  8973. comparator = typeof comparator == 'function' ? comparator : undefined;
  8974. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8975. });
  8976. /**
  8977. * Creates a duplicate-free version of an array, using
  8978. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8979. * for equality comparisons, in which only the first occurrence of each element
  8980. * is kept. The order of result values is determined by the order they occur
  8981. * in the array.
  8982. *
  8983. * @static
  8984. * @memberOf _
  8985. * @since 0.1.0
  8986. * @category Array
  8987. * @param {Array} array The array to inspect.
  8988. * @returns {Array} Returns the new duplicate free array.
  8989. * @example
  8990. *
  8991. * _.uniq([2, 1, 2]);
  8992. * // => [2, 1]
  8993. */
  8994. function uniq(array) {
  8995. return (array && array.length) ? baseUniq(array) : [];
  8996. }
  8997. /**
  8998. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8999. * invoked for each element in `array` to generate the criterion by which
  9000. * uniqueness is computed. The order of result values is determined by the
  9001. * order they occur in the array. The iteratee is invoked with one argument:
  9002. * (value).
  9003. *
  9004. * @static
  9005. * @memberOf _
  9006. * @since 4.0.0
  9007. * @category Array
  9008. * @param {Array} array The array to inspect.
  9009. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9010. * @returns {Array} Returns the new duplicate free array.
  9011. * @example
  9012. *
  9013. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9014. * // => [2.1, 1.2]
  9015. *
  9016. * // The `_.property` iteratee shorthand.
  9017. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9018. * // => [{ 'x': 1 }, { 'x': 2 }]
  9019. */
  9020. function uniqBy(array, iteratee) {
  9021. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9022. }
  9023. /**
  9024. * This method is like `_.uniq` except that it accepts `comparator` which
  9025. * is invoked to compare elements of `array`. The order of result values is
  9026. * determined by the order they occur in the array.The comparator is invoked
  9027. * with two arguments: (arrVal, othVal).
  9028. *
  9029. * @static
  9030. * @memberOf _
  9031. * @since 4.0.0
  9032. * @category Array
  9033. * @param {Array} array The array to inspect.
  9034. * @param {Function} [comparator] The comparator invoked per element.
  9035. * @returns {Array} Returns the new duplicate free array.
  9036. * @example
  9037. *
  9038. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9039. *
  9040. * _.uniqWith(objects, _.isEqual);
  9041. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9042. */
  9043. function uniqWith(array, comparator) {
  9044. comparator = typeof comparator == 'function' ? comparator : undefined;
  9045. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9046. }
  9047. /**
  9048. * This method is like `_.zip` except that it accepts an array of grouped
  9049. * elements and creates an array regrouping the elements to their pre-zip
  9050. * configuration.
  9051. *
  9052. * @static
  9053. * @memberOf _
  9054. * @since 1.2.0
  9055. * @category Array
  9056. * @param {Array} array The array of grouped elements to process.
  9057. * @returns {Array} Returns the new array of regrouped elements.
  9058. * @example
  9059. *
  9060. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9061. * // => [['a', 1, true], ['b', 2, false]]
  9062. *
  9063. * _.unzip(zipped);
  9064. * // => [['a', 'b'], [1, 2], [true, false]]
  9065. */
  9066. function unzip(array) {
  9067. if (!(array && array.length)) {
  9068. return [];
  9069. }
  9070. var length = 0;
  9071. array = arrayFilter(array, function(group) {
  9072. if (isArrayLikeObject(group)) {
  9073. length = nativeMax(group.length, length);
  9074. return true;
  9075. }
  9076. });
  9077. return baseTimes(length, function(index) {
  9078. return arrayMap(array, baseProperty(index));
  9079. });
  9080. }
  9081. /**
  9082. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9083. * how regrouped values should be combined. The iteratee is invoked with the
  9084. * elements of each group: (...group).
  9085. *
  9086. * @static
  9087. * @memberOf _
  9088. * @since 3.8.0
  9089. * @category Array
  9090. * @param {Array} array The array of grouped elements to process.
  9091. * @param {Function} [iteratee=_.identity] The function to combine
  9092. * regrouped values.
  9093. * @returns {Array} Returns the new array of regrouped elements.
  9094. * @example
  9095. *
  9096. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9097. * // => [[1, 10, 100], [2, 20, 200]]
  9098. *
  9099. * _.unzipWith(zipped, _.add);
  9100. * // => [3, 30, 300]
  9101. */
  9102. function unzipWith(array, iteratee) {
  9103. if (!(array && array.length)) {
  9104. return [];
  9105. }
  9106. var result = unzip(array);
  9107. if (iteratee == null) {
  9108. return result;
  9109. }
  9110. return arrayMap(result, function(group) {
  9111. return apply(iteratee, undefined, group);
  9112. });
  9113. }
  9114. /**
  9115. * Creates an array excluding all given values using
  9116. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9117. * for equality comparisons.
  9118. *
  9119. * **Note:** Unlike `_.pull`, this method returns a new array.
  9120. *
  9121. * @static
  9122. * @memberOf _
  9123. * @since 0.1.0
  9124. * @category Array
  9125. * @param {Array} array The array to inspect.
  9126. * @param {...*} [values] The values to exclude.
  9127. * @returns {Array} Returns the new array of filtered values.
  9128. * @see _.difference, _.xor
  9129. * @example
  9130. *
  9131. * _.without([2, 1, 2, 3], 1, 2);
  9132. * // => [3]
  9133. */
  9134. var without = baseRest(function(array, values) {
  9135. return isArrayLikeObject(array)
  9136. ? baseDifference(array, values)
  9137. : [];
  9138. });
  9139. /**
  9140. * Creates an array of unique values that is the
  9141. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9142. * of the given arrays. The order of result values is determined by the order
  9143. * they occur in the arrays.
  9144. *
  9145. * @static
  9146. * @memberOf _
  9147. * @since 2.4.0
  9148. * @category Array
  9149. * @param {...Array} [arrays] The arrays to inspect.
  9150. * @returns {Array} Returns the new array of filtered values.
  9151. * @see _.difference, _.without
  9152. * @example
  9153. *
  9154. * _.xor([2, 1], [2, 3]);
  9155. * // => [1, 3]
  9156. */
  9157. var xor = baseRest(function(arrays) {
  9158. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9159. });
  9160. /**
  9161. * This method is like `_.xor` except that it accepts `iteratee` which is
  9162. * invoked for each element of each `arrays` to generate the criterion by
  9163. * which by which they're compared. The order of result values is determined
  9164. * by the order they occur in the arrays. The iteratee is invoked with one
  9165. * argument: (value).
  9166. *
  9167. * @static
  9168. * @memberOf _
  9169. * @since 4.0.0
  9170. * @category Array
  9171. * @param {...Array} [arrays] The arrays to inspect.
  9172. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9173. * @returns {Array} Returns the new array of filtered values.
  9174. * @example
  9175. *
  9176. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9177. * // => [1.2, 3.4]
  9178. *
  9179. * // The `_.property` iteratee shorthand.
  9180. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9181. * // => [{ 'x': 2 }]
  9182. */
  9183. var xorBy = baseRest(function(arrays) {
  9184. var iteratee = last(arrays);
  9185. if (isArrayLikeObject(iteratee)) {
  9186. iteratee = undefined;
  9187. }
  9188. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9189. });
  9190. /**
  9191. * This method is like `_.xor` except that it accepts `comparator` which is
  9192. * invoked to compare elements of `arrays`. The order of result values is
  9193. * determined by the order they occur in the arrays. The comparator is invoked
  9194. * with two arguments: (arrVal, othVal).
  9195. *
  9196. * @static
  9197. * @memberOf _
  9198. * @since 4.0.0
  9199. * @category Array
  9200. * @param {...Array} [arrays] The arrays to inspect.
  9201. * @param {Function} [comparator] The comparator invoked per element.
  9202. * @returns {Array} Returns the new array of filtered values.
  9203. * @example
  9204. *
  9205. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9206. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9207. *
  9208. * _.xorWith(objects, others, _.isEqual);
  9209. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9210. */
  9211. var xorWith = baseRest(function(arrays) {
  9212. var comparator = last(arrays);
  9213. comparator = typeof comparator == 'function' ? comparator : undefined;
  9214. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9215. });
  9216. /**
  9217. * Creates an array of grouped elements, the first of which contains the
  9218. * first elements of the given arrays, the second of which contains the
  9219. * second elements of the given arrays, and so on.
  9220. *
  9221. * @static
  9222. * @memberOf _
  9223. * @since 0.1.0
  9224. * @category Array
  9225. * @param {...Array} [arrays] The arrays to process.
  9226. * @returns {Array} Returns the new array of grouped elements.
  9227. * @example
  9228. *
  9229. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9230. * // => [['a', 1, true], ['b', 2, false]]
  9231. */
  9232. var zip = baseRest(unzip);
  9233. /**
  9234. * This method is like `_.fromPairs` except that it accepts two arrays,
  9235. * one of property identifiers and one of corresponding values.
  9236. *
  9237. * @static
  9238. * @memberOf _
  9239. * @since 0.4.0
  9240. * @category Array
  9241. * @param {Array} [props=[]] The property identifiers.
  9242. * @param {Array} [values=[]] The property values.
  9243. * @returns {Object} Returns the new object.
  9244. * @example
  9245. *
  9246. * _.zipObject(['a', 'b'], [1, 2]);
  9247. * // => { 'a': 1, 'b': 2 }
  9248. */
  9249. function zipObject(props, values) {
  9250. return baseZipObject(props || [], values || [], assignValue);
  9251. }
  9252. /**
  9253. * This method is like `_.zipObject` except that it supports property paths.
  9254. *
  9255. * @static
  9256. * @memberOf _
  9257. * @since 4.1.0
  9258. * @category Array
  9259. * @param {Array} [props=[]] The property identifiers.
  9260. * @param {Array} [values=[]] The property values.
  9261. * @returns {Object} Returns the new object.
  9262. * @example
  9263. *
  9264. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9265. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9266. */
  9267. function zipObjectDeep(props, values) {
  9268. return baseZipObject(props || [], values || [], baseSet);
  9269. }
  9270. /**
  9271. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9272. * how grouped values should be combined. The iteratee is invoked with the
  9273. * elements of each group: (...group).
  9274. *
  9275. * @static
  9276. * @memberOf _
  9277. * @since 3.8.0
  9278. * @category Array
  9279. * @param {...Array} [arrays] The arrays to process.
  9280. * @param {Function} [iteratee=_.identity] The function to combine
  9281. * grouped values.
  9282. * @returns {Array} Returns the new array of grouped elements.
  9283. * @example
  9284. *
  9285. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9286. * return a + b + c;
  9287. * });
  9288. * // => [111, 222]
  9289. */
  9290. var zipWith = baseRest(function(arrays) {
  9291. var length = arrays.length,
  9292. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9293. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9294. return unzipWith(arrays, iteratee);
  9295. });
  9296. /*------------------------------------------------------------------------*/
  9297. /**
  9298. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9299. * chain sequences enabled. The result of such sequences must be unwrapped
  9300. * with `_#value`.
  9301. *
  9302. * @static
  9303. * @memberOf _
  9304. * @since 1.3.0
  9305. * @category Seq
  9306. * @param {*} value The value to wrap.
  9307. * @returns {Object} Returns the new `lodash` wrapper instance.
  9308. * @example
  9309. *
  9310. * var users = [
  9311. * { 'user': 'barney', 'age': 36 },
  9312. * { 'user': 'fred', 'age': 40 },
  9313. * { 'user': 'pebbles', 'age': 1 }
  9314. * ];
  9315. *
  9316. * var youngest = _
  9317. * .chain(users)
  9318. * .sortBy('age')
  9319. * .map(function(o) {
  9320. * return o.user + ' is ' + o.age;
  9321. * })
  9322. * .head()
  9323. * .value();
  9324. * // => 'pebbles is 1'
  9325. */
  9326. function chain(value) {
  9327. var result = lodash(value);
  9328. result.__chain__ = true;
  9329. return result;
  9330. }
  9331. /**
  9332. * This method invokes `interceptor` and returns `value`. The interceptor
  9333. * is invoked with one argument; (value). The purpose of this method is to
  9334. * "tap into" a method chain sequence in order to modify intermediate results.
  9335. *
  9336. * @static
  9337. * @memberOf _
  9338. * @since 0.1.0
  9339. * @category Seq
  9340. * @param {*} value The value to provide to `interceptor`.
  9341. * @param {Function} interceptor The function to invoke.
  9342. * @returns {*} Returns `value`.
  9343. * @example
  9344. *
  9345. * _([1, 2, 3])
  9346. * .tap(function(array) {
  9347. * // Mutate input array.
  9348. * array.pop();
  9349. * })
  9350. * .reverse()
  9351. * .value();
  9352. * // => [2, 1]
  9353. */
  9354. function tap(value, interceptor) {
  9355. interceptor(value);
  9356. return value;
  9357. }
  9358. /**
  9359. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9360. * The purpose of this method is to "pass thru" values replacing intermediate
  9361. * results in a method chain sequence.
  9362. *
  9363. * @static
  9364. * @memberOf _
  9365. * @since 3.0.0
  9366. * @category Seq
  9367. * @param {*} value The value to provide to `interceptor`.
  9368. * @param {Function} interceptor The function to invoke.
  9369. * @returns {*} Returns the result of `interceptor`.
  9370. * @example
  9371. *
  9372. * _(' abc ')
  9373. * .chain()
  9374. * .trim()
  9375. * .thru(function(value) {
  9376. * return [value];
  9377. * })
  9378. * .value();
  9379. * // => ['abc']
  9380. */
  9381. function thru(value, interceptor) {
  9382. return interceptor(value);
  9383. }
  9384. /**
  9385. * This method is the wrapper version of `_.at`.
  9386. *
  9387. * @name at
  9388. * @memberOf _
  9389. * @since 1.0.0
  9390. * @category Seq
  9391. * @param {...(string|string[])} [paths] The property paths to pick.
  9392. * @returns {Object} Returns the new `lodash` wrapper instance.
  9393. * @example
  9394. *
  9395. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9396. *
  9397. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9398. * // => [3, 4]
  9399. */
  9400. var wrapperAt = flatRest(function(paths) {
  9401. var length = paths.length,
  9402. start = length ? paths[0] : 0,
  9403. value = this.__wrapped__,
  9404. interceptor = function(object) { return baseAt(object, paths); };
  9405. if (length > 1 || this.__actions__.length ||
  9406. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9407. return this.thru(interceptor);
  9408. }
  9409. value = value.slice(start, +start + (length ? 1 : 0));
  9410. value.__actions__.push({
  9411. 'func': thru,
  9412. 'args': [interceptor],
  9413. 'thisArg': undefined
  9414. });
  9415. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9416. if (length && !array.length) {
  9417. array.push(undefined);
  9418. }
  9419. return array;
  9420. });
  9421. });
  9422. /**
  9423. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9424. *
  9425. * @name chain
  9426. * @memberOf _
  9427. * @since 0.1.0
  9428. * @category Seq
  9429. * @returns {Object} Returns the new `lodash` wrapper instance.
  9430. * @example
  9431. *
  9432. * var users = [
  9433. * { 'user': 'barney', 'age': 36 },
  9434. * { 'user': 'fred', 'age': 40 }
  9435. * ];
  9436. *
  9437. * // A sequence without explicit chaining.
  9438. * _(users).head();
  9439. * // => { 'user': 'barney', 'age': 36 }
  9440. *
  9441. * // A sequence with explicit chaining.
  9442. * _(users)
  9443. * .chain()
  9444. * .head()
  9445. * .pick('user')
  9446. * .value();
  9447. * // => { 'user': 'barney' }
  9448. */
  9449. function wrapperChain() {
  9450. return chain(this);
  9451. }
  9452. /**
  9453. * Executes the chain sequence and returns the wrapped result.
  9454. *
  9455. * @name commit
  9456. * @memberOf _
  9457. * @since 3.2.0
  9458. * @category Seq
  9459. * @returns {Object} Returns the new `lodash` wrapper instance.
  9460. * @example
  9461. *
  9462. * var array = [1, 2];
  9463. * var wrapped = _(array).push(3);
  9464. *
  9465. * console.log(array);
  9466. * // => [1, 2]
  9467. *
  9468. * wrapped = wrapped.commit();
  9469. * console.log(array);
  9470. * // => [1, 2, 3]
  9471. *
  9472. * wrapped.last();
  9473. * // => 3
  9474. *
  9475. * console.log(array);
  9476. * // => [1, 2, 3]
  9477. */
  9478. function wrapperCommit() {
  9479. return new LodashWrapper(this.value(), this.__chain__);
  9480. }
  9481. /**
  9482. * Gets the next value on a wrapped object following the
  9483. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9484. *
  9485. * @name next
  9486. * @memberOf _
  9487. * @since 4.0.0
  9488. * @category Seq
  9489. * @returns {Object} Returns the next iterator value.
  9490. * @example
  9491. *
  9492. * var wrapped = _([1, 2]);
  9493. *
  9494. * wrapped.next();
  9495. * // => { 'done': false, 'value': 1 }
  9496. *
  9497. * wrapped.next();
  9498. * // => { 'done': false, 'value': 2 }
  9499. *
  9500. * wrapped.next();
  9501. * // => { 'done': true, 'value': undefined }
  9502. */
  9503. function wrapperNext() {
  9504. if (this.__values__ === undefined) {
  9505. this.__values__ = toArray(this.value());
  9506. }
  9507. var done = this.__index__ >= this.__values__.length,
  9508. value = done ? undefined : this.__values__[this.__index__++];
  9509. return { 'done': done, 'value': value };
  9510. }
  9511. /**
  9512. * Enables the wrapper to be iterable.
  9513. *
  9514. * @name Symbol.iterator
  9515. * @memberOf _
  9516. * @since 4.0.0
  9517. * @category Seq
  9518. * @returns {Object} Returns the wrapper object.
  9519. * @example
  9520. *
  9521. * var wrapped = _([1, 2]);
  9522. *
  9523. * wrapped[Symbol.iterator]() === wrapped;
  9524. * // => true
  9525. *
  9526. * Array.from(wrapped);
  9527. * // => [1, 2]
  9528. */
  9529. function wrapperToIterator() {
  9530. return this;
  9531. }
  9532. /**
  9533. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9534. *
  9535. * @name plant
  9536. * @memberOf _
  9537. * @since 3.2.0
  9538. * @category Seq
  9539. * @param {*} value The value to plant.
  9540. * @returns {Object} Returns the new `lodash` wrapper instance.
  9541. * @example
  9542. *
  9543. * function square(n) {
  9544. * return n * n;
  9545. * }
  9546. *
  9547. * var wrapped = _([1, 2]).map(square);
  9548. * var other = wrapped.plant([3, 4]);
  9549. *
  9550. * other.value();
  9551. * // => [9, 16]
  9552. *
  9553. * wrapped.value();
  9554. * // => [1, 4]
  9555. */
  9556. function wrapperPlant(value) {
  9557. var result,
  9558. parent = this;
  9559. while (parent instanceof baseLodash) {
  9560. var clone = wrapperClone(parent);
  9561. clone.__index__ = 0;
  9562. clone.__values__ = undefined;
  9563. if (result) {
  9564. previous.__wrapped__ = clone;
  9565. } else {
  9566. result = clone;
  9567. }
  9568. var previous = clone;
  9569. parent = parent.__wrapped__;
  9570. }
  9571. previous.__wrapped__ = value;
  9572. return result;
  9573. }
  9574. /**
  9575. * This method is the wrapper version of `_.reverse`.
  9576. *
  9577. * **Note:** This method mutates the wrapped array.
  9578. *
  9579. * @name reverse
  9580. * @memberOf _
  9581. * @since 0.1.0
  9582. * @category Seq
  9583. * @returns {Object} Returns the new `lodash` wrapper instance.
  9584. * @example
  9585. *
  9586. * var array = [1, 2, 3];
  9587. *
  9588. * _(array).reverse().value()
  9589. * // => [3, 2, 1]
  9590. *
  9591. * console.log(array);
  9592. * // => [3, 2, 1]
  9593. */
  9594. function wrapperReverse() {
  9595. var value = this.__wrapped__;
  9596. if (value instanceof LazyWrapper) {
  9597. var wrapped = value;
  9598. if (this.__actions__.length) {
  9599. wrapped = new LazyWrapper(this);
  9600. }
  9601. wrapped = wrapped.reverse();
  9602. wrapped.__actions__.push({
  9603. 'func': thru,
  9604. 'args': [reverse],
  9605. 'thisArg': undefined
  9606. });
  9607. return new LodashWrapper(wrapped, this.__chain__);
  9608. }
  9609. return this.thru(reverse);
  9610. }
  9611. /**
  9612. * Executes the chain sequence to resolve the unwrapped value.
  9613. *
  9614. * @name value
  9615. * @memberOf _
  9616. * @since 0.1.0
  9617. * @alias toJSON, valueOf
  9618. * @category Seq
  9619. * @returns {*} Returns the resolved unwrapped value.
  9620. * @example
  9621. *
  9622. * _([1, 2, 3]).value();
  9623. * // => [1, 2, 3]
  9624. */
  9625. function wrapperValue() {
  9626. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9627. }
  9628. /*------------------------------------------------------------------------*/
  9629. /**
  9630. * Creates an object composed of keys generated from the results of running
  9631. * each element of `collection` thru `iteratee`. The corresponding value of
  9632. * each key is the number of times the key was returned by `iteratee`. The
  9633. * iteratee is invoked with one argument: (value).
  9634. *
  9635. * @static
  9636. * @memberOf _
  9637. * @since 0.5.0
  9638. * @category Collection
  9639. * @param {Array|Object} collection The collection to iterate over.
  9640. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9641. * @returns {Object} Returns the composed aggregate object.
  9642. * @example
  9643. *
  9644. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9645. * // => { '4': 1, '6': 2 }
  9646. *
  9647. * // The `_.property` iteratee shorthand.
  9648. * _.countBy(['one', 'two', 'three'], 'length');
  9649. * // => { '3': 2, '5': 1 }
  9650. */
  9651. var countBy = createAggregator(function(result, value, key) {
  9652. if (hasOwnProperty.call(result, key)) {
  9653. ++result[key];
  9654. } else {
  9655. baseAssignValue(result, key, 1);
  9656. }
  9657. });
  9658. /**
  9659. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9660. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9661. * invoked with three arguments: (value, index|key, collection).
  9662. *
  9663. * **Note:** This method returns `true` for
  9664. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9665. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9666. * elements of empty collections.
  9667. *
  9668. * @static
  9669. * @memberOf _
  9670. * @since 0.1.0
  9671. * @category Collection
  9672. * @param {Array|Object} collection The collection to iterate over.
  9673. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9674. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9675. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9676. * else `false`.
  9677. * @example
  9678. *
  9679. * _.every([true, 1, null, 'yes'], Boolean);
  9680. * // => false
  9681. *
  9682. * var users = [
  9683. * { 'user': 'barney', 'age': 36, 'active': false },
  9684. * { 'user': 'fred', 'age': 40, 'active': false }
  9685. * ];
  9686. *
  9687. * // The `_.matches` iteratee shorthand.
  9688. * _.every(users, { 'user': 'barney', 'active': false });
  9689. * // => false
  9690. *
  9691. * // The `_.matchesProperty` iteratee shorthand.
  9692. * _.every(users, ['active', false]);
  9693. * // => true
  9694. *
  9695. * // The `_.property` iteratee shorthand.
  9696. * _.every(users, 'active');
  9697. * // => false
  9698. */
  9699. function every(collection, predicate, guard) {
  9700. var func = isArray(collection) ? arrayEvery : baseEvery;
  9701. if (guard && isIterateeCall(collection, predicate, guard)) {
  9702. predicate = undefined;
  9703. }
  9704. return func(collection, getIteratee(predicate, 3));
  9705. }
  9706. /**
  9707. * Iterates over elements of `collection`, returning an array of all elements
  9708. * `predicate` returns truthy for. The predicate is invoked with three
  9709. * arguments: (value, index|key, collection).
  9710. *
  9711. * **Note:** Unlike `_.remove`, this method returns a new array.
  9712. *
  9713. * @static
  9714. * @memberOf _
  9715. * @since 0.1.0
  9716. * @category Collection
  9717. * @param {Array|Object} collection The collection to iterate over.
  9718. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9719. * @returns {Array} Returns the new filtered array.
  9720. * @see _.reject
  9721. * @example
  9722. *
  9723. * var users = [
  9724. * { 'user': 'barney', 'age': 36, 'active': true },
  9725. * { 'user': 'fred', 'age': 40, 'active': false }
  9726. * ];
  9727. *
  9728. * _.filter(users, function(o) { return !o.active; });
  9729. * // => objects for ['fred']
  9730. *
  9731. * // The `_.matches` iteratee shorthand.
  9732. * _.filter(users, { 'age': 36, 'active': true });
  9733. * // => objects for ['barney']
  9734. *
  9735. * // The `_.matchesProperty` iteratee shorthand.
  9736. * _.filter(users, ['active', false]);
  9737. * // => objects for ['fred']
  9738. *
  9739. * // The `_.property` iteratee shorthand.
  9740. * _.filter(users, 'active');
  9741. * // => objects for ['barney']
  9742. *
  9743. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9744. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9745. * // => objects for ['fred', 'barney']
  9746. */
  9747. function filter(collection, predicate) {
  9748. var func = isArray(collection) ? arrayFilter : baseFilter;
  9749. return func(collection, getIteratee(predicate, 3));
  9750. }
  9751. /**
  9752. * Iterates over elements of `collection`, returning the first element
  9753. * `predicate` returns truthy for. The predicate is invoked with three
  9754. * arguments: (value, index|key, collection).
  9755. *
  9756. * @static
  9757. * @memberOf _
  9758. * @since 0.1.0
  9759. * @category Collection
  9760. * @param {Array|Object} collection The collection to inspect.
  9761. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9762. * @param {number} [fromIndex=0] The index to search from.
  9763. * @returns {*} Returns the matched element, else `undefined`.
  9764. * @example
  9765. *
  9766. * var users = [
  9767. * { 'user': 'barney', 'age': 36, 'active': true },
  9768. * { 'user': 'fred', 'age': 40, 'active': false },
  9769. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9770. * ];
  9771. *
  9772. * _.find(users, function(o) { return o.age < 40; });
  9773. * // => object for 'barney'
  9774. *
  9775. * // The `_.matches` iteratee shorthand.
  9776. * _.find(users, { 'age': 1, 'active': true });
  9777. * // => object for 'pebbles'
  9778. *
  9779. * // The `_.matchesProperty` iteratee shorthand.
  9780. * _.find(users, ['active', false]);
  9781. * // => object for 'fred'
  9782. *
  9783. * // The `_.property` iteratee shorthand.
  9784. * _.find(users, 'active');
  9785. * // => object for 'barney'
  9786. */
  9787. var find = createFind(findIndex);
  9788. /**
  9789. * This method is like `_.find` except that it iterates over elements of
  9790. * `collection` from right to left.
  9791. *
  9792. * @static
  9793. * @memberOf _
  9794. * @since 2.0.0
  9795. * @category Collection
  9796. * @param {Array|Object} collection The collection to inspect.
  9797. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9798. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9799. * @returns {*} Returns the matched element, else `undefined`.
  9800. * @example
  9801. *
  9802. * _.findLast([1, 2, 3, 4], function(n) {
  9803. * return n % 2 == 1;
  9804. * });
  9805. * // => 3
  9806. */
  9807. var findLast = createFind(findLastIndex);
  9808. /**
  9809. * Creates a flattened array of values by running each element in `collection`
  9810. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9811. * with three arguments: (value, index|key, collection).
  9812. *
  9813. * @static
  9814. * @memberOf _
  9815. * @since 4.0.0
  9816. * @category Collection
  9817. * @param {Array|Object} collection The collection to iterate over.
  9818. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9819. * @returns {Array} Returns the new flattened array.
  9820. * @example
  9821. *
  9822. * function duplicate(n) {
  9823. * return [n, n];
  9824. * }
  9825. *
  9826. * _.flatMap([1, 2], duplicate);
  9827. * // => [1, 1, 2, 2]
  9828. */
  9829. function flatMap(collection, iteratee) {
  9830. return baseFlatten(map(collection, iteratee), 1);
  9831. }
  9832. /**
  9833. * This method is like `_.flatMap` except that it recursively flattens the
  9834. * mapped results.
  9835. *
  9836. * @static
  9837. * @memberOf _
  9838. * @since 4.7.0
  9839. * @category Collection
  9840. * @param {Array|Object} collection The collection to iterate over.
  9841. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9842. * @returns {Array} Returns the new flattened array.
  9843. * @example
  9844. *
  9845. * function duplicate(n) {
  9846. * return [[[n, n]]];
  9847. * }
  9848. *
  9849. * _.flatMapDeep([1, 2], duplicate);
  9850. * // => [1, 1, 2, 2]
  9851. */
  9852. function flatMapDeep(collection, iteratee) {
  9853. return baseFlatten(map(collection, iteratee), INFINITY);
  9854. }
  9855. /**
  9856. * This method is like `_.flatMap` except that it recursively flattens the
  9857. * mapped results up to `depth` times.
  9858. *
  9859. * @static
  9860. * @memberOf _
  9861. * @since 4.7.0
  9862. * @category Collection
  9863. * @param {Array|Object} collection The collection to iterate over.
  9864. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9865. * @param {number} [depth=1] The maximum recursion depth.
  9866. * @returns {Array} Returns the new flattened array.
  9867. * @example
  9868. *
  9869. * function duplicate(n) {
  9870. * return [[[n, n]]];
  9871. * }
  9872. *
  9873. * _.flatMapDepth([1, 2], duplicate, 2);
  9874. * // => [[1, 1], [2, 2]]
  9875. */
  9876. function flatMapDepth(collection, iteratee, depth) {
  9877. depth = depth === undefined ? 1 : toInteger(depth);
  9878. return baseFlatten(map(collection, iteratee), depth);
  9879. }
  9880. /**
  9881. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9882. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9883. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9884. *
  9885. * **Note:** As with other "Collections" methods, objects with a "length"
  9886. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9887. * or `_.forOwn` for object iteration.
  9888. *
  9889. * @static
  9890. * @memberOf _
  9891. * @since 0.1.0
  9892. * @alias each
  9893. * @category Collection
  9894. * @param {Array|Object} collection The collection to iterate over.
  9895. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9896. * @returns {Array|Object} Returns `collection`.
  9897. * @see _.forEachRight
  9898. * @example
  9899. *
  9900. * _.forEach([1, 2], function(value) {
  9901. * console.log(value);
  9902. * });
  9903. * // => Logs `1` then `2`.
  9904. *
  9905. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9906. * console.log(key);
  9907. * });
  9908. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9909. */
  9910. function forEach(collection, iteratee) {
  9911. var func = isArray(collection) ? arrayEach : baseEach;
  9912. return func(collection, getIteratee(iteratee, 3));
  9913. }
  9914. /**
  9915. * This method is like `_.forEach` except that it iterates over elements of
  9916. * `collection` from right to left.
  9917. *
  9918. * @static
  9919. * @memberOf _
  9920. * @since 2.0.0
  9921. * @alias eachRight
  9922. * @category Collection
  9923. * @param {Array|Object} collection The collection to iterate over.
  9924. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9925. * @returns {Array|Object} Returns `collection`.
  9926. * @see _.forEach
  9927. * @example
  9928. *
  9929. * _.forEachRight([1, 2], function(value) {
  9930. * console.log(value);
  9931. * });
  9932. * // => Logs `2` then `1`.
  9933. */
  9934. function forEachRight(collection, iteratee) {
  9935. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9936. return func(collection, getIteratee(iteratee, 3));
  9937. }
  9938. /**
  9939. * Creates an object composed of keys generated from the results of running
  9940. * each element of `collection` thru `iteratee`. The order of grouped values
  9941. * is determined by the order they occur in `collection`. The corresponding
  9942. * value of each key is an array of elements responsible for generating the
  9943. * key. The iteratee is invoked with one argument: (value).
  9944. *
  9945. * @static
  9946. * @memberOf _
  9947. * @since 0.1.0
  9948. * @category Collection
  9949. * @param {Array|Object} collection The collection to iterate over.
  9950. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9951. * @returns {Object} Returns the composed aggregate object.
  9952. * @example
  9953. *
  9954. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9955. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9956. *
  9957. * // The `_.property` iteratee shorthand.
  9958. * _.groupBy(['one', 'two', 'three'], 'length');
  9959. * // => { '3': ['one', 'two'], '5': ['three'] }
  9960. */
  9961. var groupBy = createAggregator(function(result, value, key) {
  9962. if (hasOwnProperty.call(result, key)) {
  9963. result[key].push(value);
  9964. } else {
  9965. baseAssignValue(result, key, [value]);
  9966. }
  9967. });
  9968. /**
  9969. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9970. * checked for a substring of `value`, otherwise
  9971. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9972. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9973. * the offset from the end of `collection`.
  9974. *
  9975. * @static
  9976. * @memberOf _
  9977. * @since 0.1.0
  9978. * @category Collection
  9979. * @param {Array|Object|string} collection The collection to inspect.
  9980. * @param {*} value The value to search for.
  9981. * @param {number} [fromIndex=0] The index to search from.
  9982. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9983. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9984. * @example
  9985. *
  9986. * _.includes([1, 2, 3], 1);
  9987. * // => true
  9988. *
  9989. * _.includes([1, 2, 3], 1, 2);
  9990. * // => false
  9991. *
  9992. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9993. * // => true
  9994. *
  9995. * _.includes('abcd', 'bc');
  9996. * // => true
  9997. */
  9998. function includes(collection, value, fromIndex, guard) {
  9999. collection = isArrayLike(collection) ? collection : values(collection);
  10000. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10001. var length = collection.length;
  10002. if (fromIndex < 0) {
  10003. fromIndex = nativeMax(length + fromIndex, 0);
  10004. }
  10005. return isString(collection)
  10006. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10007. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10008. }
  10009. /**
  10010. * Invokes the method at `path` of each element in `collection`, returning
  10011. * an array of the results of each invoked method. Any additional arguments
  10012. * are provided to each invoked method. If `path` is a function, it's invoked
  10013. * for, and `this` bound to, each element in `collection`.
  10014. *
  10015. * @static
  10016. * @memberOf _
  10017. * @since 4.0.0
  10018. * @category Collection
  10019. * @param {Array|Object} collection The collection to iterate over.
  10020. * @param {Array|Function|string} path The path of the method to invoke or
  10021. * the function invoked per iteration.
  10022. * @param {...*} [args] The arguments to invoke each method with.
  10023. * @returns {Array} Returns the array of results.
  10024. * @example
  10025. *
  10026. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10027. * // => [[1, 5, 7], [1, 2, 3]]
  10028. *
  10029. * _.invokeMap([123, 456], String.prototype.split, '');
  10030. * // => [['1', '2', '3'], ['4', '5', '6']]
  10031. */
  10032. var invokeMap = baseRest(function(collection, path, args) {
  10033. var index = -1,
  10034. isFunc = typeof path == 'function',
  10035. result = isArrayLike(collection) ? Array(collection.length) : [];
  10036. baseEach(collection, function(value) {
  10037. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10038. });
  10039. return result;
  10040. });
  10041. /**
  10042. * Creates an object composed of keys generated from the results of running
  10043. * each element of `collection` thru `iteratee`. The corresponding value of
  10044. * each key is the last element responsible for generating the key. The
  10045. * iteratee is invoked with one argument: (value).
  10046. *
  10047. * @static
  10048. * @memberOf _
  10049. * @since 4.0.0
  10050. * @category Collection
  10051. * @param {Array|Object} collection The collection to iterate over.
  10052. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10053. * @returns {Object} Returns the composed aggregate object.
  10054. * @example
  10055. *
  10056. * var array = [
  10057. * { 'dir': 'left', 'code': 97 },
  10058. * { 'dir': 'right', 'code': 100 }
  10059. * ];
  10060. *
  10061. * _.keyBy(array, function(o) {
  10062. * return String.fromCharCode(o.code);
  10063. * });
  10064. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10065. *
  10066. * _.keyBy(array, 'dir');
  10067. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10068. */
  10069. var keyBy = createAggregator(function(result, value, key) {
  10070. baseAssignValue(result, key, value);
  10071. });
  10072. /**
  10073. * Creates an array of values by running each element in `collection` thru
  10074. * `iteratee`. The iteratee is invoked with three arguments:
  10075. * (value, index|key, collection).
  10076. *
  10077. * Many lodash methods are guarded to work as iteratees for methods like
  10078. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10079. *
  10080. * The guarded methods are:
  10081. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10082. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10083. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10084. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10085. *
  10086. * @static
  10087. * @memberOf _
  10088. * @since 0.1.0
  10089. * @category Collection
  10090. * @param {Array|Object} collection The collection to iterate over.
  10091. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10092. * @returns {Array} Returns the new mapped array.
  10093. * @example
  10094. *
  10095. * function square(n) {
  10096. * return n * n;
  10097. * }
  10098. *
  10099. * _.map([4, 8], square);
  10100. * // => [16, 64]
  10101. *
  10102. * _.map({ 'a': 4, 'b': 8 }, square);
  10103. * // => [16, 64] (iteration order is not guaranteed)
  10104. *
  10105. * var users = [
  10106. * { 'user': 'barney' },
  10107. * { 'user': 'fred' }
  10108. * ];
  10109. *
  10110. * // The `_.property` iteratee shorthand.
  10111. * _.map(users, 'user');
  10112. * // => ['barney', 'fred']
  10113. */
  10114. function map(collection, iteratee) {
  10115. var func = isArray(collection) ? arrayMap : baseMap;
  10116. return func(collection, getIteratee(iteratee, 3));
  10117. }
  10118. /**
  10119. * This method is like `_.sortBy` except that it allows specifying the sort
  10120. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10121. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10122. * descending or "asc" for ascending sort order of corresponding values.
  10123. *
  10124. * @static
  10125. * @memberOf _
  10126. * @since 4.0.0
  10127. * @category Collection
  10128. * @param {Array|Object} collection The collection to iterate over.
  10129. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10130. * The iteratees to sort by.
  10131. * @param {string[]} [orders] The sort orders of `iteratees`.
  10132. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10133. * @returns {Array} Returns the new sorted array.
  10134. * @example
  10135. *
  10136. * var users = [
  10137. * { 'user': 'fred', 'age': 48 },
  10138. * { 'user': 'barney', 'age': 34 },
  10139. * { 'user': 'fred', 'age': 40 },
  10140. * { 'user': 'barney', 'age': 36 }
  10141. * ];
  10142. *
  10143. * // Sort by `user` in ascending order and by `age` in descending order.
  10144. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10145. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10146. */
  10147. function orderBy(collection, iteratees, orders, guard) {
  10148. if (collection == null) {
  10149. return [];
  10150. }
  10151. if (!isArray(iteratees)) {
  10152. iteratees = iteratees == null ? [] : [iteratees];
  10153. }
  10154. orders = guard ? undefined : orders;
  10155. if (!isArray(orders)) {
  10156. orders = orders == null ? [] : [orders];
  10157. }
  10158. return baseOrderBy(collection, iteratees, orders);
  10159. }
  10160. /**
  10161. * Creates an array of elements split into two groups, the first of which
  10162. * contains elements `predicate` returns truthy for, the second of which
  10163. * contains elements `predicate` returns falsey for. The predicate is
  10164. * invoked with one argument: (value).
  10165. *
  10166. * @static
  10167. * @memberOf _
  10168. * @since 3.0.0
  10169. * @category Collection
  10170. * @param {Array|Object} collection The collection to iterate over.
  10171. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10172. * @returns {Array} Returns the array of grouped elements.
  10173. * @example
  10174. *
  10175. * var users = [
  10176. * { 'user': 'barney', 'age': 36, 'active': false },
  10177. * { 'user': 'fred', 'age': 40, 'active': true },
  10178. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10179. * ];
  10180. *
  10181. * _.partition(users, function(o) { return o.active; });
  10182. * // => objects for [['fred'], ['barney', 'pebbles']]
  10183. *
  10184. * // The `_.matches` iteratee shorthand.
  10185. * _.partition(users, { 'age': 1, 'active': false });
  10186. * // => objects for [['pebbles'], ['barney', 'fred']]
  10187. *
  10188. * // The `_.matchesProperty` iteratee shorthand.
  10189. * _.partition(users, ['active', false]);
  10190. * // => objects for [['barney', 'pebbles'], ['fred']]
  10191. *
  10192. * // The `_.property` iteratee shorthand.
  10193. * _.partition(users, 'active');
  10194. * // => objects for [['fred'], ['barney', 'pebbles']]
  10195. */
  10196. var partition = createAggregator(function(result, value, key) {
  10197. result[key ? 0 : 1].push(value);
  10198. }, function() { return [[], []]; });
  10199. /**
  10200. * Reduces `collection` to a value which is the accumulated result of running
  10201. * each element in `collection` thru `iteratee`, where each successive
  10202. * invocation is supplied the return value of the previous. If `accumulator`
  10203. * is not given, the first element of `collection` is used as the initial
  10204. * value. The iteratee is invoked with four arguments:
  10205. * (accumulator, value, index|key, collection).
  10206. *
  10207. * Many lodash methods are guarded to work as iteratees for methods like
  10208. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10209. *
  10210. * The guarded methods are:
  10211. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10212. * and `sortBy`
  10213. *
  10214. * @static
  10215. * @memberOf _
  10216. * @since 0.1.0
  10217. * @category Collection
  10218. * @param {Array|Object} collection The collection to iterate over.
  10219. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10220. * @param {*} [accumulator] The initial value.
  10221. * @returns {*} Returns the accumulated value.
  10222. * @see _.reduceRight
  10223. * @example
  10224. *
  10225. * _.reduce([1, 2], function(sum, n) {
  10226. * return sum + n;
  10227. * }, 0);
  10228. * // => 3
  10229. *
  10230. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10231. * (result[value] || (result[value] = [])).push(key);
  10232. * return result;
  10233. * }, {});
  10234. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10235. */
  10236. function reduce(collection, iteratee, accumulator) {
  10237. var func = isArray(collection) ? arrayReduce : baseReduce,
  10238. initAccum = arguments.length < 3;
  10239. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10240. }
  10241. /**
  10242. * This method is like `_.reduce` except that it iterates over elements of
  10243. * `collection` from right to left.
  10244. *
  10245. * @static
  10246. * @memberOf _
  10247. * @since 0.1.0
  10248. * @category Collection
  10249. * @param {Array|Object} collection The collection to iterate over.
  10250. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10251. * @param {*} [accumulator] The initial value.
  10252. * @returns {*} Returns the accumulated value.
  10253. * @see _.reduce
  10254. * @example
  10255. *
  10256. * var array = [[0, 1], [2, 3], [4, 5]];
  10257. *
  10258. * _.reduceRight(array, function(flattened, other) {
  10259. * return flattened.concat(other);
  10260. * }, []);
  10261. * // => [4, 5, 2, 3, 0, 1]
  10262. */
  10263. function reduceRight(collection, iteratee, accumulator) {
  10264. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10265. initAccum = arguments.length < 3;
  10266. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10267. }
  10268. /**
  10269. * The opposite of `_.filter`; this method returns the elements of `collection`
  10270. * that `predicate` does **not** return truthy for.
  10271. *
  10272. * @static
  10273. * @memberOf _
  10274. * @since 0.1.0
  10275. * @category Collection
  10276. * @param {Array|Object} collection The collection to iterate over.
  10277. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10278. * @returns {Array} Returns the new filtered array.
  10279. * @see _.filter
  10280. * @example
  10281. *
  10282. * var users = [
  10283. * { 'user': 'barney', 'age': 36, 'active': false },
  10284. * { 'user': 'fred', 'age': 40, 'active': true }
  10285. * ];
  10286. *
  10287. * _.reject(users, function(o) { return !o.active; });
  10288. * // => objects for ['fred']
  10289. *
  10290. * // The `_.matches` iteratee shorthand.
  10291. * _.reject(users, { 'age': 40, 'active': true });
  10292. * // => objects for ['barney']
  10293. *
  10294. * // The `_.matchesProperty` iteratee shorthand.
  10295. * _.reject(users, ['active', false]);
  10296. * // => objects for ['fred']
  10297. *
  10298. * // The `_.property` iteratee shorthand.
  10299. * _.reject(users, 'active');
  10300. * // => objects for ['barney']
  10301. */
  10302. function reject(collection, predicate) {
  10303. var func = isArray(collection) ? arrayFilter : baseFilter;
  10304. return func(collection, negate(getIteratee(predicate, 3)));
  10305. }
  10306. /**
  10307. * Gets a random element from `collection`.
  10308. *
  10309. * @static
  10310. * @memberOf _
  10311. * @since 2.0.0
  10312. * @category Collection
  10313. * @param {Array|Object} collection The collection to sample.
  10314. * @returns {*} Returns the random element.
  10315. * @example
  10316. *
  10317. * _.sample([1, 2, 3, 4]);
  10318. * // => 2
  10319. */
  10320. function sample(collection) {
  10321. var func = isArray(collection) ? arraySample : baseSample;
  10322. return func(collection);
  10323. }
  10324. /**
  10325. * Gets `n` random elements at unique keys from `collection` up to the
  10326. * size of `collection`.
  10327. *
  10328. * @static
  10329. * @memberOf _
  10330. * @since 4.0.0
  10331. * @category Collection
  10332. * @param {Array|Object} collection The collection to sample.
  10333. * @param {number} [n=1] The number of elements to sample.
  10334. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10335. * @returns {Array} Returns the random elements.
  10336. * @example
  10337. *
  10338. * _.sampleSize([1, 2, 3], 2);
  10339. * // => [3, 1]
  10340. *
  10341. * _.sampleSize([1, 2, 3], 4);
  10342. * // => [2, 3, 1]
  10343. */
  10344. function sampleSize(collection, n, guard) {
  10345. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10346. n = 1;
  10347. } else {
  10348. n = toInteger(n);
  10349. }
  10350. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10351. return func(collection, n);
  10352. }
  10353. /**
  10354. * Creates an array of shuffled values, using a version of the
  10355. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10356. *
  10357. * @static
  10358. * @memberOf _
  10359. * @since 0.1.0
  10360. * @category Collection
  10361. * @param {Array|Object} collection The collection to shuffle.
  10362. * @returns {Array} Returns the new shuffled array.
  10363. * @example
  10364. *
  10365. * _.shuffle([1, 2, 3, 4]);
  10366. * // => [4, 1, 3, 2]
  10367. */
  10368. function shuffle(collection) {
  10369. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10370. return func(collection);
  10371. }
  10372. /**
  10373. * Gets the size of `collection` by returning its length for array-like
  10374. * values or the number of own enumerable string keyed properties for objects.
  10375. *
  10376. * @static
  10377. * @memberOf _
  10378. * @since 0.1.0
  10379. * @category Collection
  10380. * @param {Array|Object|string} collection The collection to inspect.
  10381. * @returns {number} Returns the collection size.
  10382. * @example
  10383. *
  10384. * _.size([1, 2, 3]);
  10385. * // => 3
  10386. *
  10387. * _.size({ 'a': 1, 'b': 2 });
  10388. * // => 2
  10389. *
  10390. * _.size('pebbles');
  10391. * // => 7
  10392. */
  10393. function size(collection) {
  10394. if (collection == null) {
  10395. return 0;
  10396. }
  10397. if (isArrayLike(collection)) {
  10398. return isString(collection) ? stringSize(collection) : collection.length;
  10399. }
  10400. var tag = getTag(collection);
  10401. if (tag == mapTag || tag == setTag) {
  10402. return collection.size;
  10403. }
  10404. return baseKeys(collection).length;
  10405. }
  10406. /**
  10407. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10408. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10409. * invoked with three arguments: (value, index|key, collection).
  10410. *
  10411. * @static
  10412. * @memberOf _
  10413. * @since 0.1.0
  10414. * @category Collection
  10415. * @param {Array|Object} collection The collection to iterate over.
  10416. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10417. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10418. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10419. * else `false`.
  10420. * @example
  10421. *
  10422. * _.some([null, 0, 'yes', false], Boolean);
  10423. * // => true
  10424. *
  10425. * var users = [
  10426. * { 'user': 'barney', 'active': true },
  10427. * { 'user': 'fred', 'active': false }
  10428. * ];
  10429. *
  10430. * // The `_.matches` iteratee shorthand.
  10431. * _.some(users, { 'user': 'barney', 'active': false });
  10432. * // => false
  10433. *
  10434. * // The `_.matchesProperty` iteratee shorthand.
  10435. * _.some(users, ['active', false]);
  10436. * // => true
  10437. *
  10438. * // The `_.property` iteratee shorthand.
  10439. * _.some(users, 'active');
  10440. * // => true
  10441. */
  10442. function some(collection, predicate, guard) {
  10443. var func = isArray(collection) ? arraySome : baseSome;
  10444. if (guard && isIterateeCall(collection, predicate, guard)) {
  10445. predicate = undefined;
  10446. }
  10447. return func(collection, getIteratee(predicate, 3));
  10448. }
  10449. /**
  10450. * Creates an array of elements, sorted in ascending order by the results of
  10451. * running each element in a collection thru each iteratee. This method
  10452. * performs a stable sort, that is, it preserves the original sort order of
  10453. * equal elements. The iteratees are invoked with one argument: (value).
  10454. *
  10455. * @static
  10456. * @memberOf _
  10457. * @since 0.1.0
  10458. * @category Collection
  10459. * @param {Array|Object} collection The collection to iterate over.
  10460. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10461. * The iteratees to sort by.
  10462. * @returns {Array} Returns the new sorted array.
  10463. * @example
  10464. *
  10465. * var users = [
  10466. * { 'user': 'fred', 'age': 48 },
  10467. * { 'user': 'barney', 'age': 36 },
  10468. * { 'user': 'fred', 'age': 30 },
  10469. * { 'user': 'barney', 'age': 34 }
  10470. * ];
  10471. *
  10472. * _.sortBy(users, [function(o) { return o.user; }]);
  10473. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10474. *
  10475. * _.sortBy(users, ['user', 'age']);
  10476. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10477. */
  10478. var sortBy = baseRest(function(collection, iteratees) {
  10479. if (collection == null) {
  10480. return [];
  10481. }
  10482. var length = iteratees.length;
  10483. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10484. iteratees = [];
  10485. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10486. iteratees = [iteratees[0]];
  10487. }
  10488. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10489. });
  10490. /*------------------------------------------------------------------------*/
  10491. /**
  10492. * Gets the timestamp of the number of milliseconds that have elapsed since
  10493. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10494. *
  10495. * @static
  10496. * @memberOf _
  10497. * @since 2.4.0
  10498. * @category Date
  10499. * @returns {number} Returns the timestamp.
  10500. * @example
  10501. *
  10502. * _.defer(function(stamp) {
  10503. * console.log(_.now() - stamp);
  10504. * }, _.now());
  10505. * // => Logs the number of milliseconds it took for the deferred invocation.
  10506. */
  10507. var now = ctxNow || function() {
  10508. return root.Date.now();
  10509. };
  10510. /*------------------------------------------------------------------------*/
  10511. /**
  10512. * The opposite of `_.before`; this method creates a function that invokes
  10513. * `func` once it's called `n` or more times.
  10514. *
  10515. * @static
  10516. * @memberOf _
  10517. * @since 0.1.0
  10518. * @category Function
  10519. * @param {number} n The number of calls before `func` is invoked.
  10520. * @param {Function} func The function to restrict.
  10521. * @returns {Function} Returns the new restricted function.
  10522. * @example
  10523. *
  10524. * var saves = ['profile', 'settings'];
  10525. *
  10526. * var done = _.after(saves.length, function() {
  10527. * console.log('done saving!');
  10528. * });
  10529. *
  10530. * _.forEach(saves, function(type) {
  10531. * asyncSave({ 'type': type, 'complete': done });
  10532. * });
  10533. * // => Logs 'done saving!' after the two async saves have completed.
  10534. */
  10535. function after(n, func) {
  10536. if (typeof func != 'function') {
  10537. throw new TypeError(FUNC_ERROR_TEXT);
  10538. }
  10539. n = toInteger(n);
  10540. return function() {
  10541. if (--n < 1) {
  10542. return func.apply(this, arguments);
  10543. }
  10544. };
  10545. }
  10546. /**
  10547. * Creates a function that invokes `func`, with up to `n` arguments,
  10548. * ignoring any additional arguments.
  10549. *
  10550. * @static
  10551. * @memberOf _
  10552. * @since 3.0.0
  10553. * @category Function
  10554. * @param {Function} func The function to cap arguments for.
  10555. * @param {number} [n=func.length] The arity cap.
  10556. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10557. * @returns {Function} Returns the new capped function.
  10558. * @example
  10559. *
  10560. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10561. * // => [6, 8, 10]
  10562. */
  10563. function ary(func, n, guard) {
  10564. n = guard ? undefined : n;
  10565. n = (func && n == null) ? func.length : n;
  10566. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10567. }
  10568. /**
  10569. * Creates a function that invokes `func`, with the `this` binding and arguments
  10570. * of the created function, while it's called less than `n` times. Subsequent
  10571. * calls to the created function return the result of the last `func` invocation.
  10572. *
  10573. * @static
  10574. * @memberOf _
  10575. * @since 3.0.0
  10576. * @category Function
  10577. * @param {number} n The number of calls at which `func` is no longer invoked.
  10578. * @param {Function} func The function to restrict.
  10579. * @returns {Function} Returns the new restricted function.
  10580. * @example
  10581. *
  10582. * jQuery(element).on('click', _.before(5, addContactToList));
  10583. * // => Allows adding up to 4 contacts to the list.
  10584. */
  10585. function before(n, func) {
  10586. var result;
  10587. if (typeof func != 'function') {
  10588. throw new TypeError(FUNC_ERROR_TEXT);
  10589. }
  10590. n = toInteger(n);
  10591. return function() {
  10592. if (--n > 0) {
  10593. result = func.apply(this, arguments);
  10594. }
  10595. if (n <= 1) {
  10596. func = undefined;
  10597. }
  10598. return result;
  10599. };
  10600. }
  10601. /**
  10602. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10603. * and `partials` prepended to the arguments it receives.
  10604. *
  10605. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10606. * may be used as a placeholder for partially applied arguments.
  10607. *
  10608. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10609. * property of bound functions.
  10610. *
  10611. * @static
  10612. * @memberOf _
  10613. * @since 0.1.0
  10614. * @category Function
  10615. * @param {Function} func The function to bind.
  10616. * @param {*} thisArg The `this` binding of `func`.
  10617. * @param {...*} [partials] The arguments to be partially applied.
  10618. * @returns {Function} Returns the new bound function.
  10619. * @example
  10620. *
  10621. * function greet(greeting, punctuation) {
  10622. * return greeting + ' ' + this.user + punctuation;
  10623. * }
  10624. *
  10625. * var object = { 'user': 'fred' };
  10626. *
  10627. * var bound = _.bind(greet, object, 'hi');
  10628. * bound('!');
  10629. * // => 'hi fred!'
  10630. *
  10631. * // Bound with placeholders.
  10632. * var bound = _.bind(greet, object, _, '!');
  10633. * bound('hi');
  10634. * // => 'hi fred!'
  10635. */
  10636. var bind = baseRest(function(func, thisArg, partials) {
  10637. var bitmask = WRAP_BIND_FLAG;
  10638. if (partials.length) {
  10639. var holders = replaceHolders(partials, getHolder(bind));
  10640. bitmask |= WRAP_PARTIAL_FLAG;
  10641. }
  10642. return createWrap(func, bitmask, thisArg, partials, holders);
  10643. });
  10644. /**
  10645. * Creates a function that invokes the method at `object[key]` with `partials`
  10646. * prepended to the arguments it receives.
  10647. *
  10648. * This method differs from `_.bind` by allowing bound functions to reference
  10649. * methods that may be redefined or don't yet exist. See
  10650. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10651. * for more details.
  10652. *
  10653. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10654. * builds, may be used as a placeholder for partially applied arguments.
  10655. *
  10656. * @static
  10657. * @memberOf _
  10658. * @since 0.10.0
  10659. * @category Function
  10660. * @param {Object} object The object to invoke the method on.
  10661. * @param {string} key The key of the method.
  10662. * @param {...*} [partials] The arguments to be partially applied.
  10663. * @returns {Function} Returns the new bound function.
  10664. * @example
  10665. *
  10666. * var object = {
  10667. * 'user': 'fred',
  10668. * 'greet': function(greeting, punctuation) {
  10669. * return greeting + ' ' + this.user + punctuation;
  10670. * }
  10671. * };
  10672. *
  10673. * var bound = _.bindKey(object, 'greet', 'hi');
  10674. * bound('!');
  10675. * // => 'hi fred!'
  10676. *
  10677. * object.greet = function(greeting, punctuation) {
  10678. * return greeting + 'ya ' + this.user + punctuation;
  10679. * };
  10680. *
  10681. * bound('!');
  10682. * // => 'hiya fred!'
  10683. *
  10684. * // Bound with placeholders.
  10685. * var bound = _.bindKey(object, 'greet', _, '!');
  10686. * bound('hi');
  10687. * // => 'hiya fred!'
  10688. */
  10689. var bindKey = baseRest(function(object, key, partials) {
  10690. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10691. if (partials.length) {
  10692. var holders = replaceHolders(partials, getHolder(bindKey));
  10693. bitmask |= WRAP_PARTIAL_FLAG;
  10694. }
  10695. return createWrap(key, bitmask, object, partials, holders);
  10696. });
  10697. /**
  10698. * Creates a function that accepts arguments of `func` and either invokes
  10699. * `func` returning its result, if at least `arity` number of arguments have
  10700. * been provided, or returns a function that accepts the remaining `func`
  10701. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10702. * is not sufficient.
  10703. *
  10704. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10705. * may be used as a placeholder for provided arguments.
  10706. *
  10707. * **Note:** This method doesn't set the "length" property of curried functions.
  10708. *
  10709. * @static
  10710. * @memberOf _
  10711. * @since 2.0.0
  10712. * @category Function
  10713. * @param {Function} func The function to curry.
  10714. * @param {number} [arity=func.length] The arity of `func`.
  10715. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10716. * @returns {Function} Returns the new curried function.
  10717. * @example
  10718. *
  10719. * var abc = function(a, b, c) {
  10720. * return [a, b, c];
  10721. * };
  10722. *
  10723. * var curried = _.curry(abc);
  10724. *
  10725. * curried(1)(2)(3);
  10726. * // => [1, 2, 3]
  10727. *
  10728. * curried(1, 2)(3);
  10729. * // => [1, 2, 3]
  10730. *
  10731. * curried(1, 2, 3);
  10732. * // => [1, 2, 3]
  10733. *
  10734. * // Curried with placeholders.
  10735. * curried(1)(_, 3)(2);
  10736. * // => [1, 2, 3]
  10737. */
  10738. function curry(func, arity, guard) {
  10739. arity = guard ? undefined : arity;
  10740. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10741. result.placeholder = curry.placeholder;
  10742. return result;
  10743. }
  10744. /**
  10745. * This method is like `_.curry` except that arguments are applied to `func`
  10746. * in the manner of `_.partialRight` instead of `_.partial`.
  10747. *
  10748. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10749. * builds, may be used as a placeholder for provided arguments.
  10750. *
  10751. * **Note:** This method doesn't set the "length" property of curried functions.
  10752. *
  10753. * @static
  10754. * @memberOf _
  10755. * @since 3.0.0
  10756. * @category Function
  10757. * @param {Function} func The function to curry.
  10758. * @param {number} [arity=func.length] The arity of `func`.
  10759. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10760. * @returns {Function} Returns the new curried function.
  10761. * @example
  10762. *
  10763. * var abc = function(a, b, c) {
  10764. * return [a, b, c];
  10765. * };
  10766. *
  10767. * var curried = _.curryRight(abc);
  10768. *
  10769. * curried(3)(2)(1);
  10770. * // => [1, 2, 3]
  10771. *
  10772. * curried(2, 3)(1);
  10773. * // => [1, 2, 3]
  10774. *
  10775. * curried(1, 2, 3);
  10776. * // => [1, 2, 3]
  10777. *
  10778. * // Curried with placeholders.
  10779. * curried(3)(1, _)(2);
  10780. * // => [1, 2, 3]
  10781. */
  10782. function curryRight(func, arity, guard) {
  10783. arity = guard ? undefined : arity;
  10784. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10785. result.placeholder = curryRight.placeholder;
  10786. return result;
  10787. }
  10788. /**
  10789. * Creates a debounced function that delays invoking `func` until after `wait`
  10790. * milliseconds have elapsed since the last time the debounced function was
  10791. * invoked. The debounced function comes with a `cancel` method to cancel
  10792. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10793. * Provide `options` to indicate whether `func` should be invoked on the
  10794. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10795. * with the last arguments provided to the debounced function. Subsequent
  10796. * calls to the debounced function return the result of the last `func`
  10797. * invocation.
  10798. *
  10799. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10800. * invoked on the trailing edge of the timeout only if the debounced function
  10801. * is invoked more than once during the `wait` timeout.
  10802. *
  10803. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10804. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10805. *
  10806. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10807. * for details over the differences between `_.debounce` and `_.throttle`.
  10808. *
  10809. * @static
  10810. * @memberOf _
  10811. * @since 0.1.0
  10812. * @category Function
  10813. * @param {Function} func The function to debounce.
  10814. * @param {number} [wait=0] The number of milliseconds to delay.
  10815. * @param {Object} [options={}] The options object.
  10816. * @param {boolean} [options.leading=false]
  10817. * Specify invoking on the leading edge of the timeout.
  10818. * @param {number} [options.maxWait]
  10819. * The maximum time `func` is allowed to be delayed before it's invoked.
  10820. * @param {boolean} [options.trailing=true]
  10821. * Specify invoking on the trailing edge of the timeout.
  10822. * @returns {Function} Returns the new debounced function.
  10823. * @example
  10824. *
  10825. * // Avoid costly calculations while the window size is in flux.
  10826. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10827. *
  10828. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10829. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10830. * 'leading': true,
  10831. * 'trailing': false
  10832. * }));
  10833. *
  10834. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10835. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10836. * var source = new EventSource('/stream');
  10837. * jQuery(source).on('message', debounced);
  10838. *
  10839. * // Cancel the trailing debounced invocation.
  10840. * jQuery(window).on('popstate', debounced.cancel);
  10841. */
  10842. function debounce(func, wait, options) {
  10843. var lastArgs,
  10844. lastThis,
  10845. maxWait,
  10846. result,
  10847. timerId,
  10848. lastCallTime,
  10849. lastInvokeTime = 0,
  10850. leading = false,
  10851. maxing = false,
  10852. trailing = true;
  10853. if (typeof func != 'function') {
  10854. throw new TypeError(FUNC_ERROR_TEXT);
  10855. }
  10856. wait = toNumber(wait) || 0;
  10857. if (isObject(options)) {
  10858. leading = !!options.leading;
  10859. maxing = 'maxWait' in options;
  10860. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10861. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10862. }
  10863. function invokeFunc(time) {
  10864. var args = lastArgs,
  10865. thisArg = lastThis;
  10866. lastArgs = lastThis = undefined;
  10867. lastInvokeTime = time;
  10868. result = func.apply(thisArg, args);
  10869. return result;
  10870. }
  10871. function leadingEdge(time) {
  10872. // Reset any `maxWait` timer.
  10873. lastInvokeTime = time;
  10874. // Start the timer for the trailing edge.
  10875. timerId = setTimeout(timerExpired, wait);
  10876. // Invoke the leading edge.
  10877. return leading ? invokeFunc(time) : result;
  10878. }
  10879. function remainingWait(time) {
  10880. var timeSinceLastCall = time - lastCallTime,
  10881. timeSinceLastInvoke = time - lastInvokeTime,
  10882. timeWaiting = wait - timeSinceLastCall;
  10883. return maxing
  10884. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10885. : timeWaiting;
  10886. }
  10887. function shouldInvoke(time) {
  10888. var timeSinceLastCall = time - lastCallTime,
  10889. timeSinceLastInvoke = time - lastInvokeTime;
  10890. // Either this is the first call, activity has stopped and we're at the
  10891. // trailing edge, the system time has gone backwards and we're treating
  10892. // it as the trailing edge, or we've hit the `maxWait` limit.
  10893. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10894. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10895. }
  10896. function timerExpired() {
  10897. var time = now();
  10898. if (shouldInvoke(time)) {
  10899. return trailingEdge(time);
  10900. }
  10901. // Restart the timer.
  10902. timerId = setTimeout(timerExpired, remainingWait(time));
  10903. }
  10904. function trailingEdge(time) {
  10905. timerId = undefined;
  10906. // Only invoke if we have `lastArgs` which means `func` has been
  10907. // debounced at least once.
  10908. if (trailing && lastArgs) {
  10909. return invokeFunc(time);
  10910. }
  10911. lastArgs = lastThis = undefined;
  10912. return result;
  10913. }
  10914. function cancel() {
  10915. if (timerId !== undefined) {
  10916. clearTimeout(timerId);
  10917. }
  10918. lastInvokeTime = 0;
  10919. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10920. }
  10921. function flush() {
  10922. return timerId === undefined ? result : trailingEdge(now());
  10923. }
  10924. function debounced() {
  10925. var time = now(),
  10926. isInvoking = shouldInvoke(time);
  10927. lastArgs = arguments;
  10928. lastThis = this;
  10929. lastCallTime = time;
  10930. if (isInvoking) {
  10931. if (timerId === undefined) {
  10932. return leadingEdge(lastCallTime);
  10933. }
  10934. if (maxing) {
  10935. // Handle invocations in a tight loop.
  10936. clearTimeout(timerId);
  10937. timerId = setTimeout(timerExpired, wait);
  10938. return invokeFunc(lastCallTime);
  10939. }
  10940. }
  10941. if (timerId === undefined) {
  10942. timerId = setTimeout(timerExpired, wait);
  10943. }
  10944. return result;
  10945. }
  10946. debounced.cancel = cancel;
  10947. debounced.flush = flush;
  10948. return debounced;
  10949. }
  10950. /**
  10951. * Defers invoking the `func` until the current call stack has cleared. Any
  10952. * additional arguments are provided to `func` when it's invoked.
  10953. *
  10954. * @static
  10955. * @memberOf _
  10956. * @since 0.1.0
  10957. * @category Function
  10958. * @param {Function} func The function to defer.
  10959. * @param {...*} [args] The arguments to invoke `func` with.
  10960. * @returns {number} Returns the timer id.
  10961. * @example
  10962. *
  10963. * _.defer(function(text) {
  10964. * console.log(text);
  10965. * }, 'deferred');
  10966. * // => Logs 'deferred' after one millisecond.
  10967. */
  10968. var defer = baseRest(function(func, args) {
  10969. return baseDelay(func, 1, args);
  10970. });
  10971. /**
  10972. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10973. * provided to `func` when it's invoked.
  10974. *
  10975. * @static
  10976. * @memberOf _
  10977. * @since 0.1.0
  10978. * @category Function
  10979. * @param {Function} func The function to delay.
  10980. * @param {number} wait The number of milliseconds to delay invocation.
  10981. * @param {...*} [args] The arguments to invoke `func` with.
  10982. * @returns {number} Returns the timer id.
  10983. * @example
  10984. *
  10985. * _.delay(function(text) {
  10986. * console.log(text);
  10987. * }, 1000, 'later');
  10988. * // => Logs 'later' after one second.
  10989. */
  10990. var delay = baseRest(function(func, wait, args) {
  10991. return baseDelay(func, toNumber(wait) || 0, args);
  10992. });
  10993. /**
  10994. * Creates a function that invokes `func` with arguments reversed.
  10995. *
  10996. * @static
  10997. * @memberOf _
  10998. * @since 4.0.0
  10999. * @category Function
  11000. * @param {Function} func The function to flip arguments for.
  11001. * @returns {Function} Returns the new flipped function.
  11002. * @example
  11003. *
  11004. * var flipped = _.flip(function() {
  11005. * return _.toArray(arguments);
  11006. * });
  11007. *
  11008. * flipped('a', 'b', 'c', 'd');
  11009. * // => ['d', 'c', 'b', 'a']
  11010. */
  11011. function flip(func) {
  11012. return createWrap(func, WRAP_FLIP_FLAG);
  11013. }
  11014. /**
  11015. * Creates a function that memoizes the result of `func`. If `resolver` is
  11016. * provided, it determines the cache key for storing the result based on the
  11017. * arguments provided to the memoized function. By default, the first argument
  11018. * provided to the memoized function is used as the map cache key. The `func`
  11019. * is invoked with the `this` binding of the memoized function.
  11020. *
  11021. * **Note:** The cache is exposed as the `cache` property on the memoized
  11022. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11023. * constructor with one whose instances implement the
  11024. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11025. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11026. *
  11027. * @static
  11028. * @memberOf _
  11029. * @since 0.1.0
  11030. * @category Function
  11031. * @param {Function} func The function to have its output memoized.
  11032. * @param {Function} [resolver] The function to resolve the cache key.
  11033. * @returns {Function} Returns the new memoized function.
  11034. * @example
  11035. *
  11036. * var object = { 'a': 1, 'b': 2 };
  11037. * var other = { 'c': 3, 'd': 4 };
  11038. *
  11039. * var values = _.memoize(_.values);
  11040. * values(object);
  11041. * // => [1, 2]
  11042. *
  11043. * values(other);
  11044. * // => [3, 4]
  11045. *
  11046. * object.a = 2;
  11047. * values(object);
  11048. * // => [1, 2]
  11049. *
  11050. * // Modify the result cache.
  11051. * values.cache.set(object, ['a', 'b']);
  11052. * values(object);
  11053. * // => ['a', 'b']
  11054. *
  11055. * // Replace `_.memoize.Cache`.
  11056. * _.memoize.Cache = WeakMap;
  11057. */
  11058. function memoize(func, resolver) {
  11059. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11060. throw new TypeError(FUNC_ERROR_TEXT);
  11061. }
  11062. var memoized = function() {
  11063. var args = arguments,
  11064. key = resolver ? resolver.apply(this, args) : args[0],
  11065. cache = memoized.cache;
  11066. if (cache.has(key)) {
  11067. return cache.get(key);
  11068. }
  11069. var result = func.apply(this, args);
  11070. memoized.cache = cache.set(key, result) || cache;
  11071. return result;
  11072. };
  11073. memoized.cache = new (memoize.Cache || MapCache);
  11074. return memoized;
  11075. }
  11076. // Expose `MapCache`.
  11077. memoize.Cache = MapCache;
  11078. /**
  11079. * Creates a function that negates the result of the predicate `func`. The
  11080. * `func` predicate is invoked with the `this` binding and arguments of the
  11081. * created function.
  11082. *
  11083. * @static
  11084. * @memberOf _
  11085. * @since 3.0.0
  11086. * @category Function
  11087. * @param {Function} predicate The predicate to negate.
  11088. * @returns {Function} Returns the new negated function.
  11089. * @example
  11090. *
  11091. * function isEven(n) {
  11092. * return n % 2 == 0;
  11093. * }
  11094. *
  11095. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11096. * // => [1, 3, 5]
  11097. */
  11098. function negate(predicate) {
  11099. if (typeof predicate != 'function') {
  11100. throw new TypeError(FUNC_ERROR_TEXT);
  11101. }
  11102. return function() {
  11103. var args = arguments;
  11104. switch (args.length) {
  11105. case 0: return !predicate.call(this);
  11106. case 1: return !predicate.call(this, args[0]);
  11107. case 2: return !predicate.call(this, args[0], args[1]);
  11108. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11109. }
  11110. return !predicate.apply(this, args);
  11111. };
  11112. }
  11113. /**
  11114. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11115. * to the function return the value of the first invocation. The `func` is
  11116. * invoked with the `this` binding and arguments of the created function.
  11117. *
  11118. * @static
  11119. * @memberOf _
  11120. * @since 0.1.0
  11121. * @category Function
  11122. * @param {Function} func The function to restrict.
  11123. * @returns {Function} Returns the new restricted function.
  11124. * @example
  11125. *
  11126. * var initialize = _.once(createApplication);
  11127. * initialize();
  11128. * initialize();
  11129. * // => `createApplication` is invoked once
  11130. */
  11131. function once(func) {
  11132. return before(2, func);
  11133. }
  11134. /**
  11135. * Creates a function that invokes `func` with its arguments transformed.
  11136. *
  11137. * @static
  11138. * @since 4.0.0
  11139. * @memberOf _
  11140. * @category Function
  11141. * @param {Function} func The function to wrap.
  11142. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11143. * The argument transforms.
  11144. * @returns {Function} Returns the new function.
  11145. * @example
  11146. *
  11147. * function doubled(n) {
  11148. * return n * 2;
  11149. * }
  11150. *
  11151. * function square(n) {
  11152. * return n * n;
  11153. * }
  11154. *
  11155. * var func = _.overArgs(function(x, y) {
  11156. * return [x, y];
  11157. * }, [square, doubled]);
  11158. *
  11159. * func(9, 3);
  11160. * // => [81, 6]
  11161. *
  11162. * func(10, 5);
  11163. * // => [100, 10]
  11164. */
  11165. var overArgs = castRest(function(func, transforms) {
  11166. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11167. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11168. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11169. var funcsLength = transforms.length;
  11170. return baseRest(function(args) {
  11171. var index = -1,
  11172. length = nativeMin(args.length, funcsLength);
  11173. while (++index < length) {
  11174. args[index] = transforms[index].call(this, args[index]);
  11175. }
  11176. return apply(func, this, args);
  11177. });
  11178. });
  11179. /**
  11180. * Creates a function that invokes `func` with `partials` prepended to the
  11181. * arguments it receives. This method is like `_.bind` except it does **not**
  11182. * alter the `this` binding.
  11183. *
  11184. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11185. * builds, may be used as a placeholder for partially applied arguments.
  11186. *
  11187. * **Note:** This method doesn't set the "length" property of partially
  11188. * applied functions.
  11189. *
  11190. * @static
  11191. * @memberOf _
  11192. * @since 0.2.0
  11193. * @category Function
  11194. * @param {Function} func The function to partially apply arguments to.
  11195. * @param {...*} [partials] The arguments to be partially applied.
  11196. * @returns {Function} Returns the new partially applied function.
  11197. * @example
  11198. *
  11199. * function greet(greeting, name) {
  11200. * return greeting + ' ' + name;
  11201. * }
  11202. *
  11203. * var sayHelloTo = _.partial(greet, 'hello');
  11204. * sayHelloTo('fred');
  11205. * // => 'hello fred'
  11206. *
  11207. * // Partially applied with placeholders.
  11208. * var greetFred = _.partial(greet, _, 'fred');
  11209. * greetFred('hi');
  11210. * // => 'hi fred'
  11211. */
  11212. var partial = baseRest(function(func, partials) {
  11213. var holders = replaceHolders(partials, getHolder(partial));
  11214. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11215. });
  11216. /**
  11217. * This method is like `_.partial` except that partially applied arguments
  11218. * are appended to the arguments it receives.
  11219. *
  11220. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11221. * builds, may be used as a placeholder for partially applied arguments.
  11222. *
  11223. * **Note:** This method doesn't set the "length" property of partially
  11224. * applied functions.
  11225. *
  11226. * @static
  11227. * @memberOf _
  11228. * @since 1.0.0
  11229. * @category Function
  11230. * @param {Function} func The function to partially apply arguments to.
  11231. * @param {...*} [partials] The arguments to be partially applied.
  11232. * @returns {Function} Returns the new partially applied function.
  11233. * @example
  11234. *
  11235. * function greet(greeting, name) {
  11236. * return greeting + ' ' + name;
  11237. * }
  11238. *
  11239. * var greetFred = _.partialRight(greet, 'fred');
  11240. * greetFred('hi');
  11241. * // => 'hi fred'
  11242. *
  11243. * // Partially applied with placeholders.
  11244. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11245. * sayHelloTo('fred');
  11246. * // => 'hello fred'
  11247. */
  11248. var partialRight = baseRest(function(func, partials) {
  11249. var holders = replaceHolders(partials, getHolder(partialRight));
  11250. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11251. });
  11252. /**
  11253. * Creates a function that invokes `func` with arguments arranged according
  11254. * to the specified `indexes` where the argument value at the first index is
  11255. * provided as the first argument, the argument value at the second index is
  11256. * provided as the second argument, and so on.
  11257. *
  11258. * @static
  11259. * @memberOf _
  11260. * @since 3.0.0
  11261. * @category Function
  11262. * @param {Function} func The function to rearrange arguments for.
  11263. * @param {...(number|number[])} indexes The arranged argument indexes.
  11264. * @returns {Function} Returns the new function.
  11265. * @example
  11266. *
  11267. * var rearged = _.rearg(function(a, b, c) {
  11268. * return [a, b, c];
  11269. * }, [2, 0, 1]);
  11270. *
  11271. * rearged('b', 'c', 'a')
  11272. * // => ['a', 'b', 'c']
  11273. */
  11274. var rearg = flatRest(function(func, indexes) {
  11275. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11276. });
  11277. /**
  11278. * Creates a function that invokes `func` with the `this` binding of the
  11279. * created function and arguments from `start` and beyond provided as
  11280. * an array.
  11281. *
  11282. * **Note:** This method is based on the
  11283. * [rest parameter](https://mdn.io/rest_parameters).
  11284. *
  11285. * @static
  11286. * @memberOf _
  11287. * @since 4.0.0
  11288. * @category Function
  11289. * @param {Function} func The function to apply a rest parameter to.
  11290. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11291. * @returns {Function} Returns the new function.
  11292. * @example
  11293. *
  11294. * var say = _.rest(function(what, names) {
  11295. * return what + ' ' + _.initial(names).join(', ') +
  11296. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11297. * });
  11298. *
  11299. * say('hello', 'fred', 'barney', 'pebbles');
  11300. * // => 'hello fred, barney, & pebbles'
  11301. */
  11302. function rest(func, start) {
  11303. if (typeof func != 'function') {
  11304. throw new TypeError(FUNC_ERROR_TEXT);
  11305. }
  11306. start = start === undefined ? start : toInteger(start);
  11307. return baseRest(func, start);
  11308. }
  11309. /**
  11310. * Creates a function that invokes `func` with the `this` binding of the
  11311. * create function and an array of arguments much like
  11312. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11313. *
  11314. * **Note:** This method is based on the
  11315. * [spread operator](https://mdn.io/spread_operator).
  11316. *
  11317. * @static
  11318. * @memberOf _
  11319. * @since 3.2.0
  11320. * @category Function
  11321. * @param {Function} func The function to spread arguments over.
  11322. * @param {number} [start=0] The start position of the spread.
  11323. * @returns {Function} Returns the new function.
  11324. * @example
  11325. *
  11326. * var say = _.spread(function(who, what) {
  11327. * return who + ' says ' + what;
  11328. * });
  11329. *
  11330. * say(['fred', 'hello']);
  11331. * // => 'fred says hello'
  11332. *
  11333. * var numbers = Promise.all([
  11334. * Promise.resolve(40),
  11335. * Promise.resolve(36)
  11336. * ]);
  11337. *
  11338. * numbers.then(_.spread(function(x, y) {
  11339. * return x + y;
  11340. * }));
  11341. * // => a Promise of 76
  11342. */
  11343. function spread(func, start) {
  11344. if (typeof func != 'function') {
  11345. throw new TypeError(FUNC_ERROR_TEXT);
  11346. }
  11347. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11348. return baseRest(function(args) {
  11349. var array = args[start],
  11350. otherArgs = castSlice(args, 0, start);
  11351. if (array) {
  11352. arrayPush(otherArgs, array);
  11353. }
  11354. return apply(func, this, otherArgs);
  11355. });
  11356. }
  11357. /**
  11358. * Creates a throttled function that only invokes `func` at most once per
  11359. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11360. * method to cancel delayed `func` invocations and a `flush` method to
  11361. * immediately invoke them. Provide `options` to indicate whether `func`
  11362. * should be invoked on the leading and/or trailing edge of the `wait`
  11363. * timeout. The `func` is invoked with the last arguments provided to the
  11364. * throttled function. Subsequent calls to the throttled function return the
  11365. * result of the last `func` invocation.
  11366. *
  11367. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11368. * invoked on the trailing edge of the timeout only if the throttled function
  11369. * is invoked more than once during the `wait` timeout.
  11370. *
  11371. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11372. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11373. *
  11374. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11375. * for details over the differences between `_.throttle` and `_.debounce`.
  11376. *
  11377. * @static
  11378. * @memberOf _
  11379. * @since 0.1.0
  11380. * @category Function
  11381. * @param {Function} func The function to throttle.
  11382. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11383. * @param {Object} [options={}] The options object.
  11384. * @param {boolean} [options.leading=true]
  11385. * Specify invoking on the leading edge of the timeout.
  11386. * @param {boolean} [options.trailing=true]
  11387. * Specify invoking on the trailing edge of the timeout.
  11388. * @returns {Function} Returns the new throttled function.
  11389. * @example
  11390. *
  11391. * // Avoid excessively updating the position while scrolling.
  11392. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11393. *
  11394. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11395. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11396. * jQuery(element).on('click', throttled);
  11397. *
  11398. * // Cancel the trailing throttled invocation.
  11399. * jQuery(window).on('popstate', throttled.cancel);
  11400. */
  11401. function throttle(func, wait, options) {
  11402. var leading = true,
  11403. trailing = true;
  11404. if (typeof func != 'function') {
  11405. throw new TypeError(FUNC_ERROR_TEXT);
  11406. }
  11407. if (isObject(options)) {
  11408. leading = 'leading' in options ? !!options.leading : leading;
  11409. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11410. }
  11411. return debounce(func, wait, {
  11412. 'leading': leading,
  11413. 'maxWait': wait,
  11414. 'trailing': trailing
  11415. });
  11416. }
  11417. /**
  11418. * Creates a function that accepts up to one argument, ignoring any
  11419. * additional arguments.
  11420. *
  11421. * @static
  11422. * @memberOf _
  11423. * @since 4.0.0
  11424. * @category Function
  11425. * @param {Function} func The function to cap arguments for.
  11426. * @returns {Function} Returns the new capped function.
  11427. * @example
  11428. *
  11429. * _.map(['6', '8', '10'], _.unary(parseInt));
  11430. * // => [6, 8, 10]
  11431. */
  11432. function unary(func) {
  11433. return ary(func, 1);
  11434. }
  11435. /**
  11436. * Creates a function that provides `value` to `wrapper` as its first
  11437. * argument. Any additional arguments provided to the function are appended
  11438. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11439. * binding of the created function.
  11440. *
  11441. * @static
  11442. * @memberOf _
  11443. * @since 0.1.0
  11444. * @category Function
  11445. * @param {*} value The value to wrap.
  11446. * @param {Function} [wrapper=identity] The wrapper function.
  11447. * @returns {Function} Returns the new function.
  11448. * @example
  11449. *
  11450. * var p = _.wrap(_.escape, function(func, text) {
  11451. * return '<p>' + func(text) + '</p>';
  11452. * });
  11453. *
  11454. * p('fred, barney, & pebbles');
  11455. * // => '<p>fred, barney, &amp; pebbles</p>'
  11456. */
  11457. function wrap(value, wrapper) {
  11458. return partial(castFunction(wrapper), value);
  11459. }
  11460. /*------------------------------------------------------------------------*/
  11461. /**
  11462. * Casts `value` as an array if it's not one.
  11463. *
  11464. * @static
  11465. * @memberOf _
  11466. * @since 4.4.0
  11467. * @category Lang
  11468. * @param {*} value The value to inspect.
  11469. * @returns {Array} Returns the cast array.
  11470. * @example
  11471. *
  11472. * _.castArray(1);
  11473. * // => [1]
  11474. *
  11475. * _.castArray({ 'a': 1 });
  11476. * // => [{ 'a': 1 }]
  11477. *
  11478. * _.castArray('abc');
  11479. * // => ['abc']
  11480. *
  11481. * _.castArray(null);
  11482. * // => [null]
  11483. *
  11484. * _.castArray(undefined);
  11485. * // => [undefined]
  11486. *
  11487. * _.castArray();
  11488. * // => []
  11489. *
  11490. * var array = [1, 2, 3];
  11491. * console.log(_.castArray(array) === array);
  11492. * // => true
  11493. */
  11494. function castArray() {
  11495. if (!arguments.length) {
  11496. return [];
  11497. }
  11498. var value = arguments[0];
  11499. return isArray(value) ? value : [value];
  11500. }
  11501. /**
  11502. * Creates a shallow clone of `value`.
  11503. *
  11504. * **Note:** This method is loosely based on the
  11505. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11506. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11507. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11508. * arrays. The own enumerable properties of `arguments` objects are cloned
  11509. * as plain objects. An empty object is returned for uncloneable values such
  11510. * as error objects, functions, DOM nodes, and WeakMaps.
  11511. *
  11512. * @static
  11513. * @memberOf _
  11514. * @since 0.1.0
  11515. * @category Lang
  11516. * @param {*} value The value to clone.
  11517. * @returns {*} Returns the cloned value.
  11518. * @see _.cloneDeep
  11519. * @example
  11520. *
  11521. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11522. *
  11523. * var shallow = _.clone(objects);
  11524. * console.log(shallow[0] === objects[0]);
  11525. * // => true
  11526. */
  11527. function clone(value) {
  11528. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11529. }
  11530. /**
  11531. * This method is like `_.clone` except that it accepts `customizer` which
  11532. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11533. * cloning is handled by the method instead. The `customizer` is invoked with
  11534. * up to four arguments; (value [, index|key, object, stack]).
  11535. *
  11536. * @static
  11537. * @memberOf _
  11538. * @since 4.0.0
  11539. * @category Lang
  11540. * @param {*} value The value to clone.
  11541. * @param {Function} [customizer] The function to customize cloning.
  11542. * @returns {*} Returns the cloned value.
  11543. * @see _.cloneDeepWith
  11544. * @example
  11545. *
  11546. * function customizer(value) {
  11547. * if (_.isElement(value)) {
  11548. * return value.cloneNode(false);
  11549. * }
  11550. * }
  11551. *
  11552. * var el = _.cloneWith(document.body, customizer);
  11553. *
  11554. * console.log(el === document.body);
  11555. * // => false
  11556. * console.log(el.nodeName);
  11557. * // => 'BODY'
  11558. * console.log(el.childNodes.length);
  11559. * // => 0
  11560. */
  11561. function cloneWith(value, customizer) {
  11562. customizer = typeof customizer == 'function' ? customizer : undefined;
  11563. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11564. }
  11565. /**
  11566. * This method is like `_.clone` except that it recursively clones `value`.
  11567. *
  11568. * @static
  11569. * @memberOf _
  11570. * @since 1.0.0
  11571. * @category Lang
  11572. * @param {*} value The value to recursively clone.
  11573. * @returns {*} Returns the deep cloned value.
  11574. * @see _.clone
  11575. * @example
  11576. *
  11577. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11578. *
  11579. * var deep = _.cloneDeep(objects);
  11580. * console.log(deep[0] === objects[0]);
  11581. * // => false
  11582. */
  11583. function cloneDeep(value) {
  11584. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11585. }
  11586. /**
  11587. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11588. *
  11589. * @static
  11590. * @memberOf _
  11591. * @since 4.0.0
  11592. * @category Lang
  11593. * @param {*} value The value to recursively clone.
  11594. * @param {Function} [customizer] The function to customize cloning.
  11595. * @returns {*} Returns the deep cloned value.
  11596. * @see _.cloneWith
  11597. * @example
  11598. *
  11599. * function customizer(value) {
  11600. * if (_.isElement(value)) {
  11601. * return value.cloneNode(true);
  11602. * }
  11603. * }
  11604. *
  11605. * var el = _.cloneDeepWith(document.body, customizer);
  11606. *
  11607. * console.log(el === document.body);
  11608. * // => false
  11609. * console.log(el.nodeName);
  11610. * // => 'BODY'
  11611. * console.log(el.childNodes.length);
  11612. * // => 20
  11613. */
  11614. function cloneDeepWith(value, customizer) {
  11615. customizer = typeof customizer == 'function' ? customizer : undefined;
  11616. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11617. }
  11618. /**
  11619. * Checks if `object` conforms to `source` by invoking the predicate
  11620. * properties of `source` with the corresponding property values of `object`.
  11621. *
  11622. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11623. * partially applied.
  11624. *
  11625. * @static
  11626. * @memberOf _
  11627. * @since 4.14.0
  11628. * @category Lang
  11629. * @param {Object} object The object to inspect.
  11630. * @param {Object} source The object of property predicates to conform to.
  11631. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11632. * @example
  11633. *
  11634. * var object = { 'a': 1, 'b': 2 };
  11635. *
  11636. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11637. * // => true
  11638. *
  11639. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11640. * // => false
  11641. */
  11642. function conformsTo(object, source) {
  11643. return source == null || baseConformsTo(object, source, keys(source));
  11644. }
  11645. /**
  11646. * Performs a
  11647. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11648. * comparison between two values to determine if they are equivalent.
  11649. *
  11650. * @static
  11651. * @memberOf _
  11652. * @since 4.0.0
  11653. * @category Lang
  11654. * @param {*} value The value to compare.
  11655. * @param {*} other The other value to compare.
  11656. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11657. * @example
  11658. *
  11659. * var object = { 'a': 1 };
  11660. * var other = { 'a': 1 };
  11661. *
  11662. * _.eq(object, object);
  11663. * // => true
  11664. *
  11665. * _.eq(object, other);
  11666. * // => false
  11667. *
  11668. * _.eq('a', 'a');
  11669. * // => true
  11670. *
  11671. * _.eq('a', Object('a'));
  11672. * // => false
  11673. *
  11674. * _.eq(NaN, NaN);
  11675. * // => true
  11676. */
  11677. function eq(value, other) {
  11678. return value === other || (value !== value && other !== other);
  11679. }
  11680. /**
  11681. * Checks if `value` is greater than `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 `other`,
  11690. * else `false`.
  11691. * @see _.lt
  11692. * @example
  11693. *
  11694. * _.gt(3, 1);
  11695. * // => true
  11696. *
  11697. * _.gt(3, 3);
  11698. * // => false
  11699. *
  11700. * _.gt(1, 3);
  11701. * // => false
  11702. */
  11703. var gt = createRelationalOperation(baseGt);
  11704. /**
  11705. * Checks if `value` is greater than or equal to `other`.
  11706. *
  11707. * @static
  11708. * @memberOf _
  11709. * @since 3.9.0
  11710. * @category Lang
  11711. * @param {*} value The value to compare.
  11712. * @param {*} other The other value to compare.
  11713. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11714. * `other`, else `false`.
  11715. * @see _.lte
  11716. * @example
  11717. *
  11718. * _.gte(3, 1);
  11719. * // => true
  11720. *
  11721. * _.gte(3, 3);
  11722. * // => true
  11723. *
  11724. * _.gte(1, 3);
  11725. * // => false
  11726. */
  11727. var gte = createRelationalOperation(function(value, other) {
  11728. return value >= other;
  11729. });
  11730. /**
  11731. * Checks if `value` is likely an `arguments` object.
  11732. *
  11733. * @static
  11734. * @memberOf _
  11735. * @since 0.1.0
  11736. * @category Lang
  11737. * @param {*} value The value to check.
  11738. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11739. * else `false`.
  11740. * @example
  11741. *
  11742. * _.isArguments(function() { return arguments; }());
  11743. * // => true
  11744. *
  11745. * _.isArguments([1, 2, 3]);
  11746. * // => false
  11747. */
  11748. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11749. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11750. !propertyIsEnumerable.call(value, 'callee');
  11751. };
  11752. /**
  11753. * Checks if `value` is classified as an `Array` object.
  11754. *
  11755. * @static
  11756. * @memberOf _
  11757. * @since 0.1.0
  11758. * @category Lang
  11759. * @param {*} value The value to check.
  11760. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11761. * @example
  11762. *
  11763. * _.isArray([1, 2, 3]);
  11764. * // => true
  11765. *
  11766. * _.isArray(document.body.children);
  11767. * // => false
  11768. *
  11769. * _.isArray('abc');
  11770. * // => false
  11771. *
  11772. * _.isArray(_.noop);
  11773. * // => false
  11774. */
  11775. var isArray = Array.isArray;
  11776. /**
  11777. * Checks if `value` is classified as an `ArrayBuffer` object.
  11778. *
  11779. * @static
  11780. * @memberOf _
  11781. * @since 4.3.0
  11782. * @category Lang
  11783. * @param {*} value The value to check.
  11784. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11785. * @example
  11786. *
  11787. * _.isArrayBuffer(new ArrayBuffer(2));
  11788. * // => true
  11789. *
  11790. * _.isArrayBuffer(new Array(2));
  11791. * // => false
  11792. */
  11793. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11794. /**
  11795. * Checks if `value` is array-like. A value is considered array-like if it's
  11796. * not a function and has a `value.length` that's an integer greater than or
  11797. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11798. *
  11799. * @static
  11800. * @memberOf _
  11801. * @since 4.0.0
  11802. * @category Lang
  11803. * @param {*} value The value to check.
  11804. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11805. * @example
  11806. *
  11807. * _.isArrayLike([1, 2, 3]);
  11808. * // => true
  11809. *
  11810. * _.isArrayLike(document.body.children);
  11811. * // => true
  11812. *
  11813. * _.isArrayLike('abc');
  11814. * // => true
  11815. *
  11816. * _.isArrayLike(_.noop);
  11817. * // => false
  11818. */
  11819. function isArrayLike(value) {
  11820. return value != null && isLength(value.length) && !isFunction(value);
  11821. }
  11822. /**
  11823. * This method is like `_.isArrayLike` except that it also checks if `value`
  11824. * is an object.
  11825. *
  11826. * @static
  11827. * @memberOf _
  11828. * @since 4.0.0
  11829. * @category Lang
  11830. * @param {*} value The value to check.
  11831. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11832. * else `false`.
  11833. * @example
  11834. *
  11835. * _.isArrayLikeObject([1, 2, 3]);
  11836. * // => true
  11837. *
  11838. * _.isArrayLikeObject(document.body.children);
  11839. * // => true
  11840. *
  11841. * _.isArrayLikeObject('abc');
  11842. * // => false
  11843. *
  11844. * _.isArrayLikeObject(_.noop);
  11845. * // => false
  11846. */
  11847. function isArrayLikeObject(value) {
  11848. return isObjectLike(value) && isArrayLike(value);
  11849. }
  11850. /**
  11851. * Checks if `value` is classified as a boolean primitive or object.
  11852. *
  11853. * @static
  11854. * @memberOf _
  11855. * @since 0.1.0
  11856. * @category Lang
  11857. * @param {*} value The value to check.
  11858. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11859. * @example
  11860. *
  11861. * _.isBoolean(false);
  11862. * // => true
  11863. *
  11864. * _.isBoolean(null);
  11865. * // => false
  11866. */
  11867. function isBoolean(value) {
  11868. return value === true || value === false ||
  11869. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11870. }
  11871. /**
  11872. * Checks if `value` is a buffer.
  11873. *
  11874. * @static
  11875. * @memberOf _
  11876. * @since 4.3.0
  11877. * @category Lang
  11878. * @param {*} value The value to check.
  11879. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11880. * @example
  11881. *
  11882. * _.isBuffer(new Buffer(2));
  11883. * // => true
  11884. *
  11885. * _.isBuffer(new Uint8Array(2));
  11886. * // => false
  11887. */
  11888. var isBuffer = nativeIsBuffer || stubFalse;
  11889. /**
  11890. * Checks if `value` is classified as a `Date` object.
  11891. *
  11892. * @static
  11893. * @memberOf _
  11894. * @since 0.1.0
  11895. * @category Lang
  11896. * @param {*} value The value to check.
  11897. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11898. * @example
  11899. *
  11900. * _.isDate(new Date);
  11901. * // => true
  11902. *
  11903. * _.isDate('Mon April 23 2012');
  11904. * // => false
  11905. */
  11906. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11907. /**
  11908. * Checks if `value` is likely a DOM element.
  11909. *
  11910. * @static
  11911. * @memberOf _
  11912. * @since 0.1.0
  11913. * @category Lang
  11914. * @param {*} value The value to check.
  11915. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11916. * @example
  11917. *
  11918. * _.isElement(document.body);
  11919. * // => true
  11920. *
  11921. * _.isElement('<body>');
  11922. * // => false
  11923. */
  11924. function isElement(value) {
  11925. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11926. }
  11927. /**
  11928. * Checks if `value` is an empty object, collection, map, or set.
  11929. *
  11930. * Objects are considered empty if they have no own enumerable string keyed
  11931. * properties.
  11932. *
  11933. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11934. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11935. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11936. *
  11937. * @static
  11938. * @memberOf _
  11939. * @since 0.1.0
  11940. * @category Lang
  11941. * @param {*} value The value to check.
  11942. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11943. * @example
  11944. *
  11945. * _.isEmpty(null);
  11946. * // => true
  11947. *
  11948. * _.isEmpty(true);
  11949. * // => true
  11950. *
  11951. * _.isEmpty(1);
  11952. * // => true
  11953. *
  11954. * _.isEmpty([1, 2, 3]);
  11955. * // => false
  11956. *
  11957. * _.isEmpty({ 'a': 1 });
  11958. * // => false
  11959. */
  11960. function isEmpty(value) {
  11961. if (value == null) {
  11962. return true;
  11963. }
  11964. if (isArrayLike(value) &&
  11965. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11966. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11967. return !value.length;
  11968. }
  11969. var tag = getTag(value);
  11970. if (tag == mapTag || tag == setTag) {
  11971. return !value.size;
  11972. }
  11973. if (isPrototype(value)) {
  11974. return !baseKeys(value).length;
  11975. }
  11976. for (var key in value) {
  11977. if (hasOwnProperty.call(value, key)) {
  11978. return false;
  11979. }
  11980. }
  11981. return true;
  11982. }
  11983. /**
  11984. * Performs a deep comparison between two values to determine if they are
  11985. * equivalent.
  11986. *
  11987. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11988. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11989. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11990. * by their own, not inherited, enumerable properties. Functions and DOM
  11991. * nodes are compared by strict equality, i.e. `===`.
  11992. *
  11993. * @static
  11994. * @memberOf _
  11995. * @since 0.1.0
  11996. * @category Lang
  11997. * @param {*} value The value to compare.
  11998. * @param {*} other The other value to compare.
  11999. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12000. * @example
  12001. *
  12002. * var object = { 'a': 1 };
  12003. * var other = { 'a': 1 };
  12004. *
  12005. * _.isEqual(object, other);
  12006. * // => true
  12007. *
  12008. * object === other;
  12009. * // => false
  12010. */
  12011. function isEqual(value, other) {
  12012. return baseIsEqual(value, other);
  12013. }
  12014. /**
  12015. * This method is like `_.isEqual` except that it accepts `customizer` which
  12016. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12017. * are handled by the method instead. The `customizer` is invoked with up to
  12018. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12019. *
  12020. * @static
  12021. * @memberOf _
  12022. * @since 4.0.0
  12023. * @category Lang
  12024. * @param {*} value The value to compare.
  12025. * @param {*} other The other value to compare.
  12026. * @param {Function} [customizer] The function to customize comparisons.
  12027. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12028. * @example
  12029. *
  12030. * function isGreeting(value) {
  12031. * return /^h(?:i|ello)$/.test(value);
  12032. * }
  12033. *
  12034. * function customizer(objValue, othValue) {
  12035. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12036. * return true;
  12037. * }
  12038. * }
  12039. *
  12040. * var array = ['hello', 'goodbye'];
  12041. * var other = ['hi', 'goodbye'];
  12042. *
  12043. * _.isEqualWith(array, other, customizer);
  12044. * // => true
  12045. */
  12046. function isEqualWith(value, other, customizer) {
  12047. customizer = typeof customizer == 'function' ? customizer : undefined;
  12048. var result = customizer ? customizer(value, other) : undefined;
  12049. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12050. }
  12051. /**
  12052. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12053. * `SyntaxError`, `TypeError`, or `URIError` object.
  12054. *
  12055. * @static
  12056. * @memberOf _
  12057. * @since 3.0.0
  12058. * @category Lang
  12059. * @param {*} value The value to check.
  12060. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12061. * @example
  12062. *
  12063. * _.isError(new Error);
  12064. * // => true
  12065. *
  12066. * _.isError(Error);
  12067. * // => false
  12068. */
  12069. function isError(value) {
  12070. if (!isObjectLike(value)) {
  12071. return false;
  12072. }
  12073. var tag = baseGetTag(value);
  12074. return tag == errorTag || tag == domExcTag ||
  12075. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12076. }
  12077. /**
  12078. * Checks if `value` is a finite primitive number.
  12079. *
  12080. * **Note:** This method is based on
  12081. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12082. *
  12083. * @static
  12084. * @memberOf _
  12085. * @since 0.1.0
  12086. * @category Lang
  12087. * @param {*} value The value to check.
  12088. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12089. * @example
  12090. *
  12091. * _.isFinite(3);
  12092. * // => true
  12093. *
  12094. * _.isFinite(Number.MIN_VALUE);
  12095. * // => true
  12096. *
  12097. * _.isFinite(Infinity);
  12098. * // => false
  12099. *
  12100. * _.isFinite('3');
  12101. * // => false
  12102. */
  12103. function isFinite(value) {
  12104. return typeof value == 'number' && nativeIsFinite(value);
  12105. }
  12106. /**
  12107. * Checks if `value` is classified as a `Function` object.
  12108. *
  12109. * @static
  12110. * @memberOf _
  12111. * @since 0.1.0
  12112. * @category Lang
  12113. * @param {*} value The value to check.
  12114. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12115. * @example
  12116. *
  12117. * _.isFunction(_);
  12118. * // => true
  12119. *
  12120. * _.isFunction(/abc/);
  12121. * // => false
  12122. */
  12123. function isFunction(value) {
  12124. if (!isObject(value)) {
  12125. return false;
  12126. }
  12127. // The use of `Object#toString` avoids issues with the `typeof` operator
  12128. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12129. var tag = baseGetTag(value);
  12130. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12131. }
  12132. /**
  12133. * Checks if `value` is an integer.
  12134. *
  12135. * **Note:** This method is based on
  12136. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12137. *
  12138. * @static
  12139. * @memberOf _
  12140. * @since 4.0.0
  12141. * @category Lang
  12142. * @param {*} value The value to check.
  12143. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12144. * @example
  12145. *
  12146. * _.isInteger(3);
  12147. * // => true
  12148. *
  12149. * _.isInteger(Number.MIN_VALUE);
  12150. * // => false
  12151. *
  12152. * _.isInteger(Infinity);
  12153. * // => false
  12154. *
  12155. * _.isInteger('3');
  12156. * // => false
  12157. */
  12158. function isInteger(value) {
  12159. return typeof value == 'number' && value == toInteger(value);
  12160. }
  12161. /**
  12162. * Checks if `value` is a valid array-like length.
  12163. *
  12164. * **Note:** This method is loosely based on
  12165. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12166. *
  12167. * @static
  12168. * @memberOf _
  12169. * @since 4.0.0
  12170. * @category Lang
  12171. * @param {*} value The value to check.
  12172. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12173. * @example
  12174. *
  12175. * _.isLength(3);
  12176. * // => true
  12177. *
  12178. * _.isLength(Number.MIN_VALUE);
  12179. * // => false
  12180. *
  12181. * _.isLength(Infinity);
  12182. * // => false
  12183. *
  12184. * _.isLength('3');
  12185. * // => false
  12186. */
  12187. function isLength(value) {
  12188. return typeof value == 'number' &&
  12189. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12190. }
  12191. /**
  12192. * Checks if `value` is the
  12193. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12194. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12195. *
  12196. * @static
  12197. * @memberOf _
  12198. * @since 0.1.0
  12199. * @category Lang
  12200. * @param {*} value The value to check.
  12201. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12202. * @example
  12203. *
  12204. * _.isObject({});
  12205. * // => true
  12206. *
  12207. * _.isObject([1, 2, 3]);
  12208. * // => true
  12209. *
  12210. * _.isObject(_.noop);
  12211. * // => true
  12212. *
  12213. * _.isObject(null);
  12214. * // => false
  12215. */
  12216. function isObject(value) {
  12217. var type = typeof value;
  12218. return value != null && (type == 'object' || type == 'function');
  12219. }
  12220. /**
  12221. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12222. * and has a `typeof` result of "object".
  12223. *
  12224. * @static
  12225. * @memberOf _
  12226. * @since 4.0.0
  12227. * @category Lang
  12228. * @param {*} value The value to check.
  12229. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12230. * @example
  12231. *
  12232. * _.isObjectLike({});
  12233. * // => true
  12234. *
  12235. * _.isObjectLike([1, 2, 3]);
  12236. * // => true
  12237. *
  12238. * _.isObjectLike(_.noop);
  12239. * // => false
  12240. *
  12241. * _.isObjectLike(null);
  12242. * // => false
  12243. */
  12244. function isObjectLike(value) {
  12245. return value != null && typeof value == 'object';
  12246. }
  12247. /**
  12248. * Checks if `value` is classified as a `Map` object.
  12249. *
  12250. * @static
  12251. * @memberOf _
  12252. * @since 4.3.0
  12253. * @category Lang
  12254. * @param {*} value The value to check.
  12255. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12256. * @example
  12257. *
  12258. * _.isMap(new Map);
  12259. * // => true
  12260. *
  12261. * _.isMap(new WeakMap);
  12262. * // => false
  12263. */
  12264. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12265. /**
  12266. * Performs a partial deep comparison between `object` and `source` to
  12267. * determine if `object` contains equivalent property values.
  12268. *
  12269. * **Note:** This method is equivalent to `_.matches` when `source` is
  12270. * partially applied.
  12271. *
  12272. * Partial comparisons will match empty array and empty object `source`
  12273. * values against any array or object value, respectively. See `_.isEqual`
  12274. * for a list of supported value comparisons.
  12275. *
  12276. * @static
  12277. * @memberOf _
  12278. * @since 3.0.0
  12279. * @category Lang
  12280. * @param {Object} object The object to inspect.
  12281. * @param {Object} source The object of property values to match.
  12282. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12283. * @example
  12284. *
  12285. * var object = { 'a': 1, 'b': 2 };
  12286. *
  12287. * _.isMatch(object, { 'b': 2 });
  12288. * // => true
  12289. *
  12290. * _.isMatch(object, { 'b': 1 });
  12291. * // => false
  12292. */
  12293. function isMatch(object, source) {
  12294. return object === source || baseIsMatch(object, source, getMatchData(source));
  12295. }
  12296. /**
  12297. * This method is like `_.isMatch` except that it accepts `customizer` which
  12298. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12299. * are handled by the method instead. The `customizer` is invoked with five
  12300. * arguments: (objValue, srcValue, index|key, object, source).
  12301. *
  12302. * @static
  12303. * @memberOf _
  12304. * @since 4.0.0
  12305. * @category Lang
  12306. * @param {Object} object The object to inspect.
  12307. * @param {Object} source The object of property values to match.
  12308. * @param {Function} [customizer] The function to customize comparisons.
  12309. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12310. * @example
  12311. *
  12312. * function isGreeting(value) {
  12313. * return /^h(?:i|ello)$/.test(value);
  12314. * }
  12315. *
  12316. * function customizer(objValue, srcValue) {
  12317. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12318. * return true;
  12319. * }
  12320. * }
  12321. *
  12322. * var object = { 'greeting': 'hello' };
  12323. * var source = { 'greeting': 'hi' };
  12324. *
  12325. * _.isMatchWith(object, source, customizer);
  12326. * // => true
  12327. */
  12328. function isMatchWith(object, source, customizer) {
  12329. customizer = typeof customizer == 'function' ? customizer : undefined;
  12330. return baseIsMatch(object, source, getMatchData(source), customizer);
  12331. }
  12332. /**
  12333. * Checks if `value` is `NaN`.
  12334. *
  12335. * **Note:** This method is based on
  12336. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12337. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12338. * `undefined` and other non-number values.
  12339. *
  12340. * @static
  12341. * @memberOf _
  12342. * @since 0.1.0
  12343. * @category Lang
  12344. * @param {*} value The value to check.
  12345. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12346. * @example
  12347. *
  12348. * _.isNaN(NaN);
  12349. * // => true
  12350. *
  12351. * _.isNaN(new Number(NaN));
  12352. * // => true
  12353. *
  12354. * isNaN(undefined);
  12355. * // => true
  12356. *
  12357. * _.isNaN(undefined);
  12358. * // => false
  12359. */
  12360. function isNaN(value) {
  12361. // An `NaN` primitive is the only value that is not equal to itself.
  12362. // Perform the `toStringTag` check first to avoid errors with some
  12363. // ActiveX objects in IE.
  12364. return isNumber(value) && value != +value;
  12365. }
  12366. /**
  12367. * Checks if `value` is a pristine native function.
  12368. *
  12369. * **Note:** This method can't reliably detect native functions in the presence
  12370. * of the core-js package because core-js circumvents this kind of detection.
  12371. * Despite multiple requests, the core-js maintainer has made it clear: any
  12372. * attempt to fix the detection will be obstructed. As a result, we're left
  12373. * with little choice but to throw an error. Unfortunately, this also affects
  12374. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12375. * which rely on core-js.
  12376. *
  12377. * @static
  12378. * @memberOf _
  12379. * @since 3.0.0
  12380. * @category Lang
  12381. * @param {*} value The value to check.
  12382. * @returns {boolean} Returns `true` if `value` is a native function,
  12383. * else `false`.
  12384. * @example
  12385. *
  12386. * _.isNative(Array.prototype.push);
  12387. * // => true
  12388. *
  12389. * _.isNative(_);
  12390. * // => false
  12391. */
  12392. function isNative(value) {
  12393. if (isMaskable(value)) {
  12394. throw new Error(CORE_ERROR_TEXT);
  12395. }
  12396. return baseIsNative(value);
  12397. }
  12398. /**
  12399. * Checks if `value` is `null`.
  12400. *
  12401. * @static
  12402. * @memberOf _
  12403. * @since 0.1.0
  12404. * @category Lang
  12405. * @param {*} value The value to check.
  12406. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12407. * @example
  12408. *
  12409. * _.isNull(null);
  12410. * // => true
  12411. *
  12412. * _.isNull(void 0);
  12413. * // => false
  12414. */
  12415. function isNull(value) {
  12416. return value === null;
  12417. }
  12418. /**
  12419. * Checks if `value` is `null` or `undefined`.
  12420. *
  12421. * @static
  12422. * @memberOf _
  12423. * @since 4.0.0
  12424. * @category Lang
  12425. * @param {*} value The value to check.
  12426. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12427. * @example
  12428. *
  12429. * _.isNil(null);
  12430. * // => true
  12431. *
  12432. * _.isNil(void 0);
  12433. * // => true
  12434. *
  12435. * _.isNil(NaN);
  12436. * // => false
  12437. */
  12438. function isNil(value) {
  12439. return value == null;
  12440. }
  12441. /**
  12442. * Checks if `value` is classified as a `Number` primitive or object.
  12443. *
  12444. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12445. * classified as numbers, use the `_.isFinite` method.
  12446. *
  12447. * @static
  12448. * @memberOf _
  12449. * @since 0.1.0
  12450. * @category Lang
  12451. * @param {*} value The value to check.
  12452. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12453. * @example
  12454. *
  12455. * _.isNumber(3);
  12456. * // => true
  12457. *
  12458. * _.isNumber(Number.MIN_VALUE);
  12459. * // => true
  12460. *
  12461. * _.isNumber(Infinity);
  12462. * // => true
  12463. *
  12464. * _.isNumber('3');
  12465. * // => false
  12466. */
  12467. function isNumber(value) {
  12468. return typeof value == 'number' ||
  12469. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12470. }
  12471. /**
  12472. * Checks if `value` is a plain object, that is, an object created by the
  12473. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12474. *
  12475. * @static
  12476. * @memberOf _
  12477. * @since 0.8.0
  12478. * @category Lang
  12479. * @param {*} value The value to check.
  12480. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12481. * @example
  12482. *
  12483. * function Foo() {
  12484. * this.a = 1;
  12485. * }
  12486. *
  12487. * _.isPlainObject(new Foo);
  12488. * // => false
  12489. *
  12490. * _.isPlainObject([1, 2, 3]);
  12491. * // => false
  12492. *
  12493. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12494. * // => true
  12495. *
  12496. * _.isPlainObject(Object.create(null));
  12497. * // => true
  12498. */
  12499. function isPlainObject(value) {
  12500. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12501. return false;
  12502. }
  12503. var proto = getPrototype(value);
  12504. if (proto === null) {
  12505. return true;
  12506. }
  12507. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12508. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12509. funcToString.call(Ctor) == objectCtorString;
  12510. }
  12511. /**
  12512. * Checks if `value` is classified as a `RegExp` object.
  12513. *
  12514. * @static
  12515. * @memberOf _
  12516. * @since 0.1.0
  12517. * @category Lang
  12518. * @param {*} value The value to check.
  12519. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12520. * @example
  12521. *
  12522. * _.isRegExp(/abc/);
  12523. * // => true
  12524. *
  12525. * _.isRegExp('/abc/');
  12526. * // => false
  12527. */
  12528. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12529. /**
  12530. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12531. * double precision number which isn't the result of a rounded unsafe integer.
  12532. *
  12533. * **Note:** This method is based on
  12534. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12535. *
  12536. * @static
  12537. * @memberOf _
  12538. * @since 4.0.0
  12539. * @category Lang
  12540. * @param {*} value The value to check.
  12541. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12542. * @example
  12543. *
  12544. * _.isSafeInteger(3);
  12545. * // => true
  12546. *
  12547. * _.isSafeInteger(Number.MIN_VALUE);
  12548. * // => false
  12549. *
  12550. * _.isSafeInteger(Infinity);
  12551. * // => false
  12552. *
  12553. * _.isSafeInteger('3');
  12554. * // => false
  12555. */
  12556. function isSafeInteger(value) {
  12557. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12558. }
  12559. /**
  12560. * Checks if `value` is classified as a `Set` object.
  12561. *
  12562. * @static
  12563. * @memberOf _
  12564. * @since 4.3.0
  12565. * @category Lang
  12566. * @param {*} value The value to check.
  12567. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12568. * @example
  12569. *
  12570. * _.isSet(new Set);
  12571. * // => true
  12572. *
  12573. * _.isSet(new WeakSet);
  12574. * // => false
  12575. */
  12576. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12577. /**
  12578. * Checks if `value` is classified as a `String` primitive or object.
  12579. *
  12580. * @static
  12581. * @since 0.1.0
  12582. * @memberOf _
  12583. * @category Lang
  12584. * @param {*} value The value to check.
  12585. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12586. * @example
  12587. *
  12588. * _.isString('abc');
  12589. * // => true
  12590. *
  12591. * _.isString(1);
  12592. * // => false
  12593. */
  12594. function isString(value) {
  12595. return typeof value == 'string' ||
  12596. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12597. }
  12598. /**
  12599. * Checks if `value` is classified as a `Symbol` primitive or object.
  12600. *
  12601. * @static
  12602. * @memberOf _
  12603. * @since 4.0.0
  12604. * @category Lang
  12605. * @param {*} value The value to check.
  12606. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12607. * @example
  12608. *
  12609. * _.isSymbol(Symbol.iterator);
  12610. * // => true
  12611. *
  12612. * _.isSymbol('abc');
  12613. * // => false
  12614. */
  12615. function isSymbol(value) {
  12616. return typeof value == 'symbol' ||
  12617. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12618. }
  12619. /**
  12620. * Checks if `value` is classified as a typed array.
  12621. *
  12622. * @static
  12623. * @memberOf _
  12624. * @since 3.0.0
  12625. * @category Lang
  12626. * @param {*} value The value to check.
  12627. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12628. * @example
  12629. *
  12630. * _.isTypedArray(new Uint8Array);
  12631. * // => true
  12632. *
  12633. * _.isTypedArray([]);
  12634. * // => false
  12635. */
  12636. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12637. /**
  12638. * Checks if `value` is `undefined`.
  12639. *
  12640. * @static
  12641. * @since 0.1.0
  12642. * @memberOf _
  12643. * @category Lang
  12644. * @param {*} value The value to check.
  12645. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12646. * @example
  12647. *
  12648. * _.isUndefined(void 0);
  12649. * // => true
  12650. *
  12651. * _.isUndefined(null);
  12652. * // => false
  12653. */
  12654. function isUndefined(value) {
  12655. return value === undefined;
  12656. }
  12657. /**
  12658. * Checks if `value` is classified as a `WeakMap` object.
  12659. *
  12660. * @static
  12661. * @memberOf _
  12662. * @since 4.3.0
  12663. * @category Lang
  12664. * @param {*} value The value to check.
  12665. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12666. * @example
  12667. *
  12668. * _.isWeakMap(new WeakMap);
  12669. * // => true
  12670. *
  12671. * _.isWeakMap(new Map);
  12672. * // => false
  12673. */
  12674. function isWeakMap(value) {
  12675. return isObjectLike(value) && getTag(value) == weakMapTag;
  12676. }
  12677. /**
  12678. * Checks if `value` is classified as a `WeakSet` object.
  12679. *
  12680. * @static
  12681. * @memberOf _
  12682. * @since 4.3.0
  12683. * @category Lang
  12684. * @param {*} value The value to check.
  12685. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12686. * @example
  12687. *
  12688. * _.isWeakSet(new WeakSet);
  12689. * // => true
  12690. *
  12691. * _.isWeakSet(new Set);
  12692. * // => false
  12693. */
  12694. function isWeakSet(value) {
  12695. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12696. }
  12697. /**
  12698. * Checks if `value` is less than `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 `other`,
  12707. * else `false`.
  12708. * @see _.gt
  12709. * @example
  12710. *
  12711. * _.lt(1, 3);
  12712. * // => true
  12713. *
  12714. * _.lt(3, 3);
  12715. * // => false
  12716. *
  12717. * _.lt(3, 1);
  12718. * // => false
  12719. */
  12720. var lt = createRelationalOperation(baseLt);
  12721. /**
  12722. * Checks if `value` is less than or equal to `other`.
  12723. *
  12724. * @static
  12725. * @memberOf _
  12726. * @since 3.9.0
  12727. * @category Lang
  12728. * @param {*} value The value to compare.
  12729. * @param {*} other The other value to compare.
  12730. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12731. * `other`, else `false`.
  12732. * @see _.gte
  12733. * @example
  12734. *
  12735. * _.lte(1, 3);
  12736. * // => true
  12737. *
  12738. * _.lte(3, 3);
  12739. * // => true
  12740. *
  12741. * _.lte(3, 1);
  12742. * // => false
  12743. */
  12744. var lte = createRelationalOperation(function(value, other) {
  12745. return value <= other;
  12746. });
  12747. /**
  12748. * Converts `value` to an array.
  12749. *
  12750. * @static
  12751. * @since 0.1.0
  12752. * @memberOf _
  12753. * @category Lang
  12754. * @param {*} value The value to convert.
  12755. * @returns {Array} Returns the converted array.
  12756. * @example
  12757. *
  12758. * _.toArray({ 'a': 1, 'b': 2 });
  12759. * // => [1, 2]
  12760. *
  12761. * _.toArray('abc');
  12762. * // => ['a', 'b', 'c']
  12763. *
  12764. * _.toArray(1);
  12765. * // => []
  12766. *
  12767. * _.toArray(null);
  12768. * // => []
  12769. */
  12770. function toArray(value) {
  12771. if (!value) {
  12772. return [];
  12773. }
  12774. if (isArrayLike(value)) {
  12775. return isString(value) ? stringToArray(value) : copyArray(value);
  12776. }
  12777. if (symIterator && value[symIterator]) {
  12778. return iteratorToArray(value[symIterator]());
  12779. }
  12780. var tag = getTag(value),
  12781. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12782. return func(value);
  12783. }
  12784. /**
  12785. * Converts `value` to a finite number.
  12786. *
  12787. * @static
  12788. * @memberOf _
  12789. * @since 4.12.0
  12790. * @category Lang
  12791. * @param {*} value The value to convert.
  12792. * @returns {number} Returns the converted number.
  12793. * @example
  12794. *
  12795. * _.toFinite(3.2);
  12796. * // => 3.2
  12797. *
  12798. * _.toFinite(Number.MIN_VALUE);
  12799. * // => 5e-324
  12800. *
  12801. * _.toFinite(Infinity);
  12802. * // => 1.7976931348623157e+308
  12803. *
  12804. * _.toFinite('3.2');
  12805. * // => 3.2
  12806. */
  12807. function toFinite(value) {
  12808. if (!value) {
  12809. return value === 0 ? value : 0;
  12810. }
  12811. value = toNumber(value);
  12812. if (value === INFINITY || value === -INFINITY) {
  12813. var sign = (value < 0 ? -1 : 1);
  12814. return sign * MAX_INTEGER;
  12815. }
  12816. return value === value ? value : 0;
  12817. }
  12818. /**
  12819. * Converts `value` to an integer.
  12820. *
  12821. * **Note:** This method is loosely based on
  12822. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12823. *
  12824. * @static
  12825. * @memberOf _
  12826. * @since 4.0.0
  12827. * @category Lang
  12828. * @param {*} value The value to convert.
  12829. * @returns {number} Returns the converted integer.
  12830. * @example
  12831. *
  12832. * _.toInteger(3.2);
  12833. * // => 3
  12834. *
  12835. * _.toInteger(Number.MIN_VALUE);
  12836. * // => 0
  12837. *
  12838. * _.toInteger(Infinity);
  12839. * // => 1.7976931348623157e+308
  12840. *
  12841. * _.toInteger('3.2');
  12842. * // => 3
  12843. */
  12844. function toInteger(value) {
  12845. var result = toFinite(value),
  12846. remainder = result % 1;
  12847. return result === result ? (remainder ? result - remainder : result) : 0;
  12848. }
  12849. /**
  12850. * Converts `value` to an integer suitable for use as the length of an
  12851. * array-like object.
  12852. *
  12853. * **Note:** This method is based on
  12854. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12855. *
  12856. * @static
  12857. * @memberOf _
  12858. * @since 4.0.0
  12859. * @category Lang
  12860. * @param {*} value The value to convert.
  12861. * @returns {number} Returns the converted integer.
  12862. * @example
  12863. *
  12864. * _.toLength(3.2);
  12865. * // => 3
  12866. *
  12867. * _.toLength(Number.MIN_VALUE);
  12868. * // => 0
  12869. *
  12870. * _.toLength(Infinity);
  12871. * // => 4294967295
  12872. *
  12873. * _.toLength('3.2');
  12874. * // => 3
  12875. */
  12876. function toLength(value) {
  12877. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12878. }
  12879. /**
  12880. * Converts `value` to a number.
  12881. *
  12882. * @static
  12883. * @memberOf _
  12884. * @since 4.0.0
  12885. * @category Lang
  12886. * @param {*} value The value to process.
  12887. * @returns {number} Returns the number.
  12888. * @example
  12889. *
  12890. * _.toNumber(3.2);
  12891. * // => 3.2
  12892. *
  12893. * _.toNumber(Number.MIN_VALUE);
  12894. * // => 5e-324
  12895. *
  12896. * _.toNumber(Infinity);
  12897. * // => Infinity
  12898. *
  12899. * _.toNumber('3.2');
  12900. * // => 3.2
  12901. */
  12902. function toNumber(value) {
  12903. if (typeof value == 'number') {
  12904. return value;
  12905. }
  12906. if (isSymbol(value)) {
  12907. return NAN;
  12908. }
  12909. if (isObject(value)) {
  12910. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12911. value = isObject(other) ? (other + '') : other;
  12912. }
  12913. if (typeof value != 'string') {
  12914. return value === 0 ? value : +value;
  12915. }
  12916. value = baseTrim(value);
  12917. var isBinary = reIsBinary.test(value);
  12918. return (isBinary || reIsOctal.test(value))
  12919. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12920. : (reIsBadHex.test(value) ? NAN : +value);
  12921. }
  12922. /**
  12923. * Converts `value` to a plain object flattening inherited enumerable string
  12924. * keyed properties of `value` to own properties of the plain object.
  12925. *
  12926. * @static
  12927. * @memberOf _
  12928. * @since 3.0.0
  12929. * @category Lang
  12930. * @param {*} value The value to convert.
  12931. * @returns {Object} Returns the converted plain object.
  12932. * @example
  12933. *
  12934. * function Foo() {
  12935. * this.b = 2;
  12936. * }
  12937. *
  12938. * Foo.prototype.c = 3;
  12939. *
  12940. * _.assign({ 'a': 1 }, new Foo);
  12941. * // => { 'a': 1, 'b': 2 }
  12942. *
  12943. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12944. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12945. */
  12946. function toPlainObject(value) {
  12947. return copyObject(value, keysIn(value));
  12948. }
  12949. /**
  12950. * Converts `value` to a safe integer. A safe integer can be compared and
  12951. * represented correctly.
  12952. *
  12953. * @static
  12954. * @memberOf _
  12955. * @since 4.0.0
  12956. * @category Lang
  12957. * @param {*} value The value to convert.
  12958. * @returns {number} Returns the converted integer.
  12959. * @example
  12960. *
  12961. * _.toSafeInteger(3.2);
  12962. * // => 3
  12963. *
  12964. * _.toSafeInteger(Number.MIN_VALUE);
  12965. * // => 0
  12966. *
  12967. * _.toSafeInteger(Infinity);
  12968. * // => 9007199254740991
  12969. *
  12970. * _.toSafeInteger('3.2');
  12971. * // => 3
  12972. */
  12973. function toSafeInteger(value) {
  12974. return value
  12975. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12976. : (value === 0 ? value : 0);
  12977. }
  12978. /**
  12979. * Converts `value` to a string. An empty string is returned for `null`
  12980. * and `undefined` values. The sign of `-0` is preserved.
  12981. *
  12982. * @static
  12983. * @memberOf _
  12984. * @since 4.0.0
  12985. * @category Lang
  12986. * @param {*} value The value to convert.
  12987. * @returns {string} Returns the converted string.
  12988. * @example
  12989. *
  12990. * _.toString(null);
  12991. * // => ''
  12992. *
  12993. * _.toString(-0);
  12994. * // => '-0'
  12995. *
  12996. * _.toString([1, 2, 3]);
  12997. * // => '1,2,3'
  12998. */
  12999. function toString(value) {
  13000. return value == null ? '' : baseToString(value);
  13001. }
  13002. /*------------------------------------------------------------------------*/
  13003. /**
  13004. * Assigns own enumerable string keyed properties of source objects to the
  13005. * destination object. Source objects are applied from left to right.
  13006. * Subsequent sources overwrite property assignments of previous sources.
  13007. *
  13008. * **Note:** This method mutates `object` and is loosely based on
  13009. * [`Object.assign`](https://mdn.io/Object/assign).
  13010. *
  13011. * @static
  13012. * @memberOf _
  13013. * @since 0.10.0
  13014. * @category Object
  13015. * @param {Object} object The destination object.
  13016. * @param {...Object} [sources] The source objects.
  13017. * @returns {Object} Returns `object`.
  13018. * @see _.assignIn
  13019. * @example
  13020. *
  13021. * function Foo() {
  13022. * this.a = 1;
  13023. * }
  13024. *
  13025. * function Bar() {
  13026. * this.c = 3;
  13027. * }
  13028. *
  13029. * Foo.prototype.b = 2;
  13030. * Bar.prototype.d = 4;
  13031. *
  13032. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13033. * // => { 'a': 1, 'c': 3 }
  13034. */
  13035. var assign = createAssigner(function(object, source) {
  13036. if (isPrototype(source) || isArrayLike(source)) {
  13037. copyObject(source, keys(source), object);
  13038. return;
  13039. }
  13040. for (var key in source) {
  13041. if (hasOwnProperty.call(source, key)) {
  13042. assignValue(object, key, source[key]);
  13043. }
  13044. }
  13045. });
  13046. /**
  13047. * This method is like `_.assign` except that it iterates over own and
  13048. * inherited source properties.
  13049. *
  13050. * **Note:** This method mutates `object`.
  13051. *
  13052. * @static
  13053. * @memberOf _
  13054. * @since 4.0.0
  13055. * @alias extend
  13056. * @category Object
  13057. * @param {Object} object The destination object.
  13058. * @param {...Object} [sources] The source objects.
  13059. * @returns {Object} Returns `object`.
  13060. * @see _.assign
  13061. * @example
  13062. *
  13063. * function Foo() {
  13064. * this.a = 1;
  13065. * }
  13066. *
  13067. * function Bar() {
  13068. * this.c = 3;
  13069. * }
  13070. *
  13071. * Foo.prototype.b = 2;
  13072. * Bar.prototype.d = 4;
  13073. *
  13074. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13075. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13076. */
  13077. var assignIn = createAssigner(function(object, source) {
  13078. copyObject(source, keysIn(source), object);
  13079. });
  13080. /**
  13081. * This method is like `_.assignIn` except that it accepts `customizer`
  13082. * which is invoked to produce the assigned values. If `customizer` returns
  13083. * `undefined`, assignment is handled by the method instead. The `customizer`
  13084. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13085. *
  13086. * **Note:** This method mutates `object`.
  13087. *
  13088. * @static
  13089. * @memberOf _
  13090. * @since 4.0.0
  13091. * @alias extendWith
  13092. * @category Object
  13093. * @param {Object} object The destination object.
  13094. * @param {...Object} sources The source objects.
  13095. * @param {Function} [customizer] The function to customize assigned values.
  13096. * @returns {Object} Returns `object`.
  13097. * @see _.assignWith
  13098. * @example
  13099. *
  13100. * function customizer(objValue, srcValue) {
  13101. * return _.isUndefined(objValue) ? srcValue : objValue;
  13102. * }
  13103. *
  13104. * var defaults = _.partialRight(_.assignInWith, customizer);
  13105. *
  13106. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13107. * // => { 'a': 1, 'b': 2 }
  13108. */
  13109. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13110. copyObject(source, keysIn(source), object, customizer);
  13111. });
  13112. /**
  13113. * This method is like `_.assign` except that it accepts `customizer`
  13114. * which is invoked to produce the assigned values. If `customizer` returns
  13115. * `undefined`, assignment is handled by the method instead. The `customizer`
  13116. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13117. *
  13118. * **Note:** This method mutates `object`.
  13119. *
  13120. * @static
  13121. * @memberOf _
  13122. * @since 4.0.0
  13123. * @category Object
  13124. * @param {Object} object The destination object.
  13125. * @param {...Object} sources The source objects.
  13126. * @param {Function} [customizer] The function to customize assigned values.
  13127. * @returns {Object} Returns `object`.
  13128. * @see _.assignInWith
  13129. * @example
  13130. *
  13131. * function customizer(objValue, srcValue) {
  13132. * return _.isUndefined(objValue) ? srcValue : objValue;
  13133. * }
  13134. *
  13135. * var defaults = _.partialRight(_.assignWith, customizer);
  13136. *
  13137. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13138. * // => { 'a': 1, 'b': 2 }
  13139. */
  13140. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13141. copyObject(source, keys(source), object, customizer);
  13142. });
  13143. /**
  13144. * Creates an array of values corresponding to `paths` of `object`.
  13145. *
  13146. * @static
  13147. * @memberOf _
  13148. * @since 1.0.0
  13149. * @category Object
  13150. * @param {Object} object The object to iterate over.
  13151. * @param {...(string|string[])} [paths] The property paths to pick.
  13152. * @returns {Array} Returns the picked values.
  13153. * @example
  13154. *
  13155. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13156. *
  13157. * _.at(object, ['a[0].b.c', 'a[1]']);
  13158. * // => [3, 4]
  13159. */
  13160. var at = flatRest(baseAt);
  13161. /**
  13162. * Creates an object that inherits from the `prototype` object. If a
  13163. * `properties` object is given, its own enumerable string keyed properties
  13164. * are assigned to the created object.
  13165. *
  13166. * @static
  13167. * @memberOf _
  13168. * @since 2.3.0
  13169. * @category Object
  13170. * @param {Object} prototype The object to inherit from.
  13171. * @param {Object} [properties] The properties to assign to the object.
  13172. * @returns {Object} Returns the new object.
  13173. * @example
  13174. *
  13175. * function Shape() {
  13176. * this.x = 0;
  13177. * this.y = 0;
  13178. * }
  13179. *
  13180. * function Circle() {
  13181. * Shape.call(this);
  13182. * }
  13183. *
  13184. * Circle.prototype = _.create(Shape.prototype, {
  13185. * 'constructor': Circle
  13186. * });
  13187. *
  13188. * var circle = new Circle;
  13189. * circle instanceof Circle;
  13190. * // => true
  13191. *
  13192. * circle instanceof Shape;
  13193. * // => true
  13194. */
  13195. function create(prototype, properties) {
  13196. var result = baseCreate(prototype);
  13197. return properties == null ? result : baseAssign(result, properties);
  13198. }
  13199. /**
  13200. * Assigns own and inherited enumerable string keyed properties of source
  13201. * objects to the destination object for all destination properties that
  13202. * resolve to `undefined`. Source objects are applied from left to right.
  13203. * Once a property is set, additional values of the same property are ignored.
  13204. *
  13205. * **Note:** This method mutates `object`.
  13206. *
  13207. * @static
  13208. * @since 0.1.0
  13209. * @memberOf _
  13210. * @category Object
  13211. * @param {Object} object The destination object.
  13212. * @param {...Object} [sources] The source objects.
  13213. * @returns {Object} Returns `object`.
  13214. * @see _.defaultsDeep
  13215. * @example
  13216. *
  13217. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13218. * // => { 'a': 1, 'b': 2 }
  13219. */
  13220. var defaults = baseRest(function(object, sources) {
  13221. object = Object(object);
  13222. var index = -1;
  13223. var length = sources.length;
  13224. var guard = length > 2 ? sources[2] : undefined;
  13225. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13226. length = 1;
  13227. }
  13228. while (++index < length) {
  13229. var source = sources[index];
  13230. var props = keysIn(source);
  13231. var propsIndex = -1;
  13232. var propsLength = props.length;
  13233. while (++propsIndex < propsLength) {
  13234. var key = props[propsIndex];
  13235. var value = object[key];
  13236. if (value === undefined ||
  13237. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13238. object[key] = source[key];
  13239. }
  13240. }
  13241. }
  13242. return object;
  13243. });
  13244. /**
  13245. * This method is like `_.defaults` except that it recursively assigns
  13246. * default properties.
  13247. *
  13248. * **Note:** This method mutates `object`.
  13249. *
  13250. * @static
  13251. * @memberOf _
  13252. * @since 3.10.0
  13253. * @category Object
  13254. * @param {Object} object The destination object.
  13255. * @param {...Object} [sources] The source objects.
  13256. * @returns {Object} Returns `object`.
  13257. * @see _.defaults
  13258. * @example
  13259. *
  13260. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13261. * // => { 'a': { 'b': 2, 'c': 3 } }
  13262. */
  13263. var defaultsDeep = baseRest(function(args) {
  13264. args.push(undefined, customDefaultsMerge);
  13265. return apply(mergeWith, undefined, args);
  13266. });
  13267. /**
  13268. * This method is like `_.find` except that it returns the key of the first
  13269. * element `predicate` returns truthy for instead of the element itself.
  13270. *
  13271. * @static
  13272. * @memberOf _
  13273. * @since 1.1.0
  13274. * @category Object
  13275. * @param {Object} object The object to inspect.
  13276. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13277. * @returns {string|undefined} Returns the key of the matched element,
  13278. * else `undefined`.
  13279. * @example
  13280. *
  13281. * var users = {
  13282. * 'barney': { 'age': 36, 'active': true },
  13283. * 'fred': { 'age': 40, 'active': false },
  13284. * 'pebbles': { 'age': 1, 'active': true }
  13285. * };
  13286. *
  13287. * _.findKey(users, function(o) { return o.age < 40; });
  13288. * // => 'barney' (iteration order is not guaranteed)
  13289. *
  13290. * // The `_.matches` iteratee shorthand.
  13291. * _.findKey(users, { 'age': 1, 'active': true });
  13292. * // => 'pebbles'
  13293. *
  13294. * // The `_.matchesProperty` iteratee shorthand.
  13295. * _.findKey(users, ['active', false]);
  13296. * // => 'fred'
  13297. *
  13298. * // The `_.property` iteratee shorthand.
  13299. * _.findKey(users, 'active');
  13300. * // => 'barney'
  13301. */
  13302. function findKey(object, predicate) {
  13303. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13304. }
  13305. /**
  13306. * This method is like `_.findKey` except that it iterates over elements of
  13307. * a collection in the opposite order.
  13308. *
  13309. * @static
  13310. * @memberOf _
  13311. * @since 2.0.0
  13312. * @category Object
  13313. * @param {Object} object The object to inspect.
  13314. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13315. * @returns {string|undefined} Returns the key of the matched element,
  13316. * else `undefined`.
  13317. * @example
  13318. *
  13319. * var users = {
  13320. * 'barney': { 'age': 36, 'active': true },
  13321. * 'fred': { 'age': 40, 'active': false },
  13322. * 'pebbles': { 'age': 1, 'active': true }
  13323. * };
  13324. *
  13325. * _.findLastKey(users, function(o) { return o.age < 40; });
  13326. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13327. *
  13328. * // The `_.matches` iteratee shorthand.
  13329. * _.findLastKey(users, { 'age': 36, 'active': true });
  13330. * // => 'barney'
  13331. *
  13332. * // The `_.matchesProperty` iteratee shorthand.
  13333. * _.findLastKey(users, ['active', false]);
  13334. * // => 'fred'
  13335. *
  13336. * // The `_.property` iteratee shorthand.
  13337. * _.findLastKey(users, 'active');
  13338. * // => 'pebbles'
  13339. */
  13340. function findLastKey(object, predicate) {
  13341. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13342. }
  13343. /**
  13344. * Iterates over own and inherited enumerable string keyed properties of an
  13345. * object and invokes `iteratee` for each property. The iteratee is invoked
  13346. * with three arguments: (value, key, object). Iteratee functions may exit
  13347. * iteration early by explicitly returning `false`.
  13348. *
  13349. * @static
  13350. * @memberOf _
  13351. * @since 0.3.0
  13352. * @category Object
  13353. * @param {Object} object The object to iterate over.
  13354. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13355. * @returns {Object} Returns `object`.
  13356. * @see _.forInRight
  13357. * @example
  13358. *
  13359. * function Foo() {
  13360. * this.a = 1;
  13361. * this.b = 2;
  13362. * }
  13363. *
  13364. * Foo.prototype.c = 3;
  13365. *
  13366. * _.forIn(new Foo, function(value, key) {
  13367. * console.log(key);
  13368. * });
  13369. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13370. */
  13371. function forIn(object, iteratee) {
  13372. return object == null
  13373. ? object
  13374. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13375. }
  13376. /**
  13377. * This method is like `_.forIn` except that it iterates over properties of
  13378. * `object` in the opposite order.
  13379. *
  13380. * @static
  13381. * @memberOf _
  13382. * @since 2.0.0
  13383. * @category Object
  13384. * @param {Object} object The object to iterate over.
  13385. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13386. * @returns {Object} Returns `object`.
  13387. * @see _.forIn
  13388. * @example
  13389. *
  13390. * function Foo() {
  13391. * this.a = 1;
  13392. * this.b = 2;
  13393. * }
  13394. *
  13395. * Foo.prototype.c = 3;
  13396. *
  13397. * _.forInRight(new Foo, function(value, key) {
  13398. * console.log(key);
  13399. * });
  13400. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13401. */
  13402. function forInRight(object, iteratee) {
  13403. return object == null
  13404. ? object
  13405. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13406. }
  13407. /**
  13408. * Iterates over own enumerable string keyed properties of an object and
  13409. * invokes `iteratee` for each property. The iteratee is invoked with three
  13410. * arguments: (value, key, object). Iteratee functions may exit iteration
  13411. * early by explicitly returning `false`.
  13412. *
  13413. * @static
  13414. * @memberOf _
  13415. * @since 0.3.0
  13416. * @category Object
  13417. * @param {Object} object The object to iterate over.
  13418. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13419. * @returns {Object} Returns `object`.
  13420. * @see _.forOwnRight
  13421. * @example
  13422. *
  13423. * function Foo() {
  13424. * this.a = 1;
  13425. * this.b = 2;
  13426. * }
  13427. *
  13428. * Foo.prototype.c = 3;
  13429. *
  13430. * _.forOwn(new Foo, function(value, key) {
  13431. * console.log(key);
  13432. * });
  13433. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13434. */
  13435. function forOwn(object, iteratee) {
  13436. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13437. }
  13438. /**
  13439. * This method is like `_.forOwn` except that it iterates over properties of
  13440. * `object` in the opposite order.
  13441. *
  13442. * @static
  13443. * @memberOf _
  13444. * @since 2.0.0
  13445. * @category Object
  13446. * @param {Object} object The object to iterate over.
  13447. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13448. * @returns {Object} Returns `object`.
  13449. * @see _.forOwn
  13450. * @example
  13451. *
  13452. * function Foo() {
  13453. * this.a = 1;
  13454. * this.b = 2;
  13455. * }
  13456. *
  13457. * Foo.prototype.c = 3;
  13458. *
  13459. * _.forOwnRight(new Foo, function(value, key) {
  13460. * console.log(key);
  13461. * });
  13462. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13463. */
  13464. function forOwnRight(object, iteratee) {
  13465. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13466. }
  13467. /**
  13468. * Creates an array of function property names from own enumerable properties
  13469. * of `object`.
  13470. *
  13471. * @static
  13472. * @since 0.1.0
  13473. * @memberOf _
  13474. * @category Object
  13475. * @param {Object} object The object to inspect.
  13476. * @returns {Array} Returns the function names.
  13477. * @see _.functionsIn
  13478. * @example
  13479. *
  13480. * function Foo() {
  13481. * this.a = _.constant('a');
  13482. * this.b = _.constant('b');
  13483. * }
  13484. *
  13485. * Foo.prototype.c = _.constant('c');
  13486. *
  13487. * _.functions(new Foo);
  13488. * // => ['a', 'b']
  13489. */
  13490. function functions(object) {
  13491. return object == null ? [] : baseFunctions(object, keys(object));
  13492. }
  13493. /**
  13494. * Creates an array of function property names from own and inherited
  13495. * enumerable properties of `object`.
  13496. *
  13497. * @static
  13498. * @memberOf _
  13499. * @since 4.0.0
  13500. * @category Object
  13501. * @param {Object} object The object to inspect.
  13502. * @returns {Array} Returns the function names.
  13503. * @see _.functions
  13504. * @example
  13505. *
  13506. * function Foo() {
  13507. * this.a = _.constant('a');
  13508. * this.b = _.constant('b');
  13509. * }
  13510. *
  13511. * Foo.prototype.c = _.constant('c');
  13512. *
  13513. * _.functionsIn(new Foo);
  13514. * // => ['a', 'b', 'c']
  13515. */
  13516. function functionsIn(object) {
  13517. return object == null ? [] : baseFunctions(object, keysIn(object));
  13518. }
  13519. /**
  13520. * Gets the value at `path` of `object`. If the resolved value is
  13521. * `undefined`, the `defaultValue` is returned in its place.
  13522. *
  13523. * @static
  13524. * @memberOf _
  13525. * @since 3.7.0
  13526. * @category Object
  13527. * @param {Object} object The object to query.
  13528. * @param {Array|string} path The path of the property to get.
  13529. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13530. * @returns {*} Returns the resolved value.
  13531. * @example
  13532. *
  13533. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13534. *
  13535. * _.get(object, 'a[0].b.c');
  13536. * // => 3
  13537. *
  13538. * _.get(object, ['a', '0', 'b', 'c']);
  13539. * // => 3
  13540. *
  13541. * _.get(object, 'a.b.c', 'default');
  13542. * // => 'default'
  13543. */
  13544. function get(object, path, defaultValue) {
  13545. var result = object == null ? undefined : baseGet(object, path);
  13546. return result === undefined ? defaultValue : result;
  13547. }
  13548. /**
  13549. * Checks if `path` is a direct property of `object`.
  13550. *
  13551. * @static
  13552. * @since 0.1.0
  13553. * @memberOf _
  13554. * @category Object
  13555. * @param {Object} object The object to query.
  13556. * @param {Array|string} path The path to check.
  13557. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13558. * @example
  13559. *
  13560. * var object = { 'a': { 'b': 2 } };
  13561. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13562. *
  13563. * _.has(object, 'a');
  13564. * // => true
  13565. *
  13566. * _.has(object, 'a.b');
  13567. * // => true
  13568. *
  13569. * _.has(object, ['a', 'b']);
  13570. * // => true
  13571. *
  13572. * _.has(other, 'a');
  13573. * // => false
  13574. */
  13575. function has(object, path) {
  13576. return object != null && hasPath(object, path, baseHas);
  13577. }
  13578. /**
  13579. * Checks if `path` is a direct or inherited property of `object`.
  13580. *
  13581. * @static
  13582. * @memberOf _
  13583. * @since 4.0.0
  13584. * @category Object
  13585. * @param {Object} object The object to query.
  13586. * @param {Array|string} path The path to check.
  13587. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13588. * @example
  13589. *
  13590. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13591. *
  13592. * _.hasIn(object, 'a');
  13593. * // => true
  13594. *
  13595. * _.hasIn(object, 'a.b');
  13596. * // => true
  13597. *
  13598. * _.hasIn(object, ['a', 'b']);
  13599. * // => true
  13600. *
  13601. * _.hasIn(object, 'b');
  13602. * // => false
  13603. */
  13604. function hasIn(object, path) {
  13605. return object != null && hasPath(object, path, baseHasIn);
  13606. }
  13607. /**
  13608. * Creates an object composed of the inverted keys and values of `object`.
  13609. * If `object` contains duplicate values, subsequent values overwrite
  13610. * property assignments of previous values.
  13611. *
  13612. * @static
  13613. * @memberOf _
  13614. * @since 0.7.0
  13615. * @category Object
  13616. * @param {Object} object The object to invert.
  13617. * @returns {Object} Returns the new inverted object.
  13618. * @example
  13619. *
  13620. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13621. *
  13622. * _.invert(object);
  13623. * // => { '1': 'c', '2': 'b' }
  13624. */
  13625. var invert = createInverter(function(result, value, key) {
  13626. if (value != null &&
  13627. typeof value.toString != 'function') {
  13628. value = nativeObjectToString.call(value);
  13629. }
  13630. result[value] = key;
  13631. }, constant(identity));
  13632. /**
  13633. * This method is like `_.invert` except that the inverted object is generated
  13634. * from the results of running each element of `object` thru `iteratee`. The
  13635. * corresponding inverted value of each inverted key is an array of keys
  13636. * responsible for generating the inverted value. The iteratee is invoked
  13637. * with one argument: (value).
  13638. *
  13639. * @static
  13640. * @memberOf _
  13641. * @since 4.1.0
  13642. * @category Object
  13643. * @param {Object} object The object to invert.
  13644. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13645. * @returns {Object} Returns the new inverted object.
  13646. * @example
  13647. *
  13648. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13649. *
  13650. * _.invertBy(object);
  13651. * // => { '1': ['a', 'c'], '2': ['b'] }
  13652. *
  13653. * _.invertBy(object, function(value) {
  13654. * return 'group' + value;
  13655. * });
  13656. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13657. */
  13658. var invertBy = createInverter(function(result, value, key) {
  13659. if (value != null &&
  13660. typeof value.toString != 'function') {
  13661. value = nativeObjectToString.call(value);
  13662. }
  13663. if (hasOwnProperty.call(result, value)) {
  13664. result[value].push(key);
  13665. } else {
  13666. result[value] = [key];
  13667. }
  13668. }, getIteratee);
  13669. /**
  13670. * Invokes the method at `path` of `object`.
  13671. *
  13672. * @static
  13673. * @memberOf _
  13674. * @since 4.0.0
  13675. * @category Object
  13676. * @param {Object} object The object to query.
  13677. * @param {Array|string} path The path of the method to invoke.
  13678. * @param {...*} [args] The arguments to invoke the method with.
  13679. * @returns {*} Returns the result of the invoked method.
  13680. * @example
  13681. *
  13682. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13683. *
  13684. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13685. * // => [2, 3]
  13686. */
  13687. var invoke = baseRest(baseInvoke);
  13688. /**
  13689. * Creates an array of the own enumerable property names of `object`.
  13690. *
  13691. * **Note:** Non-object values are coerced to objects. See the
  13692. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13693. * for more details.
  13694. *
  13695. * @static
  13696. * @since 0.1.0
  13697. * @memberOf _
  13698. * @category Object
  13699. * @param {Object} object The object to query.
  13700. * @returns {Array} Returns the array of property names.
  13701. * @example
  13702. *
  13703. * function Foo() {
  13704. * this.a = 1;
  13705. * this.b = 2;
  13706. * }
  13707. *
  13708. * Foo.prototype.c = 3;
  13709. *
  13710. * _.keys(new Foo);
  13711. * // => ['a', 'b'] (iteration order is not guaranteed)
  13712. *
  13713. * _.keys('hi');
  13714. * // => ['0', '1']
  13715. */
  13716. function keys(object) {
  13717. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13718. }
  13719. /**
  13720. * Creates an array of the own and inherited enumerable property names of `object`.
  13721. *
  13722. * **Note:** Non-object values are coerced to objects.
  13723. *
  13724. * @static
  13725. * @memberOf _
  13726. * @since 3.0.0
  13727. * @category Object
  13728. * @param {Object} object The object to query.
  13729. * @returns {Array} Returns the array of property names.
  13730. * @example
  13731. *
  13732. * function Foo() {
  13733. * this.a = 1;
  13734. * this.b = 2;
  13735. * }
  13736. *
  13737. * Foo.prototype.c = 3;
  13738. *
  13739. * _.keysIn(new Foo);
  13740. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13741. */
  13742. function keysIn(object) {
  13743. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13744. }
  13745. /**
  13746. * The opposite of `_.mapValues`; this method creates an object with the
  13747. * same values as `object` and keys generated by running each own enumerable
  13748. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13749. * with three arguments: (value, key, object).
  13750. *
  13751. * @static
  13752. * @memberOf _
  13753. * @since 3.8.0
  13754. * @category Object
  13755. * @param {Object} object The object to iterate over.
  13756. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13757. * @returns {Object} Returns the new mapped object.
  13758. * @see _.mapValues
  13759. * @example
  13760. *
  13761. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13762. * return key + value;
  13763. * });
  13764. * // => { 'a1': 1, 'b2': 2 }
  13765. */
  13766. function mapKeys(object, iteratee) {
  13767. var result = {};
  13768. iteratee = getIteratee(iteratee, 3);
  13769. baseForOwn(object, function(value, key, object) {
  13770. baseAssignValue(result, iteratee(value, key, object), value);
  13771. });
  13772. return result;
  13773. }
  13774. /**
  13775. * Creates an object with the same keys as `object` and values generated
  13776. * by running each own enumerable string keyed property of `object` thru
  13777. * `iteratee`. The iteratee is invoked with three arguments:
  13778. * (value, key, object).
  13779. *
  13780. * @static
  13781. * @memberOf _
  13782. * @since 2.4.0
  13783. * @category Object
  13784. * @param {Object} object The object to iterate over.
  13785. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13786. * @returns {Object} Returns the new mapped object.
  13787. * @see _.mapKeys
  13788. * @example
  13789. *
  13790. * var users = {
  13791. * 'fred': { 'user': 'fred', 'age': 40 },
  13792. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13793. * };
  13794. *
  13795. * _.mapValues(users, function(o) { return o.age; });
  13796. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13797. *
  13798. * // The `_.property` iteratee shorthand.
  13799. * _.mapValues(users, 'age');
  13800. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13801. */
  13802. function mapValues(object, iteratee) {
  13803. var result = {};
  13804. iteratee = getIteratee(iteratee, 3);
  13805. baseForOwn(object, function(value, key, object) {
  13806. baseAssignValue(result, key, iteratee(value, key, object));
  13807. });
  13808. return result;
  13809. }
  13810. /**
  13811. * This method is like `_.assign` except that it recursively merges own and
  13812. * inherited enumerable string keyed properties of source objects into the
  13813. * destination object. Source properties that resolve to `undefined` are
  13814. * skipped if a destination value exists. Array and plain object properties
  13815. * are merged recursively. Other objects and value types are overridden by
  13816. * assignment. Source objects are applied from left to right. Subsequent
  13817. * sources overwrite property assignments of previous sources.
  13818. *
  13819. * **Note:** This method mutates `object`.
  13820. *
  13821. * @static
  13822. * @memberOf _
  13823. * @since 0.5.0
  13824. * @category Object
  13825. * @param {Object} object The destination object.
  13826. * @param {...Object} [sources] The source objects.
  13827. * @returns {Object} Returns `object`.
  13828. * @example
  13829. *
  13830. * var object = {
  13831. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13832. * };
  13833. *
  13834. * var other = {
  13835. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13836. * };
  13837. *
  13838. * _.merge(object, other);
  13839. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13840. */
  13841. var merge = createAssigner(function(object, source, srcIndex) {
  13842. baseMerge(object, source, srcIndex);
  13843. });
  13844. /**
  13845. * This method is like `_.merge` except that it accepts `customizer` which
  13846. * is invoked to produce the merged values of the destination and source
  13847. * properties. If `customizer` returns `undefined`, merging is handled by the
  13848. * method instead. The `customizer` is invoked with six arguments:
  13849. * (objValue, srcValue, key, object, source, stack).
  13850. *
  13851. * **Note:** This method mutates `object`.
  13852. *
  13853. * @static
  13854. * @memberOf _
  13855. * @since 4.0.0
  13856. * @category Object
  13857. * @param {Object} object The destination object.
  13858. * @param {...Object} sources The source objects.
  13859. * @param {Function} customizer The function to customize assigned values.
  13860. * @returns {Object} Returns `object`.
  13861. * @example
  13862. *
  13863. * function customizer(objValue, srcValue) {
  13864. * if (_.isArray(objValue)) {
  13865. * return objValue.concat(srcValue);
  13866. * }
  13867. * }
  13868. *
  13869. * var object = { 'a': [1], 'b': [2] };
  13870. * var other = { 'a': [3], 'b': [4] };
  13871. *
  13872. * _.mergeWith(object, other, customizer);
  13873. * // => { 'a': [1, 3], 'b': [2, 4] }
  13874. */
  13875. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13876. baseMerge(object, source, srcIndex, customizer);
  13877. });
  13878. /**
  13879. * The opposite of `_.pick`; this method creates an object composed of the
  13880. * own and inherited enumerable property paths of `object` that are not omitted.
  13881. *
  13882. * **Note:** This method is considerably slower than `_.pick`.
  13883. *
  13884. * @static
  13885. * @since 0.1.0
  13886. * @memberOf _
  13887. * @category Object
  13888. * @param {Object} object The source object.
  13889. * @param {...(string|string[])} [paths] The property paths to omit.
  13890. * @returns {Object} Returns the new object.
  13891. * @example
  13892. *
  13893. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13894. *
  13895. * _.omit(object, ['a', 'c']);
  13896. * // => { 'b': '2' }
  13897. */
  13898. var omit = flatRest(function(object, paths) {
  13899. var result = {};
  13900. if (object == null) {
  13901. return result;
  13902. }
  13903. var isDeep = false;
  13904. paths = arrayMap(paths, function(path) {
  13905. path = castPath(path, object);
  13906. isDeep || (isDeep = path.length > 1);
  13907. return path;
  13908. });
  13909. copyObject(object, getAllKeysIn(object), result);
  13910. if (isDeep) {
  13911. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13912. }
  13913. var length = paths.length;
  13914. while (length--) {
  13915. baseUnset(result, paths[length]);
  13916. }
  13917. return result;
  13918. });
  13919. /**
  13920. * The opposite of `_.pickBy`; this method creates an object composed of
  13921. * the own and inherited enumerable string keyed properties of `object` that
  13922. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13923. * arguments: (value, key).
  13924. *
  13925. * @static
  13926. * @memberOf _
  13927. * @since 4.0.0
  13928. * @category Object
  13929. * @param {Object} object The source object.
  13930. * @param {Function} [predicate=_.identity] The function invoked per property.
  13931. * @returns {Object} Returns the new object.
  13932. * @example
  13933. *
  13934. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13935. *
  13936. * _.omitBy(object, _.isNumber);
  13937. * // => { 'b': '2' }
  13938. */
  13939. function omitBy(object, predicate) {
  13940. return pickBy(object, negate(getIteratee(predicate)));
  13941. }
  13942. /**
  13943. * Creates an object composed of the picked `object` properties.
  13944. *
  13945. * @static
  13946. * @since 0.1.0
  13947. * @memberOf _
  13948. * @category Object
  13949. * @param {Object} object The source object.
  13950. * @param {...(string|string[])} [paths] The property paths to pick.
  13951. * @returns {Object} Returns the new object.
  13952. * @example
  13953. *
  13954. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13955. *
  13956. * _.pick(object, ['a', 'c']);
  13957. * // => { 'a': 1, 'c': 3 }
  13958. */
  13959. var pick = flatRest(function(object, paths) {
  13960. return object == null ? {} : basePick(object, paths);
  13961. });
  13962. /**
  13963. * Creates an object composed of the `object` properties `predicate` returns
  13964. * truthy for. The predicate is invoked with two arguments: (value, key).
  13965. *
  13966. * @static
  13967. * @memberOf _
  13968. * @since 4.0.0
  13969. * @category Object
  13970. * @param {Object} object The source object.
  13971. * @param {Function} [predicate=_.identity] The function invoked per property.
  13972. * @returns {Object} Returns the new object.
  13973. * @example
  13974. *
  13975. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13976. *
  13977. * _.pickBy(object, _.isNumber);
  13978. * // => { 'a': 1, 'c': 3 }
  13979. */
  13980. function pickBy(object, predicate) {
  13981. if (object == null) {
  13982. return {};
  13983. }
  13984. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13985. return [prop];
  13986. });
  13987. predicate = getIteratee(predicate);
  13988. return basePickBy(object, props, function(value, path) {
  13989. return predicate(value, path[0]);
  13990. });
  13991. }
  13992. /**
  13993. * This method is like `_.get` except that if the resolved value is a
  13994. * function it's invoked with the `this` binding of its parent object and
  13995. * its result is returned.
  13996. *
  13997. * @static
  13998. * @since 0.1.0
  13999. * @memberOf _
  14000. * @category Object
  14001. * @param {Object} object The object to query.
  14002. * @param {Array|string} path The path of the property to resolve.
  14003. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14004. * @returns {*} Returns the resolved value.
  14005. * @example
  14006. *
  14007. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14008. *
  14009. * _.result(object, 'a[0].b.c1');
  14010. * // => 3
  14011. *
  14012. * _.result(object, 'a[0].b.c2');
  14013. * // => 4
  14014. *
  14015. * _.result(object, 'a[0].b.c3', 'default');
  14016. * // => 'default'
  14017. *
  14018. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14019. * // => 'default'
  14020. */
  14021. function result(object, path, defaultValue) {
  14022. path = castPath(path, object);
  14023. var index = -1,
  14024. length = path.length;
  14025. // Ensure the loop is entered when path is empty.
  14026. if (!length) {
  14027. length = 1;
  14028. object = undefined;
  14029. }
  14030. while (++index < length) {
  14031. var value = object == null ? undefined : object[toKey(path[index])];
  14032. if (value === undefined) {
  14033. index = length;
  14034. value = defaultValue;
  14035. }
  14036. object = isFunction(value) ? value.call(object) : value;
  14037. }
  14038. return object;
  14039. }
  14040. /**
  14041. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14042. * it's created. Arrays are created for missing index properties while objects
  14043. * are created for all other missing properties. Use `_.setWith` to customize
  14044. * `path` creation.
  14045. *
  14046. * **Note:** This method mutates `object`.
  14047. *
  14048. * @static
  14049. * @memberOf _
  14050. * @since 3.7.0
  14051. * @category Object
  14052. * @param {Object} object The object to modify.
  14053. * @param {Array|string} path The path of the property to set.
  14054. * @param {*} value The value to set.
  14055. * @returns {Object} Returns `object`.
  14056. * @example
  14057. *
  14058. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14059. *
  14060. * _.set(object, 'a[0].b.c', 4);
  14061. * console.log(object.a[0].b.c);
  14062. * // => 4
  14063. *
  14064. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14065. * console.log(object.x[0].y.z);
  14066. * // => 5
  14067. */
  14068. function set(object, path, value) {
  14069. return object == null ? object : baseSet(object, path, value);
  14070. }
  14071. /**
  14072. * This method is like `_.set` except that it accepts `customizer` which is
  14073. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14074. * path creation is handled by the method instead. The `customizer` is invoked
  14075. * with three arguments: (nsValue, key, nsObject).
  14076. *
  14077. * **Note:** This method mutates `object`.
  14078. *
  14079. * @static
  14080. * @memberOf _
  14081. * @since 4.0.0
  14082. * @category Object
  14083. * @param {Object} object The object to modify.
  14084. * @param {Array|string} path The path of the property to set.
  14085. * @param {*} value The value to set.
  14086. * @param {Function} [customizer] The function to customize assigned values.
  14087. * @returns {Object} Returns `object`.
  14088. * @example
  14089. *
  14090. * var object = {};
  14091. *
  14092. * _.setWith(object, '[0][1]', 'a', Object);
  14093. * // => { '0': { '1': 'a' } }
  14094. */
  14095. function setWith(object, path, value, customizer) {
  14096. customizer = typeof customizer == 'function' ? customizer : undefined;
  14097. return object == null ? object : baseSet(object, path, value, customizer);
  14098. }
  14099. /**
  14100. * Creates an array of own enumerable string keyed-value pairs for `object`
  14101. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14102. * entries are returned.
  14103. *
  14104. * @static
  14105. * @memberOf _
  14106. * @since 4.0.0
  14107. * @alias entries
  14108. * @category Object
  14109. * @param {Object} object The object to query.
  14110. * @returns {Array} Returns the key-value pairs.
  14111. * @example
  14112. *
  14113. * function Foo() {
  14114. * this.a = 1;
  14115. * this.b = 2;
  14116. * }
  14117. *
  14118. * Foo.prototype.c = 3;
  14119. *
  14120. * _.toPairs(new Foo);
  14121. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14122. */
  14123. var toPairs = createToPairs(keys);
  14124. /**
  14125. * Creates an array of own and inherited enumerable string keyed-value pairs
  14126. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14127. * or set, its entries are returned.
  14128. *
  14129. * @static
  14130. * @memberOf _
  14131. * @since 4.0.0
  14132. * @alias entriesIn
  14133. * @category Object
  14134. * @param {Object} object The object to query.
  14135. * @returns {Array} Returns the key-value pairs.
  14136. * @example
  14137. *
  14138. * function Foo() {
  14139. * this.a = 1;
  14140. * this.b = 2;
  14141. * }
  14142. *
  14143. * Foo.prototype.c = 3;
  14144. *
  14145. * _.toPairsIn(new Foo);
  14146. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14147. */
  14148. var toPairsIn = createToPairs(keysIn);
  14149. /**
  14150. * An alternative to `_.reduce`; this method transforms `object` to a new
  14151. * `accumulator` object which is the result of running each of its own
  14152. * enumerable string keyed properties thru `iteratee`, with each invocation
  14153. * potentially mutating the `accumulator` object. If `accumulator` is not
  14154. * provided, a new object with the same `[[Prototype]]` will be used. The
  14155. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14156. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14157. *
  14158. * @static
  14159. * @memberOf _
  14160. * @since 1.3.0
  14161. * @category Object
  14162. * @param {Object} object The object to iterate over.
  14163. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14164. * @param {*} [accumulator] The custom accumulator value.
  14165. * @returns {*} Returns the accumulated value.
  14166. * @example
  14167. *
  14168. * _.transform([2, 3, 4], function(result, n) {
  14169. * result.push(n *= n);
  14170. * return n % 2 == 0;
  14171. * }, []);
  14172. * // => [4, 9]
  14173. *
  14174. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14175. * (result[value] || (result[value] = [])).push(key);
  14176. * }, {});
  14177. * // => { '1': ['a', 'c'], '2': ['b'] }
  14178. */
  14179. function transform(object, iteratee, accumulator) {
  14180. var isArr = isArray(object),
  14181. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14182. iteratee = getIteratee(iteratee, 4);
  14183. if (accumulator == null) {
  14184. var Ctor = object && object.constructor;
  14185. if (isArrLike) {
  14186. accumulator = isArr ? new Ctor : [];
  14187. }
  14188. else if (isObject(object)) {
  14189. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14190. }
  14191. else {
  14192. accumulator = {};
  14193. }
  14194. }
  14195. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14196. return iteratee(accumulator, value, index, object);
  14197. });
  14198. return accumulator;
  14199. }
  14200. /**
  14201. * Removes the property at `path` of `object`.
  14202. *
  14203. * **Note:** This method mutates `object`.
  14204. *
  14205. * @static
  14206. * @memberOf _
  14207. * @since 4.0.0
  14208. * @category Object
  14209. * @param {Object} object The object to modify.
  14210. * @param {Array|string} path The path of the property to unset.
  14211. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14212. * @example
  14213. *
  14214. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14215. * _.unset(object, 'a[0].b.c');
  14216. * // => true
  14217. *
  14218. * console.log(object);
  14219. * // => { 'a': [{ 'b': {} }] };
  14220. *
  14221. * _.unset(object, ['a', '0', 'b', 'c']);
  14222. * // => true
  14223. *
  14224. * console.log(object);
  14225. * // => { 'a': [{ 'b': {} }] };
  14226. */
  14227. function unset(object, path) {
  14228. return object == null ? true : baseUnset(object, path);
  14229. }
  14230. /**
  14231. * This method is like `_.set` except that accepts `updater` to produce the
  14232. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14233. * is invoked with one argument: (value).
  14234. *
  14235. * **Note:** This method mutates `object`.
  14236. *
  14237. * @static
  14238. * @memberOf _
  14239. * @since 4.6.0
  14240. * @category Object
  14241. * @param {Object} object The object to modify.
  14242. * @param {Array|string} path The path of the property to set.
  14243. * @param {Function} updater The function to produce the updated value.
  14244. * @returns {Object} Returns `object`.
  14245. * @example
  14246. *
  14247. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14248. *
  14249. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14250. * console.log(object.a[0].b.c);
  14251. * // => 9
  14252. *
  14253. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14254. * console.log(object.x[0].y.z);
  14255. * // => 0
  14256. */
  14257. function update(object, path, updater) {
  14258. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14259. }
  14260. /**
  14261. * This method is like `_.update` except that it accepts `customizer` which is
  14262. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14263. * path creation is handled by the method instead. The `customizer` is invoked
  14264. * with three arguments: (nsValue, key, nsObject).
  14265. *
  14266. * **Note:** This method mutates `object`.
  14267. *
  14268. * @static
  14269. * @memberOf _
  14270. * @since 4.6.0
  14271. * @category Object
  14272. * @param {Object} object The object to modify.
  14273. * @param {Array|string} path The path of the property to set.
  14274. * @param {Function} updater The function to produce the updated value.
  14275. * @param {Function} [customizer] The function to customize assigned values.
  14276. * @returns {Object} Returns `object`.
  14277. * @example
  14278. *
  14279. * var object = {};
  14280. *
  14281. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14282. * // => { '0': { '1': 'a' } }
  14283. */
  14284. function updateWith(object, path, updater, customizer) {
  14285. customizer = typeof customizer == 'function' ? customizer : undefined;
  14286. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14287. }
  14288. /**
  14289. * Creates an array of the own enumerable string keyed property values of `object`.
  14290. *
  14291. * **Note:** Non-object values are coerced to objects.
  14292. *
  14293. * @static
  14294. * @since 0.1.0
  14295. * @memberOf _
  14296. * @category Object
  14297. * @param {Object} object The object to query.
  14298. * @returns {Array} Returns the array of property values.
  14299. * @example
  14300. *
  14301. * function Foo() {
  14302. * this.a = 1;
  14303. * this.b = 2;
  14304. * }
  14305. *
  14306. * Foo.prototype.c = 3;
  14307. *
  14308. * _.values(new Foo);
  14309. * // => [1, 2] (iteration order is not guaranteed)
  14310. *
  14311. * _.values('hi');
  14312. * // => ['h', 'i']
  14313. */
  14314. function values(object) {
  14315. return object == null ? [] : baseValues(object, keys(object));
  14316. }
  14317. /**
  14318. * Creates an array of the own and inherited enumerable string keyed property
  14319. * values of `object`.
  14320. *
  14321. * **Note:** Non-object values are coerced to objects.
  14322. *
  14323. * @static
  14324. * @memberOf _
  14325. * @since 3.0.0
  14326. * @category Object
  14327. * @param {Object} object The object to query.
  14328. * @returns {Array} Returns the array of property values.
  14329. * @example
  14330. *
  14331. * function Foo() {
  14332. * this.a = 1;
  14333. * this.b = 2;
  14334. * }
  14335. *
  14336. * Foo.prototype.c = 3;
  14337. *
  14338. * _.valuesIn(new Foo);
  14339. * // => [1, 2, 3] (iteration order is not guaranteed)
  14340. */
  14341. function valuesIn(object) {
  14342. return object == null ? [] : baseValues(object, keysIn(object));
  14343. }
  14344. /*------------------------------------------------------------------------*/
  14345. /**
  14346. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14347. *
  14348. * @static
  14349. * @memberOf _
  14350. * @since 4.0.0
  14351. * @category Number
  14352. * @param {number} number The number to clamp.
  14353. * @param {number} [lower] The lower bound.
  14354. * @param {number} upper The upper bound.
  14355. * @returns {number} Returns the clamped number.
  14356. * @example
  14357. *
  14358. * _.clamp(-10, -5, 5);
  14359. * // => -5
  14360. *
  14361. * _.clamp(10, -5, 5);
  14362. * // => 5
  14363. */
  14364. function clamp(number, lower, upper) {
  14365. if (upper === undefined) {
  14366. upper = lower;
  14367. lower = undefined;
  14368. }
  14369. if (upper !== undefined) {
  14370. upper = toNumber(upper);
  14371. upper = upper === upper ? upper : 0;
  14372. }
  14373. if (lower !== undefined) {
  14374. lower = toNumber(lower);
  14375. lower = lower === lower ? lower : 0;
  14376. }
  14377. return baseClamp(toNumber(number), lower, upper);
  14378. }
  14379. /**
  14380. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14381. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14382. * If `start` is greater than `end` the params are swapped to support
  14383. * negative ranges.
  14384. *
  14385. * @static
  14386. * @memberOf _
  14387. * @since 3.3.0
  14388. * @category Number
  14389. * @param {number} number The number to check.
  14390. * @param {number} [start=0] The start of the range.
  14391. * @param {number} end The end of the range.
  14392. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14393. * @see _.range, _.rangeRight
  14394. * @example
  14395. *
  14396. * _.inRange(3, 2, 4);
  14397. * // => true
  14398. *
  14399. * _.inRange(4, 8);
  14400. * // => true
  14401. *
  14402. * _.inRange(4, 2);
  14403. * // => false
  14404. *
  14405. * _.inRange(2, 2);
  14406. * // => false
  14407. *
  14408. * _.inRange(1.2, 2);
  14409. * // => true
  14410. *
  14411. * _.inRange(5.2, 4);
  14412. * // => false
  14413. *
  14414. * _.inRange(-3, -2, -6);
  14415. * // => true
  14416. */
  14417. function inRange(number, start, end) {
  14418. start = toFinite(start);
  14419. if (end === undefined) {
  14420. end = start;
  14421. start = 0;
  14422. } else {
  14423. end = toFinite(end);
  14424. }
  14425. number = toNumber(number);
  14426. return baseInRange(number, start, end);
  14427. }
  14428. /**
  14429. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14430. * If only one argument is provided a number between `0` and the given number
  14431. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14432. * floats, a floating-point number is returned instead of an integer.
  14433. *
  14434. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14435. * floating-point values which can produce unexpected results.
  14436. *
  14437. * @static
  14438. * @memberOf _
  14439. * @since 0.7.0
  14440. * @category Number
  14441. * @param {number} [lower=0] The lower bound.
  14442. * @param {number} [upper=1] The upper bound.
  14443. * @param {boolean} [floating] Specify returning a floating-point number.
  14444. * @returns {number} Returns the random number.
  14445. * @example
  14446. *
  14447. * _.random(0, 5);
  14448. * // => an integer between 0 and 5
  14449. *
  14450. * _.random(5);
  14451. * // => also an integer between 0 and 5
  14452. *
  14453. * _.random(5, true);
  14454. * // => a floating-point number between 0 and 5
  14455. *
  14456. * _.random(1.2, 5.2);
  14457. * // => a floating-point number between 1.2 and 5.2
  14458. */
  14459. function random(lower, upper, floating) {
  14460. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14461. upper = floating = undefined;
  14462. }
  14463. if (floating === undefined) {
  14464. if (typeof upper == 'boolean') {
  14465. floating = upper;
  14466. upper = undefined;
  14467. }
  14468. else if (typeof lower == 'boolean') {
  14469. floating = lower;
  14470. lower = undefined;
  14471. }
  14472. }
  14473. if (lower === undefined && upper === undefined) {
  14474. lower = 0;
  14475. upper = 1;
  14476. }
  14477. else {
  14478. lower = toFinite(lower);
  14479. if (upper === undefined) {
  14480. upper = lower;
  14481. lower = 0;
  14482. } else {
  14483. upper = toFinite(upper);
  14484. }
  14485. }
  14486. if (lower > upper) {
  14487. var temp = lower;
  14488. lower = upper;
  14489. upper = temp;
  14490. }
  14491. if (floating || lower % 1 || upper % 1) {
  14492. var rand = nativeRandom();
  14493. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14494. }
  14495. return baseRandom(lower, upper);
  14496. }
  14497. /*------------------------------------------------------------------------*/
  14498. /**
  14499. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14500. *
  14501. * @static
  14502. * @memberOf _
  14503. * @since 3.0.0
  14504. * @category String
  14505. * @param {string} [string=''] The string to convert.
  14506. * @returns {string} Returns the camel cased string.
  14507. * @example
  14508. *
  14509. * _.camelCase('Foo Bar');
  14510. * // => 'fooBar'
  14511. *
  14512. * _.camelCase('--foo-bar--');
  14513. * // => 'fooBar'
  14514. *
  14515. * _.camelCase('__FOO_BAR__');
  14516. * // => 'fooBar'
  14517. */
  14518. var camelCase = createCompounder(function(result, word, index) {
  14519. word = word.toLowerCase();
  14520. return result + (index ? capitalize(word) : word);
  14521. });
  14522. /**
  14523. * Converts the first character of `string` to upper case and the remaining
  14524. * to lower case.
  14525. *
  14526. * @static
  14527. * @memberOf _
  14528. * @since 3.0.0
  14529. * @category String
  14530. * @param {string} [string=''] The string to capitalize.
  14531. * @returns {string} Returns the capitalized string.
  14532. * @example
  14533. *
  14534. * _.capitalize('FRED');
  14535. * // => 'Fred'
  14536. */
  14537. function capitalize(string) {
  14538. return upperFirst(toString(string).toLowerCase());
  14539. }
  14540. /**
  14541. * Deburrs `string` by converting
  14542. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14543. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14544. * letters to basic Latin letters and removing
  14545. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14546. *
  14547. * @static
  14548. * @memberOf _
  14549. * @since 3.0.0
  14550. * @category String
  14551. * @param {string} [string=''] The string to deburr.
  14552. * @returns {string} Returns the deburred string.
  14553. * @example
  14554. *
  14555. * _.deburr('déjà vu');
  14556. * // => 'deja vu'
  14557. */
  14558. function deburr(string) {
  14559. string = toString(string);
  14560. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14561. }
  14562. /**
  14563. * Checks if `string` ends with the given target string.
  14564. *
  14565. * @static
  14566. * @memberOf _
  14567. * @since 3.0.0
  14568. * @category String
  14569. * @param {string} [string=''] The string to inspect.
  14570. * @param {string} [target] The string to search for.
  14571. * @param {number} [position=string.length] The position to search up to.
  14572. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14573. * else `false`.
  14574. * @example
  14575. *
  14576. * _.endsWith('abc', 'c');
  14577. * // => true
  14578. *
  14579. * _.endsWith('abc', 'b');
  14580. * // => false
  14581. *
  14582. * _.endsWith('abc', 'b', 2);
  14583. * // => true
  14584. */
  14585. function endsWith(string, target, position) {
  14586. string = toString(string);
  14587. target = baseToString(target);
  14588. var length = string.length;
  14589. position = position === undefined
  14590. ? length
  14591. : baseClamp(toInteger(position), 0, length);
  14592. var end = position;
  14593. position -= target.length;
  14594. return position >= 0 && string.slice(position, end) == target;
  14595. }
  14596. /**
  14597. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14598. * corresponding HTML entities.
  14599. *
  14600. * **Note:** No other characters are escaped. To escape additional
  14601. * characters use a third-party library like [_he_](https://mths.be/he).
  14602. *
  14603. * Though the ">" character is escaped for symmetry, characters like
  14604. * ">" and "/" don't need escaping in HTML and have no special meaning
  14605. * unless they're part of a tag or unquoted attribute value. See
  14606. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14607. * (under "semi-related fun fact") for more details.
  14608. *
  14609. * When working with HTML you should always
  14610. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14611. * XSS vectors.
  14612. *
  14613. * @static
  14614. * @since 0.1.0
  14615. * @memberOf _
  14616. * @category String
  14617. * @param {string} [string=''] The string to escape.
  14618. * @returns {string} Returns the escaped string.
  14619. * @example
  14620. *
  14621. * _.escape('fred, barney, & pebbles');
  14622. * // => 'fred, barney, &amp; pebbles'
  14623. */
  14624. function escape(string) {
  14625. string = toString(string);
  14626. return (string && reHasUnescapedHtml.test(string))
  14627. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14628. : string;
  14629. }
  14630. /**
  14631. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14632. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14633. *
  14634. * @static
  14635. * @memberOf _
  14636. * @since 3.0.0
  14637. * @category String
  14638. * @param {string} [string=''] The string to escape.
  14639. * @returns {string} Returns the escaped string.
  14640. * @example
  14641. *
  14642. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14643. * // => '\[lodash\]\(https://lodash\.com/\)'
  14644. */
  14645. function escapeRegExp(string) {
  14646. string = toString(string);
  14647. return (string && reHasRegExpChar.test(string))
  14648. ? string.replace(reRegExpChar, '\\$&')
  14649. : string;
  14650. }
  14651. /**
  14652. * Converts `string` to
  14653. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14654. *
  14655. * @static
  14656. * @memberOf _
  14657. * @since 3.0.0
  14658. * @category String
  14659. * @param {string} [string=''] The string to convert.
  14660. * @returns {string} Returns the kebab cased string.
  14661. * @example
  14662. *
  14663. * _.kebabCase('Foo Bar');
  14664. * // => 'foo-bar'
  14665. *
  14666. * _.kebabCase('fooBar');
  14667. * // => 'foo-bar'
  14668. *
  14669. * _.kebabCase('__FOO_BAR__');
  14670. * // => 'foo-bar'
  14671. */
  14672. var kebabCase = createCompounder(function(result, word, index) {
  14673. return result + (index ? '-' : '') + word.toLowerCase();
  14674. });
  14675. /**
  14676. * Converts `string`, as space separated words, to lower case.
  14677. *
  14678. * @static
  14679. * @memberOf _
  14680. * @since 4.0.0
  14681. * @category String
  14682. * @param {string} [string=''] The string to convert.
  14683. * @returns {string} Returns the lower cased string.
  14684. * @example
  14685. *
  14686. * _.lowerCase('--Foo-Bar--');
  14687. * // => 'foo bar'
  14688. *
  14689. * _.lowerCase('fooBar');
  14690. * // => 'foo bar'
  14691. *
  14692. * _.lowerCase('__FOO_BAR__');
  14693. * // => 'foo bar'
  14694. */
  14695. var lowerCase = createCompounder(function(result, word, index) {
  14696. return result + (index ? ' ' : '') + word.toLowerCase();
  14697. });
  14698. /**
  14699. * Converts the first character of `string` to lower case.
  14700. *
  14701. * @static
  14702. * @memberOf _
  14703. * @since 4.0.0
  14704. * @category String
  14705. * @param {string} [string=''] The string to convert.
  14706. * @returns {string} Returns the converted string.
  14707. * @example
  14708. *
  14709. * _.lowerFirst('Fred');
  14710. * // => 'fred'
  14711. *
  14712. * _.lowerFirst('FRED');
  14713. * // => 'fRED'
  14714. */
  14715. var lowerFirst = createCaseFirst('toLowerCase');
  14716. /**
  14717. * Pads `string` on the left and right sides if it's shorter than `length`.
  14718. * Padding characters are truncated if they can't be evenly divided by `length`.
  14719. *
  14720. * @static
  14721. * @memberOf _
  14722. * @since 3.0.0
  14723. * @category String
  14724. * @param {string} [string=''] The string to pad.
  14725. * @param {number} [length=0] The padding length.
  14726. * @param {string} [chars=' '] The string used as padding.
  14727. * @returns {string} Returns the padded string.
  14728. * @example
  14729. *
  14730. * _.pad('abc', 8);
  14731. * // => ' abc '
  14732. *
  14733. * _.pad('abc', 8, '_-');
  14734. * // => '_-abc_-_'
  14735. *
  14736. * _.pad('abc', 3);
  14737. * // => 'abc'
  14738. */
  14739. function pad(string, length, chars) {
  14740. string = toString(string);
  14741. length = toInteger(length);
  14742. var strLength = length ? stringSize(string) : 0;
  14743. if (!length || strLength >= length) {
  14744. return string;
  14745. }
  14746. var mid = (length - strLength) / 2;
  14747. return (
  14748. createPadding(nativeFloor(mid), chars) +
  14749. string +
  14750. createPadding(nativeCeil(mid), chars)
  14751. );
  14752. }
  14753. /**
  14754. * Pads `string` on the right side if it's shorter than `length`. Padding
  14755. * characters are truncated if they exceed `length`.
  14756. *
  14757. * @static
  14758. * @memberOf _
  14759. * @since 4.0.0
  14760. * @category String
  14761. * @param {string} [string=''] The string to pad.
  14762. * @param {number} [length=0] The padding length.
  14763. * @param {string} [chars=' '] The string used as padding.
  14764. * @returns {string} Returns the padded string.
  14765. * @example
  14766. *
  14767. * _.padEnd('abc', 6);
  14768. * // => 'abc '
  14769. *
  14770. * _.padEnd('abc', 6, '_-');
  14771. * // => 'abc_-_'
  14772. *
  14773. * _.padEnd('abc', 3);
  14774. * // => 'abc'
  14775. */
  14776. function padEnd(string, length, chars) {
  14777. string = toString(string);
  14778. length = toInteger(length);
  14779. var strLength = length ? stringSize(string) : 0;
  14780. return (length && strLength < length)
  14781. ? (string + createPadding(length - strLength, chars))
  14782. : string;
  14783. }
  14784. /**
  14785. * Pads `string` on the left side if it's shorter than `length`. Padding
  14786. * characters are truncated if they exceed `length`.
  14787. *
  14788. * @static
  14789. * @memberOf _
  14790. * @since 4.0.0
  14791. * @category String
  14792. * @param {string} [string=''] The string to pad.
  14793. * @param {number} [length=0] The padding length.
  14794. * @param {string} [chars=' '] The string used as padding.
  14795. * @returns {string} Returns the padded string.
  14796. * @example
  14797. *
  14798. * _.padStart('abc', 6);
  14799. * // => ' abc'
  14800. *
  14801. * _.padStart('abc', 6, '_-');
  14802. * // => '_-_abc'
  14803. *
  14804. * _.padStart('abc', 3);
  14805. * // => 'abc'
  14806. */
  14807. function padStart(string, length, chars) {
  14808. string = toString(string);
  14809. length = toInteger(length);
  14810. var strLength = length ? stringSize(string) : 0;
  14811. return (length && strLength < length)
  14812. ? (createPadding(length - strLength, chars) + string)
  14813. : string;
  14814. }
  14815. /**
  14816. * Converts `string` to an integer of the specified radix. If `radix` is
  14817. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14818. * hexadecimal, in which case a `radix` of `16` is used.
  14819. *
  14820. * **Note:** This method aligns with the
  14821. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14822. *
  14823. * @static
  14824. * @memberOf _
  14825. * @since 1.1.0
  14826. * @category String
  14827. * @param {string} string The string to convert.
  14828. * @param {number} [radix=10] The radix to interpret `value` by.
  14829. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14830. * @returns {number} Returns the converted integer.
  14831. * @example
  14832. *
  14833. * _.parseInt('08');
  14834. * // => 8
  14835. *
  14836. * _.map(['6', '08', '10'], _.parseInt);
  14837. * // => [6, 8, 10]
  14838. */
  14839. function parseInt(string, radix, guard) {
  14840. if (guard || radix == null) {
  14841. radix = 0;
  14842. } else if (radix) {
  14843. radix = +radix;
  14844. }
  14845. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14846. }
  14847. /**
  14848. * Repeats the given string `n` times.
  14849. *
  14850. * @static
  14851. * @memberOf _
  14852. * @since 3.0.0
  14853. * @category String
  14854. * @param {string} [string=''] The string to repeat.
  14855. * @param {number} [n=1] The number of times to repeat the string.
  14856. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14857. * @returns {string} Returns the repeated string.
  14858. * @example
  14859. *
  14860. * _.repeat('*', 3);
  14861. * // => '***'
  14862. *
  14863. * _.repeat('abc', 2);
  14864. * // => 'abcabc'
  14865. *
  14866. * _.repeat('abc', 0);
  14867. * // => ''
  14868. */
  14869. function repeat(string, n, guard) {
  14870. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14871. n = 1;
  14872. } else {
  14873. n = toInteger(n);
  14874. }
  14875. return baseRepeat(toString(string), n);
  14876. }
  14877. /**
  14878. * Replaces matches for `pattern` in `string` with `replacement`.
  14879. *
  14880. * **Note:** This method is based on
  14881. * [`String#replace`](https://mdn.io/String/replace).
  14882. *
  14883. * @static
  14884. * @memberOf _
  14885. * @since 4.0.0
  14886. * @category String
  14887. * @param {string} [string=''] The string to modify.
  14888. * @param {RegExp|string} pattern The pattern to replace.
  14889. * @param {Function|string} replacement The match replacement.
  14890. * @returns {string} Returns the modified string.
  14891. * @example
  14892. *
  14893. * _.replace('Hi Fred', 'Fred', 'Barney');
  14894. * // => 'Hi Barney'
  14895. */
  14896. function replace() {
  14897. var args = arguments,
  14898. string = toString(args[0]);
  14899. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14900. }
  14901. /**
  14902. * Converts `string` to
  14903. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14904. *
  14905. * @static
  14906. * @memberOf _
  14907. * @since 3.0.0
  14908. * @category String
  14909. * @param {string} [string=''] The string to convert.
  14910. * @returns {string} Returns the snake cased string.
  14911. * @example
  14912. *
  14913. * _.snakeCase('Foo Bar');
  14914. * // => 'foo_bar'
  14915. *
  14916. * _.snakeCase('fooBar');
  14917. * // => 'foo_bar'
  14918. *
  14919. * _.snakeCase('--FOO-BAR--');
  14920. * // => 'foo_bar'
  14921. */
  14922. var snakeCase = createCompounder(function(result, word, index) {
  14923. return result + (index ? '_' : '') + word.toLowerCase();
  14924. });
  14925. /**
  14926. * Splits `string` by `separator`.
  14927. *
  14928. * **Note:** This method is based on
  14929. * [`String#split`](https://mdn.io/String/split).
  14930. *
  14931. * @static
  14932. * @memberOf _
  14933. * @since 4.0.0
  14934. * @category String
  14935. * @param {string} [string=''] The string to split.
  14936. * @param {RegExp|string} separator The separator pattern to split by.
  14937. * @param {number} [limit] The length to truncate results to.
  14938. * @returns {Array} Returns the string segments.
  14939. * @example
  14940. *
  14941. * _.split('a-b-c', '-', 2);
  14942. * // => ['a', 'b']
  14943. */
  14944. function split(string, separator, limit) {
  14945. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14946. separator = limit = undefined;
  14947. }
  14948. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14949. if (!limit) {
  14950. return [];
  14951. }
  14952. string = toString(string);
  14953. if (string && (
  14954. typeof separator == 'string' ||
  14955. (separator != null && !isRegExp(separator))
  14956. )) {
  14957. separator = baseToString(separator);
  14958. if (!separator && hasUnicode(string)) {
  14959. return castSlice(stringToArray(string), 0, limit);
  14960. }
  14961. }
  14962. return string.split(separator, limit);
  14963. }
  14964. /**
  14965. * Converts `string` to
  14966. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14967. *
  14968. * @static
  14969. * @memberOf _
  14970. * @since 3.1.0
  14971. * @category String
  14972. * @param {string} [string=''] The string to convert.
  14973. * @returns {string} Returns the start cased string.
  14974. * @example
  14975. *
  14976. * _.startCase('--foo-bar--');
  14977. * // => 'Foo Bar'
  14978. *
  14979. * _.startCase('fooBar');
  14980. * // => 'Foo Bar'
  14981. *
  14982. * _.startCase('__FOO_BAR__');
  14983. * // => 'FOO BAR'
  14984. */
  14985. var startCase = createCompounder(function(result, word, index) {
  14986. return result + (index ? ' ' : '') + upperFirst(word);
  14987. });
  14988. /**
  14989. * Checks if `string` starts with the given target string.
  14990. *
  14991. * @static
  14992. * @memberOf _
  14993. * @since 3.0.0
  14994. * @category String
  14995. * @param {string} [string=''] The string to inspect.
  14996. * @param {string} [target] The string to search for.
  14997. * @param {number} [position=0] The position to search from.
  14998. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14999. * else `false`.
  15000. * @example
  15001. *
  15002. * _.startsWith('abc', 'a');
  15003. * // => true
  15004. *
  15005. * _.startsWith('abc', 'b');
  15006. * // => false
  15007. *
  15008. * _.startsWith('abc', 'b', 1);
  15009. * // => true
  15010. */
  15011. function startsWith(string, target, position) {
  15012. string = toString(string);
  15013. position = position == null
  15014. ? 0
  15015. : baseClamp(toInteger(position), 0, string.length);
  15016. target = baseToString(target);
  15017. return string.slice(position, position + target.length) == target;
  15018. }
  15019. /**
  15020. * Creates a compiled template function that can interpolate data properties
  15021. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15022. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15023. * properties may be accessed as free variables in the template. If a setting
  15024. * object is given, it takes precedence over `_.templateSettings` values.
  15025. *
  15026. * **Note:** In the development build `_.template` utilizes
  15027. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15028. * for easier debugging.
  15029. *
  15030. * For more information on precompiling templates see
  15031. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15032. *
  15033. * For more information on Chrome extension sandboxes see
  15034. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15035. *
  15036. * @static
  15037. * @since 0.1.0
  15038. * @memberOf _
  15039. * @category String
  15040. * @param {string} [string=''] The template string.
  15041. * @param {Object} [options={}] The options object.
  15042. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15043. * The HTML "escape" delimiter.
  15044. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15045. * The "evaluate" delimiter.
  15046. * @param {Object} [options.imports=_.templateSettings.imports]
  15047. * An object to import into the template as free variables.
  15048. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15049. * The "interpolate" delimiter.
  15050. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15051. * The sourceURL of the compiled template.
  15052. * @param {string} [options.variable='obj']
  15053. * The data object variable name.
  15054. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15055. * @returns {Function} Returns the compiled template function.
  15056. * @example
  15057. *
  15058. * // Use the "interpolate" delimiter to create a compiled template.
  15059. * var compiled = _.template('hello <%= user %>!');
  15060. * compiled({ 'user': 'fred' });
  15061. * // => 'hello fred!'
  15062. *
  15063. * // Use the HTML "escape" delimiter to escape data property values.
  15064. * var compiled = _.template('<b><%- value %></b>');
  15065. * compiled({ 'value': '<script>' });
  15066. * // => '<b>&lt;script&gt;</b>'
  15067. *
  15068. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15069. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15070. * compiled({ 'users': ['fred', 'barney'] });
  15071. * // => '<li>fred</li><li>barney</li>'
  15072. *
  15073. * // Use the internal `print` function in "evaluate" delimiters.
  15074. * var compiled = _.template('<% print("hello " + user); %>!');
  15075. * compiled({ 'user': 'barney' });
  15076. * // => 'hello barney!'
  15077. *
  15078. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15079. * // Disable support by replacing the "interpolate" delimiter.
  15080. * var compiled = _.template('hello ${ user }!');
  15081. * compiled({ 'user': 'pebbles' });
  15082. * // => 'hello pebbles!'
  15083. *
  15084. * // Use backslashes to treat delimiters as plain text.
  15085. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15086. * compiled({ 'value': 'ignored' });
  15087. * // => '<%- value %>'
  15088. *
  15089. * // Use the `imports` option to import `jQuery` as `jq`.
  15090. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15091. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15092. * compiled({ 'users': ['fred', 'barney'] });
  15093. * // => '<li>fred</li><li>barney</li>'
  15094. *
  15095. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15096. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15097. * compiled(data);
  15098. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15099. *
  15100. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15101. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15102. * compiled.source;
  15103. * // => function(data) {
  15104. * // var __t, __p = '';
  15105. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15106. * // return __p;
  15107. * // }
  15108. *
  15109. * // Use custom template delimiters.
  15110. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15111. * var compiled = _.template('hello {{ user }}!');
  15112. * compiled({ 'user': 'mustache' });
  15113. * // => 'hello mustache!'
  15114. *
  15115. * // Use the `source` property to inline compiled templates for meaningful
  15116. * // line numbers in error messages and stack traces.
  15117. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15118. * var JST = {\
  15119. * "main": ' + _.template(mainText).source + '\
  15120. * };\
  15121. * ');
  15122. */
  15123. function template(string, options, guard) {
  15124. // Based on John Resig's `tmpl` implementation
  15125. // (http://ejohn.org/blog/javascript-micro-templating/)
  15126. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15127. var settings = lodash.templateSettings;
  15128. if (guard && isIterateeCall(string, options, guard)) {
  15129. options = undefined;
  15130. }
  15131. string = toString(string);
  15132. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15133. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15134. importsKeys = keys(imports),
  15135. importsValues = baseValues(imports, importsKeys);
  15136. var isEscaping,
  15137. isEvaluating,
  15138. index = 0,
  15139. interpolate = options.interpolate || reNoMatch,
  15140. source = "__p += '";
  15141. // Compile the regexp to match each delimiter.
  15142. var reDelimiters = RegExp(
  15143. (options.escape || reNoMatch).source + '|' +
  15144. interpolate.source + '|' +
  15145. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15146. (options.evaluate || reNoMatch).source + '|$'
  15147. , 'g');
  15148. // Use a sourceURL for easier debugging.
  15149. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15150. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15151. // and escape the comment, thus injecting code that gets evaled.
  15152. var sourceURL = '//# sourceURL=' +
  15153. (hasOwnProperty.call(options, 'sourceURL')
  15154. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15155. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15156. ) + '\n';
  15157. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15158. interpolateValue || (interpolateValue = esTemplateValue);
  15159. // Escape characters that can't be included in string literals.
  15160. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15161. // Replace delimiters with snippets.
  15162. if (escapeValue) {
  15163. isEscaping = true;
  15164. source += "' +\n__e(" + escapeValue + ") +\n'";
  15165. }
  15166. if (evaluateValue) {
  15167. isEvaluating = true;
  15168. source += "';\n" + evaluateValue + ";\n__p += '";
  15169. }
  15170. if (interpolateValue) {
  15171. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15172. }
  15173. index = offset + match.length;
  15174. // The JS engine embedded in Adobe products needs `match` returned in
  15175. // order to produce the correct `offset` value.
  15176. return match;
  15177. });
  15178. source += "';\n";
  15179. // If `variable` is not specified wrap a with-statement around the generated
  15180. // code to add the data object to the top of the scope chain.
  15181. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15182. if (!variable) {
  15183. source = 'with (obj) {\n' + source + '\n}\n';
  15184. }
  15185. // Throw an error if a forbidden character was found in `variable`, to prevent
  15186. // potential command injection attacks.
  15187. else if (reForbiddenIdentifierChars.test(variable)) {
  15188. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15189. }
  15190. // Cleanup code by stripping empty strings.
  15191. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15192. .replace(reEmptyStringMiddle, '$1')
  15193. .replace(reEmptyStringTrailing, '$1;');
  15194. // Frame code as the function body.
  15195. source = 'function(' + (variable || 'obj') + ') {\n' +
  15196. (variable
  15197. ? ''
  15198. : 'obj || (obj = {});\n'
  15199. ) +
  15200. "var __t, __p = ''" +
  15201. (isEscaping
  15202. ? ', __e = _.escape'
  15203. : ''
  15204. ) +
  15205. (isEvaluating
  15206. ? ', __j = Array.prototype.join;\n' +
  15207. "function print() { __p += __j.call(arguments, '') }\n"
  15208. : ';\n'
  15209. ) +
  15210. source +
  15211. 'return __p\n}';
  15212. var result = attempt(function() {
  15213. return Function(importsKeys, sourceURL + 'return ' + source)
  15214. .apply(undefined, importsValues);
  15215. });
  15216. // Provide the compiled function's source by its `toString` method or
  15217. // the `source` property as a convenience for inlining compiled templates.
  15218. result.source = source;
  15219. if (isError(result)) {
  15220. throw result;
  15221. }
  15222. return result;
  15223. }
  15224. /**
  15225. * Converts `string`, as a whole, to lower case just like
  15226. * [String#toLowerCase](https://mdn.io/toLowerCase).
  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 lower cased string.
  15234. * @example
  15235. *
  15236. * _.toLower('--Foo-Bar--');
  15237. * // => '--foo-bar--'
  15238. *
  15239. * _.toLower('fooBar');
  15240. * // => 'foobar'
  15241. *
  15242. * _.toLower('__FOO_BAR__');
  15243. * // => '__foo_bar__'
  15244. */
  15245. function toLower(value) {
  15246. return toString(value).toLowerCase();
  15247. }
  15248. /**
  15249. * Converts `string`, as a whole, to upper case just like
  15250. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15251. *
  15252. * @static
  15253. * @memberOf _
  15254. * @since 4.0.0
  15255. * @category String
  15256. * @param {string} [string=''] The string to convert.
  15257. * @returns {string} Returns the upper cased string.
  15258. * @example
  15259. *
  15260. * _.toUpper('--foo-bar--');
  15261. * // => '--FOO-BAR--'
  15262. *
  15263. * _.toUpper('fooBar');
  15264. * // => 'FOOBAR'
  15265. *
  15266. * _.toUpper('__foo_bar__');
  15267. * // => '__FOO_BAR__'
  15268. */
  15269. function toUpper(value) {
  15270. return toString(value).toUpperCase();
  15271. }
  15272. /**
  15273. * Removes leading and trailing whitespace or specified characters from `string`.
  15274. *
  15275. * @static
  15276. * @memberOf _
  15277. * @since 3.0.0
  15278. * @category String
  15279. * @param {string} [string=''] The string to trim.
  15280. * @param {string} [chars=whitespace] The characters to trim.
  15281. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15282. * @returns {string} Returns the trimmed string.
  15283. * @example
  15284. *
  15285. * _.trim(' abc ');
  15286. * // => 'abc'
  15287. *
  15288. * _.trim('-_-abc-_-', '_-');
  15289. * // => 'abc'
  15290. *
  15291. * _.map([' foo ', ' bar '], _.trim);
  15292. * // => ['foo', 'bar']
  15293. */
  15294. function trim(string, chars, guard) {
  15295. string = toString(string);
  15296. if (string && (guard || chars === undefined)) {
  15297. return baseTrim(string);
  15298. }
  15299. if (!string || !(chars = baseToString(chars))) {
  15300. return string;
  15301. }
  15302. var strSymbols = stringToArray(string),
  15303. chrSymbols = stringToArray(chars),
  15304. start = charsStartIndex(strSymbols, chrSymbols),
  15305. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15306. return castSlice(strSymbols, start, end).join('');
  15307. }
  15308. /**
  15309. * Removes trailing whitespace or specified characters from `string`.
  15310. *
  15311. * @static
  15312. * @memberOf _
  15313. * @since 4.0.0
  15314. * @category String
  15315. * @param {string} [string=''] The string to trim.
  15316. * @param {string} [chars=whitespace] The characters to trim.
  15317. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15318. * @returns {string} Returns the trimmed string.
  15319. * @example
  15320. *
  15321. * _.trimEnd(' abc ');
  15322. * // => ' abc'
  15323. *
  15324. * _.trimEnd('-_-abc-_-', '_-');
  15325. * // => '-_-abc'
  15326. */
  15327. function trimEnd(string, chars, guard) {
  15328. string = toString(string);
  15329. if (string && (guard || chars === undefined)) {
  15330. return string.slice(0, trimmedEndIndex(string) + 1);
  15331. }
  15332. if (!string || !(chars = baseToString(chars))) {
  15333. return string;
  15334. }
  15335. var strSymbols = stringToArray(string),
  15336. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15337. return castSlice(strSymbols, 0, end).join('');
  15338. }
  15339. /**
  15340. * Removes leading whitespace or specified characters from `string`.
  15341. *
  15342. * @static
  15343. * @memberOf _
  15344. * @since 4.0.0
  15345. * @category String
  15346. * @param {string} [string=''] The string to trim.
  15347. * @param {string} [chars=whitespace] The characters to trim.
  15348. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15349. * @returns {string} Returns the trimmed string.
  15350. * @example
  15351. *
  15352. * _.trimStart(' abc ');
  15353. * // => 'abc '
  15354. *
  15355. * _.trimStart('-_-abc-_-', '_-');
  15356. * // => 'abc-_-'
  15357. */
  15358. function trimStart(string, chars, guard) {
  15359. string = toString(string);
  15360. if (string && (guard || chars === undefined)) {
  15361. return string.replace(reTrimStart, '');
  15362. }
  15363. if (!string || !(chars = baseToString(chars))) {
  15364. return string;
  15365. }
  15366. var strSymbols = stringToArray(string),
  15367. start = charsStartIndex(strSymbols, stringToArray(chars));
  15368. return castSlice(strSymbols, start).join('');
  15369. }
  15370. /**
  15371. * Truncates `string` if it's longer than the given maximum string length.
  15372. * The last characters of the truncated string are replaced with the omission
  15373. * string which defaults to "...".
  15374. *
  15375. * @static
  15376. * @memberOf _
  15377. * @since 4.0.0
  15378. * @category String
  15379. * @param {string} [string=''] The string to truncate.
  15380. * @param {Object} [options={}] The options object.
  15381. * @param {number} [options.length=30] The maximum string length.
  15382. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15383. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15384. * @returns {string} Returns the truncated string.
  15385. * @example
  15386. *
  15387. * _.truncate('hi-diddly-ho there, neighborino');
  15388. * // => 'hi-diddly-ho there, neighbo...'
  15389. *
  15390. * _.truncate('hi-diddly-ho there, neighborino', {
  15391. * 'length': 24,
  15392. * 'separator': ' '
  15393. * });
  15394. * // => 'hi-diddly-ho there,...'
  15395. *
  15396. * _.truncate('hi-diddly-ho there, neighborino', {
  15397. * 'length': 24,
  15398. * 'separator': /,? +/
  15399. * });
  15400. * // => 'hi-diddly-ho there...'
  15401. *
  15402. * _.truncate('hi-diddly-ho there, neighborino', {
  15403. * 'omission': ' [...]'
  15404. * });
  15405. * // => 'hi-diddly-ho there, neig [...]'
  15406. */
  15407. function truncate(string, options) {
  15408. var length = DEFAULT_TRUNC_LENGTH,
  15409. omission = DEFAULT_TRUNC_OMISSION;
  15410. if (isObject(options)) {
  15411. var separator = 'separator' in options ? options.separator : separator;
  15412. length = 'length' in options ? toInteger(options.length) : length;
  15413. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15414. }
  15415. string = toString(string);
  15416. var strLength = string.length;
  15417. if (hasUnicode(string)) {
  15418. var strSymbols = stringToArray(string);
  15419. strLength = strSymbols.length;
  15420. }
  15421. if (length >= strLength) {
  15422. return string;
  15423. }
  15424. var end = length - stringSize(omission);
  15425. if (end < 1) {
  15426. return omission;
  15427. }
  15428. var result = strSymbols
  15429. ? castSlice(strSymbols, 0, end).join('')
  15430. : string.slice(0, end);
  15431. if (separator === undefined) {
  15432. return result + omission;
  15433. }
  15434. if (strSymbols) {
  15435. end += (result.length - end);
  15436. }
  15437. if (isRegExp(separator)) {
  15438. if (string.slice(end).search(separator)) {
  15439. var match,
  15440. substring = result;
  15441. if (!separator.global) {
  15442. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15443. }
  15444. separator.lastIndex = 0;
  15445. while ((match = separator.exec(substring))) {
  15446. var newEnd = match.index;
  15447. }
  15448. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15449. }
  15450. } else if (string.indexOf(baseToString(separator), end) != end) {
  15451. var index = result.lastIndexOf(separator);
  15452. if (index > -1) {
  15453. result = result.slice(0, index);
  15454. }
  15455. }
  15456. return result + omission;
  15457. }
  15458. /**
  15459. * The inverse of `_.escape`; this method converts the HTML entities
  15460. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15461. * their corresponding characters.
  15462. *
  15463. * **Note:** No other HTML entities are unescaped. To unescape additional
  15464. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15465. *
  15466. * @static
  15467. * @memberOf _
  15468. * @since 0.6.0
  15469. * @category String
  15470. * @param {string} [string=''] The string to unescape.
  15471. * @returns {string} Returns the unescaped string.
  15472. * @example
  15473. *
  15474. * _.unescape('fred, barney, &amp; pebbles');
  15475. * // => 'fred, barney, & pebbles'
  15476. */
  15477. function unescape(string) {
  15478. string = toString(string);
  15479. return (string && reHasEscapedHtml.test(string))
  15480. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15481. : string;
  15482. }
  15483. /**
  15484. * Converts `string`, as space separated words, to upper case.
  15485. *
  15486. * @static
  15487. * @memberOf _
  15488. * @since 4.0.0
  15489. * @category String
  15490. * @param {string} [string=''] The string to convert.
  15491. * @returns {string} Returns the upper cased string.
  15492. * @example
  15493. *
  15494. * _.upperCase('--foo-bar');
  15495. * // => 'FOO BAR'
  15496. *
  15497. * _.upperCase('fooBar');
  15498. * // => 'FOO BAR'
  15499. *
  15500. * _.upperCase('__foo_bar__');
  15501. * // => 'FOO BAR'
  15502. */
  15503. var upperCase = createCompounder(function(result, word, index) {
  15504. return result + (index ? ' ' : '') + word.toUpperCase();
  15505. });
  15506. /**
  15507. * Converts the first character of `string` to upper case.
  15508. *
  15509. * @static
  15510. * @memberOf _
  15511. * @since 4.0.0
  15512. * @category String
  15513. * @param {string} [string=''] The string to convert.
  15514. * @returns {string} Returns the converted string.
  15515. * @example
  15516. *
  15517. * _.upperFirst('fred');
  15518. * // => 'Fred'
  15519. *
  15520. * _.upperFirst('FRED');
  15521. * // => 'FRED'
  15522. */
  15523. var upperFirst = createCaseFirst('toUpperCase');
  15524. /**
  15525. * Splits `string` into an array of its words.
  15526. *
  15527. * @static
  15528. * @memberOf _
  15529. * @since 3.0.0
  15530. * @category String
  15531. * @param {string} [string=''] The string to inspect.
  15532. * @param {RegExp|string} [pattern] The pattern to match words.
  15533. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15534. * @returns {Array} Returns the words of `string`.
  15535. * @example
  15536. *
  15537. * _.words('fred, barney, & pebbles');
  15538. * // => ['fred', 'barney', 'pebbles']
  15539. *
  15540. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15541. * // => ['fred', 'barney', '&', 'pebbles']
  15542. */
  15543. function words(string, pattern, guard) {
  15544. string = toString(string);
  15545. pattern = guard ? undefined : pattern;
  15546. if (pattern === undefined) {
  15547. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15548. }
  15549. return string.match(pattern) || [];
  15550. }
  15551. /*------------------------------------------------------------------------*/
  15552. /**
  15553. * Attempts to invoke `func`, returning either the result or the caught error
  15554. * object. Any additional arguments are provided to `func` when it's invoked.
  15555. *
  15556. * @static
  15557. * @memberOf _
  15558. * @since 3.0.0
  15559. * @category Util
  15560. * @param {Function} func The function to attempt.
  15561. * @param {...*} [args] The arguments to invoke `func` with.
  15562. * @returns {*} Returns the `func` result or error object.
  15563. * @example
  15564. *
  15565. * // Avoid throwing errors for invalid selectors.
  15566. * var elements = _.attempt(function(selector) {
  15567. * return document.querySelectorAll(selector);
  15568. * }, '>_>');
  15569. *
  15570. * if (_.isError(elements)) {
  15571. * elements = [];
  15572. * }
  15573. */
  15574. var attempt = baseRest(function(func, args) {
  15575. try {
  15576. return apply(func, undefined, args);
  15577. } catch (e) {
  15578. return isError(e) ? e : new Error(e);
  15579. }
  15580. });
  15581. /**
  15582. * Binds methods of an object to the object itself, overwriting the existing
  15583. * method.
  15584. *
  15585. * **Note:** This method doesn't set the "length" property of bound functions.
  15586. *
  15587. * @static
  15588. * @since 0.1.0
  15589. * @memberOf _
  15590. * @category Util
  15591. * @param {Object} object The object to bind and assign the bound methods to.
  15592. * @param {...(string|string[])} methodNames The object method names to bind.
  15593. * @returns {Object} Returns `object`.
  15594. * @example
  15595. *
  15596. * var view = {
  15597. * 'label': 'docs',
  15598. * 'click': function() {
  15599. * console.log('clicked ' + this.label);
  15600. * }
  15601. * };
  15602. *
  15603. * _.bindAll(view, ['click']);
  15604. * jQuery(element).on('click', view.click);
  15605. * // => Logs 'clicked docs' when clicked.
  15606. */
  15607. var bindAll = flatRest(function(object, methodNames) {
  15608. arrayEach(methodNames, function(key) {
  15609. key = toKey(key);
  15610. baseAssignValue(object, key, bind(object[key], object));
  15611. });
  15612. return object;
  15613. });
  15614. /**
  15615. * Creates a function that iterates over `pairs` and invokes the corresponding
  15616. * function of the first predicate to return truthy. The predicate-function
  15617. * pairs are invoked with the `this` binding and arguments of the created
  15618. * function.
  15619. *
  15620. * @static
  15621. * @memberOf _
  15622. * @since 4.0.0
  15623. * @category Util
  15624. * @param {Array} pairs The predicate-function pairs.
  15625. * @returns {Function} Returns the new composite function.
  15626. * @example
  15627. *
  15628. * var func = _.cond([
  15629. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15630. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15631. * [_.stubTrue, _.constant('no match')]
  15632. * ]);
  15633. *
  15634. * func({ 'a': 1, 'b': 2 });
  15635. * // => 'matches A'
  15636. *
  15637. * func({ 'a': 0, 'b': 1 });
  15638. * // => 'matches B'
  15639. *
  15640. * func({ 'a': '1', 'b': '2' });
  15641. * // => 'no match'
  15642. */
  15643. function cond(pairs) {
  15644. var length = pairs == null ? 0 : pairs.length,
  15645. toIteratee = getIteratee();
  15646. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15647. if (typeof pair[1] != 'function') {
  15648. throw new TypeError(FUNC_ERROR_TEXT);
  15649. }
  15650. return [toIteratee(pair[0]), pair[1]];
  15651. });
  15652. return baseRest(function(args) {
  15653. var index = -1;
  15654. while (++index < length) {
  15655. var pair = pairs[index];
  15656. if (apply(pair[0], this, args)) {
  15657. return apply(pair[1], this, args);
  15658. }
  15659. }
  15660. });
  15661. }
  15662. /**
  15663. * Creates a function that invokes the predicate properties of `source` with
  15664. * the corresponding property values of a given object, returning `true` if
  15665. * all predicates return truthy, else `false`.
  15666. *
  15667. * **Note:** The created function is equivalent to `_.conformsTo` with
  15668. * `source` partially applied.
  15669. *
  15670. * @static
  15671. * @memberOf _
  15672. * @since 4.0.0
  15673. * @category Util
  15674. * @param {Object} source The object of property predicates to conform to.
  15675. * @returns {Function} Returns the new spec function.
  15676. * @example
  15677. *
  15678. * var objects = [
  15679. * { 'a': 2, 'b': 1 },
  15680. * { 'a': 1, 'b': 2 }
  15681. * ];
  15682. *
  15683. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15684. * // => [{ 'a': 1, 'b': 2 }]
  15685. */
  15686. function conforms(source) {
  15687. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15688. }
  15689. /**
  15690. * Creates a function that returns `value`.
  15691. *
  15692. * @static
  15693. * @memberOf _
  15694. * @since 2.4.0
  15695. * @category Util
  15696. * @param {*} value The value to return from the new function.
  15697. * @returns {Function} Returns the new constant function.
  15698. * @example
  15699. *
  15700. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15701. *
  15702. * console.log(objects);
  15703. * // => [{ 'a': 1 }, { 'a': 1 }]
  15704. *
  15705. * console.log(objects[0] === objects[1]);
  15706. * // => true
  15707. */
  15708. function constant(value) {
  15709. return function() {
  15710. return value;
  15711. };
  15712. }
  15713. /**
  15714. * Checks `value` to determine whether a default value should be returned in
  15715. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15716. * or `undefined`.
  15717. *
  15718. * @static
  15719. * @memberOf _
  15720. * @since 4.14.0
  15721. * @category Util
  15722. * @param {*} value The value to check.
  15723. * @param {*} defaultValue The default value.
  15724. * @returns {*} Returns the resolved value.
  15725. * @example
  15726. *
  15727. * _.defaultTo(1, 10);
  15728. * // => 1
  15729. *
  15730. * _.defaultTo(undefined, 10);
  15731. * // => 10
  15732. */
  15733. function defaultTo(value, defaultValue) {
  15734. return (value == null || value !== value) ? defaultValue : value;
  15735. }
  15736. /**
  15737. * Creates a function that returns the result of invoking the given functions
  15738. * with the `this` binding of the created function, where each successive
  15739. * invocation is supplied the return value of the previous.
  15740. *
  15741. * @static
  15742. * @memberOf _
  15743. * @since 3.0.0
  15744. * @category Util
  15745. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15746. * @returns {Function} Returns the new composite function.
  15747. * @see _.flowRight
  15748. * @example
  15749. *
  15750. * function square(n) {
  15751. * return n * n;
  15752. * }
  15753. *
  15754. * var addSquare = _.flow([_.add, square]);
  15755. * addSquare(1, 2);
  15756. * // => 9
  15757. */
  15758. var flow = createFlow();
  15759. /**
  15760. * This method is like `_.flow` except that it creates a function that
  15761. * invokes the given functions from right to left.
  15762. *
  15763. * @static
  15764. * @since 3.0.0
  15765. * @memberOf _
  15766. * @category Util
  15767. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15768. * @returns {Function} Returns the new composite function.
  15769. * @see _.flow
  15770. * @example
  15771. *
  15772. * function square(n) {
  15773. * return n * n;
  15774. * }
  15775. *
  15776. * var addSquare = _.flowRight([square, _.add]);
  15777. * addSquare(1, 2);
  15778. * // => 9
  15779. */
  15780. var flowRight = createFlow(true);
  15781. /**
  15782. * This method returns the first argument it receives.
  15783. *
  15784. * @static
  15785. * @since 0.1.0
  15786. * @memberOf _
  15787. * @category Util
  15788. * @param {*} value Any value.
  15789. * @returns {*} Returns `value`.
  15790. * @example
  15791. *
  15792. * var object = { 'a': 1 };
  15793. *
  15794. * console.log(_.identity(object) === object);
  15795. * // => true
  15796. */
  15797. function identity(value) {
  15798. return value;
  15799. }
  15800. /**
  15801. * Creates a function that invokes `func` with the arguments of the created
  15802. * function. If `func` is a property name, the created function returns the
  15803. * property value for a given element. If `func` is an array or object, the
  15804. * created function returns `true` for elements that contain the equivalent
  15805. * source properties, otherwise it returns `false`.
  15806. *
  15807. * @static
  15808. * @since 4.0.0
  15809. * @memberOf _
  15810. * @category Util
  15811. * @param {*} [func=_.identity] The value to convert to a callback.
  15812. * @returns {Function} Returns the callback.
  15813. * @example
  15814. *
  15815. * var users = [
  15816. * { 'user': 'barney', 'age': 36, 'active': true },
  15817. * { 'user': 'fred', 'age': 40, 'active': false }
  15818. * ];
  15819. *
  15820. * // The `_.matches` iteratee shorthand.
  15821. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15822. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15823. *
  15824. * // The `_.matchesProperty` iteratee shorthand.
  15825. * _.filter(users, _.iteratee(['user', 'fred']));
  15826. * // => [{ 'user': 'fred', 'age': 40 }]
  15827. *
  15828. * // The `_.property` iteratee shorthand.
  15829. * _.map(users, _.iteratee('user'));
  15830. * // => ['barney', 'fred']
  15831. *
  15832. * // Create custom iteratee shorthands.
  15833. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15834. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15835. * return func.test(string);
  15836. * };
  15837. * });
  15838. *
  15839. * _.filter(['abc', 'def'], /ef/);
  15840. * // => ['def']
  15841. */
  15842. function iteratee(func) {
  15843. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15844. }
  15845. /**
  15846. * Creates a function that performs a partial deep comparison between a given
  15847. * object and `source`, returning `true` if the given object has equivalent
  15848. * property values, else `false`.
  15849. *
  15850. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15851. * partially applied.
  15852. *
  15853. * Partial comparisons will match empty array and empty object `source`
  15854. * values against any array or object value, respectively. See `_.isEqual`
  15855. * for a list of supported value comparisons.
  15856. *
  15857. * **Note:** Multiple values can be checked by combining several matchers
  15858. * using `_.overSome`
  15859. *
  15860. * @static
  15861. * @memberOf _
  15862. * @since 3.0.0
  15863. * @category Util
  15864. * @param {Object} source The object of property values to match.
  15865. * @returns {Function} Returns the new spec function.
  15866. * @example
  15867. *
  15868. * var objects = [
  15869. * { 'a': 1, 'b': 2, 'c': 3 },
  15870. * { 'a': 4, 'b': 5, 'c': 6 }
  15871. * ];
  15872. *
  15873. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15874. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15875. *
  15876. * // Checking for several possible values
  15877. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15878. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15879. */
  15880. function matches(source) {
  15881. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15882. }
  15883. /**
  15884. * Creates a function that performs a partial deep comparison between the
  15885. * value at `path` of a given object to `srcValue`, returning `true` if the
  15886. * object value is equivalent, else `false`.
  15887. *
  15888. * **Note:** Partial comparisons will match empty array and empty object
  15889. * `srcValue` values against any array or object value, respectively. See
  15890. * `_.isEqual` for a list of supported value comparisons.
  15891. *
  15892. * **Note:** Multiple values can be checked by combining several matchers
  15893. * using `_.overSome`
  15894. *
  15895. * @static
  15896. * @memberOf _
  15897. * @since 3.2.0
  15898. * @category Util
  15899. * @param {Array|string} path The path of the property to get.
  15900. * @param {*} srcValue The value to match.
  15901. * @returns {Function} Returns the new spec function.
  15902. * @example
  15903. *
  15904. * var objects = [
  15905. * { 'a': 1, 'b': 2, 'c': 3 },
  15906. * { 'a': 4, 'b': 5, 'c': 6 }
  15907. * ];
  15908. *
  15909. * _.find(objects, _.matchesProperty('a', 4));
  15910. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15911. *
  15912. * // Checking for several possible values
  15913. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15914. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15915. */
  15916. function matchesProperty(path, srcValue) {
  15917. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15918. }
  15919. /**
  15920. * Creates a function that invokes the method at `path` of a given object.
  15921. * Any additional arguments are provided to the invoked method.
  15922. *
  15923. * @static
  15924. * @memberOf _
  15925. * @since 3.7.0
  15926. * @category Util
  15927. * @param {Array|string} path The path of the method to invoke.
  15928. * @param {...*} [args] The arguments to invoke the method with.
  15929. * @returns {Function} Returns the new invoker function.
  15930. * @example
  15931. *
  15932. * var objects = [
  15933. * { 'a': { 'b': _.constant(2) } },
  15934. * { 'a': { 'b': _.constant(1) } }
  15935. * ];
  15936. *
  15937. * _.map(objects, _.method('a.b'));
  15938. * // => [2, 1]
  15939. *
  15940. * _.map(objects, _.method(['a', 'b']));
  15941. * // => [2, 1]
  15942. */
  15943. var method = baseRest(function(path, args) {
  15944. return function(object) {
  15945. return baseInvoke(object, path, args);
  15946. };
  15947. });
  15948. /**
  15949. * The opposite of `_.method`; this method creates a function that invokes
  15950. * the method at a given path of `object`. Any additional arguments are
  15951. * provided to the invoked method.
  15952. *
  15953. * @static
  15954. * @memberOf _
  15955. * @since 3.7.0
  15956. * @category Util
  15957. * @param {Object} object The object to query.
  15958. * @param {...*} [args] The arguments to invoke the method with.
  15959. * @returns {Function} Returns the new invoker function.
  15960. * @example
  15961. *
  15962. * var array = _.times(3, _.constant),
  15963. * object = { 'a': array, 'b': array, 'c': array };
  15964. *
  15965. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15966. * // => [2, 0]
  15967. *
  15968. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15969. * // => [2, 0]
  15970. */
  15971. var methodOf = baseRest(function(object, args) {
  15972. return function(path) {
  15973. return baseInvoke(object, path, args);
  15974. };
  15975. });
  15976. /**
  15977. * Adds all own enumerable string keyed function properties of a source
  15978. * object to the destination object. If `object` is a function, then methods
  15979. * are added to its prototype as well.
  15980. *
  15981. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15982. * avoid conflicts caused by modifying the original.
  15983. *
  15984. * @static
  15985. * @since 0.1.0
  15986. * @memberOf _
  15987. * @category Util
  15988. * @param {Function|Object} [object=lodash] The destination object.
  15989. * @param {Object} source The object of functions to add.
  15990. * @param {Object} [options={}] The options object.
  15991. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15992. * @returns {Function|Object} Returns `object`.
  15993. * @example
  15994. *
  15995. * function vowels(string) {
  15996. * return _.filter(string, function(v) {
  15997. * return /[aeiou]/i.test(v);
  15998. * });
  15999. * }
  16000. *
  16001. * _.mixin({ 'vowels': vowels });
  16002. * _.vowels('fred');
  16003. * // => ['e']
  16004. *
  16005. * _('fred').vowels().value();
  16006. * // => ['e']
  16007. *
  16008. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16009. * _('fred').vowels();
  16010. * // => ['e']
  16011. */
  16012. function mixin(object, source, options) {
  16013. var props = keys(source),
  16014. methodNames = baseFunctions(source, props);
  16015. if (options == null &&
  16016. !(isObject(source) && (methodNames.length || !props.length))) {
  16017. options = source;
  16018. source = object;
  16019. object = this;
  16020. methodNames = baseFunctions(source, keys(source));
  16021. }
  16022. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16023. isFunc = isFunction(object);
  16024. arrayEach(methodNames, function(methodName) {
  16025. var func = source[methodName];
  16026. object[methodName] = func;
  16027. if (isFunc) {
  16028. object.prototype[methodName] = function() {
  16029. var chainAll = this.__chain__;
  16030. if (chain || chainAll) {
  16031. var result = object(this.__wrapped__),
  16032. actions = result.__actions__ = copyArray(this.__actions__);
  16033. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16034. result.__chain__ = chainAll;
  16035. return result;
  16036. }
  16037. return func.apply(object, arrayPush([this.value()], arguments));
  16038. };
  16039. }
  16040. });
  16041. return object;
  16042. }
  16043. /**
  16044. * Reverts the `_` variable to its previous value and returns a reference to
  16045. * the `lodash` function.
  16046. *
  16047. * @static
  16048. * @since 0.1.0
  16049. * @memberOf _
  16050. * @category Util
  16051. * @returns {Function} Returns the `lodash` function.
  16052. * @example
  16053. *
  16054. * var lodash = _.noConflict();
  16055. */
  16056. function noConflict() {
  16057. if (root._ === this) {
  16058. root._ = oldDash;
  16059. }
  16060. return this;
  16061. }
  16062. /**
  16063. * This method returns `undefined`.
  16064. *
  16065. * @static
  16066. * @memberOf _
  16067. * @since 2.3.0
  16068. * @category Util
  16069. * @example
  16070. *
  16071. * _.times(2, _.noop);
  16072. * // => [undefined, undefined]
  16073. */
  16074. function noop() {
  16075. // No operation performed.
  16076. }
  16077. /**
  16078. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16079. * the nth argument from the end is returned.
  16080. *
  16081. * @static
  16082. * @memberOf _
  16083. * @since 4.0.0
  16084. * @category Util
  16085. * @param {number} [n=0] The index of the argument to return.
  16086. * @returns {Function} Returns the new pass-thru function.
  16087. * @example
  16088. *
  16089. * var func = _.nthArg(1);
  16090. * func('a', 'b', 'c', 'd');
  16091. * // => 'b'
  16092. *
  16093. * var func = _.nthArg(-2);
  16094. * func('a', 'b', 'c', 'd');
  16095. * // => 'c'
  16096. */
  16097. function nthArg(n) {
  16098. n = toInteger(n);
  16099. return baseRest(function(args) {
  16100. return baseNth(args, n);
  16101. });
  16102. }
  16103. /**
  16104. * Creates a function that invokes `iteratees` with the arguments it receives
  16105. * and returns their results.
  16106. *
  16107. * @static
  16108. * @memberOf _
  16109. * @since 4.0.0
  16110. * @category Util
  16111. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16112. * The iteratees to invoke.
  16113. * @returns {Function} Returns the new function.
  16114. * @example
  16115. *
  16116. * var func = _.over([Math.max, Math.min]);
  16117. *
  16118. * func(1, 2, 3, 4);
  16119. * // => [4, 1]
  16120. */
  16121. var over = createOver(arrayMap);
  16122. /**
  16123. * Creates a function that checks if **all** of the `predicates` return
  16124. * truthy when invoked with the arguments it receives.
  16125. *
  16126. * Following shorthands are possible for providing predicates.
  16127. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16128. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16129. *
  16130. * @static
  16131. * @memberOf _
  16132. * @since 4.0.0
  16133. * @category Util
  16134. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16135. * The predicates to check.
  16136. * @returns {Function} Returns the new function.
  16137. * @example
  16138. *
  16139. * var func = _.overEvery([Boolean, isFinite]);
  16140. *
  16141. * func('1');
  16142. * // => true
  16143. *
  16144. * func(null);
  16145. * // => false
  16146. *
  16147. * func(NaN);
  16148. * // => false
  16149. */
  16150. var overEvery = createOver(arrayEvery);
  16151. /**
  16152. * Creates a function that checks if **any** of the `predicates` return
  16153. * truthy when invoked with the arguments it receives.
  16154. *
  16155. * Following shorthands are possible for providing predicates.
  16156. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16157. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16158. *
  16159. * @static
  16160. * @memberOf _
  16161. * @since 4.0.0
  16162. * @category Util
  16163. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16164. * The predicates to check.
  16165. * @returns {Function} Returns the new function.
  16166. * @example
  16167. *
  16168. * var func = _.overSome([Boolean, isFinite]);
  16169. *
  16170. * func('1');
  16171. * // => true
  16172. *
  16173. * func(null);
  16174. * // => true
  16175. *
  16176. * func(NaN);
  16177. * // => false
  16178. *
  16179. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16180. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16181. */
  16182. var overSome = createOver(arraySome);
  16183. /**
  16184. * Creates a function that returns the value at `path` of a given object.
  16185. *
  16186. * @static
  16187. * @memberOf _
  16188. * @since 2.4.0
  16189. * @category Util
  16190. * @param {Array|string} path The path of the property to get.
  16191. * @returns {Function} Returns the new accessor function.
  16192. * @example
  16193. *
  16194. * var objects = [
  16195. * { 'a': { 'b': 2 } },
  16196. * { 'a': { 'b': 1 } }
  16197. * ];
  16198. *
  16199. * _.map(objects, _.property('a.b'));
  16200. * // => [2, 1]
  16201. *
  16202. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16203. * // => [1, 2]
  16204. */
  16205. function property(path) {
  16206. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16207. }
  16208. /**
  16209. * The opposite of `_.property`; this method creates a function that returns
  16210. * the value at a given path of `object`.
  16211. *
  16212. * @static
  16213. * @memberOf _
  16214. * @since 3.0.0
  16215. * @category Util
  16216. * @param {Object} object The object to query.
  16217. * @returns {Function} Returns the new accessor function.
  16218. * @example
  16219. *
  16220. * var array = [0, 1, 2],
  16221. * object = { 'a': array, 'b': array, 'c': array };
  16222. *
  16223. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16224. * // => [2, 0]
  16225. *
  16226. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16227. * // => [2, 0]
  16228. */
  16229. function propertyOf(object) {
  16230. return function(path) {
  16231. return object == null ? undefined : baseGet(object, path);
  16232. };
  16233. }
  16234. /**
  16235. * Creates an array of numbers (positive and/or negative) progressing from
  16236. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16237. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16238. * it's set to `start` with `start` then set to `0`.
  16239. *
  16240. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16241. * floating-point values which can produce unexpected results.
  16242. *
  16243. * @static
  16244. * @since 0.1.0
  16245. * @memberOf _
  16246. * @category Util
  16247. * @param {number} [start=0] The start of the range.
  16248. * @param {number} end The end of the range.
  16249. * @param {number} [step=1] The value to increment or decrement by.
  16250. * @returns {Array} Returns the range of numbers.
  16251. * @see _.inRange, _.rangeRight
  16252. * @example
  16253. *
  16254. * _.range(4);
  16255. * // => [0, 1, 2, 3]
  16256. *
  16257. * _.range(-4);
  16258. * // => [0, -1, -2, -3]
  16259. *
  16260. * _.range(1, 5);
  16261. * // => [1, 2, 3, 4]
  16262. *
  16263. * _.range(0, 20, 5);
  16264. * // => [0, 5, 10, 15]
  16265. *
  16266. * _.range(0, -4, -1);
  16267. * // => [0, -1, -2, -3]
  16268. *
  16269. * _.range(1, 4, 0);
  16270. * // => [1, 1, 1]
  16271. *
  16272. * _.range(0);
  16273. * // => []
  16274. */
  16275. var range = createRange();
  16276. /**
  16277. * This method is like `_.range` except that it populates values in
  16278. * descending order.
  16279. *
  16280. * @static
  16281. * @memberOf _
  16282. * @since 4.0.0
  16283. * @category Util
  16284. * @param {number} [start=0] The start of the range.
  16285. * @param {number} end The end of the range.
  16286. * @param {number} [step=1] The value to increment or decrement by.
  16287. * @returns {Array} Returns the range of numbers.
  16288. * @see _.inRange, _.range
  16289. * @example
  16290. *
  16291. * _.rangeRight(4);
  16292. * // => [3, 2, 1, 0]
  16293. *
  16294. * _.rangeRight(-4);
  16295. * // => [-3, -2, -1, 0]
  16296. *
  16297. * _.rangeRight(1, 5);
  16298. * // => [4, 3, 2, 1]
  16299. *
  16300. * _.rangeRight(0, 20, 5);
  16301. * // => [15, 10, 5, 0]
  16302. *
  16303. * _.rangeRight(0, -4, -1);
  16304. * // => [-3, -2, -1, 0]
  16305. *
  16306. * _.rangeRight(1, 4, 0);
  16307. * // => [1, 1, 1]
  16308. *
  16309. * _.rangeRight(0);
  16310. * // => []
  16311. */
  16312. var rangeRight = createRange(true);
  16313. /**
  16314. * This method returns a new empty array.
  16315. *
  16316. * @static
  16317. * @memberOf _
  16318. * @since 4.13.0
  16319. * @category Util
  16320. * @returns {Array} Returns the new empty array.
  16321. * @example
  16322. *
  16323. * var arrays = _.times(2, _.stubArray);
  16324. *
  16325. * console.log(arrays);
  16326. * // => [[], []]
  16327. *
  16328. * console.log(arrays[0] === arrays[1]);
  16329. * // => false
  16330. */
  16331. function stubArray() {
  16332. return [];
  16333. }
  16334. /**
  16335. * This method returns `false`.
  16336. *
  16337. * @static
  16338. * @memberOf _
  16339. * @since 4.13.0
  16340. * @category Util
  16341. * @returns {boolean} Returns `false`.
  16342. * @example
  16343. *
  16344. * _.times(2, _.stubFalse);
  16345. * // => [false, false]
  16346. */
  16347. function stubFalse() {
  16348. return false;
  16349. }
  16350. /**
  16351. * This method returns a new empty object.
  16352. *
  16353. * @static
  16354. * @memberOf _
  16355. * @since 4.13.0
  16356. * @category Util
  16357. * @returns {Object} Returns the new empty object.
  16358. * @example
  16359. *
  16360. * var objects = _.times(2, _.stubObject);
  16361. *
  16362. * console.log(objects);
  16363. * // => [{}, {}]
  16364. *
  16365. * console.log(objects[0] === objects[1]);
  16366. * // => false
  16367. */
  16368. function stubObject() {
  16369. return {};
  16370. }
  16371. /**
  16372. * This method returns an empty string.
  16373. *
  16374. * @static
  16375. * @memberOf _
  16376. * @since 4.13.0
  16377. * @category Util
  16378. * @returns {string} Returns the empty string.
  16379. * @example
  16380. *
  16381. * _.times(2, _.stubString);
  16382. * // => ['', '']
  16383. */
  16384. function stubString() {
  16385. return '';
  16386. }
  16387. /**
  16388. * This method returns `true`.
  16389. *
  16390. * @static
  16391. * @memberOf _
  16392. * @since 4.13.0
  16393. * @category Util
  16394. * @returns {boolean} Returns `true`.
  16395. * @example
  16396. *
  16397. * _.times(2, _.stubTrue);
  16398. * // => [true, true]
  16399. */
  16400. function stubTrue() {
  16401. return true;
  16402. }
  16403. /**
  16404. * Invokes the iteratee `n` times, returning an array of the results of
  16405. * each invocation. The iteratee is invoked with one argument; (index).
  16406. *
  16407. * @static
  16408. * @since 0.1.0
  16409. * @memberOf _
  16410. * @category Util
  16411. * @param {number} n The number of times to invoke `iteratee`.
  16412. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16413. * @returns {Array} Returns the array of results.
  16414. * @example
  16415. *
  16416. * _.times(3, String);
  16417. * // => ['0', '1', '2']
  16418. *
  16419. * _.times(4, _.constant(0));
  16420. * // => [0, 0, 0, 0]
  16421. */
  16422. function times(n, iteratee) {
  16423. n = toInteger(n);
  16424. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16425. return [];
  16426. }
  16427. var index = MAX_ARRAY_LENGTH,
  16428. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16429. iteratee = getIteratee(iteratee);
  16430. n -= MAX_ARRAY_LENGTH;
  16431. var result = baseTimes(length, iteratee);
  16432. while (++index < n) {
  16433. iteratee(index);
  16434. }
  16435. return result;
  16436. }
  16437. /**
  16438. * Converts `value` to a property path array.
  16439. *
  16440. * @static
  16441. * @memberOf _
  16442. * @since 4.0.0
  16443. * @category Util
  16444. * @param {*} value The value to convert.
  16445. * @returns {Array} Returns the new property path array.
  16446. * @example
  16447. *
  16448. * _.toPath('a.b.c');
  16449. * // => ['a', 'b', 'c']
  16450. *
  16451. * _.toPath('a[0].b.c');
  16452. * // => ['a', '0', 'b', 'c']
  16453. */
  16454. function toPath(value) {
  16455. if (isArray(value)) {
  16456. return arrayMap(value, toKey);
  16457. }
  16458. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16459. }
  16460. /**
  16461. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16462. *
  16463. * @static
  16464. * @since 0.1.0
  16465. * @memberOf _
  16466. * @category Util
  16467. * @param {string} [prefix=''] The value to prefix the ID with.
  16468. * @returns {string} Returns the unique ID.
  16469. * @example
  16470. *
  16471. * _.uniqueId('contact_');
  16472. * // => 'contact_104'
  16473. *
  16474. * _.uniqueId();
  16475. * // => '105'
  16476. */
  16477. function uniqueId(prefix) {
  16478. var id = ++idCounter;
  16479. return toString(prefix) + id;
  16480. }
  16481. /*------------------------------------------------------------------------*/
  16482. /**
  16483. * Adds two numbers.
  16484. *
  16485. * @static
  16486. * @memberOf _
  16487. * @since 3.4.0
  16488. * @category Math
  16489. * @param {number} augend The first number in an addition.
  16490. * @param {number} addend The second number in an addition.
  16491. * @returns {number} Returns the total.
  16492. * @example
  16493. *
  16494. * _.add(6, 4);
  16495. * // => 10
  16496. */
  16497. var add = createMathOperation(function(augend, addend) {
  16498. return augend + addend;
  16499. }, 0);
  16500. /**
  16501. * Computes `number` rounded up to `precision`.
  16502. *
  16503. * @static
  16504. * @memberOf _
  16505. * @since 3.10.0
  16506. * @category Math
  16507. * @param {number} number The number to round up.
  16508. * @param {number} [precision=0] The precision to round up to.
  16509. * @returns {number} Returns the rounded up number.
  16510. * @example
  16511. *
  16512. * _.ceil(4.006);
  16513. * // => 5
  16514. *
  16515. * _.ceil(6.004, 2);
  16516. * // => 6.01
  16517. *
  16518. * _.ceil(6040, -2);
  16519. * // => 6100
  16520. */
  16521. var ceil = createRound('ceil');
  16522. /**
  16523. * Divide two numbers.
  16524. *
  16525. * @static
  16526. * @memberOf _
  16527. * @since 4.7.0
  16528. * @category Math
  16529. * @param {number} dividend The first number in a division.
  16530. * @param {number} divisor The second number in a division.
  16531. * @returns {number} Returns the quotient.
  16532. * @example
  16533. *
  16534. * _.divide(6, 4);
  16535. * // => 1.5
  16536. */
  16537. var divide = createMathOperation(function(dividend, divisor) {
  16538. return dividend / divisor;
  16539. }, 1);
  16540. /**
  16541. * Computes `number` rounded down to `precision`.
  16542. *
  16543. * @static
  16544. * @memberOf _
  16545. * @since 3.10.0
  16546. * @category Math
  16547. * @param {number} number The number to round down.
  16548. * @param {number} [precision=0] The precision to round down to.
  16549. * @returns {number} Returns the rounded down number.
  16550. * @example
  16551. *
  16552. * _.floor(4.006);
  16553. * // => 4
  16554. *
  16555. * _.floor(0.046, 2);
  16556. * // => 0.04
  16557. *
  16558. * _.floor(4060, -2);
  16559. * // => 4000
  16560. */
  16561. var floor = createRound('floor');
  16562. /**
  16563. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16564. * `undefined` is returned.
  16565. *
  16566. * @static
  16567. * @since 0.1.0
  16568. * @memberOf _
  16569. * @category Math
  16570. * @param {Array} array The array to iterate over.
  16571. * @returns {*} Returns the maximum value.
  16572. * @example
  16573. *
  16574. * _.max([4, 2, 8, 6]);
  16575. * // => 8
  16576. *
  16577. * _.max([]);
  16578. * // => undefined
  16579. */
  16580. function max(array) {
  16581. return (array && array.length)
  16582. ? baseExtremum(array, identity, baseGt)
  16583. : undefined;
  16584. }
  16585. /**
  16586. * This method is like `_.max` except that it accepts `iteratee` which is
  16587. * invoked for each element in `array` to generate the criterion by which
  16588. * the value is ranked. The iteratee is invoked with one argument: (value).
  16589. *
  16590. * @static
  16591. * @memberOf _
  16592. * @since 4.0.0
  16593. * @category Math
  16594. * @param {Array} array The array to iterate over.
  16595. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16596. * @returns {*} Returns the maximum value.
  16597. * @example
  16598. *
  16599. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16600. *
  16601. * _.maxBy(objects, function(o) { return o.n; });
  16602. * // => { 'n': 2 }
  16603. *
  16604. * // The `_.property` iteratee shorthand.
  16605. * _.maxBy(objects, 'n');
  16606. * // => { 'n': 2 }
  16607. */
  16608. function maxBy(array, iteratee) {
  16609. return (array && array.length)
  16610. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16611. : undefined;
  16612. }
  16613. /**
  16614. * Computes the mean of the values in `array`.
  16615. *
  16616. * @static
  16617. * @memberOf _
  16618. * @since 4.0.0
  16619. * @category Math
  16620. * @param {Array} array The array to iterate over.
  16621. * @returns {number} Returns the mean.
  16622. * @example
  16623. *
  16624. * _.mean([4, 2, 8, 6]);
  16625. * // => 5
  16626. */
  16627. function mean(array) {
  16628. return baseMean(array, identity);
  16629. }
  16630. /**
  16631. * This method is like `_.mean` except that it accepts `iteratee` which is
  16632. * invoked for each element in `array` to generate the value to be averaged.
  16633. * The iteratee is invoked with one argument: (value).
  16634. *
  16635. * @static
  16636. * @memberOf _
  16637. * @since 4.7.0
  16638. * @category Math
  16639. * @param {Array} array The array to iterate over.
  16640. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16641. * @returns {number} Returns the mean.
  16642. * @example
  16643. *
  16644. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16645. *
  16646. * _.meanBy(objects, function(o) { return o.n; });
  16647. * // => 5
  16648. *
  16649. * // The `_.property` iteratee shorthand.
  16650. * _.meanBy(objects, 'n');
  16651. * // => 5
  16652. */
  16653. function meanBy(array, iteratee) {
  16654. return baseMean(array, getIteratee(iteratee, 2));
  16655. }
  16656. /**
  16657. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16658. * `undefined` is returned.
  16659. *
  16660. * @static
  16661. * @since 0.1.0
  16662. * @memberOf _
  16663. * @category Math
  16664. * @param {Array} array The array to iterate over.
  16665. * @returns {*} Returns the minimum value.
  16666. * @example
  16667. *
  16668. * _.min([4, 2, 8, 6]);
  16669. * // => 2
  16670. *
  16671. * _.min([]);
  16672. * // => undefined
  16673. */
  16674. function min(array) {
  16675. return (array && array.length)
  16676. ? baseExtremum(array, identity, baseLt)
  16677. : undefined;
  16678. }
  16679. /**
  16680. * This method is like `_.min` except that it accepts `iteratee` which is
  16681. * invoked for each element in `array` to generate the criterion by which
  16682. * the value is ranked. The iteratee is invoked with one argument: (value).
  16683. *
  16684. * @static
  16685. * @memberOf _
  16686. * @since 4.0.0
  16687. * @category Math
  16688. * @param {Array} array The array to iterate over.
  16689. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16690. * @returns {*} Returns the minimum value.
  16691. * @example
  16692. *
  16693. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16694. *
  16695. * _.minBy(objects, function(o) { return o.n; });
  16696. * // => { 'n': 1 }
  16697. *
  16698. * // The `_.property` iteratee shorthand.
  16699. * _.minBy(objects, 'n');
  16700. * // => { 'n': 1 }
  16701. */
  16702. function minBy(array, iteratee) {
  16703. return (array && array.length)
  16704. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16705. : undefined;
  16706. }
  16707. /**
  16708. * Multiply two numbers.
  16709. *
  16710. * @static
  16711. * @memberOf _
  16712. * @since 4.7.0
  16713. * @category Math
  16714. * @param {number} multiplier The first number in a multiplication.
  16715. * @param {number} multiplicand The second number in a multiplication.
  16716. * @returns {number} Returns the product.
  16717. * @example
  16718. *
  16719. * _.multiply(6, 4);
  16720. * // => 24
  16721. */
  16722. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16723. return multiplier * multiplicand;
  16724. }, 1);
  16725. /**
  16726. * Computes `number` rounded to `precision`.
  16727. *
  16728. * @static
  16729. * @memberOf _
  16730. * @since 3.10.0
  16731. * @category Math
  16732. * @param {number} number The number to round.
  16733. * @param {number} [precision=0] The precision to round to.
  16734. * @returns {number} Returns the rounded number.
  16735. * @example
  16736. *
  16737. * _.round(4.006);
  16738. * // => 4
  16739. *
  16740. * _.round(4.006, 2);
  16741. * // => 4.01
  16742. *
  16743. * _.round(4060, -2);
  16744. * // => 4100
  16745. */
  16746. var round = createRound('round');
  16747. /**
  16748. * Subtract two numbers.
  16749. *
  16750. * @static
  16751. * @memberOf _
  16752. * @since 4.0.0
  16753. * @category Math
  16754. * @param {number} minuend The first number in a subtraction.
  16755. * @param {number} subtrahend The second number in a subtraction.
  16756. * @returns {number} Returns the difference.
  16757. * @example
  16758. *
  16759. * _.subtract(6, 4);
  16760. * // => 2
  16761. */
  16762. var subtract = createMathOperation(function(minuend, subtrahend) {
  16763. return minuend - subtrahend;
  16764. }, 0);
  16765. /**
  16766. * Computes the sum of the values in `array`.
  16767. *
  16768. * @static
  16769. * @memberOf _
  16770. * @since 3.4.0
  16771. * @category Math
  16772. * @param {Array} array The array to iterate over.
  16773. * @returns {number} Returns the sum.
  16774. * @example
  16775. *
  16776. * _.sum([4, 2, 8, 6]);
  16777. * // => 20
  16778. */
  16779. function sum(array) {
  16780. return (array && array.length)
  16781. ? baseSum(array, identity)
  16782. : 0;
  16783. }
  16784. /**
  16785. * This method is like `_.sum` except that it accepts `iteratee` which is
  16786. * invoked for each element in `array` to generate the value to be summed.
  16787. * The iteratee is invoked with one argument: (value).
  16788. *
  16789. * @static
  16790. * @memberOf _
  16791. * @since 4.0.0
  16792. * @category Math
  16793. * @param {Array} array The array to iterate over.
  16794. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16795. * @returns {number} Returns the sum.
  16796. * @example
  16797. *
  16798. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16799. *
  16800. * _.sumBy(objects, function(o) { return o.n; });
  16801. * // => 20
  16802. *
  16803. * // The `_.property` iteratee shorthand.
  16804. * _.sumBy(objects, 'n');
  16805. * // => 20
  16806. */
  16807. function sumBy(array, iteratee) {
  16808. return (array && array.length)
  16809. ? baseSum(array, getIteratee(iteratee, 2))
  16810. : 0;
  16811. }
  16812. /*------------------------------------------------------------------------*/
  16813. // Add methods that return wrapped values in chain sequences.
  16814. lodash.after = after;
  16815. lodash.ary = ary;
  16816. lodash.assign = assign;
  16817. lodash.assignIn = assignIn;
  16818. lodash.assignInWith = assignInWith;
  16819. lodash.assignWith = assignWith;
  16820. lodash.at = at;
  16821. lodash.before = before;
  16822. lodash.bind = bind;
  16823. lodash.bindAll = bindAll;
  16824. lodash.bindKey = bindKey;
  16825. lodash.castArray = castArray;
  16826. lodash.chain = chain;
  16827. lodash.chunk = chunk;
  16828. lodash.compact = compact;
  16829. lodash.concat = concat;
  16830. lodash.cond = cond;
  16831. lodash.conforms = conforms;
  16832. lodash.constant = constant;
  16833. lodash.countBy = countBy;
  16834. lodash.create = create;
  16835. lodash.curry = curry;
  16836. lodash.curryRight = curryRight;
  16837. lodash.debounce = debounce;
  16838. lodash.defaults = defaults;
  16839. lodash.defaultsDeep = defaultsDeep;
  16840. lodash.defer = defer;
  16841. lodash.delay = delay;
  16842. lodash.difference = difference;
  16843. lodash.differenceBy = differenceBy;
  16844. lodash.differenceWith = differenceWith;
  16845. lodash.drop = drop;
  16846. lodash.dropRight = dropRight;
  16847. lodash.dropRightWhile = dropRightWhile;
  16848. lodash.dropWhile = dropWhile;
  16849. lodash.fill = fill;
  16850. lodash.filter = filter;
  16851. lodash.flatMap = flatMap;
  16852. lodash.flatMapDeep = flatMapDeep;
  16853. lodash.flatMapDepth = flatMapDepth;
  16854. lodash.flatten = flatten;
  16855. lodash.flattenDeep = flattenDeep;
  16856. lodash.flattenDepth = flattenDepth;
  16857. lodash.flip = flip;
  16858. lodash.flow = flow;
  16859. lodash.flowRight = flowRight;
  16860. lodash.fromPairs = fromPairs;
  16861. lodash.functions = functions;
  16862. lodash.functionsIn = functionsIn;
  16863. lodash.groupBy = groupBy;
  16864. lodash.initial = initial;
  16865. lodash.intersection = intersection;
  16866. lodash.intersectionBy = intersectionBy;
  16867. lodash.intersectionWith = intersectionWith;
  16868. lodash.invert = invert;
  16869. lodash.invertBy = invertBy;
  16870. lodash.invokeMap = invokeMap;
  16871. lodash.iteratee = iteratee;
  16872. lodash.keyBy = keyBy;
  16873. lodash.keys = keys;
  16874. lodash.keysIn = keysIn;
  16875. lodash.map = map;
  16876. lodash.mapKeys = mapKeys;
  16877. lodash.mapValues = mapValues;
  16878. lodash.matches = matches;
  16879. lodash.matchesProperty = matchesProperty;
  16880. lodash.memoize = memoize;
  16881. lodash.merge = merge;
  16882. lodash.mergeWith = mergeWith;
  16883. lodash.method = method;
  16884. lodash.methodOf = methodOf;
  16885. lodash.mixin = mixin;
  16886. lodash.negate = negate;
  16887. lodash.nthArg = nthArg;
  16888. lodash.omit = omit;
  16889. lodash.omitBy = omitBy;
  16890. lodash.once = once;
  16891. lodash.orderBy = orderBy;
  16892. lodash.over = over;
  16893. lodash.overArgs = overArgs;
  16894. lodash.overEvery = overEvery;
  16895. lodash.overSome = overSome;
  16896. lodash.partial = partial;
  16897. lodash.partialRight = partialRight;
  16898. lodash.partition = partition;
  16899. lodash.pick = pick;
  16900. lodash.pickBy = pickBy;
  16901. lodash.property = property;
  16902. lodash.propertyOf = propertyOf;
  16903. lodash.pull = pull;
  16904. lodash.pullAll = pullAll;
  16905. lodash.pullAllBy = pullAllBy;
  16906. lodash.pullAllWith = pullAllWith;
  16907. lodash.pullAt = pullAt;
  16908. lodash.range = range;
  16909. lodash.rangeRight = rangeRight;
  16910. lodash.rearg = rearg;
  16911. lodash.reject = reject;
  16912. lodash.remove = remove;
  16913. lodash.rest = rest;
  16914. lodash.reverse = reverse;
  16915. lodash.sampleSize = sampleSize;
  16916. lodash.set = set;
  16917. lodash.setWith = setWith;
  16918. lodash.shuffle = shuffle;
  16919. lodash.slice = slice;
  16920. lodash.sortBy = sortBy;
  16921. lodash.sortedUniq = sortedUniq;
  16922. lodash.sortedUniqBy = sortedUniqBy;
  16923. lodash.split = split;
  16924. lodash.spread = spread;
  16925. lodash.tail = tail;
  16926. lodash.take = take;
  16927. lodash.takeRight = takeRight;
  16928. lodash.takeRightWhile = takeRightWhile;
  16929. lodash.takeWhile = takeWhile;
  16930. lodash.tap = tap;
  16931. lodash.throttle = throttle;
  16932. lodash.thru = thru;
  16933. lodash.toArray = toArray;
  16934. lodash.toPairs = toPairs;
  16935. lodash.toPairsIn = toPairsIn;
  16936. lodash.toPath = toPath;
  16937. lodash.toPlainObject = toPlainObject;
  16938. lodash.transform = transform;
  16939. lodash.unary = unary;
  16940. lodash.union = union;
  16941. lodash.unionBy = unionBy;
  16942. lodash.unionWith = unionWith;
  16943. lodash.uniq = uniq;
  16944. lodash.uniqBy = uniqBy;
  16945. lodash.uniqWith = uniqWith;
  16946. lodash.unset = unset;
  16947. lodash.unzip = unzip;
  16948. lodash.unzipWith = unzipWith;
  16949. lodash.update = update;
  16950. lodash.updateWith = updateWith;
  16951. lodash.values = values;
  16952. lodash.valuesIn = valuesIn;
  16953. lodash.without = without;
  16954. lodash.words = words;
  16955. lodash.wrap = wrap;
  16956. lodash.xor = xor;
  16957. lodash.xorBy = xorBy;
  16958. lodash.xorWith = xorWith;
  16959. lodash.zip = zip;
  16960. lodash.zipObject = zipObject;
  16961. lodash.zipObjectDeep = zipObjectDeep;
  16962. lodash.zipWith = zipWith;
  16963. // Add aliases.
  16964. lodash.entries = toPairs;
  16965. lodash.entriesIn = toPairsIn;
  16966. lodash.extend = assignIn;
  16967. lodash.extendWith = assignInWith;
  16968. // Add methods to `lodash.prototype`.
  16969. mixin(lodash, lodash);
  16970. /*------------------------------------------------------------------------*/
  16971. // Add methods that return unwrapped values in chain sequences.
  16972. lodash.add = add;
  16973. lodash.attempt = attempt;
  16974. lodash.camelCase = camelCase;
  16975. lodash.capitalize = capitalize;
  16976. lodash.ceil = ceil;
  16977. lodash.clamp = clamp;
  16978. lodash.clone = clone;
  16979. lodash.cloneDeep = cloneDeep;
  16980. lodash.cloneDeepWith = cloneDeepWith;
  16981. lodash.cloneWith = cloneWith;
  16982. lodash.conformsTo = conformsTo;
  16983. lodash.deburr = deburr;
  16984. lodash.defaultTo = defaultTo;
  16985. lodash.divide = divide;
  16986. lodash.endsWith = endsWith;
  16987. lodash.eq = eq;
  16988. lodash.escape = escape;
  16989. lodash.escapeRegExp = escapeRegExp;
  16990. lodash.every = every;
  16991. lodash.find = find;
  16992. lodash.findIndex = findIndex;
  16993. lodash.findKey = findKey;
  16994. lodash.findLast = findLast;
  16995. lodash.findLastIndex = findLastIndex;
  16996. lodash.findLastKey = findLastKey;
  16997. lodash.floor = floor;
  16998. lodash.forEach = forEach;
  16999. lodash.forEachRight = forEachRight;
  17000. lodash.forIn = forIn;
  17001. lodash.forInRight = forInRight;
  17002. lodash.forOwn = forOwn;
  17003. lodash.forOwnRight = forOwnRight;
  17004. lodash.get = get;
  17005. lodash.gt = gt;
  17006. lodash.gte = gte;
  17007. lodash.has = has;
  17008. lodash.hasIn = hasIn;
  17009. lodash.head = head;
  17010. lodash.identity = identity;
  17011. lodash.includes = includes;
  17012. lodash.indexOf = indexOf;
  17013. lodash.inRange = inRange;
  17014. lodash.invoke = invoke;
  17015. lodash.isArguments = isArguments;
  17016. lodash.isArray = isArray;
  17017. lodash.isArrayBuffer = isArrayBuffer;
  17018. lodash.isArrayLike = isArrayLike;
  17019. lodash.isArrayLikeObject = isArrayLikeObject;
  17020. lodash.isBoolean = isBoolean;
  17021. lodash.isBuffer = isBuffer;
  17022. lodash.isDate = isDate;
  17023. lodash.isElement = isElement;
  17024. lodash.isEmpty = isEmpty;
  17025. lodash.isEqual = isEqual;
  17026. lodash.isEqualWith = isEqualWith;
  17027. lodash.isError = isError;
  17028. lodash.isFinite = isFinite;
  17029. lodash.isFunction = isFunction;
  17030. lodash.isInteger = isInteger;
  17031. lodash.isLength = isLength;
  17032. lodash.isMap = isMap;
  17033. lodash.isMatch = isMatch;
  17034. lodash.isMatchWith = isMatchWith;
  17035. lodash.isNaN = isNaN;
  17036. lodash.isNative = isNative;
  17037. lodash.isNil = isNil;
  17038. lodash.isNull = isNull;
  17039. lodash.isNumber = isNumber;
  17040. lodash.isObject = isObject;
  17041. lodash.isObjectLike = isObjectLike;
  17042. lodash.isPlainObject = isPlainObject;
  17043. lodash.isRegExp = isRegExp;
  17044. lodash.isSafeInteger = isSafeInteger;
  17045. lodash.isSet = isSet;
  17046. lodash.isString = isString;
  17047. lodash.isSymbol = isSymbol;
  17048. lodash.isTypedArray = isTypedArray;
  17049. lodash.isUndefined = isUndefined;
  17050. lodash.isWeakMap = isWeakMap;
  17051. lodash.isWeakSet = isWeakSet;
  17052. lodash.join = join;
  17053. lodash.kebabCase = kebabCase;
  17054. lodash.last = last;
  17055. lodash.lastIndexOf = lastIndexOf;
  17056. lodash.lowerCase = lowerCase;
  17057. lodash.lowerFirst = lowerFirst;
  17058. lodash.lt = lt;
  17059. lodash.lte = lte;
  17060. lodash.max = max;
  17061. lodash.maxBy = maxBy;
  17062. lodash.mean = mean;
  17063. lodash.meanBy = meanBy;
  17064. lodash.min = min;
  17065. lodash.minBy = minBy;
  17066. lodash.stubArray = stubArray;
  17067. lodash.stubFalse = stubFalse;
  17068. lodash.stubObject = stubObject;
  17069. lodash.stubString = stubString;
  17070. lodash.stubTrue = stubTrue;
  17071. lodash.multiply = multiply;
  17072. lodash.nth = nth;
  17073. lodash.noConflict = noConflict;
  17074. lodash.noop = noop;
  17075. lodash.now = now;
  17076. lodash.pad = pad;
  17077. lodash.padEnd = padEnd;
  17078. lodash.padStart = padStart;
  17079. lodash.parseInt = parseInt;
  17080. lodash.random = random;
  17081. lodash.reduce = reduce;
  17082. lodash.reduceRight = reduceRight;
  17083. lodash.repeat = repeat;
  17084. lodash.replace = replace;
  17085. lodash.result = result;
  17086. lodash.round = round;
  17087. lodash.runInContext = runInContext;
  17088. lodash.sample = sample;
  17089. lodash.size = size;
  17090. lodash.snakeCase = snakeCase;
  17091. lodash.some = some;
  17092. lodash.sortedIndex = sortedIndex;
  17093. lodash.sortedIndexBy = sortedIndexBy;
  17094. lodash.sortedIndexOf = sortedIndexOf;
  17095. lodash.sortedLastIndex = sortedLastIndex;
  17096. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17097. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17098. lodash.startCase = startCase;
  17099. lodash.startsWith = startsWith;
  17100. lodash.subtract = subtract;
  17101. lodash.sum = sum;
  17102. lodash.sumBy = sumBy;
  17103. lodash.template = template;
  17104. lodash.times = times;
  17105. lodash.toFinite = toFinite;
  17106. lodash.toInteger = toInteger;
  17107. lodash.toLength = toLength;
  17108. lodash.toLower = toLower;
  17109. lodash.toNumber = toNumber;
  17110. lodash.toSafeInteger = toSafeInteger;
  17111. lodash.toString = toString;
  17112. lodash.toUpper = toUpper;
  17113. lodash.trim = trim;
  17114. lodash.trimEnd = trimEnd;
  17115. lodash.trimStart = trimStart;
  17116. lodash.truncate = truncate;
  17117. lodash.unescape = unescape;
  17118. lodash.uniqueId = uniqueId;
  17119. lodash.upperCase = upperCase;
  17120. lodash.upperFirst = upperFirst;
  17121. // Add aliases.
  17122. lodash.each = forEach;
  17123. lodash.eachRight = forEachRight;
  17124. lodash.first = head;
  17125. mixin(lodash, (function() {
  17126. var source = {};
  17127. baseForOwn(lodash, function(func, methodName) {
  17128. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17129. source[methodName] = func;
  17130. }
  17131. });
  17132. return source;
  17133. }()), { 'chain': false });
  17134. /*------------------------------------------------------------------------*/
  17135. /**
  17136. * The semantic version number.
  17137. *
  17138. * @static
  17139. * @memberOf _
  17140. * @type {string}
  17141. */
  17142. lodash.VERSION = VERSION;
  17143. // Assign default placeholders.
  17144. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17145. lodash[methodName].placeholder = lodash;
  17146. });
  17147. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17148. arrayEach(['drop', 'take'], function(methodName, index) {
  17149. LazyWrapper.prototype[methodName] = function(n) {
  17150. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17151. var result = (this.__filtered__ && !index)
  17152. ? new LazyWrapper(this)
  17153. : this.clone();
  17154. if (result.__filtered__) {
  17155. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17156. } else {
  17157. result.__views__.push({
  17158. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17159. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17160. });
  17161. }
  17162. return result;
  17163. };
  17164. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17165. return this.reverse()[methodName](n).reverse();
  17166. };
  17167. });
  17168. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17169. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17170. var type = index + 1,
  17171. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17172. LazyWrapper.prototype[methodName] = function(iteratee) {
  17173. var result = this.clone();
  17174. result.__iteratees__.push({
  17175. 'iteratee': getIteratee(iteratee, 3),
  17176. 'type': type
  17177. });
  17178. result.__filtered__ = result.__filtered__ || isFilter;
  17179. return result;
  17180. };
  17181. });
  17182. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17183. arrayEach(['head', 'last'], function(methodName, index) {
  17184. var takeName = 'take' + (index ? 'Right' : '');
  17185. LazyWrapper.prototype[methodName] = function() {
  17186. return this[takeName](1).value()[0];
  17187. };
  17188. });
  17189. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17190. arrayEach(['initial', 'tail'], function(methodName, index) {
  17191. var dropName = 'drop' + (index ? '' : 'Right');
  17192. LazyWrapper.prototype[methodName] = function() {
  17193. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17194. };
  17195. });
  17196. LazyWrapper.prototype.compact = function() {
  17197. return this.filter(identity);
  17198. };
  17199. LazyWrapper.prototype.find = function(predicate) {
  17200. return this.filter(predicate).head();
  17201. };
  17202. LazyWrapper.prototype.findLast = function(predicate) {
  17203. return this.reverse().find(predicate);
  17204. };
  17205. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17206. if (typeof path == 'function') {
  17207. return new LazyWrapper(this);
  17208. }
  17209. return this.map(function(value) {
  17210. return baseInvoke(value, path, args);
  17211. });
  17212. });
  17213. LazyWrapper.prototype.reject = function(predicate) {
  17214. return this.filter(negate(getIteratee(predicate)));
  17215. };
  17216. LazyWrapper.prototype.slice = function(start, end) {
  17217. start = toInteger(start);
  17218. var result = this;
  17219. if (result.__filtered__ && (start > 0 || end < 0)) {
  17220. return new LazyWrapper(result);
  17221. }
  17222. if (start < 0) {
  17223. result = result.takeRight(-start);
  17224. } else if (start) {
  17225. result = result.drop(start);
  17226. }
  17227. if (end !== undefined) {
  17228. end = toInteger(end);
  17229. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17230. }
  17231. return result;
  17232. };
  17233. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17234. return this.reverse().takeWhile(predicate).reverse();
  17235. };
  17236. LazyWrapper.prototype.toArray = function() {
  17237. return this.take(MAX_ARRAY_LENGTH);
  17238. };
  17239. // Add `LazyWrapper` methods to `lodash.prototype`.
  17240. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17241. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17242. isTaker = /^(?:head|last)$/.test(methodName),
  17243. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17244. retUnwrapped = isTaker || /^find/.test(methodName);
  17245. if (!lodashFunc) {
  17246. return;
  17247. }
  17248. lodash.prototype[methodName] = function() {
  17249. var value = this.__wrapped__,
  17250. args = isTaker ? [1] : arguments,
  17251. isLazy = value instanceof LazyWrapper,
  17252. iteratee = args[0],
  17253. useLazy = isLazy || isArray(value);
  17254. var interceptor = function(value) {
  17255. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17256. return (isTaker && chainAll) ? result[0] : result;
  17257. };
  17258. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17259. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17260. isLazy = useLazy = false;
  17261. }
  17262. var chainAll = this.__chain__,
  17263. isHybrid = !!this.__actions__.length,
  17264. isUnwrapped = retUnwrapped && !chainAll,
  17265. onlyLazy = isLazy && !isHybrid;
  17266. if (!retUnwrapped && useLazy) {
  17267. value = onlyLazy ? value : new LazyWrapper(this);
  17268. var result = func.apply(value, args);
  17269. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17270. return new LodashWrapper(result, chainAll);
  17271. }
  17272. if (isUnwrapped && onlyLazy) {
  17273. return func.apply(this, args);
  17274. }
  17275. result = this.thru(interceptor);
  17276. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17277. };
  17278. });
  17279. // Add `Array` methods to `lodash.prototype`.
  17280. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17281. var func = arrayProto[methodName],
  17282. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17283. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17284. lodash.prototype[methodName] = function() {
  17285. var args = arguments;
  17286. if (retUnwrapped && !this.__chain__) {
  17287. var value = this.value();
  17288. return func.apply(isArray(value) ? value : [], args);
  17289. }
  17290. return this[chainName](function(value) {
  17291. return func.apply(isArray(value) ? value : [], args);
  17292. });
  17293. };
  17294. });
  17295. // Map minified method names to their real names.
  17296. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17297. var lodashFunc = lodash[methodName];
  17298. if (lodashFunc) {
  17299. var key = lodashFunc.name + '';
  17300. if (!hasOwnProperty.call(realNames, key)) {
  17301. realNames[key] = [];
  17302. }
  17303. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17304. }
  17305. });
  17306. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17307. 'name': 'wrapper',
  17308. 'func': undefined
  17309. }];
  17310. // Add methods to `LazyWrapper`.
  17311. LazyWrapper.prototype.clone = lazyClone;
  17312. LazyWrapper.prototype.reverse = lazyReverse;
  17313. LazyWrapper.prototype.value = lazyValue;
  17314. // Add chain sequence methods to the `lodash` wrapper.
  17315. lodash.prototype.at = wrapperAt;
  17316. lodash.prototype.chain = wrapperChain;
  17317. lodash.prototype.commit = wrapperCommit;
  17318. lodash.prototype.next = wrapperNext;
  17319. lodash.prototype.plant = wrapperPlant;
  17320. lodash.prototype.reverse = wrapperReverse;
  17321. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17322. // Add lazy aliases.
  17323. lodash.prototype.first = lodash.prototype.head;
  17324. if (symIterator) {
  17325. lodash.prototype[symIterator] = wrapperToIterator;
  17326. }
  17327. return lodash;
  17328. });
  17329. /*--------------------------------------------------------------------------*/
  17330. // Export lodash.
  17331. var _ = runInContext();
  17332. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17333. if (true) {
  17334. // Expose Lodash on the global object to prevent errors when Lodash is
  17335. // loaded by a script tag in the presence of an AMD loader.
  17336. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17337. // Use `_.noConflict` to remove Lodash from the global object.
  17338. root._ = _;
  17339. // Define as an anonymous module so, through path mapping, it can be
  17340. // referenced as the "underscore" module.
  17341. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17342. return _;
  17343. }).call(exports, __webpack_require__, exports, module),
  17344. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17345. }
  17346. // Check for `exports` after `define` in case a build optimizer adds it.
  17347. else {}
  17348. }.call(this));
  17349. /***/ }),
  17350. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17351. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17352. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17353. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17354. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17355. "use strict";
  17356. __webpack_require__.r(__webpack_exports__);
  17357. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17358. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17359. /* harmony export */ });
  17360. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17361. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17362. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17363. var options = {};
  17364. options.insert = "head";
  17365. options.singleton = false;
  17366. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17367. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17368. /***/ }),
  17369. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17370. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17371. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17372. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17373. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17374. "use strict";
  17375. __webpack_require__.r(__webpack_exports__);
  17376. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17377. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17378. /* harmony export */ });
  17379. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17380. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17381. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17382. var options = {};
  17383. options.insert = "head";
  17384. options.singleton = false;
  17385. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17386. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17387. /***/ }),
  17388. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17389. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17390. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17391. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17392. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17393. "use strict";
  17394. __webpack_require__.r(__webpack_exports__);
  17395. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17396. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17397. /* harmony export */ });
  17398. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17399. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17400. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17401. var options = {};
  17402. options.insert = "head";
  17403. options.singleton = false;
  17404. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17405. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17406. /***/ }),
  17407. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17408. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17409. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17410. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17411. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17412. "use strict";
  17413. __webpack_require__.r(__webpack_exports__);
  17414. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17415. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17416. /* harmony export */ });
  17417. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17418. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17419. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17420. var options = {};
  17421. options.insert = "head";
  17422. options.singleton = false;
  17423. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17424. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17425. /***/ }),
  17426. /***/ "./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":
  17427. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17428. !*** ./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 ***!
  17429. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17430. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17431. "use strict";
  17432. __webpack_require__.r(__webpack_exports__);
  17433. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17434. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17435. /* harmony export */ });
  17436. /* 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");
  17437. /* 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__);
  17438. /* 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");
  17439. var options = {};
  17440. options.insert = "head";
  17441. options.singleton = false;
  17442. 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);
  17443. /* 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 || {});
  17444. /***/ }),
  17445. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17446. /*!******************************************************!*\
  17447. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17448. \******************************************************/
  17449. /***/ ((__unused_webpack_module, exports) => {
  17450. "use strict";
  17451. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17452. // runtime helper for setting properties on components
  17453. // in a tree-shakable way
  17454. exports["default"] = (sfc, props) => {
  17455. const target = sfc.__vccOpts || sfc;
  17456. for (const [key, val] of props) {
  17457. target[key] = val;
  17458. }
  17459. return target;
  17460. };
  17461. /***/ }),
  17462. /***/ "./resources/js/components/AppButtonLink.vue":
  17463. /*!***************************************************!*\
  17464. !*** ./resources/js/components/AppButtonLink.vue ***!
  17465. \***************************************************/
  17466. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17467. "use strict";
  17468. __webpack_require__.r(__webpack_exports__);
  17469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17470. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17471. /* harmony export */ });
  17472. /* harmony import */ var _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");
  17473. /* 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");
  17474. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17475. ;
  17476. 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"]])
  17477. /* hot reload */
  17478. if (false) {}
  17479. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17480. /***/ }),
  17481. /***/ "./resources/js/components/AppFooter.vue":
  17482. /*!***********************************************!*\
  17483. !*** ./resources/js/components/AppFooter.vue ***!
  17484. \***********************************************/
  17485. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17486. "use strict";
  17487. __webpack_require__.r(__webpack_exports__);
  17488. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17489. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17490. /* harmony export */ });
  17491. /* 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");
  17492. /* 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");
  17493. /* 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");
  17494. const script = {}
  17495. ;
  17496. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(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"]])
  17497. /* hot reload */
  17498. if (false) {}
  17499. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17500. /***/ }),
  17501. /***/ "./resources/js/components/AppMessage.vue":
  17502. /*!************************************************!*\
  17503. !*** ./resources/js/components/AppMessage.vue ***!
  17504. \************************************************/
  17505. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17506. "use strict";
  17507. __webpack_require__.r(__webpack_exports__);
  17508. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17509. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17510. /* harmony export */ });
  17511. /* harmony import */ var _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");
  17512. /* 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");
  17513. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17514. ;
  17515. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_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"]])
  17516. /* hot reload */
  17517. if (false) {}
  17518. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17519. /***/ }),
  17520. /***/ "./resources/js/components/AppPagination.vue":
  17521. /*!***************************************************!*\
  17522. !*** ./resources/js/components/AppPagination.vue ***!
  17523. \***************************************************/
  17524. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17525. "use strict";
  17526. __webpack_require__.r(__webpack_exports__);
  17527. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17528. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17529. /* harmony export */ });
  17530. /* harmony import */ var _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");
  17531. /* 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");
  17532. /* 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");
  17533. ;
  17534. 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"]])
  17535. /* hot reload */
  17536. if (false) {}
  17537. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17538. /***/ }),
  17539. /***/ "./resources/js/components/AppSidebar.vue":
  17540. /*!************************************************!*\
  17541. !*** ./resources/js/components/AppSidebar.vue ***!
  17542. \************************************************/
  17543. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17544. "use strict";
  17545. __webpack_require__.r(__webpack_exports__);
  17546. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17547. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17548. /* harmony export */ });
  17549. /* 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");
  17550. /* 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");
  17551. /* 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");
  17552. /* 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");
  17553. ;
  17554. 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"]])
  17555. /* hot reload */
  17556. if (false) {}
  17557. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17558. /***/ }),
  17559. /***/ "./resources/js/components/AppSubSidebar.vue":
  17560. /*!***************************************************!*\
  17561. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17562. \***************************************************/
  17563. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17564. "use strict";
  17565. __webpack_require__.r(__webpack_exports__);
  17566. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17567. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17568. /* harmony export */ });
  17569. /* 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");
  17570. /* 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");
  17571. /* 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");
  17572. /* 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");
  17573. ;
  17574. 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"]])
  17575. /* hot reload */
  17576. if (false) {}
  17577. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17578. /***/ }),
  17579. /***/ "./resources/js/components/AppTopBar.vue":
  17580. /*!***********************************************!*\
  17581. !*** ./resources/js/components/AppTopBar.vue ***!
  17582. \***********************************************/
  17583. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17584. "use strict";
  17585. __webpack_require__.r(__webpack_exports__);
  17586. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17587. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17588. /* harmony export */ });
  17589. /* 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");
  17590. /* 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");
  17591. /* 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");
  17592. /* 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");
  17593. ;
  17594. 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"]])
  17595. /* hot reload */
  17596. if (false) {}
  17597. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17598. /***/ }),
  17599. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17600. /*!**************************************************!*\
  17601. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17602. \**************************************************/
  17603. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17604. "use strict";
  17605. __webpack_require__.r(__webpack_exports__);
  17606. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17607. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17608. /* harmony export */ });
  17609. /* 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");
  17610. /* 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");
  17611. /* 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");
  17612. /* 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");
  17613. ;
  17614. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_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"]])
  17615. /* hot reload */
  17616. if (false) {}
  17617. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17618. /***/ }),
  17619. /***/ "./resources/js/pages/member/Index.vue":
  17620. /*!*********************************************!*\
  17621. !*** ./resources/js/pages/member/Index.vue ***!
  17622. \*********************************************/
  17623. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17624. "use strict";
  17625. __webpack_require__.r(__webpack_exports__);
  17626. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17627. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17628. /* harmony export */ });
  17629. /* 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");
  17630. /* 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");
  17631. /* 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");
  17632. ;
  17633. 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"]])
  17634. /* hot reload */
  17635. if (false) {}
  17636. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17637. /***/ }),
  17638. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17639. /*!**************************************************************************************!*\
  17640. !*** ./resources/js/components/AppButtonLink.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_AppButtonLink_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_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");
  17649. /***/ }),
  17650. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17651. /*!***********************************************************************************!*\
  17652. !*** ./resources/js/components/AppMessage.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_AppMessage_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_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");
  17661. /***/ }),
  17662. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17663. /*!**************************************************************************************!*\
  17664. !*** ./resources/js/components/AppPagination.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_AppPagination_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_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");
  17673. /***/ }),
  17674. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17675. /*!***********************************************************************************!*\
  17676. !*** ./resources/js/components/AppSidebar.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_AppSidebar_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_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");
  17685. /***/ }),
  17686. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17687. /*!**************************************************************************************!*\
  17688. !*** ./resources/js/components/AppSubSidebar.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_AppSubSidebar_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_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");
  17697. /***/ }),
  17698. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17699. /*!**********************************************************************************!*\
  17700. !*** ./resources/js/components/AppTopBar.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_AppTopBar_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_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");
  17709. /***/ }),
  17710. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17711. /*!*************************************************************************************!*\
  17712. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  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 */ "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"])
  17719. /* harmony export */ });
  17720. /* 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");
  17721. /***/ }),
  17722. /***/ "./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js":
  17723. /*!********************************************************************************!*\
  17724. !*** ./resources/js/pages/member/Index.vue?vue&type=script&setup=true&lang=js ***!
  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 */ "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"])
  17731. /* harmony export */ });
  17732. /* 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");
  17733. /***/ }),
  17734. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17735. /*!*********************************************************************************!*\
  17736. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  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_AppButtonLink_vue_vue_type_template_id_c3621f1c__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_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");
  17745. /***/ }),
  17746. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17747. /*!*****************************************************************************************!*\
  17748. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  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_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__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_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");
  17757. /***/ }),
  17758. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17759. /*!******************************************************************************!*\
  17760. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  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_AppMessage_vue_vue_type_template_id_07159051__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_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");
  17769. /***/ }),
  17770. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17771. /*!*********************************************************************************!*\
  17772. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  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_AppPagination_vue_vue_type_template_id_4da56ec0__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_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");
  17781. /***/ }),
  17782. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17783. /*!******************************************************************************************!*\
  17784. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&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_AppSidebar_vue_vue_type_template_id_22a4e926_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_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");
  17793. /***/ }),
  17794. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17795. /*!*********************************************************************************************!*\
  17796. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&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_AppSubSidebar_vue_vue_type_template_id_0addd9bc_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_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");
  17805. /***/ }),
  17806. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17807. /*!*****************************************************************************************!*\
  17808. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  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_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__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_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");
  17817. /***/ }),
  17818. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17819. /*!********************************************************************************************!*\
  17820. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17821. \********************************************************************************************/
  17822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17823. "use strict";
  17824. __webpack_require__.r(__webpack_exports__);
  17825. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17826. /* 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)
  17827. /* harmony export */ });
  17828. /* 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");
  17829. /***/ }),
  17830. /***/ "./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66":
  17831. /*!***************************************************************************!*\
  17832. !*** ./resources/js/pages/member/Index.vue?vue&type=template&id=7b0e4c66 ***!
  17833. \***************************************************************************/
  17834. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17835. "use strict";
  17836. __webpack_require__.r(__webpack_exports__);
  17837. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17838. /* 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)
  17839. /* harmony export */ });
  17840. /* 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");
  17841. /***/ }),
  17842. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17843. /*!********************************************************************************************************!*\
  17844. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17845. \********************************************************************************************************/
  17846. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17847. "use strict";
  17848. __webpack_require__.r(__webpack_exports__);
  17849. /* 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");
  17850. /***/ }),
  17851. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17852. /*!*********************************************************************************************************!*\
  17853. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17854. \*********************************************************************************************************/
  17855. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17856. "use strict";
  17857. __webpack_require__.r(__webpack_exports__);
  17858. /* 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");
  17859. /***/ }),
  17860. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17861. /*!************************************************************************************************************!*\
  17862. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17863. \************************************************************************************************************/
  17864. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17865. "use strict";
  17866. __webpack_require__.r(__webpack_exports__);
  17867. /* 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");
  17868. /***/ }),
  17869. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17870. /*!********************************************************************************************************!*\
  17871. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17872. \********************************************************************************************************/
  17873. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17874. "use strict";
  17875. __webpack_require__.r(__webpack_exports__);
  17876. /* 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");
  17877. /***/ }),
  17878. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17879. /*!***********************************************************************************************************!*\
  17880. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17881. \***********************************************************************************************************/
  17882. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17883. "use strict";
  17884. __webpack_require__.r(__webpack_exports__);
  17885. /* 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");
  17886. /***/ })
  17887. }]);