resources_js_pages_Customers_Index_vue.js 694KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Customers_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. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./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":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./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 ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./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":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./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 ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./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/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./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/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./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/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***************************************************************************************************************************************************************************************************************!*\
  326. !*** ./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/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***************************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Customers/config.js");
  335. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  336. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  337. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  338. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  339. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  340. __name: 'Index',
  341. props: {
  342. customers: Object,
  343. initialSearch: String
  344. },
  345. setup: function setup(__props, _ref) {
  346. var expose = _ref.expose;
  347. expose();
  348. var __returned__ = {
  349. indexTable: _config__WEBPACK_IMPORTED_MODULE_0__.indexTable,
  350. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  351. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  352. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  353. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_4__["default"]
  354. };
  355. Object.defineProperty(__returned__, '__isScriptSetup', {
  356. enumerable: false,
  357. value: true
  358. });
  359. return __returned__;
  360. }
  361. });
  362. /***/ }),
  363. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  364. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  365. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  366. \***********************************************************************************************************************************************************************************************************************************************************************************/
  367. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  368. "use strict";
  369. __webpack_require__.r(__webpack_exports__);
  370. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  371. /* harmony export */ "render": () => (/* binding */ render)
  372. /* harmony export */ });
  373. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  374. var _hoisted_1 = {
  375. key: 1,
  376. "class": "p-button-label"
  377. };
  378. var _hoisted_2 = {
  379. key: 1,
  380. "class": "p-button p-component"
  381. };
  382. var _hoisted_3 = {
  383. key: 1,
  384. "class": "p-button-label"
  385. };
  386. function render(_ctx, _cache, $props, $setup, $data, $options) {
  387. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  388. key: 0,
  389. "class": "p-button p-component",
  390. as: "button",
  391. type: "button"
  392. }, {
  393. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  394. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  395. key: 0,
  396. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  397. }, null, 2
  398. /* CLASS */
  399. )) : (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
  400. /* TEXT */
  401. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  402. }),
  403. _: 1
  404. /* STABLE */
  405. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  406. key: 0,
  407. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  408. }, null, 2
  409. /* CLASS */
  410. )) : (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_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  411. /* TEXT */
  412. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  413. }
  414. /***/ }),
  415. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  416. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  417. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  418. \********************************************************************************************************************************************************************************************************************************************************************************/
  419. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  420. "use strict";
  421. __webpack_require__.r(__webpack_exports__);
  422. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  423. /* harmony export */ "render": () => (/* binding */ render)
  424. /* harmony export */ });
  425. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  426. var _hoisted_1 = {
  427. key: 0
  428. };
  429. var _hoisted_2 = {
  430. key: 1
  431. };
  432. function render(_ctx, _cache, $props, $setup, $data, $options) {
  433. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  434. 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, {
  435. key: 0,
  436. severity: "success",
  437. onClose: $setup.onClose
  438. }, {
  439. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  440. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  441. /* TEXT */
  442. )];
  443. }),
  444. _: 1
  445. /* STABLE */
  446. })) : (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, {
  447. key: 1,
  448. severity: "error",
  449. onClose: $setup.onClose
  450. }, {
  451. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  452. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  453. /* TEXT */
  454. )];
  455. }),
  456. _: 1
  457. /* STABLE */
  458. })) : (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, {
  459. key: 2,
  460. severity: "error",
  461. onClose: $setup.onClose
  462. }, {
  463. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  464. 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
  465. /* TEXT */
  466. ))];
  467. }),
  468. _: 1
  469. /* STABLE */
  470. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  471. /* STABLE_FRAGMENT */
  472. );
  473. }
  474. /***/ }),
  475. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  476. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  477. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  478. \***********************************************************************************************************************************************************************************************************************************************************************************/
  479. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  480. "use strict";
  481. __webpack_require__.r(__webpack_exports__);
  482. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  483. /* harmony export */ "render": () => (/* binding */ render)
  484. /* harmony export */ });
  485. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  486. var _hoisted_1 = {
  487. key: 0,
  488. "class": "p-paginator p-component flex justify-content-start"
  489. };
  490. var _hoisted_2 = {
  491. "class": "p-paginator-pages"
  492. };
  493. var _hoisted_3 = ["innerHTML"];
  494. function render(_ctx, _cache, $props, $setup, $data, $options) {
  495. 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) {
  496. 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", {
  497. key: "link-".concat(key),
  498. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  499. 'p-disabled': link
  500. }]),
  501. innerHTML: link.label
  502. }, null, 10
  503. /* CLASS, PROPS */
  504. , _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"], {
  505. key: "link-".concat(key),
  506. href: link.url,
  507. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  508. 'p-highlight': link.active
  509. }, "p-paginator-page p-paginator-element p-link"]),
  510. innerHTML: link.label
  511. }, null, 8
  512. /* PROPS */
  513. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  514. /* STABLE_FRAGMENT */
  515. );
  516. }), 256
  517. /* UNKEYED_FRAGMENT */
  518. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  519. }
  520. /***/ }),
  521. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppSearch.vue?vue&type=template&id=5b9fdcce":
  522. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  523. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  524. \*******************************************************************************************************************************************************************************************************************************************************************************/
  525. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  526. "use strict";
  527. __webpack_require__.r(__webpack_exports__);
  528. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  529. /* harmony export */ "render": () => (/* binding */ render)
  530. /* harmony export */ });
  531. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  532. function render(_ctx, _cache, $props, $setup, $data, $options) {
  533. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  534. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  535. modelValue: $setup.search,
  536. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  537. return $setup.search = $event;
  538. })
  539. }, null, 8
  540. /* PROPS */
  541. , ["modelValue"]);
  542. }
  543. /***/ }),
  544. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  545. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  546. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  547. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  548. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  549. "use strict";
  550. __webpack_require__.r(__webpack_exports__);
  551. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  552. /* harmony export */ "render": () => (/* binding */ render)
  553. /* harmony export */ });
  554. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  555. var _hoisted_1 = {
  556. "class": "layout-footer"
  557. };
  558. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  559. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  560. href: "https://dijitalcode.com",
  561. target: "_blank",
  562. "class": "font-medium ml-2"
  563. }, " DijitalCODE ", -1
  564. /* HOISTED */
  565. );
  566. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  567. function render(_ctx, _cache) {
  568. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  569. }
  570. /***/ }),
  571. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  572. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  573. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  574. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  575. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  576. "use strict";
  577. __webpack_require__.r(__webpack_exports__);
  578. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  579. /* harmony export */ "render": () => (/* binding */ render)
  580. /* harmony export */ });
  581. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  582. function render(_ctx, _cache, $props, $setup, $data, $options) {
  583. 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["SubSidebar"], {
  584. "class": "layout-menu",
  585. items: $props.menu,
  586. root: true
  587. }, null, 8
  588. /* PROPS */
  589. , ["items"])]);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  593. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  595. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. var _withScopeId = function _withScopeId(n) {
  604. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  605. };
  606. var _hoisted_1 = {
  607. key: 0
  608. };
  609. var _hoisted_2 = ["aria-label"];
  610. var _hoisted_3 = ["aria-label"];
  611. function render(_ctx, _cache, $props, $setup, $data, $options) {
  612. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  613. 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) {
  614. 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", {
  615. key: i,
  616. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  617. 'layout-menuitem-category': $props.root
  618. }]),
  619. role: "none"
  620. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  621. key: 0
  622. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  623. "class": "layout-menuitem-root-text",
  624. "aria-label": item.label
  625. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  626. /* TEXT, PROPS */
  627. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  628. items: item.items
  629. }, null, 8
  630. /* PROPS */
  631. , ["items"])], 64
  632. /* STABLE_FRAGMENT */
  633. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  634. key: 1
  635. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  636. key: 0,
  637. role: "menuitem",
  638. href: item.to,
  639. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  640. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  641. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  642. }]),
  643. "aria-label": item.label
  644. }, {
  645. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  646. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  647. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  648. }, null, 2
  649. /* CLASS */
  650. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  651. /* TEXT */
  652. )];
  653. }),
  654. _: 2
  655. /* DYNAMIC */
  656. }, 1032
  657. /* PROPS, DYNAMIC_SLOTS */
  658. , ["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", {
  659. key: 1,
  660. href: "#",
  661. role: "menuitem",
  662. "aria-label": item.label
  663. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  664. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  665. }, null, 2
  666. /* CLASS */
  667. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  668. /* TEXT */
  669. )], 8
  670. /* PROPS */
  671. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  672. items: item.items
  673. }, null, 8
  674. /* PROPS */
  675. , ["items"])], 64
  676. /* STABLE_FRAGMENT */
  677. ))], 2
  678. /* CLASS */
  679. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  680. /* STABLE_FRAGMENT */
  681. );
  682. }), 256
  683. /* UNKEYED_FRAGMENT */
  684. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  685. }
  686. /***/ }),
  687. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  688. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  689. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  690. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  691. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  692. "use strict";
  693. __webpack_require__.r(__webpack_exports__);
  694. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  695. /* harmony export */ "render": () => (/* binding */ render)
  696. /* harmony export */ });
  697. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  698. var _withScopeId = function _withScopeId(n) {
  699. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  700. };
  701. var _hoisted_1 = {
  702. "class": "layout-topbar"
  703. };
  704. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  705. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  706. alt: "Brand Logo",
  707. src: "/images/logo.svg",
  708. "class": "md:mr-3"
  709. }, null, -1
  710. /* HOISTED */
  711. );
  712. });
  713. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  714. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  715. /* HOISTED */
  716. );
  717. });
  718. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  719. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  720. "class": "pi pi-bars"
  721. }, null, -1
  722. /* HOISTED */
  723. );
  724. });
  725. var _hoisted_5 = [_hoisted_4];
  726. var _hoisted_6 = {
  727. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  728. };
  729. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  730. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  731. "class": "pi pi-ellipsis-v"
  732. }, null, -1
  733. /* HOISTED */
  734. );
  735. });
  736. var _hoisted_8 = [_hoisted_7];
  737. var _hoisted_9 = {
  738. "class": "layout-topbar-menu hidden lg:flex origin-top"
  739. };
  740. var _hoisted_10 = {
  741. "class": "align-self-center"
  742. };
  743. var _hoisted_11 = {
  744. "class": "hidden lg:inline"
  745. };
  746. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  747. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  748. "class": "pi pi-user"
  749. }, null, -1
  750. /* HOISTED */
  751. );
  752. });
  753. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  754. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  755. /* HOISTED */
  756. );
  757. });
  758. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  759. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  760. "class": "pi pi-sign-out"
  761. }, null, -1
  762. /* HOISTED */
  763. );
  764. });
  765. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  766. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  767. /* HOISTED */
  768. );
  769. });
  770. function render(_ctx, _cache, $props, $setup, $data, $options) {
  771. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  772. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  773. 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"], {
  774. href: "/",
  775. "class": "layout-topbar-logo"
  776. }, {
  777. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  778. return [_hoisted_2, _hoisted_3];
  779. }),
  780. _: 1
  781. /* STABLE */
  782. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  783. "class": "p-link layout-menu-button layout-topbar-button",
  784. onClick: _cache[0] || (_cache[0] = function ($event) {
  785. return _ctx.$emit('menu-toggle', $event);
  786. })
  787. }, _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, {
  788. selector: '@next',
  789. enterClass: 'hidden',
  790. enterActiveClass: 'scalein',
  791. leaveToClass: 'hidden',
  792. leaveActiveClass: 'fadeout',
  793. hideOnOutsideClick: true
  794. }]]), (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
  795. /* TEXT */
  796. )]), (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"], {
  797. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  798. "class": "p-link layout-topbar-button"
  799. }, {
  800. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  801. return [_hoisted_12, _hoisted_13];
  802. }),
  803. _: 1
  804. /* STABLE */
  805. }, 8
  806. /* PROPS */
  807. , ["href"])), [[_directive_tooltip, {
  808. value: 'Ubah Profil',
  809. "class": 'layout-topbar-menu-tooltip'
  810. }, void 0, {
  811. bottom: true
  812. }]])]), (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"], {
  813. href: _ctx.route('logout'),
  814. as: "button",
  815. method: "post",
  816. "class": "p-link layout-topbar-button"
  817. }, {
  818. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  819. return [_hoisted_14, _hoisted_15];
  820. }),
  821. _: 1
  822. /* STABLE */
  823. }, 8
  824. /* PROPS */
  825. , ["href"])), [[_directive_tooltip, {
  826. value: 'Keluar',
  827. "class": 'layout-topbar-menu-tooltip'
  828. }, void 0, {
  829. bottom: true
  830. }]])])])]);
  831. }
  832. /***/ }),
  833. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  834. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  835. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  836. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  837. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  838. "use strict";
  839. __webpack_require__.r(__webpack_exports__);
  840. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  841. /* harmony export */ "render": () => (/* binding */ render)
  842. /* harmony export */ });
  843. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  844. var _withScopeId = function _withScopeId(n) {
  845. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  846. };
  847. var _hoisted_1 = {
  848. "class": "layout-sidebar"
  849. };
  850. var _hoisted_2 = {
  851. "class": "layout-main-container"
  852. };
  853. var _hoisted_3 = {
  854. "class": "layout-main"
  855. };
  856. var _hoisted_4 = {
  857. key: 0,
  858. "class": "layout-mask p-component-overlay"
  859. };
  860. function render(_ctx, _cache, $props, $setup, $data, $options) {
  861. 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"], {
  862. title: $props.title
  863. }, null, 8
  864. /* PROPS */
  865. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  866. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  867. onClick: $setup.onWrapperClick
  868. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  869. onMenuToggle: $setup.onMenuToggle
  870. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  871. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  872. }, null, 8
  873. /* PROPS */
  874. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _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["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  875. name: "layout-mask"
  876. }, {
  877. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  878. 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)];
  879. }),
  880. _: 1
  881. /* STABLE */
  882. })], 2
  883. /* CLASS */
  884. )], 64
  885. /* STABLE_FRAGMENT */
  886. );
  887. }
  888. /***/ }),
  889. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  890. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  891. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  892. \********************************************************************************************************************************************************************************************************************************************************************************/
  893. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  894. "use strict";
  895. __webpack_require__.r(__webpack_exports__);
  896. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  897. /* harmony export */ "render": () => (/* binding */ render)
  898. /* harmony export */ });
  899. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  900. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pelanggan", -1
  901. /* HOISTED */
  902. );
  903. var _hoisted_2 = {
  904. "class": "grid"
  905. };
  906. var _hoisted_3 = {
  907. "class": "col-12 md:col-8"
  908. };
  909. var _hoisted_4 = {
  910. "class": "flex align-items-center"
  911. };
  912. var _hoisted_5 = {
  913. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  914. };
  915. function render(_ctx, _cache, $props, $setup, $data, $options) {
  916. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  917. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  918. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  919. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], {
  920. title: "Daftar Pelanggan"
  921. }, {
  922. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  923. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  924. responsiveLayout: "scroll",
  925. columnResizeMode: "expand",
  926. value: $props.customers.data,
  927. rowHover: true,
  928. stripedRows: true
  929. }, {
  930. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  931. 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)($setup["AppSearch"], {
  932. "class": "w-full md:w-27rem",
  933. placeholder: "cari, contoh: tina, 08xx, 0x",
  934. url: "/customers",
  935. "initial-search": $props.initialSearch
  936. }, null, 8
  937. /* PROPS */
  938. , ["initial-search"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  939. label: "Tambah Pelanggan",
  940. icon: "pi pi-pencil",
  941. "class": "p-button-outlined",
  942. href: _ctx.route('customers.create')
  943. }, null, 8
  944. /* PROPS */
  945. , ["href"])])])];
  946. }),
  947. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  948. 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) {
  949. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  950. field: value.field,
  951. header: value.header,
  952. key: value.field
  953. }, null, 8
  954. /* PROPS */
  955. , ["field", "header"]);
  956. }), 128
  957. /* KEYED_FRAGMENT */
  958. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  959. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  960. var data = _ref.data;
  961. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. icon: "pi pi-pencil",
  963. "class": "p-button-icon-only p-button-rounded p-button-text",
  964. href: _ctx.route('customers.edit', data.id)
  965. }, null, 8
  966. /* PROPS */
  967. , ["href"]), [[_directive_tooltip, 'Ubah Pelanggan', void 0, {
  968. bottom: true
  969. }]])];
  970. }),
  971. _: 1
  972. /* STABLE */
  973. })];
  974. }),
  975. _: 1
  976. /* STABLE */
  977. }, 8
  978. /* PROPS */
  979. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  980. links: $props.customers.links
  981. }, null, 8
  982. /* PROPS */
  983. , ["links"])];
  984. }),
  985. _: 1
  986. /* STABLE */
  987. });
  988. }
  989. /***/ }),
  990. /***/ "./resources/js/pages/Customers/config.js":
  991. /*!************************************************!*\
  992. !*** ./resources/js/pages/Customers/config.js ***!
  993. \************************************************/
  994. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  995. "use strict";
  996. __webpack_require__.r(__webpack_exports__);
  997. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  998. /* harmony export */ "indexTable": () => (/* binding */ indexTable)
  999. /* harmony export */ });
  1000. var indexTable = [{
  1001. field: 'name',
  1002. header: 'Nama'
  1003. }, {
  1004. field: 'address',
  1005. header: 'Alamat'
  1006. }, {
  1007. field: 'phone',
  1008. header: 'No HP'
  1009. }, {
  1010. field: 'npwp',
  1011. header: 'NPWP'
  1012. }];
  1013. /***/ }),
  1014. /***/ "./resources/js/utils/menu.js":
  1015. /*!************************************!*\
  1016. !*** ./resources/js/utils/menu.js ***!
  1017. \************************************/
  1018. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1019. "use strict";
  1020. __webpack_require__.r(__webpack_exports__);
  1021. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1022. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1023. /* harmony export */ });
  1024. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1025. // Admin
  1026. 1: [{
  1027. label: 'Home',
  1028. items: [{
  1029. label: 'Dashboard',
  1030. icon: 'pi pi-chart-bar',
  1031. to: '/dashboards',
  1032. component: 'Dashboards/Index'
  1033. }]
  1034. }, {
  1035. label: 'Laporan',
  1036. items: []
  1037. }, {
  1038. label: 'Master',
  1039. items: [{
  1040. label: 'User',
  1041. icon: 'pi pi-user',
  1042. to: '/users',
  1043. component: 'Users/Index'
  1044. }]
  1045. }],
  1046. // Supervisor
  1047. 2: [{
  1048. label: 'Home',
  1049. items: [{
  1050. label: 'Dashboard',
  1051. icon: 'pi pi-chart-bar',
  1052. to: '/dashboards',
  1053. component: 'Dashboards/Index'
  1054. }]
  1055. }, {
  1056. label: 'Master',
  1057. items: [{
  1058. label: 'Pelanggan',
  1059. icon: 'pi pi-users',
  1060. to: '/customers',
  1061. component: 'Customers/Index'
  1062. }, {
  1063. label: 'Pembelian',
  1064. icon: 'pi pi-shopping-cart',
  1065. to: '/purchases',
  1066. component: 'Purchases/Index'
  1067. }, {
  1068. label: 'Penjualan',
  1069. icon: 'pi pi-tag',
  1070. to: '/sales',
  1071. component: 'Sales/Index'
  1072. }, {
  1073. label: 'Produk',
  1074. icon: 'pi pi-th-large',
  1075. to: '/products',
  1076. component: 'Products/Index'
  1077. }]
  1078. }],
  1079. // Operator
  1080. 3: [{
  1081. label: 'Home',
  1082. items: [{
  1083. label: 'Dashboard',
  1084. icon: 'pi pi-chart-bar',
  1085. to: '/dashboards',
  1086. component: 'Dashboards/Index'
  1087. }]
  1088. }, {
  1089. label: 'Master',
  1090. items: [{
  1091. label: 'Supplier',
  1092. icon: 'pi pi-shopping-cart',
  1093. to: '/suppliers',
  1094. component: 'Suppliers/Index'
  1095. }, {
  1096. label: 'Stok Barang',
  1097. icon: 'pi pi-box',
  1098. to: '/stock-products',
  1099. component: 'StockProducts/Index'
  1100. }]
  1101. }]
  1102. });
  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/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1105. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1106. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1107. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1108. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1109. "use strict";
  1110. __webpack_require__.r(__webpack_exports__);
  1111. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1112. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1113. /* harmony export */ });
  1114. /* 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");
  1115. /* 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__);
  1116. // Imports
  1117. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1118. // Module
  1119. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1120. // Exports
  1121. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1124. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1125. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1126. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1127. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1128. "use strict";
  1129. __webpack_require__.r(__webpack_exports__);
  1130. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1131. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1132. /* harmony export */ });
  1133. /* 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");
  1134. /* 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__);
  1135. // Imports
  1136. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1137. // Module
  1138. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\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-b1b23eb4] {\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-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]: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-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1139. // Exports
  1140. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  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/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1143. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1144. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1145. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1146. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1147. "use strict";
  1148. __webpack_require__.r(__webpack_exports__);
  1149. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1150. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1151. /* harmony export */ });
  1152. /* 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");
  1153. /* 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__);
  1154. // Imports
  1155. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1156. // Module
  1157. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\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-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]: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-0b7edbb0] {\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-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]: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-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\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-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\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-0b7edbb0] {\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-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1158. // Exports
  1159. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1160. /***/ }),
  1161. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  1162. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1163. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  1164. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1165. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1166. "use strict";
  1167. __webpack_require__.r(__webpack_exports__);
  1168. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1169. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1170. /* harmony export */ });
  1171. /* 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");
  1172. /* 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__);
  1173. // Imports
  1174. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1175. // Module
  1176. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-1d279fe2] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-1d279fe2] {\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-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\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}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\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-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1177. // Exports
  1178. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1179. /***/ }),
  1180. /***/ "./node_modules/lodash/lodash.js":
  1181. /*!***************************************!*\
  1182. !*** ./node_modules/lodash/lodash.js ***!
  1183. \***************************************/
  1184. /***/ (function(module, exports, __webpack_require__) {
  1185. /* module decorator */ module = __webpack_require__.nmd(module);
  1186. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1187. * @license
  1188. * Lodash <https://lodash.com/>
  1189. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1190. * Released under MIT license <https://lodash.com/license>
  1191. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1192. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1193. */
  1194. ;(function() {
  1195. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1196. var undefined;
  1197. /** Used as the semantic version number. */
  1198. var VERSION = '4.17.21';
  1199. /** Used as the size to enable large array optimizations. */
  1200. var LARGE_ARRAY_SIZE = 200;
  1201. /** Error message constants. */
  1202. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1203. FUNC_ERROR_TEXT = 'Expected a function',
  1204. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1205. /** Used to stand-in for `undefined` hash values. */
  1206. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1207. /** Used as the maximum memoize cache size. */
  1208. var MAX_MEMOIZE_SIZE = 500;
  1209. /** Used as the internal argument placeholder. */
  1210. var PLACEHOLDER = '__lodash_placeholder__';
  1211. /** Used to compose bitmasks for cloning. */
  1212. var CLONE_DEEP_FLAG = 1,
  1213. CLONE_FLAT_FLAG = 2,
  1214. CLONE_SYMBOLS_FLAG = 4;
  1215. /** Used to compose bitmasks for value comparisons. */
  1216. var COMPARE_PARTIAL_FLAG = 1,
  1217. COMPARE_UNORDERED_FLAG = 2;
  1218. /** Used to compose bitmasks for function metadata. */
  1219. var WRAP_BIND_FLAG = 1,
  1220. WRAP_BIND_KEY_FLAG = 2,
  1221. WRAP_CURRY_BOUND_FLAG = 4,
  1222. WRAP_CURRY_FLAG = 8,
  1223. WRAP_CURRY_RIGHT_FLAG = 16,
  1224. WRAP_PARTIAL_FLAG = 32,
  1225. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1226. WRAP_ARY_FLAG = 128,
  1227. WRAP_REARG_FLAG = 256,
  1228. WRAP_FLIP_FLAG = 512;
  1229. /** Used as default options for `_.truncate`. */
  1230. var DEFAULT_TRUNC_LENGTH = 30,
  1231. DEFAULT_TRUNC_OMISSION = '...';
  1232. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1233. var HOT_COUNT = 800,
  1234. HOT_SPAN = 16;
  1235. /** Used to indicate the type of lazy iteratees. */
  1236. var LAZY_FILTER_FLAG = 1,
  1237. LAZY_MAP_FLAG = 2,
  1238. LAZY_WHILE_FLAG = 3;
  1239. /** Used as references for various `Number` constants. */
  1240. var INFINITY = 1 / 0,
  1241. MAX_SAFE_INTEGER = 9007199254740991,
  1242. MAX_INTEGER = 1.7976931348623157e+308,
  1243. NAN = 0 / 0;
  1244. /** Used as references for the maximum length and index of an array. */
  1245. var MAX_ARRAY_LENGTH = 4294967295,
  1246. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1247. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1248. /** Used to associate wrap methods with their bit flags. */
  1249. var wrapFlags = [
  1250. ['ary', WRAP_ARY_FLAG],
  1251. ['bind', WRAP_BIND_FLAG],
  1252. ['bindKey', WRAP_BIND_KEY_FLAG],
  1253. ['curry', WRAP_CURRY_FLAG],
  1254. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1255. ['flip', WRAP_FLIP_FLAG],
  1256. ['partial', WRAP_PARTIAL_FLAG],
  1257. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1258. ['rearg', WRAP_REARG_FLAG]
  1259. ];
  1260. /** `Object#toString` result references. */
  1261. var argsTag = '[object Arguments]',
  1262. arrayTag = '[object Array]',
  1263. asyncTag = '[object AsyncFunction]',
  1264. boolTag = '[object Boolean]',
  1265. dateTag = '[object Date]',
  1266. domExcTag = '[object DOMException]',
  1267. errorTag = '[object Error]',
  1268. funcTag = '[object Function]',
  1269. genTag = '[object GeneratorFunction]',
  1270. mapTag = '[object Map]',
  1271. numberTag = '[object Number]',
  1272. nullTag = '[object Null]',
  1273. objectTag = '[object Object]',
  1274. promiseTag = '[object Promise]',
  1275. proxyTag = '[object Proxy]',
  1276. regexpTag = '[object RegExp]',
  1277. setTag = '[object Set]',
  1278. stringTag = '[object String]',
  1279. symbolTag = '[object Symbol]',
  1280. undefinedTag = '[object Undefined]',
  1281. weakMapTag = '[object WeakMap]',
  1282. weakSetTag = '[object WeakSet]';
  1283. var arrayBufferTag = '[object ArrayBuffer]',
  1284. dataViewTag = '[object DataView]',
  1285. float32Tag = '[object Float32Array]',
  1286. float64Tag = '[object Float64Array]',
  1287. int8Tag = '[object Int8Array]',
  1288. int16Tag = '[object Int16Array]',
  1289. int32Tag = '[object Int32Array]',
  1290. uint8Tag = '[object Uint8Array]',
  1291. uint8ClampedTag = '[object Uint8ClampedArray]',
  1292. uint16Tag = '[object Uint16Array]',
  1293. uint32Tag = '[object Uint32Array]';
  1294. /** Used to match empty string literals in compiled template source. */
  1295. var reEmptyStringLeading = /\b__p \+= '';/g,
  1296. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1297. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1298. /** Used to match HTML entities and HTML characters. */
  1299. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1300. reUnescapedHtml = /[&<>"']/g,
  1301. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1302. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1303. /** Used to match template delimiters. */
  1304. var reEscape = /<%-([\s\S]+?)%>/g,
  1305. reEvaluate = /<%([\s\S]+?)%>/g,
  1306. reInterpolate = /<%=([\s\S]+?)%>/g;
  1307. /** Used to match property names within property paths. */
  1308. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1309. reIsPlainProp = /^\w*$/,
  1310. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1311. /**
  1312. * Used to match `RegExp`
  1313. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1314. */
  1315. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1316. reHasRegExpChar = RegExp(reRegExpChar.source);
  1317. /** Used to match leading whitespace. */
  1318. var reTrimStart = /^\s+/;
  1319. /** Used to match a single whitespace character. */
  1320. var reWhitespace = /\s/;
  1321. /** Used to match wrap detail comments. */
  1322. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1323. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1324. reSplitDetails = /,? & /;
  1325. /** Used to match words composed of alphanumeric characters. */
  1326. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1327. /**
  1328. * Used to validate the `validate` option in `_.template` variable.
  1329. *
  1330. * Forbids characters which could potentially change the meaning of the function argument definition:
  1331. * - "()," (modification of function parameters)
  1332. * - "=" (default value)
  1333. * - "[]{}" (destructuring of function parameters)
  1334. * - "/" (beginning of a comment)
  1335. * - whitespace
  1336. */
  1337. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1338. /** Used to match backslashes in property paths. */
  1339. var reEscapeChar = /\\(\\)?/g;
  1340. /**
  1341. * Used to match
  1342. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1343. */
  1344. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1345. /** Used to match `RegExp` flags from their coerced string values. */
  1346. var reFlags = /\w*$/;
  1347. /** Used to detect bad signed hexadecimal string values. */
  1348. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1349. /** Used to detect binary string values. */
  1350. var reIsBinary = /^0b[01]+$/i;
  1351. /** Used to detect host constructors (Safari). */
  1352. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1353. /** Used to detect octal string values. */
  1354. var reIsOctal = /^0o[0-7]+$/i;
  1355. /** Used to detect unsigned integer values. */
  1356. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1357. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1358. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1359. /** Used to ensure capturing order of template delimiters. */
  1360. var reNoMatch = /($^)/;
  1361. /** Used to match unescaped characters in compiled string literals. */
  1362. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1363. /** Used to compose unicode character classes. */
  1364. var rsAstralRange = '\\ud800-\\udfff',
  1365. rsComboMarksRange = '\\u0300-\\u036f',
  1366. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1367. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1368. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1369. rsDingbatRange = '\\u2700-\\u27bf',
  1370. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1371. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1372. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1373. rsPunctuationRange = '\\u2000-\\u206f',
  1374. 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',
  1375. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1376. rsVarRange = '\\ufe0e\\ufe0f',
  1377. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1378. /** Used to compose unicode capture groups. */
  1379. var rsApos = "['\u2019]",
  1380. rsAstral = '[' + rsAstralRange + ']',
  1381. rsBreak = '[' + rsBreakRange + ']',
  1382. rsCombo = '[' + rsComboRange + ']',
  1383. rsDigits = '\\d+',
  1384. rsDingbat = '[' + rsDingbatRange + ']',
  1385. rsLower = '[' + rsLowerRange + ']',
  1386. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1387. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1388. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1389. rsNonAstral = '[^' + rsAstralRange + ']',
  1390. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1391. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1392. rsUpper = '[' + rsUpperRange + ']',
  1393. rsZWJ = '\\u200d';
  1394. /** Used to compose unicode regexes. */
  1395. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1396. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1397. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1398. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1399. reOptMod = rsModifier + '?',
  1400. rsOptVar = '[' + rsVarRange + ']?',
  1401. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1402. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1403. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1404. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1405. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1406. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1407. /** Used to match apostrophes. */
  1408. var reApos = RegExp(rsApos, 'g');
  1409. /**
  1410. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1411. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1412. */
  1413. var reComboMark = RegExp(rsCombo, 'g');
  1414. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1415. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1416. /** Used to match complex or compound words. */
  1417. var reUnicodeWord = RegExp([
  1418. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1419. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1420. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1421. rsUpper + '+' + rsOptContrUpper,
  1422. rsOrdUpper,
  1423. rsOrdLower,
  1424. rsDigits,
  1425. rsEmoji
  1426. ].join('|'), 'g');
  1427. /** 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/). */
  1428. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1429. /** Used to detect strings that need a more robust regexp to match words. */
  1430. 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 ]/;
  1431. /** Used to assign default `context` object properties. */
  1432. var contextProps = [
  1433. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1434. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1435. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1436. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1437. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1438. ];
  1439. /** Used to make template sourceURLs easier to identify. */
  1440. var templateCounter = -1;
  1441. /** Used to identify `toStringTag` values of typed arrays. */
  1442. var typedArrayTags = {};
  1443. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1444. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1445. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1446. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1447. typedArrayTags[uint32Tag] = true;
  1448. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1449. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1450. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1451. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1452. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1453. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1454. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1455. typedArrayTags[weakMapTag] = false;
  1456. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1457. var cloneableTags = {};
  1458. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1459. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1460. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1461. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1462. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1463. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1464. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1465. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1466. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1467. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1468. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1469. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1470. cloneableTags[weakMapTag] = false;
  1471. /** Used to map Latin Unicode letters to basic Latin letters. */
  1472. var deburredLetters = {
  1473. // Latin-1 Supplement block.
  1474. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1475. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1476. '\xc7': 'C', '\xe7': 'c',
  1477. '\xd0': 'D', '\xf0': 'd',
  1478. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1479. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1480. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1481. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1482. '\xd1': 'N', '\xf1': 'n',
  1483. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1484. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1485. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1486. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1487. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1488. '\xc6': 'Ae', '\xe6': 'ae',
  1489. '\xde': 'Th', '\xfe': 'th',
  1490. '\xdf': 'ss',
  1491. // Latin Extended-A block.
  1492. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1493. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1494. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1495. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1496. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1497. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1498. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1499. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1500. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1501. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1502. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1503. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1504. '\u0134': 'J', '\u0135': 'j',
  1505. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1506. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1507. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1508. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1509. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1510. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1511. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1512. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1513. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1514. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1515. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1516. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1517. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1518. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1519. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1520. '\u0174': 'W', '\u0175': 'w',
  1521. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1522. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1523. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1524. '\u0132': 'IJ', '\u0133': 'ij',
  1525. '\u0152': 'Oe', '\u0153': 'oe',
  1526. '\u0149': "'n", '\u017f': 's'
  1527. };
  1528. /** Used to map characters to HTML entities. */
  1529. var htmlEscapes = {
  1530. '&': '&amp;',
  1531. '<': '&lt;',
  1532. '>': '&gt;',
  1533. '"': '&quot;',
  1534. "'": '&#39;'
  1535. };
  1536. /** Used to map HTML entities to characters. */
  1537. var htmlUnescapes = {
  1538. '&amp;': '&',
  1539. '&lt;': '<',
  1540. '&gt;': '>',
  1541. '&quot;': '"',
  1542. '&#39;': "'"
  1543. };
  1544. /** Used to escape characters for inclusion in compiled string literals. */
  1545. var stringEscapes = {
  1546. '\\': '\\',
  1547. "'": "'",
  1548. '\n': 'n',
  1549. '\r': 'r',
  1550. '\u2028': 'u2028',
  1551. '\u2029': 'u2029'
  1552. };
  1553. /** Built-in method references without a dependency on `root`. */
  1554. var freeParseFloat = parseFloat,
  1555. freeParseInt = parseInt;
  1556. /** Detect free variable `global` from Node.js. */
  1557. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1558. /** Detect free variable `self`. */
  1559. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1560. /** Used as a reference to the global object. */
  1561. var root = freeGlobal || freeSelf || Function('return this')();
  1562. /** Detect free variable `exports`. */
  1563. var freeExports = true && exports && !exports.nodeType && exports;
  1564. /** Detect free variable `module`. */
  1565. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1566. /** Detect the popular CommonJS extension `module.exports`. */
  1567. var moduleExports = freeModule && freeModule.exports === freeExports;
  1568. /** Detect free variable `process` from Node.js. */
  1569. var freeProcess = moduleExports && freeGlobal.process;
  1570. /** Used to access faster Node.js helpers. */
  1571. var nodeUtil = (function() {
  1572. try {
  1573. // Use `util.types` for Node.js 10+.
  1574. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1575. if (types) {
  1576. return types;
  1577. }
  1578. // Legacy `process.binding('util')` for Node.js < 10.
  1579. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1580. } catch (e) {}
  1581. }());
  1582. /* Node.js helper references. */
  1583. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1584. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1585. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1586. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1587. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1588. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1589. /*--------------------------------------------------------------------------*/
  1590. /**
  1591. * A faster alternative to `Function#apply`, this function invokes `func`
  1592. * with the `this` binding of `thisArg` and the arguments of `args`.
  1593. *
  1594. * @private
  1595. * @param {Function} func The function to invoke.
  1596. * @param {*} thisArg The `this` binding of `func`.
  1597. * @param {Array} args The arguments to invoke `func` with.
  1598. * @returns {*} Returns the result of `func`.
  1599. */
  1600. function apply(func, thisArg, args) {
  1601. switch (args.length) {
  1602. case 0: return func.call(thisArg);
  1603. case 1: return func.call(thisArg, args[0]);
  1604. case 2: return func.call(thisArg, args[0], args[1]);
  1605. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1606. }
  1607. return func.apply(thisArg, args);
  1608. }
  1609. /**
  1610. * A specialized version of `baseAggregator` for arrays.
  1611. *
  1612. * @private
  1613. * @param {Array} [array] The array to iterate over.
  1614. * @param {Function} setter The function to set `accumulator` values.
  1615. * @param {Function} iteratee The iteratee to transform keys.
  1616. * @param {Object} accumulator The initial aggregated object.
  1617. * @returns {Function} Returns `accumulator`.
  1618. */
  1619. function arrayAggregator(array, setter, iteratee, accumulator) {
  1620. var index = -1,
  1621. length = array == null ? 0 : array.length;
  1622. while (++index < length) {
  1623. var value = array[index];
  1624. setter(accumulator, value, iteratee(value), array);
  1625. }
  1626. return accumulator;
  1627. }
  1628. /**
  1629. * A specialized version of `_.forEach` for arrays without support for
  1630. * iteratee shorthands.
  1631. *
  1632. * @private
  1633. * @param {Array} [array] The array to iterate over.
  1634. * @param {Function} iteratee The function invoked per iteration.
  1635. * @returns {Array} Returns `array`.
  1636. */
  1637. function arrayEach(array, iteratee) {
  1638. var index = -1,
  1639. length = array == null ? 0 : array.length;
  1640. while (++index < length) {
  1641. if (iteratee(array[index], index, array) === false) {
  1642. break;
  1643. }
  1644. }
  1645. return array;
  1646. }
  1647. /**
  1648. * A specialized version of `_.forEachRight` for arrays without support for
  1649. * iteratee shorthands.
  1650. *
  1651. * @private
  1652. * @param {Array} [array] The array to iterate over.
  1653. * @param {Function} iteratee The function invoked per iteration.
  1654. * @returns {Array} Returns `array`.
  1655. */
  1656. function arrayEachRight(array, iteratee) {
  1657. var length = array == null ? 0 : array.length;
  1658. while (length--) {
  1659. if (iteratee(array[length], length, array) === false) {
  1660. break;
  1661. }
  1662. }
  1663. return array;
  1664. }
  1665. /**
  1666. * A specialized version of `_.every` for arrays without support for
  1667. * iteratee shorthands.
  1668. *
  1669. * @private
  1670. * @param {Array} [array] The array to iterate over.
  1671. * @param {Function} predicate The function invoked per iteration.
  1672. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1673. * else `false`.
  1674. */
  1675. function arrayEvery(array, predicate) {
  1676. var index = -1,
  1677. length = array == null ? 0 : array.length;
  1678. while (++index < length) {
  1679. if (!predicate(array[index], index, array)) {
  1680. return false;
  1681. }
  1682. }
  1683. return true;
  1684. }
  1685. /**
  1686. * A specialized version of `_.filter` for arrays without support for
  1687. * iteratee shorthands.
  1688. *
  1689. * @private
  1690. * @param {Array} [array] The array to iterate over.
  1691. * @param {Function} predicate The function invoked per iteration.
  1692. * @returns {Array} Returns the new filtered array.
  1693. */
  1694. function arrayFilter(array, predicate) {
  1695. var index = -1,
  1696. length = array == null ? 0 : array.length,
  1697. resIndex = 0,
  1698. result = [];
  1699. while (++index < length) {
  1700. var value = array[index];
  1701. if (predicate(value, index, array)) {
  1702. result[resIndex++] = value;
  1703. }
  1704. }
  1705. return result;
  1706. }
  1707. /**
  1708. * A specialized version of `_.includes` for arrays without support for
  1709. * specifying an index to search from.
  1710. *
  1711. * @private
  1712. * @param {Array} [array] The array to inspect.
  1713. * @param {*} target The value to search for.
  1714. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1715. */
  1716. function arrayIncludes(array, value) {
  1717. var length = array == null ? 0 : array.length;
  1718. return !!length && baseIndexOf(array, value, 0) > -1;
  1719. }
  1720. /**
  1721. * This function is like `arrayIncludes` except that it accepts a comparator.
  1722. *
  1723. * @private
  1724. * @param {Array} [array] The array to inspect.
  1725. * @param {*} target The value to search for.
  1726. * @param {Function} comparator The comparator invoked per element.
  1727. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1728. */
  1729. function arrayIncludesWith(array, value, comparator) {
  1730. var index = -1,
  1731. length = array == null ? 0 : array.length;
  1732. while (++index < length) {
  1733. if (comparator(value, array[index])) {
  1734. return true;
  1735. }
  1736. }
  1737. return false;
  1738. }
  1739. /**
  1740. * A specialized version of `_.map` for arrays without support for iteratee
  1741. * shorthands.
  1742. *
  1743. * @private
  1744. * @param {Array} [array] The array to iterate over.
  1745. * @param {Function} iteratee The function invoked per iteration.
  1746. * @returns {Array} Returns the new mapped array.
  1747. */
  1748. function arrayMap(array, iteratee) {
  1749. var index = -1,
  1750. length = array == null ? 0 : array.length,
  1751. result = Array(length);
  1752. while (++index < length) {
  1753. result[index] = iteratee(array[index], index, array);
  1754. }
  1755. return result;
  1756. }
  1757. /**
  1758. * Appends the elements of `values` to `array`.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to modify.
  1762. * @param {Array} values The values to append.
  1763. * @returns {Array} Returns `array`.
  1764. */
  1765. function arrayPush(array, values) {
  1766. var index = -1,
  1767. length = values.length,
  1768. offset = array.length;
  1769. while (++index < length) {
  1770. array[offset + index] = values[index];
  1771. }
  1772. return array;
  1773. }
  1774. /**
  1775. * A specialized version of `_.reduce` for arrays without support for
  1776. * iteratee shorthands.
  1777. *
  1778. * @private
  1779. * @param {Array} [array] The array to iterate over.
  1780. * @param {Function} iteratee The function invoked per iteration.
  1781. * @param {*} [accumulator] The initial value.
  1782. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1783. * the initial value.
  1784. * @returns {*} Returns the accumulated value.
  1785. */
  1786. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1787. var index = -1,
  1788. length = array == null ? 0 : array.length;
  1789. if (initAccum && length) {
  1790. accumulator = array[++index];
  1791. }
  1792. while (++index < length) {
  1793. accumulator = iteratee(accumulator, array[index], index, array);
  1794. }
  1795. return accumulator;
  1796. }
  1797. /**
  1798. * A specialized version of `_.reduceRight` for arrays without support for
  1799. * iteratee shorthands.
  1800. *
  1801. * @private
  1802. * @param {Array} [array] The array to iterate over.
  1803. * @param {Function} iteratee The function invoked per iteration.
  1804. * @param {*} [accumulator] The initial value.
  1805. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1806. * the initial value.
  1807. * @returns {*} Returns the accumulated value.
  1808. */
  1809. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1810. var length = array == null ? 0 : array.length;
  1811. if (initAccum && length) {
  1812. accumulator = array[--length];
  1813. }
  1814. while (length--) {
  1815. accumulator = iteratee(accumulator, array[length], length, array);
  1816. }
  1817. return accumulator;
  1818. }
  1819. /**
  1820. * A specialized version of `_.some` for arrays without support for iteratee
  1821. * shorthands.
  1822. *
  1823. * @private
  1824. * @param {Array} [array] The array to iterate over.
  1825. * @param {Function} predicate The function invoked per iteration.
  1826. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1827. * else `false`.
  1828. */
  1829. function arraySome(array, predicate) {
  1830. var index = -1,
  1831. length = array == null ? 0 : array.length;
  1832. while (++index < length) {
  1833. if (predicate(array[index], index, array)) {
  1834. return true;
  1835. }
  1836. }
  1837. return false;
  1838. }
  1839. /**
  1840. * Gets the size of an ASCII `string`.
  1841. *
  1842. * @private
  1843. * @param {string} string The string inspect.
  1844. * @returns {number} Returns the string size.
  1845. */
  1846. var asciiSize = baseProperty('length');
  1847. /**
  1848. * Converts an ASCII `string` to an array.
  1849. *
  1850. * @private
  1851. * @param {string} string The string to convert.
  1852. * @returns {Array} Returns the converted array.
  1853. */
  1854. function asciiToArray(string) {
  1855. return string.split('');
  1856. }
  1857. /**
  1858. * Splits an ASCII `string` into an array of its words.
  1859. *
  1860. * @private
  1861. * @param {string} The string to inspect.
  1862. * @returns {Array} Returns the words of `string`.
  1863. */
  1864. function asciiWords(string) {
  1865. return string.match(reAsciiWord) || [];
  1866. }
  1867. /**
  1868. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1869. * without support for iteratee shorthands, which iterates over `collection`
  1870. * using `eachFunc`.
  1871. *
  1872. * @private
  1873. * @param {Array|Object} collection The collection to inspect.
  1874. * @param {Function} predicate The function invoked per iteration.
  1875. * @param {Function} eachFunc The function to iterate over `collection`.
  1876. * @returns {*} Returns the found element or its key, else `undefined`.
  1877. */
  1878. function baseFindKey(collection, predicate, eachFunc) {
  1879. var result;
  1880. eachFunc(collection, function(value, key, collection) {
  1881. if (predicate(value, key, collection)) {
  1882. result = key;
  1883. return false;
  1884. }
  1885. });
  1886. return result;
  1887. }
  1888. /**
  1889. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1890. * support for iteratee shorthands.
  1891. *
  1892. * @private
  1893. * @param {Array} array The array to inspect.
  1894. * @param {Function} predicate The function invoked per iteration.
  1895. * @param {number} fromIndex The index to search from.
  1896. * @param {boolean} [fromRight] Specify iterating from right to left.
  1897. * @returns {number} Returns the index of the matched value, else `-1`.
  1898. */
  1899. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1900. var length = array.length,
  1901. index = fromIndex + (fromRight ? 1 : -1);
  1902. while ((fromRight ? index-- : ++index < length)) {
  1903. if (predicate(array[index], index, array)) {
  1904. return index;
  1905. }
  1906. }
  1907. return -1;
  1908. }
  1909. /**
  1910. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1911. *
  1912. * @private
  1913. * @param {Array} array The array to inspect.
  1914. * @param {*} value The value to search for.
  1915. * @param {number} fromIndex The index to search from.
  1916. * @returns {number} Returns the index of the matched value, else `-1`.
  1917. */
  1918. function baseIndexOf(array, value, fromIndex) {
  1919. return value === value
  1920. ? strictIndexOf(array, value, fromIndex)
  1921. : baseFindIndex(array, baseIsNaN, fromIndex);
  1922. }
  1923. /**
  1924. * This function is like `baseIndexOf` except that it accepts a comparator.
  1925. *
  1926. * @private
  1927. * @param {Array} array The array to inspect.
  1928. * @param {*} value The value to search for.
  1929. * @param {number} fromIndex The index to search from.
  1930. * @param {Function} comparator The comparator invoked per element.
  1931. * @returns {number} Returns the index of the matched value, else `-1`.
  1932. */
  1933. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1934. var index = fromIndex - 1,
  1935. length = array.length;
  1936. while (++index < length) {
  1937. if (comparator(array[index], value)) {
  1938. return index;
  1939. }
  1940. }
  1941. return -1;
  1942. }
  1943. /**
  1944. * The base implementation of `_.isNaN` without support for number objects.
  1945. *
  1946. * @private
  1947. * @param {*} value The value to check.
  1948. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1949. */
  1950. function baseIsNaN(value) {
  1951. return value !== value;
  1952. }
  1953. /**
  1954. * The base implementation of `_.mean` and `_.meanBy` without support for
  1955. * iteratee shorthands.
  1956. *
  1957. * @private
  1958. * @param {Array} array The array to iterate over.
  1959. * @param {Function} iteratee The function invoked per iteration.
  1960. * @returns {number} Returns the mean.
  1961. */
  1962. function baseMean(array, iteratee) {
  1963. var length = array == null ? 0 : array.length;
  1964. return length ? (baseSum(array, iteratee) / length) : NAN;
  1965. }
  1966. /**
  1967. * The base implementation of `_.property` without support for deep paths.
  1968. *
  1969. * @private
  1970. * @param {string} key The key of the property to get.
  1971. * @returns {Function} Returns the new accessor function.
  1972. */
  1973. function baseProperty(key) {
  1974. return function(object) {
  1975. return object == null ? undefined : object[key];
  1976. };
  1977. }
  1978. /**
  1979. * The base implementation of `_.propertyOf` without support for deep paths.
  1980. *
  1981. * @private
  1982. * @param {Object} object The object to query.
  1983. * @returns {Function} Returns the new accessor function.
  1984. */
  1985. function basePropertyOf(object) {
  1986. return function(key) {
  1987. return object == null ? undefined : object[key];
  1988. };
  1989. }
  1990. /**
  1991. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1992. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1993. *
  1994. * @private
  1995. * @param {Array|Object} collection The collection to iterate over.
  1996. * @param {Function} iteratee The function invoked per iteration.
  1997. * @param {*} accumulator The initial value.
  1998. * @param {boolean} initAccum Specify using the first or last element of
  1999. * `collection` as the initial value.
  2000. * @param {Function} eachFunc The function to iterate over `collection`.
  2001. * @returns {*} Returns the accumulated value.
  2002. */
  2003. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2004. eachFunc(collection, function(value, index, collection) {
  2005. accumulator = initAccum
  2006. ? (initAccum = false, value)
  2007. : iteratee(accumulator, value, index, collection);
  2008. });
  2009. return accumulator;
  2010. }
  2011. /**
  2012. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2013. * sort order of `array` and replaces criteria objects with their corresponding
  2014. * values.
  2015. *
  2016. * @private
  2017. * @param {Array} array The array to sort.
  2018. * @param {Function} comparer The function to define sort order.
  2019. * @returns {Array} Returns `array`.
  2020. */
  2021. function baseSortBy(array, comparer) {
  2022. var length = array.length;
  2023. array.sort(comparer);
  2024. while (length--) {
  2025. array[length] = array[length].value;
  2026. }
  2027. return array;
  2028. }
  2029. /**
  2030. * The base implementation of `_.sum` and `_.sumBy` without support for
  2031. * iteratee shorthands.
  2032. *
  2033. * @private
  2034. * @param {Array} array The array to iterate over.
  2035. * @param {Function} iteratee The function invoked per iteration.
  2036. * @returns {number} Returns the sum.
  2037. */
  2038. function baseSum(array, iteratee) {
  2039. var result,
  2040. index = -1,
  2041. length = array.length;
  2042. while (++index < length) {
  2043. var current = iteratee(array[index]);
  2044. if (current !== undefined) {
  2045. result = result === undefined ? current : (result + current);
  2046. }
  2047. }
  2048. return result;
  2049. }
  2050. /**
  2051. * The base implementation of `_.times` without support for iteratee shorthands
  2052. * or max array length checks.
  2053. *
  2054. * @private
  2055. * @param {number} n The number of times to invoke `iteratee`.
  2056. * @param {Function} iteratee The function invoked per iteration.
  2057. * @returns {Array} Returns the array of results.
  2058. */
  2059. function baseTimes(n, iteratee) {
  2060. var index = -1,
  2061. result = Array(n);
  2062. while (++index < n) {
  2063. result[index] = iteratee(index);
  2064. }
  2065. return result;
  2066. }
  2067. /**
  2068. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2069. * of key-value pairs for `object` corresponding to the property names of `props`.
  2070. *
  2071. * @private
  2072. * @param {Object} object The object to query.
  2073. * @param {Array} props The property names to get values for.
  2074. * @returns {Object} Returns the key-value pairs.
  2075. */
  2076. function baseToPairs(object, props) {
  2077. return arrayMap(props, function(key) {
  2078. return [key, object[key]];
  2079. });
  2080. }
  2081. /**
  2082. * The base implementation of `_.trim`.
  2083. *
  2084. * @private
  2085. * @param {string} string The string to trim.
  2086. * @returns {string} Returns the trimmed string.
  2087. */
  2088. function baseTrim(string) {
  2089. return string
  2090. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2091. : string;
  2092. }
  2093. /**
  2094. * The base implementation of `_.unary` without support for storing metadata.
  2095. *
  2096. * @private
  2097. * @param {Function} func The function to cap arguments for.
  2098. * @returns {Function} Returns the new capped function.
  2099. */
  2100. function baseUnary(func) {
  2101. return function(value) {
  2102. return func(value);
  2103. };
  2104. }
  2105. /**
  2106. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2107. * array of `object` property values corresponding to the property names
  2108. * of `props`.
  2109. *
  2110. * @private
  2111. * @param {Object} object The object to query.
  2112. * @param {Array} props The property names to get values for.
  2113. * @returns {Object} Returns the array of property values.
  2114. */
  2115. function baseValues(object, props) {
  2116. return arrayMap(props, function(key) {
  2117. return object[key];
  2118. });
  2119. }
  2120. /**
  2121. * Checks if a `cache` value for `key` exists.
  2122. *
  2123. * @private
  2124. * @param {Object} cache The cache to query.
  2125. * @param {string} key The key of the entry to check.
  2126. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2127. */
  2128. function cacheHas(cache, key) {
  2129. return cache.has(key);
  2130. }
  2131. /**
  2132. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2133. * that is not found in the character symbols.
  2134. *
  2135. * @private
  2136. * @param {Array} strSymbols The string symbols to inspect.
  2137. * @param {Array} chrSymbols The character symbols to find.
  2138. * @returns {number} Returns the index of the first unmatched string symbol.
  2139. */
  2140. function charsStartIndex(strSymbols, chrSymbols) {
  2141. var index = -1,
  2142. length = strSymbols.length;
  2143. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2144. return index;
  2145. }
  2146. /**
  2147. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2148. * that is not found in the character symbols.
  2149. *
  2150. * @private
  2151. * @param {Array} strSymbols The string symbols to inspect.
  2152. * @param {Array} chrSymbols The character symbols to find.
  2153. * @returns {number} Returns the index of the last unmatched string symbol.
  2154. */
  2155. function charsEndIndex(strSymbols, chrSymbols) {
  2156. var index = strSymbols.length;
  2157. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2158. return index;
  2159. }
  2160. /**
  2161. * Gets the number of `placeholder` occurrences in `array`.
  2162. *
  2163. * @private
  2164. * @param {Array} array The array to inspect.
  2165. * @param {*} placeholder The placeholder to search for.
  2166. * @returns {number} Returns the placeholder count.
  2167. */
  2168. function countHolders(array, placeholder) {
  2169. var length = array.length,
  2170. result = 0;
  2171. while (length--) {
  2172. if (array[length] === placeholder) {
  2173. ++result;
  2174. }
  2175. }
  2176. return result;
  2177. }
  2178. /**
  2179. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2180. * letters to basic Latin letters.
  2181. *
  2182. * @private
  2183. * @param {string} letter The matched letter to deburr.
  2184. * @returns {string} Returns the deburred letter.
  2185. */
  2186. var deburrLetter = basePropertyOf(deburredLetters);
  2187. /**
  2188. * Used by `_.escape` to convert characters to HTML entities.
  2189. *
  2190. * @private
  2191. * @param {string} chr The matched character to escape.
  2192. * @returns {string} Returns the escaped character.
  2193. */
  2194. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2195. /**
  2196. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2197. *
  2198. * @private
  2199. * @param {string} chr The matched character to escape.
  2200. * @returns {string} Returns the escaped character.
  2201. */
  2202. function escapeStringChar(chr) {
  2203. return '\\' + stringEscapes[chr];
  2204. }
  2205. /**
  2206. * Gets the value at `key` of `object`.
  2207. *
  2208. * @private
  2209. * @param {Object} [object] The object to query.
  2210. * @param {string} key The key of the property to get.
  2211. * @returns {*} Returns the property value.
  2212. */
  2213. function getValue(object, key) {
  2214. return object == null ? undefined : object[key];
  2215. }
  2216. /**
  2217. * Checks if `string` contains Unicode symbols.
  2218. *
  2219. * @private
  2220. * @param {string} string The string to inspect.
  2221. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2222. */
  2223. function hasUnicode(string) {
  2224. return reHasUnicode.test(string);
  2225. }
  2226. /**
  2227. * Checks if `string` contains a word composed of Unicode symbols.
  2228. *
  2229. * @private
  2230. * @param {string} string The string to inspect.
  2231. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2232. */
  2233. function hasUnicodeWord(string) {
  2234. return reHasUnicodeWord.test(string);
  2235. }
  2236. /**
  2237. * Converts `iterator` to an array.
  2238. *
  2239. * @private
  2240. * @param {Object} iterator The iterator to convert.
  2241. * @returns {Array} Returns the converted array.
  2242. */
  2243. function iteratorToArray(iterator) {
  2244. var data,
  2245. result = [];
  2246. while (!(data = iterator.next()).done) {
  2247. result.push(data.value);
  2248. }
  2249. return result;
  2250. }
  2251. /**
  2252. * Converts `map` to its key-value pairs.
  2253. *
  2254. * @private
  2255. * @param {Object} map The map to convert.
  2256. * @returns {Array} Returns the key-value pairs.
  2257. */
  2258. function mapToArray(map) {
  2259. var index = -1,
  2260. result = Array(map.size);
  2261. map.forEach(function(value, key) {
  2262. result[++index] = [key, value];
  2263. });
  2264. return result;
  2265. }
  2266. /**
  2267. * Creates a unary function that invokes `func` with its argument transformed.
  2268. *
  2269. * @private
  2270. * @param {Function} func The function to wrap.
  2271. * @param {Function} transform The argument transform.
  2272. * @returns {Function} Returns the new function.
  2273. */
  2274. function overArg(func, transform) {
  2275. return function(arg) {
  2276. return func(transform(arg));
  2277. };
  2278. }
  2279. /**
  2280. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2281. * and returns an array of their indexes.
  2282. *
  2283. * @private
  2284. * @param {Array} array The array to modify.
  2285. * @param {*} placeholder The placeholder to replace.
  2286. * @returns {Array} Returns the new array of placeholder indexes.
  2287. */
  2288. function replaceHolders(array, placeholder) {
  2289. var index = -1,
  2290. length = array.length,
  2291. resIndex = 0,
  2292. result = [];
  2293. while (++index < length) {
  2294. var value = array[index];
  2295. if (value === placeholder || value === PLACEHOLDER) {
  2296. array[index] = PLACEHOLDER;
  2297. result[resIndex++] = index;
  2298. }
  2299. }
  2300. return result;
  2301. }
  2302. /**
  2303. * Converts `set` to an array of its values.
  2304. *
  2305. * @private
  2306. * @param {Object} set The set to convert.
  2307. * @returns {Array} Returns the values.
  2308. */
  2309. function setToArray(set) {
  2310. var index = -1,
  2311. result = Array(set.size);
  2312. set.forEach(function(value) {
  2313. result[++index] = value;
  2314. });
  2315. return result;
  2316. }
  2317. /**
  2318. * Converts `set` to its value-value pairs.
  2319. *
  2320. * @private
  2321. * @param {Object} set The set to convert.
  2322. * @returns {Array} Returns the value-value pairs.
  2323. */
  2324. function setToPairs(set) {
  2325. var index = -1,
  2326. result = Array(set.size);
  2327. set.forEach(function(value) {
  2328. result[++index] = [value, value];
  2329. });
  2330. return result;
  2331. }
  2332. /**
  2333. * A specialized version of `_.indexOf` which performs strict equality
  2334. * comparisons of values, i.e. `===`.
  2335. *
  2336. * @private
  2337. * @param {Array} array The array to inspect.
  2338. * @param {*} value The value to search for.
  2339. * @param {number} fromIndex The index to search from.
  2340. * @returns {number} Returns the index of the matched value, else `-1`.
  2341. */
  2342. function strictIndexOf(array, value, fromIndex) {
  2343. var index = fromIndex - 1,
  2344. length = array.length;
  2345. while (++index < length) {
  2346. if (array[index] === value) {
  2347. return index;
  2348. }
  2349. }
  2350. return -1;
  2351. }
  2352. /**
  2353. * A specialized version of `_.lastIndexOf` which performs strict equality
  2354. * comparisons of values, i.e. `===`.
  2355. *
  2356. * @private
  2357. * @param {Array} array The array to inspect.
  2358. * @param {*} value The value to search for.
  2359. * @param {number} fromIndex The index to search from.
  2360. * @returns {number} Returns the index of the matched value, else `-1`.
  2361. */
  2362. function strictLastIndexOf(array, value, fromIndex) {
  2363. var index = fromIndex + 1;
  2364. while (index--) {
  2365. if (array[index] === value) {
  2366. return index;
  2367. }
  2368. }
  2369. return index;
  2370. }
  2371. /**
  2372. * Gets the number of symbols in `string`.
  2373. *
  2374. * @private
  2375. * @param {string} string The string to inspect.
  2376. * @returns {number} Returns the string size.
  2377. */
  2378. function stringSize(string) {
  2379. return hasUnicode(string)
  2380. ? unicodeSize(string)
  2381. : asciiSize(string);
  2382. }
  2383. /**
  2384. * Converts `string` to an array.
  2385. *
  2386. * @private
  2387. * @param {string} string The string to convert.
  2388. * @returns {Array} Returns the converted array.
  2389. */
  2390. function stringToArray(string) {
  2391. return hasUnicode(string)
  2392. ? unicodeToArray(string)
  2393. : asciiToArray(string);
  2394. }
  2395. /**
  2396. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2397. * character of `string`.
  2398. *
  2399. * @private
  2400. * @param {string} string The string to inspect.
  2401. * @returns {number} Returns the index of the last non-whitespace character.
  2402. */
  2403. function trimmedEndIndex(string) {
  2404. var index = string.length;
  2405. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2406. return index;
  2407. }
  2408. /**
  2409. * Used by `_.unescape` to convert HTML entities to characters.
  2410. *
  2411. * @private
  2412. * @param {string} chr The matched character to unescape.
  2413. * @returns {string} Returns the unescaped character.
  2414. */
  2415. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2416. /**
  2417. * Gets the size of a Unicode `string`.
  2418. *
  2419. * @private
  2420. * @param {string} string The string inspect.
  2421. * @returns {number} Returns the string size.
  2422. */
  2423. function unicodeSize(string) {
  2424. var result = reUnicode.lastIndex = 0;
  2425. while (reUnicode.test(string)) {
  2426. ++result;
  2427. }
  2428. return result;
  2429. }
  2430. /**
  2431. * Converts a Unicode `string` to an array.
  2432. *
  2433. * @private
  2434. * @param {string} string The string to convert.
  2435. * @returns {Array} Returns the converted array.
  2436. */
  2437. function unicodeToArray(string) {
  2438. return string.match(reUnicode) || [];
  2439. }
  2440. /**
  2441. * Splits a Unicode `string` into an array of its words.
  2442. *
  2443. * @private
  2444. * @param {string} The string to inspect.
  2445. * @returns {Array} Returns the words of `string`.
  2446. */
  2447. function unicodeWords(string) {
  2448. return string.match(reUnicodeWord) || [];
  2449. }
  2450. /*--------------------------------------------------------------------------*/
  2451. /**
  2452. * Create a new pristine `lodash` function using the `context` object.
  2453. *
  2454. * @static
  2455. * @memberOf _
  2456. * @since 1.1.0
  2457. * @category Util
  2458. * @param {Object} [context=root] The context object.
  2459. * @returns {Function} Returns a new `lodash` function.
  2460. * @example
  2461. *
  2462. * _.mixin({ 'foo': _.constant('foo') });
  2463. *
  2464. * var lodash = _.runInContext();
  2465. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2466. *
  2467. * _.isFunction(_.foo);
  2468. * // => true
  2469. * _.isFunction(_.bar);
  2470. * // => false
  2471. *
  2472. * lodash.isFunction(lodash.foo);
  2473. * // => false
  2474. * lodash.isFunction(lodash.bar);
  2475. * // => true
  2476. *
  2477. * // Create a suped-up `defer` in Node.js.
  2478. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2479. */
  2480. var runInContext = (function runInContext(context) {
  2481. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2482. /** Built-in constructor references. */
  2483. var Array = context.Array,
  2484. Date = context.Date,
  2485. Error = context.Error,
  2486. Function = context.Function,
  2487. Math = context.Math,
  2488. Object = context.Object,
  2489. RegExp = context.RegExp,
  2490. String = context.String,
  2491. TypeError = context.TypeError;
  2492. /** Used for built-in method references. */
  2493. var arrayProto = Array.prototype,
  2494. funcProto = Function.prototype,
  2495. objectProto = Object.prototype;
  2496. /** Used to detect overreaching core-js shims. */
  2497. var coreJsData = context['__core-js_shared__'];
  2498. /** Used to resolve the decompiled source of functions. */
  2499. var funcToString = funcProto.toString;
  2500. /** Used to check objects for own properties. */
  2501. var hasOwnProperty = objectProto.hasOwnProperty;
  2502. /** Used to generate unique IDs. */
  2503. var idCounter = 0;
  2504. /** Used to detect methods masquerading as native. */
  2505. var maskSrcKey = (function() {
  2506. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2507. return uid ? ('Symbol(src)_1.' + uid) : '';
  2508. }());
  2509. /**
  2510. * Used to resolve the
  2511. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2512. * of values.
  2513. */
  2514. var nativeObjectToString = objectProto.toString;
  2515. /** Used to infer the `Object` constructor. */
  2516. var objectCtorString = funcToString.call(Object);
  2517. /** Used to restore the original `_` reference in `_.noConflict`. */
  2518. var oldDash = root._;
  2519. /** Used to detect if a method is native. */
  2520. var reIsNative = RegExp('^' +
  2521. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2522. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2523. );
  2524. /** Built-in value references. */
  2525. var Buffer = moduleExports ? context.Buffer : undefined,
  2526. Symbol = context.Symbol,
  2527. Uint8Array = context.Uint8Array,
  2528. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2529. getPrototype = overArg(Object.getPrototypeOf, Object),
  2530. objectCreate = Object.create,
  2531. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2532. splice = arrayProto.splice,
  2533. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2534. symIterator = Symbol ? Symbol.iterator : undefined,
  2535. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2536. var defineProperty = (function() {
  2537. try {
  2538. var func = getNative(Object, 'defineProperty');
  2539. func({}, '', {});
  2540. return func;
  2541. } catch (e) {}
  2542. }());
  2543. /** Mocked built-ins. */
  2544. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2545. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2546. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2547. /* Built-in method references for those with the same name as other `lodash` methods. */
  2548. var nativeCeil = Math.ceil,
  2549. nativeFloor = Math.floor,
  2550. nativeGetSymbols = Object.getOwnPropertySymbols,
  2551. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2552. nativeIsFinite = context.isFinite,
  2553. nativeJoin = arrayProto.join,
  2554. nativeKeys = overArg(Object.keys, Object),
  2555. nativeMax = Math.max,
  2556. nativeMin = Math.min,
  2557. nativeNow = Date.now,
  2558. nativeParseInt = context.parseInt,
  2559. nativeRandom = Math.random,
  2560. nativeReverse = arrayProto.reverse;
  2561. /* Built-in method references that are verified to be native. */
  2562. var DataView = getNative(context, 'DataView'),
  2563. Map = getNative(context, 'Map'),
  2564. Promise = getNative(context, 'Promise'),
  2565. Set = getNative(context, 'Set'),
  2566. WeakMap = getNative(context, 'WeakMap'),
  2567. nativeCreate = getNative(Object, 'create');
  2568. /** Used to store function metadata. */
  2569. var metaMap = WeakMap && new WeakMap;
  2570. /** Used to lookup unminified function names. */
  2571. var realNames = {};
  2572. /** Used to detect maps, sets, and weakmaps. */
  2573. var dataViewCtorString = toSource(DataView),
  2574. mapCtorString = toSource(Map),
  2575. promiseCtorString = toSource(Promise),
  2576. setCtorString = toSource(Set),
  2577. weakMapCtorString = toSource(WeakMap);
  2578. /** Used to convert symbols to primitives and strings. */
  2579. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2580. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2581. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2582. /*------------------------------------------------------------------------*/
  2583. /**
  2584. * Creates a `lodash` object which wraps `value` to enable implicit method
  2585. * chain sequences. Methods that operate on and return arrays, collections,
  2586. * and functions can be chained together. Methods that retrieve a single value
  2587. * or may return a primitive value will automatically end the chain sequence
  2588. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2589. * with `_#value`.
  2590. *
  2591. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2592. * enabled using `_.chain`.
  2593. *
  2594. * The execution of chained methods is lazy, that is, it's deferred until
  2595. * `_#value` is implicitly or explicitly called.
  2596. *
  2597. * Lazy evaluation allows several methods to support shortcut fusion.
  2598. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2599. * the creation of intermediate arrays and can greatly reduce the number of
  2600. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2601. * fusion if the section is applied to an array and iteratees accept only
  2602. * one argument. The heuristic for whether a section qualifies for shortcut
  2603. * fusion is subject to change.
  2604. *
  2605. * Chaining is supported in custom builds as long as the `_#value` method is
  2606. * directly or indirectly included in the build.
  2607. *
  2608. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2609. *
  2610. * The wrapper `Array` methods are:
  2611. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2612. *
  2613. * The wrapper `String` methods are:
  2614. * `replace` and `split`
  2615. *
  2616. * The wrapper methods that support shortcut fusion are:
  2617. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2618. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2619. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2620. *
  2621. * The chainable wrapper methods are:
  2622. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2623. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2624. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2625. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2626. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2627. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2628. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2629. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2630. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2631. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2632. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2633. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2634. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2635. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2636. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2637. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2638. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2639. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2640. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2641. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2642. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2643. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2644. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2645. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2646. *
  2647. * The wrapper methods that are **not** chainable by default are:
  2648. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2649. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2650. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2651. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2652. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2653. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2654. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2655. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2656. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2657. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2658. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2659. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2660. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2661. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2662. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2663. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2664. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2665. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2666. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2667. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2668. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2669. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2670. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2671. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2672. * `upperFirst`, `value`, and `words`
  2673. *
  2674. * @name _
  2675. * @constructor
  2676. * @category Seq
  2677. * @param {*} value The value to wrap in a `lodash` instance.
  2678. * @returns {Object} Returns the new `lodash` wrapper instance.
  2679. * @example
  2680. *
  2681. * function square(n) {
  2682. * return n * n;
  2683. * }
  2684. *
  2685. * var wrapped = _([1, 2, 3]);
  2686. *
  2687. * // Returns an unwrapped value.
  2688. * wrapped.reduce(_.add);
  2689. * // => 6
  2690. *
  2691. * // Returns a wrapped value.
  2692. * var squares = wrapped.map(square);
  2693. *
  2694. * _.isArray(squares);
  2695. * // => false
  2696. *
  2697. * _.isArray(squares.value());
  2698. * // => true
  2699. */
  2700. function lodash(value) {
  2701. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2702. if (value instanceof LodashWrapper) {
  2703. return value;
  2704. }
  2705. if (hasOwnProperty.call(value, '__wrapped__')) {
  2706. return wrapperClone(value);
  2707. }
  2708. }
  2709. return new LodashWrapper(value);
  2710. }
  2711. /**
  2712. * The base implementation of `_.create` without support for assigning
  2713. * properties to the created object.
  2714. *
  2715. * @private
  2716. * @param {Object} proto The object to inherit from.
  2717. * @returns {Object} Returns the new object.
  2718. */
  2719. var baseCreate = (function() {
  2720. function object() {}
  2721. return function(proto) {
  2722. if (!isObject(proto)) {
  2723. return {};
  2724. }
  2725. if (objectCreate) {
  2726. return objectCreate(proto);
  2727. }
  2728. object.prototype = proto;
  2729. var result = new object;
  2730. object.prototype = undefined;
  2731. return result;
  2732. };
  2733. }());
  2734. /**
  2735. * The function whose prototype chain sequence wrappers inherit from.
  2736. *
  2737. * @private
  2738. */
  2739. function baseLodash() {
  2740. // No operation performed.
  2741. }
  2742. /**
  2743. * The base constructor for creating `lodash` wrapper objects.
  2744. *
  2745. * @private
  2746. * @param {*} value The value to wrap.
  2747. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2748. */
  2749. function LodashWrapper(value, chainAll) {
  2750. this.__wrapped__ = value;
  2751. this.__actions__ = [];
  2752. this.__chain__ = !!chainAll;
  2753. this.__index__ = 0;
  2754. this.__values__ = undefined;
  2755. }
  2756. /**
  2757. * By default, the template delimiters used by lodash are like those in
  2758. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2759. * following template settings to use alternative delimiters.
  2760. *
  2761. * @static
  2762. * @memberOf _
  2763. * @type {Object}
  2764. */
  2765. lodash.templateSettings = {
  2766. /**
  2767. * Used to detect `data` property values to be HTML-escaped.
  2768. *
  2769. * @memberOf _.templateSettings
  2770. * @type {RegExp}
  2771. */
  2772. 'escape': reEscape,
  2773. /**
  2774. * Used to detect code to be evaluated.
  2775. *
  2776. * @memberOf _.templateSettings
  2777. * @type {RegExp}
  2778. */
  2779. 'evaluate': reEvaluate,
  2780. /**
  2781. * Used to detect `data` property values to inject.
  2782. *
  2783. * @memberOf _.templateSettings
  2784. * @type {RegExp}
  2785. */
  2786. 'interpolate': reInterpolate,
  2787. /**
  2788. * Used to reference the data object in the template text.
  2789. *
  2790. * @memberOf _.templateSettings
  2791. * @type {string}
  2792. */
  2793. 'variable': '',
  2794. /**
  2795. * Used to import variables into the compiled template.
  2796. *
  2797. * @memberOf _.templateSettings
  2798. * @type {Object}
  2799. */
  2800. 'imports': {
  2801. /**
  2802. * A reference to the `lodash` function.
  2803. *
  2804. * @memberOf _.templateSettings.imports
  2805. * @type {Function}
  2806. */
  2807. '_': lodash
  2808. }
  2809. };
  2810. // Ensure wrappers are instances of `baseLodash`.
  2811. lodash.prototype = baseLodash.prototype;
  2812. lodash.prototype.constructor = lodash;
  2813. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2814. LodashWrapper.prototype.constructor = LodashWrapper;
  2815. /*------------------------------------------------------------------------*/
  2816. /**
  2817. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2818. *
  2819. * @private
  2820. * @constructor
  2821. * @param {*} value The value to wrap.
  2822. */
  2823. function LazyWrapper(value) {
  2824. this.__wrapped__ = value;
  2825. this.__actions__ = [];
  2826. this.__dir__ = 1;
  2827. this.__filtered__ = false;
  2828. this.__iteratees__ = [];
  2829. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2830. this.__views__ = [];
  2831. }
  2832. /**
  2833. * Creates a clone of the lazy wrapper object.
  2834. *
  2835. * @private
  2836. * @name clone
  2837. * @memberOf LazyWrapper
  2838. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2839. */
  2840. function lazyClone() {
  2841. var result = new LazyWrapper(this.__wrapped__);
  2842. result.__actions__ = copyArray(this.__actions__);
  2843. result.__dir__ = this.__dir__;
  2844. result.__filtered__ = this.__filtered__;
  2845. result.__iteratees__ = copyArray(this.__iteratees__);
  2846. result.__takeCount__ = this.__takeCount__;
  2847. result.__views__ = copyArray(this.__views__);
  2848. return result;
  2849. }
  2850. /**
  2851. * Reverses the direction of lazy iteration.
  2852. *
  2853. * @private
  2854. * @name reverse
  2855. * @memberOf LazyWrapper
  2856. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2857. */
  2858. function lazyReverse() {
  2859. if (this.__filtered__) {
  2860. var result = new LazyWrapper(this);
  2861. result.__dir__ = -1;
  2862. result.__filtered__ = true;
  2863. } else {
  2864. result = this.clone();
  2865. result.__dir__ *= -1;
  2866. }
  2867. return result;
  2868. }
  2869. /**
  2870. * Extracts the unwrapped value from its lazy wrapper.
  2871. *
  2872. * @private
  2873. * @name value
  2874. * @memberOf LazyWrapper
  2875. * @returns {*} Returns the unwrapped value.
  2876. */
  2877. function lazyValue() {
  2878. var array = this.__wrapped__.value(),
  2879. dir = this.__dir__,
  2880. isArr = isArray(array),
  2881. isRight = dir < 0,
  2882. arrLength = isArr ? array.length : 0,
  2883. view = getView(0, arrLength, this.__views__),
  2884. start = view.start,
  2885. end = view.end,
  2886. length = end - start,
  2887. index = isRight ? end : (start - 1),
  2888. iteratees = this.__iteratees__,
  2889. iterLength = iteratees.length,
  2890. resIndex = 0,
  2891. takeCount = nativeMin(length, this.__takeCount__);
  2892. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2893. return baseWrapperValue(array, this.__actions__);
  2894. }
  2895. var result = [];
  2896. outer:
  2897. while (length-- && resIndex < takeCount) {
  2898. index += dir;
  2899. var iterIndex = -1,
  2900. value = array[index];
  2901. while (++iterIndex < iterLength) {
  2902. var data = iteratees[iterIndex],
  2903. iteratee = data.iteratee,
  2904. type = data.type,
  2905. computed = iteratee(value);
  2906. if (type == LAZY_MAP_FLAG) {
  2907. value = computed;
  2908. } else if (!computed) {
  2909. if (type == LAZY_FILTER_FLAG) {
  2910. continue outer;
  2911. } else {
  2912. break outer;
  2913. }
  2914. }
  2915. }
  2916. result[resIndex++] = value;
  2917. }
  2918. return result;
  2919. }
  2920. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2921. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2922. LazyWrapper.prototype.constructor = LazyWrapper;
  2923. /*------------------------------------------------------------------------*/
  2924. /**
  2925. * Creates a hash object.
  2926. *
  2927. * @private
  2928. * @constructor
  2929. * @param {Array} [entries] The key-value pairs to cache.
  2930. */
  2931. function Hash(entries) {
  2932. var index = -1,
  2933. length = entries == null ? 0 : entries.length;
  2934. this.clear();
  2935. while (++index < length) {
  2936. var entry = entries[index];
  2937. this.set(entry[0], entry[1]);
  2938. }
  2939. }
  2940. /**
  2941. * Removes all key-value entries from the hash.
  2942. *
  2943. * @private
  2944. * @name clear
  2945. * @memberOf Hash
  2946. */
  2947. function hashClear() {
  2948. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2949. this.size = 0;
  2950. }
  2951. /**
  2952. * Removes `key` and its value from the hash.
  2953. *
  2954. * @private
  2955. * @name delete
  2956. * @memberOf Hash
  2957. * @param {Object} hash The hash to modify.
  2958. * @param {string} key The key of the value to remove.
  2959. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2960. */
  2961. function hashDelete(key) {
  2962. var result = this.has(key) && delete this.__data__[key];
  2963. this.size -= result ? 1 : 0;
  2964. return result;
  2965. }
  2966. /**
  2967. * Gets the hash value for `key`.
  2968. *
  2969. * @private
  2970. * @name get
  2971. * @memberOf Hash
  2972. * @param {string} key The key of the value to get.
  2973. * @returns {*} Returns the entry value.
  2974. */
  2975. function hashGet(key) {
  2976. var data = this.__data__;
  2977. if (nativeCreate) {
  2978. var result = data[key];
  2979. return result === HASH_UNDEFINED ? undefined : result;
  2980. }
  2981. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2982. }
  2983. /**
  2984. * Checks if a hash value for `key` exists.
  2985. *
  2986. * @private
  2987. * @name has
  2988. * @memberOf Hash
  2989. * @param {string} key The key of the entry to check.
  2990. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2991. */
  2992. function hashHas(key) {
  2993. var data = this.__data__;
  2994. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2995. }
  2996. /**
  2997. * Sets the hash `key` to `value`.
  2998. *
  2999. * @private
  3000. * @name set
  3001. * @memberOf Hash
  3002. * @param {string} key The key of the value to set.
  3003. * @param {*} value The value to set.
  3004. * @returns {Object} Returns the hash instance.
  3005. */
  3006. function hashSet(key, value) {
  3007. var data = this.__data__;
  3008. this.size += this.has(key) ? 0 : 1;
  3009. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3010. return this;
  3011. }
  3012. // Add methods to `Hash`.
  3013. Hash.prototype.clear = hashClear;
  3014. Hash.prototype['delete'] = hashDelete;
  3015. Hash.prototype.get = hashGet;
  3016. Hash.prototype.has = hashHas;
  3017. Hash.prototype.set = hashSet;
  3018. /*------------------------------------------------------------------------*/
  3019. /**
  3020. * Creates an list cache object.
  3021. *
  3022. * @private
  3023. * @constructor
  3024. * @param {Array} [entries] The key-value pairs to cache.
  3025. */
  3026. function ListCache(entries) {
  3027. var index = -1,
  3028. length = entries == null ? 0 : entries.length;
  3029. this.clear();
  3030. while (++index < length) {
  3031. var entry = entries[index];
  3032. this.set(entry[0], entry[1]);
  3033. }
  3034. }
  3035. /**
  3036. * Removes all key-value entries from the list cache.
  3037. *
  3038. * @private
  3039. * @name clear
  3040. * @memberOf ListCache
  3041. */
  3042. function listCacheClear() {
  3043. this.__data__ = [];
  3044. this.size = 0;
  3045. }
  3046. /**
  3047. * Removes `key` and its value from the list cache.
  3048. *
  3049. * @private
  3050. * @name delete
  3051. * @memberOf ListCache
  3052. * @param {string} key The key of the value to remove.
  3053. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3054. */
  3055. function listCacheDelete(key) {
  3056. var data = this.__data__,
  3057. index = assocIndexOf(data, key);
  3058. if (index < 0) {
  3059. return false;
  3060. }
  3061. var lastIndex = data.length - 1;
  3062. if (index == lastIndex) {
  3063. data.pop();
  3064. } else {
  3065. splice.call(data, index, 1);
  3066. }
  3067. --this.size;
  3068. return true;
  3069. }
  3070. /**
  3071. * Gets the list cache value for `key`.
  3072. *
  3073. * @private
  3074. * @name get
  3075. * @memberOf ListCache
  3076. * @param {string} key The key of the value to get.
  3077. * @returns {*} Returns the entry value.
  3078. */
  3079. function listCacheGet(key) {
  3080. var data = this.__data__,
  3081. index = assocIndexOf(data, key);
  3082. return index < 0 ? undefined : data[index][1];
  3083. }
  3084. /**
  3085. * Checks if a list cache value for `key` exists.
  3086. *
  3087. * @private
  3088. * @name has
  3089. * @memberOf ListCache
  3090. * @param {string} key The key of the entry to check.
  3091. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3092. */
  3093. function listCacheHas(key) {
  3094. return assocIndexOf(this.__data__, key) > -1;
  3095. }
  3096. /**
  3097. * Sets the list cache `key` to `value`.
  3098. *
  3099. * @private
  3100. * @name set
  3101. * @memberOf ListCache
  3102. * @param {string} key The key of the value to set.
  3103. * @param {*} value The value to set.
  3104. * @returns {Object} Returns the list cache instance.
  3105. */
  3106. function listCacheSet(key, value) {
  3107. var data = this.__data__,
  3108. index = assocIndexOf(data, key);
  3109. if (index < 0) {
  3110. ++this.size;
  3111. data.push([key, value]);
  3112. } else {
  3113. data[index][1] = value;
  3114. }
  3115. return this;
  3116. }
  3117. // Add methods to `ListCache`.
  3118. ListCache.prototype.clear = listCacheClear;
  3119. ListCache.prototype['delete'] = listCacheDelete;
  3120. ListCache.prototype.get = listCacheGet;
  3121. ListCache.prototype.has = listCacheHas;
  3122. ListCache.prototype.set = listCacheSet;
  3123. /*------------------------------------------------------------------------*/
  3124. /**
  3125. * Creates a map cache object to store key-value pairs.
  3126. *
  3127. * @private
  3128. * @constructor
  3129. * @param {Array} [entries] The key-value pairs to cache.
  3130. */
  3131. function MapCache(entries) {
  3132. var index = -1,
  3133. length = entries == null ? 0 : entries.length;
  3134. this.clear();
  3135. while (++index < length) {
  3136. var entry = entries[index];
  3137. this.set(entry[0], entry[1]);
  3138. }
  3139. }
  3140. /**
  3141. * Removes all key-value entries from the map.
  3142. *
  3143. * @private
  3144. * @name clear
  3145. * @memberOf MapCache
  3146. */
  3147. function mapCacheClear() {
  3148. this.size = 0;
  3149. this.__data__ = {
  3150. 'hash': new Hash,
  3151. 'map': new (Map || ListCache),
  3152. 'string': new Hash
  3153. };
  3154. }
  3155. /**
  3156. * Removes `key` and its value from the map.
  3157. *
  3158. * @private
  3159. * @name delete
  3160. * @memberOf MapCache
  3161. * @param {string} key The key of the value to remove.
  3162. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3163. */
  3164. function mapCacheDelete(key) {
  3165. var result = getMapData(this, key)['delete'](key);
  3166. this.size -= result ? 1 : 0;
  3167. return result;
  3168. }
  3169. /**
  3170. * Gets the map value for `key`.
  3171. *
  3172. * @private
  3173. * @name get
  3174. * @memberOf MapCache
  3175. * @param {string} key The key of the value to get.
  3176. * @returns {*} Returns the entry value.
  3177. */
  3178. function mapCacheGet(key) {
  3179. return getMapData(this, key).get(key);
  3180. }
  3181. /**
  3182. * Checks if a map value for `key` exists.
  3183. *
  3184. * @private
  3185. * @name has
  3186. * @memberOf MapCache
  3187. * @param {string} key The key of the entry to check.
  3188. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3189. */
  3190. function mapCacheHas(key) {
  3191. return getMapData(this, key).has(key);
  3192. }
  3193. /**
  3194. * Sets the map `key` to `value`.
  3195. *
  3196. * @private
  3197. * @name set
  3198. * @memberOf MapCache
  3199. * @param {string} key The key of the value to set.
  3200. * @param {*} value The value to set.
  3201. * @returns {Object} Returns the map cache instance.
  3202. */
  3203. function mapCacheSet(key, value) {
  3204. var data = getMapData(this, key),
  3205. size = data.size;
  3206. data.set(key, value);
  3207. this.size += data.size == size ? 0 : 1;
  3208. return this;
  3209. }
  3210. // Add methods to `MapCache`.
  3211. MapCache.prototype.clear = mapCacheClear;
  3212. MapCache.prototype['delete'] = mapCacheDelete;
  3213. MapCache.prototype.get = mapCacheGet;
  3214. MapCache.prototype.has = mapCacheHas;
  3215. MapCache.prototype.set = mapCacheSet;
  3216. /*------------------------------------------------------------------------*/
  3217. /**
  3218. *
  3219. * Creates an array cache object to store unique values.
  3220. *
  3221. * @private
  3222. * @constructor
  3223. * @param {Array} [values] The values to cache.
  3224. */
  3225. function SetCache(values) {
  3226. var index = -1,
  3227. length = values == null ? 0 : values.length;
  3228. this.__data__ = new MapCache;
  3229. while (++index < length) {
  3230. this.add(values[index]);
  3231. }
  3232. }
  3233. /**
  3234. * Adds `value` to the array cache.
  3235. *
  3236. * @private
  3237. * @name add
  3238. * @memberOf SetCache
  3239. * @alias push
  3240. * @param {*} value The value to cache.
  3241. * @returns {Object} Returns the cache instance.
  3242. */
  3243. function setCacheAdd(value) {
  3244. this.__data__.set(value, HASH_UNDEFINED);
  3245. return this;
  3246. }
  3247. /**
  3248. * Checks if `value` is in the array cache.
  3249. *
  3250. * @private
  3251. * @name has
  3252. * @memberOf SetCache
  3253. * @param {*} value The value to search for.
  3254. * @returns {number} Returns `true` if `value` is found, else `false`.
  3255. */
  3256. function setCacheHas(value) {
  3257. return this.__data__.has(value);
  3258. }
  3259. // Add methods to `SetCache`.
  3260. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3261. SetCache.prototype.has = setCacheHas;
  3262. /*------------------------------------------------------------------------*/
  3263. /**
  3264. * Creates a stack cache object to store key-value pairs.
  3265. *
  3266. * @private
  3267. * @constructor
  3268. * @param {Array} [entries] The key-value pairs to cache.
  3269. */
  3270. function Stack(entries) {
  3271. var data = this.__data__ = new ListCache(entries);
  3272. this.size = data.size;
  3273. }
  3274. /**
  3275. * Removes all key-value entries from the stack.
  3276. *
  3277. * @private
  3278. * @name clear
  3279. * @memberOf Stack
  3280. */
  3281. function stackClear() {
  3282. this.__data__ = new ListCache;
  3283. this.size = 0;
  3284. }
  3285. /**
  3286. * Removes `key` and its value from the stack.
  3287. *
  3288. * @private
  3289. * @name delete
  3290. * @memberOf Stack
  3291. * @param {string} key The key of the value to remove.
  3292. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3293. */
  3294. function stackDelete(key) {
  3295. var data = this.__data__,
  3296. result = data['delete'](key);
  3297. this.size = data.size;
  3298. return result;
  3299. }
  3300. /**
  3301. * Gets the stack value for `key`.
  3302. *
  3303. * @private
  3304. * @name get
  3305. * @memberOf Stack
  3306. * @param {string} key The key of the value to get.
  3307. * @returns {*} Returns the entry value.
  3308. */
  3309. function stackGet(key) {
  3310. return this.__data__.get(key);
  3311. }
  3312. /**
  3313. * Checks if a stack value for `key` exists.
  3314. *
  3315. * @private
  3316. * @name has
  3317. * @memberOf Stack
  3318. * @param {string} key The key of the entry to check.
  3319. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3320. */
  3321. function stackHas(key) {
  3322. return this.__data__.has(key);
  3323. }
  3324. /**
  3325. * Sets the stack `key` to `value`.
  3326. *
  3327. * @private
  3328. * @name set
  3329. * @memberOf Stack
  3330. * @param {string} key The key of the value to set.
  3331. * @param {*} value The value to set.
  3332. * @returns {Object} Returns the stack cache instance.
  3333. */
  3334. function stackSet(key, value) {
  3335. var data = this.__data__;
  3336. if (data instanceof ListCache) {
  3337. var pairs = data.__data__;
  3338. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3339. pairs.push([key, value]);
  3340. this.size = ++data.size;
  3341. return this;
  3342. }
  3343. data = this.__data__ = new MapCache(pairs);
  3344. }
  3345. data.set(key, value);
  3346. this.size = data.size;
  3347. return this;
  3348. }
  3349. // Add methods to `Stack`.
  3350. Stack.prototype.clear = stackClear;
  3351. Stack.prototype['delete'] = stackDelete;
  3352. Stack.prototype.get = stackGet;
  3353. Stack.prototype.has = stackHas;
  3354. Stack.prototype.set = stackSet;
  3355. /*------------------------------------------------------------------------*/
  3356. /**
  3357. * Creates an array of the enumerable property names of the array-like `value`.
  3358. *
  3359. * @private
  3360. * @param {*} value The value to query.
  3361. * @param {boolean} inherited Specify returning inherited property names.
  3362. * @returns {Array} Returns the array of property names.
  3363. */
  3364. function arrayLikeKeys(value, inherited) {
  3365. var isArr = isArray(value),
  3366. isArg = !isArr && isArguments(value),
  3367. isBuff = !isArr && !isArg && isBuffer(value),
  3368. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3369. skipIndexes = isArr || isArg || isBuff || isType,
  3370. result = skipIndexes ? baseTimes(value.length, String) : [],
  3371. length = result.length;
  3372. for (var key in value) {
  3373. if ((inherited || hasOwnProperty.call(value, key)) &&
  3374. !(skipIndexes && (
  3375. // Safari 9 has enumerable `arguments.length` in strict mode.
  3376. key == 'length' ||
  3377. // Node.js 0.10 has enumerable non-index properties on buffers.
  3378. (isBuff && (key == 'offset' || key == 'parent')) ||
  3379. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3380. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3381. // Skip index properties.
  3382. isIndex(key, length)
  3383. ))) {
  3384. result.push(key);
  3385. }
  3386. }
  3387. return result;
  3388. }
  3389. /**
  3390. * A specialized version of `_.sample` for arrays.
  3391. *
  3392. * @private
  3393. * @param {Array} array The array to sample.
  3394. * @returns {*} Returns the random element.
  3395. */
  3396. function arraySample(array) {
  3397. var length = array.length;
  3398. return length ? array[baseRandom(0, length - 1)] : undefined;
  3399. }
  3400. /**
  3401. * A specialized version of `_.sampleSize` for arrays.
  3402. *
  3403. * @private
  3404. * @param {Array} array The array to sample.
  3405. * @param {number} n The number of elements to sample.
  3406. * @returns {Array} Returns the random elements.
  3407. */
  3408. function arraySampleSize(array, n) {
  3409. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3410. }
  3411. /**
  3412. * A specialized version of `_.shuffle` for arrays.
  3413. *
  3414. * @private
  3415. * @param {Array} array The array to shuffle.
  3416. * @returns {Array} Returns the new shuffled array.
  3417. */
  3418. function arrayShuffle(array) {
  3419. return shuffleSelf(copyArray(array));
  3420. }
  3421. /**
  3422. * This function is like `assignValue` except that it doesn't assign
  3423. * `undefined` values.
  3424. *
  3425. * @private
  3426. * @param {Object} object The object to modify.
  3427. * @param {string} key The key of the property to assign.
  3428. * @param {*} value The value to assign.
  3429. */
  3430. function assignMergeValue(object, key, value) {
  3431. if ((value !== undefined && !eq(object[key], value)) ||
  3432. (value === undefined && !(key in object))) {
  3433. baseAssignValue(object, key, value);
  3434. }
  3435. }
  3436. /**
  3437. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3438. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3439. * for equality comparisons.
  3440. *
  3441. * @private
  3442. * @param {Object} object The object to modify.
  3443. * @param {string} key The key of the property to assign.
  3444. * @param {*} value The value to assign.
  3445. */
  3446. function assignValue(object, key, value) {
  3447. var objValue = object[key];
  3448. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3449. (value === undefined && !(key in object))) {
  3450. baseAssignValue(object, key, value);
  3451. }
  3452. }
  3453. /**
  3454. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3455. *
  3456. * @private
  3457. * @param {Array} array The array to inspect.
  3458. * @param {*} key The key to search for.
  3459. * @returns {number} Returns the index of the matched value, else `-1`.
  3460. */
  3461. function assocIndexOf(array, key) {
  3462. var length = array.length;
  3463. while (length--) {
  3464. if (eq(array[length][0], key)) {
  3465. return length;
  3466. }
  3467. }
  3468. return -1;
  3469. }
  3470. /**
  3471. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3472. * by `iteratee` and values set by `setter`.
  3473. *
  3474. * @private
  3475. * @param {Array|Object} collection The collection to iterate over.
  3476. * @param {Function} setter The function to set `accumulator` values.
  3477. * @param {Function} iteratee The iteratee to transform keys.
  3478. * @param {Object} accumulator The initial aggregated object.
  3479. * @returns {Function} Returns `accumulator`.
  3480. */
  3481. function baseAggregator(collection, setter, iteratee, accumulator) {
  3482. baseEach(collection, function(value, key, collection) {
  3483. setter(accumulator, value, iteratee(value), collection);
  3484. });
  3485. return accumulator;
  3486. }
  3487. /**
  3488. * The base implementation of `_.assign` without support for multiple sources
  3489. * or `customizer` functions.
  3490. *
  3491. * @private
  3492. * @param {Object} object The destination object.
  3493. * @param {Object} source The source object.
  3494. * @returns {Object} Returns `object`.
  3495. */
  3496. function baseAssign(object, source) {
  3497. return object && copyObject(source, keys(source), object);
  3498. }
  3499. /**
  3500. * The base implementation of `_.assignIn` without support for multiple sources
  3501. * or `customizer` functions.
  3502. *
  3503. * @private
  3504. * @param {Object} object The destination object.
  3505. * @param {Object} source The source object.
  3506. * @returns {Object} Returns `object`.
  3507. */
  3508. function baseAssignIn(object, source) {
  3509. return object && copyObject(source, keysIn(source), object);
  3510. }
  3511. /**
  3512. * The base implementation of `assignValue` and `assignMergeValue` without
  3513. * value checks.
  3514. *
  3515. * @private
  3516. * @param {Object} object The object to modify.
  3517. * @param {string} key The key of the property to assign.
  3518. * @param {*} value The value to assign.
  3519. */
  3520. function baseAssignValue(object, key, value) {
  3521. if (key == '__proto__' && defineProperty) {
  3522. defineProperty(object, key, {
  3523. 'configurable': true,
  3524. 'enumerable': true,
  3525. 'value': value,
  3526. 'writable': true
  3527. });
  3528. } else {
  3529. object[key] = value;
  3530. }
  3531. }
  3532. /**
  3533. * The base implementation of `_.at` without support for individual paths.
  3534. *
  3535. * @private
  3536. * @param {Object} object The object to iterate over.
  3537. * @param {string[]} paths The property paths to pick.
  3538. * @returns {Array} Returns the picked elements.
  3539. */
  3540. function baseAt(object, paths) {
  3541. var index = -1,
  3542. length = paths.length,
  3543. result = Array(length),
  3544. skip = object == null;
  3545. while (++index < length) {
  3546. result[index] = skip ? undefined : get(object, paths[index]);
  3547. }
  3548. return result;
  3549. }
  3550. /**
  3551. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3552. *
  3553. * @private
  3554. * @param {number} number The number to clamp.
  3555. * @param {number} [lower] The lower bound.
  3556. * @param {number} upper The upper bound.
  3557. * @returns {number} Returns the clamped number.
  3558. */
  3559. function baseClamp(number, lower, upper) {
  3560. if (number === number) {
  3561. if (upper !== undefined) {
  3562. number = number <= upper ? number : upper;
  3563. }
  3564. if (lower !== undefined) {
  3565. number = number >= lower ? number : lower;
  3566. }
  3567. }
  3568. return number;
  3569. }
  3570. /**
  3571. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3572. * traversed objects.
  3573. *
  3574. * @private
  3575. * @param {*} value The value to clone.
  3576. * @param {boolean} bitmask The bitmask flags.
  3577. * 1 - Deep clone
  3578. * 2 - Flatten inherited properties
  3579. * 4 - Clone symbols
  3580. * @param {Function} [customizer] The function to customize cloning.
  3581. * @param {string} [key] The key of `value`.
  3582. * @param {Object} [object] The parent object of `value`.
  3583. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3584. * @returns {*} Returns the cloned value.
  3585. */
  3586. function baseClone(value, bitmask, customizer, key, object, stack) {
  3587. var result,
  3588. isDeep = bitmask & CLONE_DEEP_FLAG,
  3589. isFlat = bitmask & CLONE_FLAT_FLAG,
  3590. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3591. if (customizer) {
  3592. result = object ? customizer(value, key, object, stack) : customizer(value);
  3593. }
  3594. if (result !== undefined) {
  3595. return result;
  3596. }
  3597. if (!isObject(value)) {
  3598. return value;
  3599. }
  3600. var isArr = isArray(value);
  3601. if (isArr) {
  3602. result = initCloneArray(value);
  3603. if (!isDeep) {
  3604. return copyArray(value, result);
  3605. }
  3606. } else {
  3607. var tag = getTag(value),
  3608. isFunc = tag == funcTag || tag == genTag;
  3609. if (isBuffer(value)) {
  3610. return cloneBuffer(value, isDeep);
  3611. }
  3612. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3613. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3614. if (!isDeep) {
  3615. return isFlat
  3616. ? copySymbolsIn(value, baseAssignIn(result, value))
  3617. : copySymbols(value, baseAssign(result, value));
  3618. }
  3619. } else {
  3620. if (!cloneableTags[tag]) {
  3621. return object ? value : {};
  3622. }
  3623. result = initCloneByTag(value, tag, isDeep);
  3624. }
  3625. }
  3626. // Check for circular references and return its corresponding clone.
  3627. stack || (stack = new Stack);
  3628. var stacked = stack.get(value);
  3629. if (stacked) {
  3630. return stacked;
  3631. }
  3632. stack.set(value, result);
  3633. if (isSet(value)) {
  3634. value.forEach(function(subValue) {
  3635. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3636. });
  3637. } else if (isMap(value)) {
  3638. value.forEach(function(subValue, key) {
  3639. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3640. });
  3641. }
  3642. var keysFunc = isFull
  3643. ? (isFlat ? getAllKeysIn : getAllKeys)
  3644. : (isFlat ? keysIn : keys);
  3645. var props = isArr ? undefined : keysFunc(value);
  3646. arrayEach(props || value, function(subValue, key) {
  3647. if (props) {
  3648. key = subValue;
  3649. subValue = value[key];
  3650. }
  3651. // Recursively populate clone (susceptible to call stack limits).
  3652. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3653. });
  3654. return result;
  3655. }
  3656. /**
  3657. * The base implementation of `_.conforms` which doesn't clone `source`.
  3658. *
  3659. * @private
  3660. * @param {Object} source The object of property predicates to conform to.
  3661. * @returns {Function} Returns the new spec function.
  3662. */
  3663. function baseConforms(source) {
  3664. var props = keys(source);
  3665. return function(object) {
  3666. return baseConformsTo(object, source, props);
  3667. };
  3668. }
  3669. /**
  3670. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3671. *
  3672. * @private
  3673. * @param {Object} object The object to inspect.
  3674. * @param {Object} source The object of property predicates to conform to.
  3675. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3676. */
  3677. function baseConformsTo(object, source, props) {
  3678. var length = props.length;
  3679. if (object == null) {
  3680. return !length;
  3681. }
  3682. object = Object(object);
  3683. while (length--) {
  3684. var key = props[length],
  3685. predicate = source[key],
  3686. value = object[key];
  3687. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3688. return false;
  3689. }
  3690. }
  3691. return true;
  3692. }
  3693. /**
  3694. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3695. * to provide to `func`.
  3696. *
  3697. * @private
  3698. * @param {Function} func The function to delay.
  3699. * @param {number} wait The number of milliseconds to delay invocation.
  3700. * @param {Array} args The arguments to provide to `func`.
  3701. * @returns {number|Object} Returns the timer id or timeout object.
  3702. */
  3703. function baseDelay(func, wait, args) {
  3704. if (typeof func != 'function') {
  3705. throw new TypeError(FUNC_ERROR_TEXT);
  3706. }
  3707. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3708. }
  3709. /**
  3710. * The base implementation of methods like `_.difference` without support
  3711. * for excluding multiple arrays or iteratee shorthands.
  3712. *
  3713. * @private
  3714. * @param {Array} array The array to inspect.
  3715. * @param {Array} values The values to exclude.
  3716. * @param {Function} [iteratee] The iteratee invoked per element.
  3717. * @param {Function} [comparator] The comparator invoked per element.
  3718. * @returns {Array} Returns the new array of filtered values.
  3719. */
  3720. function baseDifference(array, values, iteratee, comparator) {
  3721. var index = -1,
  3722. includes = arrayIncludes,
  3723. isCommon = true,
  3724. length = array.length,
  3725. result = [],
  3726. valuesLength = values.length;
  3727. if (!length) {
  3728. return result;
  3729. }
  3730. if (iteratee) {
  3731. values = arrayMap(values, baseUnary(iteratee));
  3732. }
  3733. if (comparator) {
  3734. includes = arrayIncludesWith;
  3735. isCommon = false;
  3736. }
  3737. else if (values.length >= LARGE_ARRAY_SIZE) {
  3738. includes = cacheHas;
  3739. isCommon = false;
  3740. values = new SetCache(values);
  3741. }
  3742. outer:
  3743. while (++index < length) {
  3744. var value = array[index],
  3745. computed = iteratee == null ? value : iteratee(value);
  3746. value = (comparator || value !== 0) ? value : 0;
  3747. if (isCommon && computed === computed) {
  3748. var valuesIndex = valuesLength;
  3749. while (valuesIndex--) {
  3750. if (values[valuesIndex] === computed) {
  3751. continue outer;
  3752. }
  3753. }
  3754. result.push(value);
  3755. }
  3756. else if (!includes(values, computed, comparator)) {
  3757. result.push(value);
  3758. }
  3759. }
  3760. return result;
  3761. }
  3762. /**
  3763. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3764. *
  3765. * @private
  3766. * @param {Array|Object} collection The collection to iterate over.
  3767. * @param {Function} iteratee The function invoked per iteration.
  3768. * @returns {Array|Object} Returns `collection`.
  3769. */
  3770. var baseEach = createBaseEach(baseForOwn);
  3771. /**
  3772. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3773. *
  3774. * @private
  3775. * @param {Array|Object} collection The collection to iterate over.
  3776. * @param {Function} iteratee The function invoked per iteration.
  3777. * @returns {Array|Object} Returns `collection`.
  3778. */
  3779. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3780. /**
  3781. * The base implementation of `_.every` without support for iteratee shorthands.
  3782. *
  3783. * @private
  3784. * @param {Array|Object} collection The collection to iterate over.
  3785. * @param {Function} predicate The function invoked per iteration.
  3786. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3787. * else `false`
  3788. */
  3789. function baseEvery(collection, predicate) {
  3790. var result = true;
  3791. baseEach(collection, function(value, index, collection) {
  3792. result = !!predicate(value, index, collection);
  3793. return result;
  3794. });
  3795. return result;
  3796. }
  3797. /**
  3798. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3799. * `comparator` to determine the extremum value.
  3800. *
  3801. * @private
  3802. * @param {Array} array The array to iterate over.
  3803. * @param {Function} iteratee The iteratee invoked per iteration.
  3804. * @param {Function} comparator The comparator used to compare values.
  3805. * @returns {*} Returns the extremum value.
  3806. */
  3807. function baseExtremum(array, iteratee, comparator) {
  3808. var index = -1,
  3809. length = array.length;
  3810. while (++index < length) {
  3811. var value = array[index],
  3812. current = iteratee(value);
  3813. if (current != null && (computed === undefined
  3814. ? (current === current && !isSymbol(current))
  3815. : comparator(current, computed)
  3816. )) {
  3817. var computed = current,
  3818. result = value;
  3819. }
  3820. }
  3821. return result;
  3822. }
  3823. /**
  3824. * The base implementation of `_.fill` without an iteratee call guard.
  3825. *
  3826. * @private
  3827. * @param {Array} array The array to fill.
  3828. * @param {*} value The value to fill `array` with.
  3829. * @param {number} [start=0] The start position.
  3830. * @param {number} [end=array.length] The end position.
  3831. * @returns {Array} Returns `array`.
  3832. */
  3833. function baseFill(array, value, start, end) {
  3834. var length = array.length;
  3835. start = toInteger(start);
  3836. if (start < 0) {
  3837. start = -start > length ? 0 : (length + start);
  3838. }
  3839. end = (end === undefined || end > length) ? length : toInteger(end);
  3840. if (end < 0) {
  3841. end += length;
  3842. }
  3843. end = start > end ? 0 : toLength(end);
  3844. while (start < end) {
  3845. array[start++] = value;
  3846. }
  3847. return array;
  3848. }
  3849. /**
  3850. * The base implementation of `_.filter` without support for iteratee shorthands.
  3851. *
  3852. * @private
  3853. * @param {Array|Object} collection The collection to iterate over.
  3854. * @param {Function} predicate The function invoked per iteration.
  3855. * @returns {Array} Returns the new filtered array.
  3856. */
  3857. function baseFilter(collection, predicate) {
  3858. var result = [];
  3859. baseEach(collection, function(value, index, collection) {
  3860. if (predicate(value, index, collection)) {
  3861. result.push(value);
  3862. }
  3863. });
  3864. return result;
  3865. }
  3866. /**
  3867. * The base implementation of `_.flatten` with support for restricting flattening.
  3868. *
  3869. * @private
  3870. * @param {Array} array The array to flatten.
  3871. * @param {number} depth The maximum recursion depth.
  3872. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3873. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3874. * @param {Array} [result=[]] The initial result value.
  3875. * @returns {Array} Returns the new flattened array.
  3876. */
  3877. function baseFlatten(array, depth, predicate, isStrict, result) {
  3878. var index = -1,
  3879. length = array.length;
  3880. predicate || (predicate = isFlattenable);
  3881. result || (result = []);
  3882. while (++index < length) {
  3883. var value = array[index];
  3884. if (depth > 0 && predicate(value)) {
  3885. if (depth > 1) {
  3886. // Recursively flatten arrays (susceptible to call stack limits).
  3887. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3888. } else {
  3889. arrayPush(result, value);
  3890. }
  3891. } else if (!isStrict) {
  3892. result[result.length] = value;
  3893. }
  3894. }
  3895. return result;
  3896. }
  3897. /**
  3898. * The base implementation of `baseForOwn` which iterates over `object`
  3899. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3900. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3901. *
  3902. * @private
  3903. * @param {Object} object The object to iterate over.
  3904. * @param {Function} iteratee The function invoked per iteration.
  3905. * @param {Function} keysFunc The function to get the keys of `object`.
  3906. * @returns {Object} Returns `object`.
  3907. */
  3908. var baseFor = createBaseFor();
  3909. /**
  3910. * This function is like `baseFor` except that it iterates over properties
  3911. * in the opposite order.
  3912. *
  3913. * @private
  3914. * @param {Object} object The object to iterate over.
  3915. * @param {Function} iteratee The function invoked per iteration.
  3916. * @param {Function} keysFunc The function to get the keys of `object`.
  3917. * @returns {Object} Returns `object`.
  3918. */
  3919. var baseForRight = createBaseFor(true);
  3920. /**
  3921. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3922. *
  3923. * @private
  3924. * @param {Object} object The object to iterate over.
  3925. * @param {Function} iteratee The function invoked per iteration.
  3926. * @returns {Object} Returns `object`.
  3927. */
  3928. function baseForOwn(object, iteratee) {
  3929. return object && baseFor(object, iteratee, keys);
  3930. }
  3931. /**
  3932. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3933. *
  3934. * @private
  3935. * @param {Object} object The object to iterate over.
  3936. * @param {Function} iteratee The function invoked per iteration.
  3937. * @returns {Object} Returns `object`.
  3938. */
  3939. function baseForOwnRight(object, iteratee) {
  3940. return object && baseForRight(object, iteratee, keys);
  3941. }
  3942. /**
  3943. * The base implementation of `_.functions` which creates an array of
  3944. * `object` function property names filtered from `props`.
  3945. *
  3946. * @private
  3947. * @param {Object} object The object to inspect.
  3948. * @param {Array} props The property names to filter.
  3949. * @returns {Array} Returns the function names.
  3950. */
  3951. function baseFunctions(object, props) {
  3952. return arrayFilter(props, function(key) {
  3953. return isFunction(object[key]);
  3954. });
  3955. }
  3956. /**
  3957. * The base implementation of `_.get` without support for default values.
  3958. *
  3959. * @private
  3960. * @param {Object} object The object to query.
  3961. * @param {Array|string} path The path of the property to get.
  3962. * @returns {*} Returns the resolved value.
  3963. */
  3964. function baseGet(object, path) {
  3965. path = castPath(path, object);
  3966. var index = 0,
  3967. length = path.length;
  3968. while (object != null && index < length) {
  3969. object = object[toKey(path[index++])];
  3970. }
  3971. return (index && index == length) ? object : undefined;
  3972. }
  3973. /**
  3974. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3975. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3976. * symbols of `object`.
  3977. *
  3978. * @private
  3979. * @param {Object} object The object to query.
  3980. * @param {Function} keysFunc The function to get the keys of `object`.
  3981. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3982. * @returns {Array} Returns the array of property names and symbols.
  3983. */
  3984. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3985. var result = keysFunc(object);
  3986. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3987. }
  3988. /**
  3989. * The base implementation of `getTag` without fallbacks for buggy environments.
  3990. *
  3991. * @private
  3992. * @param {*} value The value to query.
  3993. * @returns {string} Returns the `toStringTag`.
  3994. */
  3995. function baseGetTag(value) {
  3996. if (value == null) {
  3997. return value === undefined ? undefinedTag : nullTag;
  3998. }
  3999. return (symToStringTag && symToStringTag in Object(value))
  4000. ? getRawTag(value)
  4001. : objectToString(value);
  4002. }
  4003. /**
  4004. * The base implementation of `_.gt` which doesn't coerce arguments.
  4005. *
  4006. * @private
  4007. * @param {*} value The value to compare.
  4008. * @param {*} other The other value to compare.
  4009. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4010. * else `false`.
  4011. */
  4012. function baseGt(value, other) {
  4013. return value > other;
  4014. }
  4015. /**
  4016. * The base implementation of `_.has` without support for deep paths.
  4017. *
  4018. * @private
  4019. * @param {Object} [object] The object to query.
  4020. * @param {Array|string} key The key to check.
  4021. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4022. */
  4023. function baseHas(object, key) {
  4024. return object != null && hasOwnProperty.call(object, key);
  4025. }
  4026. /**
  4027. * The base implementation of `_.hasIn` without support for deep paths.
  4028. *
  4029. * @private
  4030. * @param {Object} [object] The object to query.
  4031. * @param {Array|string} key The key to check.
  4032. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4033. */
  4034. function baseHasIn(object, key) {
  4035. return object != null && key in Object(object);
  4036. }
  4037. /**
  4038. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4039. *
  4040. * @private
  4041. * @param {number} number The number to check.
  4042. * @param {number} start The start of the range.
  4043. * @param {number} end The end of the range.
  4044. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4045. */
  4046. function baseInRange(number, start, end) {
  4047. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4048. }
  4049. /**
  4050. * The base implementation of methods like `_.intersection`, without support
  4051. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4052. *
  4053. * @private
  4054. * @param {Array} arrays The arrays to inspect.
  4055. * @param {Function} [iteratee] The iteratee invoked per element.
  4056. * @param {Function} [comparator] The comparator invoked per element.
  4057. * @returns {Array} Returns the new array of shared values.
  4058. */
  4059. function baseIntersection(arrays, iteratee, comparator) {
  4060. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4061. length = arrays[0].length,
  4062. othLength = arrays.length,
  4063. othIndex = othLength,
  4064. caches = Array(othLength),
  4065. maxLength = Infinity,
  4066. result = [];
  4067. while (othIndex--) {
  4068. var array = arrays[othIndex];
  4069. if (othIndex && iteratee) {
  4070. array = arrayMap(array, baseUnary(iteratee));
  4071. }
  4072. maxLength = nativeMin(array.length, maxLength);
  4073. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4074. ? new SetCache(othIndex && array)
  4075. : undefined;
  4076. }
  4077. array = arrays[0];
  4078. var index = -1,
  4079. seen = caches[0];
  4080. outer:
  4081. while (++index < length && result.length < maxLength) {
  4082. var value = array[index],
  4083. computed = iteratee ? iteratee(value) : value;
  4084. value = (comparator || value !== 0) ? value : 0;
  4085. if (!(seen
  4086. ? cacheHas(seen, computed)
  4087. : includes(result, computed, comparator)
  4088. )) {
  4089. othIndex = othLength;
  4090. while (--othIndex) {
  4091. var cache = caches[othIndex];
  4092. if (!(cache
  4093. ? cacheHas(cache, computed)
  4094. : includes(arrays[othIndex], computed, comparator))
  4095. ) {
  4096. continue outer;
  4097. }
  4098. }
  4099. if (seen) {
  4100. seen.push(computed);
  4101. }
  4102. result.push(value);
  4103. }
  4104. }
  4105. return result;
  4106. }
  4107. /**
  4108. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4109. * `object` with values transformed by `iteratee` and set by `setter`.
  4110. *
  4111. * @private
  4112. * @param {Object} object The object to iterate over.
  4113. * @param {Function} setter The function to set `accumulator` values.
  4114. * @param {Function} iteratee The iteratee to transform values.
  4115. * @param {Object} accumulator The initial inverted object.
  4116. * @returns {Function} Returns `accumulator`.
  4117. */
  4118. function baseInverter(object, setter, iteratee, accumulator) {
  4119. baseForOwn(object, function(value, key, object) {
  4120. setter(accumulator, iteratee(value), key, object);
  4121. });
  4122. return accumulator;
  4123. }
  4124. /**
  4125. * The base implementation of `_.invoke` without support for individual
  4126. * method arguments.
  4127. *
  4128. * @private
  4129. * @param {Object} object The object to query.
  4130. * @param {Array|string} path The path of the method to invoke.
  4131. * @param {Array} args The arguments to invoke the method with.
  4132. * @returns {*} Returns the result of the invoked method.
  4133. */
  4134. function baseInvoke(object, path, args) {
  4135. path = castPath(path, object);
  4136. object = parent(object, path);
  4137. var func = object == null ? object : object[toKey(last(path))];
  4138. return func == null ? undefined : apply(func, object, args);
  4139. }
  4140. /**
  4141. * The base implementation of `_.isArguments`.
  4142. *
  4143. * @private
  4144. * @param {*} value The value to check.
  4145. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4146. */
  4147. function baseIsArguments(value) {
  4148. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4149. }
  4150. /**
  4151. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4152. *
  4153. * @private
  4154. * @param {*} value The value to check.
  4155. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4156. */
  4157. function baseIsArrayBuffer(value) {
  4158. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4159. }
  4160. /**
  4161. * The base implementation of `_.isDate` without Node.js optimizations.
  4162. *
  4163. * @private
  4164. * @param {*} value The value to check.
  4165. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4166. */
  4167. function baseIsDate(value) {
  4168. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4169. }
  4170. /**
  4171. * The base implementation of `_.isEqual` which supports partial comparisons
  4172. * and tracks traversed objects.
  4173. *
  4174. * @private
  4175. * @param {*} value The value to compare.
  4176. * @param {*} other The other value to compare.
  4177. * @param {boolean} bitmask The bitmask flags.
  4178. * 1 - Unordered comparison
  4179. * 2 - Partial comparison
  4180. * @param {Function} [customizer] The function to customize comparisons.
  4181. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4182. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4183. */
  4184. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4185. if (value === other) {
  4186. return true;
  4187. }
  4188. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4189. return value !== value && other !== other;
  4190. }
  4191. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4192. }
  4193. /**
  4194. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4195. * deep comparisons and tracks traversed objects enabling objects with circular
  4196. * references to be compared.
  4197. *
  4198. * @private
  4199. * @param {Object} object The object to compare.
  4200. * @param {Object} other The other object to compare.
  4201. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4202. * @param {Function} customizer The function to customize comparisons.
  4203. * @param {Function} equalFunc The function to determine equivalents of values.
  4204. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4205. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4206. */
  4207. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4208. var objIsArr = isArray(object),
  4209. othIsArr = isArray(other),
  4210. objTag = objIsArr ? arrayTag : getTag(object),
  4211. othTag = othIsArr ? arrayTag : getTag(other);
  4212. objTag = objTag == argsTag ? objectTag : objTag;
  4213. othTag = othTag == argsTag ? objectTag : othTag;
  4214. var objIsObj = objTag == objectTag,
  4215. othIsObj = othTag == objectTag,
  4216. isSameTag = objTag == othTag;
  4217. if (isSameTag && isBuffer(object)) {
  4218. if (!isBuffer(other)) {
  4219. return false;
  4220. }
  4221. objIsArr = true;
  4222. objIsObj = false;
  4223. }
  4224. if (isSameTag && !objIsObj) {
  4225. stack || (stack = new Stack);
  4226. return (objIsArr || isTypedArray(object))
  4227. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4228. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4229. }
  4230. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4231. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4232. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4233. if (objIsWrapped || othIsWrapped) {
  4234. var objUnwrapped = objIsWrapped ? object.value() : object,
  4235. othUnwrapped = othIsWrapped ? other.value() : other;
  4236. stack || (stack = new Stack);
  4237. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4238. }
  4239. }
  4240. if (!isSameTag) {
  4241. return false;
  4242. }
  4243. stack || (stack = new Stack);
  4244. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4245. }
  4246. /**
  4247. * The base implementation of `_.isMap` without Node.js optimizations.
  4248. *
  4249. * @private
  4250. * @param {*} value The value to check.
  4251. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4252. */
  4253. function baseIsMap(value) {
  4254. return isObjectLike(value) && getTag(value) == mapTag;
  4255. }
  4256. /**
  4257. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4258. *
  4259. * @private
  4260. * @param {Object} object The object to inspect.
  4261. * @param {Object} source The object of property values to match.
  4262. * @param {Array} matchData The property names, values, and compare flags to match.
  4263. * @param {Function} [customizer] The function to customize comparisons.
  4264. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4265. */
  4266. function baseIsMatch(object, source, matchData, customizer) {
  4267. var index = matchData.length,
  4268. length = index,
  4269. noCustomizer = !customizer;
  4270. if (object == null) {
  4271. return !length;
  4272. }
  4273. object = Object(object);
  4274. while (index--) {
  4275. var data = matchData[index];
  4276. if ((noCustomizer && data[2])
  4277. ? data[1] !== object[data[0]]
  4278. : !(data[0] in object)
  4279. ) {
  4280. return false;
  4281. }
  4282. }
  4283. while (++index < length) {
  4284. data = matchData[index];
  4285. var key = data[0],
  4286. objValue = object[key],
  4287. srcValue = data[1];
  4288. if (noCustomizer && data[2]) {
  4289. if (objValue === undefined && !(key in object)) {
  4290. return false;
  4291. }
  4292. } else {
  4293. var stack = new Stack;
  4294. if (customizer) {
  4295. var result = customizer(objValue, srcValue, key, object, source, stack);
  4296. }
  4297. if (!(result === undefined
  4298. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4299. : result
  4300. )) {
  4301. return false;
  4302. }
  4303. }
  4304. }
  4305. return true;
  4306. }
  4307. /**
  4308. * The base implementation of `_.isNative` without bad shim checks.
  4309. *
  4310. * @private
  4311. * @param {*} value The value to check.
  4312. * @returns {boolean} Returns `true` if `value` is a native function,
  4313. * else `false`.
  4314. */
  4315. function baseIsNative(value) {
  4316. if (!isObject(value) || isMasked(value)) {
  4317. return false;
  4318. }
  4319. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4320. return pattern.test(toSource(value));
  4321. }
  4322. /**
  4323. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4324. *
  4325. * @private
  4326. * @param {*} value The value to check.
  4327. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4328. */
  4329. function baseIsRegExp(value) {
  4330. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4331. }
  4332. /**
  4333. * The base implementation of `_.isSet` without Node.js optimizations.
  4334. *
  4335. * @private
  4336. * @param {*} value The value to check.
  4337. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4338. */
  4339. function baseIsSet(value) {
  4340. return isObjectLike(value) && getTag(value) == setTag;
  4341. }
  4342. /**
  4343. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4344. *
  4345. * @private
  4346. * @param {*} value The value to check.
  4347. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4348. */
  4349. function baseIsTypedArray(value) {
  4350. return isObjectLike(value) &&
  4351. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4352. }
  4353. /**
  4354. * The base implementation of `_.iteratee`.
  4355. *
  4356. * @private
  4357. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4358. * @returns {Function} Returns the iteratee.
  4359. */
  4360. function baseIteratee(value) {
  4361. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4362. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4363. if (typeof value == 'function') {
  4364. return value;
  4365. }
  4366. if (value == null) {
  4367. return identity;
  4368. }
  4369. if (typeof value == 'object') {
  4370. return isArray(value)
  4371. ? baseMatchesProperty(value[0], value[1])
  4372. : baseMatches(value);
  4373. }
  4374. return property(value);
  4375. }
  4376. /**
  4377. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4378. *
  4379. * @private
  4380. * @param {Object} object The object to query.
  4381. * @returns {Array} Returns the array of property names.
  4382. */
  4383. function baseKeys(object) {
  4384. if (!isPrototype(object)) {
  4385. return nativeKeys(object);
  4386. }
  4387. var result = [];
  4388. for (var key in Object(object)) {
  4389. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4390. result.push(key);
  4391. }
  4392. }
  4393. return result;
  4394. }
  4395. /**
  4396. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4397. *
  4398. * @private
  4399. * @param {Object} object The object to query.
  4400. * @returns {Array} Returns the array of property names.
  4401. */
  4402. function baseKeysIn(object) {
  4403. if (!isObject(object)) {
  4404. return nativeKeysIn(object);
  4405. }
  4406. var isProto = isPrototype(object),
  4407. result = [];
  4408. for (var key in object) {
  4409. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4410. result.push(key);
  4411. }
  4412. }
  4413. return result;
  4414. }
  4415. /**
  4416. * The base implementation of `_.lt` which doesn't coerce arguments.
  4417. *
  4418. * @private
  4419. * @param {*} value The value to compare.
  4420. * @param {*} other The other value to compare.
  4421. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4422. * else `false`.
  4423. */
  4424. function baseLt(value, other) {
  4425. return value < other;
  4426. }
  4427. /**
  4428. * The base implementation of `_.map` without support for iteratee shorthands.
  4429. *
  4430. * @private
  4431. * @param {Array|Object} collection The collection to iterate over.
  4432. * @param {Function} iteratee The function invoked per iteration.
  4433. * @returns {Array} Returns the new mapped array.
  4434. */
  4435. function baseMap(collection, iteratee) {
  4436. var index = -1,
  4437. result = isArrayLike(collection) ? Array(collection.length) : [];
  4438. baseEach(collection, function(value, key, collection) {
  4439. result[++index] = iteratee(value, key, collection);
  4440. });
  4441. return result;
  4442. }
  4443. /**
  4444. * The base implementation of `_.matches` which doesn't clone `source`.
  4445. *
  4446. * @private
  4447. * @param {Object} source The object of property values to match.
  4448. * @returns {Function} Returns the new spec function.
  4449. */
  4450. function baseMatches(source) {
  4451. var matchData = getMatchData(source);
  4452. if (matchData.length == 1 && matchData[0][2]) {
  4453. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4454. }
  4455. return function(object) {
  4456. return object === source || baseIsMatch(object, source, matchData);
  4457. };
  4458. }
  4459. /**
  4460. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4461. *
  4462. * @private
  4463. * @param {string} path The path of the property to get.
  4464. * @param {*} srcValue The value to match.
  4465. * @returns {Function} Returns the new spec function.
  4466. */
  4467. function baseMatchesProperty(path, srcValue) {
  4468. if (isKey(path) && isStrictComparable(srcValue)) {
  4469. return matchesStrictComparable(toKey(path), srcValue);
  4470. }
  4471. return function(object) {
  4472. var objValue = get(object, path);
  4473. return (objValue === undefined && objValue === srcValue)
  4474. ? hasIn(object, path)
  4475. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4476. };
  4477. }
  4478. /**
  4479. * The base implementation of `_.merge` without support for multiple sources.
  4480. *
  4481. * @private
  4482. * @param {Object} object The destination object.
  4483. * @param {Object} source The source object.
  4484. * @param {number} srcIndex The index of `source`.
  4485. * @param {Function} [customizer] The function to customize merged values.
  4486. * @param {Object} [stack] Tracks traversed source values and their merged
  4487. * counterparts.
  4488. */
  4489. function baseMerge(object, source, srcIndex, customizer, stack) {
  4490. if (object === source) {
  4491. return;
  4492. }
  4493. baseFor(source, function(srcValue, key) {
  4494. stack || (stack = new Stack);
  4495. if (isObject(srcValue)) {
  4496. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4497. }
  4498. else {
  4499. var newValue = customizer
  4500. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4501. : undefined;
  4502. if (newValue === undefined) {
  4503. newValue = srcValue;
  4504. }
  4505. assignMergeValue(object, key, newValue);
  4506. }
  4507. }, keysIn);
  4508. }
  4509. /**
  4510. * A specialized version of `baseMerge` for arrays and objects which performs
  4511. * deep merges and tracks traversed objects enabling objects with circular
  4512. * references to be merged.
  4513. *
  4514. * @private
  4515. * @param {Object} object The destination object.
  4516. * @param {Object} source The source object.
  4517. * @param {string} key The key of the value to merge.
  4518. * @param {number} srcIndex The index of `source`.
  4519. * @param {Function} mergeFunc The function to merge values.
  4520. * @param {Function} [customizer] The function to customize assigned values.
  4521. * @param {Object} [stack] Tracks traversed source values and their merged
  4522. * counterparts.
  4523. */
  4524. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4525. var objValue = safeGet(object, key),
  4526. srcValue = safeGet(source, key),
  4527. stacked = stack.get(srcValue);
  4528. if (stacked) {
  4529. assignMergeValue(object, key, stacked);
  4530. return;
  4531. }
  4532. var newValue = customizer
  4533. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4534. : undefined;
  4535. var isCommon = newValue === undefined;
  4536. if (isCommon) {
  4537. var isArr = isArray(srcValue),
  4538. isBuff = !isArr && isBuffer(srcValue),
  4539. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4540. newValue = srcValue;
  4541. if (isArr || isBuff || isTyped) {
  4542. if (isArray(objValue)) {
  4543. newValue = objValue;
  4544. }
  4545. else if (isArrayLikeObject(objValue)) {
  4546. newValue = copyArray(objValue);
  4547. }
  4548. else if (isBuff) {
  4549. isCommon = false;
  4550. newValue = cloneBuffer(srcValue, true);
  4551. }
  4552. else if (isTyped) {
  4553. isCommon = false;
  4554. newValue = cloneTypedArray(srcValue, true);
  4555. }
  4556. else {
  4557. newValue = [];
  4558. }
  4559. }
  4560. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4561. newValue = objValue;
  4562. if (isArguments(objValue)) {
  4563. newValue = toPlainObject(objValue);
  4564. }
  4565. else if (!isObject(objValue) || isFunction(objValue)) {
  4566. newValue = initCloneObject(srcValue);
  4567. }
  4568. }
  4569. else {
  4570. isCommon = false;
  4571. }
  4572. }
  4573. if (isCommon) {
  4574. // Recursively merge objects and arrays (susceptible to call stack limits).
  4575. stack.set(srcValue, newValue);
  4576. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4577. stack['delete'](srcValue);
  4578. }
  4579. assignMergeValue(object, key, newValue);
  4580. }
  4581. /**
  4582. * The base implementation of `_.nth` which doesn't coerce arguments.
  4583. *
  4584. * @private
  4585. * @param {Array} array The array to query.
  4586. * @param {number} n The index of the element to return.
  4587. * @returns {*} Returns the nth element of `array`.
  4588. */
  4589. function baseNth(array, n) {
  4590. var length = array.length;
  4591. if (!length) {
  4592. return;
  4593. }
  4594. n += n < 0 ? length : 0;
  4595. return isIndex(n, length) ? array[n] : undefined;
  4596. }
  4597. /**
  4598. * The base implementation of `_.orderBy` without param guards.
  4599. *
  4600. * @private
  4601. * @param {Array|Object} collection The collection to iterate over.
  4602. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4603. * @param {string[]} orders The sort orders of `iteratees`.
  4604. * @returns {Array} Returns the new sorted array.
  4605. */
  4606. function baseOrderBy(collection, iteratees, orders) {
  4607. if (iteratees.length) {
  4608. iteratees = arrayMap(iteratees, function(iteratee) {
  4609. if (isArray(iteratee)) {
  4610. return function(value) {
  4611. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4612. }
  4613. }
  4614. return iteratee;
  4615. });
  4616. } else {
  4617. iteratees = [identity];
  4618. }
  4619. var index = -1;
  4620. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4621. var result = baseMap(collection, function(value, key, collection) {
  4622. var criteria = arrayMap(iteratees, function(iteratee) {
  4623. return iteratee(value);
  4624. });
  4625. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4626. });
  4627. return baseSortBy(result, function(object, other) {
  4628. return compareMultiple(object, other, orders);
  4629. });
  4630. }
  4631. /**
  4632. * The base implementation of `_.pick` without support for individual
  4633. * property identifiers.
  4634. *
  4635. * @private
  4636. * @param {Object} object The source object.
  4637. * @param {string[]} paths The property paths to pick.
  4638. * @returns {Object} Returns the new object.
  4639. */
  4640. function basePick(object, paths) {
  4641. return basePickBy(object, paths, function(value, path) {
  4642. return hasIn(object, path);
  4643. });
  4644. }
  4645. /**
  4646. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4647. *
  4648. * @private
  4649. * @param {Object} object The source object.
  4650. * @param {string[]} paths The property paths to pick.
  4651. * @param {Function} predicate The function invoked per property.
  4652. * @returns {Object} Returns the new object.
  4653. */
  4654. function basePickBy(object, paths, predicate) {
  4655. var index = -1,
  4656. length = paths.length,
  4657. result = {};
  4658. while (++index < length) {
  4659. var path = paths[index],
  4660. value = baseGet(object, path);
  4661. if (predicate(value, path)) {
  4662. baseSet(result, castPath(path, object), value);
  4663. }
  4664. }
  4665. return result;
  4666. }
  4667. /**
  4668. * A specialized version of `baseProperty` which supports deep paths.
  4669. *
  4670. * @private
  4671. * @param {Array|string} path The path of the property to get.
  4672. * @returns {Function} Returns the new accessor function.
  4673. */
  4674. function basePropertyDeep(path) {
  4675. return function(object) {
  4676. return baseGet(object, path);
  4677. };
  4678. }
  4679. /**
  4680. * The base implementation of `_.pullAllBy` without support for iteratee
  4681. * shorthands.
  4682. *
  4683. * @private
  4684. * @param {Array} array The array to modify.
  4685. * @param {Array} values The values to remove.
  4686. * @param {Function} [iteratee] The iteratee invoked per element.
  4687. * @param {Function} [comparator] The comparator invoked per element.
  4688. * @returns {Array} Returns `array`.
  4689. */
  4690. function basePullAll(array, values, iteratee, comparator) {
  4691. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4692. index = -1,
  4693. length = values.length,
  4694. seen = array;
  4695. if (array === values) {
  4696. values = copyArray(values);
  4697. }
  4698. if (iteratee) {
  4699. seen = arrayMap(array, baseUnary(iteratee));
  4700. }
  4701. while (++index < length) {
  4702. var fromIndex = 0,
  4703. value = values[index],
  4704. computed = iteratee ? iteratee(value) : value;
  4705. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4706. if (seen !== array) {
  4707. splice.call(seen, fromIndex, 1);
  4708. }
  4709. splice.call(array, fromIndex, 1);
  4710. }
  4711. }
  4712. return array;
  4713. }
  4714. /**
  4715. * The base implementation of `_.pullAt` without support for individual
  4716. * indexes or capturing the removed elements.
  4717. *
  4718. * @private
  4719. * @param {Array} array The array to modify.
  4720. * @param {number[]} indexes The indexes of elements to remove.
  4721. * @returns {Array} Returns `array`.
  4722. */
  4723. function basePullAt(array, indexes) {
  4724. var length = array ? indexes.length : 0,
  4725. lastIndex = length - 1;
  4726. while (length--) {
  4727. var index = indexes[length];
  4728. if (length == lastIndex || index !== previous) {
  4729. var previous = index;
  4730. if (isIndex(index)) {
  4731. splice.call(array, index, 1);
  4732. } else {
  4733. baseUnset(array, index);
  4734. }
  4735. }
  4736. }
  4737. return array;
  4738. }
  4739. /**
  4740. * The base implementation of `_.random` without support for returning
  4741. * floating-point numbers.
  4742. *
  4743. * @private
  4744. * @param {number} lower The lower bound.
  4745. * @param {number} upper The upper bound.
  4746. * @returns {number} Returns the random number.
  4747. */
  4748. function baseRandom(lower, upper) {
  4749. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4750. }
  4751. /**
  4752. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4753. * coerce arguments.
  4754. *
  4755. * @private
  4756. * @param {number} start The start of the range.
  4757. * @param {number} end The end of the range.
  4758. * @param {number} step The value to increment or decrement by.
  4759. * @param {boolean} [fromRight] Specify iterating from right to left.
  4760. * @returns {Array} Returns the range of numbers.
  4761. */
  4762. function baseRange(start, end, step, fromRight) {
  4763. var index = -1,
  4764. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4765. result = Array(length);
  4766. while (length--) {
  4767. result[fromRight ? length : ++index] = start;
  4768. start += step;
  4769. }
  4770. return result;
  4771. }
  4772. /**
  4773. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4774. *
  4775. * @private
  4776. * @param {string} string The string to repeat.
  4777. * @param {number} n The number of times to repeat the string.
  4778. * @returns {string} Returns the repeated string.
  4779. */
  4780. function baseRepeat(string, n) {
  4781. var result = '';
  4782. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4783. return result;
  4784. }
  4785. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4786. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4787. do {
  4788. if (n % 2) {
  4789. result += string;
  4790. }
  4791. n = nativeFloor(n / 2);
  4792. if (n) {
  4793. string += string;
  4794. }
  4795. } while (n);
  4796. return result;
  4797. }
  4798. /**
  4799. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4800. *
  4801. * @private
  4802. * @param {Function} func The function to apply a rest parameter to.
  4803. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4804. * @returns {Function} Returns the new function.
  4805. */
  4806. function baseRest(func, start) {
  4807. return setToString(overRest(func, start, identity), func + '');
  4808. }
  4809. /**
  4810. * The base implementation of `_.sample`.
  4811. *
  4812. * @private
  4813. * @param {Array|Object} collection The collection to sample.
  4814. * @returns {*} Returns the random element.
  4815. */
  4816. function baseSample(collection) {
  4817. return arraySample(values(collection));
  4818. }
  4819. /**
  4820. * The base implementation of `_.sampleSize` without param guards.
  4821. *
  4822. * @private
  4823. * @param {Array|Object} collection The collection to sample.
  4824. * @param {number} n The number of elements to sample.
  4825. * @returns {Array} Returns the random elements.
  4826. */
  4827. function baseSampleSize(collection, n) {
  4828. var array = values(collection);
  4829. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4830. }
  4831. /**
  4832. * The base implementation of `_.set`.
  4833. *
  4834. * @private
  4835. * @param {Object} object The object to modify.
  4836. * @param {Array|string} path The path of the property to set.
  4837. * @param {*} value The value to set.
  4838. * @param {Function} [customizer] The function to customize path creation.
  4839. * @returns {Object} Returns `object`.
  4840. */
  4841. function baseSet(object, path, value, customizer) {
  4842. if (!isObject(object)) {
  4843. return object;
  4844. }
  4845. path = castPath(path, object);
  4846. var index = -1,
  4847. length = path.length,
  4848. lastIndex = length - 1,
  4849. nested = object;
  4850. while (nested != null && ++index < length) {
  4851. var key = toKey(path[index]),
  4852. newValue = value;
  4853. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4854. return object;
  4855. }
  4856. if (index != lastIndex) {
  4857. var objValue = nested[key];
  4858. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4859. if (newValue === undefined) {
  4860. newValue = isObject(objValue)
  4861. ? objValue
  4862. : (isIndex(path[index + 1]) ? [] : {});
  4863. }
  4864. }
  4865. assignValue(nested, key, newValue);
  4866. nested = nested[key];
  4867. }
  4868. return object;
  4869. }
  4870. /**
  4871. * The base implementation of `setData` without support for hot loop shorting.
  4872. *
  4873. * @private
  4874. * @param {Function} func The function to associate metadata with.
  4875. * @param {*} data The metadata.
  4876. * @returns {Function} Returns `func`.
  4877. */
  4878. var baseSetData = !metaMap ? identity : function(func, data) {
  4879. metaMap.set(func, data);
  4880. return func;
  4881. };
  4882. /**
  4883. * The base implementation of `setToString` without support for hot loop shorting.
  4884. *
  4885. * @private
  4886. * @param {Function} func The function to modify.
  4887. * @param {Function} string The `toString` result.
  4888. * @returns {Function} Returns `func`.
  4889. */
  4890. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4891. return defineProperty(func, 'toString', {
  4892. 'configurable': true,
  4893. 'enumerable': false,
  4894. 'value': constant(string),
  4895. 'writable': true
  4896. });
  4897. };
  4898. /**
  4899. * The base implementation of `_.shuffle`.
  4900. *
  4901. * @private
  4902. * @param {Array|Object} collection The collection to shuffle.
  4903. * @returns {Array} Returns the new shuffled array.
  4904. */
  4905. function baseShuffle(collection) {
  4906. return shuffleSelf(values(collection));
  4907. }
  4908. /**
  4909. * The base implementation of `_.slice` without an iteratee call guard.
  4910. *
  4911. * @private
  4912. * @param {Array} array The array to slice.
  4913. * @param {number} [start=0] The start position.
  4914. * @param {number} [end=array.length] The end position.
  4915. * @returns {Array} Returns the slice of `array`.
  4916. */
  4917. function baseSlice(array, start, end) {
  4918. var index = -1,
  4919. length = array.length;
  4920. if (start < 0) {
  4921. start = -start > length ? 0 : (length + start);
  4922. }
  4923. end = end > length ? length : end;
  4924. if (end < 0) {
  4925. end += length;
  4926. }
  4927. length = start > end ? 0 : ((end - start) >>> 0);
  4928. start >>>= 0;
  4929. var result = Array(length);
  4930. while (++index < length) {
  4931. result[index] = array[index + start];
  4932. }
  4933. return result;
  4934. }
  4935. /**
  4936. * The base implementation of `_.some` without support for iteratee shorthands.
  4937. *
  4938. * @private
  4939. * @param {Array|Object} collection The collection to iterate over.
  4940. * @param {Function} predicate The function invoked per iteration.
  4941. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4942. * else `false`.
  4943. */
  4944. function baseSome(collection, predicate) {
  4945. var result;
  4946. baseEach(collection, function(value, index, collection) {
  4947. result = predicate(value, index, collection);
  4948. return !result;
  4949. });
  4950. return !!result;
  4951. }
  4952. /**
  4953. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4954. * performs a binary search of `array` to determine the index at which `value`
  4955. * should be inserted into `array` in order to maintain its sort order.
  4956. *
  4957. * @private
  4958. * @param {Array} array The sorted array to inspect.
  4959. * @param {*} value The value to evaluate.
  4960. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4961. * @returns {number} Returns the index at which `value` should be inserted
  4962. * into `array`.
  4963. */
  4964. function baseSortedIndex(array, value, retHighest) {
  4965. var low = 0,
  4966. high = array == null ? low : array.length;
  4967. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4968. while (low < high) {
  4969. var mid = (low + high) >>> 1,
  4970. computed = array[mid];
  4971. if (computed !== null && !isSymbol(computed) &&
  4972. (retHighest ? (computed <= value) : (computed < value))) {
  4973. low = mid + 1;
  4974. } else {
  4975. high = mid;
  4976. }
  4977. }
  4978. return high;
  4979. }
  4980. return baseSortedIndexBy(array, value, identity, retHighest);
  4981. }
  4982. /**
  4983. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4984. * which invokes `iteratee` for `value` and each element of `array` to compute
  4985. * their sort ranking. The iteratee is invoked with one argument; (value).
  4986. *
  4987. * @private
  4988. * @param {Array} array The sorted array to inspect.
  4989. * @param {*} value The value to evaluate.
  4990. * @param {Function} iteratee The iteratee invoked per element.
  4991. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4992. * @returns {number} Returns the index at which `value` should be inserted
  4993. * into `array`.
  4994. */
  4995. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4996. var low = 0,
  4997. high = array == null ? 0 : array.length;
  4998. if (high === 0) {
  4999. return 0;
  5000. }
  5001. value = iteratee(value);
  5002. var valIsNaN = value !== value,
  5003. valIsNull = value === null,
  5004. valIsSymbol = isSymbol(value),
  5005. valIsUndefined = value === undefined;
  5006. while (low < high) {
  5007. var mid = nativeFloor((low + high) / 2),
  5008. computed = iteratee(array[mid]),
  5009. othIsDefined = computed !== undefined,
  5010. othIsNull = computed === null,
  5011. othIsReflexive = computed === computed,
  5012. othIsSymbol = isSymbol(computed);
  5013. if (valIsNaN) {
  5014. var setLow = retHighest || othIsReflexive;
  5015. } else if (valIsUndefined) {
  5016. setLow = othIsReflexive && (retHighest || othIsDefined);
  5017. } else if (valIsNull) {
  5018. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5019. } else if (valIsSymbol) {
  5020. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5021. } else if (othIsNull || othIsSymbol) {
  5022. setLow = false;
  5023. } else {
  5024. setLow = retHighest ? (computed <= value) : (computed < value);
  5025. }
  5026. if (setLow) {
  5027. low = mid + 1;
  5028. } else {
  5029. high = mid;
  5030. }
  5031. }
  5032. return nativeMin(high, MAX_ARRAY_INDEX);
  5033. }
  5034. /**
  5035. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5036. * support for iteratee shorthands.
  5037. *
  5038. * @private
  5039. * @param {Array} array The array to inspect.
  5040. * @param {Function} [iteratee] The iteratee invoked per element.
  5041. * @returns {Array} Returns the new duplicate free array.
  5042. */
  5043. function baseSortedUniq(array, iteratee) {
  5044. var index = -1,
  5045. length = array.length,
  5046. resIndex = 0,
  5047. result = [];
  5048. while (++index < length) {
  5049. var value = array[index],
  5050. computed = iteratee ? iteratee(value) : value;
  5051. if (!index || !eq(computed, seen)) {
  5052. var seen = computed;
  5053. result[resIndex++] = value === 0 ? 0 : value;
  5054. }
  5055. }
  5056. return result;
  5057. }
  5058. /**
  5059. * The base implementation of `_.toNumber` which doesn't ensure correct
  5060. * conversions of binary, hexadecimal, or octal string values.
  5061. *
  5062. * @private
  5063. * @param {*} value The value to process.
  5064. * @returns {number} Returns the number.
  5065. */
  5066. function baseToNumber(value) {
  5067. if (typeof value == 'number') {
  5068. return value;
  5069. }
  5070. if (isSymbol(value)) {
  5071. return NAN;
  5072. }
  5073. return +value;
  5074. }
  5075. /**
  5076. * The base implementation of `_.toString` which doesn't convert nullish
  5077. * values to empty strings.
  5078. *
  5079. * @private
  5080. * @param {*} value The value to process.
  5081. * @returns {string} Returns the string.
  5082. */
  5083. function baseToString(value) {
  5084. // Exit early for strings to avoid a performance hit in some environments.
  5085. if (typeof value == 'string') {
  5086. return value;
  5087. }
  5088. if (isArray(value)) {
  5089. // Recursively convert values (susceptible to call stack limits).
  5090. return arrayMap(value, baseToString) + '';
  5091. }
  5092. if (isSymbol(value)) {
  5093. return symbolToString ? symbolToString.call(value) : '';
  5094. }
  5095. var result = (value + '');
  5096. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5097. }
  5098. /**
  5099. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5100. *
  5101. * @private
  5102. * @param {Array} array The array to inspect.
  5103. * @param {Function} [iteratee] The iteratee invoked per element.
  5104. * @param {Function} [comparator] The comparator invoked per element.
  5105. * @returns {Array} Returns the new duplicate free array.
  5106. */
  5107. function baseUniq(array, iteratee, comparator) {
  5108. var index = -1,
  5109. includes = arrayIncludes,
  5110. length = array.length,
  5111. isCommon = true,
  5112. result = [],
  5113. seen = result;
  5114. if (comparator) {
  5115. isCommon = false;
  5116. includes = arrayIncludesWith;
  5117. }
  5118. else if (length >= LARGE_ARRAY_SIZE) {
  5119. var set = iteratee ? null : createSet(array);
  5120. if (set) {
  5121. return setToArray(set);
  5122. }
  5123. isCommon = false;
  5124. includes = cacheHas;
  5125. seen = new SetCache;
  5126. }
  5127. else {
  5128. seen = iteratee ? [] : result;
  5129. }
  5130. outer:
  5131. while (++index < length) {
  5132. var value = array[index],
  5133. computed = iteratee ? iteratee(value) : value;
  5134. value = (comparator || value !== 0) ? value : 0;
  5135. if (isCommon && computed === computed) {
  5136. var seenIndex = seen.length;
  5137. while (seenIndex--) {
  5138. if (seen[seenIndex] === computed) {
  5139. continue outer;
  5140. }
  5141. }
  5142. if (iteratee) {
  5143. seen.push(computed);
  5144. }
  5145. result.push(value);
  5146. }
  5147. else if (!includes(seen, computed, comparator)) {
  5148. if (seen !== result) {
  5149. seen.push(computed);
  5150. }
  5151. result.push(value);
  5152. }
  5153. }
  5154. return result;
  5155. }
  5156. /**
  5157. * The base implementation of `_.unset`.
  5158. *
  5159. * @private
  5160. * @param {Object} object The object to modify.
  5161. * @param {Array|string} path The property path to unset.
  5162. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5163. */
  5164. function baseUnset(object, path) {
  5165. path = castPath(path, object);
  5166. object = parent(object, path);
  5167. return object == null || delete object[toKey(last(path))];
  5168. }
  5169. /**
  5170. * The base implementation of `_.update`.
  5171. *
  5172. * @private
  5173. * @param {Object} object The object to modify.
  5174. * @param {Array|string} path The path of the property to update.
  5175. * @param {Function} updater The function to produce the updated value.
  5176. * @param {Function} [customizer] The function to customize path creation.
  5177. * @returns {Object} Returns `object`.
  5178. */
  5179. function baseUpdate(object, path, updater, customizer) {
  5180. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5181. }
  5182. /**
  5183. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5184. * without support for iteratee shorthands.
  5185. *
  5186. * @private
  5187. * @param {Array} array The array to query.
  5188. * @param {Function} predicate The function invoked per iteration.
  5189. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5190. * @param {boolean} [fromRight] Specify iterating from right to left.
  5191. * @returns {Array} Returns the slice of `array`.
  5192. */
  5193. function baseWhile(array, predicate, isDrop, fromRight) {
  5194. var length = array.length,
  5195. index = fromRight ? length : -1;
  5196. while ((fromRight ? index-- : ++index < length) &&
  5197. predicate(array[index], index, array)) {}
  5198. return isDrop
  5199. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5200. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5201. }
  5202. /**
  5203. * The base implementation of `wrapperValue` which returns the result of
  5204. * performing a sequence of actions on the unwrapped `value`, where each
  5205. * successive action is supplied the return value of the previous.
  5206. *
  5207. * @private
  5208. * @param {*} value The unwrapped value.
  5209. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5210. * @returns {*} Returns the resolved value.
  5211. */
  5212. function baseWrapperValue(value, actions) {
  5213. var result = value;
  5214. if (result instanceof LazyWrapper) {
  5215. result = result.value();
  5216. }
  5217. return arrayReduce(actions, function(result, action) {
  5218. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5219. }, result);
  5220. }
  5221. /**
  5222. * The base implementation of methods like `_.xor`, without support for
  5223. * iteratee shorthands, that accepts an array of arrays to inspect.
  5224. *
  5225. * @private
  5226. * @param {Array} arrays The arrays to inspect.
  5227. * @param {Function} [iteratee] The iteratee invoked per element.
  5228. * @param {Function} [comparator] The comparator invoked per element.
  5229. * @returns {Array} Returns the new array of values.
  5230. */
  5231. function baseXor(arrays, iteratee, comparator) {
  5232. var length = arrays.length;
  5233. if (length < 2) {
  5234. return length ? baseUniq(arrays[0]) : [];
  5235. }
  5236. var index = -1,
  5237. result = Array(length);
  5238. while (++index < length) {
  5239. var array = arrays[index],
  5240. othIndex = -1;
  5241. while (++othIndex < length) {
  5242. if (othIndex != index) {
  5243. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5244. }
  5245. }
  5246. }
  5247. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5248. }
  5249. /**
  5250. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5251. *
  5252. * @private
  5253. * @param {Array} props The property identifiers.
  5254. * @param {Array} values The property values.
  5255. * @param {Function} assignFunc The function to assign values.
  5256. * @returns {Object} Returns the new object.
  5257. */
  5258. function baseZipObject(props, values, assignFunc) {
  5259. var index = -1,
  5260. length = props.length,
  5261. valsLength = values.length,
  5262. result = {};
  5263. while (++index < length) {
  5264. var value = index < valsLength ? values[index] : undefined;
  5265. assignFunc(result, props[index], value);
  5266. }
  5267. return result;
  5268. }
  5269. /**
  5270. * Casts `value` to an empty array if it's not an array like object.
  5271. *
  5272. * @private
  5273. * @param {*} value The value to inspect.
  5274. * @returns {Array|Object} Returns the cast array-like object.
  5275. */
  5276. function castArrayLikeObject(value) {
  5277. return isArrayLikeObject(value) ? value : [];
  5278. }
  5279. /**
  5280. * Casts `value` to `identity` if it's not a function.
  5281. *
  5282. * @private
  5283. * @param {*} value The value to inspect.
  5284. * @returns {Function} Returns cast function.
  5285. */
  5286. function castFunction(value) {
  5287. return typeof value == 'function' ? value : identity;
  5288. }
  5289. /**
  5290. * Casts `value` to a path array if it's not one.
  5291. *
  5292. * @private
  5293. * @param {*} value The value to inspect.
  5294. * @param {Object} [object] The object to query keys on.
  5295. * @returns {Array} Returns the cast property path array.
  5296. */
  5297. function castPath(value, object) {
  5298. if (isArray(value)) {
  5299. return value;
  5300. }
  5301. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5302. }
  5303. /**
  5304. * A `baseRest` alias which can be replaced with `identity` by module
  5305. * replacement plugins.
  5306. *
  5307. * @private
  5308. * @type {Function}
  5309. * @param {Function} func The function to apply a rest parameter to.
  5310. * @returns {Function} Returns the new function.
  5311. */
  5312. var castRest = baseRest;
  5313. /**
  5314. * Casts `array` to a slice if it's needed.
  5315. *
  5316. * @private
  5317. * @param {Array} array The array to inspect.
  5318. * @param {number} start The start position.
  5319. * @param {number} [end=array.length] The end position.
  5320. * @returns {Array} Returns the cast slice.
  5321. */
  5322. function castSlice(array, start, end) {
  5323. var length = array.length;
  5324. end = end === undefined ? length : end;
  5325. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5326. }
  5327. /**
  5328. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5329. *
  5330. * @private
  5331. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5332. */
  5333. var clearTimeout = ctxClearTimeout || function(id) {
  5334. return root.clearTimeout(id);
  5335. };
  5336. /**
  5337. * Creates a clone of `buffer`.
  5338. *
  5339. * @private
  5340. * @param {Buffer} buffer The buffer to clone.
  5341. * @param {boolean} [isDeep] Specify a deep clone.
  5342. * @returns {Buffer} Returns the cloned buffer.
  5343. */
  5344. function cloneBuffer(buffer, isDeep) {
  5345. if (isDeep) {
  5346. return buffer.slice();
  5347. }
  5348. var length = buffer.length,
  5349. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5350. buffer.copy(result);
  5351. return result;
  5352. }
  5353. /**
  5354. * Creates a clone of `arrayBuffer`.
  5355. *
  5356. * @private
  5357. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5358. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5359. */
  5360. function cloneArrayBuffer(arrayBuffer) {
  5361. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5362. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5363. return result;
  5364. }
  5365. /**
  5366. * Creates a clone of `dataView`.
  5367. *
  5368. * @private
  5369. * @param {Object} dataView The data view to clone.
  5370. * @param {boolean} [isDeep] Specify a deep clone.
  5371. * @returns {Object} Returns the cloned data view.
  5372. */
  5373. function cloneDataView(dataView, isDeep) {
  5374. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5375. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5376. }
  5377. /**
  5378. * Creates a clone of `regexp`.
  5379. *
  5380. * @private
  5381. * @param {Object} regexp The regexp to clone.
  5382. * @returns {Object} Returns the cloned regexp.
  5383. */
  5384. function cloneRegExp(regexp) {
  5385. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5386. result.lastIndex = regexp.lastIndex;
  5387. return result;
  5388. }
  5389. /**
  5390. * Creates a clone of the `symbol` object.
  5391. *
  5392. * @private
  5393. * @param {Object} symbol The symbol object to clone.
  5394. * @returns {Object} Returns the cloned symbol object.
  5395. */
  5396. function cloneSymbol(symbol) {
  5397. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5398. }
  5399. /**
  5400. * Creates a clone of `typedArray`.
  5401. *
  5402. * @private
  5403. * @param {Object} typedArray The typed array to clone.
  5404. * @param {boolean} [isDeep] Specify a deep clone.
  5405. * @returns {Object} Returns the cloned typed array.
  5406. */
  5407. function cloneTypedArray(typedArray, isDeep) {
  5408. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5409. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5410. }
  5411. /**
  5412. * Compares values to sort them in ascending order.
  5413. *
  5414. * @private
  5415. * @param {*} value The value to compare.
  5416. * @param {*} other The other value to compare.
  5417. * @returns {number} Returns the sort order indicator for `value`.
  5418. */
  5419. function compareAscending(value, other) {
  5420. if (value !== other) {
  5421. var valIsDefined = value !== undefined,
  5422. valIsNull = value === null,
  5423. valIsReflexive = value === value,
  5424. valIsSymbol = isSymbol(value);
  5425. var othIsDefined = other !== undefined,
  5426. othIsNull = other === null,
  5427. othIsReflexive = other === other,
  5428. othIsSymbol = isSymbol(other);
  5429. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5430. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5431. (valIsNull && othIsDefined && othIsReflexive) ||
  5432. (!valIsDefined && othIsReflexive) ||
  5433. !valIsReflexive) {
  5434. return 1;
  5435. }
  5436. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5437. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5438. (othIsNull && valIsDefined && valIsReflexive) ||
  5439. (!othIsDefined && valIsReflexive) ||
  5440. !othIsReflexive) {
  5441. return -1;
  5442. }
  5443. }
  5444. return 0;
  5445. }
  5446. /**
  5447. * Used by `_.orderBy` to compare multiple properties of a value to another
  5448. * and stable sort them.
  5449. *
  5450. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5451. * specify an order of "desc" for descending or "asc" for ascending sort order
  5452. * of corresponding values.
  5453. *
  5454. * @private
  5455. * @param {Object} object The object to compare.
  5456. * @param {Object} other The other object to compare.
  5457. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5458. * @returns {number} Returns the sort order indicator for `object`.
  5459. */
  5460. function compareMultiple(object, other, orders) {
  5461. var index = -1,
  5462. objCriteria = object.criteria,
  5463. othCriteria = other.criteria,
  5464. length = objCriteria.length,
  5465. ordersLength = orders.length;
  5466. while (++index < length) {
  5467. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5468. if (result) {
  5469. if (index >= ordersLength) {
  5470. return result;
  5471. }
  5472. var order = orders[index];
  5473. return result * (order == 'desc' ? -1 : 1);
  5474. }
  5475. }
  5476. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5477. // that causes it, under certain circumstances, to provide the same value for
  5478. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5479. // for more details.
  5480. //
  5481. // This also ensures a stable sort in V8 and other engines.
  5482. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5483. return object.index - other.index;
  5484. }
  5485. /**
  5486. * Creates an array that is the composition of partially applied arguments,
  5487. * placeholders, and provided arguments into a single array of arguments.
  5488. *
  5489. * @private
  5490. * @param {Array} args The provided arguments.
  5491. * @param {Array} partials The arguments to prepend to those provided.
  5492. * @param {Array} holders The `partials` placeholder indexes.
  5493. * @params {boolean} [isCurried] Specify composing for a curried function.
  5494. * @returns {Array} Returns the new array of composed arguments.
  5495. */
  5496. function composeArgs(args, partials, holders, isCurried) {
  5497. var argsIndex = -1,
  5498. argsLength = args.length,
  5499. holdersLength = holders.length,
  5500. leftIndex = -1,
  5501. leftLength = partials.length,
  5502. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5503. result = Array(leftLength + rangeLength),
  5504. isUncurried = !isCurried;
  5505. while (++leftIndex < leftLength) {
  5506. result[leftIndex] = partials[leftIndex];
  5507. }
  5508. while (++argsIndex < holdersLength) {
  5509. if (isUncurried || argsIndex < argsLength) {
  5510. result[holders[argsIndex]] = args[argsIndex];
  5511. }
  5512. }
  5513. while (rangeLength--) {
  5514. result[leftIndex++] = args[argsIndex++];
  5515. }
  5516. return result;
  5517. }
  5518. /**
  5519. * This function is like `composeArgs` except that the arguments composition
  5520. * is tailored for `_.partialRight`.
  5521. *
  5522. * @private
  5523. * @param {Array} args The provided arguments.
  5524. * @param {Array} partials The arguments to append to those provided.
  5525. * @param {Array} holders The `partials` placeholder indexes.
  5526. * @params {boolean} [isCurried] Specify composing for a curried function.
  5527. * @returns {Array} Returns the new array of composed arguments.
  5528. */
  5529. function composeArgsRight(args, partials, holders, isCurried) {
  5530. var argsIndex = -1,
  5531. argsLength = args.length,
  5532. holdersIndex = -1,
  5533. holdersLength = holders.length,
  5534. rightIndex = -1,
  5535. rightLength = partials.length,
  5536. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5537. result = Array(rangeLength + rightLength),
  5538. isUncurried = !isCurried;
  5539. while (++argsIndex < rangeLength) {
  5540. result[argsIndex] = args[argsIndex];
  5541. }
  5542. var offset = argsIndex;
  5543. while (++rightIndex < rightLength) {
  5544. result[offset + rightIndex] = partials[rightIndex];
  5545. }
  5546. while (++holdersIndex < holdersLength) {
  5547. if (isUncurried || argsIndex < argsLength) {
  5548. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5549. }
  5550. }
  5551. return result;
  5552. }
  5553. /**
  5554. * Copies the values of `source` to `array`.
  5555. *
  5556. * @private
  5557. * @param {Array} source The array to copy values from.
  5558. * @param {Array} [array=[]] The array to copy values to.
  5559. * @returns {Array} Returns `array`.
  5560. */
  5561. function copyArray(source, array) {
  5562. var index = -1,
  5563. length = source.length;
  5564. array || (array = Array(length));
  5565. while (++index < length) {
  5566. array[index] = source[index];
  5567. }
  5568. return array;
  5569. }
  5570. /**
  5571. * Copies properties of `source` to `object`.
  5572. *
  5573. * @private
  5574. * @param {Object} source The object to copy properties from.
  5575. * @param {Array} props The property identifiers to copy.
  5576. * @param {Object} [object={}] The object to copy properties to.
  5577. * @param {Function} [customizer] The function to customize copied values.
  5578. * @returns {Object} Returns `object`.
  5579. */
  5580. function copyObject(source, props, object, customizer) {
  5581. var isNew = !object;
  5582. object || (object = {});
  5583. var index = -1,
  5584. length = props.length;
  5585. while (++index < length) {
  5586. var key = props[index];
  5587. var newValue = customizer
  5588. ? customizer(object[key], source[key], key, object, source)
  5589. : undefined;
  5590. if (newValue === undefined) {
  5591. newValue = source[key];
  5592. }
  5593. if (isNew) {
  5594. baseAssignValue(object, key, newValue);
  5595. } else {
  5596. assignValue(object, key, newValue);
  5597. }
  5598. }
  5599. return object;
  5600. }
  5601. /**
  5602. * Copies own symbols of `source` to `object`.
  5603. *
  5604. * @private
  5605. * @param {Object} source The object to copy symbols from.
  5606. * @param {Object} [object={}] The object to copy symbols to.
  5607. * @returns {Object} Returns `object`.
  5608. */
  5609. function copySymbols(source, object) {
  5610. return copyObject(source, getSymbols(source), object);
  5611. }
  5612. /**
  5613. * Copies own and inherited symbols of `source` to `object`.
  5614. *
  5615. * @private
  5616. * @param {Object} source The object to copy symbols from.
  5617. * @param {Object} [object={}] The object to copy symbols to.
  5618. * @returns {Object} Returns `object`.
  5619. */
  5620. function copySymbolsIn(source, object) {
  5621. return copyObject(source, getSymbolsIn(source), object);
  5622. }
  5623. /**
  5624. * Creates a function like `_.groupBy`.
  5625. *
  5626. * @private
  5627. * @param {Function} setter The function to set accumulator values.
  5628. * @param {Function} [initializer] The accumulator object initializer.
  5629. * @returns {Function} Returns the new aggregator function.
  5630. */
  5631. function createAggregator(setter, initializer) {
  5632. return function(collection, iteratee) {
  5633. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5634. accumulator = initializer ? initializer() : {};
  5635. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5636. };
  5637. }
  5638. /**
  5639. * Creates a function like `_.assign`.
  5640. *
  5641. * @private
  5642. * @param {Function} assigner The function to assign values.
  5643. * @returns {Function} Returns the new assigner function.
  5644. */
  5645. function createAssigner(assigner) {
  5646. return baseRest(function(object, sources) {
  5647. var index = -1,
  5648. length = sources.length,
  5649. customizer = length > 1 ? sources[length - 1] : undefined,
  5650. guard = length > 2 ? sources[2] : undefined;
  5651. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5652. ? (length--, customizer)
  5653. : undefined;
  5654. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5655. customizer = length < 3 ? undefined : customizer;
  5656. length = 1;
  5657. }
  5658. object = Object(object);
  5659. while (++index < length) {
  5660. var source = sources[index];
  5661. if (source) {
  5662. assigner(object, source, index, customizer);
  5663. }
  5664. }
  5665. return object;
  5666. });
  5667. }
  5668. /**
  5669. * Creates a `baseEach` or `baseEachRight` function.
  5670. *
  5671. * @private
  5672. * @param {Function} eachFunc The function to iterate over a collection.
  5673. * @param {boolean} [fromRight] Specify iterating from right to left.
  5674. * @returns {Function} Returns the new base function.
  5675. */
  5676. function createBaseEach(eachFunc, fromRight) {
  5677. return function(collection, iteratee) {
  5678. if (collection == null) {
  5679. return collection;
  5680. }
  5681. if (!isArrayLike(collection)) {
  5682. return eachFunc(collection, iteratee);
  5683. }
  5684. var length = collection.length,
  5685. index = fromRight ? length : -1,
  5686. iterable = Object(collection);
  5687. while ((fromRight ? index-- : ++index < length)) {
  5688. if (iteratee(iterable[index], index, iterable) === false) {
  5689. break;
  5690. }
  5691. }
  5692. return collection;
  5693. };
  5694. }
  5695. /**
  5696. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5697. *
  5698. * @private
  5699. * @param {boolean} [fromRight] Specify iterating from right to left.
  5700. * @returns {Function} Returns the new base function.
  5701. */
  5702. function createBaseFor(fromRight) {
  5703. return function(object, iteratee, keysFunc) {
  5704. var index = -1,
  5705. iterable = Object(object),
  5706. props = keysFunc(object),
  5707. length = props.length;
  5708. while (length--) {
  5709. var key = props[fromRight ? length : ++index];
  5710. if (iteratee(iterable[key], key, iterable) === false) {
  5711. break;
  5712. }
  5713. }
  5714. return object;
  5715. };
  5716. }
  5717. /**
  5718. * Creates a function that wraps `func` to invoke it with the optional `this`
  5719. * binding of `thisArg`.
  5720. *
  5721. * @private
  5722. * @param {Function} func The function to wrap.
  5723. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5724. * @param {*} [thisArg] The `this` binding of `func`.
  5725. * @returns {Function} Returns the new wrapped function.
  5726. */
  5727. function createBind(func, bitmask, thisArg) {
  5728. var isBind = bitmask & WRAP_BIND_FLAG,
  5729. Ctor = createCtor(func);
  5730. function wrapper() {
  5731. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5732. return fn.apply(isBind ? thisArg : this, arguments);
  5733. }
  5734. return wrapper;
  5735. }
  5736. /**
  5737. * Creates a function like `_.lowerFirst`.
  5738. *
  5739. * @private
  5740. * @param {string} methodName The name of the `String` case method to use.
  5741. * @returns {Function} Returns the new case function.
  5742. */
  5743. function createCaseFirst(methodName) {
  5744. return function(string) {
  5745. string = toString(string);
  5746. var strSymbols = hasUnicode(string)
  5747. ? stringToArray(string)
  5748. : undefined;
  5749. var chr = strSymbols
  5750. ? strSymbols[0]
  5751. : string.charAt(0);
  5752. var trailing = strSymbols
  5753. ? castSlice(strSymbols, 1).join('')
  5754. : string.slice(1);
  5755. return chr[methodName]() + trailing;
  5756. };
  5757. }
  5758. /**
  5759. * Creates a function like `_.camelCase`.
  5760. *
  5761. * @private
  5762. * @param {Function} callback The function to combine each word.
  5763. * @returns {Function} Returns the new compounder function.
  5764. */
  5765. function createCompounder(callback) {
  5766. return function(string) {
  5767. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5768. };
  5769. }
  5770. /**
  5771. * Creates a function that produces an instance of `Ctor` regardless of
  5772. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5773. *
  5774. * @private
  5775. * @param {Function} Ctor The constructor to wrap.
  5776. * @returns {Function} Returns the new wrapped function.
  5777. */
  5778. function createCtor(Ctor) {
  5779. return function() {
  5780. // Use a `switch` statement to work with class constructors. See
  5781. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5782. // for more details.
  5783. var args = arguments;
  5784. switch (args.length) {
  5785. case 0: return new Ctor;
  5786. case 1: return new Ctor(args[0]);
  5787. case 2: return new Ctor(args[0], args[1]);
  5788. case 3: return new Ctor(args[0], args[1], args[2]);
  5789. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5790. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5791. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5792. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5793. }
  5794. var thisBinding = baseCreate(Ctor.prototype),
  5795. result = Ctor.apply(thisBinding, args);
  5796. // Mimic the constructor's `return` behavior.
  5797. // See https://es5.github.io/#x13.2.2 for more details.
  5798. return isObject(result) ? result : thisBinding;
  5799. };
  5800. }
  5801. /**
  5802. * Creates a function that wraps `func` to enable currying.
  5803. *
  5804. * @private
  5805. * @param {Function} func The function to wrap.
  5806. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5807. * @param {number} arity The arity of `func`.
  5808. * @returns {Function} Returns the new wrapped function.
  5809. */
  5810. function createCurry(func, bitmask, arity) {
  5811. var Ctor = createCtor(func);
  5812. function wrapper() {
  5813. var length = arguments.length,
  5814. args = Array(length),
  5815. index = length,
  5816. placeholder = getHolder(wrapper);
  5817. while (index--) {
  5818. args[index] = arguments[index];
  5819. }
  5820. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5821. ? []
  5822. : replaceHolders(args, placeholder);
  5823. length -= holders.length;
  5824. if (length < arity) {
  5825. return createRecurry(
  5826. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5827. args, holders, undefined, undefined, arity - length);
  5828. }
  5829. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5830. return apply(fn, this, args);
  5831. }
  5832. return wrapper;
  5833. }
  5834. /**
  5835. * Creates a `_.find` or `_.findLast` function.
  5836. *
  5837. * @private
  5838. * @param {Function} findIndexFunc The function to find the collection index.
  5839. * @returns {Function} Returns the new find function.
  5840. */
  5841. function createFind(findIndexFunc) {
  5842. return function(collection, predicate, fromIndex) {
  5843. var iterable = Object(collection);
  5844. if (!isArrayLike(collection)) {
  5845. var iteratee = getIteratee(predicate, 3);
  5846. collection = keys(collection);
  5847. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5848. }
  5849. var index = findIndexFunc(collection, predicate, fromIndex);
  5850. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5851. };
  5852. }
  5853. /**
  5854. * Creates a `_.flow` or `_.flowRight` function.
  5855. *
  5856. * @private
  5857. * @param {boolean} [fromRight] Specify iterating from right to left.
  5858. * @returns {Function} Returns the new flow function.
  5859. */
  5860. function createFlow(fromRight) {
  5861. return flatRest(function(funcs) {
  5862. var length = funcs.length,
  5863. index = length,
  5864. prereq = LodashWrapper.prototype.thru;
  5865. if (fromRight) {
  5866. funcs.reverse();
  5867. }
  5868. while (index--) {
  5869. var func = funcs[index];
  5870. if (typeof func != 'function') {
  5871. throw new TypeError(FUNC_ERROR_TEXT);
  5872. }
  5873. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5874. var wrapper = new LodashWrapper([], true);
  5875. }
  5876. }
  5877. index = wrapper ? index : length;
  5878. while (++index < length) {
  5879. func = funcs[index];
  5880. var funcName = getFuncName(func),
  5881. data = funcName == 'wrapper' ? getData(func) : undefined;
  5882. if (data && isLaziable(data[0]) &&
  5883. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5884. !data[4].length && data[9] == 1
  5885. ) {
  5886. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5887. } else {
  5888. wrapper = (func.length == 1 && isLaziable(func))
  5889. ? wrapper[funcName]()
  5890. : wrapper.thru(func);
  5891. }
  5892. }
  5893. return function() {
  5894. var args = arguments,
  5895. value = args[0];
  5896. if (wrapper && args.length == 1 && isArray(value)) {
  5897. return wrapper.plant(value).value();
  5898. }
  5899. var index = 0,
  5900. result = length ? funcs[index].apply(this, args) : value;
  5901. while (++index < length) {
  5902. result = funcs[index].call(this, result);
  5903. }
  5904. return result;
  5905. };
  5906. });
  5907. }
  5908. /**
  5909. * Creates a function that wraps `func` to invoke it with optional `this`
  5910. * binding of `thisArg`, partial application, and currying.
  5911. *
  5912. * @private
  5913. * @param {Function|string} func The function or method name to wrap.
  5914. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5915. * @param {*} [thisArg] The `this` binding of `func`.
  5916. * @param {Array} [partials] The arguments to prepend to those provided to
  5917. * the new function.
  5918. * @param {Array} [holders] The `partials` placeholder indexes.
  5919. * @param {Array} [partialsRight] The arguments to append to those provided
  5920. * to the new function.
  5921. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5922. * @param {Array} [argPos] The argument positions of the new function.
  5923. * @param {number} [ary] The arity cap of `func`.
  5924. * @param {number} [arity] The arity of `func`.
  5925. * @returns {Function} Returns the new wrapped function.
  5926. */
  5927. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5928. var isAry = bitmask & WRAP_ARY_FLAG,
  5929. isBind = bitmask & WRAP_BIND_FLAG,
  5930. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5931. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5932. isFlip = bitmask & WRAP_FLIP_FLAG,
  5933. Ctor = isBindKey ? undefined : createCtor(func);
  5934. function wrapper() {
  5935. var length = arguments.length,
  5936. args = Array(length),
  5937. index = length;
  5938. while (index--) {
  5939. args[index] = arguments[index];
  5940. }
  5941. if (isCurried) {
  5942. var placeholder = getHolder(wrapper),
  5943. holdersCount = countHolders(args, placeholder);
  5944. }
  5945. if (partials) {
  5946. args = composeArgs(args, partials, holders, isCurried);
  5947. }
  5948. if (partialsRight) {
  5949. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5950. }
  5951. length -= holdersCount;
  5952. if (isCurried && length < arity) {
  5953. var newHolders = replaceHolders(args, placeholder);
  5954. return createRecurry(
  5955. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5956. args, newHolders, argPos, ary, arity - length
  5957. );
  5958. }
  5959. var thisBinding = isBind ? thisArg : this,
  5960. fn = isBindKey ? thisBinding[func] : func;
  5961. length = args.length;
  5962. if (argPos) {
  5963. args = reorder(args, argPos);
  5964. } else if (isFlip && length > 1) {
  5965. args.reverse();
  5966. }
  5967. if (isAry && ary < length) {
  5968. args.length = ary;
  5969. }
  5970. if (this && this !== root && this instanceof wrapper) {
  5971. fn = Ctor || createCtor(fn);
  5972. }
  5973. return fn.apply(thisBinding, args);
  5974. }
  5975. return wrapper;
  5976. }
  5977. /**
  5978. * Creates a function like `_.invertBy`.
  5979. *
  5980. * @private
  5981. * @param {Function} setter The function to set accumulator values.
  5982. * @param {Function} toIteratee The function to resolve iteratees.
  5983. * @returns {Function} Returns the new inverter function.
  5984. */
  5985. function createInverter(setter, toIteratee) {
  5986. return function(object, iteratee) {
  5987. return baseInverter(object, setter, toIteratee(iteratee), {});
  5988. };
  5989. }
  5990. /**
  5991. * Creates a function that performs a mathematical operation on two values.
  5992. *
  5993. * @private
  5994. * @param {Function} operator The function to perform the operation.
  5995. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5996. * @returns {Function} Returns the new mathematical operation function.
  5997. */
  5998. function createMathOperation(operator, defaultValue) {
  5999. return function(value, other) {
  6000. var result;
  6001. if (value === undefined && other === undefined) {
  6002. return defaultValue;
  6003. }
  6004. if (value !== undefined) {
  6005. result = value;
  6006. }
  6007. if (other !== undefined) {
  6008. if (result === undefined) {
  6009. return other;
  6010. }
  6011. if (typeof value == 'string' || typeof other == 'string') {
  6012. value = baseToString(value);
  6013. other = baseToString(other);
  6014. } else {
  6015. value = baseToNumber(value);
  6016. other = baseToNumber(other);
  6017. }
  6018. result = operator(value, other);
  6019. }
  6020. return result;
  6021. };
  6022. }
  6023. /**
  6024. * Creates a function like `_.over`.
  6025. *
  6026. * @private
  6027. * @param {Function} arrayFunc The function to iterate over iteratees.
  6028. * @returns {Function} Returns the new over function.
  6029. */
  6030. function createOver(arrayFunc) {
  6031. return flatRest(function(iteratees) {
  6032. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6033. return baseRest(function(args) {
  6034. var thisArg = this;
  6035. return arrayFunc(iteratees, function(iteratee) {
  6036. return apply(iteratee, thisArg, args);
  6037. });
  6038. });
  6039. });
  6040. }
  6041. /**
  6042. * Creates the padding for `string` based on `length`. The `chars` string
  6043. * is truncated if the number of characters exceeds `length`.
  6044. *
  6045. * @private
  6046. * @param {number} length The padding length.
  6047. * @param {string} [chars=' '] The string used as padding.
  6048. * @returns {string} Returns the padding for `string`.
  6049. */
  6050. function createPadding(length, chars) {
  6051. chars = chars === undefined ? ' ' : baseToString(chars);
  6052. var charsLength = chars.length;
  6053. if (charsLength < 2) {
  6054. return charsLength ? baseRepeat(chars, length) : chars;
  6055. }
  6056. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6057. return hasUnicode(chars)
  6058. ? castSlice(stringToArray(result), 0, length).join('')
  6059. : result.slice(0, length);
  6060. }
  6061. /**
  6062. * Creates a function that wraps `func` to invoke it with the `this` binding
  6063. * of `thisArg` and `partials` prepended to the arguments it receives.
  6064. *
  6065. * @private
  6066. * @param {Function} func The function to wrap.
  6067. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6068. * @param {*} thisArg The `this` binding of `func`.
  6069. * @param {Array} partials The arguments to prepend to those provided to
  6070. * the new function.
  6071. * @returns {Function} Returns the new wrapped function.
  6072. */
  6073. function createPartial(func, bitmask, thisArg, partials) {
  6074. var isBind = bitmask & WRAP_BIND_FLAG,
  6075. Ctor = createCtor(func);
  6076. function wrapper() {
  6077. var argsIndex = -1,
  6078. argsLength = arguments.length,
  6079. leftIndex = -1,
  6080. leftLength = partials.length,
  6081. args = Array(leftLength + argsLength),
  6082. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6083. while (++leftIndex < leftLength) {
  6084. args[leftIndex] = partials[leftIndex];
  6085. }
  6086. while (argsLength--) {
  6087. args[leftIndex++] = arguments[++argsIndex];
  6088. }
  6089. return apply(fn, isBind ? thisArg : this, args);
  6090. }
  6091. return wrapper;
  6092. }
  6093. /**
  6094. * Creates a `_.range` or `_.rangeRight` function.
  6095. *
  6096. * @private
  6097. * @param {boolean} [fromRight] Specify iterating from right to left.
  6098. * @returns {Function} Returns the new range function.
  6099. */
  6100. function createRange(fromRight) {
  6101. return function(start, end, step) {
  6102. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6103. end = step = undefined;
  6104. }
  6105. // Ensure the sign of `-0` is preserved.
  6106. start = toFinite(start);
  6107. if (end === undefined) {
  6108. end = start;
  6109. start = 0;
  6110. } else {
  6111. end = toFinite(end);
  6112. }
  6113. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6114. return baseRange(start, end, step, fromRight);
  6115. };
  6116. }
  6117. /**
  6118. * Creates a function that performs a relational operation on two values.
  6119. *
  6120. * @private
  6121. * @param {Function} operator The function to perform the operation.
  6122. * @returns {Function} Returns the new relational operation function.
  6123. */
  6124. function createRelationalOperation(operator) {
  6125. return function(value, other) {
  6126. if (!(typeof value == 'string' && typeof other == 'string')) {
  6127. value = toNumber(value);
  6128. other = toNumber(other);
  6129. }
  6130. return operator(value, other);
  6131. };
  6132. }
  6133. /**
  6134. * Creates a function that wraps `func` to continue currying.
  6135. *
  6136. * @private
  6137. * @param {Function} func The function to wrap.
  6138. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6139. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6140. * @param {*} placeholder The placeholder value.
  6141. * @param {*} [thisArg] The `this` binding of `func`.
  6142. * @param {Array} [partials] The arguments to prepend to those provided to
  6143. * the new function.
  6144. * @param {Array} [holders] The `partials` placeholder indexes.
  6145. * @param {Array} [argPos] The argument positions of the new function.
  6146. * @param {number} [ary] The arity cap of `func`.
  6147. * @param {number} [arity] The arity of `func`.
  6148. * @returns {Function} Returns the new wrapped function.
  6149. */
  6150. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6151. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6152. newHolders = isCurry ? holders : undefined,
  6153. newHoldersRight = isCurry ? undefined : holders,
  6154. newPartials = isCurry ? partials : undefined,
  6155. newPartialsRight = isCurry ? undefined : partials;
  6156. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6157. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6158. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6159. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6160. }
  6161. var newData = [
  6162. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6163. newHoldersRight, argPos, ary, arity
  6164. ];
  6165. var result = wrapFunc.apply(undefined, newData);
  6166. if (isLaziable(func)) {
  6167. setData(result, newData);
  6168. }
  6169. result.placeholder = placeholder;
  6170. return setWrapToString(result, func, bitmask);
  6171. }
  6172. /**
  6173. * Creates a function like `_.round`.
  6174. *
  6175. * @private
  6176. * @param {string} methodName The name of the `Math` method to use when rounding.
  6177. * @returns {Function} Returns the new round function.
  6178. */
  6179. function createRound(methodName) {
  6180. var func = Math[methodName];
  6181. return function(number, precision) {
  6182. number = toNumber(number);
  6183. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6184. if (precision && nativeIsFinite(number)) {
  6185. // Shift with exponential notation to avoid floating-point issues.
  6186. // See [MDN](https://mdn.io/round#Examples) for more details.
  6187. var pair = (toString(number) + 'e').split('e'),
  6188. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6189. pair = (toString(value) + 'e').split('e');
  6190. return +(pair[0] + 'e' + (+pair[1] - precision));
  6191. }
  6192. return func(number);
  6193. };
  6194. }
  6195. /**
  6196. * Creates a set object of `values`.
  6197. *
  6198. * @private
  6199. * @param {Array} values The values to add to the set.
  6200. * @returns {Object} Returns the new set.
  6201. */
  6202. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6203. return new Set(values);
  6204. };
  6205. /**
  6206. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6207. *
  6208. * @private
  6209. * @param {Function} keysFunc The function to get the keys of a given object.
  6210. * @returns {Function} Returns the new pairs function.
  6211. */
  6212. function createToPairs(keysFunc) {
  6213. return function(object) {
  6214. var tag = getTag(object);
  6215. if (tag == mapTag) {
  6216. return mapToArray(object);
  6217. }
  6218. if (tag == setTag) {
  6219. return setToPairs(object);
  6220. }
  6221. return baseToPairs(object, keysFunc(object));
  6222. };
  6223. }
  6224. /**
  6225. * Creates a function that either curries or invokes `func` with optional
  6226. * `this` binding and partially applied arguments.
  6227. *
  6228. * @private
  6229. * @param {Function|string} func The function or method name to wrap.
  6230. * @param {number} bitmask The bitmask flags.
  6231. * 1 - `_.bind`
  6232. * 2 - `_.bindKey`
  6233. * 4 - `_.curry` or `_.curryRight` of a bound function
  6234. * 8 - `_.curry`
  6235. * 16 - `_.curryRight`
  6236. * 32 - `_.partial`
  6237. * 64 - `_.partialRight`
  6238. * 128 - `_.rearg`
  6239. * 256 - `_.ary`
  6240. * 512 - `_.flip`
  6241. * @param {*} [thisArg] The `this` binding of `func`.
  6242. * @param {Array} [partials] The arguments to be partially applied.
  6243. * @param {Array} [holders] The `partials` placeholder indexes.
  6244. * @param {Array} [argPos] The argument positions of the new function.
  6245. * @param {number} [ary] The arity cap of `func`.
  6246. * @param {number} [arity] The arity of `func`.
  6247. * @returns {Function} Returns the new wrapped function.
  6248. */
  6249. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6250. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6251. if (!isBindKey && typeof func != 'function') {
  6252. throw new TypeError(FUNC_ERROR_TEXT);
  6253. }
  6254. var length = partials ? partials.length : 0;
  6255. if (!length) {
  6256. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6257. partials = holders = undefined;
  6258. }
  6259. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6260. arity = arity === undefined ? arity : toInteger(arity);
  6261. length -= holders ? holders.length : 0;
  6262. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6263. var partialsRight = partials,
  6264. holdersRight = holders;
  6265. partials = holders = undefined;
  6266. }
  6267. var data = isBindKey ? undefined : getData(func);
  6268. var newData = [
  6269. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6270. argPos, ary, arity
  6271. ];
  6272. if (data) {
  6273. mergeData(newData, data);
  6274. }
  6275. func = newData[0];
  6276. bitmask = newData[1];
  6277. thisArg = newData[2];
  6278. partials = newData[3];
  6279. holders = newData[4];
  6280. arity = newData[9] = newData[9] === undefined
  6281. ? (isBindKey ? 0 : func.length)
  6282. : nativeMax(newData[9] - length, 0);
  6283. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6284. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6285. }
  6286. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6287. var result = createBind(func, bitmask, thisArg);
  6288. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6289. result = createCurry(func, bitmask, arity);
  6290. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6291. result = createPartial(func, bitmask, thisArg, partials);
  6292. } else {
  6293. result = createHybrid.apply(undefined, newData);
  6294. }
  6295. var setter = data ? baseSetData : setData;
  6296. return setWrapToString(setter(result, newData), func, bitmask);
  6297. }
  6298. /**
  6299. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6300. * of source objects to the destination object for all destination properties
  6301. * that resolve to `undefined`.
  6302. *
  6303. * @private
  6304. * @param {*} objValue The destination value.
  6305. * @param {*} srcValue The source value.
  6306. * @param {string} key The key of the property to assign.
  6307. * @param {Object} object The parent object of `objValue`.
  6308. * @returns {*} Returns the value to assign.
  6309. */
  6310. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6311. if (objValue === undefined ||
  6312. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6313. return srcValue;
  6314. }
  6315. return objValue;
  6316. }
  6317. /**
  6318. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6319. * objects into destination objects that are passed thru.
  6320. *
  6321. * @private
  6322. * @param {*} objValue The destination value.
  6323. * @param {*} srcValue The source value.
  6324. * @param {string} key The key of the property to merge.
  6325. * @param {Object} object The parent object of `objValue`.
  6326. * @param {Object} source The parent object of `srcValue`.
  6327. * @param {Object} [stack] Tracks traversed source values and their merged
  6328. * counterparts.
  6329. * @returns {*} Returns the value to assign.
  6330. */
  6331. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6332. if (isObject(objValue) && isObject(srcValue)) {
  6333. // Recursively merge objects and arrays (susceptible to call stack limits).
  6334. stack.set(srcValue, objValue);
  6335. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6336. stack['delete'](srcValue);
  6337. }
  6338. return objValue;
  6339. }
  6340. /**
  6341. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6342. * objects.
  6343. *
  6344. * @private
  6345. * @param {*} value The value to inspect.
  6346. * @param {string} key The key of the property to inspect.
  6347. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6348. */
  6349. function customOmitClone(value) {
  6350. return isPlainObject(value) ? undefined : value;
  6351. }
  6352. /**
  6353. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6354. * partial deep comparisons.
  6355. *
  6356. * @private
  6357. * @param {Array} array The array to compare.
  6358. * @param {Array} other The other array to compare.
  6359. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6360. * @param {Function} customizer The function to customize comparisons.
  6361. * @param {Function} equalFunc The function to determine equivalents of values.
  6362. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6363. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6364. */
  6365. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6366. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6367. arrLength = array.length,
  6368. othLength = other.length;
  6369. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6370. return false;
  6371. }
  6372. // Check that cyclic values are equal.
  6373. var arrStacked = stack.get(array);
  6374. var othStacked = stack.get(other);
  6375. if (arrStacked && othStacked) {
  6376. return arrStacked == other && othStacked == array;
  6377. }
  6378. var index = -1,
  6379. result = true,
  6380. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6381. stack.set(array, other);
  6382. stack.set(other, array);
  6383. // Ignore non-index properties.
  6384. while (++index < arrLength) {
  6385. var arrValue = array[index],
  6386. othValue = other[index];
  6387. if (customizer) {
  6388. var compared = isPartial
  6389. ? customizer(othValue, arrValue, index, other, array, stack)
  6390. : customizer(arrValue, othValue, index, array, other, stack);
  6391. }
  6392. if (compared !== undefined) {
  6393. if (compared) {
  6394. continue;
  6395. }
  6396. result = false;
  6397. break;
  6398. }
  6399. // Recursively compare arrays (susceptible to call stack limits).
  6400. if (seen) {
  6401. if (!arraySome(other, function(othValue, othIndex) {
  6402. if (!cacheHas(seen, othIndex) &&
  6403. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6404. return seen.push(othIndex);
  6405. }
  6406. })) {
  6407. result = false;
  6408. break;
  6409. }
  6410. } else if (!(
  6411. arrValue === othValue ||
  6412. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6413. )) {
  6414. result = false;
  6415. break;
  6416. }
  6417. }
  6418. stack['delete'](array);
  6419. stack['delete'](other);
  6420. return result;
  6421. }
  6422. /**
  6423. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6424. * the same `toStringTag`.
  6425. *
  6426. * **Note:** This function only supports comparing values with tags of
  6427. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6428. *
  6429. * @private
  6430. * @param {Object} object The object to compare.
  6431. * @param {Object} other The other object to compare.
  6432. * @param {string} tag The `toStringTag` of the objects to compare.
  6433. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6434. * @param {Function} customizer The function to customize comparisons.
  6435. * @param {Function} equalFunc The function to determine equivalents of values.
  6436. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6437. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6438. */
  6439. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6440. switch (tag) {
  6441. case dataViewTag:
  6442. if ((object.byteLength != other.byteLength) ||
  6443. (object.byteOffset != other.byteOffset)) {
  6444. return false;
  6445. }
  6446. object = object.buffer;
  6447. other = other.buffer;
  6448. case arrayBufferTag:
  6449. if ((object.byteLength != other.byteLength) ||
  6450. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6451. return false;
  6452. }
  6453. return true;
  6454. case boolTag:
  6455. case dateTag:
  6456. case numberTag:
  6457. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6458. // Invalid dates are coerced to `NaN`.
  6459. return eq(+object, +other);
  6460. case errorTag:
  6461. return object.name == other.name && object.message == other.message;
  6462. case regexpTag:
  6463. case stringTag:
  6464. // Coerce regexes to strings and treat strings, primitives and objects,
  6465. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6466. // for more details.
  6467. return object == (other + '');
  6468. case mapTag:
  6469. var convert = mapToArray;
  6470. case setTag:
  6471. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6472. convert || (convert = setToArray);
  6473. if (object.size != other.size && !isPartial) {
  6474. return false;
  6475. }
  6476. // Assume cyclic values are equal.
  6477. var stacked = stack.get(object);
  6478. if (stacked) {
  6479. return stacked == other;
  6480. }
  6481. bitmask |= COMPARE_UNORDERED_FLAG;
  6482. // Recursively compare objects (susceptible to call stack limits).
  6483. stack.set(object, other);
  6484. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6485. stack['delete'](object);
  6486. return result;
  6487. case symbolTag:
  6488. if (symbolValueOf) {
  6489. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6490. }
  6491. }
  6492. return false;
  6493. }
  6494. /**
  6495. * A specialized version of `baseIsEqualDeep` for objects with support for
  6496. * partial deep comparisons.
  6497. *
  6498. * @private
  6499. * @param {Object} object The object to compare.
  6500. * @param {Object} other The other object to compare.
  6501. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6502. * @param {Function} customizer The function to customize comparisons.
  6503. * @param {Function} equalFunc The function to determine equivalents of values.
  6504. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6505. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6506. */
  6507. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6508. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6509. objProps = getAllKeys(object),
  6510. objLength = objProps.length,
  6511. othProps = getAllKeys(other),
  6512. othLength = othProps.length;
  6513. if (objLength != othLength && !isPartial) {
  6514. return false;
  6515. }
  6516. var index = objLength;
  6517. while (index--) {
  6518. var key = objProps[index];
  6519. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6520. return false;
  6521. }
  6522. }
  6523. // Check that cyclic values are equal.
  6524. var objStacked = stack.get(object);
  6525. var othStacked = stack.get(other);
  6526. if (objStacked && othStacked) {
  6527. return objStacked == other && othStacked == object;
  6528. }
  6529. var result = true;
  6530. stack.set(object, other);
  6531. stack.set(other, object);
  6532. var skipCtor = isPartial;
  6533. while (++index < objLength) {
  6534. key = objProps[index];
  6535. var objValue = object[key],
  6536. othValue = other[key];
  6537. if (customizer) {
  6538. var compared = isPartial
  6539. ? customizer(othValue, objValue, key, other, object, stack)
  6540. : customizer(objValue, othValue, key, object, other, stack);
  6541. }
  6542. // Recursively compare objects (susceptible to call stack limits).
  6543. if (!(compared === undefined
  6544. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6545. : compared
  6546. )) {
  6547. result = false;
  6548. break;
  6549. }
  6550. skipCtor || (skipCtor = key == 'constructor');
  6551. }
  6552. if (result && !skipCtor) {
  6553. var objCtor = object.constructor,
  6554. othCtor = other.constructor;
  6555. // Non `Object` object instances with different constructors are not equal.
  6556. if (objCtor != othCtor &&
  6557. ('constructor' in object && 'constructor' in other) &&
  6558. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6559. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6560. result = false;
  6561. }
  6562. }
  6563. stack['delete'](object);
  6564. stack['delete'](other);
  6565. return result;
  6566. }
  6567. /**
  6568. * A specialized version of `baseRest` which flattens the rest array.
  6569. *
  6570. * @private
  6571. * @param {Function} func The function to apply a rest parameter to.
  6572. * @returns {Function} Returns the new function.
  6573. */
  6574. function flatRest(func) {
  6575. return setToString(overRest(func, undefined, flatten), func + '');
  6576. }
  6577. /**
  6578. * Creates an array of own enumerable property names and symbols of `object`.
  6579. *
  6580. * @private
  6581. * @param {Object} object The object to query.
  6582. * @returns {Array} Returns the array of property names and symbols.
  6583. */
  6584. function getAllKeys(object) {
  6585. return baseGetAllKeys(object, keys, getSymbols);
  6586. }
  6587. /**
  6588. * Creates an array of own and inherited enumerable property names and
  6589. * symbols of `object`.
  6590. *
  6591. * @private
  6592. * @param {Object} object The object to query.
  6593. * @returns {Array} Returns the array of property names and symbols.
  6594. */
  6595. function getAllKeysIn(object) {
  6596. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6597. }
  6598. /**
  6599. * Gets metadata for `func`.
  6600. *
  6601. * @private
  6602. * @param {Function} func The function to query.
  6603. * @returns {*} Returns the metadata for `func`.
  6604. */
  6605. var getData = !metaMap ? noop : function(func) {
  6606. return metaMap.get(func);
  6607. };
  6608. /**
  6609. * Gets the name of `func`.
  6610. *
  6611. * @private
  6612. * @param {Function} func The function to query.
  6613. * @returns {string} Returns the function name.
  6614. */
  6615. function getFuncName(func) {
  6616. var result = (func.name + ''),
  6617. array = realNames[result],
  6618. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6619. while (length--) {
  6620. var data = array[length],
  6621. otherFunc = data.func;
  6622. if (otherFunc == null || otherFunc == func) {
  6623. return data.name;
  6624. }
  6625. }
  6626. return result;
  6627. }
  6628. /**
  6629. * Gets the argument placeholder value for `func`.
  6630. *
  6631. * @private
  6632. * @param {Function} func The function to inspect.
  6633. * @returns {*} Returns the placeholder value.
  6634. */
  6635. function getHolder(func) {
  6636. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6637. return object.placeholder;
  6638. }
  6639. /**
  6640. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6641. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6642. * If arguments are provided, the chosen function is invoked with them and
  6643. * its result is returned.
  6644. *
  6645. * @private
  6646. * @param {*} [value] The value to convert to an iteratee.
  6647. * @param {number} [arity] The arity of the created iteratee.
  6648. * @returns {Function} Returns the chosen function or its result.
  6649. */
  6650. function getIteratee() {
  6651. var result = lodash.iteratee || iteratee;
  6652. result = result === iteratee ? baseIteratee : result;
  6653. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6654. }
  6655. /**
  6656. * Gets the data for `map`.
  6657. *
  6658. * @private
  6659. * @param {Object} map The map to query.
  6660. * @param {string} key The reference key.
  6661. * @returns {*} Returns the map data.
  6662. */
  6663. function getMapData(map, key) {
  6664. var data = map.__data__;
  6665. return isKeyable(key)
  6666. ? data[typeof key == 'string' ? 'string' : 'hash']
  6667. : data.map;
  6668. }
  6669. /**
  6670. * Gets the property names, values, and compare flags of `object`.
  6671. *
  6672. * @private
  6673. * @param {Object} object The object to query.
  6674. * @returns {Array} Returns the match data of `object`.
  6675. */
  6676. function getMatchData(object) {
  6677. var result = keys(object),
  6678. length = result.length;
  6679. while (length--) {
  6680. var key = result[length],
  6681. value = object[key];
  6682. result[length] = [key, value, isStrictComparable(value)];
  6683. }
  6684. return result;
  6685. }
  6686. /**
  6687. * Gets the native function at `key` of `object`.
  6688. *
  6689. * @private
  6690. * @param {Object} object The object to query.
  6691. * @param {string} key The key of the method to get.
  6692. * @returns {*} Returns the function if it's native, else `undefined`.
  6693. */
  6694. function getNative(object, key) {
  6695. var value = getValue(object, key);
  6696. return baseIsNative(value) ? value : undefined;
  6697. }
  6698. /**
  6699. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6700. *
  6701. * @private
  6702. * @param {*} value The value to query.
  6703. * @returns {string} Returns the raw `toStringTag`.
  6704. */
  6705. function getRawTag(value) {
  6706. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6707. tag = value[symToStringTag];
  6708. try {
  6709. value[symToStringTag] = undefined;
  6710. var unmasked = true;
  6711. } catch (e) {}
  6712. var result = nativeObjectToString.call(value);
  6713. if (unmasked) {
  6714. if (isOwn) {
  6715. value[symToStringTag] = tag;
  6716. } else {
  6717. delete value[symToStringTag];
  6718. }
  6719. }
  6720. return result;
  6721. }
  6722. /**
  6723. * Creates an array of the own enumerable symbols of `object`.
  6724. *
  6725. * @private
  6726. * @param {Object} object The object to query.
  6727. * @returns {Array} Returns the array of symbols.
  6728. */
  6729. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6730. if (object == null) {
  6731. return [];
  6732. }
  6733. object = Object(object);
  6734. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6735. return propertyIsEnumerable.call(object, symbol);
  6736. });
  6737. };
  6738. /**
  6739. * Creates an array of the own and inherited enumerable symbols of `object`.
  6740. *
  6741. * @private
  6742. * @param {Object} object The object to query.
  6743. * @returns {Array} Returns the array of symbols.
  6744. */
  6745. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6746. var result = [];
  6747. while (object) {
  6748. arrayPush(result, getSymbols(object));
  6749. object = getPrototype(object);
  6750. }
  6751. return result;
  6752. };
  6753. /**
  6754. * Gets the `toStringTag` of `value`.
  6755. *
  6756. * @private
  6757. * @param {*} value The value to query.
  6758. * @returns {string} Returns the `toStringTag`.
  6759. */
  6760. var getTag = baseGetTag;
  6761. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6762. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6763. (Map && getTag(new Map) != mapTag) ||
  6764. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6765. (Set && getTag(new Set) != setTag) ||
  6766. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6767. getTag = function(value) {
  6768. var result = baseGetTag(value),
  6769. Ctor = result == objectTag ? value.constructor : undefined,
  6770. ctorString = Ctor ? toSource(Ctor) : '';
  6771. if (ctorString) {
  6772. switch (ctorString) {
  6773. case dataViewCtorString: return dataViewTag;
  6774. case mapCtorString: return mapTag;
  6775. case promiseCtorString: return promiseTag;
  6776. case setCtorString: return setTag;
  6777. case weakMapCtorString: return weakMapTag;
  6778. }
  6779. }
  6780. return result;
  6781. };
  6782. }
  6783. /**
  6784. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6785. *
  6786. * @private
  6787. * @param {number} start The start of the view.
  6788. * @param {number} end The end of the view.
  6789. * @param {Array} transforms The transformations to apply to the view.
  6790. * @returns {Object} Returns an object containing the `start` and `end`
  6791. * positions of the view.
  6792. */
  6793. function getView(start, end, transforms) {
  6794. var index = -1,
  6795. length = transforms.length;
  6796. while (++index < length) {
  6797. var data = transforms[index],
  6798. size = data.size;
  6799. switch (data.type) {
  6800. case 'drop': start += size; break;
  6801. case 'dropRight': end -= size; break;
  6802. case 'take': end = nativeMin(end, start + size); break;
  6803. case 'takeRight': start = nativeMax(start, end - size); break;
  6804. }
  6805. }
  6806. return { 'start': start, 'end': end };
  6807. }
  6808. /**
  6809. * Extracts wrapper details from the `source` body comment.
  6810. *
  6811. * @private
  6812. * @param {string} source The source to inspect.
  6813. * @returns {Array} Returns the wrapper details.
  6814. */
  6815. function getWrapDetails(source) {
  6816. var match = source.match(reWrapDetails);
  6817. return match ? match[1].split(reSplitDetails) : [];
  6818. }
  6819. /**
  6820. * Checks if `path` exists on `object`.
  6821. *
  6822. * @private
  6823. * @param {Object} object The object to query.
  6824. * @param {Array|string} path The path to check.
  6825. * @param {Function} hasFunc The function to check properties.
  6826. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6827. */
  6828. function hasPath(object, path, hasFunc) {
  6829. path = castPath(path, object);
  6830. var index = -1,
  6831. length = path.length,
  6832. result = false;
  6833. while (++index < length) {
  6834. var key = toKey(path[index]);
  6835. if (!(result = object != null && hasFunc(object, key))) {
  6836. break;
  6837. }
  6838. object = object[key];
  6839. }
  6840. if (result || ++index != length) {
  6841. return result;
  6842. }
  6843. length = object == null ? 0 : object.length;
  6844. return !!length && isLength(length) && isIndex(key, length) &&
  6845. (isArray(object) || isArguments(object));
  6846. }
  6847. /**
  6848. * Initializes an array clone.
  6849. *
  6850. * @private
  6851. * @param {Array} array The array to clone.
  6852. * @returns {Array} Returns the initialized clone.
  6853. */
  6854. function initCloneArray(array) {
  6855. var length = array.length,
  6856. result = new array.constructor(length);
  6857. // Add properties assigned by `RegExp#exec`.
  6858. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6859. result.index = array.index;
  6860. result.input = array.input;
  6861. }
  6862. return result;
  6863. }
  6864. /**
  6865. * Initializes an object clone.
  6866. *
  6867. * @private
  6868. * @param {Object} object The object to clone.
  6869. * @returns {Object} Returns the initialized clone.
  6870. */
  6871. function initCloneObject(object) {
  6872. return (typeof object.constructor == 'function' && !isPrototype(object))
  6873. ? baseCreate(getPrototype(object))
  6874. : {};
  6875. }
  6876. /**
  6877. * Initializes an object clone based on its `toStringTag`.
  6878. *
  6879. * **Note:** This function only supports cloning values with tags of
  6880. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6881. *
  6882. * @private
  6883. * @param {Object} object The object to clone.
  6884. * @param {string} tag The `toStringTag` of the object to clone.
  6885. * @param {boolean} [isDeep] Specify a deep clone.
  6886. * @returns {Object} Returns the initialized clone.
  6887. */
  6888. function initCloneByTag(object, tag, isDeep) {
  6889. var Ctor = object.constructor;
  6890. switch (tag) {
  6891. case arrayBufferTag:
  6892. return cloneArrayBuffer(object);
  6893. case boolTag:
  6894. case dateTag:
  6895. return new Ctor(+object);
  6896. case dataViewTag:
  6897. return cloneDataView(object, isDeep);
  6898. case float32Tag: case float64Tag:
  6899. case int8Tag: case int16Tag: case int32Tag:
  6900. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6901. return cloneTypedArray(object, isDeep);
  6902. case mapTag:
  6903. return new Ctor;
  6904. case numberTag:
  6905. case stringTag:
  6906. return new Ctor(object);
  6907. case regexpTag:
  6908. return cloneRegExp(object);
  6909. case setTag:
  6910. return new Ctor;
  6911. case symbolTag:
  6912. return cloneSymbol(object);
  6913. }
  6914. }
  6915. /**
  6916. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6917. *
  6918. * @private
  6919. * @param {string} source The source to modify.
  6920. * @returns {Array} details The details to insert.
  6921. * @returns {string} Returns the modified source.
  6922. */
  6923. function insertWrapDetails(source, details) {
  6924. var length = details.length;
  6925. if (!length) {
  6926. return source;
  6927. }
  6928. var lastIndex = length - 1;
  6929. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6930. details = details.join(length > 2 ? ', ' : ' ');
  6931. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6932. }
  6933. /**
  6934. * Checks if `value` is a flattenable `arguments` object or array.
  6935. *
  6936. * @private
  6937. * @param {*} value The value to check.
  6938. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6939. */
  6940. function isFlattenable(value) {
  6941. return isArray(value) || isArguments(value) ||
  6942. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6943. }
  6944. /**
  6945. * Checks if `value` is a valid array-like index.
  6946. *
  6947. * @private
  6948. * @param {*} value The value to check.
  6949. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6950. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6951. */
  6952. function isIndex(value, length) {
  6953. var type = typeof value;
  6954. length = length == null ? MAX_SAFE_INTEGER : length;
  6955. return !!length &&
  6956. (type == 'number' ||
  6957. (type != 'symbol' && reIsUint.test(value))) &&
  6958. (value > -1 && value % 1 == 0 && value < length);
  6959. }
  6960. /**
  6961. * Checks if the given arguments are from an iteratee call.
  6962. *
  6963. * @private
  6964. * @param {*} value The potential iteratee value argument.
  6965. * @param {*} index The potential iteratee index or key argument.
  6966. * @param {*} object The potential iteratee object argument.
  6967. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6968. * else `false`.
  6969. */
  6970. function isIterateeCall(value, index, object) {
  6971. if (!isObject(object)) {
  6972. return false;
  6973. }
  6974. var type = typeof index;
  6975. if (type == 'number'
  6976. ? (isArrayLike(object) && isIndex(index, object.length))
  6977. : (type == 'string' && index in object)
  6978. ) {
  6979. return eq(object[index], value);
  6980. }
  6981. return false;
  6982. }
  6983. /**
  6984. * Checks if `value` is a property name and not a property path.
  6985. *
  6986. * @private
  6987. * @param {*} value The value to check.
  6988. * @param {Object} [object] The object to query keys on.
  6989. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6990. */
  6991. function isKey(value, object) {
  6992. if (isArray(value)) {
  6993. return false;
  6994. }
  6995. var type = typeof value;
  6996. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6997. value == null || isSymbol(value)) {
  6998. return true;
  6999. }
  7000. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7001. (object != null && value in Object(object));
  7002. }
  7003. /**
  7004. * Checks if `value` is suitable for use as unique object key.
  7005. *
  7006. * @private
  7007. * @param {*} value The value to check.
  7008. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7009. */
  7010. function isKeyable(value) {
  7011. var type = typeof value;
  7012. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7013. ? (value !== '__proto__')
  7014. : (value === null);
  7015. }
  7016. /**
  7017. * Checks if `func` has a lazy counterpart.
  7018. *
  7019. * @private
  7020. * @param {Function} func The function to check.
  7021. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7022. * else `false`.
  7023. */
  7024. function isLaziable(func) {
  7025. var funcName = getFuncName(func),
  7026. other = lodash[funcName];
  7027. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7028. return false;
  7029. }
  7030. if (func === other) {
  7031. return true;
  7032. }
  7033. var data = getData(other);
  7034. return !!data && func === data[0];
  7035. }
  7036. /**
  7037. * Checks if `func` has its source masked.
  7038. *
  7039. * @private
  7040. * @param {Function} func The function to check.
  7041. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7042. */
  7043. function isMasked(func) {
  7044. return !!maskSrcKey && (maskSrcKey in func);
  7045. }
  7046. /**
  7047. * Checks if `func` is capable of being masked.
  7048. *
  7049. * @private
  7050. * @param {*} value The value to check.
  7051. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7052. */
  7053. var isMaskable = coreJsData ? isFunction : stubFalse;
  7054. /**
  7055. * Checks if `value` is likely a prototype object.
  7056. *
  7057. * @private
  7058. * @param {*} value The value to check.
  7059. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7060. */
  7061. function isPrototype(value) {
  7062. var Ctor = value && value.constructor,
  7063. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7064. return value === proto;
  7065. }
  7066. /**
  7067. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7068. *
  7069. * @private
  7070. * @param {*} value The value to check.
  7071. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7072. * equality comparisons, else `false`.
  7073. */
  7074. function isStrictComparable(value) {
  7075. return value === value && !isObject(value);
  7076. }
  7077. /**
  7078. * A specialized version of `matchesProperty` for source values suitable
  7079. * for strict equality comparisons, i.e. `===`.
  7080. *
  7081. * @private
  7082. * @param {string} key The key of the property to get.
  7083. * @param {*} srcValue The value to match.
  7084. * @returns {Function} Returns the new spec function.
  7085. */
  7086. function matchesStrictComparable(key, srcValue) {
  7087. return function(object) {
  7088. if (object == null) {
  7089. return false;
  7090. }
  7091. return object[key] === srcValue &&
  7092. (srcValue !== undefined || (key in Object(object)));
  7093. };
  7094. }
  7095. /**
  7096. * A specialized version of `_.memoize` which clears the memoized function's
  7097. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7098. *
  7099. * @private
  7100. * @param {Function} func The function to have its output memoized.
  7101. * @returns {Function} Returns the new memoized function.
  7102. */
  7103. function memoizeCapped(func) {
  7104. var result = memoize(func, function(key) {
  7105. if (cache.size === MAX_MEMOIZE_SIZE) {
  7106. cache.clear();
  7107. }
  7108. return key;
  7109. });
  7110. var cache = result.cache;
  7111. return result;
  7112. }
  7113. /**
  7114. * Merges the function metadata of `source` into `data`.
  7115. *
  7116. * Merging metadata reduces the number of wrappers used to invoke a function.
  7117. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7118. * may be applied regardless of execution order. Methods like `_.ary` and
  7119. * `_.rearg` modify function arguments, making the order in which they are
  7120. * executed important, preventing the merging of metadata. However, we make
  7121. * an exception for a safe combined case where curried functions have `_.ary`
  7122. * and or `_.rearg` applied.
  7123. *
  7124. * @private
  7125. * @param {Array} data The destination metadata.
  7126. * @param {Array} source The source metadata.
  7127. * @returns {Array} Returns `data`.
  7128. */
  7129. function mergeData(data, source) {
  7130. var bitmask = data[1],
  7131. srcBitmask = source[1],
  7132. newBitmask = bitmask | srcBitmask,
  7133. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7134. var isCombo =
  7135. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7136. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7137. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7138. // Exit early if metadata can't be merged.
  7139. if (!(isCommon || isCombo)) {
  7140. return data;
  7141. }
  7142. // Use source `thisArg` if available.
  7143. if (srcBitmask & WRAP_BIND_FLAG) {
  7144. data[2] = source[2];
  7145. // Set when currying a bound function.
  7146. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7147. }
  7148. // Compose partial arguments.
  7149. var value = source[3];
  7150. if (value) {
  7151. var partials = data[3];
  7152. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7153. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7154. }
  7155. // Compose partial right arguments.
  7156. value = source[5];
  7157. if (value) {
  7158. partials = data[5];
  7159. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7160. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7161. }
  7162. // Use source `argPos` if available.
  7163. value = source[7];
  7164. if (value) {
  7165. data[7] = value;
  7166. }
  7167. // Use source `ary` if it's smaller.
  7168. if (srcBitmask & WRAP_ARY_FLAG) {
  7169. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7170. }
  7171. // Use source `arity` if one is not provided.
  7172. if (data[9] == null) {
  7173. data[9] = source[9];
  7174. }
  7175. // Use source `func` and merge bitmasks.
  7176. data[0] = source[0];
  7177. data[1] = newBitmask;
  7178. return data;
  7179. }
  7180. /**
  7181. * This function is like
  7182. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7183. * except that it includes inherited enumerable properties.
  7184. *
  7185. * @private
  7186. * @param {Object} object The object to query.
  7187. * @returns {Array} Returns the array of property names.
  7188. */
  7189. function nativeKeysIn(object) {
  7190. var result = [];
  7191. if (object != null) {
  7192. for (var key in Object(object)) {
  7193. result.push(key);
  7194. }
  7195. }
  7196. return result;
  7197. }
  7198. /**
  7199. * Converts `value` to a string using `Object.prototype.toString`.
  7200. *
  7201. * @private
  7202. * @param {*} value The value to convert.
  7203. * @returns {string} Returns the converted string.
  7204. */
  7205. function objectToString(value) {
  7206. return nativeObjectToString.call(value);
  7207. }
  7208. /**
  7209. * A specialized version of `baseRest` which transforms the rest array.
  7210. *
  7211. * @private
  7212. * @param {Function} func The function to apply a rest parameter to.
  7213. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7214. * @param {Function} transform The rest array transform.
  7215. * @returns {Function} Returns the new function.
  7216. */
  7217. function overRest(func, start, transform) {
  7218. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7219. return function() {
  7220. var args = arguments,
  7221. index = -1,
  7222. length = nativeMax(args.length - start, 0),
  7223. array = Array(length);
  7224. while (++index < length) {
  7225. array[index] = args[start + index];
  7226. }
  7227. index = -1;
  7228. var otherArgs = Array(start + 1);
  7229. while (++index < start) {
  7230. otherArgs[index] = args[index];
  7231. }
  7232. otherArgs[start] = transform(array);
  7233. return apply(func, this, otherArgs);
  7234. };
  7235. }
  7236. /**
  7237. * Gets the parent value at `path` of `object`.
  7238. *
  7239. * @private
  7240. * @param {Object} object The object to query.
  7241. * @param {Array} path The path to get the parent value of.
  7242. * @returns {*} Returns the parent value.
  7243. */
  7244. function parent(object, path) {
  7245. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7246. }
  7247. /**
  7248. * Reorder `array` according to the specified indexes where the element at
  7249. * the first index is assigned as the first element, the element at
  7250. * the second index is assigned as the second element, and so on.
  7251. *
  7252. * @private
  7253. * @param {Array} array The array to reorder.
  7254. * @param {Array} indexes The arranged array indexes.
  7255. * @returns {Array} Returns `array`.
  7256. */
  7257. function reorder(array, indexes) {
  7258. var arrLength = array.length,
  7259. length = nativeMin(indexes.length, arrLength),
  7260. oldArray = copyArray(array);
  7261. while (length--) {
  7262. var index = indexes[length];
  7263. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7264. }
  7265. return array;
  7266. }
  7267. /**
  7268. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7269. *
  7270. * @private
  7271. * @param {Object} object The object to query.
  7272. * @param {string} key The key of the property to get.
  7273. * @returns {*} Returns the property value.
  7274. */
  7275. function safeGet(object, key) {
  7276. if (key === 'constructor' && typeof object[key] === 'function') {
  7277. return;
  7278. }
  7279. if (key == '__proto__') {
  7280. return;
  7281. }
  7282. return object[key];
  7283. }
  7284. /**
  7285. * Sets metadata for `func`.
  7286. *
  7287. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7288. * period of time, it will trip its breaker and transition to an identity
  7289. * function to avoid garbage collection pauses in V8. See
  7290. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7291. * for more details.
  7292. *
  7293. * @private
  7294. * @param {Function} func The function to associate metadata with.
  7295. * @param {*} data The metadata.
  7296. * @returns {Function} Returns `func`.
  7297. */
  7298. var setData = shortOut(baseSetData);
  7299. /**
  7300. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7301. *
  7302. * @private
  7303. * @param {Function} func The function to delay.
  7304. * @param {number} wait The number of milliseconds to delay invocation.
  7305. * @returns {number|Object} Returns the timer id or timeout object.
  7306. */
  7307. var setTimeout = ctxSetTimeout || function(func, wait) {
  7308. return root.setTimeout(func, wait);
  7309. };
  7310. /**
  7311. * Sets the `toString` method of `func` to return `string`.
  7312. *
  7313. * @private
  7314. * @param {Function} func The function to modify.
  7315. * @param {Function} string The `toString` result.
  7316. * @returns {Function} Returns `func`.
  7317. */
  7318. var setToString = shortOut(baseSetToString);
  7319. /**
  7320. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7321. * with wrapper details in a comment at the top of the source body.
  7322. *
  7323. * @private
  7324. * @param {Function} wrapper The function to modify.
  7325. * @param {Function} reference The reference function.
  7326. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7327. * @returns {Function} Returns `wrapper`.
  7328. */
  7329. function setWrapToString(wrapper, reference, bitmask) {
  7330. var source = (reference + '');
  7331. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7332. }
  7333. /**
  7334. * Creates a function that'll short out and invoke `identity` instead
  7335. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7336. * milliseconds.
  7337. *
  7338. * @private
  7339. * @param {Function} func The function to restrict.
  7340. * @returns {Function} Returns the new shortable function.
  7341. */
  7342. function shortOut(func) {
  7343. var count = 0,
  7344. lastCalled = 0;
  7345. return function() {
  7346. var stamp = nativeNow(),
  7347. remaining = HOT_SPAN - (stamp - lastCalled);
  7348. lastCalled = stamp;
  7349. if (remaining > 0) {
  7350. if (++count >= HOT_COUNT) {
  7351. return arguments[0];
  7352. }
  7353. } else {
  7354. count = 0;
  7355. }
  7356. return func.apply(undefined, arguments);
  7357. };
  7358. }
  7359. /**
  7360. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7361. *
  7362. * @private
  7363. * @param {Array} array The array to shuffle.
  7364. * @param {number} [size=array.length] The size of `array`.
  7365. * @returns {Array} Returns `array`.
  7366. */
  7367. function shuffleSelf(array, size) {
  7368. var index = -1,
  7369. length = array.length,
  7370. lastIndex = length - 1;
  7371. size = size === undefined ? length : size;
  7372. while (++index < size) {
  7373. var rand = baseRandom(index, lastIndex),
  7374. value = array[rand];
  7375. array[rand] = array[index];
  7376. array[index] = value;
  7377. }
  7378. array.length = size;
  7379. return array;
  7380. }
  7381. /**
  7382. * Converts `string` to a property path array.
  7383. *
  7384. * @private
  7385. * @param {string} string The string to convert.
  7386. * @returns {Array} Returns the property path array.
  7387. */
  7388. var stringToPath = memoizeCapped(function(string) {
  7389. var result = [];
  7390. if (string.charCodeAt(0) === 46 /* . */) {
  7391. result.push('');
  7392. }
  7393. string.replace(rePropName, function(match, number, quote, subString) {
  7394. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7395. });
  7396. return result;
  7397. });
  7398. /**
  7399. * Converts `value` to a string key if it's not a string or symbol.
  7400. *
  7401. * @private
  7402. * @param {*} value The value to inspect.
  7403. * @returns {string|symbol} Returns the key.
  7404. */
  7405. function toKey(value) {
  7406. if (typeof value == 'string' || isSymbol(value)) {
  7407. return value;
  7408. }
  7409. var result = (value + '');
  7410. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7411. }
  7412. /**
  7413. * Converts `func` to its source code.
  7414. *
  7415. * @private
  7416. * @param {Function} func The function to convert.
  7417. * @returns {string} Returns the source code.
  7418. */
  7419. function toSource(func) {
  7420. if (func != null) {
  7421. try {
  7422. return funcToString.call(func);
  7423. } catch (e) {}
  7424. try {
  7425. return (func + '');
  7426. } catch (e) {}
  7427. }
  7428. return '';
  7429. }
  7430. /**
  7431. * Updates wrapper `details` based on `bitmask` flags.
  7432. *
  7433. * @private
  7434. * @returns {Array} details The details to modify.
  7435. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7436. * @returns {Array} Returns `details`.
  7437. */
  7438. function updateWrapDetails(details, bitmask) {
  7439. arrayEach(wrapFlags, function(pair) {
  7440. var value = '_.' + pair[0];
  7441. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7442. details.push(value);
  7443. }
  7444. });
  7445. return details.sort();
  7446. }
  7447. /**
  7448. * Creates a clone of `wrapper`.
  7449. *
  7450. * @private
  7451. * @param {Object} wrapper The wrapper to clone.
  7452. * @returns {Object} Returns the cloned wrapper.
  7453. */
  7454. function wrapperClone(wrapper) {
  7455. if (wrapper instanceof LazyWrapper) {
  7456. return wrapper.clone();
  7457. }
  7458. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7459. result.__actions__ = copyArray(wrapper.__actions__);
  7460. result.__index__ = wrapper.__index__;
  7461. result.__values__ = wrapper.__values__;
  7462. return result;
  7463. }
  7464. /*------------------------------------------------------------------------*/
  7465. /**
  7466. * Creates an array of elements split into groups the length of `size`.
  7467. * If `array` can't be split evenly, the final chunk will be the remaining
  7468. * elements.
  7469. *
  7470. * @static
  7471. * @memberOf _
  7472. * @since 3.0.0
  7473. * @category Array
  7474. * @param {Array} array The array to process.
  7475. * @param {number} [size=1] The length of each chunk
  7476. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7477. * @returns {Array} Returns the new array of chunks.
  7478. * @example
  7479. *
  7480. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7481. * // => [['a', 'b'], ['c', 'd']]
  7482. *
  7483. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7484. * // => [['a', 'b', 'c'], ['d']]
  7485. */
  7486. function chunk(array, size, guard) {
  7487. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7488. size = 1;
  7489. } else {
  7490. size = nativeMax(toInteger(size), 0);
  7491. }
  7492. var length = array == null ? 0 : array.length;
  7493. if (!length || size < 1) {
  7494. return [];
  7495. }
  7496. var index = 0,
  7497. resIndex = 0,
  7498. result = Array(nativeCeil(length / size));
  7499. while (index < length) {
  7500. result[resIndex++] = baseSlice(array, index, (index += size));
  7501. }
  7502. return result;
  7503. }
  7504. /**
  7505. * Creates an array with all falsey values removed. The values `false`, `null`,
  7506. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7507. *
  7508. * @static
  7509. * @memberOf _
  7510. * @since 0.1.0
  7511. * @category Array
  7512. * @param {Array} array The array to compact.
  7513. * @returns {Array} Returns the new array of filtered values.
  7514. * @example
  7515. *
  7516. * _.compact([0, 1, false, 2, '', 3]);
  7517. * // => [1, 2, 3]
  7518. */
  7519. function compact(array) {
  7520. var index = -1,
  7521. length = array == null ? 0 : array.length,
  7522. resIndex = 0,
  7523. result = [];
  7524. while (++index < length) {
  7525. var value = array[index];
  7526. if (value) {
  7527. result[resIndex++] = value;
  7528. }
  7529. }
  7530. return result;
  7531. }
  7532. /**
  7533. * Creates a new array concatenating `array` with any additional arrays
  7534. * and/or values.
  7535. *
  7536. * @static
  7537. * @memberOf _
  7538. * @since 4.0.0
  7539. * @category Array
  7540. * @param {Array} array The array to concatenate.
  7541. * @param {...*} [values] The values to concatenate.
  7542. * @returns {Array} Returns the new concatenated array.
  7543. * @example
  7544. *
  7545. * var array = [1];
  7546. * var other = _.concat(array, 2, [3], [[4]]);
  7547. *
  7548. * console.log(other);
  7549. * // => [1, 2, 3, [4]]
  7550. *
  7551. * console.log(array);
  7552. * // => [1]
  7553. */
  7554. function concat() {
  7555. var length = arguments.length;
  7556. if (!length) {
  7557. return [];
  7558. }
  7559. var args = Array(length - 1),
  7560. array = arguments[0],
  7561. index = length;
  7562. while (index--) {
  7563. args[index - 1] = arguments[index];
  7564. }
  7565. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7566. }
  7567. /**
  7568. * Creates an array of `array` values not included in the other given arrays
  7569. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7570. * for equality comparisons. The order and references of result values are
  7571. * determined by the first array.
  7572. *
  7573. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7574. *
  7575. * @static
  7576. * @memberOf _
  7577. * @since 0.1.0
  7578. * @category Array
  7579. * @param {Array} array The array to inspect.
  7580. * @param {...Array} [values] The values to exclude.
  7581. * @returns {Array} Returns the new array of filtered values.
  7582. * @see _.without, _.xor
  7583. * @example
  7584. *
  7585. * _.difference([2, 1], [2, 3]);
  7586. * // => [1]
  7587. */
  7588. var difference = baseRest(function(array, values) {
  7589. return isArrayLikeObject(array)
  7590. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7591. : [];
  7592. });
  7593. /**
  7594. * This method is like `_.difference` except that it accepts `iteratee` which
  7595. * is invoked for each element of `array` and `values` to generate the criterion
  7596. * by which they're compared. The order and references of result values are
  7597. * determined by the first array. The iteratee is invoked with one argument:
  7598. * (value).
  7599. *
  7600. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7601. *
  7602. * @static
  7603. * @memberOf _
  7604. * @since 4.0.0
  7605. * @category Array
  7606. * @param {Array} array The array to inspect.
  7607. * @param {...Array} [values] The values to exclude.
  7608. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7609. * @returns {Array} Returns the new array of filtered values.
  7610. * @example
  7611. *
  7612. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7613. * // => [1.2]
  7614. *
  7615. * // The `_.property` iteratee shorthand.
  7616. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7617. * // => [{ 'x': 2 }]
  7618. */
  7619. var differenceBy = baseRest(function(array, values) {
  7620. var iteratee = last(values);
  7621. if (isArrayLikeObject(iteratee)) {
  7622. iteratee = undefined;
  7623. }
  7624. return isArrayLikeObject(array)
  7625. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7626. : [];
  7627. });
  7628. /**
  7629. * This method is like `_.difference` except that it accepts `comparator`
  7630. * which is invoked to compare elements of `array` to `values`. The order and
  7631. * references of result values are determined by the first array. The comparator
  7632. * is invoked with two arguments: (arrVal, othVal).
  7633. *
  7634. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7635. *
  7636. * @static
  7637. * @memberOf _
  7638. * @since 4.0.0
  7639. * @category Array
  7640. * @param {Array} array The array to inspect.
  7641. * @param {...Array} [values] The values to exclude.
  7642. * @param {Function} [comparator] The comparator invoked per element.
  7643. * @returns {Array} Returns the new array of filtered values.
  7644. * @example
  7645. *
  7646. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7647. *
  7648. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7649. * // => [{ 'x': 2, 'y': 1 }]
  7650. */
  7651. var differenceWith = baseRest(function(array, values) {
  7652. var comparator = last(values);
  7653. if (isArrayLikeObject(comparator)) {
  7654. comparator = undefined;
  7655. }
  7656. return isArrayLikeObject(array)
  7657. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7658. : [];
  7659. });
  7660. /**
  7661. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7662. *
  7663. * @static
  7664. * @memberOf _
  7665. * @since 0.5.0
  7666. * @category Array
  7667. * @param {Array} array The array to query.
  7668. * @param {number} [n=1] The number of elements to drop.
  7669. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7670. * @returns {Array} Returns the slice of `array`.
  7671. * @example
  7672. *
  7673. * _.drop([1, 2, 3]);
  7674. * // => [2, 3]
  7675. *
  7676. * _.drop([1, 2, 3], 2);
  7677. * // => [3]
  7678. *
  7679. * _.drop([1, 2, 3], 5);
  7680. * // => []
  7681. *
  7682. * _.drop([1, 2, 3], 0);
  7683. * // => [1, 2, 3]
  7684. */
  7685. function drop(array, n, guard) {
  7686. var length = array == null ? 0 : array.length;
  7687. if (!length) {
  7688. return [];
  7689. }
  7690. n = (guard || n === undefined) ? 1 : toInteger(n);
  7691. return baseSlice(array, n < 0 ? 0 : n, length);
  7692. }
  7693. /**
  7694. * Creates a slice of `array` with `n` elements dropped from the end.
  7695. *
  7696. * @static
  7697. * @memberOf _
  7698. * @since 3.0.0
  7699. * @category Array
  7700. * @param {Array} array The array to query.
  7701. * @param {number} [n=1] The number of elements to drop.
  7702. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7703. * @returns {Array} Returns the slice of `array`.
  7704. * @example
  7705. *
  7706. * _.dropRight([1, 2, 3]);
  7707. * // => [1, 2]
  7708. *
  7709. * _.dropRight([1, 2, 3], 2);
  7710. * // => [1]
  7711. *
  7712. * _.dropRight([1, 2, 3], 5);
  7713. * // => []
  7714. *
  7715. * _.dropRight([1, 2, 3], 0);
  7716. * // => [1, 2, 3]
  7717. */
  7718. function dropRight(array, n, guard) {
  7719. var length = array == null ? 0 : array.length;
  7720. if (!length) {
  7721. return [];
  7722. }
  7723. n = (guard || n === undefined) ? 1 : toInteger(n);
  7724. n = length - n;
  7725. return baseSlice(array, 0, n < 0 ? 0 : n);
  7726. }
  7727. /**
  7728. * Creates a slice of `array` excluding elements dropped from the end.
  7729. * Elements are dropped until `predicate` returns falsey. The predicate is
  7730. * invoked with three arguments: (value, index, array).
  7731. *
  7732. * @static
  7733. * @memberOf _
  7734. * @since 3.0.0
  7735. * @category Array
  7736. * @param {Array} array The array to query.
  7737. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7738. * @returns {Array} Returns the slice of `array`.
  7739. * @example
  7740. *
  7741. * var users = [
  7742. * { 'user': 'barney', 'active': true },
  7743. * { 'user': 'fred', 'active': false },
  7744. * { 'user': 'pebbles', 'active': false }
  7745. * ];
  7746. *
  7747. * _.dropRightWhile(users, function(o) { return !o.active; });
  7748. * // => objects for ['barney']
  7749. *
  7750. * // The `_.matches` iteratee shorthand.
  7751. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7752. * // => objects for ['barney', 'fred']
  7753. *
  7754. * // The `_.matchesProperty` iteratee shorthand.
  7755. * _.dropRightWhile(users, ['active', false]);
  7756. * // => objects for ['barney']
  7757. *
  7758. * // The `_.property` iteratee shorthand.
  7759. * _.dropRightWhile(users, 'active');
  7760. * // => objects for ['barney', 'fred', 'pebbles']
  7761. */
  7762. function dropRightWhile(array, predicate) {
  7763. return (array && array.length)
  7764. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7765. : [];
  7766. }
  7767. /**
  7768. * Creates a slice of `array` excluding elements dropped from the beginning.
  7769. * Elements are dropped until `predicate` returns falsey. The predicate is
  7770. * invoked with three arguments: (value, index, array).
  7771. *
  7772. * @static
  7773. * @memberOf _
  7774. * @since 3.0.0
  7775. * @category Array
  7776. * @param {Array} array The array to query.
  7777. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7778. * @returns {Array} Returns the slice of `array`.
  7779. * @example
  7780. *
  7781. * var users = [
  7782. * { 'user': 'barney', 'active': false },
  7783. * { 'user': 'fred', 'active': false },
  7784. * { 'user': 'pebbles', 'active': true }
  7785. * ];
  7786. *
  7787. * _.dropWhile(users, function(o) { return !o.active; });
  7788. * // => objects for ['pebbles']
  7789. *
  7790. * // The `_.matches` iteratee shorthand.
  7791. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7792. * // => objects for ['fred', 'pebbles']
  7793. *
  7794. * // The `_.matchesProperty` iteratee shorthand.
  7795. * _.dropWhile(users, ['active', false]);
  7796. * // => objects for ['pebbles']
  7797. *
  7798. * // The `_.property` iteratee shorthand.
  7799. * _.dropWhile(users, 'active');
  7800. * // => objects for ['barney', 'fred', 'pebbles']
  7801. */
  7802. function dropWhile(array, predicate) {
  7803. return (array && array.length)
  7804. ? baseWhile(array, getIteratee(predicate, 3), true)
  7805. : [];
  7806. }
  7807. /**
  7808. * Fills elements of `array` with `value` from `start` up to, but not
  7809. * including, `end`.
  7810. *
  7811. * **Note:** This method mutates `array`.
  7812. *
  7813. * @static
  7814. * @memberOf _
  7815. * @since 3.2.0
  7816. * @category Array
  7817. * @param {Array} array The array to fill.
  7818. * @param {*} value The value to fill `array` with.
  7819. * @param {number} [start=0] The start position.
  7820. * @param {number} [end=array.length] The end position.
  7821. * @returns {Array} Returns `array`.
  7822. * @example
  7823. *
  7824. * var array = [1, 2, 3];
  7825. *
  7826. * _.fill(array, 'a');
  7827. * console.log(array);
  7828. * // => ['a', 'a', 'a']
  7829. *
  7830. * _.fill(Array(3), 2);
  7831. * // => [2, 2, 2]
  7832. *
  7833. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7834. * // => [4, '*', '*', 10]
  7835. */
  7836. function fill(array, value, start, end) {
  7837. var length = array == null ? 0 : array.length;
  7838. if (!length) {
  7839. return [];
  7840. }
  7841. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7842. start = 0;
  7843. end = length;
  7844. }
  7845. return baseFill(array, value, start, end);
  7846. }
  7847. /**
  7848. * This method is like `_.find` except that it returns the index of the first
  7849. * element `predicate` returns truthy for instead of the element itself.
  7850. *
  7851. * @static
  7852. * @memberOf _
  7853. * @since 1.1.0
  7854. * @category Array
  7855. * @param {Array} array The array to inspect.
  7856. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7857. * @param {number} [fromIndex=0] The index to search from.
  7858. * @returns {number} Returns the index of the found element, else `-1`.
  7859. * @example
  7860. *
  7861. * var users = [
  7862. * { 'user': 'barney', 'active': false },
  7863. * { 'user': 'fred', 'active': false },
  7864. * { 'user': 'pebbles', 'active': true }
  7865. * ];
  7866. *
  7867. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7868. * // => 0
  7869. *
  7870. * // The `_.matches` iteratee shorthand.
  7871. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7872. * // => 1
  7873. *
  7874. * // The `_.matchesProperty` iteratee shorthand.
  7875. * _.findIndex(users, ['active', false]);
  7876. * // => 0
  7877. *
  7878. * // The `_.property` iteratee shorthand.
  7879. * _.findIndex(users, 'active');
  7880. * // => 2
  7881. */
  7882. function findIndex(array, predicate, fromIndex) {
  7883. var length = array == null ? 0 : array.length;
  7884. if (!length) {
  7885. return -1;
  7886. }
  7887. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7888. if (index < 0) {
  7889. index = nativeMax(length + index, 0);
  7890. }
  7891. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7892. }
  7893. /**
  7894. * This method is like `_.findIndex` except that it iterates over elements
  7895. * of `collection` from right to left.
  7896. *
  7897. * @static
  7898. * @memberOf _
  7899. * @since 2.0.0
  7900. * @category Array
  7901. * @param {Array} array The array to inspect.
  7902. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7903. * @param {number} [fromIndex=array.length-1] The index to search from.
  7904. * @returns {number} Returns the index of the found element, else `-1`.
  7905. * @example
  7906. *
  7907. * var users = [
  7908. * { 'user': 'barney', 'active': true },
  7909. * { 'user': 'fred', 'active': false },
  7910. * { 'user': 'pebbles', 'active': false }
  7911. * ];
  7912. *
  7913. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7914. * // => 2
  7915. *
  7916. * // The `_.matches` iteratee shorthand.
  7917. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7918. * // => 0
  7919. *
  7920. * // The `_.matchesProperty` iteratee shorthand.
  7921. * _.findLastIndex(users, ['active', false]);
  7922. * // => 2
  7923. *
  7924. * // The `_.property` iteratee shorthand.
  7925. * _.findLastIndex(users, 'active');
  7926. * // => 0
  7927. */
  7928. function findLastIndex(array, predicate, fromIndex) {
  7929. var length = array == null ? 0 : array.length;
  7930. if (!length) {
  7931. return -1;
  7932. }
  7933. var index = length - 1;
  7934. if (fromIndex !== undefined) {
  7935. index = toInteger(fromIndex);
  7936. index = fromIndex < 0
  7937. ? nativeMax(length + index, 0)
  7938. : nativeMin(index, length - 1);
  7939. }
  7940. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7941. }
  7942. /**
  7943. * Flattens `array` a single level deep.
  7944. *
  7945. * @static
  7946. * @memberOf _
  7947. * @since 0.1.0
  7948. * @category Array
  7949. * @param {Array} array The array to flatten.
  7950. * @returns {Array} Returns the new flattened array.
  7951. * @example
  7952. *
  7953. * _.flatten([1, [2, [3, [4]], 5]]);
  7954. * // => [1, 2, [3, [4]], 5]
  7955. */
  7956. function flatten(array) {
  7957. var length = array == null ? 0 : array.length;
  7958. return length ? baseFlatten(array, 1) : [];
  7959. }
  7960. /**
  7961. * Recursively flattens `array`.
  7962. *
  7963. * @static
  7964. * @memberOf _
  7965. * @since 3.0.0
  7966. * @category Array
  7967. * @param {Array} array The array to flatten.
  7968. * @returns {Array} Returns the new flattened array.
  7969. * @example
  7970. *
  7971. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7972. * // => [1, 2, 3, 4, 5]
  7973. */
  7974. function flattenDeep(array) {
  7975. var length = array == null ? 0 : array.length;
  7976. return length ? baseFlatten(array, INFINITY) : [];
  7977. }
  7978. /**
  7979. * Recursively flatten `array` up to `depth` times.
  7980. *
  7981. * @static
  7982. * @memberOf _
  7983. * @since 4.4.0
  7984. * @category Array
  7985. * @param {Array} array The array to flatten.
  7986. * @param {number} [depth=1] The maximum recursion depth.
  7987. * @returns {Array} Returns the new flattened array.
  7988. * @example
  7989. *
  7990. * var array = [1, [2, [3, [4]], 5]];
  7991. *
  7992. * _.flattenDepth(array, 1);
  7993. * // => [1, 2, [3, [4]], 5]
  7994. *
  7995. * _.flattenDepth(array, 2);
  7996. * // => [1, 2, 3, [4], 5]
  7997. */
  7998. function flattenDepth(array, depth) {
  7999. var length = array == null ? 0 : array.length;
  8000. if (!length) {
  8001. return [];
  8002. }
  8003. depth = depth === undefined ? 1 : toInteger(depth);
  8004. return baseFlatten(array, depth);
  8005. }
  8006. /**
  8007. * The inverse of `_.toPairs`; this method returns an object composed
  8008. * from key-value `pairs`.
  8009. *
  8010. * @static
  8011. * @memberOf _
  8012. * @since 4.0.0
  8013. * @category Array
  8014. * @param {Array} pairs The key-value pairs.
  8015. * @returns {Object} Returns the new object.
  8016. * @example
  8017. *
  8018. * _.fromPairs([['a', 1], ['b', 2]]);
  8019. * // => { 'a': 1, 'b': 2 }
  8020. */
  8021. function fromPairs(pairs) {
  8022. var index = -1,
  8023. length = pairs == null ? 0 : pairs.length,
  8024. result = {};
  8025. while (++index < length) {
  8026. var pair = pairs[index];
  8027. result[pair[0]] = pair[1];
  8028. }
  8029. return result;
  8030. }
  8031. /**
  8032. * Gets the first element of `array`.
  8033. *
  8034. * @static
  8035. * @memberOf _
  8036. * @since 0.1.0
  8037. * @alias first
  8038. * @category Array
  8039. * @param {Array} array The array to query.
  8040. * @returns {*} Returns the first element of `array`.
  8041. * @example
  8042. *
  8043. * _.head([1, 2, 3]);
  8044. * // => 1
  8045. *
  8046. * _.head([]);
  8047. * // => undefined
  8048. */
  8049. function head(array) {
  8050. return (array && array.length) ? array[0] : undefined;
  8051. }
  8052. /**
  8053. * Gets the index at which the first occurrence of `value` is found in `array`
  8054. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8055. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8056. * offset from the end of `array`.
  8057. *
  8058. * @static
  8059. * @memberOf _
  8060. * @since 0.1.0
  8061. * @category Array
  8062. * @param {Array} array The array to inspect.
  8063. * @param {*} value The value to search for.
  8064. * @param {number} [fromIndex=0] The index to search from.
  8065. * @returns {number} Returns the index of the matched value, else `-1`.
  8066. * @example
  8067. *
  8068. * _.indexOf([1, 2, 1, 2], 2);
  8069. * // => 1
  8070. *
  8071. * // Search from the `fromIndex`.
  8072. * _.indexOf([1, 2, 1, 2], 2, 2);
  8073. * // => 3
  8074. */
  8075. function indexOf(array, value, fromIndex) {
  8076. var length = array == null ? 0 : array.length;
  8077. if (!length) {
  8078. return -1;
  8079. }
  8080. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8081. if (index < 0) {
  8082. index = nativeMax(length + index, 0);
  8083. }
  8084. return baseIndexOf(array, value, index);
  8085. }
  8086. /**
  8087. * Gets all but the last element of `array`.
  8088. *
  8089. * @static
  8090. * @memberOf _
  8091. * @since 0.1.0
  8092. * @category Array
  8093. * @param {Array} array The array to query.
  8094. * @returns {Array} Returns the slice of `array`.
  8095. * @example
  8096. *
  8097. * _.initial([1, 2, 3]);
  8098. * // => [1, 2]
  8099. */
  8100. function initial(array) {
  8101. var length = array == null ? 0 : array.length;
  8102. return length ? baseSlice(array, 0, -1) : [];
  8103. }
  8104. /**
  8105. * Creates an array of unique values that are included in all given arrays
  8106. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8107. * for equality comparisons. The order and references of result values are
  8108. * determined by the first array.
  8109. *
  8110. * @static
  8111. * @memberOf _
  8112. * @since 0.1.0
  8113. * @category Array
  8114. * @param {...Array} [arrays] The arrays to inspect.
  8115. * @returns {Array} Returns the new array of intersecting values.
  8116. * @example
  8117. *
  8118. * _.intersection([2, 1], [2, 3]);
  8119. * // => [2]
  8120. */
  8121. var intersection = baseRest(function(arrays) {
  8122. var mapped = arrayMap(arrays, castArrayLikeObject);
  8123. return (mapped.length && mapped[0] === arrays[0])
  8124. ? baseIntersection(mapped)
  8125. : [];
  8126. });
  8127. /**
  8128. * This method is like `_.intersection` except that it accepts `iteratee`
  8129. * which is invoked for each element of each `arrays` to generate the criterion
  8130. * by which they're compared. The order and references of result values are
  8131. * determined by the first array. The iteratee is invoked with one argument:
  8132. * (value).
  8133. *
  8134. * @static
  8135. * @memberOf _
  8136. * @since 4.0.0
  8137. * @category Array
  8138. * @param {...Array} [arrays] The arrays to inspect.
  8139. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8140. * @returns {Array} Returns the new array of intersecting values.
  8141. * @example
  8142. *
  8143. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8144. * // => [2.1]
  8145. *
  8146. * // The `_.property` iteratee shorthand.
  8147. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8148. * // => [{ 'x': 1 }]
  8149. */
  8150. var intersectionBy = baseRest(function(arrays) {
  8151. var iteratee = last(arrays),
  8152. mapped = arrayMap(arrays, castArrayLikeObject);
  8153. if (iteratee === last(mapped)) {
  8154. iteratee = undefined;
  8155. } else {
  8156. mapped.pop();
  8157. }
  8158. return (mapped.length && mapped[0] === arrays[0])
  8159. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8160. : [];
  8161. });
  8162. /**
  8163. * This method is like `_.intersection` except that it accepts `comparator`
  8164. * which is invoked to compare elements of `arrays`. The order and references
  8165. * of result values are determined by the first array. The comparator is
  8166. * invoked with two arguments: (arrVal, othVal).
  8167. *
  8168. * @static
  8169. * @memberOf _
  8170. * @since 4.0.0
  8171. * @category Array
  8172. * @param {...Array} [arrays] The arrays to inspect.
  8173. * @param {Function} [comparator] The comparator invoked per element.
  8174. * @returns {Array} Returns the new array of intersecting values.
  8175. * @example
  8176. *
  8177. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8178. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8179. *
  8180. * _.intersectionWith(objects, others, _.isEqual);
  8181. * // => [{ 'x': 1, 'y': 2 }]
  8182. */
  8183. var intersectionWith = baseRest(function(arrays) {
  8184. var comparator = last(arrays),
  8185. mapped = arrayMap(arrays, castArrayLikeObject);
  8186. comparator = typeof comparator == 'function' ? comparator : undefined;
  8187. if (comparator) {
  8188. mapped.pop();
  8189. }
  8190. return (mapped.length && mapped[0] === arrays[0])
  8191. ? baseIntersection(mapped, undefined, comparator)
  8192. : [];
  8193. });
  8194. /**
  8195. * Converts all elements in `array` into a string separated by `separator`.
  8196. *
  8197. * @static
  8198. * @memberOf _
  8199. * @since 4.0.0
  8200. * @category Array
  8201. * @param {Array} array The array to convert.
  8202. * @param {string} [separator=','] The element separator.
  8203. * @returns {string} Returns the joined string.
  8204. * @example
  8205. *
  8206. * _.join(['a', 'b', 'c'], '~');
  8207. * // => 'a~b~c'
  8208. */
  8209. function join(array, separator) {
  8210. return array == null ? '' : nativeJoin.call(array, separator);
  8211. }
  8212. /**
  8213. * Gets the last element of `array`.
  8214. *
  8215. * @static
  8216. * @memberOf _
  8217. * @since 0.1.0
  8218. * @category Array
  8219. * @param {Array} array The array to query.
  8220. * @returns {*} Returns the last element of `array`.
  8221. * @example
  8222. *
  8223. * _.last([1, 2, 3]);
  8224. * // => 3
  8225. */
  8226. function last(array) {
  8227. var length = array == null ? 0 : array.length;
  8228. return length ? array[length - 1] : undefined;
  8229. }
  8230. /**
  8231. * This method is like `_.indexOf` except that it iterates over elements of
  8232. * `array` from right to left.
  8233. *
  8234. * @static
  8235. * @memberOf _
  8236. * @since 0.1.0
  8237. * @category Array
  8238. * @param {Array} array The array to inspect.
  8239. * @param {*} value The value to search for.
  8240. * @param {number} [fromIndex=array.length-1] The index to search from.
  8241. * @returns {number} Returns the index of the matched value, else `-1`.
  8242. * @example
  8243. *
  8244. * _.lastIndexOf([1, 2, 1, 2], 2);
  8245. * // => 3
  8246. *
  8247. * // Search from the `fromIndex`.
  8248. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8249. * // => 1
  8250. */
  8251. function lastIndexOf(array, value, fromIndex) {
  8252. var length = array == null ? 0 : array.length;
  8253. if (!length) {
  8254. return -1;
  8255. }
  8256. var index = length;
  8257. if (fromIndex !== undefined) {
  8258. index = toInteger(fromIndex);
  8259. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8260. }
  8261. return value === value
  8262. ? strictLastIndexOf(array, value, index)
  8263. : baseFindIndex(array, baseIsNaN, index, true);
  8264. }
  8265. /**
  8266. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8267. * element from the end is returned.
  8268. *
  8269. * @static
  8270. * @memberOf _
  8271. * @since 4.11.0
  8272. * @category Array
  8273. * @param {Array} array The array to query.
  8274. * @param {number} [n=0] The index of the element to return.
  8275. * @returns {*} Returns the nth element of `array`.
  8276. * @example
  8277. *
  8278. * var array = ['a', 'b', 'c', 'd'];
  8279. *
  8280. * _.nth(array, 1);
  8281. * // => 'b'
  8282. *
  8283. * _.nth(array, -2);
  8284. * // => 'c';
  8285. */
  8286. function nth(array, n) {
  8287. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8288. }
  8289. /**
  8290. * Removes all given values from `array` using
  8291. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8292. * for equality comparisons.
  8293. *
  8294. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8295. * to remove elements from an array by predicate.
  8296. *
  8297. * @static
  8298. * @memberOf _
  8299. * @since 2.0.0
  8300. * @category Array
  8301. * @param {Array} array The array to modify.
  8302. * @param {...*} [values] The values to remove.
  8303. * @returns {Array} Returns `array`.
  8304. * @example
  8305. *
  8306. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8307. *
  8308. * _.pull(array, 'a', 'c');
  8309. * console.log(array);
  8310. * // => ['b', 'b']
  8311. */
  8312. var pull = baseRest(pullAll);
  8313. /**
  8314. * This method is like `_.pull` except that it accepts an array of values to remove.
  8315. *
  8316. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8317. *
  8318. * @static
  8319. * @memberOf _
  8320. * @since 4.0.0
  8321. * @category Array
  8322. * @param {Array} array The array to modify.
  8323. * @param {Array} values The values to remove.
  8324. * @returns {Array} Returns `array`.
  8325. * @example
  8326. *
  8327. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8328. *
  8329. * _.pullAll(array, ['a', 'c']);
  8330. * console.log(array);
  8331. * // => ['b', 'b']
  8332. */
  8333. function pullAll(array, values) {
  8334. return (array && array.length && values && values.length)
  8335. ? basePullAll(array, values)
  8336. : array;
  8337. }
  8338. /**
  8339. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8340. * invoked for each element of `array` and `values` to generate the criterion
  8341. * by which they're compared. The iteratee is invoked with one argument: (value).
  8342. *
  8343. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8344. *
  8345. * @static
  8346. * @memberOf _
  8347. * @since 4.0.0
  8348. * @category Array
  8349. * @param {Array} array The array to modify.
  8350. * @param {Array} values The values to remove.
  8351. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8352. * @returns {Array} Returns `array`.
  8353. * @example
  8354. *
  8355. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8356. *
  8357. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8358. * console.log(array);
  8359. * // => [{ 'x': 2 }]
  8360. */
  8361. function pullAllBy(array, values, iteratee) {
  8362. return (array && array.length && values && values.length)
  8363. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8364. : array;
  8365. }
  8366. /**
  8367. * This method is like `_.pullAll` except that it accepts `comparator` which
  8368. * is invoked to compare elements of `array` to `values`. The comparator is
  8369. * invoked with two arguments: (arrVal, othVal).
  8370. *
  8371. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8372. *
  8373. * @static
  8374. * @memberOf _
  8375. * @since 4.6.0
  8376. * @category Array
  8377. * @param {Array} array The array to modify.
  8378. * @param {Array} values The values to remove.
  8379. * @param {Function} [comparator] The comparator invoked per element.
  8380. * @returns {Array} Returns `array`.
  8381. * @example
  8382. *
  8383. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8384. *
  8385. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8386. * console.log(array);
  8387. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8388. */
  8389. function pullAllWith(array, values, comparator) {
  8390. return (array && array.length && values && values.length)
  8391. ? basePullAll(array, values, undefined, comparator)
  8392. : array;
  8393. }
  8394. /**
  8395. * Removes elements from `array` corresponding to `indexes` and returns an
  8396. * array of removed elements.
  8397. *
  8398. * **Note:** Unlike `_.at`, this method mutates `array`.
  8399. *
  8400. * @static
  8401. * @memberOf _
  8402. * @since 3.0.0
  8403. * @category Array
  8404. * @param {Array} array The array to modify.
  8405. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8406. * @returns {Array} Returns the new array of removed elements.
  8407. * @example
  8408. *
  8409. * var array = ['a', 'b', 'c', 'd'];
  8410. * var pulled = _.pullAt(array, [1, 3]);
  8411. *
  8412. * console.log(array);
  8413. * // => ['a', 'c']
  8414. *
  8415. * console.log(pulled);
  8416. * // => ['b', 'd']
  8417. */
  8418. var pullAt = flatRest(function(array, indexes) {
  8419. var length = array == null ? 0 : array.length,
  8420. result = baseAt(array, indexes);
  8421. basePullAt(array, arrayMap(indexes, function(index) {
  8422. return isIndex(index, length) ? +index : index;
  8423. }).sort(compareAscending));
  8424. return result;
  8425. });
  8426. /**
  8427. * Removes all elements from `array` that `predicate` returns truthy for
  8428. * and returns an array of the removed elements. The predicate is invoked
  8429. * with three arguments: (value, index, array).
  8430. *
  8431. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8432. * to pull elements from an array by value.
  8433. *
  8434. * @static
  8435. * @memberOf _
  8436. * @since 2.0.0
  8437. * @category Array
  8438. * @param {Array} array The array to modify.
  8439. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8440. * @returns {Array} Returns the new array of removed elements.
  8441. * @example
  8442. *
  8443. * var array = [1, 2, 3, 4];
  8444. * var evens = _.remove(array, function(n) {
  8445. * return n % 2 == 0;
  8446. * });
  8447. *
  8448. * console.log(array);
  8449. * // => [1, 3]
  8450. *
  8451. * console.log(evens);
  8452. * // => [2, 4]
  8453. */
  8454. function remove(array, predicate) {
  8455. var result = [];
  8456. if (!(array && array.length)) {
  8457. return result;
  8458. }
  8459. var index = -1,
  8460. indexes = [],
  8461. length = array.length;
  8462. predicate = getIteratee(predicate, 3);
  8463. while (++index < length) {
  8464. var value = array[index];
  8465. if (predicate(value, index, array)) {
  8466. result.push(value);
  8467. indexes.push(index);
  8468. }
  8469. }
  8470. basePullAt(array, indexes);
  8471. return result;
  8472. }
  8473. /**
  8474. * Reverses `array` so that the first element becomes the last, the second
  8475. * element becomes the second to last, and so on.
  8476. *
  8477. * **Note:** This method mutates `array` and is based on
  8478. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8479. *
  8480. * @static
  8481. * @memberOf _
  8482. * @since 4.0.0
  8483. * @category Array
  8484. * @param {Array} array The array to modify.
  8485. * @returns {Array} Returns `array`.
  8486. * @example
  8487. *
  8488. * var array = [1, 2, 3];
  8489. *
  8490. * _.reverse(array);
  8491. * // => [3, 2, 1]
  8492. *
  8493. * console.log(array);
  8494. * // => [3, 2, 1]
  8495. */
  8496. function reverse(array) {
  8497. return array == null ? array : nativeReverse.call(array);
  8498. }
  8499. /**
  8500. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8501. *
  8502. * **Note:** This method is used instead of
  8503. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8504. * returned.
  8505. *
  8506. * @static
  8507. * @memberOf _
  8508. * @since 3.0.0
  8509. * @category Array
  8510. * @param {Array} array The array to slice.
  8511. * @param {number} [start=0] The start position.
  8512. * @param {number} [end=array.length] The end position.
  8513. * @returns {Array} Returns the slice of `array`.
  8514. */
  8515. function slice(array, start, end) {
  8516. var length = array == null ? 0 : array.length;
  8517. if (!length) {
  8518. return [];
  8519. }
  8520. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8521. start = 0;
  8522. end = length;
  8523. }
  8524. else {
  8525. start = start == null ? 0 : toInteger(start);
  8526. end = end === undefined ? length : toInteger(end);
  8527. }
  8528. return baseSlice(array, start, end);
  8529. }
  8530. /**
  8531. * Uses a binary search to determine the lowest index at which `value`
  8532. * should be inserted into `array` in order to maintain its sort order.
  8533. *
  8534. * @static
  8535. * @memberOf _
  8536. * @since 0.1.0
  8537. * @category Array
  8538. * @param {Array} array The sorted array to inspect.
  8539. * @param {*} value The value to evaluate.
  8540. * @returns {number} Returns the index at which `value` should be inserted
  8541. * into `array`.
  8542. * @example
  8543. *
  8544. * _.sortedIndex([30, 50], 40);
  8545. * // => 1
  8546. */
  8547. function sortedIndex(array, value) {
  8548. return baseSortedIndex(array, value);
  8549. }
  8550. /**
  8551. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8552. * which is invoked for `value` and each element of `array` to compute their
  8553. * sort ranking. The iteratee is invoked with one argument: (value).
  8554. *
  8555. * @static
  8556. * @memberOf _
  8557. * @since 4.0.0
  8558. * @category Array
  8559. * @param {Array} array The sorted array to inspect.
  8560. * @param {*} value The value to evaluate.
  8561. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8562. * @returns {number} Returns the index at which `value` should be inserted
  8563. * into `array`.
  8564. * @example
  8565. *
  8566. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8567. *
  8568. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8569. * // => 0
  8570. *
  8571. * // The `_.property` iteratee shorthand.
  8572. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8573. * // => 0
  8574. */
  8575. function sortedIndexBy(array, value, iteratee) {
  8576. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8577. }
  8578. /**
  8579. * This method is like `_.indexOf` except that it performs a binary
  8580. * search on a sorted `array`.
  8581. *
  8582. * @static
  8583. * @memberOf _
  8584. * @since 4.0.0
  8585. * @category Array
  8586. * @param {Array} array The array to inspect.
  8587. * @param {*} value The value to search for.
  8588. * @returns {number} Returns the index of the matched value, else `-1`.
  8589. * @example
  8590. *
  8591. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8592. * // => 1
  8593. */
  8594. function sortedIndexOf(array, value) {
  8595. var length = array == null ? 0 : array.length;
  8596. if (length) {
  8597. var index = baseSortedIndex(array, value);
  8598. if (index < length && eq(array[index], value)) {
  8599. return index;
  8600. }
  8601. }
  8602. return -1;
  8603. }
  8604. /**
  8605. * This method is like `_.sortedIndex` except that it returns the highest
  8606. * index at which `value` should be inserted into `array` in order to
  8607. * maintain its sort order.
  8608. *
  8609. * @static
  8610. * @memberOf _
  8611. * @since 3.0.0
  8612. * @category Array
  8613. * @param {Array} array The sorted array to inspect.
  8614. * @param {*} value The value to evaluate.
  8615. * @returns {number} Returns the index at which `value` should be inserted
  8616. * into `array`.
  8617. * @example
  8618. *
  8619. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8620. * // => 4
  8621. */
  8622. function sortedLastIndex(array, value) {
  8623. return baseSortedIndex(array, value, true);
  8624. }
  8625. /**
  8626. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8627. * which is invoked for `value` and each element of `array` to compute their
  8628. * sort ranking. The iteratee is invoked with one argument: (value).
  8629. *
  8630. * @static
  8631. * @memberOf _
  8632. * @since 4.0.0
  8633. * @category Array
  8634. * @param {Array} array The sorted array to inspect.
  8635. * @param {*} value The value to evaluate.
  8636. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8637. * @returns {number} Returns the index at which `value` should be inserted
  8638. * into `array`.
  8639. * @example
  8640. *
  8641. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8642. *
  8643. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8644. * // => 1
  8645. *
  8646. * // The `_.property` iteratee shorthand.
  8647. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8648. * // => 1
  8649. */
  8650. function sortedLastIndexBy(array, value, iteratee) {
  8651. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8652. }
  8653. /**
  8654. * This method is like `_.lastIndexOf` except that it performs a binary
  8655. * search on a sorted `array`.
  8656. *
  8657. * @static
  8658. * @memberOf _
  8659. * @since 4.0.0
  8660. * @category Array
  8661. * @param {Array} array The array to inspect.
  8662. * @param {*} value The value to search for.
  8663. * @returns {number} Returns the index of the matched value, else `-1`.
  8664. * @example
  8665. *
  8666. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8667. * // => 3
  8668. */
  8669. function sortedLastIndexOf(array, value) {
  8670. var length = array == null ? 0 : array.length;
  8671. if (length) {
  8672. var index = baseSortedIndex(array, value, true) - 1;
  8673. if (eq(array[index], value)) {
  8674. return index;
  8675. }
  8676. }
  8677. return -1;
  8678. }
  8679. /**
  8680. * This method is like `_.uniq` except that it's designed and optimized
  8681. * for sorted arrays.
  8682. *
  8683. * @static
  8684. * @memberOf _
  8685. * @since 4.0.0
  8686. * @category Array
  8687. * @param {Array} array The array to inspect.
  8688. * @returns {Array} Returns the new duplicate free array.
  8689. * @example
  8690. *
  8691. * _.sortedUniq([1, 1, 2]);
  8692. * // => [1, 2]
  8693. */
  8694. function sortedUniq(array) {
  8695. return (array && array.length)
  8696. ? baseSortedUniq(array)
  8697. : [];
  8698. }
  8699. /**
  8700. * This method is like `_.uniqBy` except that it's designed and optimized
  8701. * for sorted arrays.
  8702. *
  8703. * @static
  8704. * @memberOf _
  8705. * @since 4.0.0
  8706. * @category Array
  8707. * @param {Array} array The array to inspect.
  8708. * @param {Function} [iteratee] The iteratee invoked per element.
  8709. * @returns {Array} Returns the new duplicate free array.
  8710. * @example
  8711. *
  8712. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8713. * // => [1.1, 2.3]
  8714. */
  8715. function sortedUniqBy(array, iteratee) {
  8716. return (array && array.length)
  8717. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8718. : [];
  8719. }
  8720. /**
  8721. * Gets all but the first element of `array`.
  8722. *
  8723. * @static
  8724. * @memberOf _
  8725. * @since 4.0.0
  8726. * @category Array
  8727. * @param {Array} array The array to query.
  8728. * @returns {Array} Returns the slice of `array`.
  8729. * @example
  8730. *
  8731. * _.tail([1, 2, 3]);
  8732. * // => [2, 3]
  8733. */
  8734. function tail(array) {
  8735. var length = array == null ? 0 : array.length;
  8736. return length ? baseSlice(array, 1, length) : [];
  8737. }
  8738. /**
  8739. * Creates a slice of `array` with `n` elements taken from the beginning.
  8740. *
  8741. * @static
  8742. * @memberOf _
  8743. * @since 0.1.0
  8744. * @category Array
  8745. * @param {Array} array The array to query.
  8746. * @param {number} [n=1] The number of elements to take.
  8747. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8748. * @returns {Array} Returns the slice of `array`.
  8749. * @example
  8750. *
  8751. * _.take([1, 2, 3]);
  8752. * // => [1]
  8753. *
  8754. * _.take([1, 2, 3], 2);
  8755. * // => [1, 2]
  8756. *
  8757. * _.take([1, 2, 3], 5);
  8758. * // => [1, 2, 3]
  8759. *
  8760. * _.take([1, 2, 3], 0);
  8761. * // => []
  8762. */
  8763. function take(array, n, guard) {
  8764. if (!(array && array.length)) {
  8765. return [];
  8766. }
  8767. n = (guard || n === undefined) ? 1 : toInteger(n);
  8768. return baseSlice(array, 0, n < 0 ? 0 : n);
  8769. }
  8770. /**
  8771. * Creates a slice of `array` with `n` elements taken from the end.
  8772. *
  8773. * @static
  8774. * @memberOf _
  8775. * @since 3.0.0
  8776. * @category Array
  8777. * @param {Array} array The array to query.
  8778. * @param {number} [n=1] The number of elements to take.
  8779. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8780. * @returns {Array} Returns the slice of `array`.
  8781. * @example
  8782. *
  8783. * _.takeRight([1, 2, 3]);
  8784. * // => [3]
  8785. *
  8786. * _.takeRight([1, 2, 3], 2);
  8787. * // => [2, 3]
  8788. *
  8789. * _.takeRight([1, 2, 3], 5);
  8790. * // => [1, 2, 3]
  8791. *
  8792. * _.takeRight([1, 2, 3], 0);
  8793. * // => []
  8794. */
  8795. function takeRight(array, n, guard) {
  8796. var length = array == null ? 0 : array.length;
  8797. if (!length) {
  8798. return [];
  8799. }
  8800. n = (guard || n === undefined) ? 1 : toInteger(n);
  8801. n = length - n;
  8802. return baseSlice(array, n < 0 ? 0 : n, length);
  8803. }
  8804. /**
  8805. * Creates a slice of `array` with elements taken from the end. Elements are
  8806. * taken until `predicate` returns falsey. The predicate is invoked with
  8807. * three arguments: (value, index, array).
  8808. *
  8809. * @static
  8810. * @memberOf _
  8811. * @since 3.0.0
  8812. * @category Array
  8813. * @param {Array} array The array to query.
  8814. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8815. * @returns {Array} Returns the slice of `array`.
  8816. * @example
  8817. *
  8818. * var users = [
  8819. * { 'user': 'barney', 'active': true },
  8820. * { 'user': 'fred', 'active': false },
  8821. * { 'user': 'pebbles', 'active': false }
  8822. * ];
  8823. *
  8824. * _.takeRightWhile(users, function(o) { return !o.active; });
  8825. * // => objects for ['fred', 'pebbles']
  8826. *
  8827. * // The `_.matches` iteratee shorthand.
  8828. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8829. * // => objects for ['pebbles']
  8830. *
  8831. * // The `_.matchesProperty` iteratee shorthand.
  8832. * _.takeRightWhile(users, ['active', false]);
  8833. * // => objects for ['fred', 'pebbles']
  8834. *
  8835. * // The `_.property` iteratee shorthand.
  8836. * _.takeRightWhile(users, 'active');
  8837. * // => []
  8838. */
  8839. function takeRightWhile(array, predicate) {
  8840. return (array && array.length)
  8841. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8842. : [];
  8843. }
  8844. /**
  8845. * Creates a slice of `array` with elements taken from the beginning. Elements
  8846. * are taken until `predicate` returns falsey. The predicate is invoked with
  8847. * three arguments: (value, index, array).
  8848. *
  8849. * @static
  8850. * @memberOf _
  8851. * @since 3.0.0
  8852. * @category Array
  8853. * @param {Array} array The array to query.
  8854. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8855. * @returns {Array} Returns the slice of `array`.
  8856. * @example
  8857. *
  8858. * var users = [
  8859. * { 'user': 'barney', 'active': false },
  8860. * { 'user': 'fred', 'active': false },
  8861. * { 'user': 'pebbles', 'active': true }
  8862. * ];
  8863. *
  8864. * _.takeWhile(users, function(o) { return !o.active; });
  8865. * // => objects for ['barney', 'fred']
  8866. *
  8867. * // The `_.matches` iteratee shorthand.
  8868. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8869. * // => objects for ['barney']
  8870. *
  8871. * // The `_.matchesProperty` iteratee shorthand.
  8872. * _.takeWhile(users, ['active', false]);
  8873. * // => objects for ['barney', 'fred']
  8874. *
  8875. * // The `_.property` iteratee shorthand.
  8876. * _.takeWhile(users, 'active');
  8877. * // => []
  8878. */
  8879. function takeWhile(array, predicate) {
  8880. return (array && array.length)
  8881. ? baseWhile(array, getIteratee(predicate, 3))
  8882. : [];
  8883. }
  8884. /**
  8885. * Creates an array of unique values, in order, from all given arrays using
  8886. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8887. * for equality comparisons.
  8888. *
  8889. * @static
  8890. * @memberOf _
  8891. * @since 0.1.0
  8892. * @category Array
  8893. * @param {...Array} [arrays] The arrays to inspect.
  8894. * @returns {Array} Returns the new array of combined values.
  8895. * @example
  8896. *
  8897. * _.union([2], [1, 2]);
  8898. * // => [2, 1]
  8899. */
  8900. var union = baseRest(function(arrays) {
  8901. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8902. });
  8903. /**
  8904. * This method is like `_.union` except that it accepts `iteratee` which is
  8905. * invoked for each element of each `arrays` to generate the criterion by
  8906. * which uniqueness is computed. Result values are chosen from the first
  8907. * array in which the value occurs. The iteratee is invoked with one argument:
  8908. * (value).
  8909. *
  8910. * @static
  8911. * @memberOf _
  8912. * @since 4.0.0
  8913. * @category Array
  8914. * @param {...Array} [arrays] The arrays to inspect.
  8915. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8916. * @returns {Array} Returns the new array of combined values.
  8917. * @example
  8918. *
  8919. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8920. * // => [2.1, 1.2]
  8921. *
  8922. * // The `_.property` iteratee shorthand.
  8923. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8924. * // => [{ 'x': 1 }, { 'x': 2 }]
  8925. */
  8926. var unionBy = baseRest(function(arrays) {
  8927. var iteratee = last(arrays);
  8928. if (isArrayLikeObject(iteratee)) {
  8929. iteratee = undefined;
  8930. }
  8931. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8932. });
  8933. /**
  8934. * This method is like `_.union` except that it accepts `comparator` which
  8935. * is invoked to compare elements of `arrays`. Result values are chosen from
  8936. * the first array in which the value occurs. The comparator is invoked
  8937. * with two arguments: (arrVal, othVal).
  8938. *
  8939. * @static
  8940. * @memberOf _
  8941. * @since 4.0.0
  8942. * @category Array
  8943. * @param {...Array} [arrays] The arrays to inspect.
  8944. * @param {Function} [comparator] The comparator invoked per element.
  8945. * @returns {Array} Returns the new array of combined values.
  8946. * @example
  8947. *
  8948. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8949. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8950. *
  8951. * _.unionWith(objects, others, _.isEqual);
  8952. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8953. */
  8954. var unionWith = baseRest(function(arrays) {
  8955. var comparator = last(arrays);
  8956. comparator = typeof comparator == 'function' ? comparator : undefined;
  8957. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8958. });
  8959. /**
  8960. * Creates a duplicate-free version of an array, using
  8961. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8962. * for equality comparisons, in which only the first occurrence of each element
  8963. * is kept. The order of result values is determined by the order they occur
  8964. * in the array.
  8965. *
  8966. * @static
  8967. * @memberOf _
  8968. * @since 0.1.0
  8969. * @category Array
  8970. * @param {Array} array The array to inspect.
  8971. * @returns {Array} Returns the new duplicate free array.
  8972. * @example
  8973. *
  8974. * _.uniq([2, 1, 2]);
  8975. * // => [2, 1]
  8976. */
  8977. function uniq(array) {
  8978. return (array && array.length) ? baseUniq(array) : [];
  8979. }
  8980. /**
  8981. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8982. * invoked for each element in `array` to generate the criterion by which
  8983. * uniqueness is computed. The order of result values is determined by the
  8984. * order they occur in the array. The iteratee is invoked with one argument:
  8985. * (value).
  8986. *
  8987. * @static
  8988. * @memberOf _
  8989. * @since 4.0.0
  8990. * @category Array
  8991. * @param {Array} array The array to inspect.
  8992. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8993. * @returns {Array} Returns the new duplicate free array.
  8994. * @example
  8995. *
  8996. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8997. * // => [2.1, 1.2]
  8998. *
  8999. * // The `_.property` iteratee shorthand.
  9000. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9001. * // => [{ 'x': 1 }, { 'x': 2 }]
  9002. */
  9003. function uniqBy(array, iteratee) {
  9004. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9005. }
  9006. /**
  9007. * This method is like `_.uniq` except that it accepts `comparator` which
  9008. * is invoked to compare elements of `array`. The order of result values is
  9009. * determined by the order they occur in the array.The comparator is invoked
  9010. * with two arguments: (arrVal, othVal).
  9011. *
  9012. * @static
  9013. * @memberOf _
  9014. * @since 4.0.0
  9015. * @category Array
  9016. * @param {Array} array The array to inspect.
  9017. * @param {Function} [comparator] The comparator invoked per element.
  9018. * @returns {Array} Returns the new duplicate free array.
  9019. * @example
  9020. *
  9021. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9022. *
  9023. * _.uniqWith(objects, _.isEqual);
  9024. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9025. */
  9026. function uniqWith(array, comparator) {
  9027. comparator = typeof comparator == 'function' ? comparator : undefined;
  9028. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9029. }
  9030. /**
  9031. * This method is like `_.zip` except that it accepts an array of grouped
  9032. * elements and creates an array regrouping the elements to their pre-zip
  9033. * configuration.
  9034. *
  9035. * @static
  9036. * @memberOf _
  9037. * @since 1.2.0
  9038. * @category Array
  9039. * @param {Array} array The array of grouped elements to process.
  9040. * @returns {Array} Returns the new array of regrouped elements.
  9041. * @example
  9042. *
  9043. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9044. * // => [['a', 1, true], ['b', 2, false]]
  9045. *
  9046. * _.unzip(zipped);
  9047. * // => [['a', 'b'], [1, 2], [true, false]]
  9048. */
  9049. function unzip(array) {
  9050. if (!(array && array.length)) {
  9051. return [];
  9052. }
  9053. var length = 0;
  9054. array = arrayFilter(array, function(group) {
  9055. if (isArrayLikeObject(group)) {
  9056. length = nativeMax(group.length, length);
  9057. return true;
  9058. }
  9059. });
  9060. return baseTimes(length, function(index) {
  9061. return arrayMap(array, baseProperty(index));
  9062. });
  9063. }
  9064. /**
  9065. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9066. * how regrouped values should be combined. The iteratee is invoked with the
  9067. * elements of each group: (...group).
  9068. *
  9069. * @static
  9070. * @memberOf _
  9071. * @since 3.8.0
  9072. * @category Array
  9073. * @param {Array} array The array of grouped elements to process.
  9074. * @param {Function} [iteratee=_.identity] The function to combine
  9075. * regrouped values.
  9076. * @returns {Array} Returns the new array of regrouped elements.
  9077. * @example
  9078. *
  9079. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9080. * // => [[1, 10, 100], [2, 20, 200]]
  9081. *
  9082. * _.unzipWith(zipped, _.add);
  9083. * // => [3, 30, 300]
  9084. */
  9085. function unzipWith(array, iteratee) {
  9086. if (!(array && array.length)) {
  9087. return [];
  9088. }
  9089. var result = unzip(array);
  9090. if (iteratee == null) {
  9091. return result;
  9092. }
  9093. return arrayMap(result, function(group) {
  9094. return apply(iteratee, undefined, group);
  9095. });
  9096. }
  9097. /**
  9098. * Creates an array excluding all given values using
  9099. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9100. * for equality comparisons.
  9101. *
  9102. * **Note:** Unlike `_.pull`, this method returns a new array.
  9103. *
  9104. * @static
  9105. * @memberOf _
  9106. * @since 0.1.0
  9107. * @category Array
  9108. * @param {Array} array The array to inspect.
  9109. * @param {...*} [values] The values to exclude.
  9110. * @returns {Array} Returns the new array of filtered values.
  9111. * @see _.difference, _.xor
  9112. * @example
  9113. *
  9114. * _.without([2, 1, 2, 3], 1, 2);
  9115. * // => [3]
  9116. */
  9117. var without = baseRest(function(array, values) {
  9118. return isArrayLikeObject(array)
  9119. ? baseDifference(array, values)
  9120. : [];
  9121. });
  9122. /**
  9123. * Creates an array of unique values that is the
  9124. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9125. * of the given arrays. The order of result values is determined by the order
  9126. * they occur in the arrays.
  9127. *
  9128. * @static
  9129. * @memberOf _
  9130. * @since 2.4.0
  9131. * @category Array
  9132. * @param {...Array} [arrays] The arrays to inspect.
  9133. * @returns {Array} Returns the new array of filtered values.
  9134. * @see _.difference, _.without
  9135. * @example
  9136. *
  9137. * _.xor([2, 1], [2, 3]);
  9138. * // => [1, 3]
  9139. */
  9140. var xor = baseRest(function(arrays) {
  9141. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9142. });
  9143. /**
  9144. * This method is like `_.xor` except that it accepts `iteratee` which is
  9145. * invoked for each element of each `arrays` to generate the criterion by
  9146. * which by which they're compared. The order of result values is determined
  9147. * by the order they occur in the arrays. The iteratee is invoked with one
  9148. * argument: (value).
  9149. *
  9150. * @static
  9151. * @memberOf _
  9152. * @since 4.0.0
  9153. * @category Array
  9154. * @param {...Array} [arrays] The arrays to inspect.
  9155. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9156. * @returns {Array} Returns the new array of filtered values.
  9157. * @example
  9158. *
  9159. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9160. * // => [1.2, 3.4]
  9161. *
  9162. * // The `_.property` iteratee shorthand.
  9163. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9164. * // => [{ 'x': 2 }]
  9165. */
  9166. var xorBy = baseRest(function(arrays) {
  9167. var iteratee = last(arrays);
  9168. if (isArrayLikeObject(iteratee)) {
  9169. iteratee = undefined;
  9170. }
  9171. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9172. });
  9173. /**
  9174. * This method is like `_.xor` except that it accepts `comparator` which is
  9175. * invoked to compare elements of `arrays`. The order of result values is
  9176. * determined by the order they occur in the arrays. The comparator is invoked
  9177. * with two arguments: (arrVal, othVal).
  9178. *
  9179. * @static
  9180. * @memberOf _
  9181. * @since 4.0.0
  9182. * @category Array
  9183. * @param {...Array} [arrays] The arrays to inspect.
  9184. * @param {Function} [comparator] The comparator invoked per element.
  9185. * @returns {Array} Returns the new array of filtered values.
  9186. * @example
  9187. *
  9188. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9189. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9190. *
  9191. * _.xorWith(objects, others, _.isEqual);
  9192. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9193. */
  9194. var xorWith = baseRest(function(arrays) {
  9195. var comparator = last(arrays);
  9196. comparator = typeof comparator == 'function' ? comparator : undefined;
  9197. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9198. });
  9199. /**
  9200. * Creates an array of grouped elements, the first of which contains the
  9201. * first elements of the given arrays, the second of which contains the
  9202. * second elements of the given arrays, and so on.
  9203. *
  9204. * @static
  9205. * @memberOf _
  9206. * @since 0.1.0
  9207. * @category Array
  9208. * @param {...Array} [arrays] The arrays to process.
  9209. * @returns {Array} Returns the new array of grouped elements.
  9210. * @example
  9211. *
  9212. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9213. * // => [['a', 1, true], ['b', 2, false]]
  9214. */
  9215. var zip = baseRest(unzip);
  9216. /**
  9217. * This method is like `_.fromPairs` except that it accepts two arrays,
  9218. * one of property identifiers and one of corresponding values.
  9219. *
  9220. * @static
  9221. * @memberOf _
  9222. * @since 0.4.0
  9223. * @category Array
  9224. * @param {Array} [props=[]] The property identifiers.
  9225. * @param {Array} [values=[]] The property values.
  9226. * @returns {Object} Returns the new object.
  9227. * @example
  9228. *
  9229. * _.zipObject(['a', 'b'], [1, 2]);
  9230. * // => { 'a': 1, 'b': 2 }
  9231. */
  9232. function zipObject(props, values) {
  9233. return baseZipObject(props || [], values || [], assignValue);
  9234. }
  9235. /**
  9236. * This method is like `_.zipObject` except that it supports property paths.
  9237. *
  9238. * @static
  9239. * @memberOf _
  9240. * @since 4.1.0
  9241. * @category Array
  9242. * @param {Array} [props=[]] The property identifiers.
  9243. * @param {Array} [values=[]] The property values.
  9244. * @returns {Object} Returns the new object.
  9245. * @example
  9246. *
  9247. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9248. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9249. */
  9250. function zipObjectDeep(props, values) {
  9251. return baseZipObject(props || [], values || [], baseSet);
  9252. }
  9253. /**
  9254. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9255. * how grouped values should be combined. The iteratee is invoked with the
  9256. * elements of each group: (...group).
  9257. *
  9258. * @static
  9259. * @memberOf _
  9260. * @since 3.8.0
  9261. * @category Array
  9262. * @param {...Array} [arrays] The arrays to process.
  9263. * @param {Function} [iteratee=_.identity] The function to combine
  9264. * grouped values.
  9265. * @returns {Array} Returns the new array of grouped elements.
  9266. * @example
  9267. *
  9268. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9269. * return a + b + c;
  9270. * });
  9271. * // => [111, 222]
  9272. */
  9273. var zipWith = baseRest(function(arrays) {
  9274. var length = arrays.length,
  9275. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9276. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9277. return unzipWith(arrays, iteratee);
  9278. });
  9279. /*------------------------------------------------------------------------*/
  9280. /**
  9281. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9282. * chain sequences enabled. The result of such sequences must be unwrapped
  9283. * with `_#value`.
  9284. *
  9285. * @static
  9286. * @memberOf _
  9287. * @since 1.3.0
  9288. * @category Seq
  9289. * @param {*} value The value to wrap.
  9290. * @returns {Object} Returns the new `lodash` wrapper instance.
  9291. * @example
  9292. *
  9293. * var users = [
  9294. * { 'user': 'barney', 'age': 36 },
  9295. * { 'user': 'fred', 'age': 40 },
  9296. * { 'user': 'pebbles', 'age': 1 }
  9297. * ];
  9298. *
  9299. * var youngest = _
  9300. * .chain(users)
  9301. * .sortBy('age')
  9302. * .map(function(o) {
  9303. * return o.user + ' is ' + o.age;
  9304. * })
  9305. * .head()
  9306. * .value();
  9307. * // => 'pebbles is 1'
  9308. */
  9309. function chain(value) {
  9310. var result = lodash(value);
  9311. result.__chain__ = true;
  9312. return result;
  9313. }
  9314. /**
  9315. * This method invokes `interceptor` and returns `value`. The interceptor
  9316. * is invoked with one argument; (value). The purpose of this method is to
  9317. * "tap into" a method chain sequence in order to modify intermediate results.
  9318. *
  9319. * @static
  9320. * @memberOf _
  9321. * @since 0.1.0
  9322. * @category Seq
  9323. * @param {*} value The value to provide to `interceptor`.
  9324. * @param {Function} interceptor The function to invoke.
  9325. * @returns {*} Returns `value`.
  9326. * @example
  9327. *
  9328. * _([1, 2, 3])
  9329. * .tap(function(array) {
  9330. * // Mutate input array.
  9331. * array.pop();
  9332. * })
  9333. * .reverse()
  9334. * .value();
  9335. * // => [2, 1]
  9336. */
  9337. function tap(value, interceptor) {
  9338. interceptor(value);
  9339. return value;
  9340. }
  9341. /**
  9342. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9343. * The purpose of this method is to "pass thru" values replacing intermediate
  9344. * results in a method chain sequence.
  9345. *
  9346. * @static
  9347. * @memberOf _
  9348. * @since 3.0.0
  9349. * @category Seq
  9350. * @param {*} value The value to provide to `interceptor`.
  9351. * @param {Function} interceptor The function to invoke.
  9352. * @returns {*} Returns the result of `interceptor`.
  9353. * @example
  9354. *
  9355. * _(' abc ')
  9356. * .chain()
  9357. * .trim()
  9358. * .thru(function(value) {
  9359. * return [value];
  9360. * })
  9361. * .value();
  9362. * // => ['abc']
  9363. */
  9364. function thru(value, interceptor) {
  9365. return interceptor(value);
  9366. }
  9367. /**
  9368. * This method is the wrapper version of `_.at`.
  9369. *
  9370. * @name at
  9371. * @memberOf _
  9372. * @since 1.0.0
  9373. * @category Seq
  9374. * @param {...(string|string[])} [paths] The property paths to pick.
  9375. * @returns {Object} Returns the new `lodash` wrapper instance.
  9376. * @example
  9377. *
  9378. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9379. *
  9380. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9381. * // => [3, 4]
  9382. */
  9383. var wrapperAt = flatRest(function(paths) {
  9384. var length = paths.length,
  9385. start = length ? paths[0] : 0,
  9386. value = this.__wrapped__,
  9387. interceptor = function(object) { return baseAt(object, paths); };
  9388. if (length > 1 || this.__actions__.length ||
  9389. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9390. return this.thru(interceptor);
  9391. }
  9392. value = value.slice(start, +start + (length ? 1 : 0));
  9393. value.__actions__.push({
  9394. 'func': thru,
  9395. 'args': [interceptor],
  9396. 'thisArg': undefined
  9397. });
  9398. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9399. if (length && !array.length) {
  9400. array.push(undefined);
  9401. }
  9402. return array;
  9403. });
  9404. });
  9405. /**
  9406. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9407. *
  9408. * @name chain
  9409. * @memberOf _
  9410. * @since 0.1.0
  9411. * @category Seq
  9412. * @returns {Object} Returns the new `lodash` wrapper instance.
  9413. * @example
  9414. *
  9415. * var users = [
  9416. * { 'user': 'barney', 'age': 36 },
  9417. * { 'user': 'fred', 'age': 40 }
  9418. * ];
  9419. *
  9420. * // A sequence without explicit chaining.
  9421. * _(users).head();
  9422. * // => { 'user': 'barney', 'age': 36 }
  9423. *
  9424. * // A sequence with explicit chaining.
  9425. * _(users)
  9426. * .chain()
  9427. * .head()
  9428. * .pick('user')
  9429. * .value();
  9430. * // => { 'user': 'barney' }
  9431. */
  9432. function wrapperChain() {
  9433. return chain(this);
  9434. }
  9435. /**
  9436. * Executes the chain sequence and returns the wrapped result.
  9437. *
  9438. * @name commit
  9439. * @memberOf _
  9440. * @since 3.2.0
  9441. * @category Seq
  9442. * @returns {Object} Returns the new `lodash` wrapper instance.
  9443. * @example
  9444. *
  9445. * var array = [1, 2];
  9446. * var wrapped = _(array).push(3);
  9447. *
  9448. * console.log(array);
  9449. * // => [1, 2]
  9450. *
  9451. * wrapped = wrapped.commit();
  9452. * console.log(array);
  9453. * // => [1, 2, 3]
  9454. *
  9455. * wrapped.last();
  9456. * // => 3
  9457. *
  9458. * console.log(array);
  9459. * // => [1, 2, 3]
  9460. */
  9461. function wrapperCommit() {
  9462. return new LodashWrapper(this.value(), this.__chain__);
  9463. }
  9464. /**
  9465. * Gets the next value on a wrapped object following the
  9466. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9467. *
  9468. * @name next
  9469. * @memberOf _
  9470. * @since 4.0.0
  9471. * @category Seq
  9472. * @returns {Object} Returns the next iterator value.
  9473. * @example
  9474. *
  9475. * var wrapped = _([1, 2]);
  9476. *
  9477. * wrapped.next();
  9478. * // => { 'done': false, 'value': 1 }
  9479. *
  9480. * wrapped.next();
  9481. * // => { 'done': false, 'value': 2 }
  9482. *
  9483. * wrapped.next();
  9484. * // => { 'done': true, 'value': undefined }
  9485. */
  9486. function wrapperNext() {
  9487. if (this.__values__ === undefined) {
  9488. this.__values__ = toArray(this.value());
  9489. }
  9490. var done = this.__index__ >= this.__values__.length,
  9491. value = done ? undefined : this.__values__[this.__index__++];
  9492. return { 'done': done, 'value': value };
  9493. }
  9494. /**
  9495. * Enables the wrapper to be iterable.
  9496. *
  9497. * @name Symbol.iterator
  9498. * @memberOf _
  9499. * @since 4.0.0
  9500. * @category Seq
  9501. * @returns {Object} Returns the wrapper object.
  9502. * @example
  9503. *
  9504. * var wrapped = _([1, 2]);
  9505. *
  9506. * wrapped[Symbol.iterator]() === wrapped;
  9507. * // => true
  9508. *
  9509. * Array.from(wrapped);
  9510. * // => [1, 2]
  9511. */
  9512. function wrapperToIterator() {
  9513. return this;
  9514. }
  9515. /**
  9516. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9517. *
  9518. * @name plant
  9519. * @memberOf _
  9520. * @since 3.2.0
  9521. * @category Seq
  9522. * @param {*} value The value to plant.
  9523. * @returns {Object} Returns the new `lodash` wrapper instance.
  9524. * @example
  9525. *
  9526. * function square(n) {
  9527. * return n * n;
  9528. * }
  9529. *
  9530. * var wrapped = _([1, 2]).map(square);
  9531. * var other = wrapped.plant([3, 4]);
  9532. *
  9533. * other.value();
  9534. * // => [9, 16]
  9535. *
  9536. * wrapped.value();
  9537. * // => [1, 4]
  9538. */
  9539. function wrapperPlant(value) {
  9540. var result,
  9541. parent = this;
  9542. while (parent instanceof baseLodash) {
  9543. var clone = wrapperClone(parent);
  9544. clone.__index__ = 0;
  9545. clone.__values__ = undefined;
  9546. if (result) {
  9547. previous.__wrapped__ = clone;
  9548. } else {
  9549. result = clone;
  9550. }
  9551. var previous = clone;
  9552. parent = parent.__wrapped__;
  9553. }
  9554. previous.__wrapped__ = value;
  9555. return result;
  9556. }
  9557. /**
  9558. * This method is the wrapper version of `_.reverse`.
  9559. *
  9560. * **Note:** This method mutates the wrapped array.
  9561. *
  9562. * @name reverse
  9563. * @memberOf _
  9564. * @since 0.1.0
  9565. * @category Seq
  9566. * @returns {Object} Returns the new `lodash` wrapper instance.
  9567. * @example
  9568. *
  9569. * var array = [1, 2, 3];
  9570. *
  9571. * _(array).reverse().value()
  9572. * // => [3, 2, 1]
  9573. *
  9574. * console.log(array);
  9575. * // => [3, 2, 1]
  9576. */
  9577. function wrapperReverse() {
  9578. var value = this.__wrapped__;
  9579. if (value instanceof LazyWrapper) {
  9580. var wrapped = value;
  9581. if (this.__actions__.length) {
  9582. wrapped = new LazyWrapper(this);
  9583. }
  9584. wrapped = wrapped.reverse();
  9585. wrapped.__actions__.push({
  9586. 'func': thru,
  9587. 'args': [reverse],
  9588. 'thisArg': undefined
  9589. });
  9590. return new LodashWrapper(wrapped, this.__chain__);
  9591. }
  9592. return this.thru(reverse);
  9593. }
  9594. /**
  9595. * Executes the chain sequence to resolve the unwrapped value.
  9596. *
  9597. * @name value
  9598. * @memberOf _
  9599. * @since 0.1.0
  9600. * @alias toJSON, valueOf
  9601. * @category Seq
  9602. * @returns {*} Returns the resolved unwrapped value.
  9603. * @example
  9604. *
  9605. * _([1, 2, 3]).value();
  9606. * // => [1, 2, 3]
  9607. */
  9608. function wrapperValue() {
  9609. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9610. }
  9611. /*------------------------------------------------------------------------*/
  9612. /**
  9613. * Creates an object composed of keys generated from the results of running
  9614. * each element of `collection` thru `iteratee`. The corresponding value of
  9615. * each key is the number of times the key was returned by `iteratee`. The
  9616. * iteratee is invoked with one argument: (value).
  9617. *
  9618. * @static
  9619. * @memberOf _
  9620. * @since 0.5.0
  9621. * @category Collection
  9622. * @param {Array|Object} collection The collection to iterate over.
  9623. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9624. * @returns {Object} Returns the composed aggregate object.
  9625. * @example
  9626. *
  9627. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9628. * // => { '4': 1, '6': 2 }
  9629. *
  9630. * // The `_.property` iteratee shorthand.
  9631. * _.countBy(['one', 'two', 'three'], 'length');
  9632. * // => { '3': 2, '5': 1 }
  9633. */
  9634. var countBy = createAggregator(function(result, value, key) {
  9635. if (hasOwnProperty.call(result, key)) {
  9636. ++result[key];
  9637. } else {
  9638. baseAssignValue(result, key, 1);
  9639. }
  9640. });
  9641. /**
  9642. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9643. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9644. * invoked with three arguments: (value, index|key, collection).
  9645. *
  9646. * **Note:** This method returns `true` for
  9647. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9648. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9649. * elements of empty collections.
  9650. *
  9651. * @static
  9652. * @memberOf _
  9653. * @since 0.1.0
  9654. * @category Collection
  9655. * @param {Array|Object} collection The collection to iterate over.
  9656. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9657. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9658. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9659. * else `false`.
  9660. * @example
  9661. *
  9662. * _.every([true, 1, null, 'yes'], Boolean);
  9663. * // => false
  9664. *
  9665. * var users = [
  9666. * { 'user': 'barney', 'age': 36, 'active': false },
  9667. * { 'user': 'fred', 'age': 40, 'active': false }
  9668. * ];
  9669. *
  9670. * // The `_.matches` iteratee shorthand.
  9671. * _.every(users, { 'user': 'barney', 'active': false });
  9672. * // => false
  9673. *
  9674. * // The `_.matchesProperty` iteratee shorthand.
  9675. * _.every(users, ['active', false]);
  9676. * // => true
  9677. *
  9678. * // The `_.property` iteratee shorthand.
  9679. * _.every(users, 'active');
  9680. * // => false
  9681. */
  9682. function every(collection, predicate, guard) {
  9683. var func = isArray(collection) ? arrayEvery : baseEvery;
  9684. if (guard && isIterateeCall(collection, predicate, guard)) {
  9685. predicate = undefined;
  9686. }
  9687. return func(collection, getIteratee(predicate, 3));
  9688. }
  9689. /**
  9690. * Iterates over elements of `collection`, returning an array of all elements
  9691. * `predicate` returns truthy for. The predicate is invoked with three
  9692. * arguments: (value, index|key, collection).
  9693. *
  9694. * **Note:** Unlike `_.remove`, this method returns a new array.
  9695. *
  9696. * @static
  9697. * @memberOf _
  9698. * @since 0.1.0
  9699. * @category Collection
  9700. * @param {Array|Object} collection The collection to iterate over.
  9701. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9702. * @returns {Array} Returns the new filtered array.
  9703. * @see _.reject
  9704. * @example
  9705. *
  9706. * var users = [
  9707. * { 'user': 'barney', 'age': 36, 'active': true },
  9708. * { 'user': 'fred', 'age': 40, 'active': false }
  9709. * ];
  9710. *
  9711. * _.filter(users, function(o) { return !o.active; });
  9712. * // => objects for ['fred']
  9713. *
  9714. * // The `_.matches` iteratee shorthand.
  9715. * _.filter(users, { 'age': 36, 'active': true });
  9716. * // => objects for ['barney']
  9717. *
  9718. * // The `_.matchesProperty` iteratee shorthand.
  9719. * _.filter(users, ['active', false]);
  9720. * // => objects for ['fred']
  9721. *
  9722. * // The `_.property` iteratee shorthand.
  9723. * _.filter(users, 'active');
  9724. * // => objects for ['barney']
  9725. *
  9726. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9727. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9728. * // => objects for ['fred', 'barney']
  9729. */
  9730. function filter(collection, predicate) {
  9731. var func = isArray(collection) ? arrayFilter : baseFilter;
  9732. return func(collection, getIteratee(predicate, 3));
  9733. }
  9734. /**
  9735. * Iterates over elements of `collection`, returning the first element
  9736. * `predicate` returns truthy for. The predicate is invoked with three
  9737. * arguments: (value, index|key, collection).
  9738. *
  9739. * @static
  9740. * @memberOf _
  9741. * @since 0.1.0
  9742. * @category Collection
  9743. * @param {Array|Object} collection The collection to inspect.
  9744. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9745. * @param {number} [fromIndex=0] The index to search from.
  9746. * @returns {*} Returns the matched element, else `undefined`.
  9747. * @example
  9748. *
  9749. * var users = [
  9750. * { 'user': 'barney', 'age': 36, 'active': true },
  9751. * { 'user': 'fred', 'age': 40, 'active': false },
  9752. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9753. * ];
  9754. *
  9755. * _.find(users, function(o) { return o.age < 40; });
  9756. * // => object for 'barney'
  9757. *
  9758. * // The `_.matches` iteratee shorthand.
  9759. * _.find(users, { 'age': 1, 'active': true });
  9760. * // => object for 'pebbles'
  9761. *
  9762. * // The `_.matchesProperty` iteratee shorthand.
  9763. * _.find(users, ['active', false]);
  9764. * // => object for 'fred'
  9765. *
  9766. * // The `_.property` iteratee shorthand.
  9767. * _.find(users, 'active');
  9768. * // => object for 'barney'
  9769. */
  9770. var find = createFind(findIndex);
  9771. /**
  9772. * This method is like `_.find` except that it iterates over elements of
  9773. * `collection` from right to left.
  9774. *
  9775. * @static
  9776. * @memberOf _
  9777. * @since 2.0.0
  9778. * @category Collection
  9779. * @param {Array|Object} collection The collection to inspect.
  9780. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9781. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9782. * @returns {*} Returns the matched element, else `undefined`.
  9783. * @example
  9784. *
  9785. * _.findLast([1, 2, 3, 4], function(n) {
  9786. * return n % 2 == 1;
  9787. * });
  9788. * // => 3
  9789. */
  9790. var findLast = createFind(findLastIndex);
  9791. /**
  9792. * Creates a flattened array of values by running each element in `collection`
  9793. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9794. * with three arguments: (value, index|key, collection).
  9795. *
  9796. * @static
  9797. * @memberOf _
  9798. * @since 4.0.0
  9799. * @category Collection
  9800. * @param {Array|Object} collection The collection to iterate over.
  9801. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9802. * @returns {Array} Returns the new flattened array.
  9803. * @example
  9804. *
  9805. * function duplicate(n) {
  9806. * return [n, n];
  9807. * }
  9808. *
  9809. * _.flatMap([1, 2], duplicate);
  9810. * // => [1, 1, 2, 2]
  9811. */
  9812. function flatMap(collection, iteratee) {
  9813. return baseFlatten(map(collection, iteratee), 1);
  9814. }
  9815. /**
  9816. * This method is like `_.flatMap` except that it recursively flattens the
  9817. * mapped results.
  9818. *
  9819. * @static
  9820. * @memberOf _
  9821. * @since 4.7.0
  9822. * @category Collection
  9823. * @param {Array|Object} collection The collection to iterate over.
  9824. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9825. * @returns {Array} Returns the new flattened array.
  9826. * @example
  9827. *
  9828. * function duplicate(n) {
  9829. * return [[[n, n]]];
  9830. * }
  9831. *
  9832. * _.flatMapDeep([1, 2], duplicate);
  9833. * // => [1, 1, 2, 2]
  9834. */
  9835. function flatMapDeep(collection, iteratee) {
  9836. return baseFlatten(map(collection, iteratee), INFINITY);
  9837. }
  9838. /**
  9839. * This method is like `_.flatMap` except that it recursively flattens the
  9840. * mapped results up to `depth` times.
  9841. *
  9842. * @static
  9843. * @memberOf _
  9844. * @since 4.7.0
  9845. * @category Collection
  9846. * @param {Array|Object} collection The collection to iterate over.
  9847. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9848. * @param {number} [depth=1] The maximum recursion depth.
  9849. * @returns {Array} Returns the new flattened array.
  9850. * @example
  9851. *
  9852. * function duplicate(n) {
  9853. * return [[[n, n]]];
  9854. * }
  9855. *
  9856. * _.flatMapDepth([1, 2], duplicate, 2);
  9857. * // => [[1, 1], [2, 2]]
  9858. */
  9859. function flatMapDepth(collection, iteratee, depth) {
  9860. depth = depth === undefined ? 1 : toInteger(depth);
  9861. return baseFlatten(map(collection, iteratee), depth);
  9862. }
  9863. /**
  9864. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9865. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9866. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9867. *
  9868. * **Note:** As with other "Collections" methods, objects with a "length"
  9869. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9870. * or `_.forOwn` for object iteration.
  9871. *
  9872. * @static
  9873. * @memberOf _
  9874. * @since 0.1.0
  9875. * @alias each
  9876. * @category Collection
  9877. * @param {Array|Object} collection The collection to iterate over.
  9878. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9879. * @returns {Array|Object} Returns `collection`.
  9880. * @see _.forEachRight
  9881. * @example
  9882. *
  9883. * _.forEach([1, 2], function(value) {
  9884. * console.log(value);
  9885. * });
  9886. * // => Logs `1` then `2`.
  9887. *
  9888. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9889. * console.log(key);
  9890. * });
  9891. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9892. */
  9893. function forEach(collection, iteratee) {
  9894. var func = isArray(collection) ? arrayEach : baseEach;
  9895. return func(collection, getIteratee(iteratee, 3));
  9896. }
  9897. /**
  9898. * This method is like `_.forEach` except that it iterates over elements of
  9899. * `collection` from right to left.
  9900. *
  9901. * @static
  9902. * @memberOf _
  9903. * @since 2.0.0
  9904. * @alias eachRight
  9905. * @category Collection
  9906. * @param {Array|Object} collection The collection to iterate over.
  9907. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9908. * @returns {Array|Object} Returns `collection`.
  9909. * @see _.forEach
  9910. * @example
  9911. *
  9912. * _.forEachRight([1, 2], function(value) {
  9913. * console.log(value);
  9914. * });
  9915. * // => Logs `2` then `1`.
  9916. */
  9917. function forEachRight(collection, iteratee) {
  9918. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9919. return func(collection, getIteratee(iteratee, 3));
  9920. }
  9921. /**
  9922. * Creates an object composed of keys generated from the results of running
  9923. * each element of `collection` thru `iteratee`. The order of grouped values
  9924. * is determined by the order they occur in `collection`. The corresponding
  9925. * value of each key is an array of elements responsible for generating the
  9926. * key. The iteratee is invoked with one argument: (value).
  9927. *
  9928. * @static
  9929. * @memberOf _
  9930. * @since 0.1.0
  9931. * @category Collection
  9932. * @param {Array|Object} collection The collection to iterate over.
  9933. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9934. * @returns {Object} Returns the composed aggregate object.
  9935. * @example
  9936. *
  9937. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9938. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9939. *
  9940. * // The `_.property` iteratee shorthand.
  9941. * _.groupBy(['one', 'two', 'three'], 'length');
  9942. * // => { '3': ['one', 'two'], '5': ['three'] }
  9943. */
  9944. var groupBy = createAggregator(function(result, value, key) {
  9945. if (hasOwnProperty.call(result, key)) {
  9946. result[key].push(value);
  9947. } else {
  9948. baseAssignValue(result, key, [value]);
  9949. }
  9950. });
  9951. /**
  9952. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9953. * checked for a substring of `value`, otherwise
  9954. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9955. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9956. * the offset from the end of `collection`.
  9957. *
  9958. * @static
  9959. * @memberOf _
  9960. * @since 0.1.0
  9961. * @category Collection
  9962. * @param {Array|Object|string} collection The collection to inspect.
  9963. * @param {*} value The value to search for.
  9964. * @param {number} [fromIndex=0] The index to search from.
  9965. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9966. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9967. * @example
  9968. *
  9969. * _.includes([1, 2, 3], 1);
  9970. * // => true
  9971. *
  9972. * _.includes([1, 2, 3], 1, 2);
  9973. * // => false
  9974. *
  9975. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9976. * // => true
  9977. *
  9978. * _.includes('abcd', 'bc');
  9979. * // => true
  9980. */
  9981. function includes(collection, value, fromIndex, guard) {
  9982. collection = isArrayLike(collection) ? collection : values(collection);
  9983. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9984. var length = collection.length;
  9985. if (fromIndex < 0) {
  9986. fromIndex = nativeMax(length + fromIndex, 0);
  9987. }
  9988. return isString(collection)
  9989. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9990. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9991. }
  9992. /**
  9993. * Invokes the method at `path` of each element in `collection`, returning
  9994. * an array of the results of each invoked method. Any additional arguments
  9995. * are provided to each invoked method. If `path` is a function, it's invoked
  9996. * for, and `this` bound to, each element in `collection`.
  9997. *
  9998. * @static
  9999. * @memberOf _
  10000. * @since 4.0.0
  10001. * @category Collection
  10002. * @param {Array|Object} collection The collection to iterate over.
  10003. * @param {Array|Function|string} path The path of the method to invoke or
  10004. * the function invoked per iteration.
  10005. * @param {...*} [args] The arguments to invoke each method with.
  10006. * @returns {Array} Returns the array of results.
  10007. * @example
  10008. *
  10009. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10010. * // => [[1, 5, 7], [1, 2, 3]]
  10011. *
  10012. * _.invokeMap([123, 456], String.prototype.split, '');
  10013. * // => [['1', '2', '3'], ['4', '5', '6']]
  10014. */
  10015. var invokeMap = baseRest(function(collection, path, args) {
  10016. var index = -1,
  10017. isFunc = typeof path == 'function',
  10018. result = isArrayLike(collection) ? Array(collection.length) : [];
  10019. baseEach(collection, function(value) {
  10020. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10021. });
  10022. return result;
  10023. });
  10024. /**
  10025. * Creates an object composed of keys generated from the results of running
  10026. * each element of `collection` thru `iteratee`. The corresponding value of
  10027. * each key is the last element responsible for generating the key. The
  10028. * iteratee is invoked with one argument: (value).
  10029. *
  10030. * @static
  10031. * @memberOf _
  10032. * @since 4.0.0
  10033. * @category Collection
  10034. * @param {Array|Object} collection The collection to iterate over.
  10035. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10036. * @returns {Object} Returns the composed aggregate object.
  10037. * @example
  10038. *
  10039. * var array = [
  10040. * { 'dir': 'left', 'code': 97 },
  10041. * { 'dir': 'right', 'code': 100 }
  10042. * ];
  10043. *
  10044. * _.keyBy(array, function(o) {
  10045. * return String.fromCharCode(o.code);
  10046. * });
  10047. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10048. *
  10049. * _.keyBy(array, 'dir');
  10050. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10051. */
  10052. var keyBy = createAggregator(function(result, value, key) {
  10053. baseAssignValue(result, key, value);
  10054. });
  10055. /**
  10056. * Creates an array of values by running each element in `collection` thru
  10057. * `iteratee`. The iteratee is invoked with three arguments:
  10058. * (value, index|key, collection).
  10059. *
  10060. * Many lodash methods are guarded to work as iteratees for methods like
  10061. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10062. *
  10063. * The guarded methods are:
  10064. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10065. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10066. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10067. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10068. *
  10069. * @static
  10070. * @memberOf _
  10071. * @since 0.1.0
  10072. * @category Collection
  10073. * @param {Array|Object} collection The collection to iterate over.
  10074. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10075. * @returns {Array} Returns the new mapped array.
  10076. * @example
  10077. *
  10078. * function square(n) {
  10079. * return n * n;
  10080. * }
  10081. *
  10082. * _.map([4, 8], square);
  10083. * // => [16, 64]
  10084. *
  10085. * _.map({ 'a': 4, 'b': 8 }, square);
  10086. * // => [16, 64] (iteration order is not guaranteed)
  10087. *
  10088. * var users = [
  10089. * { 'user': 'barney' },
  10090. * { 'user': 'fred' }
  10091. * ];
  10092. *
  10093. * // The `_.property` iteratee shorthand.
  10094. * _.map(users, 'user');
  10095. * // => ['barney', 'fred']
  10096. */
  10097. function map(collection, iteratee) {
  10098. var func = isArray(collection) ? arrayMap : baseMap;
  10099. return func(collection, getIteratee(iteratee, 3));
  10100. }
  10101. /**
  10102. * This method is like `_.sortBy` except that it allows specifying the sort
  10103. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10104. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10105. * descending or "asc" for ascending sort order of corresponding values.
  10106. *
  10107. * @static
  10108. * @memberOf _
  10109. * @since 4.0.0
  10110. * @category Collection
  10111. * @param {Array|Object} collection The collection to iterate over.
  10112. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10113. * The iteratees to sort by.
  10114. * @param {string[]} [orders] The sort orders of `iteratees`.
  10115. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10116. * @returns {Array} Returns the new sorted array.
  10117. * @example
  10118. *
  10119. * var users = [
  10120. * { 'user': 'fred', 'age': 48 },
  10121. * { 'user': 'barney', 'age': 34 },
  10122. * { 'user': 'fred', 'age': 40 },
  10123. * { 'user': 'barney', 'age': 36 }
  10124. * ];
  10125. *
  10126. * // Sort by `user` in ascending order and by `age` in descending order.
  10127. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10128. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10129. */
  10130. function orderBy(collection, iteratees, orders, guard) {
  10131. if (collection == null) {
  10132. return [];
  10133. }
  10134. if (!isArray(iteratees)) {
  10135. iteratees = iteratees == null ? [] : [iteratees];
  10136. }
  10137. orders = guard ? undefined : orders;
  10138. if (!isArray(orders)) {
  10139. orders = orders == null ? [] : [orders];
  10140. }
  10141. return baseOrderBy(collection, iteratees, orders);
  10142. }
  10143. /**
  10144. * Creates an array of elements split into two groups, the first of which
  10145. * contains elements `predicate` returns truthy for, the second of which
  10146. * contains elements `predicate` returns falsey for. The predicate is
  10147. * invoked with one argument: (value).
  10148. *
  10149. * @static
  10150. * @memberOf _
  10151. * @since 3.0.0
  10152. * @category Collection
  10153. * @param {Array|Object} collection The collection to iterate over.
  10154. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10155. * @returns {Array} Returns the array of grouped elements.
  10156. * @example
  10157. *
  10158. * var users = [
  10159. * { 'user': 'barney', 'age': 36, 'active': false },
  10160. * { 'user': 'fred', 'age': 40, 'active': true },
  10161. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10162. * ];
  10163. *
  10164. * _.partition(users, function(o) { return o.active; });
  10165. * // => objects for [['fred'], ['barney', 'pebbles']]
  10166. *
  10167. * // The `_.matches` iteratee shorthand.
  10168. * _.partition(users, { 'age': 1, 'active': false });
  10169. * // => objects for [['pebbles'], ['barney', 'fred']]
  10170. *
  10171. * // The `_.matchesProperty` iteratee shorthand.
  10172. * _.partition(users, ['active', false]);
  10173. * // => objects for [['barney', 'pebbles'], ['fred']]
  10174. *
  10175. * // The `_.property` iteratee shorthand.
  10176. * _.partition(users, 'active');
  10177. * // => objects for [['fred'], ['barney', 'pebbles']]
  10178. */
  10179. var partition = createAggregator(function(result, value, key) {
  10180. result[key ? 0 : 1].push(value);
  10181. }, function() { return [[], []]; });
  10182. /**
  10183. * Reduces `collection` to a value which is the accumulated result of running
  10184. * each element in `collection` thru `iteratee`, where each successive
  10185. * invocation is supplied the return value of the previous. If `accumulator`
  10186. * is not given, the first element of `collection` is used as the initial
  10187. * value. The iteratee is invoked with four arguments:
  10188. * (accumulator, value, index|key, collection).
  10189. *
  10190. * Many lodash methods are guarded to work as iteratees for methods like
  10191. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10192. *
  10193. * The guarded methods are:
  10194. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10195. * and `sortBy`
  10196. *
  10197. * @static
  10198. * @memberOf _
  10199. * @since 0.1.0
  10200. * @category Collection
  10201. * @param {Array|Object} collection The collection to iterate over.
  10202. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10203. * @param {*} [accumulator] The initial value.
  10204. * @returns {*} Returns the accumulated value.
  10205. * @see _.reduceRight
  10206. * @example
  10207. *
  10208. * _.reduce([1, 2], function(sum, n) {
  10209. * return sum + n;
  10210. * }, 0);
  10211. * // => 3
  10212. *
  10213. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10214. * (result[value] || (result[value] = [])).push(key);
  10215. * return result;
  10216. * }, {});
  10217. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10218. */
  10219. function reduce(collection, iteratee, accumulator) {
  10220. var func = isArray(collection) ? arrayReduce : baseReduce,
  10221. initAccum = arguments.length < 3;
  10222. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10223. }
  10224. /**
  10225. * This method is like `_.reduce` except that it iterates over elements of
  10226. * `collection` from right to left.
  10227. *
  10228. * @static
  10229. * @memberOf _
  10230. * @since 0.1.0
  10231. * @category Collection
  10232. * @param {Array|Object} collection The collection to iterate over.
  10233. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10234. * @param {*} [accumulator] The initial value.
  10235. * @returns {*} Returns the accumulated value.
  10236. * @see _.reduce
  10237. * @example
  10238. *
  10239. * var array = [[0, 1], [2, 3], [4, 5]];
  10240. *
  10241. * _.reduceRight(array, function(flattened, other) {
  10242. * return flattened.concat(other);
  10243. * }, []);
  10244. * // => [4, 5, 2, 3, 0, 1]
  10245. */
  10246. function reduceRight(collection, iteratee, accumulator) {
  10247. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10248. initAccum = arguments.length < 3;
  10249. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10250. }
  10251. /**
  10252. * The opposite of `_.filter`; this method returns the elements of `collection`
  10253. * that `predicate` does **not** return truthy for.
  10254. *
  10255. * @static
  10256. * @memberOf _
  10257. * @since 0.1.0
  10258. * @category Collection
  10259. * @param {Array|Object} collection The collection to iterate over.
  10260. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10261. * @returns {Array} Returns the new filtered array.
  10262. * @see _.filter
  10263. * @example
  10264. *
  10265. * var users = [
  10266. * { 'user': 'barney', 'age': 36, 'active': false },
  10267. * { 'user': 'fred', 'age': 40, 'active': true }
  10268. * ];
  10269. *
  10270. * _.reject(users, function(o) { return !o.active; });
  10271. * // => objects for ['fred']
  10272. *
  10273. * // The `_.matches` iteratee shorthand.
  10274. * _.reject(users, { 'age': 40, 'active': true });
  10275. * // => objects for ['barney']
  10276. *
  10277. * // The `_.matchesProperty` iteratee shorthand.
  10278. * _.reject(users, ['active', false]);
  10279. * // => objects for ['fred']
  10280. *
  10281. * // The `_.property` iteratee shorthand.
  10282. * _.reject(users, 'active');
  10283. * // => objects for ['barney']
  10284. */
  10285. function reject(collection, predicate) {
  10286. var func = isArray(collection) ? arrayFilter : baseFilter;
  10287. return func(collection, negate(getIteratee(predicate, 3)));
  10288. }
  10289. /**
  10290. * Gets a random element from `collection`.
  10291. *
  10292. * @static
  10293. * @memberOf _
  10294. * @since 2.0.0
  10295. * @category Collection
  10296. * @param {Array|Object} collection The collection to sample.
  10297. * @returns {*} Returns the random element.
  10298. * @example
  10299. *
  10300. * _.sample([1, 2, 3, 4]);
  10301. * // => 2
  10302. */
  10303. function sample(collection) {
  10304. var func = isArray(collection) ? arraySample : baseSample;
  10305. return func(collection);
  10306. }
  10307. /**
  10308. * Gets `n` random elements at unique keys from `collection` up to the
  10309. * size of `collection`.
  10310. *
  10311. * @static
  10312. * @memberOf _
  10313. * @since 4.0.0
  10314. * @category Collection
  10315. * @param {Array|Object} collection The collection to sample.
  10316. * @param {number} [n=1] The number of elements to sample.
  10317. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10318. * @returns {Array} Returns the random elements.
  10319. * @example
  10320. *
  10321. * _.sampleSize([1, 2, 3], 2);
  10322. * // => [3, 1]
  10323. *
  10324. * _.sampleSize([1, 2, 3], 4);
  10325. * // => [2, 3, 1]
  10326. */
  10327. function sampleSize(collection, n, guard) {
  10328. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10329. n = 1;
  10330. } else {
  10331. n = toInteger(n);
  10332. }
  10333. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10334. return func(collection, n);
  10335. }
  10336. /**
  10337. * Creates an array of shuffled values, using a version of the
  10338. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10339. *
  10340. * @static
  10341. * @memberOf _
  10342. * @since 0.1.0
  10343. * @category Collection
  10344. * @param {Array|Object} collection The collection to shuffle.
  10345. * @returns {Array} Returns the new shuffled array.
  10346. * @example
  10347. *
  10348. * _.shuffle([1, 2, 3, 4]);
  10349. * // => [4, 1, 3, 2]
  10350. */
  10351. function shuffle(collection) {
  10352. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10353. return func(collection);
  10354. }
  10355. /**
  10356. * Gets the size of `collection` by returning its length for array-like
  10357. * values or the number of own enumerable string keyed properties for objects.
  10358. *
  10359. * @static
  10360. * @memberOf _
  10361. * @since 0.1.0
  10362. * @category Collection
  10363. * @param {Array|Object|string} collection The collection to inspect.
  10364. * @returns {number} Returns the collection size.
  10365. * @example
  10366. *
  10367. * _.size([1, 2, 3]);
  10368. * // => 3
  10369. *
  10370. * _.size({ 'a': 1, 'b': 2 });
  10371. * // => 2
  10372. *
  10373. * _.size('pebbles');
  10374. * // => 7
  10375. */
  10376. function size(collection) {
  10377. if (collection == null) {
  10378. return 0;
  10379. }
  10380. if (isArrayLike(collection)) {
  10381. return isString(collection) ? stringSize(collection) : collection.length;
  10382. }
  10383. var tag = getTag(collection);
  10384. if (tag == mapTag || tag == setTag) {
  10385. return collection.size;
  10386. }
  10387. return baseKeys(collection).length;
  10388. }
  10389. /**
  10390. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10391. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10392. * invoked with three arguments: (value, index|key, collection).
  10393. *
  10394. * @static
  10395. * @memberOf _
  10396. * @since 0.1.0
  10397. * @category Collection
  10398. * @param {Array|Object} collection The collection to iterate over.
  10399. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10400. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10401. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10402. * else `false`.
  10403. * @example
  10404. *
  10405. * _.some([null, 0, 'yes', false], Boolean);
  10406. * // => true
  10407. *
  10408. * var users = [
  10409. * { 'user': 'barney', 'active': true },
  10410. * { 'user': 'fred', 'active': false }
  10411. * ];
  10412. *
  10413. * // The `_.matches` iteratee shorthand.
  10414. * _.some(users, { 'user': 'barney', 'active': false });
  10415. * // => false
  10416. *
  10417. * // The `_.matchesProperty` iteratee shorthand.
  10418. * _.some(users, ['active', false]);
  10419. * // => true
  10420. *
  10421. * // The `_.property` iteratee shorthand.
  10422. * _.some(users, 'active');
  10423. * // => true
  10424. */
  10425. function some(collection, predicate, guard) {
  10426. var func = isArray(collection) ? arraySome : baseSome;
  10427. if (guard && isIterateeCall(collection, predicate, guard)) {
  10428. predicate = undefined;
  10429. }
  10430. return func(collection, getIteratee(predicate, 3));
  10431. }
  10432. /**
  10433. * Creates an array of elements, sorted in ascending order by the results of
  10434. * running each element in a collection thru each iteratee. This method
  10435. * performs a stable sort, that is, it preserves the original sort order of
  10436. * equal elements. The iteratees are invoked with one argument: (value).
  10437. *
  10438. * @static
  10439. * @memberOf _
  10440. * @since 0.1.0
  10441. * @category Collection
  10442. * @param {Array|Object} collection The collection to iterate over.
  10443. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10444. * The iteratees to sort by.
  10445. * @returns {Array} Returns the new sorted array.
  10446. * @example
  10447. *
  10448. * var users = [
  10449. * { 'user': 'fred', 'age': 48 },
  10450. * { 'user': 'barney', 'age': 36 },
  10451. * { 'user': 'fred', 'age': 30 },
  10452. * { 'user': 'barney', 'age': 34 }
  10453. * ];
  10454. *
  10455. * _.sortBy(users, [function(o) { return o.user; }]);
  10456. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10457. *
  10458. * _.sortBy(users, ['user', 'age']);
  10459. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10460. */
  10461. var sortBy = baseRest(function(collection, iteratees) {
  10462. if (collection == null) {
  10463. return [];
  10464. }
  10465. var length = iteratees.length;
  10466. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10467. iteratees = [];
  10468. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10469. iteratees = [iteratees[0]];
  10470. }
  10471. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10472. });
  10473. /*------------------------------------------------------------------------*/
  10474. /**
  10475. * Gets the timestamp of the number of milliseconds that have elapsed since
  10476. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10477. *
  10478. * @static
  10479. * @memberOf _
  10480. * @since 2.4.0
  10481. * @category Date
  10482. * @returns {number} Returns the timestamp.
  10483. * @example
  10484. *
  10485. * _.defer(function(stamp) {
  10486. * console.log(_.now() - stamp);
  10487. * }, _.now());
  10488. * // => Logs the number of milliseconds it took for the deferred invocation.
  10489. */
  10490. var now = ctxNow || function() {
  10491. return root.Date.now();
  10492. };
  10493. /*------------------------------------------------------------------------*/
  10494. /**
  10495. * The opposite of `_.before`; this method creates a function that invokes
  10496. * `func` once it's called `n` or more times.
  10497. *
  10498. * @static
  10499. * @memberOf _
  10500. * @since 0.1.0
  10501. * @category Function
  10502. * @param {number} n The number of calls before `func` is invoked.
  10503. * @param {Function} func The function to restrict.
  10504. * @returns {Function} Returns the new restricted function.
  10505. * @example
  10506. *
  10507. * var saves = ['profile', 'settings'];
  10508. *
  10509. * var done = _.after(saves.length, function() {
  10510. * console.log('done saving!');
  10511. * });
  10512. *
  10513. * _.forEach(saves, function(type) {
  10514. * asyncSave({ 'type': type, 'complete': done });
  10515. * });
  10516. * // => Logs 'done saving!' after the two async saves have completed.
  10517. */
  10518. function after(n, func) {
  10519. if (typeof func != 'function') {
  10520. throw new TypeError(FUNC_ERROR_TEXT);
  10521. }
  10522. n = toInteger(n);
  10523. return function() {
  10524. if (--n < 1) {
  10525. return func.apply(this, arguments);
  10526. }
  10527. };
  10528. }
  10529. /**
  10530. * Creates a function that invokes `func`, with up to `n` arguments,
  10531. * ignoring any additional arguments.
  10532. *
  10533. * @static
  10534. * @memberOf _
  10535. * @since 3.0.0
  10536. * @category Function
  10537. * @param {Function} func The function to cap arguments for.
  10538. * @param {number} [n=func.length] The arity cap.
  10539. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10540. * @returns {Function} Returns the new capped function.
  10541. * @example
  10542. *
  10543. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10544. * // => [6, 8, 10]
  10545. */
  10546. function ary(func, n, guard) {
  10547. n = guard ? undefined : n;
  10548. n = (func && n == null) ? func.length : n;
  10549. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10550. }
  10551. /**
  10552. * Creates a function that invokes `func`, with the `this` binding and arguments
  10553. * of the created function, while it's called less than `n` times. Subsequent
  10554. * calls to the created function return the result of the last `func` invocation.
  10555. *
  10556. * @static
  10557. * @memberOf _
  10558. * @since 3.0.0
  10559. * @category Function
  10560. * @param {number} n The number of calls at which `func` is no longer invoked.
  10561. * @param {Function} func The function to restrict.
  10562. * @returns {Function} Returns the new restricted function.
  10563. * @example
  10564. *
  10565. * jQuery(element).on('click', _.before(5, addContactToList));
  10566. * // => Allows adding up to 4 contacts to the list.
  10567. */
  10568. function before(n, func) {
  10569. var result;
  10570. if (typeof func != 'function') {
  10571. throw new TypeError(FUNC_ERROR_TEXT);
  10572. }
  10573. n = toInteger(n);
  10574. return function() {
  10575. if (--n > 0) {
  10576. result = func.apply(this, arguments);
  10577. }
  10578. if (n <= 1) {
  10579. func = undefined;
  10580. }
  10581. return result;
  10582. };
  10583. }
  10584. /**
  10585. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10586. * and `partials` prepended to the arguments it receives.
  10587. *
  10588. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10589. * may be used as a placeholder for partially applied arguments.
  10590. *
  10591. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10592. * property of bound functions.
  10593. *
  10594. * @static
  10595. * @memberOf _
  10596. * @since 0.1.0
  10597. * @category Function
  10598. * @param {Function} func The function to bind.
  10599. * @param {*} thisArg The `this` binding of `func`.
  10600. * @param {...*} [partials] The arguments to be partially applied.
  10601. * @returns {Function} Returns the new bound function.
  10602. * @example
  10603. *
  10604. * function greet(greeting, punctuation) {
  10605. * return greeting + ' ' + this.user + punctuation;
  10606. * }
  10607. *
  10608. * var object = { 'user': 'fred' };
  10609. *
  10610. * var bound = _.bind(greet, object, 'hi');
  10611. * bound('!');
  10612. * // => 'hi fred!'
  10613. *
  10614. * // Bound with placeholders.
  10615. * var bound = _.bind(greet, object, _, '!');
  10616. * bound('hi');
  10617. * // => 'hi fred!'
  10618. */
  10619. var bind = baseRest(function(func, thisArg, partials) {
  10620. var bitmask = WRAP_BIND_FLAG;
  10621. if (partials.length) {
  10622. var holders = replaceHolders(partials, getHolder(bind));
  10623. bitmask |= WRAP_PARTIAL_FLAG;
  10624. }
  10625. return createWrap(func, bitmask, thisArg, partials, holders);
  10626. });
  10627. /**
  10628. * Creates a function that invokes the method at `object[key]` with `partials`
  10629. * prepended to the arguments it receives.
  10630. *
  10631. * This method differs from `_.bind` by allowing bound functions to reference
  10632. * methods that may be redefined or don't yet exist. See
  10633. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10634. * for more details.
  10635. *
  10636. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10637. * builds, may be used as a placeholder for partially applied arguments.
  10638. *
  10639. * @static
  10640. * @memberOf _
  10641. * @since 0.10.0
  10642. * @category Function
  10643. * @param {Object} object The object to invoke the method on.
  10644. * @param {string} key The key of the method.
  10645. * @param {...*} [partials] The arguments to be partially applied.
  10646. * @returns {Function} Returns the new bound function.
  10647. * @example
  10648. *
  10649. * var object = {
  10650. * 'user': 'fred',
  10651. * 'greet': function(greeting, punctuation) {
  10652. * return greeting + ' ' + this.user + punctuation;
  10653. * }
  10654. * };
  10655. *
  10656. * var bound = _.bindKey(object, 'greet', 'hi');
  10657. * bound('!');
  10658. * // => 'hi fred!'
  10659. *
  10660. * object.greet = function(greeting, punctuation) {
  10661. * return greeting + 'ya ' + this.user + punctuation;
  10662. * };
  10663. *
  10664. * bound('!');
  10665. * // => 'hiya fred!'
  10666. *
  10667. * // Bound with placeholders.
  10668. * var bound = _.bindKey(object, 'greet', _, '!');
  10669. * bound('hi');
  10670. * // => 'hiya fred!'
  10671. */
  10672. var bindKey = baseRest(function(object, key, partials) {
  10673. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10674. if (partials.length) {
  10675. var holders = replaceHolders(partials, getHolder(bindKey));
  10676. bitmask |= WRAP_PARTIAL_FLAG;
  10677. }
  10678. return createWrap(key, bitmask, object, partials, holders);
  10679. });
  10680. /**
  10681. * Creates a function that accepts arguments of `func` and either invokes
  10682. * `func` returning its result, if at least `arity` number of arguments have
  10683. * been provided, or returns a function that accepts the remaining `func`
  10684. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10685. * is not sufficient.
  10686. *
  10687. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10688. * may be used as a placeholder for provided arguments.
  10689. *
  10690. * **Note:** This method doesn't set the "length" property of curried functions.
  10691. *
  10692. * @static
  10693. * @memberOf _
  10694. * @since 2.0.0
  10695. * @category Function
  10696. * @param {Function} func The function to curry.
  10697. * @param {number} [arity=func.length] The arity of `func`.
  10698. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10699. * @returns {Function} Returns the new curried function.
  10700. * @example
  10701. *
  10702. * var abc = function(a, b, c) {
  10703. * return [a, b, c];
  10704. * };
  10705. *
  10706. * var curried = _.curry(abc);
  10707. *
  10708. * curried(1)(2)(3);
  10709. * // => [1, 2, 3]
  10710. *
  10711. * curried(1, 2)(3);
  10712. * // => [1, 2, 3]
  10713. *
  10714. * curried(1, 2, 3);
  10715. * // => [1, 2, 3]
  10716. *
  10717. * // Curried with placeholders.
  10718. * curried(1)(_, 3)(2);
  10719. * // => [1, 2, 3]
  10720. */
  10721. function curry(func, arity, guard) {
  10722. arity = guard ? undefined : arity;
  10723. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10724. result.placeholder = curry.placeholder;
  10725. return result;
  10726. }
  10727. /**
  10728. * This method is like `_.curry` except that arguments are applied to `func`
  10729. * in the manner of `_.partialRight` instead of `_.partial`.
  10730. *
  10731. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10732. * builds, may be used as a placeholder for provided arguments.
  10733. *
  10734. * **Note:** This method doesn't set the "length" property of curried functions.
  10735. *
  10736. * @static
  10737. * @memberOf _
  10738. * @since 3.0.0
  10739. * @category Function
  10740. * @param {Function} func The function to curry.
  10741. * @param {number} [arity=func.length] The arity of `func`.
  10742. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10743. * @returns {Function} Returns the new curried function.
  10744. * @example
  10745. *
  10746. * var abc = function(a, b, c) {
  10747. * return [a, b, c];
  10748. * };
  10749. *
  10750. * var curried = _.curryRight(abc);
  10751. *
  10752. * curried(3)(2)(1);
  10753. * // => [1, 2, 3]
  10754. *
  10755. * curried(2, 3)(1);
  10756. * // => [1, 2, 3]
  10757. *
  10758. * curried(1, 2, 3);
  10759. * // => [1, 2, 3]
  10760. *
  10761. * // Curried with placeholders.
  10762. * curried(3)(1, _)(2);
  10763. * // => [1, 2, 3]
  10764. */
  10765. function curryRight(func, arity, guard) {
  10766. arity = guard ? undefined : arity;
  10767. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10768. result.placeholder = curryRight.placeholder;
  10769. return result;
  10770. }
  10771. /**
  10772. * Creates a debounced function that delays invoking `func` until after `wait`
  10773. * milliseconds have elapsed since the last time the debounced function was
  10774. * invoked. The debounced function comes with a `cancel` method to cancel
  10775. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10776. * Provide `options` to indicate whether `func` should be invoked on the
  10777. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10778. * with the last arguments provided to the debounced function. Subsequent
  10779. * calls to the debounced function return the result of the last `func`
  10780. * invocation.
  10781. *
  10782. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10783. * invoked on the trailing edge of the timeout only if the debounced function
  10784. * is invoked more than once during the `wait` timeout.
  10785. *
  10786. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10787. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10788. *
  10789. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10790. * for details over the differences between `_.debounce` and `_.throttle`.
  10791. *
  10792. * @static
  10793. * @memberOf _
  10794. * @since 0.1.0
  10795. * @category Function
  10796. * @param {Function} func The function to debounce.
  10797. * @param {number} [wait=0] The number of milliseconds to delay.
  10798. * @param {Object} [options={}] The options object.
  10799. * @param {boolean} [options.leading=false]
  10800. * Specify invoking on the leading edge of the timeout.
  10801. * @param {number} [options.maxWait]
  10802. * The maximum time `func` is allowed to be delayed before it's invoked.
  10803. * @param {boolean} [options.trailing=true]
  10804. * Specify invoking on the trailing edge of the timeout.
  10805. * @returns {Function} Returns the new debounced function.
  10806. * @example
  10807. *
  10808. * // Avoid costly calculations while the window size is in flux.
  10809. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10810. *
  10811. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10812. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10813. * 'leading': true,
  10814. * 'trailing': false
  10815. * }));
  10816. *
  10817. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10818. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10819. * var source = new EventSource('/stream');
  10820. * jQuery(source).on('message', debounced);
  10821. *
  10822. * // Cancel the trailing debounced invocation.
  10823. * jQuery(window).on('popstate', debounced.cancel);
  10824. */
  10825. function debounce(func, wait, options) {
  10826. var lastArgs,
  10827. lastThis,
  10828. maxWait,
  10829. result,
  10830. timerId,
  10831. lastCallTime,
  10832. lastInvokeTime = 0,
  10833. leading = false,
  10834. maxing = false,
  10835. trailing = true;
  10836. if (typeof func != 'function') {
  10837. throw new TypeError(FUNC_ERROR_TEXT);
  10838. }
  10839. wait = toNumber(wait) || 0;
  10840. if (isObject(options)) {
  10841. leading = !!options.leading;
  10842. maxing = 'maxWait' in options;
  10843. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10844. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10845. }
  10846. function invokeFunc(time) {
  10847. var args = lastArgs,
  10848. thisArg = lastThis;
  10849. lastArgs = lastThis = undefined;
  10850. lastInvokeTime = time;
  10851. result = func.apply(thisArg, args);
  10852. return result;
  10853. }
  10854. function leadingEdge(time) {
  10855. // Reset any `maxWait` timer.
  10856. lastInvokeTime = time;
  10857. // Start the timer for the trailing edge.
  10858. timerId = setTimeout(timerExpired, wait);
  10859. // Invoke the leading edge.
  10860. return leading ? invokeFunc(time) : result;
  10861. }
  10862. function remainingWait(time) {
  10863. var timeSinceLastCall = time - lastCallTime,
  10864. timeSinceLastInvoke = time - lastInvokeTime,
  10865. timeWaiting = wait - timeSinceLastCall;
  10866. return maxing
  10867. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10868. : timeWaiting;
  10869. }
  10870. function shouldInvoke(time) {
  10871. var timeSinceLastCall = time - lastCallTime,
  10872. timeSinceLastInvoke = time - lastInvokeTime;
  10873. // Either this is the first call, activity has stopped and we're at the
  10874. // trailing edge, the system time has gone backwards and we're treating
  10875. // it as the trailing edge, or we've hit the `maxWait` limit.
  10876. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10877. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10878. }
  10879. function timerExpired() {
  10880. var time = now();
  10881. if (shouldInvoke(time)) {
  10882. return trailingEdge(time);
  10883. }
  10884. // Restart the timer.
  10885. timerId = setTimeout(timerExpired, remainingWait(time));
  10886. }
  10887. function trailingEdge(time) {
  10888. timerId = undefined;
  10889. // Only invoke if we have `lastArgs` which means `func` has been
  10890. // debounced at least once.
  10891. if (trailing && lastArgs) {
  10892. return invokeFunc(time);
  10893. }
  10894. lastArgs = lastThis = undefined;
  10895. return result;
  10896. }
  10897. function cancel() {
  10898. if (timerId !== undefined) {
  10899. clearTimeout(timerId);
  10900. }
  10901. lastInvokeTime = 0;
  10902. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10903. }
  10904. function flush() {
  10905. return timerId === undefined ? result : trailingEdge(now());
  10906. }
  10907. function debounced() {
  10908. var time = now(),
  10909. isInvoking = shouldInvoke(time);
  10910. lastArgs = arguments;
  10911. lastThis = this;
  10912. lastCallTime = time;
  10913. if (isInvoking) {
  10914. if (timerId === undefined) {
  10915. return leadingEdge(lastCallTime);
  10916. }
  10917. if (maxing) {
  10918. // Handle invocations in a tight loop.
  10919. clearTimeout(timerId);
  10920. timerId = setTimeout(timerExpired, wait);
  10921. return invokeFunc(lastCallTime);
  10922. }
  10923. }
  10924. if (timerId === undefined) {
  10925. timerId = setTimeout(timerExpired, wait);
  10926. }
  10927. return result;
  10928. }
  10929. debounced.cancel = cancel;
  10930. debounced.flush = flush;
  10931. return debounced;
  10932. }
  10933. /**
  10934. * Defers invoking the `func` until the current call stack has cleared. Any
  10935. * additional arguments are provided to `func` when it's invoked.
  10936. *
  10937. * @static
  10938. * @memberOf _
  10939. * @since 0.1.0
  10940. * @category Function
  10941. * @param {Function} func The function to defer.
  10942. * @param {...*} [args] The arguments to invoke `func` with.
  10943. * @returns {number} Returns the timer id.
  10944. * @example
  10945. *
  10946. * _.defer(function(text) {
  10947. * console.log(text);
  10948. * }, 'deferred');
  10949. * // => Logs 'deferred' after one millisecond.
  10950. */
  10951. var defer = baseRest(function(func, args) {
  10952. return baseDelay(func, 1, args);
  10953. });
  10954. /**
  10955. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10956. * provided to `func` when it's invoked.
  10957. *
  10958. * @static
  10959. * @memberOf _
  10960. * @since 0.1.0
  10961. * @category Function
  10962. * @param {Function} func The function to delay.
  10963. * @param {number} wait The number of milliseconds to delay invocation.
  10964. * @param {...*} [args] The arguments to invoke `func` with.
  10965. * @returns {number} Returns the timer id.
  10966. * @example
  10967. *
  10968. * _.delay(function(text) {
  10969. * console.log(text);
  10970. * }, 1000, 'later');
  10971. * // => Logs 'later' after one second.
  10972. */
  10973. var delay = baseRest(function(func, wait, args) {
  10974. return baseDelay(func, toNumber(wait) || 0, args);
  10975. });
  10976. /**
  10977. * Creates a function that invokes `func` with arguments reversed.
  10978. *
  10979. * @static
  10980. * @memberOf _
  10981. * @since 4.0.0
  10982. * @category Function
  10983. * @param {Function} func The function to flip arguments for.
  10984. * @returns {Function} Returns the new flipped function.
  10985. * @example
  10986. *
  10987. * var flipped = _.flip(function() {
  10988. * return _.toArray(arguments);
  10989. * });
  10990. *
  10991. * flipped('a', 'b', 'c', 'd');
  10992. * // => ['d', 'c', 'b', 'a']
  10993. */
  10994. function flip(func) {
  10995. return createWrap(func, WRAP_FLIP_FLAG);
  10996. }
  10997. /**
  10998. * Creates a function that memoizes the result of `func`. If `resolver` is
  10999. * provided, it determines the cache key for storing the result based on the
  11000. * arguments provided to the memoized function. By default, the first argument
  11001. * provided to the memoized function is used as the map cache key. The `func`
  11002. * is invoked with the `this` binding of the memoized function.
  11003. *
  11004. * **Note:** The cache is exposed as the `cache` property on the memoized
  11005. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11006. * constructor with one whose instances implement the
  11007. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11008. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11009. *
  11010. * @static
  11011. * @memberOf _
  11012. * @since 0.1.0
  11013. * @category Function
  11014. * @param {Function} func The function to have its output memoized.
  11015. * @param {Function} [resolver] The function to resolve the cache key.
  11016. * @returns {Function} Returns the new memoized function.
  11017. * @example
  11018. *
  11019. * var object = { 'a': 1, 'b': 2 };
  11020. * var other = { 'c': 3, 'd': 4 };
  11021. *
  11022. * var values = _.memoize(_.values);
  11023. * values(object);
  11024. * // => [1, 2]
  11025. *
  11026. * values(other);
  11027. * // => [3, 4]
  11028. *
  11029. * object.a = 2;
  11030. * values(object);
  11031. * // => [1, 2]
  11032. *
  11033. * // Modify the result cache.
  11034. * values.cache.set(object, ['a', 'b']);
  11035. * values(object);
  11036. * // => ['a', 'b']
  11037. *
  11038. * // Replace `_.memoize.Cache`.
  11039. * _.memoize.Cache = WeakMap;
  11040. */
  11041. function memoize(func, resolver) {
  11042. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11043. throw new TypeError(FUNC_ERROR_TEXT);
  11044. }
  11045. var memoized = function() {
  11046. var args = arguments,
  11047. key = resolver ? resolver.apply(this, args) : args[0],
  11048. cache = memoized.cache;
  11049. if (cache.has(key)) {
  11050. return cache.get(key);
  11051. }
  11052. var result = func.apply(this, args);
  11053. memoized.cache = cache.set(key, result) || cache;
  11054. return result;
  11055. };
  11056. memoized.cache = new (memoize.Cache || MapCache);
  11057. return memoized;
  11058. }
  11059. // Expose `MapCache`.
  11060. memoize.Cache = MapCache;
  11061. /**
  11062. * Creates a function that negates the result of the predicate `func`. The
  11063. * `func` predicate is invoked with the `this` binding and arguments of the
  11064. * created function.
  11065. *
  11066. * @static
  11067. * @memberOf _
  11068. * @since 3.0.0
  11069. * @category Function
  11070. * @param {Function} predicate The predicate to negate.
  11071. * @returns {Function} Returns the new negated function.
  11072. * @example
  11073. *
  11074. * function isEven(n) {
  11075. * return n % 2 == 0;
  11076. * }
  11077. *
  11078. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11079. * // => [1, 3, 5]
  11080. */
  11081. function negate(predicate) {
  11082. if (typeof predicate != 'function') {
  11083. throw new TypeError(FUNC_ERROR_TEXT);
  11084. }
  11085. return function() {
  11086. var args = arguments;
  11087. switch (args.length) {
  11088. case 0: return !predicate.call(this);
  11089. case 1: return !predicate.call(this, args[0]);
  11090. case 2: return !predicate.call(this, args[0], args[1]);
  11091. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11092. }
  11093. return !predicate.apply(this, args);
  11094. };
  11095. }
  11096. /**
  11097. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11098. * to the function return the value of the first invocation. The `func` is
  11099. * invoked with the `this` binding and arguments of the created function.
  11100. *
  11101. * @static
  11102. * @memberOf _
  11103. * @since 0.1.0
  11104. * @category Function
  11105. * @param {Function} func The function to restrict.
  11106. * @returns {Function} Returns the new restricted function.
  11107. * @example
  11108. *
  11109. * var initialize = _.once(createApplication);
  11110. * initialize();
  11111. * initialize();
  11112. * // => `createApplication` is invoked once
  11113. */
  11114. function once(func) {
  11115. return before(2, func);
  11116. }
  11117. /**
  11118. * Creates a function that invokes `func` with its arguments transformed.
  11119. *
  11120. * @static
  11121. * @since 4.0.0
  11122. * @memberOf _
  11123. * @category Function
  11124. * @param {Function} func The function to wrap.
  11125. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11126. * The argument transforms.
  11127. * @returns {Function} Returns the new function.
  11128. * @example
  11129. *
  11130. * function doubled(n) {
  11131. * return n * 2;
  11132. * }
  11133. *
  11134. * function square(n) {
  11135. * return n * n;
  11136. * }
  11137. *
  11138. * var func = _.overArgs(function(x, y) {
  11139. * return [x, y];
  11140. * }, [square, doubled]);
  11141. *
  11142. * func(9, 3);
  11143. * // => [81, 6]
  11144. *
  11145. * func(10, 5);
  11146. * // => [100, 10]
  11147. */
  11148. var overArgs = castRest(function(func, transforms) {
  11149. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11150. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11151. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11152. var funcsLength = transforms.length;
  11153. return baseRest(function(args) {
  11154. var index = -1,
  11155. length = nativeMin(args.length, funcsLength);
  11156. while (++index < length) {
  11157. args[index] = transforms[index].call(this, args[index]);
  11158. }
  11159. return apply(func, this, args);
  11160. });
  11161. });
  11162. /**
  11163. * Creates a function that invokes `func` with `partials` prepended to the
  11164. * arguments it receives. This method is like `_.bind` except it does **not**
  11165. * alter the `this` binding.
  11166. *
  11167. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11168. * builds, may be used as a placeholder for partially applied arguments.
  11169. *
  11170. * **Note:** This method doesn't set the "length" property of partially
  11171. * applied functions.
  11172. *
  11173. * @static
  11174. * @memberOf _
  11175. * @since 0.2.0
  11176. * @category Function
  11177. * @param {Function} func The function to partially apply arguments to.
  11178. * @param {...*} [partials] The arguments to be partially applied.
  11179. * @returns {Function} Returns the new partially applied function.
  11180. * @example
  11181. *
  11182. * function greet(greeting, name) {
  11183. * return greeting + ' ' + name;
  11184. * }
  11185. *
  11186. * var sayHelloTo = _.partial(greet, 'hello');
  11187. * sayHelloTo('fred');
  11188. * // => 'hello fred'
  11189. *
  11190. * // Partially applied with placeholders.
  11191. * var greetFred = _.partial(greet, _, 'fred');
  11192. * greetFred('hi');
  11193. * // => 'hi fred'
  11194. */
  11195. var partial = baseRest(function(func, partials) {
  11196. var holders = replaceHolders(partials, getHolder(partial));
  11197. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11198. });
  11199. /**
  11200. * This method is like `_.partial` except that partially applied arguments
  11201. * are appended to the arguments it receives.
  11202. *
  11203. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11204. * builds, may be used as a placeholder for partially applied arguments.
  11205. *
  11206. * **Note:** This method doesn't set the "length" property of partially
  11207. * applied functions.
  11208. *
  11209. * @static
  11210. * @memberOf _
  11211. * @since 1.0.0
  11212. * @category Function
  11213. * @param {Function} func The function to partially apply arguments to.
  11214. * @param {...*} [partials] The arguments to be partially applied.
  11215. * @returns {Function} Returns the new partially applied function.
  11216. * @example
  11217. *
  11218. * function greet(greeting, name) {
  11219. * return greeting + ' ' + name;
  11220. * }
  11221. *
  11222. * var greetFred = _.partialRight(greet, 'fred');
  11223. * greetFred('hi');
  11224. * // => 'hi fred'
  11225. *
  11226. * // Partially applied with placeholders.
  11227. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11228. * sayHelloTo('fred');
  11229. * // => 'hello fred'
  11230. */
  11231. var partialRight = baseRest(function(func, partials) {
  11232. var holders = replaceHolders(partials, getHolder(partialRight));
  11233. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11234. });
  11235. /**
  11236. * Creates a function that invokes `func` with arguments arranged according
  11237. * to the specified `indexes` where the argument value at the first index is
  11238. * provided as the first argument, the argument value at the second index is
  11239. * provided as the second argument, and so on.
  11240. *
  11241. * @static
  11242. * @memberOf _
  11243. * @since 3.0.0
  11244. * @category Function
  11245. * @param {Function} func The function to rearrange arguments for.
  11246. * @param {...(number|number[])} indexes The arranged argument indexes.
  11247. * @returns {Function} Returns the new function.
  11248. * @example
  11249. *
  11250. * var rearged = _.rearg(function(a, b, c) {
  11251. * return [a, b, c];
  11252. * }, [2, 0, 1]);
  11253. *
  11254. * rearged('b', 'c', 'a')
  11255. * // => ['a', 'b', 'c']
  11256. */
  11257. var rearg = flatRest(function(func, indexes) {
  11258. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11259. });
  11260. /**
  11261. * Creates a function that invokes `func` with the `this` binding of the
  11262. * created function and arguments from `start` and beyond provided as
  11263. * an array.
  11264. *
  11265. * **Note:** This method is based on the
  11266. * [rest parameter](https://mdn.io/rest_parameters).
  11267. *
  11268. * @static
  11269. * @memberOf _
  11270. * @since 4.0.0
  11271. * @category Function
  11272. * @param {Function} func The function to apply a rest parameter to.
  11273. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11274. * @returns {Function} Returns the new function.
  11275. * @example
  11276. *
  11277. * var say = _.rest(function(what, names) {
  11278. * return what + ' ' + _.initial(names).join(', ') +
  11279. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11280. * });
  11281. *
  11282. * say('hello', 'fred', 'barney', 'pebbles');
  11283. * // => 'hello fred, barney, & pebbles'
  11284. */
  11285. function rest(func, start) {
  11286. if (typeof func != 'function') {
  11287. throw new TypeError(FUNC_ERROR_TEXT);
  11288. }
  11289. start = start === undefined ? start : toInteger(start);
  11290. return baseRest(func, start);
  11291. }
  11292. /**
  11293. * Creates a function that invokes `func` with the `this` binding of the
  11294. * create function and an array of arguments much like
  11295. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11296. *
  11297. * **Note:** This method is based on the
  11298. * [spread operator](https://mdn.io/spread_operator).
  11299. *
  11300. * @static
  11301. * @memberOf _
  11302. * @since 3.2.0
  11303. * @category Function
  11304. * @param {Function} func The function to spread arguments over.
  11305. * @param {number} [start=0] The start position of the spread.
  11306. * @returns {Function} Returns the new function.
  11307. * @example
  11308. *
  11309. * var say = _.spread(function(who, what) {
  11310. * return who + ' says ' + what;
  11311. * });
  11312. *
  11313. * say(['fred', 'hello']);
  11314. * // => 'fred says hello'
  11315. *
  11316. * var numbers = Promise.all([
  11317. * Promise.resolve(40),
  11318. * Promise.resolve(36)
  11319. * ]);
  11320. *
  11321. * numbers.then(_.spread(function(x, y) {
  11322. * return x + y;
  11323. * }));
  11324. * // => a Promise of 76
  11325. */
  11326. function spread(func, start) {
  11327. if (typeof func != 'function') {
  11328. throw new TypeError(FUNC_ERROR_TEXT);
  11329. }
  11330. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11331. return baseRest(function(args) {
  11332. var array = args[start],
  11333. otherArgs = castSlice(args, 0, start);
  11334. if (array) {
  11335. arrayPush(otherArgs, array);
  11336. }
  11337. return apply(func, this, otherArgs);
  11338. });
  11339. }
  11340. /**
  11341. * Creates a throttled function that only invokes `func` at most once per
  11342. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11343. * method to cancel delayed `func` invocations and a `flush` method to
  11344. * immediately invoke them. Provide `options` to indicate whether `func`
  11345. * should be invoked on the leading and/or trailing edge of the `wait`
  11346. * timeout. The `func` is invoked with the last arguments provided to the
  11347. * throttled function. Subsequent calls to the throttled function return the
  11348. * result of the last `func` invocation.
  11349. *
  11350. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11351. * invoked on the trailing edge of the timeout only if the throttled function
  11352. * is invoked more than once during the `wait` timeout.
  11353. *
  11354. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11355. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11356. *
  11357. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11358. * for details over the differences between `_.throttle` and `_.debounce`.
  11359. *
  11360. * @static
  11361. * @memberOf _
  11362. * @since 0.1.0
  11363. * @category Function
  11364. * @param {Function} func The function to throttle.
  11365. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11366. * @param {Object} [options={}] The options object.
  11367. * @param {boolean} [options.leading=true]
  11368. * Specify invoking on the leading edge of the timeout.
  11369. * @param {boolean} [options.trailing=true]
  11370. * Specify invoking on the trailing edge of the timeout.
  11371. * @returns {Function} Returns the new throttled function.
  11372. * @example
  11373. *
  11374. * // Avoid excessively updating the position while scrolling.
  11375. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11376. *
  11377. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11378. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11379. * jQuery(element).on('click', throttled);
  11380. *
  11381. * // Cancel the trailing throttled invocation.
  11382. * jQuery(window).on('popstate', throttled.cancel);
  11383. */
  11384. function throttle(func, wait, options) {
  11385. var leading = true,
  11386. trailing = true;
  11387. if (typeof func != 'function') {
  11388. throw new TypeError(FUNC_ERROR_TEXT);
  11389. }
  11390. if (isObject(options)) {
  11391. leading = 'leading' in options ? !!options.leading : leading;
  11392. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11393. }
  11394. return debounce(func, wait, {
  11395. 'leading': leading,
  11396. 'maxWait': wait,
  11397. 'trailing': trailing
  11398. });
  11399. }
  11400. /**
  11401. * Creates a function that accepts up to one argument, ignoring any
  11402. * additional arguments.
  11403. *
  11404. * @static
  11405. * @memberOf _
  11406. * @since 4.0.0
  11407. * @category Function
  11408. * @param {Function} func The function to cap arguments for.
  11409. * @returns {Function} Returns the new capped function.
  11410. * @example
  11411. *
  11412. * _.map(['6', '8', '10'], _.unary(parseInt));
  11413. * // => [6, 8, 10]
  11414. */
  11415. function unary(func) {
  11416. return ary(func, 1);
  11417. }
  11418. /**
  11419. * Creates a function that provides `value` to `wrapper` as its first
  11420. * argument. Any additional arguments provided to the function are appended
  11421. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11422. * binding of the created function.
  11423. *
  11424. * @static
  11425. * @memberOf _
  11426. * @since 0.1.0
  11427. * @category Function
  11428. * @param {*} value The value to wrap.
  11429. * @param {Function} [wrapper=identity] The wrapper function.
  11430. * @returns {Function} Returns the new function.
  11431. * @example
  11432. *
  11433. * var p = _.wrap(_.escape, function(func, text) {
  11434. * return '<p>' + func(text) + '</p>';
  11435. * });
  11436. *
  11437. * p('fred, barney, & pebbles');
  11438. * // => '<p>fred, barney, &amp; pebbles</p>'
  11439. */
  11440. function wrap(value, wrapper) {
  11441. return partial(castFunction(wrapper), value);
  11442. }
  11443. /*------------------------------------------------------------------------*/
  11444. /**
  11445. * Casts `value` as an array if it's not one.
  11446. *
  11447. * @static
  11448. * @memberOf _
  11449. * @since 4.4.0
  11450. * @category Lang
  11451. * @param {*} value The value to inspect.
  11452. * @returns {Array} Returns the cast array.
  11453. * @example
  11454. *
  11455. * _.castArray(1);
  11456. * // => [1]
  11457. *
  11458. * _.castArray({ 'a': 1 });
  11459. * // => [{ 'a': 1 }]
  11460. *
  11461. * _.castArray('abc');
  11462. * // => ['abc']
  11463. *
  11464. * _.castArray(null);
  11465. * // => [null]
  11466. *
  11467. * _.castArray(undefined);
  11468. * // => [undefined]
  11469. *
  11470. * _.castArray();
  11471. * // => []
  11472. *
  11473. * var array = [1, 2, 3];
  11474. * console.log(_.castArray(array) === array);
  11475. * // => true
  11476. */
  11477. function castArray() {
  11478. if (!arguments.length) {
  11479. return [];
  11480. }
  11481. var value = arguments[0];
  11482. return isArray(value) ? value : [value];
  11483. }
  11484. /**
  11485. * Creates a shallow clone of `value`.
  11486. *
  11487. * **Note:** This method is loosely based on the
  11488. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11489. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11490. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11491. * arrays. The own enumerable properties of `arguments` objects are cloned
  11492. * as plain objects. An empty object is returned for uncloneable values such
  11493. * as error objects, functions, DOM nodes, and WeakMaps.
  11494. *
  11495. * @static
  11496. * @memberOf _
  11497. * @since 0.1.0
  11498. * @category Lang
  11499. * @param {*} value The value to clone.
  11500. * @returns {*} Returns the cloned value.
  11501. * @see _.cloneDeep
  11502. * @example
  11503. *
  11504. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11505. *
  11506. * var shallow = _.clone(objects);
  11507. * console.log(shallow[0] === objects[0]);
  11508. * // => true
  11509. */
  11510. function clone(value) {
  11511. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11512. }
  11513. /**
  11514. * This method is like `_.clone` except that it accepts `customizer` which
  11515. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11516. * cloning is handled by the method instead. The `customizer` is invoked with
  11517. * up to four arguments; (value [, index|key, object, stack]).
  11518. *
  11519. * @static
  11520. * @memberOf _
  11521. * @since 4.0.0
  11522. * @category Lang
  11523. * @param {*} value The value to clone.
  11524. * @param {Function} [customizer] The function to customize cloning.
  11525. * @returns {*} Returns the cloned value.
  11526. * @see _.cloneDeepWith
  11527. * @example
  11528. *
  11529. * function customizer(value) {
  11530. * if (_.isElement(value)) {
  11531. * return value.cloneNode(false);
  11532. * }
  11533. * }
  11534. *
  11535. * var el = _.cloneWith(document.body, customizer);
  11536. *
  11537. * console.log(el === document.body);
  11538. * // => false
  11539. * console.log(el.nodeName);
  11540. * // => 'BODY'
  11541. * console.log(el.childNodes.length);
  11542. * // => 0
  11543. */
  11544. function cloneWith(value, customizer) {
  11545. customizer = typeof customizer == 'function' ? customizer : undefined;
  11546. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11547. }
  11548. /**
  11549. * This method is like `_.clone` except that it recursively clones `value`.
  11550. *
  11551. * @static
  11552. * @memberOf _
  11553. * @since 1.0.0
  11554. * @category Lang
  11555. * @param {*} value The value to recursively clone.
  11556. * @returns {*} Returns the deep cloned value.
  11557. * @see _.clone
  11558. * @example
  11559. *
  11560. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11561. *
  11562. * var deep = _.cloneDeep(objects);
  11563. * console.log(deep[0] === objects[0]);
  11564. * // => false
  11565. */
  11566. function cloneDeep(value) {
  11567. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11568. }
  11569. /**
  11570. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11571. *
  11572. * @static
  11573. * @memberOf _
  11574. * @since 4.0.0
  11575. * @category Lang
  11576. * @param {*} value The value to recursively clone.
  11577. * @param {Function} [customizer] The function to customize cloning.
  11578. * @returns {*} Returns the deep cloned value.
  11579. * @see _.cloneWith
  11580. * @example
  11581. *
  11582. * function customizer(value) {
  11583. * if (_.isElement(value)) {
  11584. * return value.cloneNode(true);
  11585. * }
  11586. * }
  11587. *
  11588. * var el = _.cloneDeepWith(document.body, customizer);
  11589. *
  11590. * console.log(el === document.body);
  11591. * // => false
  11592. * console.log(el.nodeName);
  11593. * // => 'BODY'
  11594. * console.log(el.childNodes.length);
  11595. * // => 20
  11596. */
  11597. function cloneDeepWith(value, customizer) {
  11598. customizer = typeof customizer == 'function' ? customizer : undefined;
  11599. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11600. }
  11601. /**
  11602. * Checks if `object` conforms to `source` by invoking the predicate
  11603. * properties of `source` with the corresponding property values of `object`.
  11604. *
  11605. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11606. * partially applied.
  11607. *
  11608. * @static
  11609. * @memberOf _
  11610. * @since 4.14.0
  11611. * @category Lang
  11612. * @param {Object} object The object to inspect.
  11613. * @param {Object} source The object of property predicates to conform to.
  11614. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11615. * @example
  11616. *
  11617. * var object = { 'a': 1, 'b': 2 };
  11618. *
  11619. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11620. * // => true
  11621. *
  11622. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11623. * // => false
  11624. */
  11625. function conformsTo(object, source) {
  11626. return source == null || baseConformsTo(object, source, keys(source));
  11627. }
  11628. /**
  11629. * Performs a
  11630. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11631. * comparison between two values to determine if they are equivalent.
  11632. *
  11633. * @static
  11634. * @memberOf _
  11635. * @since 4.0.0
  11636. * @category Lang
  11637. * @param {*} value The value to compare.
  11638. * @param {*} other The other value to compare.
  11639. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11640. * @example
  11641. *
  11642. * var object = { 'a': 1 };
  11643. * var other = { 'a': 1 };
  11644. *
  11645. * _.eq(object, object);
  11646. * // => true
  11647. *
  11648. * _.eq(object, other);
  11649. * // => false
  11650. *
  11651. * _.eq('a', 'a');
  11652. * // => true
  11653. *
  11654. * _.eq('a', Object('a'));
  11655. * // => false
  11656. *
  11657. * _.eq(NaN, NaN);
  11658. * // => true
  11659. */
  11660. function eq(value, other) {
  11661. return value === other || (value !== value && other !== other);
  11662. }
  11663. /**
  11664. * Checks if `value` is greater than `other`.
  11665. *
  11666. * @static
  11667. * @memberOf _
  11668. * @since 3.9.0
  11669. * @category Lang
  11670. * @param {*} value The value to compare.
  11671. * @param {*} other The other value to compare.
  11672. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11673. * else `false`.
  11674. * @see _.lt
  11675. * @example
  11676. *
  11677. * _.gt(3, 1);
  11678. * // => true
  11679. *
  11680. * _.gt(3, 3);
  11681. * // => false
  11682. *
  11683. * _.gt(1, 3);
  11684. * // => false
  11685. */
  11686. var gt = createRelationalOperation(baseGt);
  11687. /**
  11688. * Checks if `value` is greater than or equal to `other`.
  11689. *
  11690. * @static
  11691. * @memberOf _
  11692. * @since 3.9.0
  11693. * @category Lang
  11694. * @param {*} value The value to compare.
  11695. * @param {*} other The other value to compare.
  11696. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11697. * `other`, else `false`.
  11698. * @see _.lte
  11699. * @example
  11700. *
  11701. * _.gte(3, 1);
  11702. * // => true
  11703. *
  11704. * _.gte(3, 3);
  11705. * // => true
  11706. *
  11707. * _.gte(1, 3);
  11708. * // => false
  11709. */
  11710. var gte = createRelationalOperation(function(value, other) {
  11711. return value >= other;
  11712. });
  11713. /**
  11714. * Checks if `value` is likely an `arguments` object.
  11715. *
  11716. * @static
  11717. * @memberOf _
  11718. * @since 0.1.0
  11719. * @category Lang
  11720. * @param {*} value The value to check.
  11721. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11722. * else `false`.
  11723. * @example
  11724. *
  11725. * _.isArguments(function() { return arguments; }());
  11726. * // => true
  11727. *
  11728. * _.isArguments([1, 2, 3]);
  11729. * // => false
  11730. */
  11731. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11732. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11733. !propertyIsEnumerable.call(value, 'callee');
  11734. };
  11735. /**
  11736. * Checks if `value` is classified as an `Array` object.
  11737. *
  11738. * @static
  11739. * @memberOf _
  11740. * @since 0.1.0
  11741. * @category Lang
  11742. * @param {*} value The value to check.
  11743. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11744. * @example
  11745. *
  11746. * _.isArray([1, 2, 3]);
  11747. * // => true
  11748. *
  11749. * _.isArray(document.body.children);
  11750. * // => false
  11751. *
  11752. * _.isArray('abc');
  11753. * // => false
  11754. *
  11755. * _.isArray(_.noop);
  11756. * // => false
  11757. */
  11758. var isArray = Array.isArray;
  11759. /**
  11760. * Checks if `value` is classified as an `ArrayBuffer` object.
  11761. *
  11762. * @static
  11763. * @memberOf _
  11764. * @since 4.3.0
  11765. * @category Lang
  11766. * @param {*} value The value to check.
  11767. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11768. * @example
  11769. *
  11770. * _.isArrayBuffer(new ArrayBuffer(2));
  11771. * // => true
  11772. *
  11773. * _.isArrayBuffer(new Array(2));
  11774. * // => false
  11775. */
  11776. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11777. /**
  11778. * Checks if `value` is array-like. A value is considered array-like if it's
  11779. * not a function and has a `value.length` that's an integer greater than or
  11780. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11781. *
  11782. * @static
  11783. * @memberOf _
  11784. * @since 4.0.0
  11785. * @category Lang
  11786. * @param {*} value The value to check.
  11787. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11788. * @example
  11789. *
  11790. * _.isArrayLike([1, 2, 3]);
  11791. * // => true
  11792. *
  11793. * _.isArrayLike(document.body.children);
  11794. * // => true
  11795. *
  11796. * _.isArrayLike('abc');
  11797. * // => true
  11798. *
  11799. * _.isArrayLike(_.noop);
  11800. * // => false
  11801. */
  11802. function isArrayLike(value) {
  11803. return value != null && isLength(value.length) && !isFunction(value);
  11804. }
  11805. /**
  11806. * This method is like `_.isArrayLike` except that it also checks if `value`
  11807. * is an object.
  11808. *
  11809. * @static
  11810. * @memberOf _
  11811. * @since 4.0.0
  11812. * @category Lang
  11813. * @param {*} value The value to check.
  11814. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11815. * else `false`.
  11816. * @example
  11817. *
  11818. * _.isArrayLikeObject([1, 2, 3]);
  11819. * // => true
  11820. *
  11821. * _.isArrayLikeObject(document.body.children);
  11822. * // => true
  11823. *
  11824. * _.isArrayLikeObject('abc');
  11825. * // => false
  11826. *
  11827. * _.isArrayLikeObject(_.noop);
  11828. * // => false
  11829. */
  11830. function isArrayLikeObject(value) {
  11831. return isObjectLike(value) && isArrayLike(value);
  11832. }
  11833. /**
  11834. * Checks if `value` is classified as a boolean primitive or object.
  11835. *
  11836. * @static
  11837. * @memberOf _
  11838. * @since 0.1.0
  11839. * @category Lang
  11840. * @param {*} value The value to check.
  11841. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11842. * @example
  11843. *
  11844. * _.isBoolean(false);
  11845. * // => true
  11846. *
  11847. * _.isBoolean(null);
  11848. * // => false
  11849. */
  11850. function isBoolean(value) {
  11851. return value === true || value === false ||
  11852. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11853. }
  11854. /**
  11855. * Checks if `value` is a buffer.
  11856. *
  11857. * @static
  11858. * @memberOf _
  11859. * @since 4.3.0
  11860. * @category Lang
  11861. * @param {*} value The value to check.
  11862. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11863. * @example
  11864. *
  11865. * _.isBuffer(new Buffer(2));
  11866. * // => true
  11867. *
  11868. * _.isBuffer(new Uint8Array(2));
  11869. * // => false
  11870. */
  11871. var isBuffer = nativeIsBuffer || stubFalse;
  11872. /**
  11873. * Checks if `value` is classified as a `Date` object.
  11874. *
  11875. * @static
  11876. * @memberOf _
  11877. * @since 0.1.0
  11878. * @category Lang
  11879. * @param {*} value The value to check.
  11880. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11881. * @example
  11882. *
  11883. * _.isDate(new Date);
  11884. * // => true
  11885. *
  11886. * _.isDate('Mon April 23 2012');
  11887. * // => false
  11888. */
  11889. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11890. /**
  11891. * Checks if `value` is likely a DOM element.
  11892. *
  11893. * @static
  11894. * @memberOf _
  11895. * @since 0.1.0
  11896. * @category Lang
  11897. * @param {*} value The value to check.
  11898. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11899. * @example
  11900. *
  11901. * _.isElement(document.body);
  11902. * // => true
  11903. *
  11904. * _.isElement('<body>');
  11905. * // => false
  11906. */
  11907. function isElement(value) {
  11908. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11909. }
  11910. /**
  11911. * Checks if `value` is an empty object, collection, map, or set.
  11912. *
  11913. * Objects are considered empty if they have no own enumerable string keyed
  11914. * properties.
  11915. *
  11916. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11917. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11918. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11919. *
  11920. * @static
  11921. * @memberOf _
  11922. * @since 0.1.0
  11923. * @category Lang
  11924. * @param {*} value The value to check.
  11925. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11926. * @example
  11927. *
  11928. * _.isEmpty(null);
  11929. * // => true
  11930. *
  11931. * _.isEmpty(true);
  11932. * // => true
  11933. *
  11934. * _.isEmpty(1);
  11935. * // => true
  11936. *
  11937. * _.isEmpty([1, 2, 3]);
  11938. * // => false
  11939. *
  11940. * _.isEmpty({ 'a': 1 });
  11941. * // => false
  11942. */
  11943. function isEmpty(value) {
  11944. if (value == null) {
  11945. return true;
  11946. }
  11947. if (isArrayLike(value) &&
  11948. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11949. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11950. return !value.length;
  11951. }
  11952. var tag = getTag(value);
  11953. if (tag == mapTag || tag == setTag) {
  11954. return !value.size;
  11955. }
  11956. if (isPrototype(value)) {
  11957. return !baseKeys(value).length;
  11958. }
  11959. for (var key in value) {
  11960. if (hasOwnProperty.call(value, key)) {
  11961. return false;
  11962. }
  11963. }
  11964. return true;
  11965. }
  11966. /**
  11967. * Performs a deep comparison between two values to determine if they are
  11968. * equivalent.
  11969. *
  11970. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11971. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11972. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11973. * by their own, not inherited, enumerable properties. Functions and DOM
  11974. * nodes are compared by strict equality, i.e. `===`.
  11975. *
  11976. * @static
  11977. * @memberOf _
  11978. * @since 0.1.0
  11979. * @category Lang
  11980. * @param {*} value The value to compare.
  11981. * @param {*} other The other value to compare.
  11982. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11983. * @example
  11984. *
  11985. * var object = { 'a': 1 };
  11986. * var other = { 'a': 1 };
  11987. *
  11988. * _.isEqual(object, other);
  11989. * // => true
  11990. *
  11991. * object === other;
  11992. * // => false
  11993. */
  11994. function isEqual(value, other) {
  11995. return baseIsEqual(value, other);
  11996. }
  11997. /**
  11998. * This method is like `_.isEqual` except that it accepts `customizer` which
  11999. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12000. * are handled by the method instead. The `customizer` is invoked with up to
  12001. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12002. *
  12003. * @static
  12004. * @memberOf _
  12005. * @since 4.0.0
  12006. * @category Lang
  12007. * @param {*} value The value to compare.
  12008. * @param {*} other The other value to compare.
  12009. * @param {Function} [customizer] The function to customize comparisons.
  12010. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12011. * @example
  12012. *
  12013. * function isGreeting(value) {
  12014. * return /^h(?:i|ello)$/.test(value);
  12015. * }
  12016. *
  12017. * function customizer(objValue, othValue) {
  12018. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12019. * return true;
  12020. * }
  12021. * }
  12022. *
  12023. * var array = ['hello', 'goodbye'];
  12024. * var other = ['hi', 'goodbye'];
  12025. *
  12026. * _.isEqualWith(array, other, customizer);
  12027. * // => true
  12028. */
  12029. function isEqualWith(value, other, customizer) {
  12030. customizer = typeof customizer == 'function' ? customizer : undefined;
  12031. var result = customizer ? customizer(value, other) : undefined;
  12032. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12033. }
  12034. /**
  12035. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12036. * `SyntaxError`, `TypeError`, or `URIError` object.
  12037. *
  12038. * @static
  12039. * @memberOf _
  12040. * @since 3.0.0
  12041. * @category Lang
  12042. * @param {*} value The value to check.
  12043. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12044. * @example
  12045. *
  12046. * _.isError(new Error);
  12047. * // => true
  12048. *
  12049. * _.isError(Error);
  12050. * // => false
  12051. */
  12052. function isError(value) {
  12053. if (!isObjectLike(value)) {
  12054. return false;
  12055. }
  12056. var tag = baseGetTag(value);
  12057. return tag == errorTag || tag == domExcTag ||
  12058. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12059. }
  12060. /**
  12061. * Checks if `value` is a finite primitive number.
  12062. *
  12063. * **Note:** This method is based on
  12064. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12065. *
  12066. * @static
  12067. * @memberOf _
  12068. * @since 0.1.0
  12069. * @category Lang
  12070. * @param {*} value The value to check.
  12071. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12072. * @example
  12073. *
  12074. * _.isFinite(3);
  12075. * // => true
  12076. *
  12077. * _.isFinite(Number.MIN_VALUE);
  12078. * // => true
  12079. *
  12080. * _.isFinite(Infinity);
  12081. * // => false
  12082. *
  12083. * _.isFinite('3');
  12084. * // => false
  12085. */
  12086. function isFinite(value) {
  12087. return typeof value == 'number' && nativeIsFinite(value);
  12088. }
  12089. /**
  12090. * Checks if `value` is classified as a `Function` object.
  12091. *
  12092. * @static
  12093. * @memberOf _
  12094. * @since 0.1.0
  12095. * @category Lang
  12096. * @param {*} value The value to check.
  12097. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12098. * @example
  12099. *
  12100. * _.isFunction(_);
  12101. * // => true
  12102. *
  12103. * _.isFunction(/abc/);
  12104. * // => false
  12105. */
  12106. function isFunction(value) {
  12107. if (!isObject(value)) {
  12108. return false;
  12109. }
  12110. // The use of `Object#toString` avoids issues with the `typeof` operator
  12111. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12112. var tag = baseGetTag(value);
  12113. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12114. }
  12115. /**
  12116. * Checks if `value` is an integer.
  12117. *
  12118. * **Note:** This method is based on
  12119. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12120. *
  12121. * @static
  12122. * @memberOf _
  12123. * @since 4.0.0
  12124. * @category Lang
  12125. * @param {*} value The value to check.
  12126. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12127. * @example
  12128. *
  12129. * _.isInteger(3);
  12130. * // => true
  12131. *
  12132. * _.isInteger(Number.MIN_VALUE);
  12133. * // => false
  12134. *
  12135. * _.isInteger(Infinity);
  12136. * // => false
  12137. *
  12138. * _.isInteger('3');
  12139. * // => false
  12140. */
  12141. function isInteger(value) {
  12142. return typeof value == 'number' && value == toInteger(value);
  12143. }
  12144. /**
  12145. * Checks if `value` is a valid array-like length.
  12146. *
  12147. * **Note:** This method is loosely based on
  12148. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12149. *
  12150. * @static
  12151. * @memberOf _
  12152. * @since 4.0.0
  12153. * @category Lang
  12154. * @param {*} value The value to check.
  12155. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12156. * @example
  12157. *
  12158. * _.isLength(3);
  12159. * // => true
  12160. *
  12161. * _.isLength(Number.MIN_VALUE);
  12162. * // => false
  12163. *
  12164. * _.isLength(Infinity);
  12165. * // => false
  12166. *
  12167. * _.isLength('3');
  12168. * // => false
  12169. */
  12170. function isLength(value) {
  12171. return typeof value == 'number' &&
  12172. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12173. }
  12174. /**
  12175. * Checks if `value` is the
  12176. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12177. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12178. *
  12179. * @static
  12180. * @memberOf _
  12181. * @since 0.1.0
  12182. * @category Lang
  12183. * @param {*} value The value to check.
  12184. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12185. * @example
  12186. *
  12187. * _.isObject({});
  12188. * // => true
  12189. *
  12190. * _.isObject([1, 2, 3]);
  12191. * // => true
  12192. *
  12193. * _.isObject(_.noop);
  12194. * // => true
  12195. *
  12196. * _.isObject(null);
  12197. * // => false
  12198. */
  12199. function isObject(value) {
  12200. var type = typeof value;
  12201. return value != null && (type == 'object' || type == 'function');
  12202. }
  12203. /**
  12204. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12205. * and has a `typeof` result of "object".
  12206. *
  12207. * @static
  12208. * @memberOf _
  12209. * @since 4.0.0
  12210. * @category Lang
  12211. * @param {*} value The value to check.
  12212. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12213. * @example
  12214. *
  12215. * _.isObjectLike({});
  12216. * // => true
  12217. *
  12218. * _.isObjectLike([1, 2, 3]);
  12219. * // => true
  12220. *
  12221. * _.isObjectLike(_.noop);
  12222. * // => false
  12223. *
  12224. * _.isObjectLike(null);
  12225. * // => false
  12226. */
  12227. function isObjectLike(value) {
  12228. return value != null && typeof value == 'object';
  12229. }
  12230. /**
  12231. * Checks if `value` is classified as a `Map` object.
  12232. *
  12233. * @static
  12234. * @memberOf _
  12235. * @since 4.3.0
  12236. * @category Lang
  12237. * @param {*} value The value to check.
  12238. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12239. * @example
  12240. *
  12241. * _.isMap(new Map);
  12242. * // => true
  12243. *
  12244. * _.isMap(new WeakMap);
  12245. * // => false
  12246. */
  12247. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12248. /**
  12249. * Performs a partial deep comparison between `object` and `source` to
  12250. * determine if `object` contains equivalent property values.
  12251. *
  12252. * **Note:** This method is equivalent to `_.matches` when `source` is
  12253. * partially applied.
  12254. *
  12255. * Partial comparisons will match empty array and empty object `source`
  12256. * values against any array or object value, respectively. See `_.isEqual`
  12257. * for a list of supported value comparisons.
  12258. *
  12259. * @static
  12260. * @memberOf _
  12261. * @since 3.0.0
  12262. * @category Lang
  12263. * @param {Object} object The object to inspect.
  12264. * @param {Object} source The object of property values to match.
  12265. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12266. * @example
  12267. *
  12268. * var object = { 'a': 1, 'b': 2 };
  12269. *
  12270. * _.isMatch(object, { 'b': 2 });
  12271. * // => true
  12272. *
  12273. * _.isMatch(object, { 'b': 1 });
  12274. * // => false
  12275. */
  12276. function isMatch(object, source) {
  12277. return object === source || baseIsMatch(object, source, getMatchData(source));
  12278. }
  12279. /**
  12280. * This method is like `_.isMatch` except that it accepts `customizer` which
  12281. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12282. * are handled by the method instead. The `customizer` is invoked with five
  12283. * arguments: (objValue, srcValue, index|key, object, source).
  12284. *
  12285. * @static
  12286. * @memberOf _
  12287. * @since 4.0.0
  12288. * @category Lang
  12289. * @param {Object} object The object to inspect.
  12290. * @param {Object} source The object of property values to match.
  12291. * @param {Function} [customizer] The function to customize comparisons.
  12292. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12293. * @example
  12294. *
  12295. * function isGreeting(value) {
  12296. * return /^h(?:i|ello)$/.test(value);
  12297. * }
  12298. *
  12299. * function customizer(objValue, srcValue) {
  12300. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12301. * return true;
  12302. * }
  12303. * }
  12304. *
  12305. * var object = { 'greeting': 'hello' };
  12306. * var source = { 'greeting': 'hi' };
  12307. *
  12308. * _.isMatchWith(object, source, customizer);
  12309. * // => true
  12310. */
  12311. function isMatchWith(object, source, customizer) {
  12312. customizer = typeof customizer == 'function' ? customizer : undefined;
  12313. return baseIsMatch(object, source, getMatchData(source), customizer);
  12314. }
  12315. /**
  12316. * Checks if `value` is `NaN`.
  12317. *
  12318. * **Note:** This method is based on
  12319. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12320. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12321. * `undefined` and other non-number values.
  12322. *
  12323. * @static
  12324. * @memberOf _
  12325. * @since 0.1.0
  12326. * @category Lang
  12327. * @param {*} value The value to check.
  12328. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12329. * @example
  12330. *
  12331. * _.isNaN(NaN);
  12332. * // => true
  12333. *
  12334. * _.isNaN(new Number(NaN));
  12335. * // => true
  12336. *
  12337. * isNaN(undefined);
  12338. * // => true
  12339. *
  12340. * _.isNaN(undefined);
  12341. * // => false
  12342. */
  12343. function isNaN(value) {
  12344. // An `NaN` primitive is the only value that is not equal to itself.
  12345. // Perform the `toStringTag` check first to avoid errors with some
  12346. // ActiveX objects in IE.
  12347. return isNumber(value) && value != +value;
  12348. }
  12349. /**
  12350. * Checks if `value` is a pristine native function.
  12351. *
  12352. * **Note:** This method can't reliably detect native functions in the presence
  12353. * of the core-js package because core-js circumvents this kind of detection.
  12354. * Despite multiple requests, the core-js maintainer has made it clear: any
  12355. * attempt to fix the detection will be obstructed. As a result, we're left
  12356. * with little choice but to throw an error. Unfortunately, this also affects
  12357. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12358. * which rely on core-js.
  12359. *
  12360. * @static
  12361. * @memberOf _
  12362. * @since 3.0.0
  12363. * @category Lang
  12364. * @param {*} value The value to check.
  12365. * @returns {boolean} Returns `true` if `value` is a native function,
  12366. * else `false`.
  12367. * @example
  12368. *
  12369. * _.isNative(Array.prototype.push);
  12370. * // => true
  12371. *
  12372. * _.isNative(_);
  12373. * // => false
  12374. */
  12375. function isNative(value) {
  12376. if (isMaskable(value)) {
  12377. throw new Error(CORE_ERROR_TEXT);
  12378. }
  12379. return baseIsNative(value);
  12380. }
  12381. /**
  12382. * Checks if `value` is `null`.
  12383. *
  12384. * @static
  12385. * @memberOf _
  12386. * @since 0.1.0
  12387. * @category Lang
  12388. * @param {*} value The value to check.
  12389. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12390. * @example
  12391. *
  12392. * _.isNull(null);
  12393. * // => true
  12394. *
  12395. * _.isNull(void 0);
  12396. * // => false
  12397. */
  12398. function isNull(value) {
  12399. return value === null;
  12400. }
  12401. /**
  12402. * Checks if `value` is `null` or `undefined`.
  12403. *
  12404. * @static
  12405. * @memberOf _
  12406. * @since 4.0.0
  12407. * @category Lang
  12408. * @param {*} value The value to check.
  12409. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12410. * @example
  12411. *
  12412. * _.isNil(null);
  12413. * // => true
  12414. *
  12415. * _.isNil(void 0);
  12416. * // => true
  12417. *
  12418. * _.isNil(NaN);
  12419. * // => false
  12420. */
  12421. function isNil(value) {
  12422. return value == null;
  12423. }
  12424. /**
  12425. * Checks if `value` is classified as a `Number` primitive or object.
  12426. *
  12427. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12428. * classified as numbers, use the `_.isFinite` method.
  12429. *
  12430. * @static
  12431. * @memberOf _
  12432. * @since 0.1.0
  12433. * @category Lang
  12434. * @param {*} value The value to check.
  12435. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12436. * @example
  12437. *
  12438. * _.isNumber(3);
  12439. * // => true
  12440. *
  12441. * _.isNumber(Number.MIN_VALUE);
  12442. * // => true
  12443. *
  12444. * _.isNumber(Infinity);
  12445. * // => true
  12446. *
  12447. * _.isNumber('3');
  12448. * // => false
  12449. */
  12450. function isNumber(value) {
  12451. return typeof value == 'number' ||
  12452. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12453. }
  12454. /**
  12455. * Checks if `value` is a plain object, that is, an object created by the
  12456. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12457. *
  12458. * @static
  12459. * @memberOf _
  12460. * @since 0.8.0
  12461. * @category Lang
  12462. * @param {*} value The value to check.
  12463. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12464. * @example
  12465. *
  12466. * function Foo() {
  12467. * this.a = 1;
  12468. * }
  12469. *
  12470. * _.isPlainObject(new Foo);
  12471. * // => false
  12472. *
  12473. * _.isPlainObject([1, 2, 3]);
  12474. * // => false
  12475. *
  12476. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12477. * // => true
  12478. *
  12479. * _.isPlainObject(Object.create(null));
  12480. * // => true
  12481. */
  12482. function isPlainObject(value) {
  12483. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12484. return false;
  12485. }
  12486. var proto = getPrototype(value);
  12487. if (proto === null) {
  12488. return true;
  12489. }
  12490. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12491. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12492. funcToString.call(Ctor) == objectCtorString;
  12493. }
  12494. /**
  12495. * Checks if `value` is classified as a `RegExp` object.
  12496. *
  12497. * @static
  12498. * @memberOf _
  12499. * @since 0.1.0
  12500. * @category Lang
  12501. * @param {*} value The value to check.
  12502. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12503. * @example
  12504. *
  12505. * _.isRegExp(/abc/);
  12506. * // => true
  12507. *
  12508. * _.isRegExp('/abc/');
  12509. * // => false
  12510. */
  12511. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12512. /**
  12513. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12514. * double precision number which isn't the result of a rounded unsafe integer.
  12515. *
  12516. * **Note:** This method is based on
  12517. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12518. *
  12519. * @static
  12520. * @memberOf _
  12521. * @since 4.0.0
  12522. * @category Lang
  12523. * @param {*} value The value to check.
  12524. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12525. * @example
  12526. *
  12527. * _.isSafeInteger(3);
  12528. * // => true
  12529. *
  12530. * _.isSafeInteger(Number.MIN_VALUE);
  12531. * // => false
  12532. *
  12533. * _.isSafeInteger(Infinity);
  12534. * // => false
  12535. *
  12536. * _.isSafeInteger('3');
  12537. * // => false
  12538. */
  12539. function isSafeInteger(value) {
  12540. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12541. }
  12542. /**
  12543. * Checks if `value` is classified as a `Set` object.
  12544. *
  12545. * @static
  12546. * @memberOf _
  12547. * @since 4.3.0
  12548. * @category Lang
  12549. * @param {*} value The value to check.
  12550. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12551. * @example
  12552. *
  12553. * _.isSet(new Set);
  12554. * // => true
  12555. *
  12556. * _.isSet(new WeakSet);
  12557. * // => false
  12558. */
  12559. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12560. /**
  12561. * Checks if `value` is classified as a `String` primitive or object.
  12562. *
  12563. * @static
  12564. * @since 0.1.0
  12565. * @memberOf _
  12566. * @category Lang
  12567. * @param {*} value The value to check.
  12568. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12569. * @example
  12570. *
  12571. * _.isString('abc');
  12572. * // => true
  12573. *
  12574. * _.isString(1);
  12575. * // => false
  12576. */
  12577. function isString(value) {
  12578. return typeof value == 'string' ||
  12579. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12580. }
  12581. /**
  12582. * Checks if `value` is classified as a `Symbol` primitive or object.
  12583. *
  12584. * @static
  12585. * @memberOf _
  12586. * @since 4.0.0
  12587. * @category Lang
  12588. * @param {*} value The value to check.
  12589. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12590. * @example
  12591. *
  12592. * _.isSymbol(Symbol.iterator);
  12593. * // => true
  12594. *
  12595. * _.isSymbol('abc');
  12596. * // => false
  12597. */
  12598. function isSymbol(value) {
  12599. return typeof value == 'symbol' ||
  12600. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12601. }
  12602. /**
  12603. * Checks if `value` is classified as a typed array.
  12604. *
  12605. * @static
  12606. * @memberOf _
  12607. * @since 3.0.0
  12608. * @category Lang
  12609. * @param {*} value The value to check.
  12610. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12611. * @example
  12612. *
  12613. * _.isTypedArray(new Uint8Array);
  12614. * // => true
  12615. *
  12616. * _.isTypedArray([]);
  12617. * // => false
  12618. */
  12619. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12620. /**
  12621. * Checks if `value` is `undefined`.
  12622. *
  12623. * @static
  12624. * @since 0.1.0
  12625. * @memberOf _
  12626. * @category Lang
  12627. * @param {*} value The value to check.
  12628. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12629. * @example
  12630. *
  12631. * _.isUndefined(void 0);
  12632. * // => true
  12633. *
  12634. * _.isUndefined(null);
  12635. * // => false
  12636. */
  12637. function isUndefined(value) {
  12638. return value === undefined;
  12639. }
  12640. /**
  12641. * Checks if `value` is classified as a `WeakMap` object.
  12642. *
  12643. * @static
  12644. * @memberOf _
  12645. * @since 4.3.0
  12646. * @category Lang
  12647. * @param {*} value The value to check.
  12648. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12649. * @example
  12650. *
  12651. * _.isWeakMap(new WeakMap);
  12652. * // => true
  12653. *
  12654. * _.isWeakMap(new Map);
  12655. * // => false
  12656. */
  12657. function isWeakMap(value) {
  12658. return isObjectLike(value) && getTag(value) == weakMapTag;
  12659. }
  12660. /**
  12661. * Checks if `value` is classified as a `WeakSet` object.
  12662. *
  12663. * @static
  12664. * @memberOf _
  12665. * @since 4.3.0
  12666. * @category Lang
  12667. * @param {*} value The value to check.
  12668. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12669. * @example
  12670. *
  12671. * _.isWeakSet(new WeakSet);
  12672. * // => true
  12673. *
  12674. * _.isWeakSet(new Set);
  12675. * // => false
  12676. */
  12677. function isWeakSet(value) {
  12678. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12679. }
  12680. /**
  12681. * Checks if `value` is less than `other`.
  12682. *
  12683. * @static
  12684. * @memberOf _
  12685. * @since 3.9.0
  12686. * @category Lang
  12687. * @param {*} value The value to compare.
  12688. * @param {*} other The other value to compare.
  12689. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12690. * else `false`.
  12691. * @see _.gt
  12692. * @example
  12693. *
  12694. * _.lt(1, 3);
  12695. * // => true
  12696. *
  12697. * _.lt(3, 3);
  12698. * // => false
  12699. *
  12700. * _.lt(3, 1);
  12701. * // => false
  12702. */
  12703. var lt = createRelationalOperation(baseLt);
  12704. /**
  12705. * Checks if `value` is less than or equal to `other`.
  12706. *
  12707. * @static
  12708. * @memberOf _
  12709. * @since 3.9.0
  12710. * @category Lang
  12711. * @param {*} value The value to compare.
  12712. * @param {*} other The other value to compare.
  12713. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12714. * `other`, else `false`.
  12715. * @see _.gte
  12716. * @example
  12717. *
  12718. * _.lte(1, 3);
  12719. * // => true
  12720. *
  12721. * _.lte(3, 3);
  12722. * // => true
  12723. *
  12724. * _.lte(3, 1);
  12725. * // => false
  12726. */
  12727. var lte = createRelationalOperation(function(value, other) {
  12728. return value <= other;
  12729. });
  12730. /**
  12731. * Converts `value` to an array.
  12732. *
  12733. * @static
  12734. * @since 0.1.0
  12735. * @memberOf _
  12736. * @category Lang
  12737. * @param {*} value The value to convert.
  12738. * @returns {Array} Returns the converted array.
  12739. * @example
  12740. *
  12741. * _.toArray({ 'a': 1, 'b': 2 });
  12742. * // => [1, 2]
  12743. *
  12744. * _.toArray('abc');
  12745. * // => ['a', 'b', 'c']
  12746. *
  12747. * _.toArray(1);
  12748. * // => []
  12749. *
  12750. * _.toArray(null);
  12751. * // => []
  12752. */
  12753. function toArray(value) {
  12754. if (!value) {
  12755. return [];
  12756. }
  12757. if (isArrayLike(value)) {
  12758. return isString(value) ? stringToArray(value) : copyArray(value);
  12759. }
  12760. if (symIterator && value[symIterator]) {
  12761. return iteratorToArray(value[symIterator]());
  12762. }
  12763. var tag = getTag(value),
  12764. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12765. return func(value);
  12766. }
  12767. /**
  12768. * Converts `value` to a finite number.
  12769. *
  12770. * @static
  12771. * @memberOf _
  12772. * @since 4.12.0
  12773. * @category Lang
  12774. * @param {*} value The value to convert.
  12775. * @returns {number} Returns the converted number.
  12776. * @example
  12777. *
  12778. * _.toFinite(3.2);
  12779. * // => 3.2
  12780. *
  12781. * _.toFinite(Number.MIN_VALUE);
  12782. * // => 5e-324
  12783. *
  12784. * _.toFinite(Infinity);
  12785. * // => 1.7976931348623157e+308
  12786. *
  12787. * _.toFinite('3.2');
  12788. * // => 3.2
  12789. */
  12790. function toFinite(value) {
  12791. if (!value) {
  12792. return value === 0 ? value : 0;
  12793. }
  12794. value = toNumber(value);
  12795. if (value === INFINITY || value === -INFINITY) {
  12796. var sign = (value < 0 ? -1 : 1);
  12797. return sign * MAX_INTEGER;
  12798. }
  12799. return value === value ? value : 0;
  12800. }
  12801. /**
  12802. * Converts `value` to an integer.
  12803. *
  12804. * **Note:** This method is loosely based on
  12805. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12806. *
  12807. * @static
  12808. * @memberOf _
  12809. * @since 4.0.0
  12810. * @category Lang
  12811. * @param {*} value The value to convert.
  12812. * @returns {number} Returns the converted integer.
  12813. * @example
  12814. *
  12815. * _.toInteger(3.2);
  12816. * // => 3
  12817. *
  12818. * _.toInteger(Number.MIN_VALUE);
  12819. * // => 0
  12820. *
  12821. * _.toInteger(Infinity);
  12822. * // => 1.7976931348623157e+308
  12823. *
  12824. * _.toInteger('3.2');
  12825. * // => 3
  12826. */
  12827. function toInteger(value) {
  12828. var result = toFinite(value),
  12829. remainder = result % 1;
  12830. return result === result ? (remainder ? result - remainder : result) : 0;
  12831. }
  12832. /**
  12833. * Converts `value` to an integer suitable for use as the length of an
  12834. * array-like object.
  12835. *
  12836. * **Note:** This method is based on
  12837. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12838. *
  12839. * @static
  12840. * @memberOf _
  12841. * @since 4.0.0
  12842. * @category Lang
  12843. * @param {*} value The value to convert.
  12844. * @returns {number} Returns the converted integer.
  12845. * @example
  12846. *
  12847. * _.toLength(3.2);
  12848. * // => 3
  12849. *
  12850. * _.toLength(Number.MIN_VALUE);
  12851. * // => 0
  12852. *
  12853. * _.toLength(Infinity);
  12854. * // => 4294967295
  12855. *
  12856. * _.toLength('3.2');
  12857. * // => 3
  12858. */
  12859. function toLength(value) {
  12860. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12861. }
  12862. /**
  12863. * Converts `value` to a number.
  12864. *
  12865. * @static
  12866. * @memberOf _
  12867. * @since 4.0.0
  12868. * @category Lang
  12869. * @param {*} value The value to process.
  12870. * @returns {number} Returns the number.
  12871. * @example
  12872. *
  12873. * _.toNumber(3.2);
  12874. * // => 3.2
  12875. *
  12876. * _.toNumber(Number.MIN_VALUE);
  12877. * // => 5e-324
  12878. *
  12879. * _.toNumber(Infinity);
  12880. * // => Infinity
  12881. *
  12882. * _.toNumber('3.2');
  12883. * // => 3.2
  12884. */
  12885. function toNumber(value) {
  12886. if (typeof value == 'number') {
  12887. return value;
  12888. }
  12889. if (isSymbol(value)) {
  12890. return NAN;
  12891. }
  12892. if (isObject(value)) {
  12893. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12894. value = isObject(other) ? (other + '') : other;
  12895. }
  12896. if (typeof value != 'string') {
  12897. return value === 0 ? value : +value;
  12898. }
  12899. value = baseTrim(value);
  12900. var isBinary = reIsBinary.test(value);
  12901. return (isBinary || reIsOctal.test(value))
  12902. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12903. : (reIsBadHex.test(value) ? NAN : +value);
  12904. }
  12905. /**
  12906. * Converts `value` to a plain object flattening inherited enumerable string
  12907. * keyed properties of `value` to own properties of the plain object.
  12908. *
  12909. * @static
  12910. * @memberOf _
  12911. * @since 3.0.0
  12912. * @category Lang
  12913. * @param {*} value The value to convert.
  12914. * @returns {Object} Returns the converted plain object.
  12915. * @example
  12916. *
  12917. * function Foo() {
  12918. * this.b = 2;
  12919. * }
  12920. *
  12921. * Foo.prototype.c = 3;
  12922. *
  12923. * _.assign({ 'a': 1 }, new Foo);
  12924. * // => { 'a': 1, 'b': 2 }
  12925. *
  12926. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12927. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12928. */
  12929. function toPlainObject(value) {
  12930. return copyObject(value, keysIn(value));
  12931. }
  12932. /**
  12933. * Converts `value` to a safe integer. A safe integer can be compared and
  12934. * represented correctly.
  12935. *
  12936. * @static
  12937. * @memberOf _
  12938. * @since 4.0.0
  12939. * @category Lang
  12940. * @param {*} value The value to convert.
  12941. * @returns {number} Returns the converted integer.
  12942. * @example
  12943. *
  12944. * _.toSafeInteger(3.2);
  12945. * // => 3
  12946. *
  12947. * _.toSafeInteger(Number.MIN_VALUE);
  12948. * // => 0
  12949. *
  12950. * _.toSafeInteger(Infinity);
  12951. * // => 9007199254740991
  12952. *
  12953. * _.toSafeInteger('3.2');
  12954. * // => 3
  12955. */
  12956. function toSafeInteger(value) {
  12957. return value
  12958. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12959. : (value === 0 ? value : 0);
  12960. }
  12961. /**
  12962. * Converts `value` to a string. An empty string is returned for `null`
  12963. * and `undefined` values. The sign of `-0` is preserved.
  12964. *
  12965. * @static
  12966. * @memberOf _
  12967. * @since 4.0.0
  12968. * @category Lang
  12969. * @param {*} value The value to convert.
  12970. * @returns {string} Returns the converted string.
  12971. * @example
  12972. *
  12973. * _.toString(null);
  12974. * // => ''
  12975. *
  12976. * _.toString(-0);
  12977. * // => '-0'
  12978. *
  12979. * _.toString([1, 2, 3]);
  12980. * // => '1,2,3'
  12981. */
  12982. function toString(value) {
  12983. return value == null ? '' : baseToString(value);
  12984. }
  12985. /*------------------------------------------------------------------------*/
  12986. /**
  12987. * Assigns own enumerable string keyed properties of source objects to the
  12988. * destination object. Source objects are applied from left to right.
  12989. * Subsequent sources overwrite property assignments of previous sources.
  12990. *
  12991. * **Note:** This method mutates `object` and is loosely based on
  12992. * [`Object.assign`](https://mdn.io/Object/assign).
  12993. *
  12994. * @static
  12995. * @memberOf _
  12996. * @since 0.10.0
  12997. * @category Object
  12998. * @param {Object} object The destination object.
  12999. * @param {...Object} [sources] The source objects.
  13000. * @returns {Object} Returns `object`.
  13001. * @see _.assignIn
  13002. * @example
  13003. *
  13004. * function Foo() {
  13005. * this.a = 1;
  13006. * }
  13007. *
  13008. * function Bar() {
  13009. * this.c = 3;
  13010. * }
  13011. *
  13012. * Foo.prototype.b = 2;
  13013. * Bar.prototype.d = 4;
  13014. *
  13015. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13016. * // => { 'a': 1, 'c': 3 }
  13017. */
  13018. var assign = createAssigner(function(object, source) {
  13019. if (isPrototype(source) || isArrayLike(source)) {
  13020. copyObject(source, keys(source), object);
  13021. return;
  13022. }
  13023. for (var key in source) {
  13024. if (hasOwnProperty.call(source, key)) {
  13025. assignValue(object, key, source[key]);
  13026. }
  13027. }
  13028. });
  13029. /**
  13030. * This method is like `_.assign` except that it iterates over own and
  13031. * inherited source properties.
  13032. *
  13033. * **Note:** This method mutates `object`.
  13034. *
  13035. * @static
  13036. * @memberOf _
  13037. * @since 4.0.0
  13038. * @alias extend
  13039. * @category Object
  13040. * @param {Object} object The destination object.
  13041. * @param {...Object} [sources] The source objects.
  13042. * @returns {Object} Returns `object`.
  13043. * @see _.assign
  13044. * @example
  13045. *
  13046. * function Foo() {
  13047. * this.a = 1;
  13048. * }
  13049. *
  13050. * function Bar() {
  13051. * this.c = 3;
  13052. * }
  13053. *
  13054. * Foo.prototype.b = 2;
  13055. * Bar.prototype.d = 4;
  13056. *
  13057. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13058. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13059. */
  13060. var assignIn = createAssigner(function(object, source) {
  13061. copyObject(source, keysIn(source), object);
  13062. });
  13063. /**
  13064. * This method is like `_.assignIn` except that it accepts `customizer`
  13065. * which is invoked to produce the assigned values. If `customizer` returns
  13066. * `undefined`, assignment is handled by the method instead. The `customizer`
  13067. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13068. *
  13069. * **Note:** This method mutates `object`.
  13070. *
  13071. * @static
  13072. * @memberOf _
  13073. * @since 4.0.0
  13074. * @alias extendWith
  13075. * @category Object
  13076. * @param {Object} object The destination object.
  13077. * @param {...Object} sources The source objects.
  13078. * @param {Function} [customizer] The function to customize assigned values.
  13079. * @returns {Object} Returns `object`.
  13080. * @see _.assignWith
  13081. * @example
  13082. *
  13083. * function customizer(objValue, srcValue) {
  13084. * return _.isUndefined(objValue) ? srcValue : objValue;
  13085. * }
  13086. *
  13087. * var defaults = _.partialRight(_.assignInWith, customizer);
  13088. *
  13089. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13090. * // => { 'a': 1, 'b': 2 }
  13091. */
  13092. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13093. copyObject(source, keysIn(source), object, customizer);
  13094. });
  13095. /**
  13096. * This method is like `_.assign` except that it accepts `customizer`
  13097. * which is invoked to produce the assigned values. If `customizer` returns
  13098. * `undefined`, assignment is handled by the method instead. The `customizer`
  13099. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13100. *
  13101. * **Note:** This method mutates `object`.
  13102. *
  13103. * @static
  13104. * @memberOf _
  13105. * @since 4.0.0
  13106. * @category Object
  13107. * @param {Object} object The destination object.
  13108. * @param {...Object} sources The source objects.
  13109. * @param {Function} [customizer] The function to customize assigned values.
  13110. * @returns {Object} Returns `object`.
  13111. * @see _.assignInWith
  13112. * @example
  13113. *
  13114. * function customizer(objValue, srcValue) {
  13115. * return _.isUndefined(objValue) ? srcValue : objValue;
  13116. * }
  13117. *
  13118. * var defaults = _.partialRight(_.assignWith, customizer);
  13119. *
  13120. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13121. * // => { 'a': 1, 'b': 2 }
  13122. */
  13123. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13124. copyObject(source, keys(source), object, customizer);
  13125. });
  13126. /**
  13127. * Creates an array of values corresponding to `paths` of `object`.
  13128. *
  13129. * @static
  13130. * @memberOf _
  13131. * @since 1.0.0
  13132. * @category Object
  13133. * @param {Object} object The object to iterate over.
  13134. * @param {...(string|string[])} [paths] The property paths to pick.
  13135. * @returns {Array} Returns the picked values.
  13136. * @example
  13137. *
  13138. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13139. *
  13140. * _.at(object, ['a[0].b.c', 'a[1]']);
  13141. * // => [3, 4]
  13142. */
  13143. var at = flatRest(baseAt);
  13144. /**
  13145. * Creates an object that inherits from the `prototype` object. If a
  13146. * `properties` object is given, its own enumerable string keyed properties
  13147. * are assigned to the created object.
  13148. *
  13149. * @static
  13150. * @memberOf _
  13151. * @since 2.3.0
  13152. * @category Object
  13153. * @param {Object} prototype The object to inherit from.
  13154. * @param {Object} [properties] The properties to assign to the object.
  13155. * @returns {Object} Returns the new object.
  13156. * @example
  13157. *
  13158. * function Shape() {
  13159. * this.x = 0;
  13160. * this.y = 0;
  13161. * }
  13162. *
  13163. * function Circle() {
  13164. * Shape.call(this);
  13165. * }
  13166. *
  13167. * Circle.prototype = _.create(Shape.prototype, {
  13168. * 'constructor': Circle
  13169. * });
  13170. *
  13171. * var circle = new Circle;
  13172. * circle instanceof Circle;
  13173. * // => true
  13174. *
  13175. * circle instanceof Shape;
  13176. * // => true
  13177. */
  13178. function create(prototype, properties) {
  13179. var result = baseCreate(prototype);
  13180. return properties == null ? result : baseAssign(result, properties);
  13181. }
  13182. /**
  13183. * Assigns own and inherited enumerable string keyed properties of source
  13184. * objects to the destination object for all destination properties that
  13185. * resolve to `undefined`. Source objects are applied from left to right.
  13186. * Once a property is set, additional values of the same property are ignored.
  13187. *
  13188. * **Note:** This method mutates `object`.
  13189. *
  13190. * @static
  13191. * @since 0.1.0
  13192. * @memberOf _
  13193. * @category Object
  13194. * @param {Object} object The destination object.
  13195. * @param {...Object} [sources] The source objects.
  13196. * @returns {Object} Returns `object`.
  13197. * @see _.defaultsDeep
  13198. * @example
  13199. *
  13200. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13201. * // => { 'a': 1, 'b': 2 }
  13202. */
  13203. var defaults = baseRest(function(object, sources) {
  13204. object = Object(object);
  13205. var index = -1;
  13206. var length = sources.length;
  13207. var guard = length > 2 ? sources[2] : undefined;
  13208. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13209. length = 1;
  13210. }
  13211. while (++index < length) {
  13212. var source = sources[index];
  13213. var props = keysIn(source);
  13214. var propsIndex = -1;
  13215. var propsLength = props.length;
  13216. while (++propsIndex < propsLength) {
  13217. var key = props[propsIndex];
  13218. var value = object[key];
  13219. if (value === undefined ||
  13220. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13221. object[key] = source[key];
  13222. }
  13223. }
  13224. }
  13225. return object;
  13226. });
  13227. /**
  13228. * This method is like `_.defaults` except that it recursively assigns
  13229. * default properties.
  13230. *
  13231. * **Note:** This method mutates `object`.
  13232. *
  13233. * @static
  13234. * @memberOf _
  13235. * @since 3.10.0
  13236. * @category Object
  13237. * @param {Object} object The destination object.
  13238. * @param {...Object} [sources] The source objects.
  13239. * @returns {Object} Returns `object`.
  13240. * @see _.defaults
  13241. * @example
  13242. *
  13243. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13244. * // => { 'a': { 'b': 2, 'c': 3 } }
  13245. */
  13246. var defaultsDeep = baseRest(function(args) {
  13247. args.push(undefined, customDefaultsMerge);
  13248. return apply(mergeWith, undefined, args);
  13249. });
  13250. /**
  13251. * This method is like `_.find` except that it returns the key of the first
  13252. * element `predicate` returns truthy for instead of the element itself.
  13253. *
  13254. * @static
  13255. * @memberOf _
  13256. * @since 1.1.0
  13257. * @category Object
  13258. * @param {Object} object The object to inspect.
  13259. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13260. * @returns {string|undefined} Returns the key of the matched element,
  13261. * else `undefined`.
  13262. * @example
  13263. *
  13264. * var users = {
  13265. * 'barney': { 'age': 36, 'active': true },
  13266. * 'fred': { 'age': 40, 'active': false },
  13267. * 'pebbles': { 'age': 1, 'active': true }
  13268. * };
  13269. *
  13270. * _.findKey(users, function(o) { return o.age < 40; });
  13271. * // => 'barney' (iteration order is not guaranteed)
  13272. *
  13273. * // The `_.matches` iteratee shorthand.
  13274. * _.findKey(users, { 'age': 1, 'active': true });
  13275. * // => 'pebbles'
  13276. *
  13277. * // The `_.matchesProperty` iteratee shorthand.
  13278. * _.findKey(users, ['active', false]);
  13279. * // => 'fred'
  13280. *
  13281. * // The `_.property` iteratee shorthand.
  13282. * _.findKey(users, 'active');
  13283. * // => 'barney'
  13284. */
  13285. function findKey(object, predicate) {
  13286. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13287. }
  13288. /**
  13289. * This method is like `_.findKey` except that it iterates over elements of
  13290. * a collection in the opposite order.
  13291. *
  13292. * @static
  13293. * @memberOf _
  13294. * @since 2.0.0
  13295. * @category Object
  13296. * @param {Object} object The object to inspect.
  13297. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13298. * @returns {string|undefined} Returns the key of the matched element,
  13299. * else `undefined`.
  13300. * @example
  13301. *
  13302. * var users = {
  13303. * 'barney': { 'age': 36, 'active': true },
  13304. * 'fred': { 'age': 40, 'active': false },
  13305. * 'pebbles': { 'age': 1, 'active': true }
  13306. * };
  13307. *
  13308. * _.findLastKey(users, function(o) { return o.age < 40; });
  13309. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13310. *
  13311. * // The `_.matches` iteratee shorthand.
  13312. * _.findLastKey(users, { 'age': 36, 'active': true });
  13313. * // => 'barney'
  13314. *
  13315. * // The `_.matchesProperty` iteratee shorthand.
  13316. * _.findLastKey(users, ['active', false]);
  13317. * // => 'fred'
  13318. *
  13319. * // The `_.property` iteratee shorthand.
  13320. * _.findLastKey(users, 'active');
  13321. * // => 'pebbles'
  13322. */
  13323. function findLastKey(object, predicate) {
  13324. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13325. }
  13326. /**
  13327. * Iterates over own and inherited enumerable string keyed properties of an
  13328. * object and invokes `iteratee` for each property. The iteratee is invoked
  13329. * with three arguments: (value, key, object). Iteratee functions may exit
  13330. * iteration early by explicitly returning `false`.
  13331. *
  13332. * @static
  13333. * @memberOf _
  13334. * @since 0.3.0
  13335. * @category Object
  13336. * @param {Object} object The object to iterate over.
  13337. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13338. * @returns {Object} Returns `object`.
  13339. * @see _.forInRight
  13340. * @example
  13341. *
  13342. * function Foo() {
  13343. * this.a = 1;
  13344. * this.b = 2;
  13345. * }
  13346. *
  13347. * Foo.prototype.c = 3;
  13348. *
  13349. * _.forIn(new Foo, function(value, key) {
  13350. * console.log(key);
  13351. * });
  13352. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13353. */
  13354. function forIn(object, iteratee) {
  13355. return object == null
  13356. ? object
  13357. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13358. }
  13359. /**
  13360. * This method is like `_.forIn` except that it iterates over properties of
  13361. * `object` in the opposite order.
  13362. *
  13363. * @static
  13364. * @memberOf _
  13365. * @since 2.0.0
  13366. * @category Object
  13367. * @param {Object} object The object to iterate over.
  13368. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13369. * @returns {Object} Returns `object`.
  13370. * @see _.forIn
  13371. * @example
  13372. *
  13373. * function Foo() {
  13374. * this.a = 1;
  13375. * this.b = 2;
  13376. * }
  13377. *
  13378. * Foo.prototype.c = 3;
  13379. *
  13380. * _.forInRight(new Foo, function(value, key) {
  13381. * console.log(key);
  13382. * });
  13383. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13384. */
  13385. function forInRight(object, iteratee) {
  13386. return object == null
  13387. ? object
  13388. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13389. }
  13390. /**
  13391. * Iterates over own enumerable string keyed properties of an object and
  13392. * invokes `iteratee` for each property. The iteratee is invoked with three
  13393. * arguments: (value, key, object). Iteratee functions may exit iteration
  13394. * early by explicitly returning `false`.
  13395. *
  13396. * @static
  13397. * @memberOf _
  13398. * @since 0.3.0
  13399. * @category Object
  13400. * @param {Object} object The object to iterate over.
  13401. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13402. * @returns {Object} Returns `object`.
  13403. * @see _.forOwnRight
  13404. * @example
  13405. *
  13406. * function Foo() {
  13407. * this.a = 1;
  13408. * this.b = 2;
  13409. * }
  13410. *
  13411. * Foo.prototype.c = 3;
  13412. *
  13413. * _.forOwn(new Foo, function(value, key) {
  13414. * console.log(key);
  13415. * });
  13416. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13417. */
  13418. function forOwn(object, iteratee) {
  13419. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13420. }
  13421. /**
  13422. * This method is like `_.forOwn` except that it iterates over properties of
  13423. * `object` in the opposite order.
  13424. *
  13425. * @static
  13426. * @memberOf _
  13427. * @since 2.0.0
  13428. * @category Object
  13429. * @param {Object} object The object to iterate over.
  13430. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13431. * @returns {Object} Returns `object`.
  13432. * @see _.forOwn
  13433. * @example
  13434. *
  13435. * function Foo() {
  13436. * this.a = 1;
  13437. * this.b = 2;
  13438. * }
  13439. *
  13440. * Foo.prototype.c = 3;
  13441. *
  13442. * _.forOwnRight(new Foo, function(value, key) {
  13443. * console.log(key);
  13444. * });
  13445. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13446. */
  13447. function forOwnRight(object, iteratee) {
  13448. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13449. }
  13450. /**
  13451. * Creates an array of function property names from own enumerable properties
  13452. * of `object`.
  13453. *
  13454. * @static
  13455. * @since 0.1.0
  13456. * @memberOf _
  13457. * @category Object
  13458. * @param {Object} object The object to inspect.
  13459. * @returns {Array} Returns the function names.
  13460. * @see _.functionsIn
  13461. * @example
  13462. *
  13463. * function Foo() {
  13464. * this.a = _.constant('a');
  13465. * this.b = _.constant('b');
  13466. * }
  13467. *
  13468. * Foo.prototype.c = _.constant('c');
  13469. *
  13470. * _.functions(new Foo);
  13471. * // => ['a', 'b']
  13472. */
  13473. function functions(object) {
  13474. return object == null ? [] : baseFunctions(object, keys(object));
  13475. }
  13476. /**
  13477. * Creates an array of function property names from own and inherited
  13478. * enumerable properties of `object`.
  13479. *
  13480. * @static
  13481. * @memberOf _
  13482. * @since 4.0.0
  13483. * @category Object
  13484. * @param {Object} object The object to inspect.
  13485. * @returns {Array} Returns the function names.
  13486. * @see _.functions
  13487. * @example
  13488. *
  13489. * function Foo() {
  13490. * this.a = _.constant('a');
  13491. * this.b = _.constant('b');
  13492. * }
  13493. *
  13494. * Foo.prototype.c = _.constant('c');
  13495. *
  13496. * _.functionsIn(new Foo);
  13497. * // => ['a', 'b', 'c']
  13498. */
  13499. function functionsIn(object) {
  13500. return object == null ? [] : baseFunctions(object, keysIn(object));
  13501. }
  13502. /**
  13503. * Gets the value at `path` of `object`. If the resolved value is
  13504. * `undefined`, the `defaultValue` is returned in its place.
  13505. *
  13506. * @static
  13507. * @memberOf _
  13508. * @since 3.7.0
  13509. * @category Object
  13510. * @param {Object} object The object to query.
  13511. * @param {Array|string} path The path of the property to get.
  13512. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13513. * @returns {*} Returns the resolved value.
  13514. * @example
  13515. *
  13516. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13517. *
  13518. * _.get(object, 'a[0].b.c');
  13519. * // => 3
  13520. *
  13521. * _.get(object, ['a', '0', 'b', 'c']);
  13522. * // => 3
  13523. *
  13524. * _.get(object, 'a.b.c', 'default');
  13525. * // => 'default'
  13526. */
  13527. function get(object, path, defaultValue) {
  13528. var result = object == null ? undefined : baseGet(object, path);
  13529. return result === undefined ? defaultValue : result;
  13530. }
  13531. /**
  13532. * Checks if `path` is a direct property of `object`.
  13533. *
  13534. * @static
  13535. * @since 0.1.0
  13536. * @memberOf _
  13537. * @category Object
  13538. * @param {Object} object The object to query.
  13539. * @param {Array|string} path The path to check.
  13540. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13541. * @example
  13542. *
  13543. * var object = { 'a': { 'b': 2 } };
  13544. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13545. *
  13546. * _.has(object, 'a');
  13547. * // => true
  13548. *
  13549. * _.has(object, 'a.b');
  13550. * // => true
  13551. *
  13552. * _.has(object, ['a', 'b']);
  13553. * // => true
  13554. *
  13555. * _.has(other, 'a');
  13556. * // => false
  13557. */
  13558. function has(object, path) {
  13559. return object != null && hasPath(object, path, baseHas);
  13560. }
  13561. /**
  13562. * Checks if `path` is a direct or inherited property of `object`.
  13563. *
  13564. * @static
  13565. * @memberOf _
  13566. * @since 4.0.0
  13567. * @category Object
  13568. * @param {Object} object The object to query.
  13569. * @param {Array|string} path The path to check.
  13570. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13571. * @example
  13572. *
  13573. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13574. *
  13575. * _.hasIn(object, 'a');
  13576. * // => true
  13577. *
  13578. * _.hasIn(object, 'a.b');
  13579. * // => true
  13580. *
  13581. * _.hasIn(object, ['a', 'b']);
  13582. * // => true
  13583. *
  13584. * _.hasIn(object, 'b');
  13585. * // => false
  13586. */
  13587. function hasIn(object, path) {
  13588. return object != null && hasPath(object, path, baseHasIn);
  13589. }
  13590. /**
  13591. * Creates an object composed of the inverted keys and values of `object`.
  13592. * If `object` contains duplicate values, subsequent values overwrite
  13593. * property assignments of previous values.
  13594. *
  13595. * @static
  13596. * @memberOf _
  13597. * @since 0.7.0
  13598. * @category Object
  13599. * @param {Object} object The object to invert.
  13600. * @returns {Object} Returns the new inverted object.
  13601. * @example
  13602. *
  13603. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13604. *
  13605. * _.invert(object);
  13606. * // => { '1': 'c', '2': 'b' }
  13607. */
  13608. var invert = createInverter(function(result, value, key) {
  13609. if (value != null &&
  13610. typeof value.toString != 'function') {
  13611. value = nativeObjectToString.call(value);
  13612. }
  13613. result[value] = key;
  13614. }, constant(identity));
  13615. /**
  13616. * This method is like `_.invert` except that the inverted object is generated
  13617. * from the results of running each element of `object` thru `iteratee`. The
  13618. * corresponding inverted value of each inverted key is an array of keys
  13619. * responsible for generating the inverted value. The iteratee is invoked
  13620. * with one argument: (value).
  13621. *
  13622. * @static
  13623. * @memberOf _
  13624. * @since 4.1.0
  13625. * @category Object
  13626. * @param {Object} object The object to invert.
  13627. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13628. * @returns {Object} Returns the new inverted object.
  13629. * @example
  13630. *
  13631. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13632. *
  13633. * _.invertBy(object);
  13634. * // => { '1': ['a', 'c'], '2': ['b'] }
  13635. *
  13636. * _.invertBy(object, function(value) {
  13637. * return 'group' + value;
  13638. * });
  13639. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13640. */
  13641. var invertBy = createInverter(function(result, value, key) {
  13642. if (value != null &&
  13643. typeof value.toString != 'function') {
  13644. value = nativeObjectToString.call(value);
  13645. }
  13646. if (hasOwnProperty.call(result, value)) {
  13647. result[value].push(key);
  13648. } else {
  13649. result[value] = [key];
  13650. }
  13651. }, getIteratee);
  13652. /**
  13653. * Invokes the method at `path` of `object`.
  13654. *
  13655. * @static
  13656. * @memberOf _
  13657. * @since 4.0.0
  13658. * @category Object
  13659. * @param {Object} object The object to query.
  13660. * @param {Array|string} path The path of the method to invoke.
  13661. * @param {...*} [args] The arguments to invoke the method with.
  13662. * @returns {*} Returns the result of the invoked method.
  13663. * @example
  13664. *
  13665. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13666. *
  13667. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13668. * // => [2, 3]
  13669. */
  13670. var invoke = baseRest(baseInvoke);
  13671. /**
  13672. * Creates an array of the own enumerable property names of `object`.
  13673. *
  13674. * **Note:** Non-object values are coerced to objects. See the
  13675. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13676. * for more details.
  13677. *
  13678. * @static
  13679. * @since 0.1.0
  13680. * @memberOf _
  13681. * @category Object
  13682. * @param {Object} object The object to query.
  13683. * @returns {Array} Returns the array of property names.
  13684. * @example
  13685. *
  13686. * function Foo() {
  13687. * this.a = 1;
  13688. * this.b = 2;
  13689. * }
  13690. *
  13691. * Foo.prototype.c = 3;
  13692. *
  13693. * _.keys(new Foo);
  13694. * // => ['a', 'b'] (iteration order is not guaranteed)
  13695. *
  13696. * _.keys('hi');
  13697. * // => ['0', '1']
  13698. */
  13699. function keys(object) {
  13700. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13701. }
  13702. /**
  13703. * Creates an array of the own and inherited enumerable property names of `object`.
  13704. *
  13705. * **Note:** Non-object values are coerced to objects.
  13706. *
  13707. * @static
  13708. * @memberOf _
  13709. * @since 3.0.0
  13710. * @category Object
  13711. * @param {Object} object The object to query.
  13712. * @returns {Array} Returns the array of property names.
  13713. * @example
  13714. *
  13715. * function Foo() {
  13716. * this.a = 1;
  13717. * this.b = 2;
  13718. * }
  13719. *
  13720. * Foo.prototype.c = 3;
  13721. *
  13722. * _.keysIn(new Foo);
  13723. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13724. */
  13725. function keysIn(object) {
  13726. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13727. }
  13728. /**
  13729. * The opposite of `_.mapValues`; this method creates an object with the
  13730. * same values as `object` and keys generated by running each own enumerable
  13731. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13732. * with three arguments: (value, key, object).
  13733. *
  13734. * @static
  13735. * @memberOf _
  13736. * @since 3.8.0
  13737. * @category Object
  13738. * @param {Object} object The object to iterate over.
  13739. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13740. * @returns {Object} Returns the new mapped object.
  13741. * @see _.mapValues
  13742. * @example
  13743. *
  13744. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13745. * return key + value;
  13746. * });
  13747. * // => { 'a1': 1, 'b2': 2 }
  13748. */
  13749. function mapKeys(object, iteratee) {
  13750. var result = {};
  13751. iteratee = getIteratee(iteratee, 3);
  13752. baseForOwn(object, function(value, key, object) {
  13753. baseAssignValue(result, iteratee(value, key, object), value);
  13754. });
  13755. return result;
  13756. }
  13757. /**
  13758. * Creates an object with the same keys as `object` and values generated
  13759. * by running each own enumerable string keyed property of `object` thru
  13760. * `iteratee`. The iteratee is invoked with three arguments:
  13761. * (value, key, object).
  13762. *
  13763. * @static
  13764. * @memberOf _
  13765. * @since 2.4.0
  13766. * @category Object
  13767. * @param {Object} object The object to iterate over.
  13768. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13769. * @returns {Object} Returns the new mapped object.
  13770. * @see _.mapKeys
  13771. * @example
  13772. *
  13773. * var users = {
  13774. * 'fred': { 'user': 'fred', 'age': 40 },
  13775. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13776. * };
  13777. *
  13778. * _.mapValues(users, function(o) { return o.age; });
  13779. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13780. *
  13781. * // The `_.property` iteratee shorthand.
  13782. * _.mapValues(users, 'age');
  13783. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13784. */
  13785. function mapValues(object, iteratee) {
  13786. var result = {};
  13787. iteratee = getIteratee(iteratee, 3);
  13788. baseForOwn(object, function(value, key, object) {
  13789. baseAssignValue(result, key, iteratee(value, key, object));
  13790. });
  13791. return result;
  13792. }
  13793. /**
  13794. * This method is like `_.assign` except that it recursively merges own and
  13795. * inherited enumerable string keyed properties of source objects into the
  13796. * destination object. Source properties that resolve to `undefined` are
  13797. * skipped if a destination value exists. Array and plain object properties
  13798. * are merged recursively. Other objects and value types are overridden by
  13799. * assignment. Source objects are applied from left to right. Subsequent
  13800. * sources overwrite property assignments of previous sources.
  13801. *
  13802. * **Note:** This method mutates `object`.
  13803. *
  13804. * @static
  13805. * @memberOf _
  13806. * @since 0.5.0
  13807. * @category Object
  13808. * @param {Object} object The destination object.
  13809. * @param {...Object} [sources] The source objects.
  13810. * @returns {Object} Returns `object`.
  13811. * @example
  13812. *
  13813. * var object = {
  13814. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13815. * };
  13816. *
  13817. * var other = {
  13818. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13819. * };
  13820. *
  13821. * _.merge(object, other);
  13822. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13823. */
  13824. var merge = createAssigner(function(object, source, srcIndex) {
  13825. baseMerge(object, source, srcIndex);
  13826. });
  13827. /**
  13828. * This method is like `_.merge` except that it accepts `customizer` which
  13829. * is invoked to produce the merged values of the destination and source
  13830. * properties. If `customizer` returns `undefined`, merging is handled by the
  13831. * method instead. The `customizer` is invoked with six arguments:
  13832. * (objValue, srcValue, key, object, source, stack).
  13833. *
  13834. * **Note:** This method mutates `object`.
  13835. *
  13836. * @static
  13837. * @memberOf _
  13838. * @since 4.0.0
  13839. * @category Object
  13840. * @param {Object} object The destination object.
  13841. * @param {...Object} sources The source objects.
  13842. * @param {Function} customizer The function to customize assigned values.
  13843. * @returns {Object} Returns `object`.
  13844. * @example
  13845. *
  13846. * function customizer(objValue, srcValue) {
  13847. * if (_.isArray(objValue)) {
  13848. * return objValue.concat(srcValue);
  13849. * }
  13850. * }
  13851. *
  13852. * var object = { 'a': [1], 'b': [2] };
  13853. * var other = { 'a': [3], 'b': [4] };
  13854. *
  13855. * _.mergeWith(object, other, customizer);
  13856. * // => { 'a': [1, 3], 'b': [2, 4] }
  13857. */
  13858. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13859. baseMerge(object, source, srcIndex, customizer);
  13860. });
  13861. /**
  13862. * The opposite of `_.pick`; this method creates an object composed of the
  13863. * own and inherited enumerable property paths of `object` that are not omitted.
  13864. *
  13865. * **Note:** This method is considerably slower than `_.pick`.
  13866. *
  13867. * @static
  13868. * @since 0.1.0
  13869. * @memberOf _
  13870. * @category Object
  13871. * @param {Object} object The source object.
  13872. * @param {...(string|string[])} [paths] The property paths to omit.
  13873. * @returns {Object} Returns the new object.
  13874. * @example
  13875. *
  13876. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13877. *
  13878. * _.omit(object, ['a', 'c']);
  13879. * // => { 'b': '2' }
  13880. */
  13881. var omit = flatRest(function(object, paths) {
  13882. var result = {};
  13883. if (object == null) {
  13884. return result;
  13885. }
  13886. var isDeep = false;
  13887. paths = arrayMap(paths, function(path) {
  13888. path = castPath(path, object);
  13889. isDeep || (isDeep = path.length > 1);
  13890. return path;
  13891. });
  13892. copyObject(object, getAllKeysIn(object), result);
  13893. if (isDeep) {
  13894. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13895. }
  13896. var length = paths.length;
  13897. while (length--) {
  13898. baseUnset(result, paths[length]);
  13899. }
  13900. return result;
  13901. });
  13902. /**
  13903. * The opposite of `_.pickBy`; this method creates an object composed of
  13904. * the own and inherited enumerable string keyed properties of `object` that
  13905. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13906. * arguments: (value, key).
  13907. *
  13908. * @static
  13909. * @memberOf _
  13910. * @since 4.0.0
  13911. * @category Object
  13912. * @param {Object} object The source object.
  13913. * @param {Function} [predicate=_.identity] The function invoked per property.
  13914. * @returns {Object} Returns the new object.
  13915. * @example
  13916. *
  13917. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13918. *
  13919. * _.omitBy(object, _.isNumber);
  13920. * // => { 'b': '2' }
  13921. */
  13922. function omitBy(object, predicate) {
  13923. return pickBy(object, negate(getIteratee(predicate)));
  13924. }
  13925. /**
  13926. * Creates an object composed of the picked `object` properties.
  13927. *
  13928. * @static
  13929. * @since 0.1.0
  13930. * @memberOf _
  13931. * @category Object
  13932. * @param {Object} object The source object.
  13933. * @param {...(string|string[])} [paths] The property paths to pick.
  13934. * @returns {Object} Returns the new object.
  13935. * @example
  13936. *
  13937. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13938. *
  13939. * _.pick(object, ['a', 'c']);
  13940. * // => { 'a': 1, 'c': 3 }
  13941. */
  13942. var pick = flatRest(function(object, paths) {
  13943. return object == null ? {} : basePick(object, paths);
  13944. });
  13945. /**
  13946. * Creates an object composed of the `object` properties `predicate` returns
  13947. * truthy for. The predicate is invoked with two arguments: (value, key).
  13948. *
  13949. * @static
  13950. * @memberOf _
  13951. * @since 4.0.0
  13952. * @category Object
  13953. * @param {Object} object The source object.
  13954. * @param {Function} [predicate=_.identity] The function invoked per property.
  13955. * @returns {Object} Returns the new object.
  13956. * @example
  13957. *
  13958. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13959. *
  13960. * _.pickBy(object, _.isNumber);
  13961. * // => { 'a': 1, 'c': 3 }
  13962. */
  13963. function pickBy(object, predicate) {
  13964. if (object == null) {
  13965. return {};
  13966. }
  13967. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13968. return [prop];
  13969. });
  13970. predicate = getIteratee(predicate);
  13971. return basePickBy(object, props, function(value, path) {
  13972. return predicate(value, path[0]);
  13973. });
  13974. }
  13975. /**
  13976. * This method is like `_.get` except that if the resolved value is a
  13977. * function it's invoked with the `this` binding of its parent object and
  13978. * its result is returned.
  13979. *
  13980. * @static
  13981. * @since 0.1.0
  13982. * @memberOf _
  13983. * @category Object
  13984. * @param {Object} object The object to query.
  13985. * @param {Array|string} path The path of the property to resolve.
  13986. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13987. * @returns {*} Returns the resolved value.
  13988. * @example
  13989. *
  13990. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13991. *
  13992. * _.result(object, 'a[0].b.c1');
  13993. * // => 3
  13994. *
  13995. * _.result(object, 'a[0].b.c2');
  13996. * // => 4
  13997. *
  13998. * _.result(object, 'a[0].b.c3', 'default');
  13999. * // => 'default'
  14000. *
  14001. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14002. * // => 'default'
  14003. */
  14004. function result(object, path, defaultValue) {
  14005. path = castPath(path, object);
  14006. var index = -1,
  14007. length = path.length;
  14008. // Ensure the loop is entered when path is empty.
  14009. if (!length) {
  14010. length = 1;
  14011. object = undefined;
  14012. }
  14013. while (++index < length) {
  14014. var value = object == null ? undefined : object[toKey(path[index])];
  14015. if (value === undefined) {
  14016. index = length;
  14017. value = defaultValue;
  14018. }
  14019. object = isFunction(value) ? value.call(object) : value;
  14020. }
  14021. return object;
  14022. }
  14023. /**
  14024. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14025. * it's created. Arrays are created for missing index properties while objects
  14026. * are created for all other missing properties. Use `_.setWith` to customize
  14027. * `path` creation.
  14028. *
  14029. * **Note:** This method mutates `object`.
  14030. *
  14031. * @static
  14032. * @memberOf _
  14033. * @since 3.7.0
  14034. * @category Object
  14035. * @param {Object} object The object to modify.
  14036. * @param {Array|string} path The path of the property to set.
  14037. * @param {*} value The value to set.
  14038. * @returns {Object} Returns `object`.
  14039. * @example
  14040. *
  14041. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14042. *
  14043. * _.set(object, 'a[0].b.c', 4);
  14044. * console.log(object.a[0].b.c);
  14045. * // => 4
  14046. *
  14047. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14048. * console.log(object.x[0].y.z);
  14049. * // => 5
  14050. */
  14051. function set(object, path, value) {
  14052. return object == null ? object : baseSet(object, path, value);
  14053. }
  14054. /**
  14055. * This method is like `_.set` except that it accepts `customizer` which is
  14056. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14057. * path creation is handled by the method instead. The `customizer` is invoked
  14058. * with three arguments: (nsValue, key, nsObject).
  14059. *
  14060. * **Note:** This method mutates `object`.
  14061. *
  14062. * @static
  14063. * @memberOf _
  14064. * @since 4.0.0
  14065. * @category Object
  14066. * @param {Object} object The object to modify.
  14067. * @param {Array|string} path The path of the property to set.
  14068. * @param {*} value The value to set.
  14069. * @param {Function} [customizer] The function to customize assigned values.
  14070. * @returns {Object} Returns `object`.
  14071. * @example
  14072. *
  14073. * var object = {};
  14074. *
  14075. * _.setWith(object, '[0][1]', 'a', Object);
  14076. * // => { '0': { '1': 'a' } }
  14077. */
  14078. function setWith(object, path, value, customizer) {
  14079. customizer = typeof customizer == 'function' ? customizer : undefined;
  14080. return object == null ? object : baseSet(object, path, value, customizer);
  14081. }
  14082. /**
  14083. * Creates an array of own enumerable string keyed-value pairs for `object`
  14084. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14085. * entries are returned.
  14086. *
  14087. * @static
  14088. * @memberOf _
  14089. * @since 4.0.0
  14090. * @alias entries
  14091. * @category Object
  14092. * @param {Object} object The object to query.
  14093. * @returns {Array} Returns the key-value pairs.
  14094. * @example
  14095. *
  14096. * function Foo() {
  14097. * this.a = 1;
  14098. * this.b = 2;
  14099. * }
  14100. *
  14101. * Foo.prototype.c = 3;
  14102. *
  14103. * _.toPairs(new Foo);
  14104. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14105. */
  14106. var toPairs = createToPairs(keys);
  14107. /**
  14108. * Creates an array of own and inherited enumerable string keyed-value pairs
  14109. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14110. * or set, its entries are returned.
  14111. *
  14112. * @static
  14113. * @memberOf _
  14114. * @since 4.0.0
  14115. * @alias entriesIn
  14116. * @category Object
  14117. * @param {Object} object The object to query.
  14118. * @returns {Array} Returns the key-value pairs.
  14119. * @example
  14120. *
  14121. * function Foo() {
  14122. * this.a = 1;
  14123. * this.b = 2;
  14124. * }
  14125. *
  14126. * Foo.prototype.c = 3;
  14127. *
  14128. * _.toPairsIn(new Foo);
  14129. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14130. */
  14131. var toPairsIn = createToPairs(keysIn);
  14132. /**
  14133. * An alternative to `_.reduce`; this method transforms `object` to a new
  14134. * `accumulator` object which is the result of running each of its own
  14135. * enumerable string keyed properties thru `iteratee`, with each invocation
  14136. * potentially mutating the `accumulator` object. If `accumulator` is not
  14137. * provided, a new object with the same `[[Prototype]]` will be used. The
  14138. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14139. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14140. *
  14141. * @static
  14142. * @memberOf _
  14143. * @since 1.3.0
  14144. * @category Object
  14145. * @param {Object} object The object to iterate over.
  14146. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14147. * @param {*} [accumulator] The custom accumulator value.
  14148. * @returns {*} Returns the accumulated value.
  14149. * @example
  14150. *
  14151. * _.transform([2, 3, 4], function(result, n) {
  14152. * result.push(n *= n);
  14153. * return n % 2 == 0;
  14154. * }, []);
  14155. * // => [4, 9]
  14156. *
  14157. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14158. * (result[value] || (result[value] = [])).push(key);
  14159. * }, {});
  14160. * // => { '1': ['a', 'c'], '2': ['b'] }
  14161. */
  14162. function transform(object, iteratee, accumulator) {
  14163. var isArr = isArray(object),
  14164. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14165. iteratee = getIteratee(iteratee, 4);
  14166. if (accumulator == null) {
  14167. var Ctor = object && object.constructor;
  14168. if (isArrLike) {
  14169. accumulator = isArr ? new Ctor : [];
  14170. }
  14171. else if (isObject(object)) {
  14172. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14173. }
  14174. else {
  14175. accumulator = {};
  14176. }
  14177. }
  14178. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14179. return iteratee(accumulator, value, index, object);
  14180. });
  14181. return accumulator;
  14182. }
  14183. /**
  14184. * Removes the property at `path` of `object`.
  14185. *
  14186. * **Note:** This method mutates `object`.
  14187. *
  14188. * @static
  14189. * @memberOf _
  14190. * @since 4.0.0
  14191. * @category Object
  14192. * @param {Object} object The object to modify.
  14193. * @param {Array|string} path The path of the property to unset.
  14194. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14195. * @example
  14196. *
  14197. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14198. * _.unset(object, 'a[0].b.c');
  14199. * // => true
  14200. *
  14201. * console.log(object);
  14202. * // => { 'a': [{ 'b': {} }] };
  14203. *
  14204. * _.unset(object, ['a', '0', 'b', 'c']);
  14205. * // => true
  14206. *
  14207. * console.log(object);
  14208. * // => { 'a': [{ 'b': {} }] };
  14209. */
  14210. function unset(object, path) {
  14211. return object == null ? true : baseUnset(object, path);
  14212. }
  14213. /**
  14214. * This method is like `_.set` except that accepts `updater` to produce the
  14215. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14216. * is invoked with one argument: (value).
  14217. *
  14218. * **Note:** This method mutates `object`.
  14219. *
  14220. * @static
  14221. * @memberOf _
  14222. * @since 4.6.0
  14223. * @category Object
  14224. * @param {Object} object The object to modify.
  14225. * @param {Array|string} path The path of the property to set.
  14226. * @param {Function} updater The function to produce the updated value.
  14227. * @returns {Object} Returns `object`.
  14228. * @example
  14229. *
  14230. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14231. *
  14232. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14233. * console.log(object.a[0].b.c);
  14234. * // => 9
  14235. *
  14236. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14237. * console.log(object.x[0].y.z);
  14238. * // => 0
  14239. */
  14240. function update(object, path, updater) {
  14241. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14242. }
  14243. /**
  14244. * This method is like `_.update` except that it accepts `customizer` which is
  14245. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14246. * path creation is handled by the method instead. The `customizer` is invoked
  14247. * with three arguments: (nsValue, key, nsObject).
  14248. *
  14249. * **Note:** This method mutates `object`.
  14250. *
  14251. * @static
  14252. * @memberOf _
  14253. * @since 4.6.0
  14254. * @category Object
  14255. * @param {Object} object The object to modify.
  14256. * @param {Array|string} path The path of the property to set.
  14257. * @param {Function} updater The function to produce the updated value.
  14258. * @param {Function} [customizer] The function to customize assigned values.
  14259. * @returns {Object} Returns `object`.
  14260. * @example
  14261. *
  14262. * var object = {};
  14263. *
  14264. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14265. * // => { '0': { '1': 'a' } }
  14266. */
  14267. function updateWith(object, path, updater, customizer) {
  14268. customizer = typeof customizer == 'function' ? customizer : undefined;
  14269. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14270. }
  14271. /**
  14272. * Creates an array of the own enumerable string keyed property values of `object`.
  14273. *
  14274. * **Note:** Non-object values are coerced to objects.
  14275. *
  14276. * @static
  14277. * @since 0.1.0
  14278. * @memberOf _
  14279. * @category Object
  14280. * @param {Object} object The object to query.
  14281. * @returns {Array} Returns the array of property values.
  14282. * @example
  14283. *
  14284. * function Foo() {
  14285. * this.a = 1;
  14286. * this.b = 2;
  14287. * }
  14288. *
  14289. * Foo.prototype.c = 3;
  14290. *
  14291. * _.values(new Foo);
  14292. * // => [1, 2] (iteration order is not guaranteed)
  14293. *
  14294. * _.values('hi');
  14295. * // => ['h', 'i']
  14296. */
  14297. function values(object) {
  14298. return object == null ? [] : baseValues(object, keys(object));
  14299. }
  14300. /**
  14301. * Creates an array of the own and inherited enumerable string keyed property
  14302. * values of `object`.
  14303. *
  14304. * **Note:** Non-object values are coerced to objects.
  14305. *
  14306. * @static
  14307. * @memberOf _
  14308. * @since 3.0.0
  14309. * @category Object
  14310. * @param {Object} object The object to query.
  14311. * @returns {Array} Returns the array of property values.
  14312. * @example
  14313. *
  14314. * function Foo() {
  14315. * this.a = 1;
  14316. * this.b = 2;
  14317. * }
  14318. *
  14319. * Foo.prototype.c = 3;
  14320. *
  14321. * _.valuesIn(new Foo);
  14322. * // => [1, 2, 3] (iteration order is not guaranteed)
  14323. */
  14324. function valuesIn(object) {
  14325. return object == null ? [] : baseValues(object, keysIn(object));
  14326. }
  14327. /*------------------------------------------------------------------------*/
  14328. /**
  14329. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14330. *
  14331. * @static
  14332. * @memberOf _
  14333. * @since 4.0.0
  14334. * @category Number
  14335. * @param {number} number The number to clamp.
  14336. * @param {number} [lower] The lower bound.
  14337. * @param {number} upper The upper bound.
  14338. * @returns {number} Returns the clamped number.
  14339. * @example
  14340. *
  14341. * _.clamp(-10, -5, 5);
  14342. * // => -5
  14343. *
  14344. * _.clamp(10, -5, 5);
  14345. * // => 5
  14346. */
  14347. function clamp(number, lower, upper) {
  14348. if (upper === undefined) {
  14349. upper = lower;
  14350. lower = undefined;
  14351. }
  14352. if (upper !== undefined) {
  14353. upper = toNumber(upper);
  14354. upper = upper === upper ? upper : 0;
  14355. }
  14356. if (lower !== undefined) {
  14357. lower = toNumber(lower);
  14358. lower = lower === lower ? lower : 0;
  14359. }
  14360. return baseClamp(toNumber(number), lower, upper);
  14361. }
  14362. /**
  14363. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14364. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14365. * If `start` is greater than `end` the params are swapped to support
  14366. * negative ranges.
  14367. *
  14368. * @static
  14369. * @memberOf _
  14370. * @since 3.3.0
  14371. * @category Number
  14372. * @param {number} number The number to check.
  14373. * @param {number} [start=0] The start of the range.
  14374. * @param {number} end The end of the range.
  14375. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14376. * @see _.range, _.rangeRight
  14377. * @example
  14378. *
  14379. * _.inRange(3, 2, 4);
  14380. * // => true
  14381. *
  14382. * _.inRange(4, 8);
  14383. * // => true
  14384. *
  14385. * _.inRange(4, 2);
  14386. * // => false
  14387. *
  14388. * _.inRange(2, 2);
  14389. * // => false
  14390. *
  14391. * _.inRange(1.2, 2);
  14392. * // => true
  14393. *
  14394. * _.inRange(5.2, 4);
  14395. * // => false
  14396. *
  14397. * _.inRange(-3, -2, -6);
  14398. * // => true
  14399. */
  14400. function inRange(number, start, end) {
  14401. start = toFinite(start);
  14402. if (end === undefined) {
  14403. end = start;
  14404. start = 0;
  14405. } else {
  14406. end = toFinite(end);
  14407. }
  14408. number = toNumber(number);
  14409. return baseInRange(number, start, end);
  14410. }
  14411. /**
  14412. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14413. * If only one argument is provided a number between `0` and the given number
  14414. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14415. * floats, a floating-point number is returned instead of an integer.
  14416. *
  14417. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14418. * floating-point values which can produce unexpected results.
  14419. *
  14420. * @static
  14421. * @memberOf _
  14422. * @since 0.7.0
  14423. * @category Number
  14424. * @param {number} [lower=0] The lower bound.
  14425. * @param {number} [upper=1] The upper bound.
  14426. * @param {boolean} [floating] Specify returning a floating-point number.
  14427. * @returns {number} Returns the random number.
  14428. * @example
  14429. *
  14430. * _.random(0, 5);
  14431. * // => an integer between 0 and 5
  14432. *
  14433. * _.random(5);
  14434. * // => also an integer between 0 and 5
  14435. *
  14436. * _.random(5, true);
  14437. * // => a floating-point number between 0 and 5
  14438. *
  14439. * _.random(1.2, 5.2);
  14440. * // => a floating-point number between 1.2 and 5.2
  14441. */
  14442. function random(lower, upper, floating) {
  14443. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14444. upper = floating = undefined;
  14445. }
  14446. if (floating === undefined) {
  14447. if (typeof upper == 'boolean') {
  14448. floating = upper;
  14449. upper = undefined;
  14450. }
  14451. else if (typeof lower == 'boolean') {
  14452. floating = lower;
  14453. lower = undefined;
  14454. }
  14455. }
  14456. if (lower === undefined && upper === undefined) {
  14457. lower = 0;
  14458. upper = 1;
  14459. }
  14460. else {
  14461. lower = toFinite(lower);
  14462. if (upper === undefined) {
  14463. upper = lower;
  14464. lower = 0;
  14465. } else {
  14466. upper = toFinite(upper);
  14467. }
  14468. }
  14469. if (lower > upper) {
  14470. var temp = lower;
  14471. lower = upper;
  14472. upper = temp;
  14473. }
  14474. if (floating || lower % 1 || upper % 1) {
  14475. var rand = nativeRandom();
  14476. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14477. }
  14478. return baseRandom(lower, upper);
  14479. }
  14480. /*------------------------------------------------------------------------*/
  14481. /**
  14482. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14483. *
  14484. * @static
  14485. * @memberOf _
  14486. * @since 3.0.0
  14487. * @category String
  14488. * @param {string} [string=''] The string to convert.
  14489. * @returns {string} Returns the camel cased string.
  14490. * @example
  14491. *
  14492. * _.camelCase('Foo Bar');
  14493. * // => 'fooBar'
  14494. *
  14495. * _.camelCase('--foo-bar--');
  14496. * // => 'fooBar'
  14497. *
  14498. * _.camelCase('__FOO_BAR__');
  14499. * // => 'fooBar'
  14500. */
  14501. var camelCase = createCompounder(function(result, word, index) {
  14502. word = word.toLowerCase();
  14503. return result + (index ? capitalize(word) : word);
  14504. });
  14505. /**
  14506. * Converts the first character of `string` to upper case and the remaining
  14507. * to lower case.
  14508. *
  14509. * @static
  14510. * @memberOf _
  14511. * @since 3.0.0
  14512. * @category String
  14513. * @param {string} [string=''] The string to capitalize.
  14514. * @returns {string} Returns the capitalized string.
  14515. * @example
  14516. *
  14517. * _.capitalize('FRED');
  14518. * // => 'Fred'
  14519. */
  14520. function capitalize(string) {
  14521. return upperFirst(toString(string).toLowerCase());
  14522. }
  14523. /**
  14524. * Deburrs `string` by converting
  14525. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14526. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14527. * letters to basic Latin letters and removing
  14528. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14529. *
  14530. * @static
  14531. * @memberOf _
  14532. * @since 3.0.0
  14533. * @category String
  14534. * @param {string} [string=''] The string to deburr.
  14535. * @returns {string} Returns the deburred string.
  14536. * @example
  14537. *
  14538. * _.deburr('déjà vu');
  14539. * // => 'deja vu'
  14540. */
  14541. function deburr(string) {
  14542. string = toString(string);
  14543. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14544. }
  14545. /**
  14546. * Checks if `string` ends with the given target string.
  14547. *
  14548. * @static
  14549. * @memberOf _
  14550. * @since 3.0.0
  14551. * @category String
  14552. * @param {string} [string=''] The string to inspect.
  14553. * @param {string} [target] The string to search for.
  14554. * @param {number} [position=string.length] The position to search up to.
  14555. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14556. * else `false`.
  14557. * @example
  14558. *
  14559. * _.endsWith('abc', 'c');
  14560. * // => true
  14561. *
  14562. * _.endsWith('abc', 'b');
  14563. * // => false
  14564. *
  14565. * _.endsWith('abc', 'b', 2);
  14566. * // => true
  14567. */
  14568. function endsWith(string, target, position) {
  14569. string = toString(string);
  14570. target = baseToString(target);
  14571. var length = string.length;
  14572. position = position === undefined
  14573. ? length
  14574. : baseClamp(toInteger(position), 0, length);
  14575. var end = position;
  14576. position -= target.length;
  14577. return position >= 0 && string.slice(position, end) == target;
  14578. }
  14579. /**
  14580. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14581. * corresponding HTML entities.
  14582. *
  14583. * **Note:** No other characters are escaped. To escape additional
  14584. * characters use a third-party library like [_he_](https://mths.be/he).
  14585. *
  14586. * Though the ">" character is escaped for symmetry, characters like
  14587. * ">" and "/" don't need escaping in HTML and have no special meaning
  14588. * unless they're part of a tag or unquoted attribute value. See
  14589. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14590. * (under "semi-related fun fact") for more details.
  14591. *
  14592. * When working with HTML you should always
  14593. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14594. * XSS vectors.
  14595. *
  14596. * @static
  14597. * @since 0.1.0
  14598. * @memberOf _
  14599. * @category String
  14600. * @param {string} [string=''] The string to escape.
  14601. * @returns {string} Returns the escaped string.
  14602. * @example
  14603. *
  14604. * _.escape('fred, barney, & pebbles');
  14605. * // => 'fred, barney, &amp; pebbles'
  14606. */
  14607. function escape(string) {
  14608. string = toString(string);
  14609. return (string && reHasUnescapedHtml.test(string))
  14610. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14611. : string;
  14612. }
  14613. /**
  14614. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14615. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14616. *
  14617. * @static
  14618. * @memberOf _
  14619. * @since 3.0.0
  14620. * @category String
  14621. * @param {string} [string=''] The string to escape.
  14622. * @returns {string} Returns the escaped string.
  14623. * @example
  14624. *
  14625. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14626. * // => '\[lodash\]\(https://lodash\.com/\)'
  14627. */
  14628. function escapeRegExp(string) {
  14629. string = toString(string);
  14630. return (string && reHasRegExpChar.test(string))
  14631. ? string.replace(reRegExpChar, '\\$&')
  14632. : string;
  14633. }
  14634. /**
  14635. * Converts `string` to
  14636. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14637. *
  14638. * @static
  14639. * @memberOf _
  14640. * @since 3.0.0
  14641. * @category String
  14642. * @param {string} [string=''] The string to convert.
  14643. * @returns {string} Returns the kebab cased string.
  14644. * @example
  14645. *
  14646. * _.kebabCase('Foo Bar');
  14647. * // => 'foo-bar'
  14648. *
  14649. * _.kebabCase('fooBar');
  14650. * // => 'foo-bar'
  14651. *
  14652. * _.kebabCase('__FOO_BAR__');
  14653. * // => 'foo-bar'
  14654. */
  14655. var kebabCase = createCompounder(function(result, word, index) {
  14656. return result + (index ? '-' : '') + word.toLowerCase();
  14657. });
  14658. /**
  14659. * Converts `string`, as space separated words, to lower case.
  14660. *
  14661. * @static
  14662. * @memberOf _
  14663. * @since 4.0.0
  14664. * @category String
  14665. * @param {string} [string=''] The string to convert.
  14666. * @returns {string} Returns the lower cased string.
  14667. * @example
  14668. *
  14669. * _.lowerCase('--Foo-Bar--');
  14670. * // => 'foo bar'
  14671. *
  14672. * _.lowerCase('fooBar');
  14673. * // => 'foo bar'
  14674. *
  14675. * _.lowerCase('__FOO_BAR__');
  14676. * // => 'foo bar'
  14677. */
  14678. var lowerCase = createCompounder(function(result, word, index) {
  14679. return result + (index ? ' ' : '') + word.toLowerCase();
  14680. });
  14681. /**
  14682. * Converts the first character of `string` to lower case.
  14683. *
  14684. * @static
  14685. * @memberOf _
  14686. * @since 4.0.0
  14687. * @category String
  14688. * @param {string} [string=''] The string to convert.
  14689. * @returns {string} Returns the converted string.
  14690. * @example
  14691. *
  14692. * _.lowerFirst('Fred');
  14693. * // => 'fred'
  14694. *
  14695. * _.lowerFirst('FRED');
  14696. * // => 'fRED'
  14697. */
  14698. var lowerFirst = createCaseFirst('toLowerCase');
  14699. /**
  14700. * Pads `string` on the left and right sides if it's shorter than `length`.
  14701. * Padding characters are truncated if they can't be evenly divided by `length`.
  14702. *
  14703. * @static
  14704. * @memberOf _
  14705. * @since 3.0.0
  14706. * @category String
  14707. * @param {string} [string=''] The string to pad.
  14708. * @param {number} [length=0] The padding length.
  14709. * @param {string} [chars=' '] The string used as padding.
  14710. * @returns {string} Returns the padded string.
  14711. * @example
  14712. *
  14713. * _.pad('abc', 8);
  14714. * // => ' abc '
  14715. *
  14716. * _.pad('abc', 8, '_-');
  14717. * // => '_-abc_-_'
  14718. *
  14719. * _.pad('abc', 3);
  14720. * // => 'abc'
  14721. */
  14722. function pad(string, length, chars) {
  14723. string = toString(string);
  14724. length = toInteger(length);
  14725. var strLength = length ? stringSize(string) : 0;
  14726. if (!length || strLength >= length) {
  14727. return string;
  14728. }
  14729. var mid = (length - strLength) / 2;
  14730. return (
  14731. createPadding(nativeFloor(mid), chars) +
  14732. string +
  14733. createPadding(nativeCeil(mid), chars)
  14734. );
  14735. }
  14736. /**
  14737. * Pads `string` on the right side if it's shorter than `length`. Padding
  14738. * characters are truncated if they exceed `length`.
  14739. *
  14740. * @static
  14741. * @memberOf _
  14742. * @since 4.0.0
  14743. * @category String
  14744. * @param {string} [string=''] The string to pad.
  14745. * @param {number} [length=0] The padding length.
  14746. * @param {string} [chars=' '] The string used as padding.
  14747. * @returns {string} Returns the padded string.
  14748. * @example
  14749. *
  14750. * _.padEnd('abc', 6);
  14751. * // => 'abc '
  14752. *
  14753. * _.padEnd('abc', 6, '_-');
  14754. * // => 'abc_-_'
  14755. *
  14756. * _.padEnd('abc', 3);
  14757. * // => 'abc'
  14758. */
  14759. function padEnd(string, length, chars) {
  14760. string = toString(string);
  14761. length = toInteger(length);
  14762. var strLength = length ? stringSize(string) : 0;
  14763. return (length && strLength < length)
  14764. ? (string + createPadding(length - strLength, chars))
  14765. : string;
  14766. }
  14767. /**
  14768. * Pads `string` on the left side if it's shorter than `length`. Padding
  14769. * characters are truncated if they exceed `length`.
  14770. *
  14771. * @static
  14772. * @memberOf _
  14773. * @since 4.0.0
  14774. * @category String
  14775. * @param {string} [string=''] The string to pad.
  14776. * @param {number} [length=0] The padding length.
  14777. * @param {string} [chars=' '] The string used as padding.
  14778. * @returns {string} Returns the padded string.
  14779. * @example
  14780. *
  14781. * _.padStart('abc', 6);
  14782. * // => ' abc'
  14783. *
  14784. * _.padStart('abc', 6, '_-');
  14785. * // => '_-_abc'
  14786. *
  14787. * _.padStart('abc', 3);
  14788. * // => 'abc'
  14789. */
  14790. function padStart(string, length, chars) {
  14791. string = toString(string);
  14792. length = toInteger(length);
  14793. var strLength = length ? stringSize(string) : 0;
  14794. return (length && strLength < length)
  14795. ? (createPadding(length - strLength, chars) + string)
  14796. : string;
  14797. }
  14798. /**
  14799. * Converts `string` to an integer of the specified radix. If `radix` is
  14800. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14801. * hexadecimal, in which case a `radix` of `16` is used.
  14802. *
  14803. * **Note:** This method aligns with the
  14804. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14805. *
  14806. * @static
  14807. * @memberOf _
  14808. * @since 1.1.0
  14809. * @category String
  14810. * @param {string} string The string to convert.
  14811. * @param {number} [radix=10] The radix to interpret `value` by.
  14812. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14813. * @returns {number} Returns the converted integer.
  14814. * @example
  14815. *
  14816. * _.parseInt('08');
  14817. * // => 8
  14818. *
  14819. * _.map(['6', '08', '10'], _.parseInt);
  14820. * // => [6, 8, 10]
  14821. */
  14822. function parseInt(string, radix, guard) {
  14823. if (guard || radix == null) {
  14824. radix = 0;
  14825. } else if (radix) {
  14826. radix = +radix;
  14827. }
  14828. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14829. }
  14830. /**
  14831. * Repeats the given string `n` times.
  14832. *
  14833. * @static
  14834. * @memberOf _
  14835. * @since 3.0.0
  14836. * @category String
  14837. * @param {string} [string=''] The string to repeat.
  14838. * @param {number} [n=1] The number of times to repeat the string.
  14839. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14840. * @returns {string} Returns the repeated string.
  14841. * @example
  14842. *
  14843. * _.repeat('*', 3);
  14844. * // => '***'
  14845. *
  14846. * _.repeat('abc', 2);
  14847. * // => 'abcabc'
  14848. *
  14849. * _.repeat('abc', 0);
  14850. * // => ''
  14851. */
  14852. function repeat(string, n, guard) {
  14853. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14854. n = 1;
  14855. } else {
  14856. n = toInteger(n);
  14857. }
  14858. return baseRepeat(toString(string), n);
  14859. }
  14860. /**
  14861. * Replaces matches for `pattern` in `string` with `replacement`.
  14862. *
  14863. * **Note:** This method is based on
  14864. * [`String#replace`](https://mdn.io/String/replace).
  14865. *
  14866. * @static
  14867. * @memberOf _
  14868. * @since 4.0.0
  14869. * @category String
  14870. * @param {string} [string=''] The string to modify.
  14871. * @param {RegExp|string} pattern The pattern to replace.
  14872. * @param {Function|string} replacement The match replacement.
  14873. * @returns {string} Returns the modified string.
  14874. * @example
  14875. *
  14876. * _.replace('Hi Fred', 'Fred', 'Barney');
  14877. * // => 'Hi Barney'
  14878. */
  14879. function replace() {
  14880. var args = arguments,
  14881. string = toString(args[0]);
  14882. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14883. }
  14884. /**
  14885. * Converts `string` to
  14886. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14887. *
  14888. * @static
  14889. * @memberOf _
  14890. * @since 3.0.0
  14891. * @category String
  14892. * @param {string} [string=''] The string to convert.
  14893. * @returns {string} Returns the snake cased string.
  14894. * @example
  14895. *
  14896. * _.snakeCase('Foo Bar');
  14897. * // => 'foo_bar'
  14898. *
  14899. * _.snakeCase('fooBar');
  14900. * // => 'foo_bar'
  14901. *
  14902. * _.snakeCase('--FOO-BAR--');
  14903. * // => 'foo_bar'
  14904. */
  14905. var snakeCase = createCompounder(function(result, word, index) {
  14906. return result + (index ? '_' : '') + word.toLowerCase();
  14907. });
  14908. /**
  14909. * Splits `string` by `separator`.
  14910. *
  14911. * **Note:** This method is based on
  14912. * [`String#split`](https://mdn.io/String/split).
  14913. *
  14914. * @static
  14915. * @memberOf _
  14916. * @since 4.0.0
  14917. * @category String
  14918. * @param {string} [string=''] The string to split.
  14919. * @param {RegExp|string} separator The separator pattern to split by.
  14920. * @param {number} [limit] The length to truncate results to.
  14921. * @returns {Array} Returns the string segments.
  14922. * @example
  14923. *
  14924. * _.split('a-b-c', '-', 2);
  14925. * // => ['a', 'b']
  14926. */
  14927. function split(string, separator, limit) {
  14928. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14929. separator = limit = undefined;
  14930. }
  14931. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14932. if (!limit) {
  14933. return [];
  14934. }
  14935. string = toString(string);
  14936. if (string && (
  14937. typeof separator == 'string' ||
  14938. (separator != null && !isRegExp(separator))
  14939. )) {
  14940. separator = baseToString(separator);
  14941. if (!separator && hasUnicode(string)) {
  14942. return castSlice(stringToArray(string), 0, limit);
  14943. }
  14944. }
  14945. return string.split(separator, limit);
  14946. }
  14947. /**
  14948. * Converts `string` to
  14949. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14950. *
  14951. * @static
  14952. * @memberOf _
  14953. * @since 3.1.0
  14954. * @category String
  14955. * @param {string} [string=''] The string to convert.
  14956. * @returns {string} Returns the start cased string.
  14957. * @example
  14958. *
  14959. * _.startCase('--foo-bar--');
  14960. * // => 'Foo Bar'
  14961. *
  14962. * _.startCase('fooBar');
  14963. * // => 'Foo Bar'
  14964. *
  14965. * _.startCase('__FOO_BAR__');
  14966. * // => 'FOO BAR'
  14967. */
  14968. var startCase = createCompounder(function(result, word, index) {
  14969. return result + (index ? ' ' : '') + upperFirst(word);
  14970. });
  14971. /**
  14972. * Checks if `string` starts with the given target string.
  14973. *
  14974. * @static
  14975. * @memberOf _
  14976. * @since 3.0.0
  14977. * @category String
  14978. * @param {string} [string=''] The string to inspect.
  14979. * @param {string} [target] The string to search for.
  14980. * @param {number} [position=0] The position to search from.
  14981. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14982. * else `false`.
  14983. * @example
  14984. *
  14985. * _.startsWith('abc', 'a');
  14986. * // => true
  14987. *
  14988. * _.startsWith('abc', 'b');
  14989. * // => false
  14990. *
  14991. * _.startsWith('abc', 'b', 1);
  14992. * // => true
  14993. */
  14994. function startsWith(string, target, position) {
  14995. string = toString(string);
  14996. position = position == null
  14997. ? 0
  14998. : baseClamp(toInteger(position), 0, string.length);
  14999. target = baseToString(target);
  15000. return string.slice(position, position + target.length) == target;
  15001. }
  15002. /**
  15003. * Creates a compiled template function that can interpolate data properties
  15004. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15005. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15006. * properties may be accessed as free variables in the template. If a setting
  15007. * object is given, it takes precedence over `_.templateSettings` values.
  15008. *
  15009. * **Note:** In the development build `_.template` utilizes
  15010. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15011. * for easier debugging.
  15012. *
  15013. * For more information on precompiling templates see
  15014. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15015. *
  15016. * For more information on Chrome extension sandboxes see
  15017. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15018. *
  15019. * @static
  15020. * @since 0.1.0
  15021. * @memberOf _
  15022. * @category String
  15023. * @param {string} [string=''] The template string.
  15024. * @param {Object} [options={}] The options object.
  15025. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15026. * The HTML "escape" delimiter.
  15027. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15028. * The "evaluate" delimiter.
  15029. * @param {Object} [options.imports=_.templateSettings.imports]
  15030. * An object to import into the template as free variables.
  15031. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15032. * The "interpolate" delimiter.
  15033. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15034. * The sourceURL of the compiled template.
  15035. * @param {string} [options.variable='obj']
  15036. * The data object variable name.
  15037. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15038. * @returns {Function} Returns the compiled template function.
  15039. * @example
  15040. *
  15041. * // Use the "interpolate" delimiter to create a compiled template.
  15042. * var compiled = _.template('hello <%= user %>!');
  15043. * compiled({ 'user': 'fred' });
  15044. * // => 'hello fred!'
  15045. *
  15046. * // Use the HTML "escape" delimiter to escape data property values.
  15047. * var compiled = _.template('<b><%- value %></b>');
  15048. * compiled({ 'value': '<script>' });
  15049. * // => '<b>&lt;script&gt;</b>'
  15050. *
  15051. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15052. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15053. * compiled({ 'users': ['fred', 'barney'] });
  15054. * // => '<li>fred</li><li>barney</li>'
  15055. *
  15056. * // Use the internal `print` function in "evaluate" delimiters.
  15057. * var compiled = _.template('<% print("hello " + user); %>!');
  15058. * compiled({ 'user': 'barney' });
  15059. * // => 'hello barney!'
  15060. *
  15061. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15062. * // Disable support by replacing the "interpolate" delimiter.
  15063. * var compiled = _.template('hello ${ user }!');
  15064. * compiled({ 'user': 'pebbles' });
  15065. * // => 'hello pebbles!'
  15066. *
  15067. * // Use backslashes to treat delimiters as plain text.
  15068. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15069. * compiled({ 'value': 'ignored' });
  15070. * // => '<%- value %>'
  15071. *
  15072. * // Use the `imports` option to import `jQuery` as `jq`.
  15073. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15074. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15075. * compiled({ 'users': ['fred', 'barney'] });
  15076. * // => '<li>fred</li><li>barney</li>'
  15077. *
  15078. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15079. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15080. * compiled(data);
  15081. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15082. *
  15083. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15084. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15085. * compiled.source;
  15086. * // => function(data) {
  15087. * // var __t, __p = '';
  15088. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15089. * // return __p;
  15090. * // }
  15091. *
  15092. * // Use custom template delimiters.
  15093. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15094. * var compiled = _.template('hello {{ user }}!');
  15095. * compiled({ 'user': 'mustache' });
  15096. * // => 'hello mustache!'
  15097. *
  15098. * // Use the `source` property to inline compiled templates for meaningful
  15099. * // line numbers in error messages and stack traces.
  15100. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15101. * var JST = {\
  15102. * "main": ' + _.template(mainText).source + '\
  15103. * };\
  15104. * ');
  15105. */
  15106. function template(string, options, guard) {
  15107. // Based on John Resig's `tmpl` implementation
  15108. // (http://ejohn.org/blog/javascript-micro-templating/)
  15109. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15110. var settings = lodash.templateSettings;
  15111. if (guard && isIterateeCall(string, options, guard)) {
  15112. options = undefined;
  15113. }
  15114. string = toString(string);
  15115. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15116. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15117. importsKeys = keys(imports),
  15118. importsValues = baseValues(imports, importsKeys);
  15119. var isEscaping,
  15120. isEvaluating,
  15121. index = 0,
  15122. interpolate = options.interpolate || reNoMatch,
  15123. source = "__p += '";
  15124. // Compile the regexp to match each delimiter.
  15125. var reDelimiters = RegExp(
  15126. (options.escape || reNoMatch).source + '|' +
  15127. interpolate.source + '|' +
  15128. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15129. (options.evaluate || reNoMatch).source + '|$'
  15130. , 'g');
  15131. // Use a sourceURL for easier debugging.
  15132. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15133. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15134. // and escape the comment, thus injecting code that gets evaled.
  15135. var sourceURL = '//# sourceURL=' +
  15136. (hasOwnProperty.call(options, 'sourceURL')
  15137. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15138. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15139. ) + '\n';
  15140. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15141. interpolateValue || (interpolateValue = esTemplateValue);
  15142. // Escape characters that can't be included in string literals.
  15143. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15144. // Replace delimiters with snippets.
  15145. if (escapeValue) {
  15146. isEscaping = true;
  15147. source += "' +\n__e(" + escapeValue + ") +\n'";
  15148. }
  15149. if (evaluateValue) {
  15150. isEvaluating = true;
  15151. source += "';\n" + evaluateValue + ";\n__p += '";
  15152. }
  15153. if (interpolateValue) {
  15154. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15155. }
  15156. index = offset + match.length;
  15157. // The JS engine embedded in Adobe products needs `match` returned in
  15158. // order to produce the correct `offset` value.
  15159. return match;
  15160. });
  15161. source += "';\n";
  15162. // If `variable` is not specified wrap a with-statement around the generated
  15163. // code to add the data object to the top of the scope chain.
  15164. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15165. if (!variable) {
  15166. source = 'with (obj) {\n' + source + '\n}\n';
  15167. }
  15168. // Throw an error if a forbidden character was found in `variable`, to prevent
  15169. // potential command injection attacks.
  15170. else if (reForbiddenIdentifierChars.test(variable)) {
  15171. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15172. }
  15173. // Cleanup code by stripping empty strings.
  15174. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15175. .replace(reEmptyStringMiddle, '$1')
  15176. .replace(reEmptyStringTrailing, '$1;');
  15177. // Frame code as the function body.
  15178. source = 'function(' + (variable || 'obj') + ') {\n' +
  15179. (variable
  15180. ? ''
  15181. : 'obj || (obj = {});\n'
  15182. ) +
  15183. "var __t, __p = ''" +
  15184. (isEscaping
  15185. ? ', __e = _.escape'
  15186. : ''
  15187. ) +
  15188. (isEvaluating
  15189. ? ', __j = Array.prototype.join;\n' +
  15190. "function print() { __p += __j.call(arguments, '') }\n"
  15191. : ';\n'
  15192. ) +
  15193. source +
  15194. 'return __p\n}';
  15195. var result = attempt(function() {
  15196. return Function(importsKeys, sourceURL + 'return ' + source)
  15197. .apply(undefined, importsValues);
  15198. });
  15199. // Provide the compiled function's source by its `toString` method or
  15200. // the `source` property as a convenience for inlining compiled templates.
  15201. result.source = source;
  15202. if (isError(result)) {
  15203. throw result;
  15204. }
  15205. return result;
  15206. }
  15207. /**
  15208. * Converts `string`, as a whole, to lower case just like
  15209. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15210. *
  15211. * @static
  15212. * @memberOf _
  15213. * @since 4.0.0
  15214. * @category String
  15215. * @param {string} [string=''] The string to convert.
  15216. * @returns {string} Returns the lower cased string.
  15217. * @example
  15218. *
  15219. * _.toLower('--Foo-Bar--');
  15220. * // => '--foo-bar--'
  15221. *
  15222. * _.toLower('fooBar');
  15223. * // => 'foobar'
  15224. *
  15225. * _.toLower('__FOO_BAR__');
  15226. * // => '__foo_bar__'
  15227. */
  15228. function toLower(value) {
  15229. return toString(value).toLowerCase();
  15230. }
  15231. /**
  15232. * Converts `string`, as a whole, to upper case just like
  15233. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15234. *
  15235. * @static
  15236. * @memberOf _
  15237. * @since 4.0.0
  15238. * @category String
  15239. * @param {string} [string=''] The string to convert.
  15240. * @returns {string} Returns the upper cased string.
  15241. * @example
  15242. *
  15243. * _.toUpper('--foo-bar--');
  15244. * // => '--FOO-BAR--'
  15245. *
  15246. * _.toUpper('fooBar');
  15247. * // => 'FOOBAR'
  15248. *
  15249. * _.toUpper('__foo_bar__');
  15250. * // => '__FOO_BAR__'
  15251. */
  15252. function toUpper(value) {
  15253. return toString(value).toUpperCase();
  15254. }
  15255. /**
  15256. * Removes leading and trailing whitespace or specified characters from `string`.
  15257. *
  15258. * @static
  15259. * @memberOf _
  15260. * @since 3.0.0
  15261. * @category String
  15262. * @param {string} [string=''] The string to trim.
  15263. * @param {string} [chars=whitespace] The characters to trim.
  15264. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15265. * @returns {string} Returns the trimmed string.
  15266. * @example
  15267. *
  15268. * _.trim(' abc ');
  15269. * // => 'abc'
  15270. *
  15271. * _.trim('-_-abc-_-', '_-');
  15272. * // => 'abc'
  15273. *
  15274. * _.map([' foo ', ' bar '], _.trim);
  15275. * // => ['foo', 'bar']
  15276. */
  15277. function trim(string, chars, guard) {
  15278. string = toString(string);
  15279. if (string && (guard || chars === undefined)) {
  15280. return baseTrim(string);
  15281. }
  15282. if (!string || !(chars = baseToString(chars))) {
  15283. return string;
  15284. }
  15285. var strSymbols = stringToArray(string),
  15286. chrSymbols = stringToArray(chars),
  15287. start = charsStartIndex(strSymbols, chrSymbols),
  15288. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15289. return castSlice(strSymbols, start, end).join('');
  15290. }
  15291. /**
  15292. * Removes trailing whitespace or specified characters from `string`.
  15293. *
  15294. * @static
  15295. * @memberOf _
  15296. * @since 4.0.0
  15297. * @category String
  15298. * @param {string} [string=''] The string to trim.
  15299. * @param {string} [chars=whitespace] The characters to trim.
  15300. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15301. * @returns {string} Returns the trimmed string.
  15302. * @example
  15303. *
  15304. * _.trimEnd(' abc ');
  15305. * // => ' abc'
  15306. *
  15307. * _.trimEnd('-_-abc-_-', '_-');
  15308. * // => '-_-abc'
  15309. */
  15310. function trimEnd(string, chars, guard) {
  15311. string = toString(string);
  15312. if (string && (guard || chars === undefined)) {
  15313. return string.slice(0, trimmedEndIndex(string) + 1);
  15314. }
  15315. if (!string || !(chars = baseToString(chars))) {
  15316. return string;
  15317. }
  15318. var strSymbols = stringToArray(string),
  15319. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15320. return castSlice(strSymbols, 0, end).join('');
  15321. }
  15322. /**
  15323. * Removes leading whitespace or specified characters from `string`.
  15324. *
  15325. * @static
  15326. * @memberOf _
  15327. * @since 4.0.0
  15328. * @category String
  15329. * @param {string} [string=''] The string to trim.
  15330. * @param {string} [chars=whitespace] The characters to trim.
  15331. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15332. * @returns {string} Returns the trimmed string.
  15333. * @example
  15334. *
  15335. * _.trimStart(' abc ');
  15336. * // => 'abc '
  15337. *
  15338. * _.trimStart('-_-abc-_-', '_-');
  15339. * // => 'abc-_-'
  15340. */
  15341. function trimStart(string, chars, guard) {
  15342. string = toString(string);
  15343. if (string && (guard || chars === undefined)) {
  15344. return string.replace(reTrimStart, '');
  15345. }
  15346. if (!string || !(chars = baseToString(chars))) {
  15347. return string;
  15348. }
  15349. var strSymbols = stringToArray(string),
  15350. start = charsStartIndex(strSymbols, stringToArray(chars));
  15351. return castSlice(strSymbols, start).join('');
  15352. }
  15353. /**
  15354. * Truncates `string` if it's longer than the given maximum string length.
  15355. * The last characters of the truncated string are replaced with the omission
  15356. * string which defaults to "...".
  15357. *
  15358. * @static
  15359. * @memberOf _
  15360. * @since 4.0.0
  15361. * @category String
  15362. * @param {string} [string=''] The string to truncate.
  15363. * @param {Object} [options={}] The options object.
  15364. * @param {number} [options.length=30] The maximum string length.
  15365. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15366. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15367. * @returns {string} Returns the truncated string.
  15368. * @example
  15369. *
  15370. * _.truncate('hi-diddly-ho there, neighborino');
  15371. * // => 'hi-diddly-ho there, neighbo...'
  15372. *
  15373. * _.truncate('hi-diddly-ho there, neighborino', {
  15374. * 'length': 24,
  15375. * 'separator': ' '
  15376. * });
  15377. * // => 'hi-diddly-ho there,...'
  15378. *
  15379. * _.truncate('hi-diddly-ho there, neighborino', {
  15380. * 'length': 24,
  15381. * 'separator': /,? +/
  15382. * });
  15383. * // => 'hi-diddly-ho there...'
  15384. *
  15385. * _.truncate('hi-diddly-ho there, neighborino', {
  15386. * 'omission': ' [...]'
  15387. * });
  15388. * // => 'hi-diddly-ho there, neig [...]'
  15389. */
  15390. function truncate(string, options) {
  15391. var length = DEFAULT_TRUNC_LENGTH,
  15392. omission = DEFAULT_TRUNC_OMISSION;
  15393. if (isObject(options)) {
  15394. var separator = 'separator' in options ? options.separator : separator;
  15395. length = 'length' in options ? toInteger(options.length) : length;
  15396. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15397. }
  15398. string = toString(string);
  15399. var strLength = string.length;
  15400. if (hasUnicode(string)) {
  15401. var strSymbols = stringToArray(string);
  15402. strLength = strSymbols.length;
  15403. }
  15404. if (length >= strLength) {
  15405. return string;
  15406. }
  15407. var end = length - stringSize(omission);
  15408. if (end < 1) {
  15409. return omission;
  15410. }
  15411. var result = strSymbols
  15412. ? castSlice(strSymbols, 0, end).join('')
  15413. : string.slice(0, end);
  15414. if (separator === undefined) {
  15415. return result + omission;
  15416. }
  15417. if (strSymbols) {
  15418. end += (result.length - end);
  15419. }
  15420. if (isRegExp(separator)) {
  15421. if (string.slice(end).search(separator)) {
  15422. var match,
  15423. substring = result;
  15424. if (!separator.global) {
  15425. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15426. }
  15427. separator.lastIndex = 0;
  15428. while ((match = separator.exec(substring))) {
  15429. var newEnd = match.index;
  15430. }
  15431. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15432. }
  15433. } else if (string.indexOf(baseToString(separator), end) != end) {
  15434. var index = result.lastIndexOf(separator);
  15435. if (index > -1) {
  15436. result = result.slice(0, index);
  15437. }
  15438. }
  15439. return result + omission;
  15440. }
  15441. /**
  15442. * The inverse of `_.escape`; this method converts the HTML entities
  15443. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15444. * their corresponding characters.
  15445. *
  15446. * **Note:** No other HTML entities are unescaped. To unescape additional
  15447. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15448. *
  15449. * @static
  15450. * @memberOf _
  15451. * @since 0.6.0
  15452. * @category String
  15453. * @param {string} [string=''] The string to unescape.
  15454. * @returns {string} Returns the unescaped string.
  15455. * @example
  15456. *
  15457. * _.unescape('fred, barney, &amp; pebbles');
  15458. * // => 'fred, barney, & pebbles'
  15459. */
  15460. function unescape(string) {
  15461. string = toString(string);
  15462. return (string && reHasEscapedHtml.test(string))
  15463. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15464. : string;
  15465. }
  15466. /**
  15467. * Converts `string`, as space separated words, to upper case.
  15468. *
  15469. * @static
  15470. * @memberOf _
  15471. * @since 4.0.0
  15472. * @category String
  15473. * @param {string} [string=''] The string to convert.
  15474. * @returns {string} Returns the upper cased string.
  15475. * @example
  15476. *
  15477. * _.upperCase('--foo-bar');
  15478. * // => 'FOO BAR'
  15479. *
  15480. * _.upperCase('fooBar');
  15481. * // => 'FOO BAR'
  15482. *
  15483. * _.upperCase('__foo_bar__');
  15484. * // => 'FOO BAR'
  15485. */
  15486. var upperCase = createCompounder(function(result, word, index) {
  15487. return result + (index ? ' ' : '') + word.toUpperCase();
  15488. });
  15489. /**
  15490. * Converts the first character of `string` to upper case.
  15491. *
  15492. * @static
  15493. * @memberOf _
  15494. * @since 4.0.0
  15495. * @category String
  15496. * @param {string} [string=''] The string to convert.
  15497. * @returns {string} Returns the converted string.
  15498. * @example
  15499. *
  15500. * _.upperFirst('fred');
  15501. * // => 'Fred'
  15502. *
  15503. * _.upperFirst('FRED');
  15504. * // => 'FRED'
  15505. */
  15506. var upperFirst = createCaseFirst('toUpperCase');
  15507. /**
  15508. * Splits `string` into an array of its words.
  15509. *
  15510. * @static
  15511. * @memberOf _
  15512. * @since 3.0.0
  15513. * @category String
  15514. * @param {string} [string=''] The string to inspect.
  15515. * @param {RegExp|string} [pattern] The pattern to match words.
  15516. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15517. * @returns {Array} Returns the words of `string`.
  15518. * @example
  15519. *
  15520. * _.words('fred, barney, & pebbles');
  15521. * // => ['fred', 'barney', 'pebbles']
  15522. *
  15523. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15524. * // => ['fred', 'barney', '&', 'pebbles']
  15525. */
  15526. function words(string, pattern, guard) {
  15527. string = toString(string);
  15528. pattern = guard ? undefined : pattern;
  15529. if (pattern === undefined) {
  15530. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15531. }
  15532. return string.match(pattern) || [];
  15533. }
  15534. /*------------------------------------------------------------------------*/
  15535. /**
  15536. * Attempts to invoke `func`, returning either the result or the caught error
  15537. * object. Any additional arguments are provided to `func` when it's invoked.
  15538. *
  15539. * @static
  15540. * @memberOf _
  15541. * @since 3.0.0
  15542. * @category Util
  15543. * @param {Function} func The function to attempt.
  15544. * @param {...*} [args] The arguments to invoke `func` with.
  15545. * @returns {*} Returns the `func` result or error object.
  15546. * @example
  15547. *
  15548. * // Avoid throwing errors for invalid selectors.
  15549. * var elements = _.attempt(function(selector) {
  15550. * return document.querySelectorAll(selector);
  15551. * }, '>_>');
  15552. *
  15553. * if (_.isError(elements)) {
  15554. * elements = [];
  15555. * }
  15556. */
  15557. var attempt = baseRest(function(func, args) {
  15558. try {
  15559. return apply(func, undefined, args);
  15560. } catch (e) {
  15561. return isError(e) ? e : new Error(e);
  15562. }
  15563. });
  15564. /**
  15565. * Binds methods of an object to the object itself, overwriting the existing
  15566. * method.
  15567. *
  15568. * **Note:** This method doesn't set the "length" property of bound functions.
  15569. *
  15570. * @static
  15571. * @since 0.1.0
  15572. * @memberOf _
  15573. * @category Util
  15574. * @param {Object} object The object to bind and assign the bound methods to.
  15575. * @param {...(string|string[])} methodNames The object method names to bind.
  15576. * @returns {Object} Returns `object`.
  15577. * @example
  15578. *
  15579. * var view = {
  15580. * 'label': 'docs',
  15581. * 'click': function() {
  15582. * console.log('clicked ' + this.label);
  15583. * }
  15584. * };
  15585. *
  15586. * _.bindAll(view, ['click']);
  15587. * jQuery(element).on('click', view.click);
  15588. * // => Logs 'clicked docs' when clicked.
  15589. */
  15590. var bindAll = flatRest(function(object, methodNames) {
  15591. arrayEach(methodNames, function(key) {
  15592. key = toKey(key);
  15593. baseAssignValue(object, key, bind(object[key], object));
  15594. });
  15595. return object;
  15596. });
  15597. /**
  15598. * Creates a function that iterates over `pairs` and invokes the corresponding
  15599. * function of the first predicate to return truthy. The predicate-function
  15600. * pairs are invoked with the `this` binding and arguments of the created
  15601. * function.
  15602. *
  15603. * @static
  15604. * @memberOf _
  15605. * @since 4.0.0
  15606. * @category Util
  15607. * @param {Array} pairs The predicate-function pairs.
  15608. * @returns {Function} Returns the new composite function.
  15609. * @example
  15610. *
  15611. * var func = _.cond([
  15612. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15613. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15614. * [_.stubTrue, _.constant('no match')]
  15615. * ]);
  15616. *
  15617. * func({ 'a': 1, 'b': 2 });
  15618. * // => 'matches A'
  15619. *
  15620. * func({ 'a': 0, 'b': 1 });
  15621. * // => 'matches B'
  15622. *
  15623. * func({ 'a': '1', 'b': '2' });
  15624. * // => 'no match'
  15625. */
  15626. function cond(pairs) {
  15627. var length = pairs == null ? 0 : pairs.length,
  15628. toIteratee = getIteratee();
  15629. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15630. if (typeof pair[1] != 'function') {
  15631. throw new TypeError(FUNC_ERROR_TEXT);
  15632. }
  15633. return [toIteratee(pair[0]), pair[1]];
  15634. });
  15635. return baseRest(function(args) {
  15636. var index = -1;
  15637. while (++index < length) {
  15638. var pair = pairs[index];
  15639. if (apply(pair[0], this, args)) {
  15640. return apply(pair[1], this, args);
  15641. }
  15642. }
  15643. });
  15644. }
  15645. /**
  15646. * Creates a function that invokes the predicate properties of `source` with
  15647. * the corresponding property values of a given object, returning `true` if
  15648. * all predicates return truthy, else `false`.
  15649. *
  15650. * **Note:** The created function is equivalent to `_.conformsTo` with
  15651. * `source` partially applied.
  15652. *
  15653. * @static
  15654. * @memberOf _
  15655. * @since 4.0.0
  15656. * @category Util
  15657. * @param {Object} source The object of property predicates to conform to.
  15658. * @returns {Function} Returns the new spec function.
  15659. * @example
  15660. *
  15661. * var objects = [
  15662. * { 'a': 2, 'b': 1 },
  15663. * { 'a': 1, 'b': 2 }
  15664. * ];
  15665. *
  15666. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15667. * // => [{ 'a': 1, 'b': 2 }]
  15668. */
  15669. function conforms(source) {
  15670. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15671. }
  15672. /**
  15673. * Creates a function that returns `value`.
  15674. *
  15675. * @static
  15676. * @memberOf _
  15677. * @since 2.4.0
  15678. * @category Util
  15679. * @param {*} value The value to return from the new function.
  15680. * @returns {Function} Returns the new constant function.
  15681. * @example
  15682. *
  15683. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15684. *
  15685. * console.log(objects);
  15686. * // => [{ 'a': 1 }, { 'a': 1 }]
  15687. *
  15688. * console.log(objects[0] === objects[1]);
  15689. * // => true
  15690. */
  15691. function constant(value) {
  15692. return function() {
  15693. return value;
  15694. };
  15695. }
  15696. /**
  15697. * Checks `value` to determine whether a default value should be returned in
  15698. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15699. * or `undefined`.
  15700. *
  15701. * @static
  15702. * @memberOf _
  15703. * @since 4.14.0
  15704. * @category Util
  15705. * @param {*} value The value to check.
  15706. * @param {*} defaultValue The default value.
  15707. * @returns {*} Returns the resolved value.
  15708. * @example
  15709. *
  15710. * _.defaultTo(1, 10);
  15711. * // => 1
  15712. *
  15713. * _.defaultTo(undefined, 10);
  15714. * // => 10
  15715. */
  15716. function defaultTo(value, defaultValue) {
  15717. return (value == null || value !== value) ? defaultValue : value;
  15718. }
  15719. /**
  15720. * Creates a function that returns the result of invoking the given functions
  15721. * with the `this` binding of the created function, where each successive
  15722. * invocation is supplied the return value of the previous.
  15723. *
  15724. * @static
  15725. * @memberOf _
  15726. * @since 3.0.0
  15727. * @category Util
  15728. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15729. * @returns {Function} Returns the new composite function.
  15730. * @see _.flowRight
  15731. * @example
  15732. *
  15733. * function square(n) {
  15734. * return n * n;
  15735. * }
  15736. *
  15737. * var addSquare = _.flow([_.add, square]);
  15738. * addSquare(1, 2);
  15739. * // => 9
  15740. */
  15741. var flow = createFlow();
  15742. /**
  15743. * This method is like `_.flow` except that it creates a function that
  15744. * invokes the given functions from right to left.
  15745. *
  15746. * @static
  15747. * @since 3.0.0
  15748. * @memberOf _
  15749. * @category Util
  15750. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15751. * @returns {Function} Returns the new composite function.
  15752. * @see _.flow
  15753. * @example
  15754. *
  15755. * function square(n) {
  15756. * return n * n;
  15757. * }
  15758. *
  15759. * var addSquare = _.flowRight([square, _.add]);
  15760. * addSquare(1, 2);
  15761. * // => 9
  15762. */
  15763. var flowRight = createFlow(true);
  15764. /**
  15765. * This method returns the first argument it receives.
  15766. *
  15767. * @static
  15768. * @since 0.1.0
  15769. * @memberOf _
  15770. * @category Util
  15771. * @param {*} value Any value.
  15772. * @returns {*} Returns `value`.
  15773. * @example
  15774. *
  15775. * var object = { 'a': 1 };
  15776. *
  15777. * console.log(_.identity(object) === object);
  15778. * // => true
  15779. */
  15780. function identity(value) {
  15781. return value;
  15782. }
  15783. /**
  15784. * Creates a function that invokes `func` with the arguments of the created
  15785. * function. If `func` is a property name, the created function returns the
  15786. * property value for a given element. If `func` is an array or object, the
  15787. * created function returns `true` for elements that contain the equivalent
  15788. * source properties, otherwise it returns `false`.
  15789. *
  15790. * @static
  15791. * @since 4.0.0
  15792. * @memberOf _
  15793. * @category Util
  15794. * @param {*} [func=_.identity] The value to convert to a callback.
  15795. * @returns {Function} Returns the callback.
  15796. * @example
  15797. *
  15798. * var users = [
  15799. * { 'user': 'barney', 'age': 36, 'active': true },
  15800. * { 'user': 'fred', 'age': 40, 'active': false }
  15801. * ];
  15802. *
  15803. * // The `_.matches` iteratee shorthand.
  15804. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15805. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15806. *
  15807. * // The `_.matchesProperty` iteratee shorthand.
  15808. * _.filter(users, _.iteratee(['user', 'fred']));
  15809. * // => [{ 'user': 'fred', 'age': 40 }]
  15810. *
  15811. * // The `_.property` iteratee shorthand.
  15812. * _.map(users, _.iteratee('user'));
  15813. * // => ['barney', 'fred']
  15814. *
  15815. * // Create custom iteratee shorthands.
  15816. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15817. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15818. * return func.test(string);
  15819. * };
  15820. * });
  15821. *
  15822. * _.filter(['abc', 'def'], /ef/);
  15823. * // => ['def']
  15824. */
  15825. function iteratee(func) {
  15826. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15827. }
  15828. /**
  15829. * Creates a function that performs a partial deep comparison between a given
  15830. * object and `source`, returning `true` if the given object has equivalent
  15831. * property values, else `false`.
  15832. *
  15833. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15834. * partially applied.
  15835. *
  15836. * Partial comparisons will match empty array and empty object `source`
  15837. * values against any array or object value, respectively. See `_.isEqual`
  15838. * for a list of supported value comparisons.
  15839. *
  15840. * **Note:** Multiple values can be checked by combining several matchers
  15841. * using `_.overSome`
  15842. *
  15843. * @static
  15844. * @memberOf _
  15845. * @since 3.0.0
  15846. * @category Util
  15847. * @param {Object} source The object of property values to match.
  15848. * @returns {Function} Returns the new spec function.
  15849. * @example
  15850. *
  15851. * var objects = [
  15852. * { 'a': 1, 'b': 2, 'c': 3 },
  15853. * { 'a': 4, 'b': 5, 'c': 6 }
  15854. * ];
  15855. *
  15856. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15857. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15858. *
  15859. * // Checking for several possible values
  15860. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15861. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15862. */
  15863. function matches(source) {
  15864. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15865. }
  15866. /**
  15867. * Creates a function that performs a partial deep comparison between the
  15868. * value at `path` of a given object to `srcValue`, returning `true` if the
  15869. * object value is equivalent, else `false`.
  15870. *
  15871. * **Note:** Partial comparisons will match empty array and empty object
  15872. * `srcValue` values against any array or object value, respectively. See
  15873. * `_.isEqual` for a list of supported value comparisons.
  15874. *
  15875. * **Note:** Multiple values can be checked by combining several matchers
  15876. * using `_.overSome`
  15877. *
  15878. * @static
  15879. * @memberOf _
  15880. * @since 3.2.0
  15881. * @category Util
  15882. * @param {Array|string} path The path of the property to get.
  15883. * @param {*} srcValue The value to match.
  15884. * @returns {Function} Returns the new spec function.
  15885. * @example
  15886. *
  15887. * var objects = [
  15888. * { 'a': 1, 'b': 2, 'c': 3 },
  15889. * { 'a': 4, 'b': 5, 'c': 6 }
  15890. * ];
  15891. *
  15892. * _.find(objects, _.matchesProperty('a', 4));
  15893. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15894. *
  15895. * // Checking for several possible values
  15896. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15897. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15898. */
  15899. function matchesProperty(path, srcValue) {
  15900. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15901. }
  15902. /**
  15903. * Creates a function that invokes the method at `path` of a given object.
  15904. * Any additional arguments are provided to the invoked method.
  15905. *
  15906. * @static
  15907. * @memberOf _
  15908. * @since 3.7.0
  15909. * @category Util
  15910. * @param {Array|string} path The path of the method to invoke.
  15911. * @param {...*} [args] The arguments to invoke the method with.
  15912. * @returns {Function} Returns the new invoker function.
  15913. * @example
  15914. *
  15915. * var objects = [
  15916. * { 'a': { 'b': _.constant(2) } },
  15917. * { 'a': { 'b': _.constant(1) } }
  15918. * ];
  15919. *
  15920. * _.map(objects, _.method('a.b'));
  15921. * // => [2, 1]
  15922. *
  15923. * _.map(objects, _.method(['a', 'b']));
  15924. * // => [2, 1]
  15925. */
  15926. var method = baseRest(function(path, args) {
  15927. return function(object) {
  15928. return baseInvoke(object, path, args);
  15929. };
  15930. });
  15931. /**
  15932. * The opposite of `_.method`; this method creates a function that invokes
  15933. * the method at a given path of `object`. Any additional arguments are
  15934. * provided to the invoked method.
  15935. *
  15936. * @static
  15937. * @memberOf _
  15938. * @since 3.7.0
  15939. * @category Util
  15940. * @param {Object} object The object to query.
  15941. * @param {...*} [args] The arguments to invoke the method with.
  15942. * @returns {Function} Returns the new invoker function.
  15943. * @example
  15944. *
  15945. * var array = _.times(3, _.constant),
  15946. * object = { 'a': array, 'b': array, 'c': array };
  15947. *
  15948. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15949. * // => [2, 0]
  15950. *
  15951. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15952. * // => [2, 0]
  15953. */
  15954. var methodOf = baseRest(function(object, args) {
  15955. return function(path) {
  15956. return baseInvoke(object, path, args);
  15957. };
  15958. });
  15959. /**
  15960. * Adds all own enumerable string keyed function properties of a source
  15961. * object to the destination object. If `object` is a function, then methods
  15962. * are added to its prototype as well.
  15963. *
  15964. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15965. * avoid conflicts caused by modifying the original.
  15966. *
  15967. * @static
  15968. * @since 0.1.0
  15969. * @memberOf _
  15970. * @category Util
  15971. * @param {Function|Object} [object=lodash] The destination object.
  15972. * @param {Object} source The object of functions to add.
  15973. * @param {Object} [options={}] The options object.
  15974. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15975. * @returns {Function|Object} Returns `object`.
  15976. * @example
  15977. *
  15978. * function vowels(string) {
  15979. * return _.filter(string, function(v) {
  15980. * return /[aeiou]/i.test(v);
  15981. * });
  15982. * }
  15983. *
  15984. * _.mixin({ 'vowels': vowels });
  15985. * _.vowels('fred');
  15986. * // => ['e']
  15987. *
  15988. * _('fred').vowels().value();
  15989. * // => ['e']
  15990. *
  15991. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15992. * _('fred').vowels();
  15993. * // => ['e']
  15994. */
  15995. function mixin(object, source, options) {
  15996. var props = keys(source),
  15997. methodNames = baseFunctions(source, props);
  15998. if (options == null &&
  15999. !(isObject(source) && (methodNames.length || !props.length))) {
  16000. options = source;
  16001. source = object;
  16002. object = this;
  16003. methodNames = baseFunctions(source, keys(source));
  16004. }
  16005. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16006. isFunc = isFunction(object);
  16007. arrayEach(methodNames, function(methodName) {
  16008. var func = source[methodName];
  16009. object[methodName] = func;
  16010. if (isFunc) {
  16011. object.prototype[methodName] = function() {
  16012. var chainAll = this.__chain__;
  16013. if (chain || chainAll) {
  16014. var result = object(this.__wrapped__),
  16015. actions = result.__actions__ = copyArray(this.__actions__);
  16016. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16017. result.__chain__ = chainAll;
  16018. return result;
  16019. }
  16020. return func.apply(object, arrayPush([this.value()], arguments));
  16021. };
  16022. }
  16023. });
  16024. return object;
  16025. }
  16026. /**
  16027. * Reverts the `_` variable to its previous value and returns a reference to
  16028. * the `lodash` function.
  16029. *
  16030. * @static
  16031. * @since 0.1.0
  16032. * @memberOf _
  16033. * @category Util
  16034. * @returns {Function} Returns the `lodash` function.
  16035. * @example
  16036. *
  16037. * var lodash = _.noConflict();
  16038. */
  16039. function noConflict() {
  16040. if (root._ === this) {
  16041. root._ = oldDash;
  16042. }
  16043. return this;
  16044. }
  16045. /**
  16046. * This method returns `undefined`.
  16047. *
  16048. * @static
  16049. * @memberOf _
  16050. * @since 2.3.0
  16051. * @category Util
  16052. * @example
  16053. *
  16054. * _.times(2, _.noop);
  16055. * // => [undefined, undefined]
  16056. */
  16057. function noop() {
  16058. // No operation performed.
  16059. }
  16060. /**
  16061. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16062. * the nth argument from the end is returned.
  16063. *
  16064. * @static
  16065. * @memberOf _
  16066. * @since 4.0.0
  16067. * @category Util
  16068. * @param {number} [n=0] The index of the argument to return.
  16069. * @returns {Function} Returns the new pass-thru function.
  16070. * @example
  16071. *
  16072. * var func = _.nthArg(1);
  16073. * func('a', 'b', 'c', 'd');
  16074. * // => 'b'
  16075. *
  16076. * var func = _.nthArg(-2);
  16077. * func('a', 'b', 'c', 'd');
  16078. * // => 'c'
  16079. */
  16080. function nthArg(n) {
  16081. n = toInteger(n);
  16082. return baseRest(function(args) {
  16083. return baseNth(args, n);
  16084. });
  16085. }
  16086. /**
  16087. * Creates a function that invokes `iteratees` with the arguments it receives
  16088. * and returns their results.
  16089. *
  16090. * @static
  16091. * @memberOf _
  16092. * @since 4.0.0
  16093. * @category Util
  16094. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16095. * The iteratees to invoke.
  16096. * @returns {Function} Returns the new function.
  16097. * @example
  16098. *
  16099. * var func = _.over([Math.max, Math.min]);
  16100. *
  16101. * func(1, 2, 3, 4);
  16102. * // => [4, 1]
  16103. */
  16104. var over = createOver(arrayMap);
  16105. /**
  16106. * Creates a function that checks if **all** of the `predicates` return
  16107. * truthy when invoked with the arguments it receives.
  16108. *
  16109. * Following shorthands are possible for providing predicates.
  16110. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16111. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16112. *
  16113. * @static
  16114. * @memberOf _
  16115. * @since 4.0.0
  16116. * @category Util
  16117. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16118. * The predicates to check.
  16119. * @returns {Function} Returns the new function.
  16120. * @example
  16121. *
  16122. * var func = _.overEvery([Boolean, isFinite]);
  16123. *
  16124. * func('1');
  16125. * // => true
  16126. *
  16127. * func(null);
  16128. * // => false
  16129. *
  16130. * func(NaN);
  16131. * // => false
  16132. */
  16133. var overEvery = createOver(arrayEvery);
  16134. /**
  16135. * Creates a function that checks if **any** of the `predicates` return
  16136. * truthy when invoked with the arguments it receives.
  16137. *
  16138. * Following shorthands are possible for providing predicates.
  16139. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16140. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16141. *
  16142. * @static
  16143. * @memberOf _
  16144. * @since 4.0.0
  16145. * @category Util
  16146. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16147. * The predicates to check.
  16148. * @returns {Function} Returns the new function.
  16149. * @example
  16150. *
  16151. * var func = _.overSome([Boolean, isFinite]);
  16152. *
  16153. * func('1');
  16154. * // => true
  16155. *
  16156. * func(null);
  16157. * // => true
  16158. *
  16159. * func(NaN);
  16160. * // => false
  16161. *
  16162. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16163. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16164. */
  16165. var overSome = createOver(arraySome);
  16166. /**
  16167. * Creates a function that returns the value at `path` of a given object.
  16168. *
  16169. * @static
  16170. * @memberOf _
  16171. * @since 2.4.0
  16172. * @category Util
  16173. * @param {Array|string} path The path of the property to get.
  16174. * @returns {Function} Returns the new accessor function.
  16175. * @example
  16176. *
  16177. * var objects = [
  16178. * { 'a': { 'b': 2 } },
  16179. * { 'a': { 'b': 1 } }
  16180. * ];
  16181. *
  16182. * _.map(objects, _.property('a.b'));
  16183. * // => [2, 1]
  16184. *
  16185. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16186. * // => [1, 2]
  16187. */
  16188. function property(path) {
  16189. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16190. }
  16191. /**
  16192. * The opposite of `_.property`; this method creates a function that returns
  16193. * the value at a given path of `object`.
  16194. *
  16195. * @static
  16196. * @memberOf _
  16197. * @since 3.0.0
  16198. * @category Util
  16199. * @param {Object} object The object to query.
  16200. * @returns {Function} Returns the new accessor function.
  16201. * @example
  16202. *
  16203. * var array = [0, 1, 2],
  16204. * object = { 'a': array, 'b': array, 'c': array };
  16205. *
  16206. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16207. * // => [2, 0]
  16208. *
  16209. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16210. * // => [2, 0]
  16211. */
  16212. function propertyOf(object) {
  16213. return function(path) {
  16214. return object == null ? undefined : baseGet(object, path);
  16215. };
  16216. }
  16217. /**
  16218. * Creates an array of numbers (positive and/or negative) progressing from
  16219. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16220. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16221. * it's set to `start` with `start` then set to `0`.
  16222. *
  16223. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16224. * floating-point values which can produce unexpected results.
  16225. *
  16226. * @static
  16227. * @since 0.1.0
  16228. * @memberOf _
  16229. * @category Util
  16230. * @param {number} [start=0] The start of the range.
  16231. * @param {number} end The end of the range.
  16232. * @param {number} [step=1] The value to increment or decrement by.
  16233. * @returns {Array} Returns the range of numbers.
  16234. * @see _.inRange, _.rangeRight
  16235. * @example
  16236. *
  16237. * _.range(4);
  16238. * // => [0, 1, 2, 3]
  16239. *
  16240. * _.range(-4);
  16241. * // => [0, -1, -2, -3]
  16242. *
  16243. * _.range(1, 5);
  16244. * // => [1, 2, 3, 4]
  16245. *
  16246. * _.range(0, 20, 5);
  16247. * // => [0, 5, 10, 15]
  16248. *
  16249. * _.range(0, -4, -1);
  16250. * // => [0, -1, -2, -3]
  16251. *
  16252. * _.range(1, 4, 0);
  16253. * // => [1, 1, 1]
  16254. *
  16255. * _.range(0);
  16256. * // => []
  16257. */
  16258. var range = createRange();
  16259. /**
  16260. * This method is like `_.range` except that it populates values in
  16261. * descending order.
  16262. *
  16263. * @static
  16264. * @memberOf _
  16265. * @since 4.0.0
  16266. * @category Util
  16267. * @param {number} [start=0] The start of the range.
  16268. * @param {number} end The end of the range.
  16269. * @param {number} [step=1] The value to increment or decrement by.
  16270. * @returns {Array} Returns the range of numbers.
  16271. * @see _.inRange, _.range
  16272. * @example
  16273. *
  16274. * _.rangeRight(4);
  16275. * // => [3, 2, 1, 0]
  16276. *
  16277. * _.rangeRight(-4);
  16278. * // => [-3, -2, -1, 0]
  16279. *
  16280. * _.rangeRight(1, 5);
  16281. * // => [4, 3, 2, 1]
  16282. *
  16283. * _.rangeRight(0, 20, 5);
  16284. * // => [15, 10, 5, 0]
  16285. *
  16286. * _.rangeRight(0, -4, -1);
  16287. * // => [-3, -2, -1, 0]
  16288. *
  16289. * _.rangeRight(1, 4, 0);
  16290. * // => [1, 1, 1]
  16291. *
  16292. * _.rangeRight(0);
  16293. * // => []
  16294. */
  16295. var rangeRight = createRange(true);
  16296. /**
  16297. * This method returns a new empty array.
  16298. *
  16299. * @static
  16300. * @memberOf _
  16301. * @since 4.13.0
  16302. * @category Util
  16303. * @returns {Array} Returns the new empty array.
  16304. * @example
  16305. *
  16306. * var arrays = _.times(2, _.stubArray);
  16307. *
  16308. * console.log(arrays);
  16309. * // => [[], []]
  16310. *
  16311. * console.log(arrays[0] === arrays[1]);
  16312. * // => false
  16313. */
  16314. function stubArray() {
  16315. return [];
  16316. }
  16317. /**
  16318. * This method returns `false`.
  16319. *
  16320. * @static
  16321. * @memberOf _
  16322. * @since 4.13.0
  16323. * @category Util
  16324. * @returns {boolean} Returns `false`.
  16325. * @example
  16326. *
  16327. * _.times(2, _.stubFalse);
  16328. * // => [false, false]
  16329. */
  16330. function stubFalse() {
  16331. return false;
  16332. }
  16333. /**
  16334. * This method returns a new empty object.
  16335. *
  16336. * @static
  16337. * @memberOf _
  16338. * @since 4.13.0
  16339. * @category Util
  16340. * @returns {Object} Returns the new empty object.
  16341. * @example
  16342. *
  16343. * var objects = _.times(2, _.stubObject);
  16344. *
  16345. * console.log(objects);
  16346. * // => [{}, {}]
  16347. *
  16348. * console.log(objects[0] === objects[1]);
  16349. * // => false
  16350. */
  16351. function stubObject() {
  16352. return {};
  16353. }
  16354. /**
  16355. * This method returns an empty string.
  16356. *
  16357. * @static
  16358. * @memberOf _
  16359. * @since 4.13.0
  16360. * @category Util
  16361. * @returns {string} Returns the empty string.
  16362. * @example
  16363. *
  16364. * _.times(2, _.stubString);
  16365. * // => ['', '']
  16366. */
  16367. function stubString() {
  16368. return '';
  16369. }
  16370. /**
  16371. * This method returns `true`.
  16372. *
  16373. * @static
  16374. * @memberOf _
  16375. * @since 4.13.0
  16376. * @category Util
  16377. * @returns {boolean} Returns `true`.
  16378. * @example
  16379. *
  16380. * _.times(2, _.stubTrue);
  16381. * // => [true, true]
  16382. */
  16383. function stubTrue() {
  16384. return true;
  16385. }
  16386. /**
  16387. * Invokes the iteratee `n` times, returning an array of the results of
  16388. * each invocation. The iteratee is invoked with one argument; (index).
  16389. *
  16390. * @static
  16391. * @since 0.1.0
  16392. * @memberOf _
  16393. * @category Util
  16394. * @param {number} n The number of times to invoke `iteratee`.
  16395. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16396. * @returns {Array} Returns the array of results.
  16397. * @example
  16398. *
  16399. * _.times(3, String);
  16400. * // => ['0', '1', '2']
  16401. *
  16402. * _.times(4, _.constant(0));
  16403. * // => [0, 0, 0, 0]
  16404. */
  16405. function times(n, iteratee) {
  16406. n = toInteger(n);
  16407. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16408. return [];
  16409. }
  16410. var index = MAX_ARRAY_LENGTH,
  16411. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16412. iteratee = getIteratee(iteratee);
  16413. n -= MAX_ARRAY_LENGTH;
  16414. var result = baseTimes(length, iteratee);
  16415. while (++index < n) {
  16416. iteratee(index);
  16417. }
  16418. return result;
  16419. }
  16420. /**
  16421. * Converts `value` to a property path array.
  16422. *
  16423. * @static
  16424. * @memberOf _
  16425. * @since 4.0.0
  16426. * @category Util
  16427. * @param {*} value The value to convert.
  16428. * @returns {Array} Returns the new property path array.
  16429. * @example
  16430. *
  16431. * _.toPath('a.b.c');
  16432. * // => ['a', 'b', 'c']
  16433. *
  16434. * _.toPath('a[0].b.c');
  16435. * // => ['a', '0', 'b', 'c']
  16436. */
  16437. function toPath(value) {
  16438. if (isArray(value)) {
  16439. return arrayMap(value, toKey);
  16440. }
  16441. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16442. }
  16443. /**
  16444. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16445. *
  16446. * @static
  16447. * @since 0.1.0
  16448. * @memberOf _
  16449. * @category Util
  16450. * @param {string} [prefix=''] The value to prefix the ID with.
  16451. * @returns {string} Returns the unique ID.
  16452. * @example
  16453. *
  16454. * _.uniqueId('contact_');
  16455. * // => 'contact_104'
  16456. *
  16457. * _.uniqueId();
  16458. * // => '105'
  16459. */
  16460. function uniqueId(prefix) {
  16461. var id = ++idCounter;
  16462. return toString(prefix) + id;
  16463. }
  16464. /*------------------------------------------------------------------------*/
  16465. /**
  16466. * Adds two numbers.
  16467. *
  16468. * @static
  16469. * @memberOf _
  16470. * @since 3.4.0
  16471. * @category Math
  16472. * @param {number} augend The first number in an addition.
  16473. * @param {number} addend The second number in an addition.
  16474. * @returns {number} Returns the total.
  16475. * @example
  16476. *
  16477. * _.add(6, 4);
  16478. * // => 10
  16479. */
  16480. var add = createMathOperation(function(augend, addend) {
  16481. return augend + addend;
  16482. }, 0);
  16483. /**
  16484. * Computes `number` rounded up to `precision`.
  16485. *
  16486. * @static
  16487. * @memberOf _
  16488. * @since 3.10.0
  16489. * @category Math
  16490. * @param {number} number The number to round up.
  16491. * @param {number} [precision=0] The precision to round up to.
  16492. * @returns {number} Returns the rounded up number.
  16493. * @example
  16494. *
  16495. * _.ceil(4.006);
  16496. * // => 5
  16497. *
  16498. * _.ceil(6.004, 2);
  16499. * // => 6.01
  16500. *
  16501. * _.ceil(6040, -2);
  16502. * // => 6100
  16503. */
  16504. var ceil = createRound('ceil');
  16505. /**
  16506. * Divide two numbers.
  16507. *
  16508. * @static
  16509. * @memberOf _
  16510. * @since 4.7.0
  16511. * @category Math
  16512. * @param {number} dividend The first number in a division.
  16513. * @param {number} divisor The second number in a division.
  16514. * @returns {number} Returns the quotient.
  16515. * @example
  16516. *
  16517. * _.divide(6, 4);
  16518. * // => 1.5
  16519. */
  16520. var divide = createMathOperation(function(dividend, divisor) {
  16521. return dividend / divisor;
  16522. }, 1);
  16523. /**
  16524. * Computes `number` rounded down to `precision`.
  16525. *
  16526. * @static
  16527. * @memberOf _
  16528. * @since 3.10.0
  16529. * @category Math
  16530. * @param {number} number The number to round down.
  16531. * @param {number} [precision=0] The precision to round down to.
  16532. * @returns {number} Returns the rounded down number.
  16533. * @example
  16534. *
  16535. * _.floor(4.006);
  16536. * // => 4
  16537. *
  16538. * _.floor(0.046, 2);
  16539. * // => 0.04
  16540. *
  16541. * _.floor(4060, -2);
  16542. * // => 4000
  16543. */
  16544. var floor = createRound('floor');
  16545. /**
  16546. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16547. * `undefined` is returned.
  16548. *
  16549. * @static
  16550. * @since 0.1.0
  16551. * @memberOf _
  16552. * @category Math
  16553. * @param {Array} array The array to iterate over.
  16554. * @returns {*} Returns the maximum value.
  16555. * @example
  16556. *
  16557. * _.max([4, 2, 8, 6]);
  16558. * // => 8
  16559. *
  16560. * _.max([]);
  16561. * // => undefined
  16562. */
  16563. function max(array) {
  16564. return (array && array.length)
  16565. ? baseExtremum(array, identity, baseGt)
  16566. : undefined;
  16567. }
  16568. /**
  16569. * This method is like `_.max` except that it accepts `iteratee` which is
  16570. * invoked for each element in `array` to generate the criterion by which
  16571. * the value is ranked. The iteratee is invoked with one argument: (value).
  16572. *
  16573. * @static
  16574. * @memberOf _
  16575. * @since 4.0.0
  16576. * @category Math
  16577. * @param {Array} array The array to iterate over.
  16578. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16579. * @returns {*} Returns the maximum value.
  16580. * @example
  16581. *
  16582. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16583. *
  16584. * _.maxBy(objects, function(o) { return o.n; });
  16585. * // => { 'n': 2 }
  16586. *
  16587. * // The `_.property` iteratee shorthand.
  16588. * _.maxBy(objects, 'n');
  16589. * // => { 'n': 2 }
  16590. */
  16591. function maxBy(array, iteratee) {
  16592. return (array && array.length)
  16593. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16594. : undefined;
  16595. }
  16596. /**
  16597. * Computes the mean of the values in `array`.
  16598. *
  16599. * @static
  16600. * @memberOf _
  16601. * @since 4.0.0
  16602. * @category Math
  16603. * @param {Array} array The array to iterate over.
  16604. * @returns {number} Returns the mean.
  16605. * @example
  16606. *
  16607. * _.mean([4, 2, 8, 6]);
  16608. * // => 5
  16609. */
  16610. function mean(array) {
  16611. return baseMean(array, identity);
  16612. }
  16613. /**
  16614. * This method is like `_.mean` except that it accepts `iteratee` which is
  16615. * invoked for each element in `array` to generate the value to be averaged.
  16616. * The iteratee is invoked with one argument: (value).
  16617. *
  16618. * @static
  16619. * @memberOf _
  16620. * @since 4.7.0
  16621. * @category Math
  16622. * @param {Array} array The array to iterate over.
  16623. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16624. * @returns {number} Returns the mean.
  16625. * @example
  16626. *
  16627. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16628. *
  16629. * _.meanBy(objects, function(o) { return o.n; });
  16630. * // => 5
  16631. *
  16632. * // The `_.property` iteratee shorthand.
  16633. * _.meanBy(objects, 'n');
  16634. * // => 5
  16635. */
  16636. function meanBy(array, iteratee) {
  16637. return baseMean(array, getIteratee(iteratee, 2));
  16638. }
  16639. /**
  16640. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16641. * `undefined` is returned.
  16642. *
  16643. * @static
  16644. * @since 0.1.0
  16645. * @memberOf _
  16646. * @category Math
  16647. * @param {Array} array The array to iterate over.
  16648. * @returns {*} Returns the minimum value.
  16649. * @example
  16650. *
  16651. * _.min([4, 2, 8, 6]);
  16652. * // => 2
  16653. *
  16654. * _.min([]);
  16655. * // => undefined
  16656. */
  16657. function min(array) {
  16658. return (array && array.length)
  16659. ? baseExtremum(array, identity, baseLt)
  16660. : undefined;
  16661. }
  16662. /**
  16663. * This method is like `_.min` except that it accepts `iteratee` which is
  16664. * invoked for each element in `array` to generate the criterion by which
  16665. * the value is ranked. The iteratee is invoked with one argument: (value).
  16666. *
  16667. * @static
  16668. * @memberOf _
  16669. * @since 4.0.0
  16670. * @category Math
  16671. * @param {Array} array The array to iterate over.
  16672. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16673. * @returns {*} Returns the minimum value.
  16674. * @example
  16675. *
  16676. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16677. *
  16678. * _.minBy(objects, function(o) { return o.n; });
  16679. * // => { 'n': 1 }
  16680. *
  16681. * // The `_.property` iteratee shorthand.
  16682. * _.minBy(objects, 'n');
  16683. * // => { 'n': 1 }
  16684. */
  16685. function minBy(array, iteratee) {
  16686. return (array && array.length)
  16687. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16688. : undefined;
  16689. }
  16690. /**
  16691. * Multiply two numbers.
  16692. *
  16693. * @static
  16694. * @memberOf _
  16695. * @since 4.7.0
  16696. * @category Math
  16697. * @param {number} multiplier The first number in a multiplication.
  16698. * @param {number} multiplicand The second number in a multiplication.
  16699. * @returns {number} Returns the product.
  16700. * @example
  16701. *
  16702. * _.multiply(6, 4);
  16703. * // => 24
  16704. */
  16705. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16706. return multiplier * multiplicand;
  16707. }, 1);
  16708. /**
  16709. * Computes `number` rounded to `precision`.
  16710. *
  16711. * @static
  16712. * @memberOf _
  16713. * @since 3.10.0
  16714. * @category Math
  16715. * @param {number} number The number to round.
  16716. * @param {number} [precision=0] The precision to round to.
  16717. * @returns {number} Returns the rounded number.
  16718. * @example
  16719. *
  16720. * _.round(4.006);
  16721. * // => 4
  16722. *
  16723. * _.round(4.006, 2);
  16724. * // => 4.01
  16725. *
  16726. * _.round(4060, -2);
  16727. * // => 4100
  16728. */
  16729. var round = createRound('round');
  16730. /**
  16731. * Subtract two numbers.
  16732. *
  16733. * @static
  16734. * @memberOf _
  16735. * @since 4.0.0
  16736. * @category Math
  16737. * @param {number} minuend The first number in a subtraction.
  16738. * @param {number} subtrahend The second number in a subtraction.
  16739. * @returns {number} Returns the difference.
  16740. * @example
  16741. *
  16742. * _.subtract(6, 4);
  16743. * // => 2
  16744. */
  16745. var subtract = createMathOperation(function(minuend, subtrahend) {
  16746. return minuend - subtrahend;
  16747. }, 0);
  16748. /**
  16749. * Computes the sum of the values in `array`.
  16750. *
  16751. * @static
  16752. * @memberOf _
  16753. * @since 3.4.0
  16754. * @category Math
  16755. * @param {Array} array The array to iterate over.
  16756. * @returns {number} Returns the sum.
  16757. * @example
  16758. *
  16759. * _.sum([4, 2, 8, 6]);
  16760. * // => 20
  16761. */
  16762. function sum(array) {
  16763. return (array && array.length)
  16764. ? baseSum(array, identity)
  16765. : 0;
  16766. }
  16767. /**
  16768. * This method is like `_.sum` except that it accepts `iteratee` which is
  16769. * invoked for each element in `array` to generate the value to be summed.
  16770. * The iteratee is invoked with one argument: (value).
  16771. *
  16772. * @static
  16773. * @memberOf _
  16774. * @since 4.0.0
  16775. * @category Math
  16776. * @param {Array} array The array to iterate over.
  16777. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16778. * @returns {number} Returns the sum.
  16779. * @example
  16780. *
  16781. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16782. *
  16783. * _.sumBy(objects, function(o) { return o.n; });
  16784. * // => 20
  16785. *
  16786. * // The `_.property` iteratee shorthand.
  16787. * _.sumBy(objects, 'n');
  16788. * // => 20
  16789. */
  16790. function sumBy(array, iteratee) {
  16791. return (array && array.length)
  16792. ? baseSum(array, getIteratee(iteratee, 2))
  16793. : 0;
  16794. }
  16795. /*------------------------------------------------------------------------*/
  16796. // Add methods that return wrapped values in chain sequences.
  16797. lodash.after = after;
  16798. lodash.ary = ary;
  16799. lodash.assign = assign;
  16800. lodash.assignIn = assignIn;
  16801. lodash.assignInWith = assignInWith;
  16802. lodash.assignWith = assignWith;
  16803. lodash.at = at;
  16804. lodash.before = before;
  16805. lodash.bind = bind;
  16806. lodash.bindAll = bindAll;
  16807. lodash.bindKey = bindKey;
  16808. lodash.castArray = castArray;
  16809. lodash.chain = chain;
  16810. lodash.chunk = chunk;
  16811. lodash.compact = compact;
  16812. lodash.concat = concat;
  16813. lodash.cond = cond;
  16814. lodash.conforms = conforms;
  16815. lodash.constant = constant;
  16816. lodash.countBy = countBy;
  16817. lodash.create = create;
  16818. lodash.curry = curry;
  16819. lodash.curryRight = curryRight;
  16820. lodash.debounce = debounce;
  16821. lodash.defaults = defaults;
  16822. lodash.defaultsDeep = defaultsDeep;
  16823. lodash.defer = defer;
  16824. lodash.delay = delay;
  16825. lodash.difference = difference;
  16826. lodash.differenceBy = differenceBy;
  16827. lodash.differenceWith = differenceWith;
  16828. lodash.drop = drop;
  16829. lodash.dropRight = dropRight;
  16830. lodash.dropRightWhile = dropRightWhile;
  16831. lodash.dropWhile = dropWhile;
  16832. lodash.fill = fill;
  16833. lodash.filter = filter;
  16834. lodash.flatMap = flatMap;
  16835. lodash.flatMapDeep = flatMapDeep;
  16836. lodash.flatMapDepth = flatMapDepth;
  16837. lodash.flatten = flatten;
  16838. lodash.flattenDeep = flattenDeep;
  16839. lodash.flattenDepth = flattenDepth;
  16840. lodash.flip = flip;
  16841. lodash.flow = flow;
  16842. lodash.flowRight = flowRight;
  16843. lodash.fromPairs = fromPairs;
  16844. lodash.functions = functions;
  16845. lodash.functionsIn = functionsIn;
  16846. lodash.groupBy = groupBy;
  16847. lodash.initial = initial;
  16848. lodash.intersection = intersection;
  16849. lodash.intersectionBy = intersectionBy;
  16850. lodash.intersectionWith = intersectionWith;
  16851. lodash.invert = invert;
  16852. lodash.invertBy = invertBy;
  16853. lodash.invokeMap = invokeMap;
  16854. lodash.iteratee = iteratee;
  16855. lodash.keyBy = keyBy;
  16856. lodash.keys = keys;
  16857. lodash.keysIn = keysIn;
  16858. lodash.map = map;
  16859. lodash.mapKeys = mapKeys;
  16860. lodash.mapValues = mapValues;
  16861. lodash.matches = matches;
  16862. lodash.matchesProperty = matchesProperty;
  16863. lodash.memoize = memoize;
  16864. lodash.merge = merge;
  16865. lodash.mergeWith = mergeWith;
  16866. lodash.method = method;
  16867. lodash.methodOf = methodOf;
  16868. lodash.mixin = mixin;
  16869. lodash.negate = negate;
  16870. lodash.nthArg = nthArg;
  16871. lodash.omit = omit;
  16872. lodash.omitBy = omitBy;
  16873. lodash.once = once;
  16874. lodash.orderBy = orderBy;
  16875. lodash.over = over;
  16876. lodash.overArgs = overArgs;
  16877. lodash.overEvery = overEvery;
  16878. lodash.overSome = overSome;
  16879. lodash.partial = partial;
  16880. lodash.partialRight = partialRight;
  16881. lodash.partition = partition;
  16882. lodash.pick = pick;
  16883. lodash.pickBy = pickBy;
  16884. lodash.property = property;
  16885. lodash.propertyOf = propertyOf;
  16886. lodash.pull = pull;
  16887. lodash.pullAll = pullAll;
  16888. lodash.pullAllBy = pullAllBy;
  16889. lodash.pullAllWith = pullAllWith;
  16890. lodash.pullAt = pullAt;
  16891. lodash.range = range;
  16892. lodash.rangeRight = rangeRight;
  16893. lodash.rearg = rearg;
  16894. lodash.reject = reject;
  16895. lodash.remove = remove;
  16896. lodash.rest = rest;
  16897. lodash.reverse = reverse;
  16898. lodash.sampleSize = sampleSize;
  16899. lodash.set = set;
  16900. lodash.setWith = setWith;
  16901. lodash.shuffle = shuffle;
  16902. lodash.slice = slice;
  16903. lodash.sortBy = sortBy;
  16904. lodash.sortedUniq = sortedUniq;
  16905. lodash.sortedUniqBy = sortedUniqBy;
  16906. lodash.split = split;
  16907. lodash.spread = spread;
  16908. lodash.tail = tail;
  16909. lodash.take = take;
  16910. lodash.takeRight = takeRight;
  16911. lodash.takeRightWhile = takeRightWhile;
  16912. lodash.takeWhile = takeWhile;
  16913. lodash.tap = tap;
  16914. lodash.throttle = throttle;
  16915. lodash.thru = thru;
  16916. lodash.toArray = toArray;
  16917. lodash.toPairs = toPairs;
  16918. lodash.toPairsIn = toPairsIn;
  16919. lodash.toPath = toPath;
  16920. lodash.toPlainObject = toPlainObject;
  16921. lodash.transform = transform;
  16922. lodash.unary = unary;
  16923. lodash.union = union;
  16924. lodash.unionBy = unionBy;
  16925. lodash.unionWith = unionWith;
  16926. lodash.uniq = uniq;
  16927. lodash.uniqBy = uniqBy;
  16928. lodash.uniqWith = uniqWith;
  16929. lodash.unset = unset;
  16930. lodash.unzip = unzip;
  16931. lodash.unzipWith = unzipWith;
  16932. lodash.update = update;
  16933. lodash.updateWith = updateWith;
  16934. lodash.values = values;
  16935. lodash.valuesIn = valuesIn;
  16936. lodash.without = without;
  16937. lodash.words = words;
  16938. lodash.wrap = wrap;
  16939. lodash.xor = xor;
  16940. lodash.xorBy = xorBy;
  16941. lodash.xorWith = xorWith;
  16942. lodash.zip = zip;
  16943. lodash.zipObject = zipObject;
  16944. lodash.zipObjectDeep = zipObjectDeep;
  16945. lodash.zipWith = zipWith;
  16946. // Add aliases.
  16947. lodash.entries = toPairs;
  16948. lodash.entriesIn = toPairsIn;
  16949. lodash.extend = assignIn;
  16950. lodash.extendWith = assignInWith;
  16951. // Add methods to `lodash.prototype`.
  16952. mixin(lodash, lodash);
  16953. /*------------------------------------------------------------------------*/
  16954. // Add methods that return unwrapped values in chain sequences.
  16955. lodash.add = add;
  16956. lodash.attempt = attempt;
  16957. lodash.camelCase = camelCase;
  16958. lodash.capitalize = capitalize;
  16959. lodash.ceil = ceil;
  16960. lodash.clamp = clamp;
  16961. lodash.clone = clone;
  16962. lodash.cloneDeep = cloneDeep;
  16963. lodash.cloneDeepWith = cloneDeepWith;
  16964. lodash.cloneWith = cloneWith;
  16965. lodash.conformsTo = conformsTo;
  16966. lodash.deburr = deburr;
  16967. lodash.defaultTo = defaultTo;
  16968. lodash.divide = divide;
  16969. lodash.endsWith = endsWith;
  16970. lodash.eq = eq;
  16971. lodash.escape = escape;
  16972. lodash.escapeRegExp = escapeRegExp;
  16973. lodash.every = every;
  16974. lodash.find = find;
  16975. lodash.findIndex = findIndex;
  16976. lodash.findKey = findKey;
  16977. lodash.findLast = findLast;
  16978. lodash.findLastIndex = findLastIndex;
  16979. lodash.findLastKey = findLastKey;
  16980. lodash.floor = floor;
  16981. lodash.forEach = forEach;
  16982. lodash.forEachRight = forEachRight;
  16983. lodash.forIn = forIn;
  16984. lodash.forInRight = forInRight;
  16985. lodash.forOwn = forOwn;
  16986. lodash.forOwnRight = forOwnRight;
  16987. lodash.get = get;
  16988. lodash.gt = gt;
  16989. lodash.gte = gte;
  16990. lodash.has = has;
  16991. lodash.hasIn = hasIn;
  16992. lodash.head = head;
  16993. lodash.identity = identity;
  16994. lodash.includes = includes;
  16995. lodash.indexOf = indexOf;
  16996. lodash.inRange = inRange;
  16997. lodash.invoke = invoke;
  16998. lodash.isArguments = isArguments;
  16999. lodash.isArray = isArray;
  17000. lodash.isArrayBuffer = isArrayBuffer;
  17001. lodash.isArrayLike = isArrayLike;
  17002. lodash.isArrayLikeObject = isArrayLikeObject;
  17003. lodash.isBoolean = isBoolean;
  17004. lodash.isBuffer = isBuffer;
  17005. lodash.isDate = isDate;
  17006. lodash.isElement = isElement;
  17007. lodash.isEmpty = isEmpty;
  17008. lodash.isEqual = isEqual;
  17009. lodash.isEqualWith = isEqualWith;
  17010. lodash.isError = isError;
  17011. lodash.isFinite = isFinite;
  17012. lodash.isFunction = isFunction;
  17013. lodash.isInteger = isInteger;
  17014. lodash.isLength = isLength;
  17015. lodash.isMap = isMap;
  17016. lodash.isMatch = isMatch;
  17017. lodash.isMatchWith = isMatchWith;
  17018. lodash.isNaN = isNaN;
  17019. lodash.isNative = isNative;
  17020. lodash.isNil = isNil;
  17021. lodash.isNull = isNull;
  17022. lodash.isNumber = isNumber;
  17023. lodash.isObject = isObject;
  17024. lodash.isObjectLike = isObjectLike;
  17025. lodash.isPlainObject = isPlainObject;
  17026. lodash.isRegExp = isRegExp;
  17027. lodash.isSafeInteger = isSafeInteger;
  17028. lodash.isSet = isSet;
  17029. lodash.isString = isString;
  17030. lodash.isSymbol = isSymbol;
  17031. lodash.isTypedArray = isTypedArray;
  17032. lodash.isUndefined = isUndefined;
  17033. lodash.isWeakMap = isWeakMap;
  17034. lodash.isWeakSet = isWeakSet;
  17035. lodash.join = join;
  17036. lodash.kebabCase = kebabCase;
  17037. lodash.last = last;
  17038. lodash.lastIndexOf = lastIndexOf;
  17039. lodash.lowerCase = lowerCase;
  17040. lodash.lowerFirst = lowerFirst;
  17041. lodash.lt = lt;
  17042. lodash.lte = lte;
  17043. lodash.max = max;
  17044. lodash.maxBy = maxBy;
  17045. lodash.mean = mean;
  17046. lodash.meanBy = meanBy;
  17047. lodash.min = min;
  17048. lodash.minBy = minBy;
  17049. lodash.stubArray = stubArray;
  17050. lodash.stubFalse = stubFalse;
  17051. lodash.stubObject = stubObject;
  17052. lodash.stubString = stubString;
  17053. lodash.stubTrue = stubTrue;
  17054. lodash.multiply = multiply;
  17055. lodash.nth = nth;
  17056. lodash.noConflict = noConflict;
  17057. lodash.noop = noop;
  17058. lodash.now = now;
  17059. lodash.pad = pad;
  17060. lodash.padEnd = padEnd;
  17061. lodash.padStart = padStart;
  17062. lodash.parseInt = parseInt;
  17063. lodash.random = random;
  17064. lodash.reduce = reduce;
  17065. lodash.reduceRight = reduceRight;
  17066. lodash.repeat = repeat;
  17067. lodash.replace = replace;
  17068. lodash.result = result;
  17069. lodash.round = round;
  17070. lodash.runInContext = runInContext;
  17071. lodash.sample = sample;
  17072. lodash.size = size;
  17073. lodash.snakeCase = snakeCase;
  17074. lodash.some = some;
  17075. lodash.sortedIndex = sortedIndex;
  17076. lodash.sortedIndexBy = sortedIndexBy;
  17077. lodash.sortedIndexOf = sortedIndexOf;
  17078. lodash.sortedLastIndex = sortedLastIndex;
  17079. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17080. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17081. lodash.startCase = startCase;
  17082. lodash.startsWith = startsWith;
  17083. lodash.subtract = subtract;
  17084. lodash.sum = sum;
  17085. lodash.sumBy = sumBy;
  17086. lodash.template = template;
  17087. lodash.times = times;
  17088. lodash.toFinite = toFinite;
  17089. lodash.toInteger = toInteger;
  17090. lodash.toLength = toLength;
  17091. lodash.toLower = toLower;
  17092. lodash.toNumber = toNumber;
  17093. lodash.toSafeInteger = toSafeInteger;
  17094. lodash.toString = toString;
  17095. lodash.toUpper = toUpper;
  17096. lodash.trim = trim;
  17097. lodash.trimEnd = trimEnd;
  17098. lodash.trimStart = trimStart;
  17099. lodash.truncate = truncate;
  17100. lodash.unescape = unescape;
  17101. lodash.uniqueId = uniqueId;
  17102. lodash.upperCase = upperCase;
  17103. lodash.upperFirst = upperFirst;
  17104. // Add aliases.
  17105. lodash.each = forEach;
  17106. lodash.eachRight = forEachRight;
  17107. lodash.first = head;
  17108. mixin(lodash, (function() {
  17109. var source = {};
  17110. baseForOwn(lodash, function(func, methodName) {
  17111. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17112. source[methodName] = func;
  17113. }
  17114. });
  17115. return source;
  17116. }()), { 'chain': false });
  17117. /*------------------------------------------------------------------------*/
  17118. /**
  17119. * The semantic version number.
  17120. *
  17121. * @static
  17122. * @memberOf _
  17123. * @type {string}
  17124. */
  17125. lodash.VERSION = VERSION;
  17126. // Assign default placeholders.
  17127. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17128. lodash[methodName].placeholder = lodash;
  17129. });
  17130. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17131. arrayEach(['drop', 'take'], function(methodName, index) {
  17132. LazyWrapper.prototype[methodName] = function(n) {
  17133. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17134. var result = (this.__filtered__ && !index)
  17135. ? new LazyWrapper(this)
  17136. : this.clone();
  17137. if (result.__filtered__) {
  17138. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17139. } else {
  17140. result.__views__.push({
  17141. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17142. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17143. });
  17144. }
  17145. return result;
  17146. };
  17147. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17148. return this.reverse()[methodName](n).reverse();
  17149. };
  17150. });
  17151. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17152. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17153. var type = index + 1,
  17154. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17155. LazyWrapper.prototype[methodName] = function(iteratee) {
  17156. var result = this.clone();
  17157. result.__iteratees__.push({
  17158. 'iteratee': getIteratee(iteratee, 3),
  17159. 'type': type
  17160. });
  17161. result.__filtered__ = result.__filtered__ || isFilter;
  17162. return result;
  17163. };
  17164. });
  17165. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17166. arrayEach(['head', 'last'], function(methodName, index) {
  17167. var takeName = 'take' + (index ? 'Right' : '');
  17168. LazyWrapper.prototype[methodName] = function() {
  17169. return this[takeName](1).value()[0];
  17170. };
  17171. });
  17172. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17173. arrayEach(['initial', 'tail'], function(methodName, index) {
  17174. var dropName = 'drop' + (index ? '' : 'Right');
  17175. LazyWrapper.prototype[methodName] = function() {
  17176. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17177. };
  17178. });
  17179. LazyWrapper.prototype.compact = function() {
  17180. return this.filter(identity);
  17181. };
  17182. LazyWrapper.prototype.find = function(predicate) {
  17183. return this.filter(predicate).head();
  17184. };
  17185. LazyWrapper.prototype.findLast = function(predicate) {
  17186. return this.reverse().find(predicate);
  17187. };
  17188. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17189. if (typeof path == 'function') {
  17190. return new LazyWrapper(this);
  17191. }
  17192. return this.map(function(value) {
  17193. return baseInvoke(value, path, args);
  17194. });
  17195. });
  17196. LazyWrapper.prototype.reject = function(predicate) {
  17197. return this.filter(negate(getIteratee(predicate)));
  17198. };
  17199. LazyWrapper.prototype.slice = function(start, end) {
  17200. start = toInteger(start);
  17201. var result = this;
  17202. if (result.__filtered__ && (start > 0 || end < 0)) {
  17203. return new LazyWrapper(result);
  17204. }
  17205. if (start < 0) {
  17206. result = result.takeRight(-start);
  17207. } else if (start) {
  17208. result = result.drop(start);
  17209. }
  17210. if (end !== undefined) {
  17211. end = toInteger(end);
  17212. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17213. }
  17214. return result;
  17215. };
  17216. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17217. return this.reverse().takeWhile(predicate).reverse();
  17218. };
  17219. LazyWrapper.prototype.toArray = function() {
  17220. return this.take(MAX_ARRAY_LENGTH);
  17221. };
  17222. // Add `LazyWrapper` methods to `lodash.prototype`.
  17223. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17224. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17225. isTaker = /^(?:head|last)$/.test(methodName),
  17226. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17227. retUnwrapped = isTaker || /^find/.test(methodName);
  17228. if (!lodashFunc) {
  17229. return;
  17230. }
  17231. lodash.prototype[methodName] = function() {
  17232. var value = this.__wrapped__,
  17233. args = isTaker ? [1] : arguments,
  17234. isLazy = value instanceof LazyWrapper,
  17235. iteratee = args[0],
  17236. useLazy = isLazy || isArray(value);
  17237. var interceptor = function(value) {
  17238. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17239. return (isTaker && chainAll) ? result[0] : result;
  17240. };
  17241. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17242. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17243. isLazy = useLazy = false;
  17244. }
  17245. var chainAll = this.__chain__,
  17246. isHybrid = !!this.__actions__.length,
  17247. isUnwrapped = retUnwrapped && !chainAll,
  17248. onlyLazy = isLazy && !isHybrid;
  17249. if (!retUnwrapped && useLazy) {
  17250. value = onlyLazy ? value : new LazyWrapper(this);
  17251. var result = func.apply(value, args);
  17252. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17253. return new LodashWrapper(result, chainAll);
  17254. }
  17255. if (isUnwrapped && onlyLazy) {
  17256. return func.apply(this, args);
  17257. }
  17258. result = this.thru(interceptor);
  17259. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17260. };
  17261. });
  17262. // Add `Array` methods to `lodash.prototype`.
  17263. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17264. var func = arrayProto[methodName],
  17265. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17266. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17267. lodash.prototype[methodName] = function() {
  17268. var args = arguments;
  17269. if (retUnwrapped && !this.__chain__) {
  17270. var value = this.value();
  17271. return func.apply(isArray(value) ? value : [], args);
  17272. }
  17273. return this[chainName](function(value) {
  17274. return func.apply(isArray(value) ? value : [], args);
  17275. });
  17276. };
  17277. });
  17278. // Map minified method names to their real names.
  17279. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17280. var lodashFunc = lodash[methodName];
  17281. if (lodashFunc) {
  17282. var key = lodashFunc.name + '';
  17283. if (!hasOwnProperty.call(realNames, key)) {
  17284. realNames[key] = [];
  17285. }
  17286. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17287. }
  17288. });
  17289. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17290. 'name': 'wrapper',
  17291. 'func': undefined
  17292. }];
  17293. // Add methods to `LazyWrapper`.
  17294. LazyWrapper.prototype.clone = lazyClone;
  17295. LazyWrapper.prototype.reverse = lazyReverse;
  17296. LazyWrapper.prototype.value = lazyValue;
  17297. // Add chain sequence methods to the `lodash` wrapper.
  17298. lodash.prototype.at = wrapperAt;
  17299. lodash.prototype.chain = wrapperChain;
  17300. lodash.prototype.commit = wrapperCommit;
  17301. lodash.prototype.next = wrapperNext;
  17302. lodash.prototype.plant = wrapperPlant;
  17303. lodash.prototype.reverse = wrapperReverse;
  17304. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17305. // Add lazy aliases.
  17306. lodash.prototype.first = lodash.prototype.head;
  17307. if (symIterator) {
  17308. lodash.prototype[symIterator] = wrapperToIterator;
  17309. }
  17310. return lodash;
  17311. });
  17312. /*--------------------------------------------------------------------------*/
  17313. // Export lodash.
  17314. var _ = runInContext();
  17315. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17316. if (true) {
  17317. // Expose Lodash on the global object to prevent errors when Lodash is
  17318. // loaded by a script tag in the presence of an AMD loader.
  17319. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17320. // Use `_.noConflict` to remove Lodash from the global object.
  17321. root._ = _;
  17322. // Define as an anonymous module so, through path mapping, it can be
  17323. // referenced as the "underscore" module.
  17324. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17325. return _;
  17326. }).call(exports, __webpack_require__, exports, module),
  17327. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17328. }
  17329. // Check for `exports` after `define` in case a build optimizer adds it.
  17330. else {}
  17331. }.call(this));
  17332. /***/ }),
  17333. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17334. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17335. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17336. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17337. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17338. "use strict";
  17339. __webpack_require__.r(__webpack_exports__);
  17340. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17341. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17342. /* harmony export */ });
  17343. /* 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");
  17344. /* 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__);
  17345. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_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]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17346. var options = {};
  17347. options.insert = "head";
  17348. options.singleton = false;
  17349. 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17350. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  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/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17353. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17354. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17355. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17356. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17357. "use strict";
  17358. __webpack_require__.r(__webpack_exports__);
  17359. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17360. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17361. /* harmony export */ });
  17362. /* 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");
  17363. /* 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__);
  17364. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17365. var options = {};
  17366. options.insert = "head";
  17367. options.singleton = false;
  17368. 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17369. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  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/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17372. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17373. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17374. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17375. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17376. "use strict";
  17377. __webpack_require__.r(__webpack_exports__);
  17378. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17379. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17380. /* harmony export */ });
  17381. /* 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");
  17382. /* 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__);
  17383. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_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]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17384. var options = {};
  17385. options.insert = "head";
  17386. options.singleton = false;
  17387. 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17388. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  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/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17391. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17392. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17393. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17394. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17395. "use strict";
  17396. __webpack_require__.r(__webpack_exports__);
  17397. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17398. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17399. /* harmony export */ });
  17400. /* 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");
  17401. /* 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__);
  17402. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17403. var options = {};
  17404. options.insert = "head";
  17405. options.singleton = false;
  17406. 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_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17407. /* 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_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17408. /***/ }),
  17409. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17410. /*!******************************************************!*\
  17411. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17412. \******************************************************/
  17413. /***/ ((__unused_webpack_module, exports) => {
  17414. "use strict";
  17415. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17416. // runtime helper for setting properties on components
  17417. // in a tree-shakable way
  17418. exports["default"] = (sfc, props) => {
  17419. const target = sfc.__vccOpts || sfc;
  17420. for (const [key, val] of props) {
  17421. target[key] = val;
  17422. }
  17423. return target;
  17424. };
  17425. /***/ }),
  17426. /***/ "./resources/js/components/AppButtonLink.vue":
  17427. /*!***************************************************!*\
  17428. !*** ./resources/js/components/AppButtonLink.vue ***!
  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 _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");
  17437. /* 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");
  17438. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17439. ;
  17440. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17441. /* hot reload */
  17442. if (false) {}
  17443. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17444. /***/ }),
  17445. /***/ "./resources/js/components/AppMessage.vue":
  17446. /*!************************************************!*\
  17447. !*** ./resources/js/components/AppMessage.vue ***!
  17448. \************************************************/
  17449. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17450. "use strict";
  17451. __webpack_require__.r(__webpack_exports__);
  17452. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17453. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17454. /* harmony export */ });
  17455. /* 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");
  17456. /* 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");
  17457. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17458. ;
  17459. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17460. /* hot reload */
  17461. if (false) {}
  17462. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17463. /***/ }),
  17464. /***/ "./resources/js/components/AppPagination.vue":
  17465. /*!***************************************************!*\
  17466. !*** ./resources/js/components/AppPagination.vue ***!
  17467. \***************************************************/
  17468. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17469. "use strict";
  17470. __webpack_require__.r(__webpack_exports__);
  17471. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17472. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17473. /* harmony export */ });
  17474. /* 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");
  17475. /* 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");
  17476. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17477. ;
  17478. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17479. /* hot reload */
  17480. if (false) {}
  17481. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17482. /***/ }),
  17483. /***/ "./resources/js/components/AppSearch.vue":
  17484. /*!***********************************************!*\
  17485. !*** ./resources/js/components/AppSearch.vue ***!
  17486. \***********************************************/
  17487. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17488. "use strict";
  17489. __webpack_require__.r(__webpack_exports__);
  17490. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17491. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17492. /* harmony export */ });
  17493. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17494. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17495. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17496. ;
  17497. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17498. /* hot reload */
  17499. if (false) {}
  17500. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17501. /***/ }),
  17502. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17503. /*!**************************************************************!*\
  17504. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17505. \**************************************************************/
  17506. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17507. "use strict";
  17508. __webpack_require__.r(__webpack_exports__);
  17509. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17510. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17511. /* harmony export */ });
  17512. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17513. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17514. const script = {}
  17515. ;
  17516. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17517. /* hot reload */
  17518. if (false) {}
  17519. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17520. /***/ }),
  17521. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17522. /*!***************************************************************!*\
  17523. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17524. \***************************************************************/
  17525. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17526. "use strict";
  17527. __webpack_require__.r(__webpack_exports__);
  17528. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17529. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17530. /* harmony export */ });
  17531. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17532. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17533. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17534. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17535. ;
  17536. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17537. /* hot reload */
  17538. if (false) {}
  17539. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17540. /***/ }),
  17541. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17542. /*!******************************************************************!*\
  17543. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17544. \******************************************************************/
  17545. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17546. "use strict";
  17547. __webpack_require__.r(__webpack_exports__);
  17548. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17549. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17550. /* harmony export */ });
  17551. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17552. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17553. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17554. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17555. ;
  17556. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17557. /* hot reload */
  17558. if (false) {}
  17559. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17560. /***/ }),
  17561. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17562. /*!**************************************************************!*\
  17563. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17564. \**************************************************************/
  17565. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17566. "use strict";
  17567. __webpack_require__.r(__webpack_exports__);
  17568. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17569. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17570. /* harmony export */ });
  17571. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17572. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17573. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17574. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17575. ;
  17576. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17577. /* hot reload */
  17578. if (false) {}
  17579. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17580. /***/ }),
  17581. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17582. /*!************************************************************!*\
  17583. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17584. \************************************************************/
  17585. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17586. "use strict";
  17587. __webpack_require__.r(__webpack_exports__);
  17588. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17589. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17590. /* harmony export */ });
  17591. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17592. /* 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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17593. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17594. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17595. ;
  17596. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17597. /* hot reload */
  17598. if (false) {}
  17599. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17600. /***/ }),
  17601. /***/ "./resources/js/pages/Customers/Index.vue":
  17602. /*!************************************************!*\
  17603. !*** ./resources/js/pages/Customers/Index.vue ***!
  17604. \************************************************/
  17605. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17606. "use strict";
  17607. __webpack_require__.r(__webpack_exports__);
  17608. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17609. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17610. /* harmony export */ });
  17611. /* harmony import */ var _Index_vue_vue_type_template_id_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=2f43e3ff */ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17612. /* 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/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17613. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17614. ;
  17615. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Customers/Index.vue"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17621. /*!**************************************************************************************!*\
  17622. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17623. \**************************************************************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* 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"])
  17629. /* harmony export */ });
  17630. /* 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");
  17631. /***/ }),
  17632. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17633. /*!***********************************************************************************!*\
  17634. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17635. \***********************************************************************************/
  17636. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17637. "use strict";
  17638. __webpack_require__.r(__webpack_exports__);
  17639. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17640. /* 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"])
  17641. /* harmony export */ });
  17642. /* 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");
  17643. /***/ }),
  17644. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17645. /*!**************************************************************************************!*\
  17646. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17647. \**************************************************************************************/
  17648. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17649. "use strict";
  17650. __webpack_require__.r(__webpack_exports__);
  17651. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17652. /* 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"])
  17653. /* harmony export */ });
  17654. /* 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");
  17655. /***/ }),
  17656. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17657. /*!**********************************************************************************!*\
  17658. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17659. \**********************************************************************************/
  17660. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17661. "use strict";
  17662. __webpack_require__.r(__webpack_exports__);
  17663. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17664. /* 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_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17665. /* harmony export */ });
  17666. /* 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_AppSearch_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]!./AppSearch.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/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17667. /***/ }),
  17668. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17669. /*!**************************************************************************************************!*\
  17670. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17671. \**************************************************************************************************/
  17672. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17673. "use strict";
  17674. __webpack_require__.r(__webpack_exports__);
  17675. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17676. /* 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_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17677. /* harmony export */ });
  17678. /* 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_Sidebar_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]!./Sidebar.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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17679. /***/ }),
  17680. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17681. /*!*****************************************************************************************************!*\
  17682. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17683. \*****************************************************************************************************/
  17684. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17685. "use strict";
  17686. __webpack_require__.r(__webpack_exports__);
  17687. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17688. /* 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_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17689. /* harmony export */ });
  17690. /* 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_SubSidebar_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]!./SubSidebar.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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17691. /***/ }),
  17692. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17693. /*!*************************************************************************************************!*\
  17694. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17695. \*************************************************************************************************/
  17696. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17697. "use strict";
  17698. __webpack_require__.r(__webpack_exports__);
  17699. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17700. /* 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_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17701. /* harmony export */ });
  17702. /* 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_TopBar_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]!./TopBar.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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17703. /***/ }),
  17704. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17705. /*!***********************************************************************************************!*\
  17706. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17707. \***********************************************************************************************/
  17708. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17709. "use strict";
  17710. __webpack_require__.r(__webpack_exports__);
  17711. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17712. /* 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"])
  17713. /* harmony export */ });
  17714. /* 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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17715. /***/ }),
  17716. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  17717. /*!***********************************************************************************!*\
  17718. !*** ./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17719. \***********************************************************************************/
  17720. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17721. "use strict";
  17722. __webpack_require__.r(__webpack_exports__);
  17723. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17724. /* 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"])
  17725. /* harmony export */ });
  17726. /* 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/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17727. /***/ }),
  17728. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17729. /*!*********************************************************************************!*\
  17730. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17731. \*********************************************************************************/
  17732. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17733. "use strict";
  17734. __webpack_require__.r(__webpack_exports__);
  17735. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17736. /* 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)
  17737. /* harmony export */ });
  17738. /* 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");
  17739. /***/ }),
  17740. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17741. /*!******************************************************************************!*\
  17742. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17743. \******************************************************************************/
  17744. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17745. "use strict";
  17746. __webpack_require__.r(__webpack_exports__);
  17747. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17748. /* 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)
  17749. /* harmony export */ });
  17750. /* 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");
  17751. /***/ }),
  17752. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17753. /*!*********************************************************************************!*\
  17754. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17755. \*********************************************************************************/
  17756. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17757. "use strict";
  17758. __webpack_require__.r(__webpack_exports__);
  17759. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17760. /* 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)
  17761. /* harmony export */ });
  17762. /* 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");
  17763. /***/ }),
  17764. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17765. /*!*****************************************************************************!*\
  17766. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17767. \*****************************************************************************/
  17768. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17769. "use strict";
  17770. __webpack_require__.r(__webpack_exports__);
  17771. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17772. /* 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_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17773. /* harmony export */ });
  17774. /* 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_AppSearch_vue_vue_type_template_id_5b9fdcce__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]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17775. /***/ }),
  17776. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17777. /*!********************************************************************************************!*\
  17778. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17779. \********************************************************************************************/
  17780. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17781. "use strict";
  17782. __webpack_require__.r(__webpack_exports__);
  17783. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17784. /* 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_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17785. /* harmony export */ });
  17786. /* 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_Footer_vue_vue_type_template_id_dbb3aa76__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]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17787. /***/ }),
  17788. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17789. /*!*********************************************************************************************************!*\
  17790. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17791. \*********************************************************************************************************/
  17792. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17793. "use strict";
  17794. __webpack_require__.r(__webpack_exports__);
  17795. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17796. /* 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_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17797. /* harmony export */ });
  17798. /* 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_Sidebar_vue_vue_type_template_id_5b49aa22_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]!./Sidebar.vue?vue&type=template&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17799. /***/ }),
  17800. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17801. /*!************************************************************************************************************!*\
  17802. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17803. \************************************************************************************************************/
  17804. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17805. "use strict";
  17806. __webpack_require__.r(__webpack_exports__);
  17807. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17808. /* 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_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17809. /* harmony export */ });
  17810. /* 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_SubSidebar_vue_vue_type_template_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17811. /***/ }),
  17812. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17813. /*!********************************************************************************************************!*\
  17814. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17815. \********************************************************************************************************/
  17816. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17817. "use strict";
  17818. __webpack_require__.r(__webpack_exports__);
  17819. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17820. /* 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_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17821. /* harmony export */ });
  17822. /* 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_TopBar_vue_vue_type_template_id_0b7edbb0_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]!./TopBar.vue?vue&type=template&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17823. /***/ }),
  17824. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17825. /*!******************************************************************************************************!*\
  17826. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17827. \******************************************************************************************************/
  17828. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17829. "use strict";
  17830. __webpack_require__.r(__webpack_exports__);
  17831. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17832. /* 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_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17833. /* harmony export */ });
  17834. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17835. /***/ }),
  17836. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  17837. /*!******************************************************************************!*\
  17838. !*** ./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  17839. \******************************************************************************/
  17840. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17841. "use strict";
  17842. __webpack_require__.r(__webpack_exports__);
  17843. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17844. /* 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_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render)
  17845. /* harmony export */ });
  17846. /* 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_2f43e3ff__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=2f43e3ff */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17847. /***/ }),
  17848. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17849. /*!************************************************************************************************************************!*\
  17850. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17851. \************************************************************************************************************************/
  17852. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17853. "use strict";
  17854. __webpack_require__.r(__webpack_exports__);
  17855. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_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]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17856. /***/ }),
  17857. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17858. /*!***************************************************************************************************************************!*\
  17859. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17860. \***************************************************************************************************************************/
  17861. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17862. "use strict";
  17863. __webpack_require__.r(__webpack_exports__);
  17864. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17865. /***/ }),
  17866. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17867. /*!***********************************************************************************************************************!*\
  17868. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17869. \***********************************************************************************************************************/
  17870. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17871. "use strict";
  17872. __webpack_require__.r(__webpack_exports__);
  17873. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_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]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17874. /***/ }),
  17875. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17876. /*!*********************************************************************************************************************!*\
  17877. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17878. \*********************************************************************************************************************/
  17879. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17880. "use strict";
  17881. __webpack_require__.r(__webpack_exports__);
  17882. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17883. /***/ })
  17884. }]);