resources_js_pages_mutation_Report_vue.js 707KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_mutation_Report_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js":
  259. /*!***************************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js ***!
  261. \***************************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  269. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/mutation/tableHeader.js");
  274. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  277. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. mutations: {
  281. type: Object,
  282. "default": {
  283. details: {
  284. data: [],
  285. links: [],
  286. total: 0
  287. }
  288. }
  289. },
  290. initialDateRange: Array
  291. },
  292. setup: function setup(__props, _ref) {
  293. var expose = _ref.expose;
  294. expose();
  295. var props = __props;
  296. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter)(props),
  297. dates = _useDateRangeFilter.dates,
  298. startDate = _useDateRangeFilter.startDate,
  299. endDate = _useDateRangeFilter.endDate;
  300. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  301. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  302. data: (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  303. startDate: startDate.value,
  304. endDate: endDate.value
  305. }),
  306. only: ['mutations']
  307. });
  308. var params = window.location.search;
  309. exportExcelLink.value = "/reports/mutations/export/excel".concat(params);
  310. });
  311. var filterReset = function filterReset() {
  312. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/reports/mutations');
  313. };
  314. var linkReference = function linkReference(data) {
  315. if (data.topUpId) {
  316. return route('top-ups.show', data.topUpId);
  317. } else if (data.expenseId) {
  318. return route('expenses.show', data.expenseId);
  319. } else {
  320. return route('out-transactions.show', data.outTransactionId);
  321. }
  322. };
  323. var exportExcelLink = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)('/reports/mutations/export/excel');
  324. var __returned__ = {
  325. props: props,
  326. dates: dates,
  327. startDate: startDate,
  328. endDate: endDate,
  329. filterReset: filterReset,
  330. linkReference: linkReference,
  331. exportExcelLink: exportExcelLink,
  332. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  333. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  334. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  335. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  336. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  337. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  338. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter,
  339. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  340. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  341. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  342. };
  343. Object.defineProperty(__returned__, '__isScriptSetup', {
  344. enumerable: false,
  345. value: true
  346. });
  347. return __returned__;
  348. }
  349. });
  350. /***/ }),
  351. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  352. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  353. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  354. \***********************************************************************************************************************************************************************************************************************************************************************************/
  355. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  356. "use strict";
  357. __webpack_require__.r(__webpack_exports__);
  358. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  359. /* harmony export */ "render": () => (/* binding */ render)
  360. /* harmony export */ });
  361. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  362. var _hoisted_1 = {
  363. key: 1,
  364. "class": "p-button-label"
  365. };
  366. var _hoisted_2 = {
  367. key: 1,
  368. "class": "p-button-label"
  369. };
  370. function render(_ctx, _cache, $props, $setup, $data, $options) {
  371. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  372. key: 0,
  373. "class": "p-button p-component",
  374. as: "button",
  375. type: "button"
  376. }, {
  377. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  378. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  379. key: 0,
  380. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  381. }, null, 2
  382. /* CLASS */
  383. )) : (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
  384. /* TEXT */
  385. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  386. }),
  387. _: 1
  388. /* STABLE */
  389. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  390. key: 1,
  391. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  392. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  393. key: 0,
  394. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  395. }, null, 2
  396. /* CLASS */
  397. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  398. /* TEXT */
  399. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  400. /* CLASS */
  401. ));
  402. }
  403. /***/ }),
  404. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  405. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  406. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  407. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  408. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  409. "use strict";
  410. __webpack_require__.r(__webpack_exports__);
  411. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  412. /* harmony export */ "render": () => (/* binding */ render)
  413. /* harmony export */ });
  414. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  415. var _withScopeId = function _withScopeId(n) {
  416. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  417. };
  418. var _hoisted_1 = {
  419. "class": "layout-footer"
  420. };
  421. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  422. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  423. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  424. href: "https://dijitalcode.com",
  425. target: "_blank",
  426. "class": "font-medium ml-2"
  427. }, "DijitalCODE", -1
  428. /* HOISTED */
  429. );
  430. });
  431. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  432. function render(_ctx, _cache) {
  433. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  434. }
  435. /***/ }),
  436. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  437. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  438. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  439. \********************************************************************************************************************************************************************************************************************************************************************************/
  440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  441. "use strict";
  442. __webpack_require__.r(__webpack_exports__);
  443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  444. /* harmony export */ "render": () => (/* binding */ render)
  445. /* harmony export */ });
  446. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  447. var _hoisted_1 = {
  448. key: 0
  449. };
  450. var _hoisted_2 = {
  451. key: 1
  452. };
  453. function render(_ctx, _cache, $props, $setup, $data, $options) {
  454. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  455. 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, {
  456. key: 0,
  457. severity: "success",
  458. onClose: $setup.onClose
  459. }, {
  460. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  461. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  462. /* TEXT */
  463. )];
  464. }),
  465. _: 1
  466. /* STABLE */
  467. })) : (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, {
  468. key: 1,
  469. severity: "error",
  470. onClose: $setup.onClose
  471. }, {
  472. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  473. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  474. /* TEXT */
  475. )];
  476. }),
  477. _: 1
  478. /* STABLE */
  479. })) : (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, {
  480. key: 2,
  481. severity: "error",
  482. onClose: $setup.onClose
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. 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
  486. /* TEXT */
  487. ))];
  488. }),
  489. _: 1
  490. /* STABLE */
  491. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  492. /* STABLE_FRAGMENT */
  493. );
  494. }
  495. /***/ }),
  496. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  497. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  498. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  499. \***********************************************************************************************************************************************************************************************************************************************************************************/
  500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  501. "use strict";
  502. __webpack_require__.r(__webpack_exports__);
  503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  504. /* harmony export */ "render": () => (/* binding */ render)
  505. /* harmony export */ });
  506. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  507. var _hoisted_1 = {
  508. key: 0,
  509. "class": "p-paginator p-component flex justify-content-start"
  510. };
  511. var _hoisted_2 = {
  512. "class": "p-paginator-pages"
  513. };
  514. var _hoisted_3 = ["innerHTML"];
  515. function render(_ctx, _cache, $props, $setup, $data, $options) {
  516. 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) {
  517. 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", {
  518. key: "link-".concat(key),
  519. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  520. 'p-disabled': link
  521. }]),
  522. innerHTML: link.label
  523. }, null, 10
  524. /* CLASS, PROPS */
  525. , _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"], {
  526. key: "link-".concat(key),
  527. href: link.url,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'p-highlight': link.active
  530. }, "p-paginator-page p-paginator-element p-link"]),
  531. innerHTML: link.label
  532. }, null, 8
  533. /* PROPS */
  534. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  535. /* STABLE_FRAGMENT */
  536. );
  537. }), 256
  538. /* UNKEYED_FRAGMENT */
  539. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  540. }
  541. /***/ }),
  542. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  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/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  545. \********************************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. function render(_ctx, _cache, $props, $setup, $data, $options) {
  554. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  555. "class": "layout-menu",
  556. items: $props.menu,
  557. root: true
  558. }, null, 8
  559. /* PROPS */
  560. , ["items"])]);
  561. }
  562. /***/ }),
  563. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  564. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  565. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  566. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  567. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  568. "use strict";
  569. __webpack_require__.r(__webpack_exports__);
  570. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  571. /* harmony export */ "render": () => (/* binding */ render)
  572. /* harmony export */ });
  573. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  574. var _withScopeId = function _withScopeId(n) {
  575. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  576. };
  577. var _hoisted_1 = {
  578. key: 0
  579. };
  580. var _hoisted_2 = ["aria-label"];
  581. var _hoisted_3 = ["aria-label"];
  582. function render(_ctx, _cache, $props, $setup, $data, $options) {
  583. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  584. 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) {
  585. 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", {
  586. key: i,
  587. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  588. 'layout-menuitem-category': $props.root
  589. }]),
  590. role: "none"
  591. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  592. key: 0
  593. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  594. "class": "layout-menuitem-root-text",
  595. "aria-label": item.label
  596. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  597. /* TEXT, PROPS */
  598. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  599. items: item.items
  600. }, null, 8
  601. /* PROPS */
  602. , ["items"])], 64
  603. /* STABLE_FRAGMENT */
  604. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  605. key: 1
  606. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  607. key: 0,
  608. role: "menuitem",
  609. href: item.to,
  610. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  611. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  612. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  613. }]),
  614. "aria-label": item.label
  615. }, {
  616. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  617. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  618. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  619. }, null, 2
  620. /* CLASS */
  621. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  622. /* TEXT */
  623. )];
  624. }),
  625. _: 2
  626. /* DYNAMIC */
  627. }, 1032
  628. /* PROPS, DYNAMIC_SLOTS */
  629. , ["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", {
  630. key: 1,
  631. href: "#",
  632. role: "menuitem",
  633. "aria-label": item.label
  634. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  635. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  636. }, null, 2
  637. /* CLASS */
  638. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  639. /* TEXT */
  640. )], 8
  641. /* PROPS */
  642. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  643. items: item.items
  644. }, null, 8
  645. /* PROPS */
  646. , ["items"])], 64
  647. /* STABLE_FRAGMENT */
  648. ))], 2
  649. /* CLASS */
  650. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  651. /* STABLE_FRAGMENT */
  652. );
  653. }), 256
  654. /* UNKEYED_FRAGMENT */
  655. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  656. }
  657. /***/ }),
  658. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  659. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  660. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  661. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  662. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  663. "use strict";
  664. __webpack_require__.r(__webpack_exports__);
  665. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  666. /* harmony export */ "render": () => (/* binding */ render)
  667. /* harmony export */ });
  668. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  669. var _withScopeId = function _withScopeId(n) {
  670. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  671. };
  672. var _hoisted_1 = {
  673. "class": "layout-topbar"
  674. };
  675. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  676. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  677. alt: "Logo",
  678. src: "/images/logo.svg",
  679. "class": "md:mr-3"
  680. }, null, -1
  681. /* HOISTED */
  682. );
  683. });
  684. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  685. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  690. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  691. "class": "pi pi-bars"
  692. }, null, -1
  693. /* HOISTED */
  694. );
  695. });
  696. var _hoisted_5 = [_hoisted_4];
  697. var _hoisted_6 = {
  698. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  699. };
  700. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  701. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  702. "class": "pi pi-ellipsis-v"
  703. }, null, -1
  704. /* HOISTED */
  705. );
  706. });
  707. var _hoisted_8 = [_hoisted_7];
  708. var _hoisted_9 = {
  709. "class": "layout-topbar-menu hidden lg:flex origin-top"
  710. };
  711. var _hoisted_10 = {
  712. "class": "align-self-center"
  713. };
  714. var _hoisted_11 = {
  715. "class": "hidden lg:inline"
  716. };
  717. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  718. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  719. "class": "pi pi-user"
  720. }, null, -1
  721. /* HOISTED */
  722. );
  723. });
  724. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  725. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  726. /* HOISTED */
  727. );
  728. });
  729. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  730. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  731. "class": "pi pi-sign-out"
  732. }, null, -1
  733. /* HOISTED */
  734. );
  735. });
  736. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  737. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  738. /* HOISTED */
  739. );
  740. });
  741. function render(_ctx, _cache, $props, $setup, $data, $options) {
  742. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  743. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  744. 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"], {
  745. href: "/",
  746. "class": "layout-topbar-logo"
  747. }, {
  748. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  749. return [_hoisted_2, _hoisted_3];
  750. }),
  751. _: 1
  752. /* STABLE */
  753. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  754. "class": "p-link layout-menu-button layout-topbar-button",
  755. onClick: _cache[0] || (_cache[0] = function ($event) {
  756. return _ctx.$emit('menu-toggle', $event);
  757. })
  758. }, _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, {
  759. selector: '@next',
  760. enterClass: 'hidden',
  761. enterActiveClass: 'scalein',
  762. leaveToClass: 'hidden',
  763. leaveActiveClass: 'fadeout',
  764. hideOnOutsideClick: true
  765. }]]), (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
  766. /* TEXT */
  767. )]), (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"], {
  768. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  769. "class": "p-link layout-topbar-button"
  770. }, {
  771. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  772. return [_hoisted_12, _hoisted_13];
  773. }),
  774. _: 1
  775. /* STABLE */
  776. }, 8
  777. /* PROPS */
  778. , ["href"])), [[_directive_tooltip, {
  779. value: 'Ubah Profil',
  780. "class": 'layout-topbar-menu-tooltip'
  781. }, void 0, {
  782. bottom: true
  783. }]])]), (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"], {
  784. href: _ctx.route('logout'),
  785. as: "button",
  786. method: "post",
  787. "class": "p-link layout-topbar-button"
  788. }, {
  789. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  790. return [_hoisted_14, _hoisted_15];
  791. }),
  792. _: 1
  793. /* STABLE */
  794. }, 8
  795. /* PROPS */
  796. , ["href"])), [[_directive_tooltip, {
  797. value: 'Keluar',
  798. "class": 'layout-topbar-menu-tooltip'
  799. }, void 0, {
  800. bottom: true
  801. }]])])])]);
  802. }
  803. /***/ }),
  804. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  805. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  806. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  807. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  808. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  809. "use strict";
  810. __webpack_require__.r(__webpack_exports__);
  811. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  812. /* harmony export */ "render": () => (/* binding */ render)
  813. /* harmony export */ });
  814. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  815. var _withScopeId = function _withScopeId(n) {
  816. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  817. };
  818. var _hoisted_1 = {
  819. "class": "layout-sidebar"
  820. };
  821. var _hoisted_2 = {
  822. "class": "layout-main-container"
  823. };
  824. var _hoisted_3 = {
  825. "class": "layout-main"
  826. };
  827. var _hoisted_4 = {
  828. key: 0,
  829. "class": "layout-mask p-component-overlay"
  830. };
  831. function render(_ctx, _cache, $props, $setup, $data, $options) {
  832. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  833. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  834. onClick: $setup.onWrapperClick
  835. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  836. onMenuToggle: $setup.onMenuToggle
  837. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  838. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  839. }, null, 8
  840. /* PROPS */
  841. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  842. name: "layout-mask"
  843. }, {
  844. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  845. 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)];
  846. }),
  847. _: 1
  848. /* STABLE */
  849. })], 2
  850. /* CLASS */
  851. );
  852. }
  853. /***/ }),
  854. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/mutation/Report.vue?vue&type=template&id=289c9421":
  855. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  856. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/mutation/Report.vue?vue&type=template&id=289c9421 ***!
  857. \********************************************************************************************************************************************************************************************************************************************************************************/
  858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  859. "use strict";
  860. __webpack_require__.r(__webpack_exports__);
  861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  862. /* harmony export */ "render": () => (/* binding */ render)
  863. /* harmony export */ });
  864. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  865. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Laporan Mutasi", -1
  866. /* HOISTED */
  867. );
  868. var _hoisted_2 = {
  869. "class": "grid"
  870. };
  871. var _hoisted_3 = {
  872. "class": "col-12 md:col-8"
  873. };
  874. var _hoisted_4 = {
  875. "class": "grid"
  876. };
  877. var _hoisted_5 = {
  878. "class": "col-12 md:col-4"
  879. };
  880. var _hoisted_6 = {
  881. "class": "col-auto mt-2 ml-2"
  882. };
  883. var _hoisted_7 = {
  884. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  885. };
  886. var _hoisted_8 = {
  887. key: 0,
  888. "class": "grid mt-5 ml-1"
  889. };
  890. var _hoisted_9 = {
  891. "class": "col-auto mr-7"
  892. };
  893. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  894. "class": "text-base"
  895. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  896. "class": "pi pi-wallet"
  897. }), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Pendapatan")], -1
  898. /* HOISTED */
  899. );
  900. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
  901. /* HOISTED */
  902. );
  903. var _hoisted_12 = {
  904. "class": "text-xl font-bold"
  905. };
  906. var _hoisted_13 = {
  907. "class": "col-auto mr-7"
  908. };
  909. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  910. "class": "text-base"
  911. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  912. "class": "pi pi-wallet"
  913. }), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Pengeluaran")], -1
  914. /* HOISTED */
  915. );
  916. var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
  917. /* HOISTED */
  918. );
  919. var _hoisted_16 = {
  920. "class": "text-xl font-bold"
  921. };
  922. var _hoisted_17 = {
  923. "class": "col-auto"
  924. };
  925. var _hoisted_18 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  926. "class": "text-base"
  927. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  928. "class": "pi pi-wallet"
  929. }), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Total ")], -1
  930. /* HOISTED */
  931. );
  932. var _hoisted_19 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
  933. /* HOISTED */
  934. );
  935. var _hoisted_20 = {
  936. "class": "text-xl font-bold"
  937. };
  938. function render(_ctx, _cache, $props, $setup, $data, $options) {
  939. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  940. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  941. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  942. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  943. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  944. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  945. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  946. title: "Laporan Mutasi"
  947. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  948. "responsive-layout": "scroll",
  949. "column-resize-mode": "expand",
  950. value: $props.mutations.details.data,
  951. "row-hover": true,
  952. "striped-rows": true
  953. }, {
  954. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  955. 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__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  956. "touch-u-i": "",
  957. "class": "w-full",
  958. modelValue: $setup.dates,
  959. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  960. return $setup.dates = $event;
  961. }),
  962. "selection-mode": "range",
  963. placeholder: "filter waktu...",
  964. "date-format": "dd/mm/yy",
  965. "manual-input": false
  966. }, null, 8
  967. /* PROPS */
  968. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  969. label: "reset",
  970. "class": "p-button-link",
  971. onClick: $setup.filterReset
  972. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [$props.mutations.details.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButtonLink"], {
  973. key: 0,
  974. label: "Export excel",
  975. "class-button": "p-button-outlined md:w-16rem",
  976. icon: "pi pi-file-excel",
  977. "inertia-link": false,
  978. href: $setup.exportExcelLink
  979. }, null, 8
  980. /* PROPS */
  981. , ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]), $props.mutations.totalAmount ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_10, _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalIncome), 1
  982. /* TEXT */
  983. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_13, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_14, _hoisted_15, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_16, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalExpense), 1
  984. /* TEXT */
  985. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_18, _hoisted_19, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_20, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalAmount), 1
  986. /* TEXT */
  987. )])])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  988. }),
  989. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  990. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  991. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  992. field: value.field,
  993. header: value.header,
  994. key: value.field
  995. }, null, 8
  996. /* PROPS */
  997. , ["field", "header"]);
  998. }), 128
  999. /* KEYED_FRAGMENT */
  1000. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1001. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1002. var data = _ref.data;
  1003. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  1004. icon: "pi pi-link",
  1005. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  1006. href: $setup.linkReference(data)
  1007. }, null, 8
  1008. /* PROPS */
  1009. , ["href"])];
  1010. }),
  1011. _: 1
  1012. /* STABLE */
  1013. })];
  1014. }),
  1015. _: 1
  1016. /* STABLE */
  1017. }, 8
  1018. /* PROPS */
  1019. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1020. links: $props.mutations.details.links
  1021. }, null, 8
  1022. /* PROPS */
  1023. , ["links"])];
  1024. }),
  1025. _: 1
  1026. /* STABLE */
  1027. });
  1028. }
  1029. /***/ }),
  1030. /***/ "./resources/js/components/useDateRangeFilter.js":
  1031. /*!*******************************************************!*\
  1032. !*** ./resources/js/components/useDateRangeFilter.js ***!
  1033. \*******************************************************/
  1034. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1035. "use strict";
  1036. __webpack_require__.r(__webpack_exports__);
  1037. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1038. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  1039. /* harmony export */ });
  1040. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1041. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  1042. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  1043. function useDateRangeFilter(props) {
  1044. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1045. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1046. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1047. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1048. if (!props.initialDateRange) {
  1049. return;
  1050. }
  1051. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  1052. if (props.initialDateRange[1]) {
  1053. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  1054. } else {
  1055. dates.value = [new Date(props.props.initialDateRange[1]), null];
  1056. }
  1057. }
  1058. });
  1059. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  1060. if (dates.value[1]) {
  1061. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1062. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  1063. } else if (dates.value[0]) {
  1064. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1065. endDate.value = null;
  1066. }
  1067. });
  1068. return {
  1069. dates: dates,
  1070. startDate: startDate,
  1071. endDate: endDate
  1072. };
  1073. }
  1074. /***/ }),
  1075. /***/ "./resources/js/pages/mutation/tableHeader.js":
  1076. /*!****************************************************!*\
  1077. !*** ./resources/js/pages/mutation/tableHeader.js ***!
  1078. \****************************************************/
  1079. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1080. "use strict";
  1081. __webpack_require__.r(__webpack_exports__);
  1082. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1083. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1084. /* harmony export */ });
  1085. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  1086. field: 'createdAt',
  1087. header: 'Tanggal'
  1088. }, {
  1089. field: 'type',
  1090. header: 'Tipe'
  1091. }, {
  1092. field: 'amount',
  1093. header: 'Nilai'
  1094. }]);
  1095. /***/ }),
  1096. /***/ "./resources/js/utils/menu.js":
  1097. /*!************************************!*\
  1098. !*** ./resources/js/utils/menu.js ***!
  1099. \************************************/
  1100. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1101. "use strict";
  1102. __webpack_require__.r(__webpack_exports__);
  1103. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1104. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1105. /* harmony export */ });
  1106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1107. // Admin
  1108. 1: [{
  1109. label: 'Home',
  1110. items: [{
  1111. label: 'Dashboard',
  1112. icon: 'pi pi-home',
  1113. to: '/dashboards',
  1114. component: 'home/Index'
  1115. }]
  1116. }, {
  1117. label: 'Master',
  1118. items: [{
  1119. label: 'User',
  1120. icon: 'pi pi-user',
  1121. to: '/users',
  1122. component: 'user/Index'
  1123. }]
  1124. }],
  1125. // Supervisor
  1126. 2: [{
  1127. label: 'Home',
  1128. items: [{
  1129. label: 'Dashboard',
  1130. icon: 'pi pi-home',
  1131. to: '/dashboards',
  1132. component: 'home/Index'
  1133. }]
  1134. }, {
  1135. label: 'Menu',
  1136. items: [{
  1137. label: 'Pengeluaran',
  1138. icon: 'pi pi-wallet',
  1139. to: '/expenses',
  1140. component: 'expense/Index'
  1141. }, {
  1142. label: 'Laporan',
  1143. icon: 'pi pi-book',
  1144. items: [{
  1145. label: 'Mutasi',
  1146. icon: 'pi pi-circle',
  1147. to: '/reports/mutations',
  1148. component: 'mutation/Report'
  1149. }]
  1150. }]
  1151. }, {
  1152. label: 'Master',
  1153. items: [{
  1154. label: 'Jenis Kendaraan',
  1155. icon: 'pi pi-car',
  1156. to: '/type-vehicles',
  1157. component: 'typevehicle/Index'
  1158. }, {
  1159. label: 'Jenis Member',
  1160. icon: 'pi pi-id-card',
  1161. to: '/type-members',
  1162. component: 'typemember/Index'
  1163. }]
  1164. }, {
  1165. label: 'Pengaturan',
  1166. items: [{
  1167. label: 'Tarif Parkir',
  1168. icon: 'pi pi-car',
  1169. to: '/parking-fees/create',
  1170. component: 'parkingfee/Create'
  1171. }]
  1172. }],
  1173. // Operator
  1174. 3: [{
  1175. label: 'Home',
  1176. items: [{
  1177. label: 'Dashboard',
  1178. icon: 'pi pi-home',
  1179. to: '/dashboards',
  1180. component: 'home/Index'
  1181. }]
  1182. }, {
  1183. label: 'Transaksi',
  1184. items: [{
  1185. label: 'Transaksi masuk dan keluar',
  1186. icon: 'pi pi-car',
  1187. to: '/transactions/create',
  1188. component: 'transaction/Create'
  1189. }]
  1190. }, {
  1191. label: 'Menu',
  1192. items: [{
  1193. label: 'Pengeluaran',
  1194. icon: 'pi pi-wallet',
  1195. to: '/expenses',
  1196. component: 'expense/Index'
  1197. }, {
  1198. label: 'Member',
  1199. icon: 'pi pi-id-card',
  1200. to: '/members',
  1201. component: 'member/Index'
  1202. }, {
  1203. label: 'Top Up',
  1204. icon: 'pi pi-car',
  1205. to: '/top-ups',
  1206. component: 'topup/Index'
  1207. }]
  1208. }]
  1209. });
  1210. /***/ }),
  1211. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1212. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1213. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1214. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1215. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1216. "use strict";
  1217. __webpack_require__.r(__webpack_exports__);
  1218. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1219. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1220. /* harmony export */ });
  1221. /* 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");
  1222. /* 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__);
  1223. // Imports
  1224. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1225. // Module
  1226. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1227. // Exports
  1228. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1229. /***/ }),
  1230. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1231. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1232. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1233. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1234. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1235. "use strict";
  1236. __webpack_require__.r(__webpack_exports__);
  1237. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1238. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1239. /* harmony export */ });
  1240. /* 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");
  1241. /* 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__);
  1242. // Imports
  1243. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1244. // Module
  1245. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1246. // Exports
  1247. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1248. /***/ }),
  1249. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1250. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1251. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1252. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1253. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1254. "use strict";
  1255. __webpack_require__.r(__webpack_exports__);
  1256. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1257. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1258. /* harmony export */ });
  1259. /* 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");
  1260. /* 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__);
  1261. // Imports
  1262. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1263. // Module
  1264. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1265. // Exports
  1266. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1267. /***/ }),
  1268. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1269. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1270. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1271. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1272. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1273. "use strict";
  1274. __webpack_require__.r(__webpack_exports__);
  1275. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1276. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1277. /* harmony export */ });
  1278. /* 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");
  1279. /* 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__);
  1280. // Imports
  1281. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1282. // Module
  1283. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1284. // Exports
  1285. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1286. /***/ }),
  1287. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1288. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1289. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1290. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1291. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1292. "use strict";
  1293. __webpack_require__.r(__webpack_exports__);
  1294. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1295. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1296. /* harmony export */ });
  1297. /* 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");
  1298. /* 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__);
  1299. // Imports
  1300. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1301. // Module
  1302. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1303. // Exports
  1304. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1305. /***/ }),
  1306. /***/ "./node_modules/dayjs/dayjs.min.js":
  1307. /*!*****************************************!*\
  1308. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1309. \*****************************************/
  1310. /***/ (function(module) {
  1311. !function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",f="month",h="quarter",c="year",d="date",$="Invalid Date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,f),s=n-i<0,u=e.clone().add(r+(s?-1:1),f);return+(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:f,y:c,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:h}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},v="en",D={};D[v]=M;var p=function(t){return t instanceof _},S=function t(e,n,r){var i;if(!e)return v;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(v=i),i||!r&&v},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},O=g;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(l);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===$)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<w(t)},m.$g=function(t,e,n){return O.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!O.u(e)||e,h=O.p(t),$=function(t,e){var i=O.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},l=function(t,e){return O.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,g="set"+(this.$u?"UTC":"");switch(h){case c:return r?$(1,0):$(31,11);case f:return r?$(1,M):$(0,M+1);case o:var v=this.$locale().weekStart||0,D=(y<v?y+7:y)-v;return $(r?m-D:m+(6-D),M);case a:case d:return l(g+"Hours",0);case u:return l(g+"Minutes",1);case s:return l(g+"Seconds",2);case i:return l(g+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var n,o=O.p(t),h="set"+(this.$u?"UTC":""),$=(n={},n[a]=h+"Date",n[d]=h+"Date",n[f]=h+"Month",n[c]=h+"FullYear",n[u]=h+"Hours",n[s]=h+"Minutes",n[i]=h+"Seconds",n[r]=h+"Milliseconds",n)[o],l=o===a?this.$D+(e-this.$W):e;if(o===f||o===c){var y=this.clone().set(d,1);y.$d[$](l),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d}else $&&this.$d[$](l);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[O.p(t)]()},m.add=function(r,h){var d,$=this;r=Number(r);var l=O.p(h),y=function(t){var e=w($);return O.w(e.date(e.date()+Math.round(t*r)),$)};if(l===f)return this.set(f,this.$M+r);if(l===c)return this.set(c,this.$y+r);if(l===a)return y(1);if(l===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[l]||1,m=this.$d.getTime()+r*M;return O.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||$;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=O.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,f=n.months,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},c=function(t){return O.s(s%12||12,t,"0")},d=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},l={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:O.s(a+1,2,"0"),MMM:h(n.monthsShort,a,f,3),MMMM:h(f,a),D:this.$D,DD:O.s(this.$D,2,"0"),d:String(this.$W),dd:h(n.weekdaysMin,this.$W,o,2),ddd:h(n.weekdaysShort,this.$W,o,3),dddd:o[this.$W],H:String(s),HH:O.s(s,2,"0"),h:c(1),hh:c(2),a:d(s,u,!0),A:d(s,u,!1),m:String(u),mm:O.s(u,2,"0"),s:String(this.$s),ss:O.s(this.$s,2,"0"),SSS:O.s(this.$ms,3,"0"),Z:i};return r.replace(y,(function(t,e){return e||l[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,$){var l,y=O.p(d),M=w(r),m=(M.utcOffset()-this.utcOffset())*e,g=this-M,v=O.m(this,M);return v=(l={},l[c]=v/12,l[f]=v,l[h]=v/3,l[o]=(g-m)/6048e5,l[a]=(g-m)/864e5,l[u]=g/n,l[s]=g/e,l[i]=g/t,l)[y]||g,$?v:O.a(v)},m.daysInMonth=function(){return this.endOf(f).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return O.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),T=_.prototype;return w.prototype=T,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",f],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),w.extend=function(t,e){return t.$i||(t(e,_,w),t.$i=!0),w},w.locale=S,w.isDayjs=p,w.unix=function(t){return w(1e3*t)},w.en=D[v],w.Ls=D,w.p={},w}));
  1312. /***/ }),
  1313. /***/ "./node_modules/lodash/lodash.js":
  1314. /*!***************************************!*\
  1315. !*** ./node_modules/lodash/lodash.js ***!
  1316. \***************************************/
  1317. /***/ (function(module, exports, __webpack_require__) {
  1318. /* module decorator */ module = __webpack_require__.nmd(module);
  1319. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1320. * @license
  1321. * Lodash <https://lodash.com/>
  1322. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1323. * Released under MIT license <https://lodash.com/license>
  1324. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1325. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1326. */
  1327. ;(function() {
  1328. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1329. var undefined;
  1330. /** Used as the semantic version number. */
  1331. var VERSION = '4.17.21';
  1332. /** Used as the size to enable large array optimizations. */
  1333. var LARGE_ARRAY_SIZE = 200;
  1334. /** Error message constants. */
  1335. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1336. FUNC_ERROR_TEXT = 'Expected a function',
  1337. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1338. /** Used to stand-in for `undefined` hash values. */
  1339. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1340. /** Used as the maximum memoize cache size. */
  1341. var MAX_MEMOIZE_SIZE = 500;
  1342. /** Used as the internal argument placeholder. */
  1343. var PLACEHOLDER = '__lodash_placeholder__';
  1344. /** Used to compose bitmasks for cloning. */
  1345. var CLONE_DEEP_FLAG = 1,
  1346. CLONE_FLAT_FLAG = 2,
  1347. CLONE_SYMBOLS_FLAG = 4;
  1348. /** Used to compose bitmasks for value comparisons. */
  1349. var COMPARE_PARTIAL_FLAG = 1,
  1350. COMPARE_UNORDERED_FLAG = 2;
  1351. /** Used to compose bitmasks for function metadata. */
  1352. var WRAP_BIND_FLAG = 1,
  1353. WRAP_BIND_KEY_FLAG = 2,
  1354. WRAP_CURRY_BOUND_FLAG = 4,
  1355. WRAP_CURRY_FLAG = 8,
  1356. WRAP_CURRY_RIGHT_FLAG = 16,
  1357. WRAP_PARTIAL_FLAG = 32,
  1358. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1359. WRAP_ARY_FLAG = 128,
  1360. WRAP_REARG_FLAG = 256,
  1361. WRAP_FLIP_FLAG = 512;
  1362. /** Used as default options for `_.truncate`. */
  1363. var DEFAULT_TRUNC_LENGTH = 30,
  1364. DEFAULT_TRUNC_OMISSION = '...';
  1365. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1366. var HOT_COUNT = 800,
  1367. HOT_SPAN = 16;
  1368. /** Used to indicate the type of lazy iteratees. */
  1369. var LAZY_FILTER_FLAG = 1,
  1370. LAZY_MAP_FLAG = 2,
  1371. LAZY_WHILE_FLAG = 3;
  1372. /** Used as references for various `Number` constants. */
  1373. var INFINITY = 1 / 0,
  1374. MAX_SAFE_INTEGER = 9007199254740991,
  1375. MAX_INTEGER = 1.7976931348623157e+308,
  1376. NAN = 0 / 0;
  1377. /** Used as references for the maximum length and index of an array. */
  1378. var MAX_ARRAY_LENGTH = 4294967295,
  1379. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1380. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1381. /** Used to associate wrap methods with their bit flags. */
  1382. var wrapFlags = [
  1383. ['ary', WRAP_ARY_FLAG],
  1384. ['bind', WRAP_BIND_FLAG],
  1385. ['bindKey', WRAP_BIND_KEY_FLAG],
  1386. ['curry', WRAP_CURRY_FLAG],
  1387. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1388. ['flip', WRAP_FLIP_FLAG],
  1389. ['partial', WRAP_PARTIAL_FLAG],
  1390. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1391. ['rearg', WRAP_REARG_FLAG]
  1392. ];
  1393. /** `Object#toString` result references. */
  1394. var argsTag = '[object Arguments]',
  1395. arrayTag = '[object Array]',
  1396. asyncTag = '[object AsyncFunction]',
  1397. boolTag = '[object Boolean]',
  1398. dateTag = '[object Date]',
  1399. domExcTag = '[object DOMException]',
  1400. errorTag = '[object Error]',
  1401. funcTag = '[object Function]',
  1402. genTag = '[object GeneratorFunction]',
  1403. mapTag = '[object Map]',
  1404. numberTag = '[object Number]',
  1405. nullTag = '[object Null]',
  1406. objectTag = '[object Object]',
  1407. promiseTag = '[object Promise]',
  1408. proxyTag = '[object Proxy]',
  1409. regexpTag = '[object RegExp]',
  1410. setTag = '[object Set]',
  1411. stringTag = '[object String]',
  1412. symbolTag = '[object Symbol]',
  1413. undefinedTag = '[object Undefined]',
  1414. weakMapTag = '[object WeakMap]',
  1415. weakSetTag = '[object WeakSet]';
  1416. var arrayBufferTag = '[object ArrayBuffer]',
  1417. dataViewTag = '[object DataView]',
  1418. float32Tag = '[object Float32Array]',
  1419. float64Tag = '[object Float64Array]',
  1420. int8Tag = '[object Int8Array]',
  1421. int16Tag = '[object Int16Array]',
  1422. int32Tag = '[object Int32Array]',
  1423. uint8Tag = '[object Uint8Array]',
  1424. uint8ClampedTag = '[object Uint8ClampedArray]',
  1425. uint16Tag = '[object Uint16Array]',
  1426. uint32Tag = '[object Uint32Array]';
  1427. /** Used to match empty string literals in compiled template source. */
  1428. var reEmptyStringLeading = /\b__p \+= '';/g,
  1429. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1430. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1431. /** Used to match HTML entities and HTML characters. */
  1432. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1433. reUnescapedHtml = /[&<>"']/g,
  1434. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1435. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1436. /** Used to match template delimiters. */
  1437. var reEscape = /<%-([\s\S]+?)%>/g,
  1438. reEvaluate = /<%([\s\S]+?)%>/g,
  1439. reInterpolate = /<%=([\s\S]+?)%>/g;
  1440. /** Used to match property names within property paths. */
  1441. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1442. reIsPlainProp = /^\w*$/,
  1443. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1444. /**
  1445. * Used to match `RegExp`
  1446. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1447. */
  1448. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1449. reHasRegExpChar = RegExp(reRegExpChar.source);
  1450. /** Used to match leading whitespace. */
  1451. var reTrimStart = /^\s+/;
  1452. /** Used to match a single whitespace character. */
  1453. var reWhitespace = /\s/;
  1454. /** Used to match wrap detail comments. */
  1455. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1456. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1457. reSplitDetails = /,? & /;
  1458. /** Used to match words composed of alphanumeric characters. */
  1459. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1460. /**
  1461. * Used to validate the `validate` option in `_.template` variable.
  1462. *
  1463. * Forbids characters which could potentially change the meaning of the function argument definition:
  1464. * - "()," (modification of function parameters)
  1465. * - "=" (default value)
  1466. * - "[]{}" (destructuring of function parameters)
  1467. * - "/" (beginning of a comment)
  1468. * - whitespace
  1469. */
  1470. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1471. /** Used to match backslashes in property paths. */
  1472. var reEscapeChar = /\\(\\)?/g;
  1473. /**
  1474. * Used to match
  1475. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1476. */
  1477. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1478. /** Used to match `RegExp` flags from their coerced string values. */
  1479. var reFlags = /\w*$/;
  1480. /** Used to detect bad signed hexadecimal string values. */
  1481. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1482. /** Used to detect binary string values. */
  1483. var reIsBinary = /^0b[01]+$/i;
  1484. /** Used to detect host constructors (Safari). */
  1485. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1486. /** Used to detect octal string values. */
  1487. var reIsOctal = /^0o[0-7]+$/i;
  1488. /** Used to detect unsigned integer values. */
  1489. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1490. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1491. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1492. /** Used to ensure capturing order of template delimiters. */
  1493. var reNoMatch = /($^)/;
  1494. /** Used to match unescaped characters in compiled string literals. */
  1495. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1496. /** Used to compose unicode character classes. */
  1497. var rsAstralRange = '\\ud800-\\udfff',
  1498. rsComboMarksRange = '\\u0300-\\u036f',
  1499. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1500. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1501. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1502. rsDingbatRange = '\\u2700-\\u27bf',
  1503. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1504. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1505. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1506. rsPunctuationRange = '\\u2000-\\u206f',
  1507. 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',
  1508. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1509. rsVarRange = '\\ufe0e\\ufe0f',
  1510. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1511. /** Used to compose unicode capture groups. */
  1512. var rsApos = "['\u2019]",
  1513. rsAstral = '[' + rsAstralRange + ']',
  1514. rsBreak = '[' + rsBreakRange + ']',
  1515. rsCombo = '[' + rsComboRange + ']',
  1516. rsDigits = '\\d+',
  1517. rsDingbat = '[' + rsDingbatRange + ']',
  1518. rsLower = '[' + rsLowerRange + ']',
  1519. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1520. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1521. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1522. rsNonAstral = '[^' + rsAstralRange + ']',
  1523. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1524. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1525. rsUpper = '[' + rsUpperRange + ']',
  1526. rsZWJ = '\\u200d';
  1527. /** Used to compose unicode regexes. */
  1528. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1529. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1530. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1531. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1532. reOptMod = rsModifier + '?',
  1533. rsOptVar = '[' + rsVarRange + ']?',
  1534. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1535. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1536. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1537. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1538. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1539. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1540. /** Used to match apostrophes. */
  1541. var reApos = RegExp(rsApos, 'g');
  1542. /**
  1543. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1544. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1545. */
  1546. var reComboMark = RegExp(rsCombo, 'g');
  1547. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1548. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1549. /** Used to match complex or compound words. */
  1550. var reUnicodeWord = RegExp([
  1551. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1552. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1553. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1554. rsUpper + '+' + rsOptContrUpper,
  1555. rsOrdUpper,
  1556. rsOrdLower,
  1557. rsDigits,
  1558. rsEmoji
  1559. ].join('|'), 'g');
  1560. /** 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/). */
  1561. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1562. /** Used to detect strings that need a more robust regexp to match words. */
  1563. 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 ]/;
  1564. /** Used to assign default `context` object properties. */
  1565. var contextProps = [
  1566. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1567. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1568. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1569. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1570. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1571. ];
  1572. /** Used to make template sourceURLs easier to identify. */
  1573. var templateCounter = -1;
  1574. /** Used to identify `toStringTag` values of typed arrays. */
  1575. var typedArrayTags = {};
  1576. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1577. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1578. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1579. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1580. typedArrayTags[uint32Tag] = true;
  1581. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1582. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1583. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1584. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1585. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1586. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1587. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1588. typedArrayTags[weakMapTag] = false;
  1589. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1590. var cloneableTags = {};
  1591. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1592. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1593. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1594. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1595. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1596. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1597. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1598. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1599. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1600. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1601. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1602. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1603. cloneableTags[weakMapTag] = false;
  1604. /** Used to map Latin Unicode letters to basic Latin letters. */
  1605. var deburredLetters = {
  1606. // Latin-1 Supplement block.
  1607. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1608. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1609. '\xc7': 'C', '\xe7': 'c',
  1610. '\xd0': 'D', '\xf0': 'd',
  1611. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1612. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1613. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1614. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1615. '\xd1': 'N', '\xf1': 'n',
  1616. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1617. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1618. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1619. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1620. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1621. '\xc6': 'Ae', '\xe6': 'ae',
  1622. '\xde': 'Th', '\xfe': 'th',
  1623. '\xdf': 'ss',
  1624. // Latin Extended-A block.
  1625. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1626. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1627. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1628. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1629. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1630. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1631. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1632. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1633. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1634. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1635. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1636. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1637. '\u0134': 'J', '\u0135': 'j',
  1638. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1639. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1640. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1641. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1642. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1643. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1644. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1645. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1646. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1647. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1648. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1649. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1650. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1651. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1652. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1653. '\u0174': 'W', '\u0175': 'w',
  1654. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1655. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1656. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1657. '\u0132': 'IJ', '\u0133': 'ij',
  1658. '\u0152': 'Oe', '\u0153': 'oe',
  1659. '\u0149': "'n", '\u017f': 's'
  1660. };
  1661. /** Used to map characters to HTML entities. */
  1662. var htmlEscapes = {
  1663. '&': '&amp;',
  1664. '<': '&lt;',
  1665. '>': '&gt;',
  1666. '"': '&quot;',
  1667. "'": '&#39;'
  1668. };
  1669. /** Used to map HTML entities to characters. */
  1670. var htmlUnescapes = {
  1671. '&amp;': '&',
  1672. '&lt;': '<',
  1673. '&gt;': '>',
  1674. '&quot;': '"',
  1675. '&#39;': "'"
  1676. };
  1677. /** Used to escape characters for inclusion in compiled string literals. */
  1678. var stringEscapes = {
  1679. '\\': '\\',
  1680. "'": "'",
  1681. '\n': 'n',
  1682. '\r': 'r',
  1683. '\u2028': 'u2028',
  1684. '\u2029': 'u2029'
  1685. };
  1686. /** Built-in method references without a dependency on `root`. */
  1687. var freeParseFloat = parseFloat,
  1688. freeParseInt = parseInt;
  1689. /** Detect free variable `global` from Node.js. */
  1690. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1691. /** Detect free variable `self`. */
  1692. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1693. /** Used as a reference to the global object. */
  1694. var root = freeGlobal || freeSelf || Function('return this')();
  1695. /** Detect free variable `exports`. */
  1696. var freeExports = true && exports && !exports.nodeType && exports;
  1697. /** Detect free variable `module`. */
  1698. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1699. /** Detect the popular CommonJS extension `module.exports`. */
  1700. var moduleExports = freeModule && freeModule.exports === freeExports;
  1701. /** Detect free variable `process` from Node.js. */
  1702. var freeProcess = moduleExports && freeGlobal.process;
  1703. /** Used to access faster Node.js helpers. */
  1704. var nodeUtil = (function() {
  1705. try {
  1706. // Use `util.types` for Node.js 10+.
  1707. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1708. if (types) {
  1709. return types;
  1710. }
  1711. // Legacy `process.binding('util')` for Node.js < 10.
  1712. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1713. } catch (e) {}
  1714. }());
  1715. /* Node.js helper references. */
  1716. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1717. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1718. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1719. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1720. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1721. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1722. /*--------------------------------------------------------------------------*/
  1723. /**
  1724. * A faster alternative to `Function#apply`, this function invokes `func`
  1725. * with the `this` binding of `thisArg` and the arguments of `args`.
  1726. *
  1727. * @private
  1728. * @param {Function} func The function to invoke.
  1729. * @param {*} thisArg The `this` binding of `func`.
  1730. * @param {Array} args The arguments to invoke `func` with.
  1731. * @returns {*} Returns the result of `func`.
  1732. */
  1733. function apply(func, thisArg, args) {
  1734. switch (args.length) {
  1735. case 0: return func.call(thisArg);
  1736. case 1: return func.call(thisArg, args[0]);
  1737. case 2: return func.call(thisArg, args[0], args[1]);
  1738. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1739. }
  1740. return func.apply(thisArg, args);
  1741. }
  1742. /**
  1743. * A specialized version of `baseAggregator` for arrays.
  1744. *
  1745. * @private
  1746. * @param {Array} [array] The array to iterate over.
  1747. * @param {Function} setter The function to set `accumulator` values.
  1748. * @param {Function} iteratee The iteratee to transform keys.
  1749. * @param {Object} accumulator The initial aggregated object.
  1750. * @returns {Function} Returns `accumulator`.
  1751. */
  1752. function arrayAggregator(array, setter, iteratee, accumulator) {
  1753. var index = -1,
  1754. length = array == null ? 0 : array.length;
  1755. while (++index < length) {
  1756. var value = array[index];
  1757. setter(accumulator, value, iteratee(value), array);
  1758. }
  1759. return accumulator;
  1760. }
  1761. /**
  1762. * A specialized version of `_.forEach` for arrays without support for
  1763. * iteratee shorthands.
  1764. *
  1765. * @private
  1766. * @param {Array} [array] The array to iterate over.
  1767. * @param {Function} iteratee The function invoked per iteration.
  1768. * @returns {Array} Returns `array`.
  1769. */
  1770. function arrayEach(array, iteratee) {
  1771. var index = -1,
  1772. length = array == null ? 0 : array.length;
  1773. while (++index < length) {
  1774. if (iteratee(array[index], index, array) === false) {
  1775. break;
  1776. }
  1777. }
  1778. return array;
  1779. }
  1780. /**
  1781. * A specialized version of `_.forEachRight` for arrays without support for
  1782. * iteratee shorthands.
  1783. *
  1784. * @private
  1785. * @param {Array} [array] The array to iterate over.
  1786. * @param {Function} iteratee The function invoked per iteration.
  1787. * @returns {Array} Returns `array`.
  1788. */
  1789. function arrayEachRight(array, iteratee) {
  1790. var length = array == null ? 0 : array.length;
  1791. while (length--) {
  1792. if (iteratee(array[length], length, array) === false) {
  1793. break;
  1794. }
  1795. }
  1796. return array;
  1797. }
  1798. /**
  1799. * A specialized version of `_.every` for arrays without support for
  1800. * iteratee shorthands.
  1801. *
  1802. * @private
  1803. * @param {Array} [array] The array to iterate over.
  1804. * @param {Function} predicate The function invoked per iteration.
  1805. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1806. * else `false`.
  1807. */
  1808. function arrayEvery(array, predicate) {
  1809. var index = -1,
  1810. length = array == null ? 0 : array.length;
  1811. while (++index < length) {
  1812. if (!predicate(array[index], index, array)) {
  1813. return false;
  1814. }
  1815. }
  1816. return true;
  1817. }
  1818. /**
  1819. * A specialized version of `_.filter` for arrays without support for
  1820. * iteratee shorthands.
  1821. *
  1822. * @private
  1823. * @param {Array} [array] The array to iterate over.
  1824. * @param {Function} predicate The function invoked per iteration.
  1825. * @returns {Array} Returns the new filtered array.
  1826. */
  1827. function arrayFilter(array, predicate) {
  1828. var index = -1,
  1829. length = array == null ? 0 : array.length,
  1830. resIndex = 0,
  1831. result = [];
  1832. while (++index < length) {
  1833. var value = array[index];
  1834. if (predicate(value, index, array)) {
  1835. result[resIndex++] = value;
  1836. }
  1837. }
  1838. return result;
  1839. }
  1840. /**
  1841. * A specialized version of `_.includes` for arrays without support for
  1842. * specifying an index to search from.
  1843. *
  1844. * @private
  1845. * @param {Array} [array] The array to inspect.
  1846. * @param {*} target The value to search for.
  1847. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1848. */
  1849. function arrayIncludes(array, value) {
  1850. var length = array == null ? 0 : array.length;
  1851. return !!length && baseIndexOf(array, value, 0) > -1;
  1852. }
  1853. /**
  1854. * This function is like `arrayIncludes` except that it accepts a comparator.
  1855. *
  1856. * @private
  1857. * @param {Array} [array] The array to inspect.
  1858. * @param {*} target The value to search for.
  1859. * @param {Function} comparator The comparator invoked per element.
  1860. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1861. */
  1862. function arrayIncludesWith(array, value, comparator) {
  1863. var index = -1,
  1864. length = array == null ? 0 : array.length;
  1865. while (++index < length) {
  1866. if (comparator(value, array[index])) {
  1867. return true;
  1868. }
  1869. }
  1870. return false;
  1871. }
  1872. /**
  1873. * A specialized version of `_.map` for arrays without support for iteratee
  1874. * shorthands.
  1875. *
  1876. * @private
  1877. * @param {Array} [array] The array to iterate over.
  1878. * @param {Function} iteratee The function invoked per iteration.
  1879. * @returns {Array} Returns the new mapped array.
  1880. */
  1881. function arrayMap(array, iteratee) {
  1882. var index = -1,
  1883. length = array == null ? 0 : array.length,
  1884. result = Array(length);
  1885. while (++index < length) {
  1886. result[index] = iteratee(array[index], index, array);
  1887. }
  1888. return result;
  1889. }
  1890. /**
  1891. * Appends the elements of `values` to `array`.
  1892. *
  1893. * @private
  1894. * @param {Array} array The array to modify.
  1895. * @param {Array} values The values to append.
  1896. * @returns {Array} Returns `array`.
  1897. */
  1898. function arrayPush(array, values) {
  1899. var index = -1,
  1900. length = values.length,
  1901. offset = array.length;
  1902. while (++index < length) {
  1903. array[offset + index] = values[index];
  1904. }
  1905. return array;
  1906. }
  1907. /**
  1908. * A specialized version of `_.reduce` for arrays without support for
  1909. * iteratee shorthands.
  1910. *
  1911. * @private
  1912. * @param {Array} [array] The array to iterate over.
  1913. * @param {Function} iteratee The function invoked per iteration.
  1914. * @param {*} [accumulator] The initial value.
  1915. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1916. * the initial value.
  1917. * @returns {*} Returns the accumulated value.
  1918. */
  1919. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1920. var index = -1,
  1921. length = array == null ? 0 : array.length;
  1922. if (initAccum && length) {
  1923. accumulator = array[++index];
  1924. }
  1925. while (++index < length) {
  1926. accumulator = iteratee(accumulator, array[index], index, array);
  1927. }
  1928. return accumulator;
  1929. }
  1930. /**
  1931. * A specialized version of `_.reduceRight` for arrays without support for
  1932. * iteratee shorthands.
  1933. *
  1934. * @private
  1935. * @param {Array} [array] The array to iterate over.
  1936. * @param {Function} iteratee The function invoked per iteration.
  1937. * @param {*} [accumulator] The initial value.
  1938. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1939. * the initial value.
  1940. * @returns {*} Returns the accumulated value.
  1941. */
  1942. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1943. var length = array == null ? 0 : array.length;
  1944. if (initAccum && length) {
  1945. accumulator = array[--length];
  1946. }
  1947. while (length--) {
  1948. accumulator = iteratee(accumulator, array[length], length, array);
  1949. }
  1950. return accumulator;
  1951. }
  1952. /**
  1953. * A specialized version of `_.some` for arrays without support for iteratee
  1954. * shorthands.
  1955. *
  1956. * @private
  1957. * @param {Array} [array] The array to iterate over.
  1958. * @param {Function} predicate The function invoked per iteration.
  1959. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1960. * else `false`.
  1961. */
  1962. function arraySome(array, predicate) {
  1963. var index = -1,
  1964. length = array == null ? 0 : array.length;
  1965. while (++index < length) {
  1966. if (predicate(array[index], index, array)) {
  1967. return true;
  1968. }
  1969. }
  1970. return false;
  1971. }
  1972. /**
  1973. * Gets the size of an ASCII `string`.
  1974. *
  1975. * @private
  1976. * @param {string} string The string inspect.
  1977. * @returns {number} Returns the string size.
  1978. */
  1979. var asciiSize = baseProperty('length');
  1980. /**
  1981. * Converts an ASCII `string` to an array.
  1982. *
  1983. * @private
  1984. * @param {string} string The string to convert.
  1985. * @returns {Array} Returns the converted array.
  1986. */
  1987. function asciiToArray(string) {
  1988. return string.split('');
  1989. }
  1990. /**
  1991. * Splits an ASCII `string` into an array of its words.
  1992. *
  1993. * @private
  1994. * @param {string} The string to inspect.
  1995. * @returns {Array} Returns the words of `string`.
  1996. */
  1997. function asciiWords(string) {
  1998. return string.match(reAsciiWord) || [];
  1999. }
  2000. /**
  2001. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2002. * without support for iteratee shorthands, which iterates over `collection`
  2003. * using `eachFunc`.
  2004. *
  2005. * @private
  2006. * @param {Array|Object} collection The collection to inspect.
  2007. * @param {Function} predicate The function invoked per iteration.
  2008. * @param {Function} eachFunc The function to iterate over `collection`.
  2009. * @returns {*} Returns the found element or its key, else `undefined`.
  2010. */
  2011. function baseFindKey(collection, predicate, eachFunc) {
  2012. var result;
  2013. eachFunc(collection, function(value, key, collection) {
  2014. if (predicate(value, key, collection)) {
  2015. result = key;
  2016. return false;
  2017. }
  2018. });
  2019. return result;
  2020. }
  2021. /**
  2022. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2023. * support for iteratee shorthands.
  2024. *
  2025. * @private
  2026. * @param {Array} array The array to inspect.
  2027. * @param {Function} predicate The function invoked per iteration.
  2028. * @param {number} fromIndex The index to search from.
  2029. * @param {boolean} [fromRight] Specify iterating from right to left.
  2030. * @returns {number} Returns the index of the matched value, else `-1`.
  2031. */
  2032. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2033. var length = array.length,
  2034. index = fromIndex + (fromRight ? 1 : -1);
  2035. while ((fromRight ? index-- : ++index < length)) {
  2036. if (predicate(array[index], index, array)) {
  2037. return index;
  2038. }
  2039. }
  2040. return -1;
  2041. }
  2042. /**
  2043. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2044. *
  2045. * @private
  2046. * @param {Array} array The array to inspect.
  2047. * @param {*} value The value to search for.
  2048. * @param {number} fromIndex The index to search from.
  2049. * @returns {number} Returns the index of the matched value, else `-1`.
  2050. */
  2051. function baseIndexOf(array, value, fromIndex) {
  2052. return value === value
  2053. ? strictIndexOf(array, value, fromIndex)
  2054. : baseFindIndex(array, baseIsNaN, fromIndex);
  2055. }
  2056. /**
  2057. * This function is like `baseIndexOf` except that it accepts a comparator.
  2058. *
  2059. * @private
  2060. * @param {Array} array The array to inspect.
  2061. * @param {*} value The value to search for.
  2062. * @param {number} fromIndex The index to search from.
  2063. * @param {Function} comparator The comparator invoked per element.
  2064. * @returns {number} Returns the index of the matched value, else `-1`.
  2065. */
  2066. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2067. var index = fromIndex - 1,
  2068. length = array.length;
  2069. while (++index < length) {
  2070. if (comparator(array[index], value)) {
  2071. return index;
  2072. }
  2073. }
  2074. return -1;
  2075. }
  2076. /**
  2077. * The base implementation of `_.isNaN` without support for number objects.
  2078. *
  2079. * @private
  2080. * @param {*} value The value to check.
  2081. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2082. */
  2083. function baseIsNaN(value) {
  2084. return value !== value;
  2085. }
  2086. /**
  2087. * The base implementation of `_.mean` and `_.meanBy` without support for
  2088. * iteratee shorthands.
  2089. *
  2090. * @private
  2091. * @param {Array} array The array to iterate over.
  2092. * @param {Function} iteratee The function invoked per iteration.
  2093. * @returns {number} Returns the mean.
  2094. */
  2095. function baseMean(array, iteratee) {
  2096. var length = array == null ? 0 : array.length;
  2097. return length ? (baseSum(array, iteratee) / length) : NAN;
  2098. }
  2099. /**
  2100. * The base implementation of `_.property` without support for deep paths.
  2101. *
  2102. * @private
  2103. * @param {string} key The key of the property to get.
  2104. * @returns {Function} Returns the new accessor function.
  2105. */
  2106. function baseProperty(key) {
  2107. return function(object) {
  2108. return object == null ? undefined : object[key];
  2109. };
  2110. }
  2111. /**
  2112. * The base implementation of `_.propertyOf` without support for deep paths.
  2113. *
  2114. * @private
  2115. * @param {Object} object The object to query.
  2116. * @returns {Function} Returns the new accessor function.
  2117. */
  2118. function basePropertyOf(object) {
  2119. return function(key) {
  2120. return object == null ? undefined : object[key];
  2121. };
  2122. }
  2123. /**
  2124. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2125. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2126. *
  2127. * @private
  2128. * @param {Array|Object} collection The collection to iterate over.
  2129. * @param {Function} iteratee The function invoked per iteration.
  2130. * @param {*} accumulator The initial value.
  2131. * @param {boolean} initAccum Specify using the first or last element of
  2132. * `collection` as the initial value.
  2133. * @param {Function} eachFunc The function to iterate over `collection`.
  2134. * @returns {*} Returns the accumulated value.
  2135. */
  2136. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2137. eachFunc(collection, function(value, index, collection) {
  2138. accumulator = initAccum
  2139. ? (initAccum = false, value)
  2140. : iteratee(accumulator, value, index, collection);
  2141. });
  2142. return accumulator;
  2143. }
  2144. /**
  2145. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2146. * sort order of `array` and replaces criteria objects with their corresponding
  2147. * values.
  2148. *
  2149. * @private
  2150. * @param {Array} array The array to sort.
  2151. * @param {Function} comparer The function to define sort order.
  2152. * @returns {Array} Returns `array`.
  2153. */
  2154. function baseSortBy(array, comparer) {
  2155. var length = array.length;
  2156. array.sort(comparer);
  2157. while (length--) {
  2158. array[length] = array[length].value;
  2159. }
  2160. return array;
  2161. }
  2162. /**
  2163. * The base implementation of `_.sum` and `_.sumBy` without support for
  2164. * iteratee shorthands.
  2165. *
  2166. * @private
  2167. * @param {Array} array The array to iterate over.
  2168. * @param {Function} iteratee The function invoked per iteration.
  2169. * @returns {number} Returns the sum.
  2170. */
  2171. function baseSum(array, iteratee) {
  2172. var result,
  2173. index = -1,
  2174. length = array.length;
  2175. while (++index < length) {
  2176. var current = iteratee(array[index]);
  2177. if (current !== undefined) {
  2178. result = result === undefined ? current : (result + current);
  2179. }
  2180. }
  2181. return result;
  2182. }
  2183. /**
  2184. * The base implementation of `_.times` without support for iteratee shorthands
  2185. * or max array length checks.
  2186. *
  2187. * @private
  2188. * @param {number} n The number of times to invoke `iteratee`.
  2189. * @param {Function} iteratee The function invoked per iteration.
  2190. * @returns {Array} Returns the array of results.
  2191. */
  2192. function baseTimes(n, iteratee) {
  2193. var index = -1,
  2194. result = Array(n);
  2195. while (++index < n) {
  2196. result[index] = iteratee(index);
  2197. }
  2198. return result;
  2199. }
  2200. /**
  2201. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2202. * of key-value pairs for `object` corresponding to the property names of `props`.
  2203. *
  2204. * @private
  2205. * @param {Object} object The object to query.
  2206. * @param {Array} props The property names to get values for.
  2207. * @returns {Object} Returns the key-value pairs.
  2208. */
  2209. function baseToPairs(object, props) {
  2210. return arrayMap(props, function(key) {
  2211. return [key, object[key]];
  2212. });
  2213. }
  2214. /**
  2215. * The base implementation of `_.trim`.
  2216. *
  2217. * @private
  2218. * @param {string} string The string to trim.
  2219. * @returns {string} Returns the trimmed string.
  2220. */
  2221. function baseTrim(string) {
  2222. return string
  2223. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2224. : string;
  2225. }
  2226. /**
  2227. * The base implementation of `_.unary` without support for storing metadata.
  2228. *
  2229. * @private
  2230. * @param {Function} func The function to cap arguments for.
  2231. * @returns {Function} Returns the new capped function.
  2232. */
  2233. function baseUnary(func) {
  2234. return function(value) {
  2235. return func(value);
  2236. };
  2237. }
  2238. /**
  2239. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2240. * array of `object` property values corresponding to the property names
  2241. * of `props`.
  2242. *
  2243. * @private
  2244. * @param {Object} object The object to query.
  2245. * @param {Array} props The property names to get values for.
  2246. * @returns {Object} Returns the array of property values.
  2247. */
  2248. function baseValues(object, props) {
  2249. return arrayMap(props, function(key) {
  2250. return object[key];
  2251. });
  2252. }
  2253. /**
  2254. * Checks if a `cache` value for `key` exists.
  2255. *
  2256. * @private
  2257. * @param {Object} cache The cache to query.
  2258. * @param {string} key The key of the entry to check.
  2259. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2260. */
  2261. function cacheHas(cache, key) {
  2262. return cache.has(key);
  2263. }
  2264. /**
  2265. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2266. * that is not found in the character symbols.
  2267. *
  2268. * @private
  2269. * @param {Array} strSymbols The string symbols to inspect.
  2270. * @param {Array} chrSymbols The character symbols to find.
  2271. * @returns {number} Returns the index of the first unmatched string symbol.
  2272. */
  2273. function charsStartIndex(strSymbols, chrSymbols) {
  2274. var index = -1,
  2275. length = strSymbols.length;
  2276. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2277. return index;
  2278. }
  2279. /**
  2280. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2281. * that is not found in the character symbols.
  2282. *
  2283. * @private
  2284. * @param {Array} strSymbols The string symbols to inspect.
  2285. * @param {Array} chrSymbols The character symbols to find.
  2286. * @returns {number} Returns the index of the last unmatched string symbol.
  2287. */
  2288. function charsEndIndex(strSymbols, chrSymbols) {
  2289. var index = strSymbols.length;
  2290. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2291. return index;
  2292. }
  2293. /**
  2294. * Gets the number of `placeholder` occurrences in `array`.
  2295. *
  2296. * @private
  2297. * @param {Array} array The array to inspect.
  2298. * @param {*} placeholder The placeholder to search for.
  2299. * @returns {number} Returns the placeholder count.
  2300. */
  2301. function countHolders(array, placeholder) {
  2302. var length = array.length,
  2303. result = 0;
  2304. while (length--) {
  2305. if (array[length] === placeholder) {
  2306. ++result;
  2307. }
  2308. }
  2309. return result;
  2310. }
  2311. /**
  2312. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2313. * letters to basic Latin letters.
  2314. *
  2315. * @private
  2316. * @param {string} letter The matched letter to deburr.
  2317. * @returns {string} Returns the deburred letter.
  2318. */
  2319. var deburrLetter = basePropertyOf(deburredLetters);
  2320. /**
  2321. * Used by `_.escape` to convert characters to HTML entities.
  2322. *
  2323. * @private
  2324. * @param {string} chr The matched character to escape.
  2325. * @returns {string} Returns the escaped character.
  2326. */
  2327. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2328. /**
  2329. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2330. *
  2331. * @private
  2332. * @param {string} chr The matched character to escape.
  2333. * @returns {string} Returns the escaped character.
  2334. */
  2335. function escapeStringChar(chr) {
  2336. return '\\' + stringEscapes[chr];
  2337. }
  2338. /**
  2339. * Gets the value at `key` of `object`.
  2340. *
  2341. * @private
  2342. * @param {Object} [object] The object to query.
  2343. * @param {string} key The key of the property to get.
  2344. * @returns {*} Returns the property value.
  2345. */
  2346. function getValue(object, key) {
  2347. return object == null ? undefined : object[key];
  2348. }
  2349. /**
  2350. * Checks if `string` contains Unicode symbols.
  2351. *
  2352. * @private
  2353. * @param {string} string The string to inspect.
  2354. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2355. */
  2356. function hasUnicode(string) {
  2357. return reHasUnicode.test(string);
  2358. }
  2359. /**
  2360. * Checks if `string` contains a word composed of Unicode symbols.
  2361. *
  2362. * @private
  2363. * @param {string} string The string to inspect.
  2364. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2365. */
  2366. function hasUnicodeWord(string) {
  2367. return reHasUnicodeWord.test(string);
  2368. }
  2369. /**
  2370. * Converts `iterator` to an array.
  2371. *
  2372. * @private
  2373. * @param {Object} iterator The iterator to convert.
  2374. * @returns {Array} Returns the converted array.
  2375. */
  2376. function iteratorToArray(iterator) {
  2377. var data,
  2378. result = [];
  2379. while (!(data = iterator.next()).done) {
  2380. result.push(data.value);
  2381. }
  2382. return result;
  2383. }
  2384. /**
  2385. * Converts `map` to its key-value pairs.
  2386. *
  2387. * @private
  2388. * @param {Object} map The map to convert.
  2389. * @returns {Array} Returns the key-value pairs.
  2390. */
  2391. function mapToArray(map) {
  2392. var index = -1,
  2393. result = Array(map.size);
  2394. map.forEach(function(value, key) {
  2395. result[++index] = [key, value];
  2396. });
  2397. return result;
  2398. }
  2399. /**
  2400. * Creates a unary function that invokes `func` with its argument transformed.
  2401. *
  2402. * @private
  2403. * @param {Function} func The function to wrap.
  2404. * @param {Function} transform The argument transform.
  2405. * @returns {Function} Returns the new function.
  2406. */
  2407. function overArg(func, transform) {
  2408. return function(arg) {
  2409. return func(transform(arg));
  2410. };
  2411. }
  2412. /**
  2413. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2414. * and returns an array of their indexes.
  2415. *
  2416. * @private
  2417. * @param {Array} array The array to modify.
  2418. * @param {*} placeholder The placeholder to replace.
  2419. * @returns {Array} Returns the new array of placeholder indexes.
  2420. */
  2421. function replaceHolders(array, placeholder) {
  2422. var index = -1,
  2423. length = array.length,
  2424. resIndex = 0,
  2425. result = [];
  2426. while (++index < length) {
  2427. var value = array[index];
  2428. if (value === placeholder || value === PLACEHOLDER) {
  2429. array[index] = PLACEHOLDER;
  2430. result[resIndex++] = index;
  2431. }
  2432. }
  2433. return result;
  2434. }
  2435. /**
  2436. * Converts `set` to an array of its values.
  2437. *
  2438. * @private
  2439. * @param {Object} set The set to convert.
  2440. * @returns {Array} Returns the values.
  2441. */
  2442. function setToArray(set) {
  2443. var index = -1,
  2444. result = Array(set.size);
  2445. set.forEach(function(value) {
  2446. result[++index] = value;
  2447. });
  2448. return result;
  2449. }
  2450. /**
  2451. * Converts `set` to its value-value pairs.
  2452. *
  2453. * @private
  2454. * @param {Object} set The set to convert.
  2455. * @returns {Array} Returns the value-value pairs.
  2456. */
  2457. function setToPairs(set) {
  2458. var index = -1,
  2459. result = Array(set.size);
  2460. set.forEach(function(value) {
  2461. result[++index] = [value, value];
  2462. });
  2463. return result;
  2464. }
  2465. /**
  2466. * A specialized version of `_.indexOf` which performs strict equality
  2467. * comparisons of values, i.e. `===`.
  2468. *
  2469. * @private
  2470. * @param {Array} array The array to inspect.
  2471. * @param {*} value The value to search for.
  2472. * @param {number} fromIndex The index to search from.
  2473. * @returns {number} Returns the index of the matched value, else `-1`.
  2474. */
  2475. function strictIndexOf(array, value, fromIndex) {
  2476. var index = fromIndex - 1,
  2477. length = array.length;
  2478. while (++index < length) {
  2479. if (array[index] === value) {
  2480. return index;
  2481. }
  2482. }
  2483. return -1;
  2484. }
  2485. /**
  2486. * A specialized version of `_.lastIndexOf` which performs strict equality
  2487. * comparisons of values, i.e. `===`.
  2488. *
  2489. * @private
  2490. * @param {Array} array The array to inspect.
  2491. * @param {*} value The value to search for.
  2492. * @param {number} fromIndex The index to search from.
  2493. * @returns {number} Returns the index of the matched value, else `-1`.
  2494. */
  2495. function strictLastIndexOf(array, value, fromIndex) {
  2496. var index = fromIndex + 1;
  2497. while (index--) {
  2498. if (array[index] === value) {
  2499. return index;
  2500. }
  2501. }
  2502. return index;
  2503. }
  2504. /**
  2505. * Gets the number of symbols in `string`.
  2506. *
  2507. * @private
  2508. * @param {string} string The string to inspect.
  2509. * @returns {number} Returns the string size.
  2510. */
  2511. function stringSize(string) {
  2512. return hasUnicode(string)
  2513. ? unicodeSize(string)
  2514. : asciiSize(string);
  2515. }
  2516. /**
  2517. * Converts `string` to an array.
  2518. *
  2519. * @private
  2520. * @param {string} string The string to convert.
  2521. * @returns {Array} Returns the converted array.
  2522. */
  2523. function stringToArray(string) {
  2524. return hasUnicode(string)
  2525. ? unicodeToArray(string)
  2526. : asciiToArray(string);
  2527. }
  2528. /**
  2529. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2530. * character of `string`.
  2531. *
  2532. * @private
  2533. * @param {string} string The string to inspect.
  2534. * @returns {number} Returns the index of the last non-whitespace character.
  2535. */
  2536. function trimmedEndIndex(string) {
  2537. var index = string.length;
  2538. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2539. return index;
  2540. }
  2541. /**
  2542. * Used by `_.unescape` to convert HTML entities to characters.
  2543. *
  2544. * @private
  2545. * @param {string} chr The matched character to unescape.
  2546. * @returns {string} Returns the unescaped character.
  2547. */
  2548. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2549. /**
  2550. * Gets the size of a Unicode `string`.
  2551. *
  2552. * @private
  2553. * @param {string} string The string inspect.
  2554. * @returns {number} Returns the string size.
  2555. */
  2556. function unicodeSize(string) {
  2557. var result = reUnicode.lastIndex = 0;
  2558. while (reUnicode.test(string)) {
  2559. ++result;
  2560. }
  2561. return result;
  2562. }
  2563. /**
  2564. * Converts a Unicode `string` to an array.
  2565. *
  2566. * @private
  2567. * @param {string} string The string to convert.
  2568. * @returns {Array} Returns the converted array.
  2569. */
  2570. function unicodeToArray(string) {
  2571. return string.match(reUnicode) || [];
  2572. }
  2573. /**
  2574. * Splits a Unicode `string` into an array of its words.
  2575. *
  2576. * @private
  2577. * @param {string} The string to inspect.
  2578. * @returns {Array} Returns the words of `string`.
  2579. */
  2580. function unicodeWords(string) {
  2581. return string.match(reUnicodeWord) || [];
  2582. }
  2583. /*--------------------------------------------------------------------------*/
  2584. /**
  2585. * Create a new pristine `lodash` function using the `context` object.
  2586. *
  2587. * @static
  2588. * @memberOf _
  2589. * @since 1.1.0
  2590. * @category Util
  2591. * @param {Object} [context=root] The context object.
  2592. * @returns {Function} Returns a new `lodash` function.
  2593. * @example
  2594. *
  2595. * _.mixin({ 'foo': _.constant('foo') });
  2596. *
  2597. * var lodash = _.runInContext();
  2598. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2599. *
  2600. * _.isFunction(_.foo);
  2601. * // => true
  2602. * _.isFunction(_.bar);
  2603. * // => false
  2604. *
  2605. * lodash.isFunction(lodash.foo);
  2606. * // => false
  2607. * lodash.isFunction(lodash.bar);
  2608. * // => true
  2609. *
  2610. * // Create a suped-up `defer` in Node.js.
  2611. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2612. */
  2613. var runInContext = (function runInContext(context) {
  2614. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2615. /** Built-in constructor references. */
  2616. var Array = context.Array,
  2617. Date = context.Date,
  2618. Error = context.Error,
  2619. Function = context.Function,
  2620. Math = context.Math,
  2621. Object = context.Object,
  2622. RegExp = context.RegExp,
  2623. String = context.String,
  2624. TypeError = context.TypeError;
  2625. /** Used for built-in method references. */
  2626. var arrayProto = Array.prototype,
  2627. funcProto = Function.prototype,
  2628. objectProto = Object.prototype;
  2629. /** Used to detect overreaching core-js shims. */
  2630. var coreJsData = context['__core-js_shared__'];
  2631. /** Used to resolve the decompiled source of functions. */
  2632. var funcToString = funcProto.toString;
  2633. /** Used to check objects for own properties. */
  2634. var hasOwnProperty = objectProto.hasOwnProperty;
  2635. /** Used to generate unique IDs. */
  2636. var idCounter = 0;
  2637. /** Used to detect methods masquerading as native. */
  2638. var maskSrcKey = (function() {
  2639. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2640. return uid ? ('Symbol(src)_1.' + uid) : '';
  2641. }());
  2642. /**
  2643. * Used to resolve the
  2644. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2645. * of values.
  2646. */
  2647. var nativeObjectToString = objectProto.toString;
  2648. /** Used to infer the `Object` constructor. */
  2649. var objectCtorString = funcToString.call(Object);
  2650. /** Used to restore the original `_` reference in `_.noConflict`. */
  2651. var oldDash = root._;
  2652. /** Used to detect if a method is native. */
  2653. var reIsNative = RegExp('^' +
  2654. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2655. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2656. );
  2657. /** Built-in value references. */
  2658. var Buffer = moduleExports ? context.Buffer : undefined,
  2659. Symbol = context.Symbol,
  2660. Uint8Array = context.Uint8Array,
  2661. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2662. getPrototype = overArg(Object.getPrototypeOf, Object),
  2663. objectCreate = Object.create,
  2664. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2665. splice = arrayProto.splice,
  2666. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2667. symIterator = Symbol ? Symbol.iterator : undefined,
  2668. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2669. var defineProperty = (function() {
  2670. try {
  2671. var func = getNative(Object, 'defineProperty');
  2672. func({}, '', {});
  2673. return func;
  2674. } catch (e) {}
  2675. }());
  2676. /** Mocked built-ins. */
  2677. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2678. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2679. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2680. /* Built-in method references for those with the same name as other `lodash` methods. */
  2681. var nativeCeil = Math.ceil,
  2682. nativeFloor = Math.floor,
  2683. nativeGetSymbols = Object.getOwnPropertySymbols,
  2684. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2685. nativeIsFinite = context.isFinite,
  2686. nativeJoin = arrayProto.join,
  2687. nativeKeys = overArg(Object.keys, Object),
  2688. nativeMax = Math.max,
  2689. nativeMin = Math.min,
  2690. nativeNow = Date.now,
  2691. nativeParseInt = context.parseInt,
  2692. nativeRandom = Math.random,
  2693. nativeReverse = arrayProto.reverse;
  2694. /* Built-in method references that are verified to be native. */
  2695. var DataView = getNative(context, 'DataView'),
  2696. Map = getNative(context, 'Map'),
  2697. Promise = getNative(context, 'Promise'),
  2698. Set = getNative(context, 'Set'),
  2699. WeakMap = getNative(context, 'WeakMap'),
  2700. nativeCreate = getNative(Object, 'create');
  2701. /** Used to store function metadata. */
  2702. var metaMap = WeakMap && new WeakMap;
  2703. /** Used to lookup unminified function names. */
  2704. var realNames = {};
  2705. /** Used to detect maps, sets, and weakmaps. */
  2706. var dataViewCtorString = toSource(DataView),
  2707. mapCtorString = toSource(Map),
  2708. promiseCtorString = toSource(Promise),
  2709. setCtorString = toSource(Set),
  2710. weakMapCtorString = toSource(WeakMap);
  2711. /** Used to convert symbols to primitives and strings. */
  2712. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2713. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2714. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2715. /*------------------------------------------------------------------------*/
  2716. /**
  2717. * Creates a `lodash` object which wraps `value` to enable implicit method
  2718. * chain sequences. Methods that operate on and return arrays, collections,
  2719. * and functions can be chained together. Methods that retrieve a single value
  2720. * or may return a primitive value will automatically end the chain sequence
  2721. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2722. * with `_#value`.
  2723. *
  2724. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2725. * enabled using `_.chain`.
  2726. *
  2727. * The execution of chained methods is lazy, that is, it's deferred until
  2728. * `_#value` is implicitly or explicitly called.
  2729. *
  2730. * Lazy evaluation allows several methods to support shortcut fusion.
  2731. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2732. * the creation of intermediate arrays and can greatly reduce the number of
  2733. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2734. * fusion if the section is applied to an array and iteratees accept only
  2735. * one argument. The heuristic for whether a section qualifies for shortcut
  2736. * fusion is subject to change.
  2737. *
  2738. * Chaining is supported in custom builds as long as the `_#value` method is
  2739. * directly or indirectly included in the build.
  2740. *
  2741. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2742. *
  2743. * The wrapper `Array` methods are:
  2744. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2745. *
  2746. * The wrapper `String` methods are:
  2747. * `replace` and `split`
  2748. *
  2749. * The wrapper methods that support shortcut fusion are:
  2750. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2751. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2752. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2753. *
  2754. * The chainable wrapper methods are:
  2755. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2756. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2757. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2758. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2759. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2760. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2761. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2762. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2763. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2764. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2765. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2766. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2767. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2768. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2769. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2770. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2771. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2772. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2773. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2774. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2775. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2776. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2777. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2778. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2779. *
  2780. * The wrapper methods that are **not** chainable by default are:
  2781. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2782. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2783. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2784. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2785. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2786. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2787. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2788. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2789. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2790. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2791. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2792. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2793. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2794. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2795. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2796. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2797. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2798. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2799. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2800. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2801. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2802. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2803. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2804. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2805. * `upperFirst`, `value`, and `words`
  2806. *
  2807. * @name _
  2808. * @constructor
  2809. * @category Seq
  2810. * @param {*} value The value to wrap in a `lodash` instance.
  2811. * @returns {Object} Returns the new `lodash` wrapper instance.
  2812. * @example
  2813. *
  2814. * function square(n) {
  2815. * return n * n;
  2816. * }
  2817. *
  2818. * var wrapped = _([1, 2, 3]);
  2819. *
  2820. * // Returns an unwrapped value.
  2821. * wrapped.reduce(_.add);
  2822. * // => 6
  2823. *
  2824. * // Returns a wrapped value.
  2825. * var squares = wrapped.map(square);
  2826. *
  2827. * _.isArray(squares);
  2828. * // => false
  2829. *
  2830. * _.isArray(squares.value());
  2831. * // => true
  2832. */
  2833. function lodash(value) {
  2834. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2835. if (value instanceof LodashWrapper) {
  2836. return value;
  2837. }
  2838. if (hasOwnProperty.call(value, '__wrapped__')) {
  2839. return wrapperClone(value);
  2840. }
  2841. }
  2842. return new LodashWrapper(value);
  2843. }
  2844. /**
  2845. * The base implementation of `_.create` without support for assigning
  2846. * properties to the created object.
  2847. *
  2848. * @private
  2849. * @param {Object} proto The object to inherit from.
  2850. * @returns {Object} Returns the new object.
  2851. */
  2852. var baseCreate = (function() {
  2853. function object() {}
  2854. return function(proto) {
  2855. if (!isObject(proto)) {
  2856. return {};
  2857. }
  2858. if (objectCreate) {
  2859. return objectCreate(proto);
  2860. }
  2861. object.prototype = proto;
  2862. var result = new object;
  2863. object.prototype = undefined;
  2864. return result;
  2865. };
  2866. }());
  2867. /**
  2868. * The function whose prototype chain sequence wrappers inherit from.
  2869. *
  2870. * @private
  2871. */
  2872. function baseLodash() {
  2873. // No operation performed.
  2874. }
  2875. /**
  2876. * The base constructor for creating `lodash` wrapper objects.
  2877. *
  2878. * @private
  2879. * @param {*} value The value to wrap.
  2880. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2881. */
  2882. function LodashWrapper(value, chainAll) {
  2883. this.__wrapped__ = value;
  2884. this.__actions__ = [];
  2885. this.__chain__ = !!chainAll;
  2886. this.__index__ = 0;
  2887. this.__values__ = undefined;
  2888. }
  2889. /**
  2890. * By default, the template delimiters used by lodash are like those in
  2891. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2892. * following template settings to use alternative delimiters.
  2893. *
  2894. * @static
  2895. * @memberOf _
  2896. * @type {Object}
  2897. */
  2898. lodash.templateSettings = {
  2899. /**
  2900. * Used to detect `data` property values to be HTML-escaped.
  2901. *
  2902. * @memberOf _.templateSettings
  2903. * @type {RegExp}
  2904. */
  2905. 'escape': reEscape,
  2906. /**
  2907. * Used to detect code to be evaluated.
  2908. *
  2909. * @memberOf _.templateSettings
  2910. * @type {RegExp}
  2911. */
  2912. 'evaluate': reEvaluate,
  2913. /**
  2914. * Used to detect `data` property values to inject.
  2915. *
  2916. * @memberOf _.templateSettings
  2917. * @type {RegExp}
  2918. */
  2919. 'interpolate': reInterpolate,
  2920. /**
  2921. * Used to reference the data object in the template text.
  2922. *
  2923. * @memberOf _.templateSettings
  2924. * @type {string}
  2925. */
  2926. 'variable': '',
  2927. /**
  2928. * Used to import variables into the compiled template.
  2929. *
  2930. * @memberOf _.templateSettings
  2931. * @type {Object}
  2932. */
  2933. 'imports': {
  2934. /**
  2935. * A reference to the `lodash` function.
  2936. *
  2937. * @memberOf _.templateSettings.imports
  2938. * @type {Function}
  2939. */
  2940. '_': lodash
  2941. }
  2942. };
  2943. // Ensure wrappers are instances of `baseLodash`.
  2944. lodash.prototype = baseLodash.prototype;
  2945. lodash.prototype.constructor = lodash;
  2946. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2947. LodashWrapper.prototype.constructor = LodashWrapper;
  2948. /*------------------------------------------------------------------------*/
  2949. /**
  2950. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2951. *
  2952. * @private
  2953. * @constructor
  2954. * @param {*} value The value to wrap.
  2955. */
  2956. function LazyWrapper(value) {
  2957. this.__wrapped__ = value;
  2958. this.__actions__ = [];
  2959. this.__dir__ = 1;
  2960. this.__filtered__ = false;
  2961. this.__iteratees__ = [];
  2962. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2963. this.__views__ = [];
  2964. }
  2965. /**
  2966. * Creates a clone of the lazy wrapper object.
  2967. *
  2968. * @private
  2969. * @name clone
  2970. * @memberOf LazyWrapper
  2971. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2972. */
  2973. function lazyClone() {
  2974. var result = new LazyWrapper(this.__wrapped__);
  2975. result.__actions__ = copyArray(this.__actions__);
  2976. result.__dir__ = this.__dir__;
  2977. result.__filtered__ = this.__filtered__;
  2978. result.__iteratees__ = copyArray(this.__iteratees__);
  2979. result.__takeCount__ = this.__takeCount__;
  2980. result.__views__ = copyArray(this.__views__);
  2981. return result;
  2982. }
  2983. /**
  2984. * Reverses the direction of lazy iteration.
  2985. *
  2986. * @private
  2987. * @name reverse
  2988. * @memberOf LazyWrapper
  2989. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2990. */
  2991. function lazyReverse() {
  2992. if (this.__filtered__) {
  2993. var result = new LazyWrapper(this);
  2994. result.__dir__ = -1;
  2995. result.__filtered__ = true;
  2996. } else {
  2997. result = this.clone();
  2998. result.__dir__ *= -1;
  2999. }
  3000. return result;
  3001. }
  3002. /**
  3003. * Extracts the unwrapped value from its lazy wrapper.
  3004. *
  3005. * @private
  3006. * @name value
  3007. * @memberOf LazyWrapper
  3008. * @returns {*} Returns the unwrapped value.
  3009. */
  3010. function lazyValue() {
  3011. var array = this.__wrapped__.value(),
  3012. dir = this.__dir__,
  3013. isArr = isArray(array),
  3014. isRight = dir < 0,
  3015. arrLength = isArr ? array.length : 0,
  3016. view = getView(0, arrLength, this.__views__),
  3017. start = view.start,
  3018. end = view.end,
  3019. length = end - start,
  3020. index = isRight ? end : (start - 1),
  3021. iteratees = this.__iteratees__,
  3022. iterLength = iteratees.length,
  3023. resIndex = 0,
  3024. takeCount = nativeMin(length, this.__takeCount__);
  3025. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3026. return baseWrapperValue(array, this.__actions__);
  3027. }
  3028. var result = [];
  3029. outer:
  3030. while (length-- && resIndex < takeCount) {
  3031. index += dir;
  3032. var iterIndex = -1,
  3033. value = array[index];
  3034. while (++iterIndex < iterLength) {
  3035. var data = iteratees[iterIndex],
  3036. iteratee = data.iteratee,
  3037. type = data.type,
  3038. computed = iteratee(value);
  3039. if (type == LAZY_MAP_FLAG) {
  3040. value = computed;
  3041. } else if (!computed) {
  3042. if (type == LAZY_FILTER_FLAG) {
  3043. continue outer;
  3044. } else {
  3045. break outer;
  3046. }
  3047. }
  3048. }
  3049. result[resIndex++] = value;
  3050. }
  3051. return result;
  3052. }
  3053. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3054. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3055. LazyWrapper.prototype.constructor = LazyWrapper;
  3056. /*------------------------------------------------------------------------*/
  3057. /**
  3058. * Creates a hash object.
  3059. *
  3060. * @private
  3061. * @constructor
  3062. * @param {Array} [entries] The key-value pairs to cache.
  3063. */
  3064. function Hash(entries) {
  3065. var index = -1,
  3066. length = entries == null ? 0 : entries.length;
  3067. this.clear();
  3068. while (++index < length) {
  3069. var entry = entries[index];
  3070. this.set(entry[0], entry[1]);
  3071. }
  3072. }
  3073. /**
  3074. * Removes all key-value entries from the hash.
  3075. *
  3076. * @private
  3077. * @name clear
  3078. * @memberOf Hash
  3079. */
  3080. function hashClear() {
  3081. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3082. this.size = 0;
  3083. }
  3084. /**
  3085. * Removes `key` and its value from the hash.
  3086. *
  3087. * @private
  3088. * @name delete
  3089. * @memberOf Hash
  3090. * @param {Object} hash The hash to modify.
  3091. * @param {string} key The key of the value to remove.
  3092. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3093. */
  3094. function hashDelete(key) {
  3095. var result = this.has(key) && delete this.__data__[key];
  3096. this.size -= result ? 1 : 0;
  3097. return result;
  3098. }
  3099. /**
  3100. * Gets the hash value for `key`.
  3101. *
  3102. * @private
  3103. * @name get
  3104. * @memberOf Hash
  3105. * @param {string} key The key of the value to get.
  3106. * @returns {*} Returns the entry value.
  3107. */
  3108. function hashGet(key) {
  3109. var data = this.__data__;
  3110. if (nativeCreate) {
  3111. var result = data[key];
  3112. return result === HASH_UNDEFINED ? undefined : result;
  3113. }
  3114. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3115. }
  3116. /**
  3117. * Checks if a hash value for `key` exists.
  3118. *
  3119. * @private
  3120. * @name has
  3121. * @memberOf Hash
  3122. * @param {string} key The key of the entry to check.
  3123. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3124. */
  3125. function hashHas(key) {
  3126. var data = this.__data__;
  3127. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3128. }
  3129. /**
  3130. * Sets the hash `key` to `value`.
  3131. *
  3132. * @private
  3133. * @name set
  3134. * @memberOf Hash
  3135. * @param {string} key The key of the value to set.
  3136. * @param {*} value The value to set.
  3137. * @returns {Object} Returns the hash instance.
  3138. */
  3139. function hashSet(key, value) {
  3140. var data = this.__data__;
  3141. this.size += this.has(key) ? 0 : 1;
  3142. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3143. return this;
  3144. }
  3145. // Add methods to `Hash`.
  3146. Hash.prototype.clear = hashClear;
  3147. Hash.prototype['delete'] = hashDelete;
  3148. Hash.prototype.get = hashGet;
  3149. Hash.prototype.has = hashHas;
  3150. Hash.prototype.set = hashSet;
  3151. /*------------------------------------------------------------------------*/
  3152. /**
  3153. * Creates an list cache object.
  3154. *
  3155. * @private
  3156. * @constructor
  3157. * @param {Array} [entries] The key-value pairs to cache.
  3158. */
  3159. function ListCache(entries) {
  3160. var index = -1,
  3161. length = entries == null ? 0 : entries.length;
  3162. this.clear();
  3163. while (++index < length) {
  3164. var entry = entries[index];
  3165. this.set(entry[0], entry[1]);
  3166. }
  3167. }
  3168. /**
  3169. * Removes all key-value entries from the list cache.
  3170. *
  3171. * @private
  3172. * @name clear
  3173. * @memberOf ListCache
  3174. */
  3175. function listCacheClear() {
  3176. this.__data__ = [];
  3177. this.size = 0;
  3178. }
  3179. /**
  3180. * Removes `key` and its value from the list cache.
  3181. *
  3182. * @private
  3183. * @name delete
  3184. * @memberOf ListCache
  3185. * @param {string} key The key of the value to remove.
  3186. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3187. */
  3188. function listCacheDelete(key) {
  3189. var data = this.__data__,
  3190. index = assocIndexOf(data, key);
  3191. if (index < 0) {
  3192. return false;
  3193. }
  3194. var lastIndex = data.length - 1;
  3195. if (index == lastIndex) {
  3196. data.pop();
  3197. } else {
  3198. splice.call(data, index, 1);
  3199. }
  3200. --this.size;
  3201. return true;
  3202. }
  3203. /**
  3204. * Gets the list cache value for `key`.
  3205. *
  3206. * @private
  3207. * @name get
  3208. * @memberOf ListCache
  3209. * @param {string} key The key of the value to get.
  3210. * @returns {*} Returns the entry value.
  3211. */
  3212. function listCacheGet(key) {
  3213. var data = this.__data__,
  3214. index = assocIndexOf(data, key);
  3215. return index < 0 ? undefined : data[index][1];
  3216. }
  3217. /**
  3218. * Checks if a list cache value for `key` exists.
  3219. *
  3220. * @private
  3221. * @name has
  3222. * @memberOf ListCache
  3223. * @param {string} key The key of the entry to check.
  3224. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3225. */
  3226. function listCacheHas(key) {
  3227. return assocIndexOf(this.__data__, key) > -1;
  3228. }
  3229. /**
  3230. * Sets the list cache `key` to `value`.
  3231. *
  3232. * @private
  3233. * @name set
  3234. * @memberOf ListCache
  3235. * @param {string} key The key of the value to set.
  3236. * @param {*} value The value to set.
  3237. * @returns {Object} Returns the list cache instance.
  3238. */
  3239. function listCacheSet(key, value) {
  3240. var data = this.__data__,
  3241. index = assocIndexOf(data, key);
  3242. if (index < 0) {
  3243. ++this.size;
  3244. data.push([key, value]);
  3245. } else {
  3246. data[index][1] = value;
  3247. }
  3248. return this;
  3249. }
  3250. // Add methods to `ListCache`.
  3251. ListCache.prototype.clear = listCacheClear;
  3252. ListCache.prototype['delete'] = listCacheDelete;
  3253. ListCache.prototype.get = listCacheGet;
  3254. ListCache.prototype.has = listCacheHas;
  3255. ListCache.prototype.set = listCacheSet;
  3256. /*------------------------------------------------------------------------*/
  3257. /**
  3258. * Creates a map cache object to store key-value pairs.
  3259. *
  3260. * @private
  3261. * @constructor
  3262. * @param {Array} [entries] The key-value pairs to cache.
  3263. */
  3264. function MapCache(entries) {
  3265. var index = -1,
  3266. length = entries == null ? 0 : entries.length;
  3267. this.clear();
  3268. while (++index < length) {
  3269. var entry = entries[index];
  3270. this.set(entry[0], entry[1]);
  3271. }
  3272. }
  3273. /**
  3274. * Removes all key-value entries from the map.
  3275. *
  3276. * @private
  3277. * @name clear
  3278. * @memberOf MapCache
  3279. */
  3280. function mapCacheClear() {
  3281. this.size = 0;
  3282. this.__data__ = {
  3283. 'hash': new Hash,
  3284. 'map': new (Map || ListCache),
  3285. 'string': new Hash
  3286. };
  3287. }
  3288. /**
  3289. * Removes `key` and its value from the map.
  3290. *
  3291. * @private
  3292. * @name delete
  3293. * @memberOf MapCache
  3294. * @param {string} key The key of the value to remove.
  3295. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3296. */
  3297. function mapCacheDelete(key) {
  3298. var result = getMapData(this, key)['delete'](key);
  3299. this.size -= result ? 1 : 0;
  3300. return result;
  3301. }
  3302. /**
  3303. * Gets the map value for `key`.
  3304. *
  3305. * @private
  3306. * @name get
  3307. * @memberOf MapCache
  3308. * @param {string} key The key of the value to get.
  3309. * @returns {*} Returns the entry value.
  3310. */
  3311. function mapCacheGet(key) {
  3312. return getMapData(this, key).get(key);
  3313. }
  3314. /**
  3315. * Checks if a map value for `key` exists.
  3316. *
  3317. * @private
  3318. * @name has
  3319. * @memberOf MapCache
  3320. * @param {string} key The key of the entry to check.
  3321. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3322. */
  3323. function mapCacheHas(key) {
  3324. return getMapData(this, key).has(key);
  3325. }
  3326. /**
  3327. * Sets the map `key` to `value`.
  3328. *
  3329. * @private
  3330. * @name set
  3331. * @memberOf MapCache
  3332. * @param {string} key The key of the value to set.
  3333. * @param {*} value The value to set.
  3334. * @returns {Object} Returns the map cache instance.
  3335. */
  3336. function mapCacheSet(key, value) {
  3337. var data = getMapData(this, key),
  3338. size = data.size;
  3339. data.set(key, value);
  3340. this.size += data.size == size ? 0 : 1;
  3341. return this;
  3342. }
  3343. // Add methods to `MapCache`.
  3344. MapCache.prototype.clear = mapCacheClear;
  3345. MapCache.prototype['delete'] = mapCacheDelete;
  3346. MapCache.prototype.get = mapCacheGet;
  3347. MapCache.prototype.has = mapCacheHas;
  3348. MapCache.prototype.set = mapCacheSet;
  3349. /*------------------------------------------------------------------------*/
  3350. /**
  3351. *
  3352. * Creates an array cache object to store unique values.
  3353. *
  3354. * @private
  3355. * @constructor
  3356. * @param {Array} [values] The values to cache.
  3357. */
  3358. function SetCache(values) {
  3359. var index = -1,
  3360. length = values == null ? 0 : values.length;
  3361. this.__data__ = new MapCache;
  3362. while (++index < length) {
  3363. this.add(values[index]);
  3364. }
  3365. }
  3366. /**
  3367. * Adds `value` to the array cache.
  3368. *
  3369. * @private
  3370. * @name add
  3371. * @memberOf SetCache
  3372. * @alias push
  3373. * @param {*} value The value to cache.
  3374. * @returns {Object} Returns the cache instance.
  3375. */
  3376. function setCacheAdd(value) {
  3377. this.__data__.set(value, HASH_UNDEFINED);
  3378. return this;
  3379. }
  3380. /**
  3381. * Checks if `value` is in the array cache.
  3382. *
  3383. * @private
  3384. * @name has
  3385. * @memberOf SetCache
  3386. * @param {*} value The value to search for.
  3387. * @returns {number} Returns `true` if `value` is found, else `false`.
  3388. */
  3389. function setCacheHas(value) {
  3390. return this.__data__.has(value);
  3391. }
  3392. // Add methods to `SetCache`.
  3393. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3394. SetCache.prototype.has = setCacheHas;
  3395. /*------------------------------------------------------------------------*/
  3396. /**
  3397. * Creates a stack cache object to store key-value pairs.
  3398. *
  3399. * @private
  3400. * @constructor
  3401. * @param {Array} [entries] The key-value pairs to cache.
  3402. */
  3403. function Stack(entries) {
  3404. var data = this.__data__ = new ListCache(entries);
  3405. this.size = data.size;
  3406. }
  3407. /**
  3408. * Removes all key-value entries from the stack.
  3409. *
  3410. * @private
  3411. * @name clear
  3412. * @memberOf Stack
  3413. */
  3414. function stackClear() {
  3415. this.__data__ = new ListCache;
  3416. this.size = 0;
  3417. }
  3418. /**
  3419. * Removes `key` and its value from the stack.
  3420. *
  3421. * @private
  3422. * @name delete
  3423. * @memberOf Stack
  3424. * @param {string} key The key of the value to remove.
  3425. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3426. */
  3427. function stackDelete(key) {
  3428. var data = this.__data__,
  3429. result = data['delete'](key);
  3430. this.size = data.size;
  3431. return result;
  3432. }
  3433. /**
  3434. * Gets the stack value for `key`.
  3435. *
  3436. * @private
  3437. * @name get
  3438. * @memberOf Stack
  3439. * @param {string} key The key of the value to get.
  3440. * @returns {*} Returns the entry value.
  3441. */
  3442. function stackGet(key) {
  3443. return this.__data__.get(key);
  3444. }
  3445. /**
  3446. * Checks if a stack value for `key` exists.
  3447. *
  3448. * @private
  3449. * @name has
  3450. * @memberOf Stack
  3451. * @param {string} key The key of the entry to check.
  3452. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3453. */
  3454. function stackHas(key) {
  3455. return this.__data__.has(key);
  3456. }
  3457. /**
  3458. * Sets the stack `key` to `value`.
  3459. *
  3460. * @private
  3461. * @name set
  3462. * @memberOf Stack
  3463. * @param {string} key The key of the value to set.
  3464. * @param {*} value The value to set.
  3465. * @returns {Object} Returns the stack cache instance.
  3466. */
  3467. function stackSet(key, value) {
  3468. var data = this.__data__;
  3469. if (data instanceof ListCache) {
  3470. var pairs = data.__data__;
  3471. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3472. pairs.push([key, value]);
  3473. this.size = ++data.size;
  3474. return this;
  3475. }
  3476. data = this.__data__ = new MapCache(pairs);
  3477. }
  3478. data.set(key, value);
  3479. this.size = data.size;
  3480. return this;
  3481. }
  3482. // Add methods to `Stack`.
  3483. Stack.prototype.clear = stackClear;
  3484. Stack.prototype['delete'] = stackDelete;
  3485. Stack.prototype.get = stackGet;
  3486. Stack.prototype.has = stackHas;
  3487. Stack.prototype.set = stackSet;
  3488. /*------------------------------------------------------------------------*/
  3489. /**
  3490. * Creates an array of the enumerable property names of the array-like `value`.
  3491. *
  3492. * @private
  3493. * @param {*} value The value to query.
  3494. * @param {boolean} inherited Specify returning inherited property names.
  3495. * @returns {Array} Returns the array of property names.
  3496. */
  3497. function arrayLikeKeys(value, inherited) {
  3498. var isArr = isArray(value),
  3499. isArg = !isArr && isArguments(value),
  3500. isBuff = !isArr && !isArg && isBuffer(value),
  3501. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3502. skipIndexes = isArr || isArg || isBuff || isType,
  3503. result = skipIndexes ? baseTimes(value.length, String) : [],
  3504. length = result.length;
  3505. for (var key in value) {
  3506. if ((inherited || hasOwnProperty.call(value, key)) &&
  3507. !(skipIndexes && (
  3508. // Safari 9 has enumerable `arguments.length` in strict mode.
  3509. key == 'length' ||
  3510. // Node.js 0.10 has enumerable non-index properties on buffers.
  3511. (isBuff && (key == 'offset' || key == 'parent')) ||
  3512. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3513. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3514. // Skip index properties.
  3515. isIndex(key, length)
  3516. ))) {
  3517. result.push(key);
  3518. }
  3519. }
  3520. return result;
  3521. }
  3522. /**
  3523. * A specialized version of `_.sample` for arrays.
  3524. *
  3525. * @private
  3526. * @param {Array} array The array to sample.
  3527. * @returns {*} Returns the random element.
  3528. */
  3529. function arraySample(array) {
  3530. var length = array.length;
  3531. return length ? array[baseRandom(0, length - 1)] : undefined;
  3532. }
  3533. /**
  3534. * A specialized version of `_.sampleSize` for arrays.
  3535. *
  3536. * @private
  3537. * @param {Array} array The array to sample.
  3538. * @param {number} n The number of elements to sample.
  3539. * @returns {Array} Returns the random elements.
  3540. */
  3541. function arraySampleSize(array, n) {
  3542. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3543. }
  3544. /**
  3545. * A specialized version of `_.shuffle` for arrays.
  3546. *
  3547. * @private
  3548. * @param {Array} array The array to shuffle.
  3549. * @returns {Array} Returns the new shuffled array.
  3550. */
  3551. function arrayShuffle(array) {
  3552. return shuffleSelf(copyArray(array));
  3553. }
  3554. /**
  3555. * This function is like `assignValue` except that it doesn't assign
  3556. * `undefined` values.
  3557. *
  3558. * @private
  3559. * @param {Object} object The object to modify.
  3560. * @param {string} key The key of the property to assign.
  3561. * @param {*} value The value to assign.
  3562. */
  3563. function assignMergeValue(object, key, value) {
  3564. if ((value !== undefined && !eq(object[key], value)) ||
  3565. (value === undefined && !(key in object))) {
  3566. baseAssignValue(object, key, value);
  3567. }
  3568. }
  3569. /**
  3570. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3571. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3572. * for equality comparisons.
  3573. *
  3574. * @private
  3575. * @param {Object} object The object to modify.
  3576. * @param {string} key The key of the property to assign.
  3577. * @param {*} value The value to assign.
  3578. */
  3579. function assignValue(object, key, value) {
  3580. var objValue = object[key];
  3581. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3582. (value === undefined && !(key in object))) {
  3583. baseAssignValue(object, key, value);
  3584. }
  3585. }
  3586. /**
  3587. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3588. *
  3589. * @private
  3590. * @param {Array} array The array to inspect.
  3591. * @param {*} key The key to search for.
  3592. * @returns {number} Returns the index of the matched value, else `-1`.
  3593. */
  3594. function assocIndexOf(array, key) {
  3595. var length = array.length;
  3596. while (length--) {
  3597. if (eq(array[length][0], key)) {
  3598. return length;
  3599. }
  3600. }
  3601. return -1;
  3602. }
  3603. /**
  3604. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3605. * by `iteratee` and values set by `setter`.
  3606. *
  3607. * @private
  3608. * @param {Array|Object} collection The collection to iterate over.
  3609. * @param {Function} setter The function to set `accumulator` values.
  3610. * @param {Function} iteratee The iteratee to transform keys.
  3611. * @param {Object} accumulator The initial aggregated object.
  3612. * @returns {Function} Returns `accumulator`.
  3613. */
  3614. function baseAggregator(collection, setter, iteratee, accumulator) {
  3615. baseEach(collection, function(value, key, collection) {
  3616. setter(accumulator, value, iteratee(value), collection);
  3617. });
  3618. return accumulator;
  3619. }
  3620. /**
  3621. * The base implementation of `_.assign` without support for multiple sources
  3622. * or `customizer` functions.
  3623. *
  3624. * @private
  3625. * @param {Object} object The destination object.
  3626. * @param {Object} source The source object.
  3627. * @returns {Object} Returns `object`.
  3628. */
  3629. function baseAssign(object, source) {
  3630. return object && copyObject(source, keys(source), object);
  3631. }
  3632. /**
  3633. * The base implementation of `_.assignIn` without support for multiple sources
  3634. * or `customizer` functions.
  3635. *
  3636. * @private
  3637. * @param {Object} object The destination object.
  3638. * @param {Object} source The source object.
  3639. * @returns {Object} Returns `object`.
  3640. */
  3641. function baseAssignIn(object, source) {
  3642. return object && copyObject(source, keysIn(source), object);
  3643. }
  3644. /**
  3645. * The base implementation of `assignValue` and `assignMergeValue` without
  3646. * value checks.
  3647. *
  3648. * @private
  3649. * @param {Object} object The object to modify.
  3650. * @param {string} key The key of the property to assign.
  3651. * @param {*} value The value to assign.
  3652. */
  3653. function baseAssignValue(object, key, value) {
  3654. if (key == '__proto__' && defineProperty) {
  3655. defineProperty(object, key, {
  3656. 'configurable': true,
  3657. 'enumerable': true,
  3658. 'value': value,
  3659. 'writable': true
  3660. });
  3661. } else {
  3662. object[key] = value;
  3663. }
  3664. }
  3665. /**
  3666. * The base implementation of `_.at` without support for individual paths.
  3667. *
  3668. * @private
  3669. * @param {Object} object The object to iterate over.
  3670. * @param {string[]} paths The property paths to pick.
  3671. * @returns {Array} Returns the picked elements.
  3672. */
  3673. function baseAt(object, paths) {
  3674. var index = -1,
  3675. length = paths.length,
  3676. result = Array(length),
  3677. skip = object == null;
  3678. while (++index < length) {
  3679. result[index] = skip ? undefined : get(object, paths[index]);
  3680. }
  3681. return result;
  3682. }
  3683. /**
  3684. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3685. *
  3686. * @private
  3687. * @param {number} number The number to clamp.
  3688. * @param {number} [lower] The lower bound.
  3689. * @param {number} upper The upper bound.
  3690. * @returns {number} Returns the clamped number.
  3691. */
  3692. function baseClamp(number, lower, upper) {
  3693. if (number === number) {
  3694. if (upper !== undefined) {
  3695. number = number <= upper ? number : upper;
  3696. }
  3697. if (lower !== undefined) {
  3698. number = number >= lower ? number : lower;
  3699. }
  3700. }
  3701. return number;
  3702. }
  3703. /**
  3704. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3705. * traversed objects.
  3706. *
  3707. * @private
  3708. * @param {*} value The value to clone.
  3709. * @param {boolean} bitmask The bitmask flags.
  3710. * 1 - Deep clone
  3711. * 2 - Flatten inherited properties
  3712. * 4 - Clone symbols
  3713. * @param {Function} [customizer] The function to customize cloning.
  3714. * @param {string} [key] The key of `value`.
  3715. * @param {Object} [object] The parent object of `value`.
  3716. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3717. * @returns {*} Returns the cloned value.
  3718. */
  3719. function baseClone(value, bitmask, customizer, key, object, stack) {
  3720. var result,
  3721. isDeep = bitmask & CLONE_DEEP_FLAG,
  3722. isFlat = bitmask & CLONE_FLAT_FLAG,
  3723. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3724. if (customizer) {
  3725. result = object ? customizer(value, key, object, stack) : customizer(value);
  3726. }
  3727. if (result !== undefined) {
  3728. return result;
  3729. }
  3730. if (!isObject(value)) {
  3731. return value;
  3732. }
  3733. var isArr = isArray(value);
  3734. if (isArr) {
  3735. result = initCloneArray(value);
  3736. if (!isDeep) {
  3737. return copyArray(value, result);
  3738. }
  3739. } else {
  3740. var tag = getTag(value),
  3741. isFunc = tag == funcTag || tag == genTag;
  3742. if (isBuffer(value)) {
  3743. return cloneBuffer(value, isDeep);
  3744. }
  3745. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3746. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3747. if (!isDeep) {
  3748. return isFlat
  3749. ? copySymbolsIn(value, baseAssignIn(result, value))
  3750. : copySymbols(value, baseAssign(result, value));
  3751. }
  3752. } else {
  3753. if (!cloneableTags[tag]) {
  3754. return object ? value : {};
  3755. }
  3756. result = initCloneByTag(value, tag, isDeep);
  3757. }
  3758. }
  3759. // Check for circular references and return its corresponding clone.
  3760. stack || (stack = new Stack);
  3761. var stacked = stack.get(value);
  3762. if (stacked) {
  3763. return stacked;
  3764. }
  3765. stack.set(value, result);
  3766. if (isSet(value)) {
  3767. value.forEach(function(subValue) {
  3768. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3769. });
  3770. } else if (isMap(value)) {
  3771. value.forEach(function(subValue, key) {
  3772. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3773. });
  3774. }
  3775. var keysFunc = isFull
  3776. ? (isFlat ? getAllKeysIn : getAllKeys)
  3777. : (isFlat ? keysIn : keys);
  3778. var props = isArr ? undefined : keysFunc(value);
  3779. arrayEach(props || value, function(subValue, key) {
  3780. if (props) {
  3781. key = subValue;
  3782. subValue = value[key];
  3783. }
  3784. // Recursively populate clone (susceptible to call stack limits).
  3785. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3786. });
  3787. return result;
  3788. }
  3789. /**
  3790. * The base implementation of `_.conforms` which doesn't clone `source`.
  3791. *
  3792. * @private
  3793. * @param {Object} source The object of property predicates to conform to.
  3794. * @returns {Function} Returns the new spec function.
  3795. */
  3796. function baseConforms(source) {
  3797. var props = keys(source);
  3798. return function(object) {
  3799. return baseConformsTo(object, source, props);
  3800. };
  3801. }
  3802. /**
  3803. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3804. *
  3805. * @private
  3806. * @param {Object} object The object to inspect.
  3807. * @param {Object} source The object of property predicates to conform to.
  3808. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3809. */
  3810. function baseConformsTo(object, source, props) {
  3811. var length = props.length;
  3812. if (object == null) {
  3813. return !length;
  3814. }
  3815. object = Object(object);
  3816. while (length--) {
  3817. var key = props[length],
  3818. predicate = source[key],
  3819. value = object[key];
  3820. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3821. return false;
  3822. }
  3823. }
  3824. return true;
  3825. }
  3826. /**
  3827. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3828. * to provide to `func`.
  3829. *
  3830. * @private
  3831. * @param {Function} func The function to delay.
  3832. * @param {number} wait The number of milliseconds to delay invocation.
  3833. * @param {Array} args The arguments to provide to `func`.
  3834. * @returns {number|Object} Returns the timer id or timeout object.
  3835. */
  3836. function baseDelay(func, wait, args) {
  3837. if (typeof func != 'function') {
  3838. throw new TypeError(FUNC_ERROR_TEXT);
  3839. }
  3840. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3841. }
  3842. /**
  3843. * The base implementation of methods like `_.difference` without support
  3844. * for excluding multiple arrays or iteratee shorthands.
  3845. *
  3846. * @private
  3847. * @param {Array} array The array to inspect.
  3848. * @param {Array} values The values to exclude.
  3849. * @param {Function} [iteratee] The iteratee invoked per element.
  3850. * @param {Function} [comparator] The comparator invoked per element.
  3851. * @returns {Array} Returns the new array of filtered values.
  3852. */
  3853. function baseDifference(array, values, iteratee, comparator) {
  3854. var index = -1,
  3855. includes = arrayIncludes,
  3856. isCommon = true,
  3857. length = array.length,
  3858. result = [],
  3859. valuesLength = values.length;
  3860. if (!length) {
  3861. return result;
  3862. }
  3863. if (iteratee) {
  3864. values = arrayMap(values, baseUnary(iteratee));
  3865. }
  3866. if (comparator) {
  3867. includes = arrayIncludesWith;
  3868. isCommon = false;
  3869. }
  3870. else if (values.length >= LARGE_ARRAY_SIZE) {
  3871. includes = cacheHas;
  3872. isCommon = false;
  3873. values = new SetCache(values);
  3874. }
  3875. outer:
  3876. while (++index < length) {
  3877. var value = array[index],
  3878. computed = iteratee == null ? value : iteratee(value);
  3879. value = (comparator || value !== 0) ? value : 0;
  3880. if (isCommon && computed === computed) {
  3881. var valuesIndex = valuesLength;
  3882. while (valuesIndex--) {
  3883. if (values[valuesIndex] === computed) {
  3884. continue outer;
  3885. }
  3886. }
  3887. result.push(value);
  3888. }
  3889. else if (!includes(values, computed, comparator)) {
  3890. result.push(value);
  3891. }
  3892. }
  3893. return result;
  3894. }
  3895. /**
  3896. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3897. *
  3898. * @private
  3899. * @param {Array|Object} collection The collection to iterate over.
  3900. * @param {Function} iteratee The function invoked per iteration.
  3901. * @returns {Array|Object} Returns `collection`.
  3902. */
  3903. var baseEach = createBaseEach(baseForOwn);
  3904. /**
  3905. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3906. *
  3907. * @private
  3908. * @param {Array|Object} collection The collection to iterate over.
  3909. * @param {Function} iteratee The function invoked per iteration.
  3910. * @returns {Array|Object} Returns `collection`.
  3911. */
  3912. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3913. /**
  3914. * The base implementation of `_.every` without support for iteratee shorthands.
  3915. *
  3916. * @private
  3917. * @param {Array|Object} collection The collection to iterate over.
  3918. * @param {Function} predicate The function invoked per iteration.
  3919. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3920. * else `false`
  3921. */
  3922. function baseEvery(collection, predicate) {
  3923. var result = true;
  3924. baseEach(collection, function(value, index, collection) {
  3925. result = !!predicate(value, index, collection);
  3926. return result;
  3927. });
  3928. return result;
  3929. }
  3930. /**
  3931. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3932. * `comparator` to determine the extremum value.
  3933. *
  3934. * @private
  3935. * @param {Array} array The array to iterate over.
  3936. * @param {Function} iteratee The iteratee invoked per iteration.
  3937. * @param {Function} comparator The comparator used to compare values.
  3938. * @returns {*} Returns the extremum value.
  3939. */
  3940. function baseExtremum(array, iteratee, comparator) {
  3941. var index = -1,
  3942. length = array.length;
  3943. while (++index < length) {
  3944. var value = array[index],
  3945. current = iteratee(value);
  3946. if (current != null && (computed === undefined
  3947. ? (current === current && !isSymbol(current))
  3948. : comparator(current, computed)
  3949. )) {
  3950. var computed = current,
  3951. result = value;
  3952. }
  3953. }
  3954. return result;
  3955. }
  3956. /**
  3957. * The base implementation of `_.fill` without an iteratee call guard.
  3958. *
  3959. * @private
  3960. * @param {Array} array The array to fill.
  3961. * @param {*} value The value to fill `array` with.
  3962. * @param {number} [start=0] The start position.
  3963. * @param {number} [end=array.length] The end position.
  3964. * @returns {Array} Returns `array`.
  3965. */
  3966. function baseFill(array, value, start, end) {
  3967. var length = array.length;
  3968. start = toInteger(start);
  3969. if (start < 0) {
  3970. start = -start > length ? 0 : (length + start);
  3971. }
  3972. end = (end === undefined || end > length) ? length : toInteger(end);
  3973. if (end < 0) {
  3974. end += length;
  3975. }
  3976. end = start > end ? 0 : toLength(end);
  3977. while (start < end) {
  3978. array[start++] = value;
  3979. }
  3980. return array;
  3981. }
  3982. /**
  3983. * The base implementation of `_.filter` without support for iteratee shorthands.
  3984. *
  3985. * @private
  3986. * @param {Array|Object} collection The collection to iterate over.
  3987. * @param {Function} predicate The function invoked per iteration.
  3988. * @returns {Array} Returns the new filtered array.
  3989. */
  3990. function baseFilter(collection, predicate) {
  3991. var result = [];
  3992. baseEach(collection, function(value, index, collection) {
  3993. if (predicate(value, index, collection)) {
  3994. result.push(value);
  3995. }
  3996. });
  3997. return result;
  3998. }
  3999. /**
  4000. * The base implementation of `_.flatten` with support for restricting flattening.
  4001. *
  4002. * @private
  4003. * @param {Array} array The array to flatten.
  4004. * @param {number} depth The maximum recursion depth.
  4005. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4006. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4007. * @param {Array} [result=[]] The initial result value.
  4008. * @returns {Array} Returns the new flattened array.
  4009. */
  4010. function baseFlatten(array, depth, predicate, isStrict, result) {
  4011. var index = -1,
  4012. length = array.length;
  4013. predicate || (predicate = isFlattenable);
  4014. result || (result = []);
  4015. while (++index < length) {
  4016. var value = array[index];
  4017. if (depth > 0 && predicate(value)) {
  4018. if (depth > 1) {
  4019. // Recursively flatten arrays (susceptible to call stack limits).
  4020. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4021. } else {
  4022. arrayPush(result, value);
  4023. }
  4024. } else if (!isStrict) {
  4025. result[result.length] = value;
  4026. }
  4027. }
  4028. return result;
  4029. }
  4030. /**
  4031. * The base implementation of `baseForOwn` which iterates over `object`
  4032. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4033. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4034. *
  4035. * @private
  4036. * @param {Object} object The object to iterate over.
  4037. * @param {Function} iteratee The function invoked per iteration.
  4038. * @param {Function} keysFunc The function to get the keys of `object`.
  4039. * @returns {Object} Returns `object`.
  4040. */
  4041. var baseFor = createBaseFor();
  4042. /**
  4043. * This function is like `baseFor` except that it iterates over properties
  4044. * in the opposite order.
  4045. *
  4046. * @private
  4047. * @param {Object} object The object to iterate over.
  4048. * @param {Function} iteratee The function invoked per iteration.
  4049. * @param {Function} keysFunc The function to get the keys of `object`.
  4050. * @returns {Object} Returns `object`.
  4051. */
  4052. var baseForRight = createBaseFor(true);
  4053. /**
  4054. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4055. *
  4056. * @private
  4057. * @param {Object} object The object to iterate over.
  4058. * @param {Function} iteratee The function invoked per iteration.
  4059. * @returns {Object} Returns `object`.
  4060. */
  4061. function baseForOwn(object, iteratee) {
  4062. return object && baseFor(object, iteratee, keys);
  4063. }
  4064. /**
  4065. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4066. *
  4067. * @private
  4068. * @param {Object} object The object to iterate over.
  4069. * @param {Function} iteratee The function invoked per iteration.
  4070. * @returns {Object} Returns `object`.
  4071. */
  4072. function baseForOwnRight(object, iteratee) {
  4073. return object && baseForRight(object, iteratee, keys);
  4074. }
  4075. /**
  4076. * The base implementation of `_.functions` which creates an array of
  4077. * `object` function property names filtered from `props`.
  4078. *
  4079. * @private
  4080. * @param {Object} object The object to inspect.
  4081. * @param {Array} props The property names to filter.
  4082. * @returns {Array} Returns the function names.
  4083. */
  4084. function baseFunctions(object, props) {
  4085. return arrayFilter(props, function(key) {
  4086. return isFunction(object[key]);
  4087. });
  4088. }
  4089. /**
  4090. * The base implementation of `_.get` without support for default values.
  4091. *
  4092. * @private
  4093. * @param {Object} object The object to query.
  4094. * @param {Array|string} path The path of the property to get.
  4095. * @returns {*} Returns the resolved value.
  4096. */
  4097. function baseGet(object, path) {
  4098. path = castPath(path, object);
  4099. var index = 0,
  4100. length = path.length;
  4101. while (object != null && index < length) {
  4102. object = object[toKey(path[index++])];
  4103. }
  4104. return (index && index == length) ? object : undefined;
  4105. }
  4106. /**
  4107. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4108. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4109. * symbols of `object`.
  4110. *
  4111. * @private
  4112. * @param {Object} object The object to query.
  4113. * @param {Function} keysFunc The function to get the keys of `object`.
  4114. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4115. * @returns {Array} Returns the array of property names and symbols.
  4116. */
  4117. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4118. var result = keysFunc(object);
  4119. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4120. }
  4121. /**
  4122. * The base implementation of `getTag` without fallbacks for buggy environments.
  4123. *
  4124. * @private
  4125. * @param {*} value The value to query.
  4126. * @returns {string} Returns the `toStringTag`.
  4127. */
  4128. function baseGetTag(value) {
  4129. if (value == null) {
  4130. return value === undefined ? undefinedTag : nullTag;
  4131. }
  4132. return (symToStringTag && symToStringTag in Object(value))
  4133. ? getRawTag(value)
  4134. : objectToString(value);
  4135. }
  4136. /**
  4137. * The base implementation of `_.gt` which doesn't coerce arguments.
  4138. *
  4139. * @private
  4140. * @param {*} value The value to compare.
  4141. * @param {*} other The other value to compare.
  4142. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4143. * else `false`.
  4144. */
  4145. function baseGt(value, other) {
  4146. return value > other;
  4147. }
  4148. /**
  4149. * The base implementation of `_.has` without support for deep paths.
  4150. *
  4151. * @private
  4152. * @param {Object} [object] The object to query.
  4153. * @param {Array|string} key The key to check.
  4154. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4155. */
  4156. function baseHas(object, key) {
  4157. return object != null && hasOwnProperty.call(object, key);
  4158. }
  4159. /**
  4160. * The base implementation of `_.hasIn` without support for deep paths.
  4161. *
  4162. * @private
  4163. * @param {Object} [object] The object to query.
  4164. * @param {Array|string} key The key to check.
  4165. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4166. */
  4167. function baseHasIn(object, key) {
  4168. return object != null && key in Object(object);
  4169. }
  4170. /**
  4171. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4172. *
  4173. * @private
  4174. * @param {number} number The number to check.
  4175. * @param {number} start The start of the range.
  4176. * @param {number} end The end of the range.
  4177. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4178. */
  4179. function baseInRange(number, start, end) {
  4180. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4181. }
  4182. /**
  4183. * The base implementation of methods like `_.intersection`, without support
  4184. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4185. *
  4186. * @private
  4187. * @param {Array} arrays The arrays to inspect.
  4188. * @param {Function} [iteratee] The iteratee invoked per element.
  4189. * @param {Function} [comparator] The comparator invoked per element.
  4190. * @returns {Array} Returns the new array of shared values.
  4191. */
  4192. function baseIntersection(arrays, iteratee, comparator) {
  4193. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4194. length = arrays[0].length,
  4195. othLength = arrays.length,
  4196. othIndex = othLength,
  4197. caches = Array(othLength),
  4198. maxLength = Infinity,
  4199. result = [];
  4200. while (othIndex--) {
  4201. var array = arrays[othIndex];
  4202. if (othIndex && iteratee) {
  4203. array = arrayMap(array, baseUnary(iteratee));
  4204. }
  4205. maxLength = nativeMin(array.length, maxLength);
  4206. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4207. ? new SetCache(othIndex && array)
  4208. : undefined;
  4209. }
  4210. array = arrays[0];
  4211. var index = -1,
  4212. seen = caches[0];
  4213. outer:
  4214. while (++index < length && result.length < maxLength) {
  4215. var value = array[index],
  4216. computed = iteratee ? iteratee(value) : value;
  4217. value = (comparator || value !== 0) ? value : 0;
  4218. if (!(seen
  4219. ? cacheHas(seen, computed)
  4220. : includes(result, computed, comparator)
  4221. )) {
  4222. othIndex = othLength;
  4223. while (--othIndex) {
  4224. var cache = caches[othIndex];
  4225. if (!(cache
  4226. ? cacheHas(cache, computed)
  4227. : includes(arrays[othIndex], computed, comparator))
  4228. ) {
  4229. continue outer;
  4230. }
  4231. }
  4232. if (seen) {
  4233. seen.push(computed);
  4234. }
  4235. result.push(value);
  4236. }
  4237. }
  4238. return result;
  4239. }
  4240. /**
  4241. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4242. * `object` with values transformed by `iteratee` and set by `setter`.
  4243. *
  4244. * @private
  4245. * @param {Object} object The object to iterate over.
  4246. * @param {Function} setter The function to set `accumulator` values.
  4247. * @param {Function} iteratee The iteratee to transform values.
  4248. * @param {Object} accumulator The initial inverted object.
  4249. * @returns {Function} Returns `accumulator`.
  4250. */
  4251. function baseInverter(object, setter, iteratee, accumulator) {
  4252. baseForOwn(object, function(value, key, object) {
  4253. setter(accumulator, iteratee(value), key, object);
  4254. });
  4255. return accumulator;
  4256. }
  4257. /**
  4258. * The base implementation of `_.invoke` without support for individual
  4259. * method arguments.
  4260. *
  4261. * @private
  4262. * @param {Object} object The object to query.
  4263. * @param {Array|string} path The path of the method to invoke.
  4264. * @param {Array} args The arguments to invoke the method with.
  4265. * @returns {*} Returns the result of the invoked method.
  4266. */
  4267. function baseInvoke(object, path, args) {
  4268. path = castPath(path, object);
  4269. object = parent(object, path);
  4270. var func = object == null ? object : object[toKey(last(path))];
  4271. return func == null ? undefined : apply(func, object, args);
  4272. }
  4273. /**
  4274. * The base implementation of `_.isArguments`.
  4275. *
  4276. * @private
  4277. * @param {*} value The value to check.
  4278. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4279. */
  4280. function baseIsArguments(value) {
  4281. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4282. }
  4283. /**
  4284. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4285. *
  4286. * @private
  4287. * @param {*} value The value to check.
  4288. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4289. */
  4290. function baseIsArrayBuffer(value) {
  4291. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4292. }
  4293. /**
  4294. * The base implementation of `_.isDate` without Node.js optimizations.
  4295. *
  4296. * @private
  4297. * @param {*} value The value to check.
  4298. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4299. */
  4300. function baseIsDate(value) {
  4301. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4302. }
  4303. /**
  4304. * The base implementation of `_.isEqual` which supports partial comparisons
  4305. * and tracks traversed objects.
  4306. *
  4307. * @private
  4308. * @param {*} value The value to compare.
  4309. * @param {*} other The other value to compare.
  4310. * @param {boolean} bitmask The bitmask flags.
  4311. * 1 - Unordered comparison
  4312. * 2 - Partial comparison
  4313. * @param {Function} [customizer] The function to customize comparisons.
  4314. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4315. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4316. */
  4317. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4318. if (value === other) {
  4319. return true;
  4320. }
  4321. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4322. return value !== value && other !== other;
  4323. }
  4324. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4325. }
  4326. /**
  4327. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4328. * deep comparisons and tracks traversed objects enabling objects with circular
  4329. * references to be compared.
  4330. *
  4331. * @private
  4332. * @param {Object} object The object to compare.
  4333. * @param {Object} other The other object to compare.
  4334. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4335. * @param {Function} customizer The function to customize comparisons.
  4336. * @param {Function} equalFunc The function to determine equivalents of values.
  4337. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4338. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4339. */
  4340. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4341. var objIsArr = isArray(object),
  4342. othIsArr = isArray(other),
  4343. objTag = objIsArr ? arrayTag : getTag(object),
  4344. othTag = othIsArr ? arrayTag : getTag(other);
  4345. objTag = objTag == argsTag ? objectTag : objTag;
  4346. othTag = othTag == argsTag ? objectTag : othTag;
  4347. var objIsObj = objTag == objectTag,
  4348. othIsObj = othTag == objectTag,
  4349. isSameTag = objTag == othTag;
  4350. if (isSameTag && isBuffer(object)) {
  4351. if (!isBuffer(other)) {
  4352. return false;
  4353. }
  4354. objIsArr = true;
  4355. objIsObj = false;
  4356. }
  4357. if (isSameTag && !objIsObj) {
  4358. stack || (stack = new Stack);
  4359. return (objIsArr || isTypedArray(object))
  4360. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4361. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4362. }
  4363. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4364. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4365. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4366. if (objIsWrapped || othIsWrapped) {
  4367. var objUnwrapped = objIsWrapped ? object.value() : object,
  4368. othUnwrapped = othIsWrapped ? other.value() : other;
  4369. stack || (stack = new Stack);
  4370. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4371. }
  4372. }
  4373. if (!isSameTag) {
  4374. return false;
  4375. }
  4376. stack || (stack = new Stack);
  4377. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4378. }
  4379. /**
  4380. * The base implementation of `_.isMap` without Node.js optimizations.
  4381. *
  4382. * @private
  4383. * @param {*} value The value to check.
  4384. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4385. */
  4386. function baseIsMap(value) {
  4387. return isObjectLike(value) && getTag(value) == mapTag;
  4388. }
  4389. /**
  4390. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4391. *
  4392. * @private
  4393. * @param {Object} object The object to inspect.
  4394. * @param {Object} source The object of property values to match.
  4395. * @param {Array} matchData The property names, values, and compare flags to match.
  4396. * @param {Function} [customizer] The function to customize comparisons.
  4397. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4398. */
  4399. function baseIsMatch(object, source, matchData, customizer) {
  4400. var index = matchData.length,
  4401. length = index,
  4402. noCustomizer = !customizer;
  4403. if (object == null) {
  4404. return !length;
  4405. }
  4406. object = Object(object);
  4407. while (index--) {
  4408. var data = matchData[index];
  4409. if ((noCustomizer && data[2])
  4410. ? data[1] !== object[data[0]]
  4411. : !(data[0] in object)
  4412. ) {
  4413. return false;
  4414. }
  4415. }
  4416. while (++index < length) {
  4417. data = matchData[index];
  4418. var key = data[0],
  4419. objValue = object[key],
  4420. srcValue = data[1];
  4421. if (noCustomizer && data[2]) {
  4422. if (objValue === undefined && !(key in object)) {
  4423. return false;
  4424. }
  4425. } else {
  4426. var stack = new Stack;
  4427. if (customizer) {
  4428. var result = customizer(objValue, srcValue, key, object, source, stack);
  4429. }
  4430. if (!(result === undefined
  4431. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4432. : result
  4433. )) {
  4434. return false;
  4435. }
  4436. }
  4437. }
  4438. return true;
  4439. }
  4440. /**
  4441. * The base implementation of `_.isNative` without bad shim checks.
  4442. *
  4443. * @private
  4444. * @param {*} value The value to check.
  4445. * @returns {boolean} Returns `true` if `value` is a native function,
  4446. * else `false`.
  4447. */
  4448. function baseIsNative(value) {
  4449. if (!isObject(value) || isMasked(value)) {
  4450. return false;
  4451. }
  4452. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4453. return pattern.test(toSource(value));
  4454. }
  4455. /**
  4456. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4457. *
  4458. * @private
  4459. * @param {*} value The value to check.
  4460. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4461. */
  4462. function baseIsRegExp(value) {
  4463. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4464. }
  4465. /**
  4466. * The base implementation of `_.isSet` without Node.js optimizations.
  4467. *
  4468. * @private
  4469. * @param {*} value The value to check.
  4470. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4471. */
  4472. function baseIsSet(value) {
  4473. return isObjectLike(value) && getTag(value) == setTag;
  4474. }
  4475. /**
  4476. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4477. *
  4478. * @private
  4479. * @param {*} value The value to check.
  4480. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4481. */
  4482. function baseIsTypedArray(value) {
  4483. return isObjectLike(value) &&
  4484. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4485. }
  4486. /**
  4487. * The base implementation of `_.iteratee`.
  4488. *
  4489. * @private
  4490. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4491. * @returns {Function} Returns the iteratee.
  4492. */
  4493. function baseIteratee(value) {
  4494. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4495. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4496. if (typeof value == 'function') {
  4497. return value;
  4498. }
  4499. if (value == null) {
  4500. return identity;
  4501. }
  4502. if (typeof value == 'object') {
  4503. return isArray(value)
  4504. ? baseMatchesProperty(value[0], value[1])
  4505. : baseMatches(value);
  4506. }
  4507. return property(value);
  4508. }
  4509. /**
  4510. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4511. *
  4512. * @private
  4513. * @param {Object} object The object to query.
  4514. * @returns {Array} Returns the array of property names.
  4515. */
  4516. function baseKeys(object) {
  4517. if (!isPrototype(object)) {
  4518. return nativeKeys(object);
  4519. }
  4520. var result = [];
  4521. for (var key in Object(object)) {
  4522. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4523. result.push(key);
  4524. }
  4525. }
  4526. return result;
  4527. }
  4528. /**
  4529. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4530. *
  4531. * @private
  4532. * @param {Object} object The object to query.
  4533. * @returns {Array} Returns the array of property names.
  4534. */
  4535. function baseKeysIn(object) {
  4536. if (!isObject(object)) {
  4537. return nativeKeysIn(object);
  4538. }
  4539. var isProto = isPrototype(object),
  4540. result = [];
  4541. for (var key in object) {
  4542. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4543. result.push(key);
  4544. }
  4545. }
  4546. return result;
  4547. }
  4548. /**
  4549. * The base implementation of `_.lt` which doesn't coerce arguments.
  4550. *
  4551. * @private
  4552. * @param {*} value The value to compare.
  4553. * @param {*} other The other value to compare.
  4554. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4555. * else `false`.
  4556. */
  4557. function baseLt(value, other) {
  4558. return value < other;
  4559. }
  4560. /**
  4561. * The base implementation of `_.map` without support for iteratee shorthands.
  4562. *
  4563. * @private
  4564. * @param {Array|Object} collection The collection to iterate over.
  4565. * @param {Function} iteratee The function invoked per iteration.
  4566. * @returns {Array} Returns the new mapped array.
  4567. */
  4568. function baseMap(collection, iteratee) {
  4569. var index = -1,
  4570. result = isArrayLike(collection) ? Array(collection.length) : [];
  4571. baseEach(collection, function(value, key, collection) {
  4572. result[++index] = iteratee(value, key, collection);
  4573. });
  4574. return result;
  4575. }
  4576. /**
  4577. * The base implementation of `_.matches` which doesn't clone `source`.
  4578. *
  4579. * @private
  4580. * @param {Object} source The object of property values to match.
  4581. * @returns {Function} Returns the new spec function.
  4582. */
  4583. function baseMatches(source) {
  4584. var matchData = getMatchData(source);
  4585. if (matchData.length == 1 && matchData[0][2]) {
  4586. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4587. }
  4588. return function(object) {
  4589. return object === source || baseIsMatch(object, source, matchData);
  4590. };
  4591. }
  4592. /**
  4593. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4594. *
  4595. * @private
  4596. * @param {string} path The path of the property to get.
  4597. * @param {*} srcValue The value to match.
  4598. * @returns {Function} Returns the new spec function.
  4599. */
  4600. function baseMatchesProperty(path, srcValue) {
  4601. if (isKey(path) && isStrictComparable(srcValue)) {
  4602. return matchesStrictComparable(toKey(path), srcValue);
  4603. }
  4604. return function(object) {
  4605. var objValue = get(object, path);
  4606. return (objValue === undefined && objValue === srcValue)
  4607. ? hasIn(object, path)
  4608. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4609. };
  4610. }
  4611. /**
  4612. * The base implementation of `_.merge` without support for multiple sources.
  4613. *
  4614. * @private
  4615. * @param {Object} object The destination object.
  4616. * @param {Object} source The source object.
  4617. * @param {number} srcIndex The index of `source`.
  4618. * @param {Function} [customizer] The function to customize merged values.
  4619. * @param {Object} [stack] Tracks traversed source values and their merged
  4620. * counterparts.
  4621. */
  4622. function baseMerge(object, source, srcIndex, customizer, stack) {
  4623. if (object === source) {
  4624. return;
  4625. }
  4626. baseFor(source, function(srcValue, key) {
  4627. stack || (stack = new Stack);
  4628. if (isObject(srcValue)) {
  4629. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4630. }
  4631. else {
  4632. var newValue = customizer
  4633. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4634. : undefined;
  4635. if (newValue === undefined) {
  4636. newValue = srcValue;
  4637. }
  4638. assignMergeValue(object, key, newValue);
  4639. }
  4640. }, keysIn);
  4641. }
  4642. /**
  4643. * A specialized version of `baseMerge` for arrays and objects which performs
  4644. * deep merges and tracks traversed objects enabling objects with circular
  4645. * references to be merged.
  4646. *
  4647. * @private
  4648. * @param {Object} object The destination object.
  4649. * @param {Object} source The source object.
  4650. * @param {string} key The key of the value to merge.
  4651. * @param {number} srcIndex The index of `source`.
  4652. * @param {Function} mergeFunc The function to merge values.
  4653. * @param {Function} [customizer] The function to customize assigned values.
  4654. * @param {Object} [stack] Tracks traversed source values and their merged
  4655. * counterparts.
  4656. */
  4657. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4658. var objValue = safeGet(object, key),
  4659. srcValue = safeGet(source, key),
  4660. stacked = stack.get(srcValue);
  4661. if (stacked) {
  4662. assignMergeValue(object, key, stacked);
  4663. return;
  4664. }
  4665. var newValue = customizer
  4666. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4667. : undefined;
  4668. var isCommon = newValue === undefined;
  4669. if (isCommon) {
  4670. var isArr = isArray(srcValue),
  4671. isBuff = !isArr && isBuffer(srcValue),
  4672. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4673. newValue = srcValue;
  4674. if (isArr || isBuff || isTyped) {
  4675. if (isArray(objValue)) {
  4676. newValue = objValue;
  4677. }
  4678. else if (isArrayLikeObject(objValue)) {
  4679. newValue = copyArray(objValue);
  4680. }
  4681. else if (isBuff) {
  4682. isCommon = false;
  4683. newValue = cloneBuffer(srcValue, true);
  4684. }
  4685. else if (isTyped) {
  4686. isCommon = false;
  4687. newValue = cloneTypedArray(srcValue, true);
  4688. }
  4689. else {
  4690. newValue = [];
  4691. }
  4692. }
  4693. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4694. newValue = objValue;
  4695. if (isArguments(objValue)) {
  4696. newValue = toPlainObject(objValue);
  4697. }
  4698. else if (!isObject(objValue) || isFunction(objValue)) {
  4699. newValue = initCloneObject(srcValue);
  4700. }
  4701. }
  4702. else {
  4703. isCommon = false;
  4704. }
  4705. }
  4706. if (isCommon) {
  4707. // Recursively merge objects and arrays (susceptible to call stack limits).
  4708. stack.set(srcValue, newValue);
  4709. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4710. stack['delete'](srcValue);
  4711. }
  4712. assignMergeValue(object, key, newValue);
  4713. }
  4714. /**
  4715. * The base implementation of `_.nth` which doesn't coerce arguments.
  4716. *
  4717. * @private
  4718. * @param {Array} array The array to query.
  4719. * @param {number} n The index of the element to return.
  4720. * @returns {*} Returns the nth element of `array`.
  4721. */
  4722. function baseNth(array, n) {
  4723. var length = array.length;
  4724. if (!length) {
  4725. return;
  4726. }
  4727. n += n < 0 ? length : 0;
  4728. return isIndex(n, length) ? array[n] : undefined;
  4729. }
  4730. /**
  4731. * The base implementation of `_.orderBy` without param guards.
  4732. *
  4733. * @private
  4734. * @param {Array|Object} collection The collection to iterate over.
  4735. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4736. * @param {string[]} orders The sort orders of `iteratees`.
  4737. * @returns {Array} Returns the new sorted array.
  4738. */
  4739. function baseOrderBy(collection, iteratees, orders) {
  4740. if (iteratees.length) {
  4741. iteratees = arrayMap(iteratees, function(iteratee) {
  4742. if (isArray(iteratee)) {
  4743. return function(value) {
  4744. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4745. }
  4746. }
  4747. return iteratee;
  4748. });
  4749. } else {
  4750. iteratees = [identity];
  4751. }
  4752. var index = -1;
  4753. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4754. var result = baseMap(collection, function(value, key, collection) {
  4755. var criteria = arrayMap(iteratees, function(iteratee) {
  4756. return iteratee(value);
  4757. });
  4758. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4759. });
  4760. return baseSortBy(result, function(object, other) {
  4761. return compareMultiple(object, other, orders);
  4762. });
  4763. }
  4764. /**
  4765. * The base implementation of `_.pick` without support for individual
  4766. * property identifiers.
  4767. *
  4768. * @private
  4769. * @param {Object} object The source object.
  4770. * @param {string[]} paths The property paths to pick.
  4771. * @returns {Object} Returns the new object.
  4772. */
  4773. function basePick(object, paths) {
  4774. return basePickBy(object, paths, function(value, path) {
  4775. return hasIn(object, path);
  4776. });
  4777. }
  4778. /**
  4779. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4780. *
  4781. * @private
  4782. * @param {Object} object The source object.
  4783. * @param {string[]} paths The property paths to pick.
  4784. * @param {Function} predicate The function invoked per property.
  4785. * @returns {Object} Returns the new object.
  4786. */
  4787. function basePickBy(object, paths, predicate) {
  4788. var index = -1,
  4789. length = paths.length,
  4790. result = {};
  4791. while (++index < length) {
  4792. var path = paths[index],
  4793. value = baseGet(object, path);
  4794. if (predicate(value, path)) {
  4795. baseSet(result, castPath(path, object), value);
  4796. }
  4797. }
  4798. return result;
  4799. }
  4800. /**
  4801. * A specialized version of `baseProperty` which supports deep paths.
  4802. *
  4803. * @private
  4804. * @param {Array|string} path The path of the property to get.
  4805. * @returns {Function} Returns the new accessor function.
  4806. */
  4807. function basePropertyDeep(path) {
  4808. return function(object) {
  4809. return baseGet(object, path);
  4810. };
  4811. }
  4812. /**
  4813. * The base implementation of `_.pullAllBy` without support for iteratee
  4814. * shorthands.
  4815. *
  4816. * @private
  4817. * @param {Array} array The array to modify.
  4818. * @param {Array} values The values to remove.
  4819. * @param {Function} [iteratee] The iteratee invoked per element.
  4820. * @param {Function} [comparator] The comparator invoked per element.
  4821. * @returns {Array} Returns `array`.
  4822. */
  4823. function basePullAll(array, values, iteratee, comparator) {
  4824. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4825. index = -1,
  4826. length = values.length,
  4827. seen = array;
  4828. if (array === values) {
  4829. values = copyArray(values);
  4830. }
  4831. if (iteratee) {
  4832. seen = arrayMap(array, baseUnary(iteratee));
  4833. }
  4834. while (++index < length) {
  4835. var fromIndex = 0,
  4836. value = values[index],
  4837. computed = iteratee ? iteratee(value) : value;
  4838. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4839. if (seen !== array) {
  4840. splice.call(seen, fromIndex, 1);
  4841. }
  4842. splice.call(array, fromIndex, 1);
  4843. }
  4844. }
  4845. return array;
  4846. }
  4847. /**
  4848. * The base implementation of `_.pullAt` without support for individual
  4849. * indexes or capturing the removed elements.
  4850. *
  4851. * @private
  4852. * @param {Array} array The array to modify.
  4853. * @param {number[]} indexes The indexes of elements to remove.
  4854. * @returns {Array} Returns `array`.
  4855. */
  4856. function basePullAt(array, indexes) {
  4857. var length = array ? indexes.length : 0,
  4858. lastIndex = length - 1;
  4859. while (length--) {
  4860. var index = indexes[length];
  4861. if (length == lastIndex || index !== previous) {
  4862. var previous = index;
  4863. if (isIndex(index)) {
  4864. splice.call(array, index, 1);
  4865. } else {
  4866. baseUnset(array, index);
  4867. }
  4868. }
  4869. }
  4870. return array;
  4871. }
  4872. /**
  4873. * The base implementation of `_.random` without support for returning
  4874. * floating-point numbers.
  4875. *
  4876. * @private
  4877. * @param {number} lower The lower bound.
  4878. * @param {number} upper The upper bound.
  4879. * @returns {number} Returns the random number.
  4880. */
  4881. function baseRandom(lower, upper) {
  4882. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4883. }
  4884. /**
  4885. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4886. * coerce arguments.
  4887. *
  4888. * @private
  4889. * @param {number} start The start of the range.
  4890. * @param {number} end The end of the range.
  4891. * @param {number} step The value to increment or decrement by.
  4892. * @param {boolean} [fromRight] Specify iterating from right to left.
  4893. * @returns {Array} Returns the range of numbers.
  4894. */
  4895. function baseRange(start, end, step, fromRight) {
  4896. var index = -1,
  4897. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4898. result = Array(length);
  4899. while (length--) {
  4900. result[fromRight ? length : ++index] = start;
  4901. start += step;
  4902. }
  4903. return result;
  4904. }
  4905. /**
  4906. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4907. *
  4908. * @private
  4909. * @param {string} string The string to repeat.
  4910. * @param {number} n The number of times to repeat the string.
  4911. * @returns {string} Returns the repeated string.
  4912. */
  4913. function baseRepeat(string, n) {
  4914. var result = '';
  4915. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4916. return result;
  4917. }
  4918. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4919. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4920. do {
  4921. if (n % 2) {
  4922. result += string;
  4923. }
  4924. n = nativeFloor(n / 2);
  4925. if (n) {
  4926. string += string;
  4927. }
  4928. } while (n);
  4929. return result;
  4930. }
  4931. /**
  4932. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4933. *
  4934. * @private
  4935. * @param {Function} func The function to apply a rest parameter to.
  4936. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4937. * @returns {Function} Returns the new function.
  4938. */
  4939. function baseRest(func, start) {
  4940. return setToString(overRest(func, start, identity), func + '');
  4941. }
  4942. /**
  4943. * The base implementation of `_.sample`.
  4944. *
  4945. * @private
  4946. * @param {Array|Object} collection The collection to sample.
  4947. * @returns {*} Returns the random element.
  4948. */
  4949. function baseSample(collection) {
  4950. return arraySample(values(collection));
  4951. }
  4952. /**
  4953. * The base implementation of `_.sampleSize` without param guards.
  4954. *
  4955. * @private
  4956. * @param {Array|Object} collection The collection to sample.
  4957. * @param {number} n The number of elements to sample.
  4958. * @returns {Array} Returns the random elements.
  4959. */
  4960. function baseSampleSize(collection, n) {
  4961. var array = values(collection);
  4962. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4963. }
  4964. /**
  4965. * The base implementation of `_.set`.
  4966. *
  4967. * @private
  4968. * @param {Object} object The object to modify.
  4969. * @param {Array|string} path The path of the property to set.
  4970. * @param {*} value The value to set.
  4971. * @param {Function} [customizer] The function to customize path creation.
  4972. * @returns {Object} Returns `object`.
  4973. */
  4974. function baseSet(object, path, value, customizer) {
  4975. if (!isObject(object)) {
  4976. return object;
  4977. }
  4978. path = castPath(path, object);
  4979. var index = -1,
  4980. length = path.length,
  4981. lastIndex = length - 1,
  4982. nested = object;
  4983. while (nested != null && ++index < length) {
  4984. var key = toKey(path[index]),
  4985. newValue = value;
  4986. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4987. return object;
  4988. }
  4989. if (index != lastIndex) {
  4990. var objValue = nested[key];
  4991. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4992. if (newValue === undefined) {
  4993. newValue = isObject(objValue)
  4994. ? objValue
  4995. : (isIndex(path[index + 1]) ? [] : {});
  4996. }
  4997. }
  4998. assignValue(nested, key, newValue);
  4999. nested = nested[key];
  5000. }
  5001. return object;
  5002. }
  5003. /**
  5004. * The base implementation of `setData` without support for hot loop shorting.
  5005. *
  5006. * @private
  5007. * @param {Function} func The function to associate metadata with.
  5008. * @param {*} data The metadata.
  5009. * @returns {Function} Returns `func`.
  5010. */
  5011. var baseSetData = !metaMap ? identity : function(func, data) {
  5012. metaMap.set(func, data);
  5013. return func;
  5014. };
  5015. /**
  5016. * The base implementation of `setToString` without support for hot loop shorting.
  5017. *
  5018. * @private
  5019. * @param {Function} func The function to modify.
  5020. * @param {Function} string The `toString` result.
  5021. * @returns {Function} Returns `func`.
  5022. */
  5023. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5024. return defineProperty(func, 'toString', {
  5025. 'configurable': true,
  5026. 'enumerable': false,
  5027. 'value': constant(string),
  5028. 'writable': true
  5029. });
  5030. };
  5031. /**
  5032. * The base implementation of `_.shuffle`.
  5033. *
  5034. * @private
  5035. * @param {Array|Object} collection The collection to shuffle.
  5036. * @returns {Array} Returns the new shuffled array.
  5037. */
  5038. function baseShuffle(collection) {
  5039. return shuffleSelf(values(collection));
  5040. }
  5041. /**
  5042. * The base implementation of `_.slice` without an iteratee call guard.
  5043. *
  5044. * @private
  5045. * @param {Array} array The array to slice.
  5046. * @param {number} [start=0] The start position.
  5047. * @param {number} [end=array.length] The end position.
  5048. * @returns {Array} Returns the slice of `array`.
  5049. */
  5050. function baseSlice(array, start, end) {
  5051. var index = -1,
  5052. length = array.length;
  5053. if (start < 0) {
  5054. start = -start > length ? 0 : (length + start);
  5055. }
  5056. end = end > length ? length : end;
  5057. if (end < 0) {
  5058. end += length;
  5059. }
  5060. length = start > end ? 0 : ((end - start) >>> 0);
  5061. start >>>= 0;
  5062. var result = Array(length);
  5063. while (++index < length) {
  5064. result[index] = array[index + start];
  5065. }
  5066. return result;
  5067. }
  5068. /**
  5069. * The base implementation of `_.some` without support for iteratee shorthands.
  5070. *
  5071. * @private
  5072. * @param {Array|Object} collection The collection to iterate over.
  5073. * @param {Function} predicate The function invoked per iteration.
  5074. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5075. * else `false`.
  5076. */
  5077. function baseSome(collection, predicate) {
  5078. var result;
  5079. baseEach(collection, function(value, index, collection) {
  5080. result = predicate(value, index, collection);
  5081. return !result;
  5082. });
  5083. return !!result;
  5084. }
  5085. /**
  5086. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5087. * performs a binary search of `array` to determine the index at which `value`
  5088. * should be inserted into `array` in order to maintain its sort order.
  5089. *
  5090. * @private
  5091. * @param {Array} array The sorted array to inspect.
  5092. * @param {*} value The value to evaluate.
  5093. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5094. * @returns {number} Returns the index at which `value` should be inserted
  5095. * into `array`.
  5096. */
  5097. function baseSortedIndex(array, value, retHighest) {
  5098. var low = 0,
  5099. high = array == null ? low : array.length;
  5100. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5101. while (low < high) {
  5102. var mid = (low + high) >>> 1,
  5103. computed = array[mid];
  5104. if (computed !== null && !isSymbol(computed) &&
  5105. (retHighest ? (computed <= value) : (computed < value))) {
  5106. low = mid + 1;
  5107. } else {
  5108. high = mid;
  5109. }
  5110. }
  5111. return high;
  5112. }
  5113. return baseSortedIndexBy(array, value, identity, retHighest);
  5114. }
  5115. /**
  5116. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5117. * which invokes `iteratee` for `value` and each element of `array` to compute
  5118. * their sort ranking. The iteratee is invoked with one argument; (value).
  5119. *
  5120. * @private
  5121. * @param {Array} array The sorted array to inspect.
  5122. * @param {*} value The value to evaluate.
  5123. * @param {Function} iteratee The iteratee invoked per element.
  5124. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5125. * @returns {number} Returns the index at which `value` should be inserted
  5126. * into `array`.
  5127. */
  5128. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5129. var low = 0,
  5130. high = array == null ? 0 : array.length;
  5131. if (high === 0) {
  5132. return 0;
  5133. }
  5134. value = iteratee(value);
  5135. var valIsNaN = value !== value,
  5136. valIsNull = value === null,
  5137. valIsSymbol = isSymbol(value),
  5138. valIsUndefined = value === undefined;
  5139. while (low < high) {
  5140. var mid = nativeFloor((low + high) / 2),
  5141. computed = iteratee(array[mid]),
  5142. othIsDefined = computed !== undefined,
  5143. othIsNull = computed === null,
  5144. othIsReflexive = computed === computed,
  5145. othIsSymbol = isSymbol(computed);
  5146. if (valIsNaN) {
  5147. var setLow = retHighest || othIsReflexive;
  5148. } else if (valIsUndefined) {
  5149. setLow = othIsReflexive && (retHighest || othIsDefined);
  5150. } else if (valIsNull) {
  5151. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5152. } else if (valIsSymbol) {
  5153. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5154. } else if (othIsNull || othIsSymbol) {
  5155. setLow = false;
  5156. } else {
  5157. setLow = retHighest ? (computed <= value) : (computed < value);
  5158. }
  5159. if (setLow) {
  5160. low = mid + 1;
  5161. } else {
  5162. high = mid;
  5163. }
  5164. }
  5165. return nativeMin(high, MAX_ARRAY_INDEX);
  5166. }
  5167. /**
  5168. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5169. * support for iteratee shorthands.
  5170. *
  5171. * @private
  5172. * @param {Array} array The array to inspect.
  5173. * @param {Function} [iteratee] The iteratee invoked per element.
  5174. * @returns {Array} Returns the new duplicate free array.
  5175. */
  5176. function baseSortedUniq(array, iteratee) {
  5177. var index = -1,
  5178. length = array.length,
  5179. resIndex = 0,
  5180. result = [];
  5181. while (++index < length) {
  5182. var value = array[index],
  5183. computed = iteratee ? iteratee(value) : value;
  5184. if (!index || !eq(computed, seen)) {
  5185. var seen = computed;
  5186. result[resIndex++] = value === 0 ? 0 : value;
  5187. }
  5188. }
  5189. return result;
  5190. }
  5191. /**
  5192. * The base implementation of `_.toNumber` which doesn't ensure correct
  5193. * conversions of binary, hexadecimal, or octal string values.
  5194. *
  5195. * @private
  5196. * @param {*} value The value to process.
  5197. * @returns {number} Returns the number.
  5198. */
  5199. function baseToNumber(value) {
  5200. if (typeof value == 'number') {
  5201. return value;
  5202. }
  5203. if (isSymbol(value)) {
  5204. return NAN;
  5205. }
  5206. return +value;
  5207. }
  5208. /**
  5209. * The base implementation of `_.toString` which doesn't convert nullish
  5210. * values to empty strings.
  5211. *
  5212. * @private
  5213. * @param {*} value The value to process.
  5214. * @returns {string} Returns the string.
  5215. */
  5216. function baseToString(value) {
  5217. // Exit early for strings to avoid a performance hit in some environments.
  5218. if (typeof value == 'string') {
  5219. return value;
  5220. }
  5221. if (isArray(value)) {
  5222. // Recursively convert values (susceptible to call stack limits).
  5223. return arrayMap(value, baseToString) + '';
  5224. }
  5225. if (isSymbol(value)) {
  5226. return symbolToString ? symbolToString.call(value) : '';
  5227. }
  5228. var result = (value + '');
  5229. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5230. }
  5231. /**
  5232. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5233. *
  5234. * @private
  5235. * @param {Array} array The array to inspect.
  5236. * @param {Function} [iteratee] The iteratee invoked per element.
  5237. * @param {Function} [comparator] The comparator invoked per element.
  5238. * @returns {Array} Returns the new duplicate free array.
  5239. */
  5240. function baseUniq(array, iteratee, comparator) {
  5241. var index = -1,
  5242. includes = arrayIncludes,
  5243. length = array.length,
  5244. isCommon = true,
  5245. result = [],
  5246. seen = result;
  5247. if (comparator) {
  5248. isCommon = false;
  5249. includes = arrayIncludesWith;
  5250. }
  5251. else if (length >= LARGE_ARRAY_SIZE) {
  5252. var set = iteratee ? null : createSet(array);
  5253. if (set) {
  5254. return setToArray(set);
  5255. }
  5256. isCommon = false;
  5257. includes = cacheHas;
  5258. seen = new SetCache;
  5259. }
  5260. else {
  5261. seen = iteratee ? [] : result;
  5262. }
  5263. outer:
  5264. while (++index < length) {
  5265. var value = array[index],
  5266. computed = iteratee ? iteratee(value) : value;
  5267. value = (comparator || value !== 0) ? value : 0;
  5268. if (isCommon && computed === computed) {
  5269. var seenIndex = seen.length;
  5270. while (seenIndex--) {
  5271. if (seen[seenIndex] === computed) {
  5272. continue outer;
  5273. }
  5274. }
  5275. if (iteratee) {
  5276. seen.push(computed);
  5277. }
  5278. result.push(value);
  5279. }
  5280. else if (!includes(seen, computed, comparator)) {
  5281. if (seen !== result) {
  5282. seen.push(computed);
  5283. }
  5284. result.push(value);
  5285. }
  5286. }
  5287. return result;
  5288. }
  5289. /**
  5290. * The base implementation of `_.unset`.
  5291. *
  5292. * @private
  5293. * @param {Object} object The object to modify.
  5294. * @param {Array|string} path The property path to unset.
  5295. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5296. */
  5297. function baseUnset(object, path) {
  5298. path = castPath(path, object);
  5299. object = parent(object, path);
  5300. return object == null || delete object[toKey(last(path))];
  5301. }
  5302. /**
  5303. * The base implementation of `_.update`.
  5304. *
  5305. * @private
  5306. * @param {Object} object The object to modify.
  5307. * @param {Array|string} path The path of the property to update.
  5308. * @param {Function} updater The function to produce the updated value.
  5309. * @param {Function} [customizer] The function to customize path creation.
  5310. * @returns {Object} Returns `object`.
  5311. */
  5312. function baseUpdate(object, path, updater, customizer) {
  5313. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5314. }
  5315. /**
  5316. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5317. * without support for iteratee shorthands.
  5318. *
  5319. * @private
  5320. * @param {Array} array The array to query.
  5321. * @param {Function} predicate The function invoked per iteration.
  5322. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5323. * @param {boolean} [fromRight] Specify iterating from right to left.
  5324. * @returns {Array} Returns the slice of `array`.
  5325. */
  5326. function baseWhile(array, predicate, isDrop, fromRight) {
  5327. var length = array.length,
  5328. index = fromRight ? length : -1;
  5329. while ((fromRight ? index-- : ++index < length) &&
  5330. predicate(array[index], index, array)) {}
  5331. return isDrop
  5332. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5333. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5334. }
  5335. /**
  5336. * The base implementation of `wrapperValue` which returns the result of
  5337. * performing a sequence of actions on the unwrapped `value`, where each
  5338. * successive action is supplied the return value of the previous.
  5339. *
  5340. * @private
  5341. * @param {*} value The unwrapped value.
  5342. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5343. * @returns {*} Returns the resolved value.
  5344. */
  5345. function baseWrapperValue(value, actions) {
  5346. var result = value;
  5347. if (result instanceof LazyWrapper) {
  5348. result = result.value();
  5349. }
  5350. return arrayReduce(actions, function(result, action) {
  5351. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5352. }, result);
  5353. }
  5354. /**
  5355. * The base implementation of methods like `_.xor`, without support for
  5356. * iteratee shorthands, that accepts an array of arrays to inspect.
  5357. *
  5358. * @private
  5359. * @param {Array} arrays The arrays to inspect.
  5360. * @param {Function} [iteratee] The iteratee invoked per element.
  5361. * @param {Function} [comparator] The comparator invoked per element.
  5362. * @returns {Array} Returns the new array of values.
  5363. */
  5364. function baseXor(arrays, iteratee, comparator) {
  5365. var length = arrays.length;
  5366. if (length < 2) {
  5367. return length ? baseUniq(arrays[0]) : [];
  5368. }
  5369. var index = -1,
  5370. result = Array(length);
  5371. while (++index < length) {
  5372. var array = arrays[index],
  5373. othIndex = -1;
  5374. while (++othIndex < length) {
  5375. if (othIndex != index) {
  5376. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5377. }
  5378. }
  5379. }
  5380. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5381. }
  5382. /**
  5383. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5384. *
  5385. * @private
  5386. * @param {Array} props The property identifiers.
  5387. * @param {Array} values The property values.
  5388. * @param {Function} assignFunc The function to assign values.
  5389. * @returns {Object} Returns the new object.
  5390. */
  5391. function baseZipObject(props, values, assignFunc) {
  5392. var index = -1,
  5393. length = props.length,
  5394. valsLength = values.length,
  5395. result = {};
  5396. while (++index < length) {
  5397. var value = index < valsLength ? values[index] : undefined;
  5398. assignFunc(result, props[index], value);
  5399. }
  5400. return result;
  5401. }
  5402. /**
  5403. * Casts `value` to an empty array if it's not an array like object.
  5404. *
  5405. * @private
  5406. * @param {*} value The value to inspect.
  5407. * @returns {Array|Object} Returns the cast array-like object.
  5408. */
  5409. function castArrayLikeObject(value) {
  5410. return isArrayLikeObject(value) ? value : [];
  5411. }
  5412. /**
  5413. * Casts `value` to `identity` if it's not a function.
  5414. *
  5415. * @private
  5416. * @param {*} value The value to inspect.
  5417. * @returns {Function} Returns cast function.
  5418. */
  5419. function castFunction(value) {
  5420. return typeof value == 'function' ? value : identity;
  5421. }
  5422. /**
  5423. * Casts `value` to a path array if it's not one.
  5424. *
  5425. * @private
  5426. * @param {*} value The value to inspect.
  5427. * @param {Object} [object] The object to query keys on.
  5428. * @returns {Array} Returns the cast property path array.
  5429. */
  5430. function castPath(value, object) {
  5431. if (isArray(value)) {
  5432. return value;
  5433. }
  5434. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5435. }
  5436. /**
  5437. * A `baseRest` alias which can be replaced with `identity` by module
  5438. * replacement plugins.
  5439. *
  5440. * @private
  5441. * @type {Function}
  5442. * @param {Function} func The function to apply a rest parameter to.
  5443. * @returns {Function} Returns the new function.
  5444. */
  5445. var castRest = baseRest;
  5446. /**
  5447. * Casts `array` to a slice if it's needed.
  5448. *
  5449. * @private
  5450. * @param {Array} array The array to inspect.
  5451. * @param {number} start The start position.
  5452. * @param {number} [end=array.length] The end position.
  5453. * @returns {Array} Returns the cast slice.
  5454. */
  5455. function castSlice(array, start, end) {
  5456. var length = array.length;
  5457. end = end === undefined ? length : end;
  5458. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5459. }
  5460. /**
  5461. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5462. *
  5463. * @private
  5464. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5465. */
  5466. var clearTimeout = ctxClearTimeout || function(id) {
  5467. return root.clearTimeout(id);
  5468. };
  5469. /**
  5470. * Creates a clone of `buffer`.
  5471. *
  5472. * @private
  5473. * @param {Buffer} buffer The buffer to clone.
  5474. * @param {boolean} [isDeep] Specify a deep clone.
  5475. * @returns {Buffer} Returns the cloned buffer.
  5476. */
  5477. function cloneBuffer(buffer, isDeep) {
  5478. if (isDeep) {
  5479. return buffer.slice();
  5480. }
  5481. var length = buffer.length,
  5482. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5483. buffer.copy(result);
  5484. return result;
  5485. }
  5486. /**
  5487. * Creates a clone of `arrayBuffer`.
  5488. *
  5489. * @private
  5490. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5491. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5492. */
  5493. function cloneArrayBuffer(arrayBuffer) {
  5494. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5495. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5496. return result;
  5497. }
  5498. /**
  5499. * Creates a clone of `dataView`.
  5500. *
  5501. * @private
  5502. * @param {Object} dataView The data view to clone.
  5503. * @param {boolean} [isDeep] Specify a deep clone.
  5504. * @returns {Object} Returns the cloned data view.
  5505. */
  5506. function cloneDataView(dataView, isDeep) {
  5507. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5508. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5509. }
  5510. /**
  5511. * Creates a clone of `regexp`.
  5512. *
  5513. * @private
  5514. * @param {Object} regexp The regexp to clone.
  5515. * @returns {Object} Returns the cloned regexp.
  5516. */
  5517. function cloneRegExp(regexp) {
  5518. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5519. result.lastIndex = regexp.lastIndex;
  5520. return result;
  5521. }
  5522. /**
  5523. * Creates a clone of the `symbol` object.
  5524. *
  5525. * @private
  5526. * @param {Object} symbol The symbol object to clone.
  5527. * @returns {Object} Returns the cloned symbol object.
  5528. */
  5529. function cloneSymbol(symbol) {
  5530. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5531. }
  5532. /**
  5533. * Creates a clone of `typedArray`.
  5534. *
  5535. * @private
  5536. * @param {Object} typedArray The typed array to clone.
  5537. * @param {boolean} [isDeep] Specify a deep clone.
  5538. * @returns {Object} Returns the cloned typed array.
  5539. */
  5540. function cloneTypedArray(typedArray, isDeep) {
  5541. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5542. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5543. }
  5544. /**
  5545. * Compares values to sort them in ascending order.
  5546. *
  5547. * @private
  5548. * @param {*} value The value to compare.
  5549. * @param {*} other The other value to compare.
  5550. * @returns {number} Returns the sort order indicator for `value`.
  5551. */
  5552. function compareAscending(value, other) {
  5553. if (value !== other) {
  5554. var valIsDefined = value !== undefined,
  5555. valIsNull = value === null,
  5556. valIsReflexive = value === value,
  5557. valIsSymbol = isSymbol(value);
  5558. var othIsDefined = other !== undefined,
  5559. othIsNull = other === null,
  5560. othIsReflexive = other === other,
  5561. othIsSymbol = isSymbol(other);
  5562. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5563. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5564. (valIsNull && othIsDefined && othIsReflexive) ||
  5565. (!valIsDefined && othIsReflexive) ||
  5566. !valIsReflexive) {
  5567. return 1;
  5568. }
  5569. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5570. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5571. (othIsNull && valIsDefined && valIsReflexive) ||
  5572. (!othIsDefined && valIsReflexive) ||
  5573. !othIsReflexive) {
  5574. return -1;
  5575. }
  5576. }
  5577. return 0;
  5578. }
  5579. /**
  5580. * Used by `_.orderBy` to compare multiple properties of a value to another
  5581. * and stable sort them.
  5582. *
  5583. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5584. * specify an order of "desc" for descending or "asc" for ascending sort order
  5585. * of corresponding values.
  5586. *
  5587. * @private
  5588. * @param {Object} object The object to compare.
  5589. * @param {Object} other The other object to compare.
  5590. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5591. * @returns {number} Returns the sort order indicator for `object`.
  5592. */
  5593. function compareMultiple(object, other, orders) {
  5594. var index = -1,
  5595. objCriteria = object.criteria,
  5596. othCriteria = other.criteria,
  5597. length = objCriteria.length,
  5598. ordersLength = orders.length;
  5599. while (++index < length) {
  5600. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5601. if (result) {
  5602. if (index >= ordersLength) {
  5603. return result;
  5604. }
  5605. var order = orders[index];
  5606. return result * (order == 'desc' ? -1 : 1);
  5607. }
  5608. }
  5609. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5610. // that causes it, under certain circumstances, to provide the same value for
  5611. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5612. // for more details.
  5613. //
  5614. // This also ensures a stable sort in V8 and other engines.
  5615. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5616. return object.index - other.index;
  5617. }
  5618. /**
  5619. * Creates an array that is the composition of partially applied arguments,
  5620. * placeholders, and provided arguments into a single array of arguments.
  5621. *
  5622. * @private
  5623. * @param {Array} args The provided arguments.
  5624. * @param {Array} partials The arguments to prepend to those provided.
  5625. * @param {Array} holders The `partials` placeholder indexes.
  5626. * @params {boolean} [isCurried] Specify composing for a curried function.
  5627. * @returns {Array} Returns the new array of composed arguments.
  5628. */
  5629. function composeArgs(args, partials, holders, isCurried) {
  5630. var argsIndex = -1,
  5631. argsLength = args.length,
  5632. holdersLength = holders.length,
  5633. leftIndex = -1,
  5634. leftLength = partials.length,
  5635. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5636. result = Array(leftLength + rangeLength),
  5637. isUncurried = !isCurried;
  5638. while (++leftIndex < leftLength) {
  5639. result[leftIndex] = partials[leftIndex];
  5640. }
  5641. while (++argsIndex < holdersLength) {
  5642. if (isUncurried || argsIndex < argsLength) {
  5643. result[holders[argsIndex]] = args[argsIndex];
  5644. }
  5645. }
  5646. while (rangeLength--) {
  5647. result[leftIndex++] = args[argsIndex++];
  5648. }
  5649. return result;
  5650. }
  5651. /**
  5652. * This function is like `composeArgs` except that the arguments composition
  5653. * is tailored for `_.partialRight`.
  5654. *
  5655. * @private
  5656. * @param {Array} args The provided arguments.
  5657. * @param {Array} partials The arguments to append to those provided.
  5658. * @param {Array} holders The `partials` placeholder indexes.
  5659. * @params {boolean} [isCurried] Specify composing for a curried function.
  5660. * @returns {Array} Returns the new array of composed arguments.
  5661. */
  5662. function composeArgsRight(args, partials, holders, isCurried) {
  5663. var argsIndex = -1,
  5664. argsLength = args.length,
  5665. holdersIndex = -1,
  5666. holdersLength = holders.length,
  5667. rightIndex = -1,
  5668. rightLength = partials.length,
  5669. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5670. result = Array(rangeLength + rightLength),
  5671. isUncurried = !isCurried;
  5672. while (++argsIndex < rangeLength) {
  5673. result[argsIndex] = args[argsIndex];
  5674. }
  5675. var offset = argsIndex;
  5676. while (++rightIndex < rightLength) {
  5677. result[offset + rightIndex] = partials[rightIndex];
  5678. }
  5679. while (++holdersIndex < holdersLength) {
  5680. if (isUncurried || argsIndex < argsLength) {
  5681. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5682. }
  5683. }
  5684. return result;
  5685. }
  5686. /**
  5687. * Copies the values of `source` to `array`.
  5688. *
  5689. * @private
  5690. * @param {Array} source The array to copy values from.
  5691. * @param {Array} [array=[]] The array to copy values to.
  5692. * @returns {Array} Returns `array`.
  5693. */
  5694. function copyArray(source, array) {
  5695. var index = -1,
  5696. length = source.length;
  5697. array || (array = Array(length));
  5698. while (++index < length) {
  5699. array[index] = source[index];
  5700. }
  5701. return array;
  5702. }
  5703. /**
  5704. * Copies properties of `source` to `object`.
  5705. *
  5706. * @private
  5707. * @param {Object} source The object to copy properties from.
  5708. * @param {Array} props The property identifiers to copy.
  5709. * @param {Object} [object={}] The object to copy properties to.
  5710. * @param {Function} [customizer] The function to customize copied values.
  5711. * @returns {Object} Returns `object`.
  5712. */
  5713. function copyObject(source, props, object, customizer) {
  5714. var isNew = !object;
  5715. object || (object = {});
  5716. var index = -1,
  5717. length = props.length;
  5718. while (++index < length) {
  5719. var key = props[index];
  5720. var newValue = customizer
  5721. ? customizer(object[key], source[key], key, object, source)
  5722. : undefined;
  5723. if (newValue === undefined) {
  5724. newValue = source[key];
  5725. }
  5726. if (isNew) {
  5727. baseAssignValue(object, key, newValue);
  5728. } else {
  5729. assignValue(object, key, newValue);
  5730. }
  5731. }
  5732. return object;
  5733. }
  5734. /**
  5735. * Copies own symbols of `source` to `object`.
  5736. *
  5737. * @private
  5738. * @param {Object} source The object to copy symbols from.
  5739. * @param {Object} [object={}] The object to copy symbols to.
  5740. * @returns {Object} Returns `object`.
  5741. */
  5742. function copySymbols(source, object) {
  5743. return copyObject(source, getSymbols(source), object);
  5744. }
  5745. /**
  5746. * Copies own and inherited symbols of `source` to `object`.
  5747. *
  5748. * @private
  5749. * @param {Object} source The object to copy symbols from.
  5750. * @param {Object} [object={}] The object to copy symbols to.
  5751. * @returns {Object} Returns `object`.
  5752. */
  5753. function copySymbolsIn(source, object) {
  5754. return copyObject(source, getSymbolsIn(source), object);
  5755. }
  5756. /**
  5757. * Creates a function like `_.groupBy`.
  5758. *
  5759. * @private
  5760. * @param {Function} setter The function to set accumulator values.
  5761. * @param {Function} [initializer] The accumulator object initializer.
  5762. * @returns {Function} Returns the new aggregator function.
  5763. */
  5764. function createAggregator(setter, initializer) {
  5765. return function(collection, iteratee) {
  5766. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5767. accumulator = initializer ? initializer() : {};
  5768. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5769. };
  5770. }
  5771. /**
  5772. * Creates a function like `_.assign`.
  5773. *
  5774. * @private
  5775. * @param {Function} assigner The function to assign values.
  5776. * @returns {Function} Returns the new assigner function.
  5777. */
  5778. function createAssigner(assigner) {
  5779. return baseRest(function(object, sources) {
  5780. var index = -1,
  5781. length = sources.length,
  5782. customizer = length > 1 ? sources[length - 1] : undefined,
  5783. guard = length > 2 ? sources[2] : undefined;
  5784. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5785. ? (length--, customizer)
  5786. : undefined;
  5787. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5788. customizer = length < 3 ? undefined : customizer;
  5789. length = 1;
  5790. }
  5791. object = Object(object);
  5792. while (++index < length) {
  5793. var source = sources[index];
  5794. if (source) {
  5795. assigner(object, source, index, customizer);
  5796. }
  5797. }
  5798. return object;
  5799. });
  5800. }
  5801. /**
  5802. * Creates a `baseEach` or `baseEachRight` function.
  5803. *
  5804. * @private
  5805. * @param {Function} eachFunc The function to iterate over a collection.
  5806. * @param {boolean} [fromRight] Specify iterating from right to left.
  5807. * @returns {Function} Returns the new base function.
  5808. */
  5809. function createBaseEach(eachFunc, fromRight) {
  5810. return function(collection, iteratee) {
  5811. if (collection == null) {
  5812. return collection;
  5813. }
  5814. if (!isArrayLike(collection)) {
  5815. return eachFunc(collection, iteratee);
  5816. }
  5817. var length = collection.length,
  5818. index = fromRight ? length : -1,
  5819. iterable = Object(collection);
  5820. while ((fromRight ? index-- : ++index < length)) {
  5821. if (iteratee(iterable[index], index, iterable) === false) {
  5822. break;
  5823. }
  5824. }
  5825. return collection;
  5826. };
  5827. }
  5828. /**
  5829. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5830. *
  5831. * @private
  5832. * @param {boolean} [fromRight] Specify iterating from right to left.
  5833. * @returns {Function} Returns the new base function.
  5834. */
  5835. function createBaseFor(fromRight) {
  5836. return function(object, iteratee, keysFunc) {
  5837. var index = -1,
  5838. iterable = Object(object),
  5839. props = keysFunc(object),
  5840. length = props.length;
  5841. while (length--) {
  5842. var key = props[fromRight ? length : ++index];
  5843. if (iteratee(iterable[key], key, iterable) === false) {
  5844. break;
  5845. }
  5846. }
  5847. return object;
  5848. };
  5849. }
  5850. /**
  5851. * Creates a function that wraps `func` to invoke it with the optional `this`
  5852. * binding of `thisArg`.
  5853. *
  5854. * @private
  5855. * @param {Function} func The function to wrap.
  5856. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5857. * @param {*} [thisArg] The `this` binding of `func`.
  5858. * @returns {Function} Returns the new wrapped function.
  5859. */
  5860. function createBind(func, bitmask, thisArg) {
  5861. var isBind = bitmask & WRAP_BIND_FLAG,
  5862. Ctor = createCtor(func);
  5863. function wrapper() {
  5864. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5865. return fn.apply(isBind ? thisArg : this, arguments);
  5866. }
  5867. return wrapper;
  5868. }
  5869. /**
  5870. * Creates a function like `_.lowerFirst`.
  5871. *
  5872. * @private
  5873. * @param {string} methodName The name of the `String` case method to use.
  5874. * @returns {Function} Returns the new case function.
  5875. */
  5876. function createCaseFirst(methodName) {
  5877. return function(string) {
  5878. string = toString(string);
  5879. var strSymbols = hasUnicode(string)
  5880. ? stringToArray(string)
  5881. : undefined;
  5882. var chr = strSymbols
  5883. ? strSymbols[0]
  5884. : string.charAt(0);
  5885. var trailing = strSymbols
  5886. ? castSlice(strSymbols, 1).join('')
  5887. : string.slice(1);
  5888. return chr[methodName]() + trailing;
  5889. };
  5890. }
  5891. /**
  5892. * Creates a function like `_.camelCase`.
  5893. *
  5894. * @private
  5895. * @param {Function} callback The function to combine each word.
  5896. * @returns {Function} Returns the new compounder function.
  5897. */
  5898. function createCompounder(callback) {
  5899. return function(string) {
  5900. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5901. };
  5902. }
  5903. /**
  5904. * Creates a function that produces an instance of `Ctor` regardless of
  5905. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5906. *
  5907. * @private
  5908. * @param {Function} Ctor The constructor to wrap.
  5909. * @returns {Function} Returns the new wrapped function.
  5910. */
  5911. function createCtor(Ctor) {
  5912. return function() {
  5913. // Use a `switch` statement to work with class constructors. See
  5914. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5915. // for more details.
  5916. var args = arguments;
  5917. switch (args.length) {
  5918. case 0: return new Ctor;
  5919. case 1: return new Ctor(args[0]);
  5920. case 2: return new Ctor(args[0], args[1]);
  5921. case 3: return new Ctor(args[0], args[1], args[2]);
  5922. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5923. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5924. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5925. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5926. }
  5927. var thisBinding = baseCreate(Ctor.prototype),
  5928. result = Ctor.apply(thisBinding, args);
  5929. // Mimic the constructor's `return` behavior.
  5930. // See https://es5.github.io/#x13.2.2 for more details.
  5931. return isObject(result) ? result : thisBinding;
  5932. };
  5933. }
  5934. /**
  5935. * Creates a function that wraps `func` to enable currying.
  5936. *
  5937. * @private
  5938. * @param {Function} func The function to wrap.
  5939. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5940. * @param {number} arity The arity of `func`.
  5941. * @returns {Function} Returns the new wrapped function.
  5942. */
  5943. function createCurry(func, bitmask, arity) {
  5944. var Ctor = createCtor(func);
  5945. function wrapper() {
  5946. var length = arguments.length,
  5947. args = Array(length),
  5948. index = length,
  5949. placeholder = getHolder(wrapper);
  5950. while (index--) {
  5951. args[index] = arguments[index];
  5952. }
  5953. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5954. ? []
  5955. : replaceHolders(args, placeholder);
  5956. length -= holders.length;
  5957. if (length < arity) {
  5958. return createRecurry(
  5959. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5960. args, holders, undefined, undefined, arity - length);
  5961. }
  5962. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5963. return apply(fn, this, args);
  5964. }
  5965. return wrapper;
  5966. }
  5967. /**
  5968. * Creates a `_.find` or `_.findLast` function.
  5969. *
  5970. * @private
  5971. * @param {Function} findIndexFunc The function to find the collection index.
  5972. * @returns {Function} Returns the new find function.
  5973. */
  5974. function createFind(findIndexFunc) {
  5975. return function(collection, predicate, fromIndex) {
  5976. var iterable = Object(collection);
  5977. if (!isArrayLike(collection)) {
  5978. var iteratee = getIteratee(predicate, 3);
  5979. collection = keys(collection);
  5980. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5981. }
  5982. var index = findIndexFunc(collection, predicate, fromIndex);
  5983. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5984. };
  5985. }
  5986. /**
  5987. * Creates a `_.flow` or `_.flowRight` function.
  5988. *
  5989. * @private
  5990. * @param {boolean} [fromRight] Specify iterating from right to left.
  5991. * @returns {Function} Returns the new flow function.
  5992. */
  5993. function createFlow(fromRight) {
  5994. return flatRest(function(funcs) {
  5995. var length = funcs.length,
  5996. index = length,
  5997. prereq = LodashWrapper.prototype.thru;
  5998. if (fromRight) {
  5999. funcs.reverse();
  6000. }
  6001. while (index--) {
  6002. var func = funcs[index];
  6003. if (typeof func != 'function') {
  6004. throw new TypeError(FUNC_ERROR_TEXT);
  6005. }
  6006. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6007. var wrapper = new LodashWrapper([], true);
  6008. }
  6009. }
  6010. index = wrapper ? index : length;
  6011. while (++index < length) {
  6012. func = funcs[index];
  6013. var funcName = getFuncName(func),
  6014. data = funcName == 'wrapper' ? getData(func) : undefined;
  6015. if (data && isLaziable(data[0]) &&
  6016. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6017. !data[4].length && data[9] == 1
  6018. ) {
  6019. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6020. } else {
  6021. wrapper = (func.length == 1 && isLaziable(func))
  6022. ? wrapper[funcName]()
  6023. : wrapper.thru(func);
  6024. }
  6025. }
  6026. return function() {
  6027. var args = arguments,
  6028. value = args[0];
  6029. if (wrapper && args.length == 1 && isArray(value)) {
  6030. return wrapper.plant(value).value();
  6031. }
  6032. var index = 0,
  6033. result = length ? funcs[index].apply(this, args) : value;
  6034. while (++index < length) {
  6035. result = funcs[index].call(this, result);
  6036. }
  6037. return result;
  6038. };
  6039. });
  6040. }
  6041. /**
  6042. * Creates a function that wraps `func` to invoke it with optional `this`
  6043. * binding of `thisArg`, partial application, and currying.
  6044. *
  6045. * @private
  6046. * @param {Function|string} func The function or method name to wrap.
  6047. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6048. * @param {*} [thisArg] The `this` binding of `func`.
  6049. * @param {Array} [partials] The arguments to prepend to those provided to
  6050. * the new function.
  6051. * @param {Array} [holders] The `partials` placeholder indexes.
  6052. * @param {Array} [partialsRight] The arguments to append to those provided
  6053. * to the new function.
  6054. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6055. * @param {Array} [argPos] The argument positions of the new function.
  6056. * @param {number} [ary] The arity cap of `func`.
  6057. * @param {number} [arity] The arity of `func`.
  6058. * @returns {Function} Returns the new wrapped function.
  6059. */
  6060. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6061. var isAry = bitmask & WRAP_ARY_FLAG,
  6062. isBind = bitmask & WRAP_BIND_FLAG,
  6063. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6064. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6065. isFlip = bitmask & WRAP_FLIP_FLAG,
  6066. Ctor = isBindKey ? undefined : createCtor(func);
  6067. function wrapper() {
  6068. var length = arguments.length,
  6069. args = Array(length),
  6070. index = length;
  6071. while (index--) {
  6072. args[index] = arguments[index];
  6073. }
  6074. if (isCurried) {
  6075. var placeholder = getHolder(wrapper),
  6076. holdersCount = countHolders(args, placeholder);
  6077. }
  6078. if (partials) {
  6079. args = composeArgs(args, partials, holders, isCurried);
  6080. }
  6081. if (partialsRight) {
  6082. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6083. }
  6084. length -= holdersCount;
  6085. if (isCurried && length < arity) {
  6086. var newHolders = replaceHolders(args, placeholder);
  6087. return createRecurry(
  6088. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6089. args, newHolders, argPos, ary, arity - length
  6090. );
  6091. }
  6092. var thisBinding = isBind ? thisArg : this,
  6093. fn = isBindKey ? thisBinding[func] : func;
  6094. length = args.length;
  6095. if (argPos) {
  6096. args = reorder(args, argPos);
  6097. } else if (isFlip && length > 1) {
  6098. args.reverse();
  6099. }
  6100. if (isAry && ary < length) {
  6101. args.length = ary;
  6102. }
  6103. if (this && this !== root && this instanceof wrapper) {
  6104. fn = Ctor || createCtor(fn);
  6105. }
  6106. return fn.apply(thisBinding, args);
  6107. }
  6108. return wrapper;
  6109. }
  6110. /**
  6111. * Creates a function like `_.invertBy`.
  6112. *
  6113. * @private
  6114. * @param {Function} setter The function to set accumulator values.
  6115. * @param {Function} toIteratee The function to resolve iteratees.
  6116. * @returns {Function} Returns the new inverter function.
  6117. */
  6118. function createInverter(setter, toIteratee) {
  6119. return function(object, iteratee) {
  6120. return baseInverter(object, setter, toIteratee(iteratee), {});
  6121. };
  6122. }
  6123. /**
  6124. * Creates a function that performs a mathematical operation on two values.
  6125. *
  6126. * @private
  6127. * @param {Function} operator The function to perform the operation.
  6128. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6129. * @returns {Function} Returns the new mathematical operation function.
  6130. */
  6131. function createMathOperation(operator, defaultValue) {
  6132. return function(value, other) {
  6133. var result;
  6134. if (value === undefined && other === undefined) {
  6135. return defaultValue;
  6136. }
  6137. if (value !== undefined) {
  6138. result = value;
  6139. }
  6140. if (other !== undefined) {
  6141. if (result === undefined) {
  6142. return other;
  6143. }
  6144. if (typeof value == 'string' || typeof other == 'string') {
  6145. value = baseToString(value);
  6146. other = baseToString(other);
  6147. } else {
  6148. value = baseToNumber(value);
  6149. other = baseToNumber(other);
  6150. }
  6151. result = operator(value, other);
  6152. }
  6153. return result;
  6154. };
  6155. }
  6156. /**
  6157. * Creates a function like `_.over`.
  6158. *
  6159. * @private
  6160. * @param {Function} arrayFunc The function to iterate over iteratees.
  6161. * @returns {Function} Returns the new over function.
  6162. */
  6163. function createOver(arrayFunc) {
  6164. return flatRest(function(iteratees) {
  6165. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6166. return baseRest(function(args) {
  6167. var thisArg = this;
  6168. return arrayFunc(iteratees, function(iteratee) {
  6169. return apply(iteratee, thisArg, args);
  6170. });
  6171. });
  6172. });
  6173. }
  6174. /**
  6175. * Creates the padding for `string` based on `length`. The `chars` string
  6176. * is truncated if the number of characters exceeds `length`.
  6177. *
  6178. * @private
  6179. * @param {number} length The padding length.
  6180. * @param {string} [chars=' '] The string used as padding.
  6181. * @returns {string} Returns the padding for `string`.
  6182. */
  6183. function createPadding(length, chars) {
  6184. chars = chars === undefined ? ' ' : baseToString(chars);
  6185. var charsLength = chars.length;
  6186. if (charsLength < 2) {
  6187. return charsLength ? baseRepeat(chars, length) : chars;
  6188. }
  6189. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6190. return hasUnicode(chars)
  6191. ? castSlice(stringToArray(result), 0, length).join('')
  6192. : result.slice(0, length);
  6193. }
  6194. /**
  6195. * Creates a function that wraps `func` to invoke it with the `this` binding
  6196. * of `thisArg` and `partials` prepended to the arguments it receives.
  6197. *
  6198. * @private
  6199. * @param {Function} func The function to wrap.
  6200. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6201. * @param {*} thisArg The `this` binding of `func`.
  6202. * @param {Array} partials The arguments to prepend to those provided to
  6203. * the new function.
  6204. * @returns {Function} Returns the new wrapped function.
  6205. */
  6206. function createPartial(func, bitmask, thisArg, partials) {
  6207. var isBind = bitmask & WRAP_BIND_FLAG,
  6208. Ctor = createCtor(func);
  6209. function wrapper() {
  6210. var argsIndex = -1,
  6211. argsLength = arguments.length,
  6212. leftIndex = -1,
  6213. leftLength = partials.length,
  6214. args = Array(leftLength + argsLength),
  6215. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6216. while (++leftIndex < leftLength) {
  6217. args[leftIndex] = partials[leftIndex];
  6218. }
  6219. while (argsLength--) {
  6220. args[leftIndex++] = arguments[++argsIndex];
  6221. }
  6222. return apply(fn, isBind ? thisArg : this, args);
  6223. }
  6224. return wrapper;
  6225. }
  6226. /**
  6227. * Creates a `_.range` or `_.rangeRight` function.
  6228. *
  6229. * @private
  6230. * @param {boolean} [fromRight] Specify iterating from right to left.
  6231. * @returns {Function} Returns the new range function.
  6232. */
  6233. function createRange(fromRight) {
  6234. return function(start, end, step) {
  6235. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6236. end = step = undefined;
  6237. }
  6238. // Ensure the sign of `-0` is preserved.
  6239. start = toFinite(start);
  6240. if (end === undefined) {
  6241. end = start;
  6242. start = 0;
  6243. } else {
  6244. end = toFinite(end);
  6245. }
  6246. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6247. return baseRange(start, end, step, fromRight);
  6248. };
  6249. }
  6250. /**
  6251. * Creates a function that performs a relational operation on two values.
  6252. *
  6253. * @private
  6254. * @param {Function} operator The function to perform the operation.
  6255. * @returns {Function} Returns the new relational operation function.
  6256. */
  6257. function createRelationalOperation(operator) {
  6258. return function(value, other) {
  6259. if (!(typeof value == 'string' && typeof other == 'string')) {
  6260. value = toNumber(value);
  6261. other = toNumber(other);
  6262. }
  6263. return operator(value, other);
  6264. };
  6265. }
  6266. /**
  6267. * Creates a function that wraps `func` to continue currying.
  6268. *
  6269. * @private
  6270. * @param {Function} func The function to wrap.
  6271. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6272. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6273. * @param {*} placeholder The placeholder value.
  6274. * @param {*} [thisArg] The `this` binding of `func`.
  6275. * @param {Array} [partials] The arguments to prepend to those provided to
  6276. * the new function.
  6277. * @param {Array} [holders] The `partials` placeholder indexes.
  6278. * @param {Array} [argPos] The argument positions of the new function.
  6279. * @param {number} [ary] The arity cap of `func`.
  6280. * @param {number} [arity] The arity of `func`.
  6281. * @returns {Function} Returns the new wrapped function.
  6282. */
  6283. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6284. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6285. newHolders = isCurry ? holders : undefined,
  6286. newHoldersRight = isCurry ? undefined : holders,
  6287. newPartials = isCurry ? partials : undefined,
  6288. newPartialsRight = isCurry ? undefined : partials;
  6289. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6290. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6291. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6292. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6293. }
  6294. var newData = [
  6295. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6296. newHoldersRight, argPos, ary, arity
  6297. ];
  6298. var result = wrapFunc.apply(undefined, newData);
  6299. if (isLaziable(func)) {
  6300. setData(result, newData);
  6301. }
  6302. result.placeholder = placeholder;
  6303. return setWrapToString(result, func, bitmask);
  6304. }
  6305. /**
  6306. * Creates a function like `_.round`.
  6307. *
  6308. * @private
  6309. * @param {string} methodName The name of the `Math` method to use when rounding.
  6310. * @returns {Function} Returns the new round function.
  6311. */
  6312. function createRound(methodName) {
  6313. var func = Math[methodName];
  6314. return function(number, precision) {
  6315. number = toNumber(number);
  6316. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6317. if (precision && nativeIsFinite(number)) {
  6318. // Shift with exponential notation to avoid floating-point issues.
  6319. // See [MDN](https://mdn.io/round#Examples) for more details.
  6320. var pair = (toString(number) + 'e').split('e'),
  6321. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6322. pair = (toString(value) + 'e').split('e');
  6323. return +(pair[0] + 'e' + (+pair[1] - precision));
  6324. }
  6325. return func(number);
  6326. };
  6327. }
  6328. /**
  6329. * Creates a set object of `values`.
  6330. *
  6331. * @private
  6332. * @param {Array} values The values to add to the set.
  6333. * @returns {Object} Returns the new set.
  6334. */
  6335. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6336. return new Set(values);
  6337. };
  6338. /**
  6339. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6340. *
  6341. * @private
  6342. * @param {Function} keysFunc The function to get the keys of a given object.
  6343. * @returns {Function} Returns the new pairs function.
  6344. */
  6345. function createToPairs(keysFunc) {
  6346. return function(object) {
  6347. var tag = getTag(object);
  6348. if (tag == mapTag) {
  6349. return mapToArray(object);
  6350. }
  6351. if (tag == setTag) {
  6352. return setToPairs(object);
  6353. }
  6354. return baseToPairs(object, keysFunc(object));
  6355. };
  6356. }
  6357. /**
  6358. * Creates a function that either curries or invokes `func` with optional
  6359. * `this` binding and partially applied arguments.
  6360. *
  6361. * @private
  6362. * @param {Function|string} func The function or method name to wrap.
  6363. * @param {number} bitmask The bitmask flags.
  6364. * 1 - `_.bind`
  6365. * 2 - `_.bindKey`
  6366. * 4 - `_.curry` or `_.curryRight` of a bound function
  6367. * 8 - `_.curry`
  6368. * 16 - `_.curryRight`
  6369. * 32 - `_.partial`
  6370. * 64 - `_.partialRight`
  6371. * 128 - `_.rearg`
  6372. * 256 - `_.ary`
  6373. * 512 - `_.flip`
  6374. * @param {*} [thisArg] The `this` binding of `func`.
  6375. * @param {Array} [partials] The arguments to be partially applied.
  6376. * @param {Array} [holders] The `partials` placeholder indexes.
  6377. * @param {Array} [argPos] The argument positions of the new function.
  6378. * @param {number} [ary] The arity cap of `func`.
  6379. * @param {number} [arity] The arity of `func`.
  6380. * @returns {Function} Returns the new wrapped function.
  6381. */
  6382. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6383. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6384. if (!isBindKey && typeof func != 'function') {
  6385. throw new TypeError(FUNC_ERROR_TEXT);
  6386. }
  6387. var length = partials ? partials.length : 0;
  6388. if (!length) {
  6389. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6390. partials = holders = undefined;
  6391. }
  6392. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6393. arity = arity === undefined ? arity : toInteger(arity);
  6394. length -= holders ? holders.length : 0;
  6395. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6396. var partialsRight = partials,
  6397. holdersRight = holders;
  6398. partials = holders = undefined;
  6399. }
  6400. var data = isBindKey ? undefined : getData(func);
  6401. var newData = [
  6402. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6403. argPos, ary, arity
  6404. ];
  6405. if (data) {
  6406. mergeData(newData, data);
  6407. }
  6408. func = newData[0];
  6409. bitmask = newData[1];
  6410. thisArg = newData[2];
  6411. partials = newData[3];
  6412. holders = newData[4];
  6413. arity = newData[9] = newData[9] === undefined
  6414. ? (isBindKey ? 0 : func.length)
  6415. : nativeMax(newData[9] - length, 0);
  6416. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6417. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6418. }
  6419. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6420. var result = createBind(func, bitmask, thisArg);
  6421. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6422. result = createCurry(func, bitmask, arity);
  6423. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6424. result = createPartial(func, bitmask, thisArg, partials);
  6425. } else {
  6426. result = createHybrid.apply(undefined, newData);
  6427. }
  6428. var setter = data ? baseSetData : setData;
  6429. return setWrapToString(setter(result, newData), func, bitmask);
  6430. }
  6431. /**
  6432. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6433. * of source objects to the destination object for all destination properties
  6434. * that resolve to `undefined`.
  6435. *
  6436. * @private
  6437. * @param {*} objValue The destination value.
  6438. * @param {*} srcValue The source value.
  6439. * @param {string} key The key of the property to assign.
  6440. * @param {Object} object The parent object of `objValue`.
  6441. * @returns {*} Returns the value to assign.
  6442. */
  6443. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6444. if (objValue === undefined ||
  6445. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6446. return srcValue;
  6447. }
  6448. return objValue;
  6449. }
  6450. /**
  6451. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6452. * objects into destination objects that are passed thru.
  6453. *
  6454. * @private
  6455. * @param {*} objValue The destination value.
  6456. * @param {*} srcValue The source value.
  6457. * @param {string} key The key of the property to merge.
  6458. * @param {Object} object The parent object of `objValue`.
  6459. * @param {Object} source The parent object of `srcValue`.
  6460. * @param {Object} [stack] Tracks traversed source values and their merged
  6461. * counterparts.
  6462. * @returns {*} Returns the value to assign.
  6463. */
  6464. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6465. if (isObject(objValue) && isObject(srcValue)) {
  6466. // Recursively merge objects and arrays (susceptible to call stack limits).
  6467. stack.set(srcValue, objValue);
  6468. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6469. stack['delete'](srcValue);
  6470. }
  6471. return objValue;
  6472. }
  6473. /**
  6474. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6475. * objects.
  6476. *
  6477. * @private
  6478. * @param {*} value The value to inspect.
  6479. * @param {string} key The key of the property to inspect.
  6480. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6481. */
  6482. function customOmitClone(value) {
  6483. return isPlainObject(value) ? undefined : value;
  6484. }
  6485. /**
  6486. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6487. * partial deep comparisons.
  6488. *
  6489. * @private
  6490. * @param {Array} array The array to compare.
  6491. * @param {Array} other The other array to compare.
  6492. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6493. * @param {Function} customizer The function to customize comparisons.
  6494. * @param {Function} equalFunc The function to determine equivalents of values.
  6495. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6496. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6497. */
  6498. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6499. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6500. arrLength = array.length,
  6501. othLength = other.length;
  6502. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6503. return false;
  6504. }
  6505. // Check that cyclic values are equal.
  6506. var arrStacked = stack.get(array);
  6507. var othStacked = stack.get(other);
  6508. if (arrStacked && othStacked) {
  6509. return arrStacked == other && othStacked == array;
  6510. }
  6511. var index = -1,
  6512. result = true,
  6513. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6514. stack.set(array, other);
  6515. stack.set(other, array);
  6516. // Ignore non-index properties.
  6517. while (++index < arrLength) {
  6518. var arrValue = array[index],
  6519. othValue = other[index];
  6520. if (customizer) {
  6521. var compared = isPartial
  6522. ? customizer(othValue, arrValue, index, other, array, stack)
  6523. : customizer(arrValue, othValue, index, array, other, stack);
  6524. }
  6525. if (compared !== undefined) {
  6526. if (compared) {
  6527. continue;
  6528. }
  6529. result = false;
  6530. break;
  6531. }
  6532. // Recursively compare arrays (susceptible to call stack limits).
  6533. if (seen) {
  6534. if (!arraySome(other, function(othValue, othIndex) {
  6535. if (!cacheHas(seen, othIndex) &&
  6536. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6537. return seen.push(othIndex);
  6538. }
  6539. })) {
  6540. result = false;
  6541. break;
  6542. }
  6543. } else if (!(
  6544. arrValue === othValue ||
  6545. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6546. )) {
  6547. result = false;
  6548. break;
  6549. }
  6550. }
  6551. stack['delete'](array);
  6552. stack['delete'](other);
  6553. return result;
  6554. }
  6555. /**
  6556. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6557. * the same `toStringTag`.
  6558. *
  6559. * **Note:** This function only supports comparing values with tags of
  6560. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6561. *
  6562. * @private
  6563. * @param {Object} object The object to compare.
  6564. * @param {Object} other The other object to compare.
  6565. * @param {string} tag The `toStringTag` of the objects to compare.
  6566. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6567. * @param {Function} customizer The function to customize comparisons.
  6568. * @param {Function} equalFunc The function to determine equivalents of values.
  6569. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6570. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6571. */
  6572. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6573. switch (tag) {
  6574. case dataViewTag:
  6575. if ((object.byteLength != other.byteLength) ||
  6576. (object.byteOffset != other.byteOffset)) {
  6577. return false;
  6578. }
  6579. object = object.buffer;
  6580. other = other.buffer;
  6581. case arrayBufferTag:
  6582. if ((object.byteLength != other.byteLength) ||
  6583. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6584. return false;
  6585. }
  6586. return true;
  6587. case boolTag:
  6588. case dateTag:
  6589. case numberTag:
  6590. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6591. // Invalid dates are coerced to `NaN`.
  6592. return eq(+object, +other);
  6593. case errorTag:
  6594. return object.name == other.name && object.message == other.message;
  6595. case regexpTag:
  6596. case stringTag:
  6597. // Coerce regexes to strings and treat strings, primitives and objects,
  6598. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6599. // for more details.
  6600. return object == (other + '');
  6601. case mapTag:
  6602. var convert = mapToArray;
  6603. case setTag:
  6604. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6605. convert || (convert = setToArray);
  6606. if (object.size != other.size && !isPartial) {
  6607. return false;
  6608. }
  6609. // Assume cyclic values are equal.
  6610. var stacked = stack.get(object);
  6611. if (stacked) {
  6612. return stacked == other;
  6613. }
  6614. bitmask |= COMPARE_UNORDERED_FLAG;
  6615. // Recursively compare objects (susceptible to call stack limits).
  6616. stack.set(object, other);
  6617. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6618. stack['delete'](object);
  6619. return result;
  6620. case symbolTag:
  6621. if (symbolValueOf) {
  6622. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6623. }
  6624. }
  6625. return false;
  6626. }
  6627. /**
  6628. * A specialized version of `baseIsEqualDeep` for objects with support for
  6629. * partial deep comparisons.
  6630. *
  6631. * @private
  6632. * @param {Object} object The object to compare.
  6633. * @param {Object} other The other object to compare.
  6634. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6635. * @param {Function} customizer The function to customize comparisons.
  6636. * @param {Function} equalFunc The function to determine equivalents of values.
  6637. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6638. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6639. */
  6640. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6641. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6642. objProps = getAllKeys(object),
  6643. objLength = objProps.length,
  6644. othProps = getAllKeys(other),
  6645. othLength = othProps.length;
  6646. if (objLength != othLength && !isPartial) {
  6647. return false;
  6648. }
  6649. var index = objLength;
  6650. while (index--) {
  6651. var key = objProps[index];
  6652. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6653. return false;
  6654. }
  6655. }
  6656. // Check that cyclic values are equal.
  6657. var objStacked = stack.get(object);
  6658. var othStacked = stack.get(other);
  6659. if (objStacked && othStacked) {
  6660. return objStacked == other && othStacked == object;
  6661. }
  6662. var result = true;
  6663. stack.set(object, other);
  6664. stack.set(other, object);
  6665. var skipCtor = isPartial;
  6666. while (++index < objLength) {
  6667. key = objProps[index];
  6668. var objValue = object[key],
  6669. othValue = other[key];
  6670. if (customizer) {
  6671. var compared = isPartial
  6672. ? customizer(othValue, objValue, key, other, object, stack)
  6673. : customizer(objValue, othValue, key, object, other, stack);
  6674. }
  6675. // Recursively compare objects (susceptible to call stack limits).
  6676. if (!(compared === undefined
  6677. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6678. : compared
  6679. )) {
  6680. result = false;
  6681. break;
  6682. }
  6683. skipCtor || (skipCtor = key == 'constructor');
  6684. }
  6685. if (result && !skipCtor) {
  6686. var objCtor = object.constructor,
  6687. othCtor = other.constructor;
  6688. // Non `Object` object instances with different constructors are not equal.
  6689. if (objCtor != othCtor &&
  6690. ('constructor' in object && 'constructor' in other) &&
  6691. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6692. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6693. result = false;
  6694. }
  6695. }
  6696. stack['delete'](object);
  6697. stack['delete'](other);
  6698. return result;
  6699. }
  6700. /**
  6701. * A specialized version of `baseRest` which flattens the rest array.
  6702. *
  6703. * @private
  6704. * @param {Function} func The function to apply a rest parameter to.
  6705. * @returns {Function} Returns the new function.
  6706. */
  6707. function flatRest(func) {
  6708. return setToString(overRest(func, undefined, flatten), func + '');
  6709. }
  6710. /**
  6711. * Creates an array of own enumerable property names and symbols of `object`.
  6712. *
  6713. * @private
  6714. * @param {Object} object The object to query.
  6715. * @returns {Array} Returns the array of property names and symbols.
  6716. */
  6717. function getAllKeys(object) {
  6718. return baseGetAllKeys(object, keys, getSymbols);
  6719. }
  6720. /**
  6721. * Creates an array of own and inherited enumerable property names and
  6722. * symbols of `object`.
  6723. *
  6724. * @private
  6725. * @param {Object} object The object to query.
  6726. * @returns {Array} Returns the array of property names and symbols.
  6727. */
  6728. function getAllKeysIn(object) {
  6729. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6730. }
  6731. /**
  6732. * Gets metadata for `func`.
  6733. *
  6734. * @private
  6735. * @param {Function} func The function to query.
  6736. * @returns {*} Returns the metadata for `func`.
  6737. */
  6738. var getData = !metaMap ? noop : function(func) {
  6739. return metaMap.get(func);
  6740. };
  6741. /**
  6742. * Gets the name of `func`.
  6743. *
  6744. * @private
  6745. * @param {Function} func The function to query.
  6746. * @returns {string} Returns the function name.
  6747. */
  6748. function getFuncName(func) {
  6749. var result = (func.name + ''),
  6750. array = realNames[result],
  6751. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6752. while (length--) {
  6753. var data = array[length],
  6754. otherFunc = data.func;
  6755. if (otherFunc == null || otherFunc == func) {
  6756. return data.name;
  6757. }
  6758. }
  6759. return result;
  6760. }
  6761. /**
  6762. * Gets the argument placeholder value for `func`.
  6763. *
  6764. * @private
  6765. * @param {Function} func The function to inspect.
  6766. * @returns {*} Returns the placeholder value.
  6767. */
  6768. function getHolder(func) {
  6769. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6770. return object.placeholder;
  6771. }
  6772. /**
  6773. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6774. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6775. * If arguments are provided, the chosen function is invoked with them and
  6776. * its result is returned.
  6777. *
  6778. * @private
  6779. * @param {*} [value] The value to convert to an iteratee.
  6780. * @param {number} [arity] The arity of the created iteratee.
  6781. * @returns {Function} Returns the chosen function or its result.
  6782. */
  6783. function getIteratee() {
  6784. var result = lodash.iteratee || iteratee;
  6785. result = result === iteratee ? baseIteratee : result;
  6786. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6787. }
  6788. /**
  6789. * Gets the data for `map`.
  6790. *
  6791. * @private
  6792. * @param {Object} map The map to query.
  6793. * @param {string} key The reference key.
  6794. * @returns {*} Returns the map data.
  6795. */
  6796. function getMapData(map, key) {
  6797. var data = map.__data__;
  6798. return isKeyable(key)
  6799. ? data[typeof key == 'string' ? 'string' : 'hash']
  6800. : data.map;
  6801. }
  6802. /**
  6803. * Gets the property names, values, and compare flags of `object`.
  6804. *
  6805. * @private
  6806. * @param {Object} object The object to query.
  6807. * @returns {Array} Returns the match data of `object`.
  6808. */
  6809. function getMatchData(object) {
  6810. var result = keys(object),
  6811. length = result.length;
  6812. while (length--) {
  6813. var key = result[length],
  6814. value = object[key];
  6815. result[length] = [key, value, isStrictComparable(value)];
  6816. }
  6817. return result;
  6818. }
  6819. /**
  6820. * Gets the native function at `key` of `object`.
  6821. *
  6822. * @private
  6823. * @param {Object} object The object to query.
  6824. * @param {string} key The key of the method to get.
  6825. * @returns {*} Returns the function if it's native, else `undefined`.
  6826. */
  6827. function getNative(object, key) {
  6828. var value = getValue(object, key);
  6829. return baseIsNative(value) ? value : undefined;
  6830. }
  6831. /**
  6832. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6833. *
  6834. * @private
  6835. * @param {*} value The value to query.
  6836. * @returns {string} Returns the raw `toStringTag`.
  6837. */
  6838. function getRawTag(value) {
  6839. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6840. tag = value[symToStringTag];
  6841. try {
  6842. value[symToStringTag] = undefined;
  6843. var unmasked = true;
  6844. } catch (e) {}
  6845. var result = nativeObjectToString.call(value);
  6846. if (unmasked) {
  6847. if (isOwn) {
  6848. value[symToStringTag] = tag;
  6849. } else {
  6850. delete value[symToStringTag];
  6851. }
  6852. }
  6853. return result;
  6854. }
  6855. /**
  6856. * Creates an array of the own enumerable symbols of `object`.
  6857. *
  6858. * @private
  6859. * @param {Object} object The object to query.
  6860. * @returns {Array} Returns the array of symbols.
  6861. */
  6862. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6863. if (object == null) {
  6864. return [];
  6865. }
  6866. object = Object(object);
  6867. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6868. return propertyIsEnumerable.call(object, symbol);
  6869. });
  6870. };
  6871. /**
  6872. * Creates an array of the own and inherited enumerable symbols of `object`.
  6873. *
  6874. * @private
  6875. * @param {Object} object The object to query.
  6876. * @returns {Array} Returns the array of symbols.
  6877. */
  6878. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6879. var result = [];
  6880. while (object) {
  6881. arrayPush(result, getSymbols(object));
  6882. object = getPrototype(object);
  6883. }
  6884. return result;
  6885. };
  6886. /**
  6887. * Gets the `toStringTag` of `value`.
  6888. *
  6889. * @private
  6890. * @param {*} value The value to query.
  6891. * @returns {string} Returns the `toStringTag`.
  6892. */
  6893. var getTag = baseGetTag;
  6894. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6895. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6896. (Map && getTag(new Map) != mapTag) ||
  6897. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6898. (Set && getTag(new Set) != setTag) ||
  6899. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6900. getTag = function(value) {
  6901. var result = baseGetTag(value),
  6902. Ctor = result == objectTag ? value.constructor : undefined,
  6903. ctorString = Ctor ? toSource(Ctor) : '';
  6904. if (ctorString) {
  6905. switch (ctorString) {
  6906. case dataViewCtorString: return dataViewTag;
  6907. case mapCtorString: return mapTag;
  6908. case promiseCtorString: return promiseTag;
  6909. case setCtorString: return setTag;
  6910. case weakMapCtorString: return weakMapTag;
  6911. }
  6912. }
  6913. return result;
  6914. };
  6915. }
  6916. /**
  6917. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6918. *
  6919. * @private
  6920. * @param {number} start The start of the view.
  6921. * @param {number} end The end of the view.
  6922. * @param {Array} transforms The transformations to apply to the view.
  6923. * @returns {Object} Returns an object containing the `start` and `end`
  6924. * positions of the view.
  6925. */
  6926. function getView(start, end, transforms) {
  6927. var index = -1,
  6928. length = transforms.length;
  6929. while (++index < length) {
  6930. var data = transforms[index],
  6931. size = data.size;
  6932. switch (data.type) {
  6933. case 'drop': start += size; break;
  6934. case 'dropRight': end -= size; break;
  6935. case 'take': end = nativeMin(end, start + size); break;
  6936. case 'takeRight': start = nativeMax(start, end - size); break;
  6937. }
  6938. }
  6939. return { 'start': start, 'end': end };
  6940. }
  6941. /**
  6942. * Extracts wrapper details from the `source` body comment.
  6943. *
  6944. * @private
  6945. * @param {string} source The source to inspect.
  6946. * @returns {Array} Returns the wrapper details.
  6947. */
  6948. function getWrapDetails(source) {
  6949. var match = source.match(reWrapDetails);
  6950. return match ? match[1].split(reSplitDetails) : [];
  6951. }
  6952. /**
  6953. * Checks if `path` exists on `object`.
  6954. *
  6955. * @private
  6956. * @param {Object} object The object to query.
  6957. * @param {Array|string} path The path to check.
  6958. * @param {Function} hasFunc The function to check properties.
  6959. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6960. */
  6961. function hasPath(object, path, hasFunc) {
  6962. path = castPath(path, object);
  6963. var index = -1,
  6964. length = path.length,
  6965. result = false;
  6966. while (++index < length) {
  6967. var key = toKey(path[index]);
  6968. if (!(result = object != null && hasFunc(object, key))) {
  6969. break;
  6970. }
  6971. object = object[key];
  6972. }
  6973. if (result || ++index != length) {
  6974. return result;
  6975. }
  6976. length = object == null ? 0 : object.length;
  6977. return !!length && isLength(length) && isIndex(key, length) &&
  6978. (isArray(object) || isArguments(object));
  6979. }
  6980. /**
  6981. * Initializes an array clone.
  6982. *
  6983. * @private
  6984. * @param {Array} array The array to clone.
  6985. * @returns {Array} Returns the initialized clone.
  6986. */
  6987. function initCloneArray(array) {
  6988. var length = array.length,
  6989. result = new array.constructor(length);
  6990. // Add properties assigned by `RegExp#exec`.
  6991. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6992. result.index = array.index;
  6993. result.input = array.input;
  6994. }
  6995. return result;
  6996. }
  6997. /**
  6998. * Initializes an object clone.
  6999. *
  7000. * @private
  7001. * @param {Object} object The object to clone.
  7002. * @returns {Object} Returns the initialized clone.
  7003. */
  7004. function initCloneObject(object) {
  7005. return (typeof object.constructor == 'function' && !isPrototype(object))
  7006. ? baseCreate(getPrototype(object))
  7007. : {};
  7008. }
  7009. /**
  7010. * Initializes an object clone based on its `toStringTag`.
  7011. *
  7012. * **Note:** This function only supports cloning values with tags of
  7013. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7014. *
  7015. * @private
  7016. * @param {Object} object The object to clone.
  7017. * @param {string} tag The `toStringTag` of the object to clone.
  7018. * @param {boolean} [isDeep] Specify a deep clone.
  7019. * @returns {Object} Returns the initialized clone.
  7020. */
  7021. function initCloneByTag(object, tag, isDeep) {
  7022. var Ctor = object.constructor;
  7023. switch (tag) {
  7024. case arrayBufferTag:
  7025. return cloneArrayBuffer(object);
  7026. case boolTag:
  7027. case dateTag:
  7028. return new Ctor(+object);
  7029. case dataViewTag:
  7030. return cloneDataView(object, isDeep);
  7031. case float32Tag: case float64Tag:
  7032. case int8Tag: case int16Tag: case int32Tag:
  7033. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7034. return cloneTypedArray(object, isDeep);
  7035. case mapTag:
  7036. return new Ctor;
  7037. case numberTag:
  7038. case stringTag:
  7039. return new Ctor(object);
  7040. case regexpTag:
  7041. return cloneRegExp(object);
  7042. case setTag:
  7043. return new Ctor;
  7044. case symbolTag:
  7045. return cloneSymbol(object);
  7046. }
  7047. }
  7048. /**
  7049. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7050. *
  7051. * @private
  7052. * @param {string} source The source to modify.
  7053. * @returns {Array} details The details to insert.
  7054. * @returns {string} Returns the modified source.
  7055. */
  7056. function insertWrapDetails(source, details) {
  7057. var length = details.length;
  7058. if (!length) {
  7059. return source;
  7060. }
  7061. var lastIndex = length - 1;
  7062. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7063. details = details.join(length > 2 ? ', ' : ' ');
  7064. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7065. }
  7066. /**
  7067. * Checks if `value` is a flattenable `arguments` object or array.
  7068. *
  7069. * @private
  7070. * @param {*} value The value to check.
  7071. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7072. */
  7073. function isFlattenable(value) {
  7074. return isArray(value) || isArguments(value) ||
  7075. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7076. }
  7077. /**
  7078. * Checks if `value` is a valid array-like index.
  7079. *
  7080. * @private
  7081. * @param {*} value The value to check.
  7082. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7083. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7084. */
  7085. function isIndex(value, length) {
  7086. var type = typeof value;
  7087. length = length == null ? MAX_SAFE_INTEGER : length;
  7088. return !!length &&
  7089. (type == 'number' ||
  7090. (type != 'symbol' && reIsUint.test(value))) &&
  7091. (value > -1 && value % 1 == 0 && value < length);
  7092. }
  7093. /**
  7094. * Checks if the given arguments are from an iteratee call.
  7095. *
  7096. * @private
  7097. * @param {*} value The potential iteratee value argument.
  7098. * @param {*} index The potential iteratee index or key argument.
  7099. * @param {*} object The potential iteratee object argument.
  7100. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7101. * else `false`.
  7102. */
  7103. function isIterateeCall(value, index, object) {
  7104. if (!isObject(object)) {
  7105. return false;
  7106. }
  7107. var type = typeof index;
  7108. if (type == 'number'
  7109. ? (isArrayLike(object) && isIndex(index, object.length))
  7110. : (type == 'string' && index in object)
  7111. ) {
  7112. return eq(object[index], value);
  7113. }
  7114. return false;
  7115. }
  7116. /**
  7117. * Checks if `value` is a property name and not a property path.
  7118. *
  7119. * @private
  7120. * @param {*} value The value to check.
  7121. * @param {Object} [object] The object to query keys on.
  7122. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7123. */
  7124. function isKey(value, object) {
  7125. if (isArray(value)) {
  7126. return false;
  7127. }
  7128. var type = typeof value;
  7129. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7130. value == null || isSymbol(value)) {
  7131. return true;
  7132. }
  7133. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7134. (object != null && value in Object(object));
  7135. }
  7136. /**
  7137. * Checks if `value` is suitable for use as unique object key.
  7138. *
  7139. * @private
  7140. * @param {*} value The value to check.
  7141. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7142. */
  7143. function isKeyable(value) {
  7144. var type = typeof value;
  7145. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7146. ? (value !== '__proto__')
  7147. : (value === null);
  7148. }
  7149. /**
  7150. * Checks if `func` has a lazy counterpart.
  7151. *
  7152. * @private
  7153. * @param {Function} func The function to check.
  7154. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7155. * else `false`.
  7156. */
  7157. function isLaziable(func) {
  7158. var funcName = getFuncName(func),
  7159. other = lodash[funcName];
  7160. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7161. return false;
  7162. }
  7163. if (func === other) {
  7164. return true;
  7165. }
  7166. var data = getData(other);
  7167. return !!data && func === data[0];
  7168. }
  7169. /**
  7170. * Checks if `func` has its source masked.
  7171. *
  7172. * @private
  7173. * @param {Function} func The function to check.
  7174. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7175. */
  7176. function isMasked(func) {
  7177. return !!maskSrcKey && (maskSrcKey in func);
  7178. }
  7179. /**
  7180. * Checks if `func` is capable of being masked.
  7181. *
  7182. * @private
  7183. * @param {*} value The value to check.
  7184. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7185. */
  7186. var isMaskable = coreJsData ? isFunction : stubFalse;
  7187. /**
  7188. * Checks if `value` is likely a prototype object.
  7189. *
  7190. * @private
  7191. * @param {*} value The value to check.
  7192. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7193. */
  7194. function isPrototype(value) {
  7195. var Ctor = value && value.constructor,
  7196. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7197. return value === proto;
  7198. }
  7199. /**
  7200. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7201. *
  7202. * @private
  7203. * @param {*} value The value to check.
  7204. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7205. * equality comparisons, else `false`.
  7206. */
  7207. function isStrictComparable(value) {
  7208. return value === value && !isObject(value);
  7209. }
  7210. /**
  7211. * A specialized version of `matchesProperty` for source values suitable
  7212. * for strict equality comparisons, i.e. `===`.
  7213. *
  7214. * @private
  7215. * @param {string} key The key of the property to get.
  7216. * @param {*} srcValue The value to match.
  7217. * @returns {Function} Returns the new spec function.
  7218. */
  7219. function matchesStrictComparable(key, srcValue) {
  7220. return function(object) {
  7221. if (object == null) {
  7222. return false;
  7223. }
  7224. return object[key] === srcValue &&
  7225. (srcValue !== undefined || (key in Object(object)));
  7226. };
  7227. }
  7228. /**
  7229. * A specialized version of `_.memoize` which clears the memoized function's
  7230. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7231. *
  7232. * @private
  7233. * @param {Function} func The function to have its output memoized.
  7234. * @returns {Function} Returns the new memoized function.
  7235. */
  7236. function memoizeCapped(func) {
  7237. var result = memoize(func, function(key) {
  7238. if (cache.size === MAX_MEMOIZE_SIZE) {
  7239. cache.clear();
  7240. }
  7241. return key;
  7242. });
  7243. var cache = result.cache;
  7244. return result;
  7245. }
  7246. /**
  7247. * Merges the function metadata of `source` into `data`.
  7248. *
  7249. * Merging metadata reduces the number of wrappers used to invoke a function.
  7250. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7251. * may be applied regardless of execution order. Methods like `_.ary` and
  7252. * `_.rearg` modify function arguments, making the order in which they are
  7253. * executed important, preventing the merging of metadata. However, we make
  7254. * an exception for a safe combined case where curried functions have `_.ary`
  7255. * and or `_.rearg` applied.
  7256. *
  7257. * @private
  7258. * @param {Array} data The destination metadata.
  7259. * @param {Array} source The source metadata.
  7260. * @returns {Array} Returns `data`.
  7261. */
  7262. function mergeData(data, source) {
  7263. var bitmask = data[1],
  7264. srcBitmask = source[1],
  7265. newBitmask = bitmask | srcBitmask,
  7266. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7267. var isCombo =
  7268. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7269. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7270. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7271. // Exit early if metadata can't be merged.
  7272. if (!(isCommon || isCombo)) {
  7273. return data;
  7274. }
  7275. // Use source `thisArg` if available.
  7276. if (srcBitmask & WRAP_BIND_FLAG) {
  7277. data[2] = source[2];
  7278. // Set when currying a bound function.
  7279. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7280. }
  7281. // Compose partial arguments.
  7282. var value = source[3];
  7283. if (value) {
  7284. var partials = data[3];
  7285. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7286. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7287. }
  7288. // Compose partial right arguments.
  7289. value = source[5];
  7290. if (value) {
  7291. partials = data[5];
  7292. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7293. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7294. }
  7295. // Use source `argPos` if available.
  7296. value = source[7];
  7297. if (value) {
  7298. data[7] = value;
  7299. }
  7300. // Use source `ary` if it's smaller.
  7301. if (srcBitmask & WRAP_ARY_FLAG) {
  7302. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7303. }
  7304. // Use source `arity` if one is not provided.
  7305. if (data[9] == null) {
  7306. data[9] = source[9];
  7307. }
  7308. // Use source `func` and merge bitmasks.
  7309. data[0] = source[0];
  7310. data[1] = newBitmask;
  7311. return data;
  7312. }
  7313. /**
  7314. * This function is like
  7315. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7316. * except that it includes inherited enumerable properties.
  7317. *
  7318. * @private
  7319. * @param {Object} object The object to query.
  7320. * @returns {Array} Returns the array of property names.
  7321. */
  7322. function nativeKeysIn(object) {
  7323. var result = [];
  7324. if (object != null) {
  7325. for (var key in Object(object)) {
  7326. result.push(key);
  7327. }
  7328. }
  7329. return result;
  7330. }
  7331. /**
  7332. * Converts `value` to a string using `Object.prototype.toString`.
  7333. *
  7334. * @private
  7335. * @param {*} value The value to convert.
  7336. * @returns {string} Returns the converted string.
  7337. */
  7338. function objectToString(value) {
  7339. return nativeObjectToString.call(value);
  7340. }
  7341. /**
  7342. * A specialized version of `baseRest` which transforms the rest array.
  7343. *
  7344. * @private
  7345. * @param {Function} func The function to apply a rest parameter to.
  7346. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7347. * @param {Function} transform The rest array transform.
  7348. * @returns {Function} Returns the new function.
  7349. */
  7350. function overRest(func, start, transform) {
  7351. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7352. return function() {
  7353. var args = arguments,
  7354. index = -1,
  7355. length = nativeMax(args.length - start, 0),
  7356. array = Array(length);
  7357. while (++index < length) {
  7358. array[index] = args[start + index];
  7359. }
  7360. index = -1;
  7361. var otherArgs = Array(start + 1);
  7362. while (++index < start) {
  7363. otherArgs[index] = args[index];
  7364. }
  7365. otherArgs[start] = transform(array);
  7366. return apply(func, this, otherArgs);
  7367. };
  7368. }
  7369. /**
  7370. * Gets the parent value at `path` of `object`.
  7371. *
  7372. * @private
  7373. * @param {Object} object The object to query.
  7374. * @param {Array} path The path to get the parent value of.
  7375. * @returns {*} Returns the parent value.
  7376. */
  7377. function parent(object, path) {
  7378. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7379. }
  7380. /**
  7381. * Reorder `array` according to the specified indexes where the element at
  7382. * the first index is assigned as the first element, the element at
  7383. * the second index is assigned as the second element, and so on.
  7384. *
  7385. * @private
  7386. * @param {Array} array The array to reorder.
  7387. * @param {Array} indexes The arranged array indexes.
  7388. * @returns {Array} Returns `array`.
  7389. */
  7390. function reorder(array, indexes) {
  7391. var arrLength = array.length,
  7392. length = nativeMin(indexes.length, arrLength),
  7393. oldArray = copyArray(array);
  7394. while (length--) {
  7395. var index = indexes[length];
  7396. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7397. }
  7398. return array;
  7399. }
  7400. /**
  7401. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7402. *
  7403. * @private
  7404. * @param {Object} object The object to query.
  7405. * @param {string} key The key of the property to get.
  7406. * @returns {*} Returns the property value.
  7407. */
  7408. function safeGet(object, key) {
  7409. if (key === 'constructor' && typeof object[key] === 'function') {
  7410. return;
  7411. }
  7412. if (key == '__proto__') {
  7413. return;
  7414. }
  7415. return object[key];
  7416. }
  7417. /**
  7418. * Sets metadata for `func`.
  7419. *
  7420. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7421. * period of time, it will trip its breaker and transition to an identity
  7422. * function to avoid garbage collection pauses in V8. See
  7423. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7424. * for more details.
  7425. *
  7426. * @private
  7427. * @param {Function} func The function to associate metadata with.
  7428. * @param {*} data The metadata.
  7429. * @returns {Function} Returns `func`.
  7430. */
  7431. var setData = shortOut(baseSetData);
  7432. /**
  7433. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7434. *
  7435. * @private
  7436. * @param {Function} func The function to delay.
  7437. * @param {number} wait The number of milliseconds to delay invocation.
  7438. * @returns {number|Object} Returns the timer id or timeout object.
  7439. */
  7440. var setTimeout = ctxSetTimeout || function(func, wait) {
  7441. return root.setTimeout(func, wait);
  7442. };
  7443. /**
  7444. * Sets the `toString` method of `func` to return `string`.
  7445. *
  7446. * @private
  7447. * @param {Function} func The function to modify.
  7448. * @param {Function} string The `toString` result.
  7449. * @returns {Function} Returns `func`.
  7450. */
  7451. var setToString = shortOut(baseSetToString);
  7452. /**
  7453. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7454. * with wrapper details in a comment at the top of the source body.
  7455. *
  7456. * @private
  7457. * @param {Function} wrapper The function to modify.
  7458. * @param {Function} reference The reference function.
  7459. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7460. * @returns {Function} Returns `wrapper`.
  7461. */
  7462. function setWrapToString(wrapper, reference, bitmask) {
  7463. var source = (reference + '');
  7464. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7465. }
  7466. /**
  7467. * Creates a function that'll short out and invoke `identity` instead
  7468. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7469. * milliseconds.
  7470. *
  7471. * @private
  7472. * @param {Function} func The function to restrict.
  7473. * @returns {Function} Returns the new shortable function.
  7474. */
  7475. function shortOut(func) {
  7476. var count = 0,
  7477. lastCalled = 0;
  7478. return function() {
  7479. var stamp = nativeNow(),
  7480. remaining = HOT_SPAN - (stamp - lastCalled);
  7481. lastCalled = stamp;
  7482. if (remaining > 0) {
  7483. if (++count >= HOT_COUNT) {
  7484. return arguments[0];
  7485. }
  7486. } else {
  7487. count = 0;
  7488. }
  7489. return func.apply(undefined, arguments);
  7490. };
  7491. }
  7492. /**
  7493. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7494. *
  7495. * @private
  7496. * @param {Array} array The array to shuffle.
  7497. * @param {number} [size=array.length] The size of `array`.
  7498. * @returns {Array} Returns `array`.
  7499. */
  7500. function shuffleSelf(array, size) {
  7501. var index = -1,
  7502. length = array.length,
  7503. lastIndex = length - 1;
  7504. size = size === undefined ? length : size;
  7505. while (++index < size) {
  7506. var rand = baseRandom(index, lastIndex),
  7507. value = array[rand];
  7508. array[rand] = array[index];
  7509. array[index] = value;
  7510. }
  7511. array.length = size;
  7512. return array;
  7513. }
  7514. /**
  7515. * Converts `string` to a property path array.
  7516. *
  7517. * @private
  7518. * @param {string} string The string to convert.
  7519. * @returns {Array} Returns the property path array.
  7520. */
  7521. var stringToPath = memoizeCapped(function(string) {
  7522. var result = [];
  7523. if (string.charCodeAt(0) === 46 /* . */) {
  7524. result.push('');
  7525. }
  7526. string.replace(rePropName, function(match, number, quote, subString) {
  7527. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7528. });
  7529. return result;
  7530. });
  7531. /**
  7532. * Converts `value` to a string key if it's not a string or symbol.
  7533. *
  7534. * @private
  7535. * @param {*} value The value to inspect.
  7536. * @returns {string|symbol} Returns the key.
  7537. */
  7538. function toKey(value) {
  7539. if (typeof value == 'string' || isSymbol(value)) {
  7540. return value;
  7541. }
  7542. var result = (value + '');
  7543. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7544. }
  7545. /**
  7546. * Converts `func` to its source code.
  7547. *
  7548. * @private
  7549. * @param {Function} func The function to convert.
  7550. * @returns {string} Returns the source code.
  7551. */
  7552. function toSource(func) {
  7553. if (func != null) {
  7554. try {
  7555. return funcToString.call(func);
  7556. } catch (e) {}
  7557. try {
  7558. return (func + '');
  7559. } catch (e) {}
  7560. }
  7561. return '';
  7562. }
  7563. /**
  7564. * Updates wrapper `details` based on `bitmask` flags.
  7565. *
  7566. * @private
  7567. * @returns {Array} details The details to modify.
  7568. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7569. * @returns {Array} Returns `details`.
  7570. */
  7571. function updateWrapDetails(details, bitmask) {
  7572. arrayEach(wrapFlags, function(pair) {
  7573. var value = '_.' + pair[0];
  7574. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7575. details.push(value);
  7576. }
  7577. });
  7578. return details.sort();
  7579. }
  7580. /**
  7581. * Creates a clone of `wrapper`.
  7582. *
  7583. * @private
  7584. * @param {Object} wrapper The wrapper to clone.
  7585. * @returns {Object} Returns the cloned wrapper.
  7586. */
  7587. function wrapperClone(wrapper) {
  7588. if (wrapper instanceof LazyWrapper) {
  7589. return wrapper.clone();
  7590. }
  7591. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7592. result.__actions__ = copyArray(wrapper.__actions__);
  7593. result.__index__ = wrapper.__index__;
  7594. result.__values__ = wrapper.__values__;
  7595. return result;
  7596. }
  7597. /*------------------------------------------------------------------------*/
  7598. /**
  7599. * Creates an array of elements split into groups the length of `size`.
  7600. * If `array` can't be split evenly, the final chunk will be the remaining
  7601. * elements.
  7602. *
  7603. * @static
  7604. * @memberOf _
  7605. * @since 3.0.0
  7606. * @category Array
  7607. * @param {Array} array The array to process.
  7608. * @param {number} [size=1] The length of each chunk
  7609. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7610. * @returns {Array} Returns the new array of chunks.
  7611. * @example
  7612. *
  7613. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7614. * // => [['a', 'b'], ['c', 'd']]
  7615. *
  7616. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7617. * // => [['a', 'b', 'c'], ['d']]
  7618. */
  7619. function chunk(array, size, guard) {
  7620. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7621. size = 1;
  7622. } else {
  7623. size = nativeMax(toInteger(size), 0);
  7624. }
  7625. var length = array == null ? 0 : array.length;
  7626. if (!length || size < 1) {
  7627. return [];
  7628. }
  7629. var index = 0,
  7630. resIndex = 0,
  7631. result = Array(nativeCeil(length / size));
  7632. while (index < length) {
  7633. result[resIndex++] = baseSlice(array, index, (index += size));
  7634. }
  7635. return result;
  7636. }
  7637. /**
  7638. * Creates an array with all falsey values removed. The values `false`, `null`,
  7639. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7640. *
  7641. * @static
  7642. * @memberOf _
  7643. * @since 0.1.0
  7644. * @category Array
  7645. * @param {Array} array The array to compact.
  7646. * @returns {Array} Returns the new array of filtered values.
  7647. * @example
  7648. *
  7649. * _.compact([0, 1, false, 2, '', 3]);
  7650. * // => [1, 2, 3]
  7651. */
  7652. function compact(array) {
  7653. var index = -1,
  7654. length = array == null ? 0 : array.length,
  7655. resIndex = 0,
  7656. result = [];
  7657. while (++index < length) {
  7658. var value = array[index];
  7659. if (value) {
  7660. result[resIndex++] = value;
  7661. }
  7662. }
  7663. return result;
  7664. }
  7665. /**
  7666. * Creates a new array concatenating `array` with any additional arrays
  7667. * and/or values.
  7668. *
  7669. * @static
  7670. * @memberOf _
  7671. * @since 4.0.0
  7672. * @category Array
  7673. * @param {Array} array The array to concatenate.
  7674. * @param {...*} [values] The values to concatenate.
  7675. * @returns {Array} Returns the new concatenated array.
  7676. * @example
  7677. *
  7678. * var array = [1];
  7679. * var other = _.concat(array, 2, [3], [[4]]);
  7680. *
  7681. * console.log(other);
  7682. * // => [1, 2, 3, [4]]
  7683. *
  7684. * console.log(array);
  7685. * // => [1]
  7686. */
  7687. function concat() {
  7688. var length = arguments.length;
  7689. if (!length) {
  7690. return [];
  7691. }
  7692. var args = Array(length - 1),
  7693. array = arguments[0],
  7694. index = length;
  7695. while (index--) {
  7696. args[index - 1] = arguments[index];
  7697. }
  7698. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7699. }
  7700. /**
  7701. * Creates an array of `array` values not included in the other given arrays
  7702. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7703. * for equality comparisons. The order and references of result values are
  7704. * determined by the first array.
  7705. *
  7706. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7707. *
  7708. * @static
  7709. * @memberOf _
  7710. * @since 0.1.0
  7711. * @category Array
  7712. * @param {Array} array The array to inspect.
  7713. * @param {...Array} [values] The values to exclude.
  7714. * @returns {Array} Returns the new array of filtered values.
  7715. * @see _.without, _.xor
  7716. * @example
  7717. *
  7718. * _.difference([2, 1], [2, 3]);
  7719. * // => [1]
  7720. */
  7721. var difference = baseRest(function(array, values) {
  7722. return isArrayLikeObject(array)
  7723. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7724. : [];
  7725. });
  7726. /**
  7727. * This method is like `_.difference` except that it accepts `iteratee` which
  7728. * is invoked for each element of `array` and `values` to generate the criterion
  7729. * by which they're compared. The order and references of result values are
  7730. * determined by the first array. The iteratee is invoked with one argument:
  7731. * (value).
  7732. *
  7733. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7734. *
  7735. * @static
  7736. * @memberOf _
  7737. * @since 4.0.0
  7738. * @category Array
  7739. * @param {Array} array The array to inspect.
  7740. * @param {...Array} [values] The values to exclude.
  7741. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7742. * @returns {Array} Returns the new array of filtered values.
  7743. * @example
  7744. *
  7745. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7746. * // => [1.2]
  7747. *
  7748. * // The `_.property` iteratee shorthand.
  7749. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7750. * // => [{ 'x': 2 }]
  7751. */
  7752. var differenceBy = baseRest(function(array, values) {
  7753. var iteratee = last(values);
  7754. if (isArrayLikeObject(iteratee)) {
  7755. iteratee = undefined;
  7756. }
  7757. return isArrayLikeObject(array)
  7758. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7759. : [];
  7760. });
  7761. /**
  7762. * This method is like `_.difference` except that it accepts `comparator`
  7763. * which is invoked to compare elements of `array` to `values`. The order and
  7764. * references of result values are determined by the first array. The comparator
  7765. * is invoked with two arguments: (arrVal, othVal).
  7766. *
  7767. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7768. *
  7769. * @static
  7770. * @memberOf _
  7771. * @since 4.0.0
  7772. * @category Array
  7773. * @param {Array} array The array to inspect.
  7774. * @param {...Array} [values] The values to exclude.
  7775. * @param {Function} [comparator] The comparator invoked per element.
  7776. * @returns {Array} Returns the new array of filtered values.
  7777. * @example
  7778. *
  7779. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7780. *
  7781. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7782. * // => [{ 'x': 2, 'y': 1 }]
  7783. */
  7784. var differenceWith = baseRest(function(array, values) {
  7785. var comparator = last(values);
  7786. if (isArrayLikeObject(comparator)) {
  7787. comparator = undefined;
  7788. }
  7789. return isArrayLikeObject(array)
  7790. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7791. : [];
  7792. });
  7793. /**
  7794. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7795. *
  7796. * @static
  7797. * @memberOf _
  7798. * @since 0.5.0
  7799. * @category Array
  7800. * @param {Array} array The array to query.
  7801. * @param {number} [n=1] The number of elements to drop.
  7802. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7803. * @returns {Array} Returns the slice of `array`.
  7804. * @example
  7805. *
  7806. * _.drop([1, 2, 3]);
  7807. * // => [2, 3]
  7808. *
  7809. * _.drop([1, 2, 3], 2);
  7810. * // => [3]
  7811. *
  7812. * _.drop([1, 2, 3], 5);
  7813. * // => []
  7814. *
  7815. * _.drop([1, 2, 3], 0);
  7816. * // => [1, 2, 3]
  7817. */
  7818. function drop(array, n, guard) {
  7819. var length = array == null ? 0 : array.length;
  7820. if (!length) {
  7821. return [];
  7822. }
  7823. n = (guard || n === undefined) ? 1 : toInteger(n);
  7824. return baseSlice(array, n < 0 ? 0 : n, length);
  7825. }
  7826. /**
  7827. * Creates a slice of `array` with `n` elements dropped from the end.
  7828. *
  7829. * @static
  7830. * @memberOf _
  7831. * @since 3.0.0
  7832. * @category Array
  7833. * @param {Array} array The array to query.
  7834. * @param {number} [n=1] The number of elements to drop.
  7835. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7836. * @returns {Array} Returns the slice of `array`.
  7837. * @example
  7838. *
  7839. * _.dropRight([1, 2, 3]);
  7840. * // => [1, 2]
  7841. *
  7842. * _.dropRight([1, 2, 3], 2);
  7843. * // => [1]
  7844. *
  7845. * _.dropRight([1, 2, 3], 5);
  7846. * // => []
  7847. *
  7848. * _.dropRight([1, 2, 3], 0);
  7849. * // => [1, 2, 3]
  7850. */
  7851. function dropRight(array, n, guard) {
  7852. var length = array == null ? 0 : array.length;
  7853. if (!length) {
  7854. return [];
  7855. }
  7856. n = (guard || n === undefined) ? 1 : toInteger(n);
  7857. n = length - n;
  7858. return baseSlice(array, 0, n < 0 ? 0 : n);
  7859. }
  7860. /**
  7861. * Creates a slice of `array` excluding elements dropped from the end.
  7862. * Elements are dropped until `predicate` returns falsey. The predicate is
  7863. * invoked with three arguments: (value, index, array).
  7864. *
  7865. * @static
  7866. * @memberOf _
  7867. * @since 3.0.0
  7868. * @category Array
  7869. * @param {Array} array The array to query.
  7870. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7871. * @returns {Array} Returns the slice of `array`.
  7872. * @example
  7873. *
  7874. * var users = [
  7875. * { 'user': 'barney', 'active': true },
  7876. * { 'user': 'fred', 'active': false },
  7877. * { 'user': 'pebbles', 'active': false }
  7878. * ];
  7879. *
  7880. * _.dropRightWhile(users, function(o) { return !o.active; });
  7881. * // => objects for ['barney']
  7882. *
  7883. * // The `_.matches` iteratee shorthand.
  7884. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7885. * // => objects for ['barney', 'fred']
  7886. *
  7887. * // The `_.matchesProperty` iteratee shorthand.
  7888. * _.dropRightWhile(users, ['active', false]);
  7889. * // => objects for ['barney']
  7890. *
  7891. * // The `_.property` iteratee shorthand.
  7892. * _.dropRightWhile(users, 'active');
  7893. * // => objects for ['barney', 'fred', 'pebbles']
  7894. */
  7895. function dropRightWhile(array, predicate) {
  7896. return (array && array.length)
  7897. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7898. : [];
  7899. }
  7900. /**
  7901. * Creates a slice of `array` excluding elements dropped from the beginning.
  7902. * Elements are dropped until `predicate` returns falsey. The predicate is
  7903. * invoked with three arguments: (value, index, array).
  7904. *
  7905. * @static
  7906. * @memberOf _
  7907. * @since 3.0.0
  7908. * @category Array
  7909. * @param {Array} array The array to query.
  7910. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7911. * @returns {Array} Returns the slice of `array`.
  7912. * @example
  7913. *
  7914. * var users = [
  7915. * { 'user': 'barney', 'active': false },
  7916. * { 'user': 'fred', 'active': false },
  7917. * { 'user': 'pebbles', 'active': true }
  7918. * ];
  7919. *
  7920. * _.dropWhile(users, function(o) { return !o.active; });
  7921. * // => objects for ['pebbles']
  7922. *
  7923. * // The `_.matches` iteratee shorthand.
  7924. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7925. * // => objects for ['fred', 'pebbles']
  7926. *
  7927. * // The `_.matchesProperty` iteratee shorthand.
  7928. * _.dropWhile(users, ['active', false]);
  7929. * // => objects for ['pebbles']
  7930. *
  7931. * // The `_.property` iteratee shorthand.
  7932. * _.dropWhile(users, 'active');
  7933. * // => objects for ['barney', 'fred', 'pebbles']
  7934. */
  7935. function dropWhile(array, predicate) {
  7936. return (array && array.length)
  7937. ? baseWhile(array, getIteratee(predicate, 3), true)
  7938. : [];
  7939. }
  7940. /**
  7941. * Fills elements of `array` with `value` from `start` up to, but not
  7942. * including, `end`.
  7943. *
  7944. * **Note:** This method mutates `array`.
  7945. *
  7946. * @static
  7947. * @memberOf _
  7948. * @since 3.2.0
  7949. * @category Array
  7950. * @param {Array} array The array to fill.
  7951. * @param {*} value The value to fill `array` with.
  7952. * @param {number} [start=0] The start position.
  7953. * @param {number} [end=array.length] The end position.
  7954. * @returns {Array} Returns `array`.
  7955. * @example
  7956. *
  7957. * var array = [1, 2, 3];
  7958. *
  7959. * _.fill(array, 'a');
  7960. * console.log(array);
  7961. * // => ['a', 'a', 'a']
  7962. *
  7963. * _.fill(Array(3), 2);
  7964. * // => [2, 2, 2]
  7965. *
  7966. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7967. * // => [4, '*', '*', 10]
  7968. */
  7969. function fill(array, value, start, end) {
  7970. var length = array == null ? 0 : array.length;
  7971. if (!length) {
  7972. return [];
  7973. }
  7974. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7975. start = 0;
  7976. end = length;
  7977. }
  7978. return baseFill(array, value, start, end);
  7979. }
  7980. /**
  7981. * This method is like `_.find` except that it returns the index of the first
  7982. * element `predicate` returns truthy for instead of the element itself.
  7983. *
  7984. * @static
  7985. * @memberOf _
  7986. * @since 1.1.0
  7987. * @category Array
  7988. * @param {Array} array The array to inspect.
  7989. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7990. * @param {number} [fromIndex=0] The index to search from.
  7991. * @returns {number} Returns the index of the found element, else `-1`.
  7992. * @example
  7993. *
  7994. * var users = [
  7995. * { 'user': 'barney', 'active': false },
  7996. * { 'user': 'fred', 'active': false },
  7997. * { 'user': 'pebbles', 'active': true }
  7998. * ];
  7999. *
  8000. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8001. * // => 0
  8002. *
  8003. * // The `_.matches` iteratee shorthand.
  8004. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8005. * // => 1
  8006. *
  8007. * // The `_.matchesProperty` iteratee shorthand.
  8008. * _.findIndex(users, ['active', false]);
  8009. * // => 0
  8010. *
  8011. * // The `_.property` iteratee shorthand.
  8012. * _.findIndex(users, 'active');
  8013. * // => 2
  8014. */
  8015. function findIndex(array, predicate, fromIndex) {
  8016. var length = array == null ? 0 : array.length;
  8017. if (!length) {
  8018. return -1;
  8019. }
  8020. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8021. if (index < 0) {
  8022. index = nativeMax(length + index, 0);
  8023. }
  8024. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8025. }
  8026. /**
  8027. * This method is like `_.findIndex` except that it iterates over elements
  8028. * of `collection` from right to left.
  8029. *
  8030. * @static
  8031. * @memberOf _
  8032. * @since 2.0.0
  8033. * @category Array
  8034. * @param {Array} array The array to inspect.
  8035. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8036. * @param {number} [fromIndex=array.length-1] The index to search from.
  8037. * @returns {number} Returns the index of the found element, else `-1`.
  8038. * @example
  8039. *
  8040. * var users = [
  8041. * { 'user': 'barney', 'active': true },
  8042. * { 'user': 'fred', 'active': false },
  8043. * { 'user': 'pebbles', 'active': false }
  8044. * ];
  8045. *
  8046. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8047. * // => 2
  8048. *
  8049. * // The `_.matches` iteratee shorthand.
  8050. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8051. * // => 0
  8052. *
  8053. * // The `_.matchesProperty` iteratee shorthand.
  8054. * _.findLastIndex(users, ['active', false]);
  8055. * // => 2
  8056. *
  8057. * // The `_.property` iteratee shorthand.
  8058. * _.findLastIndex(users, 'active');
  8059. * // => 0
  8060. */
  8061. function findLastIndex(array, predicate, fromIndex) {
  8062. var length = array == null ? 0 : array.length;
  8063. if (!length) {
  8064. return -1;
  8065. }
  8066. var index = length - 1;
  8067. if (fromIndex !== undefined) {
  8068. index = toInteger(fromIndex);
  8069. index = fromIndex < 0
  8070. ? nativeMax(length + index, 0)
  8071. : nativeMin(index, length - 1);
  8072. }
  8073. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8074. }
  8075. /**
  8076. * Flattens `array` a single level deep.
  8077. *
  8078. * @static
  8079. * @memberOf _
  8080. * @since 0.1.0
  8081. * @category Array
  8082. * @param {Array} array The array to flatten.
  8083. * @returns {Array} Returns the new flattened array.
  8084. * @example
  8085. *
  8086. * _.flatten([1, [2, [3, [4]], 5]]);
  8087. * // => [1, 2, [3, [4]], 5]
  8088. */
  8089. function flatten(array) {
  8090. var length = array == null ? 0 : array.length;
  8091. return length ? baseFlatten(array, 1) : [];
  8092. }
  8093. /**
  8094. * Recursively flattens `array`.
  8095. *
  8096. * @static
  8097. * @memberOf _
  8098. * @since 3.0.0
  8099. * @category Array
  8100. * @param {Array} array The array to flatten.
  8101. * @returns {Array} Returns the new flattened array.
  8102. * @example
  8103. *
  8104. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8105. * // => [1, 2, 3, 4, 5]
  8106. */
  8107. function flattenDeep(array) {
  8108. var length = array == null ? 0 : array.length;
  8109. return length ? baseFlatten(array, INFINITY) : [];
  8110. }
  8111. /**
  8112. * Recursively flatten `array` up to `depth` times.
  8113. *
  8114. * @static
  8115. * @memberOf _
  8116. * @since 4.4.0
  8117. * @category Array
  8118. * @param {Array} array The array to flatten.
  8119. * @param {number} [depth=1] The maximum recursion depth.
  8120. * @returns {Array} Returns the new flattened array.
  8121. * @example
  8122. *
  8123. * var array = [1, [2, [3, [4]], 5]];
  8124. *
  8125. * _.flattenDepth(array, 1);
  8126. * // => [1, 2, [3, [4]], 5]
  8127. *
  8128. * _.flattenDepth(array, 2);
  8129. * // => [1, 2, 3, [4], 5]
  8130. */
  8131. function flattenDepth(array, depth) {
  8132. var length = array == null ? 0 : array.length;
  8133. if (!length) {
  8134. return [];
  8135. }
  8136. depth = depth === undefined ? 1 : toInteger(depth);
  8137. return baseFlatten(array, depth);
  8138. }
  8139. /**
  8140. * The inverse of `_.toPairs`; this method returns an object composed
  8141. * from key-value `pairs`.
  8142. *
  8143. * @static
  8144. * @memberOf _
  8145. * @since 4.0.0
  8146. * @category Array
  8147. * @param {Array} pairs The key-value pairs.
  8148. * @returns {Object} Returns the new object.
  8149. * @example
  8150. *
  8151. * _.fromPairs([['a', 1], ['b', 2]]);
  8152. * // => { 'a': 1, 'b': 2 }
  8153. */
  8154. function fromPairs(pairs) {
  8155. var index = -1,
  8156. length = pairs == null ? 0 : pairs.length,
  8157. result = {};
  8158. while (++index < length) {
  8159. var pair = pairs[index];
  8160. result[pair[0]] = pair[1];
  8161. }
  8162. return result;
  8163. }
  8164. /**
  8165. * Gets the first element of `array`.
  8166. *
  8167. * @static
  8168. * @memberOf _
  8169. * @since 0.1.0
  8170. * @alias first
  8171. * @category Array
  8172. * @param {Array} array The array to query.
  8173. * @returns {*} Returns the first element of `array`.
  8174. * @example
  8175. *
  8176. * _.head([1, 2, 3]);
  8177. * // => 1
  8178. *
  8179. * _.head([]);
  8180. * // => undefined
  8181. */
  8182. function head(array) {
  8183. return (array && array.length) ? array[0] : undefined;
  8184. }
  8185. /**
  8186. * Gets the index at which the first occurrence of `value` is found in `array`
  8187. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8188. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8189. * offset from the end of `array`.
  8190. *
  8191. * @static
  8192. * @memberOf _
  8193. * @since 0.1.0
  8194. * @category Array
  8195. * @param {Array} array The array to inspect.
  8196. * @param {*} value The value to search for.
  8197. * @param {number} [fromIndex=0] The index to search from.
  8198. * @returns {number} Returns the index of the matched value, else `-1`.
  8199. * @example
  8200. *
  8201. * _.indexOf([1, 2, 1, 2], 2);
  8202. * // => 1
  8203. *
  8204. * // Search from the `fromIndex`.
  8205. * _.indexOf([1, 2, 1, 2], 2, 2);
  8206. * // => 3
  8207. */
  8208. function indexOf(array, value, fromIndex) {
  8209. var length = array == null ? 0 : array.length;
  8210. if (!length) {
  8211. return -1;
  8212. }
  8213. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8214. if (index < 0) {
  8215. index = nativeMax(length + index, 0);
  8216. }
  8217. return baseIndexOf(array, value, index);
  8218. }
  8219. /**
  8220. * Gets all but the last element of `array`.
  8221. *
  8222. * @static
  8223. * @memberOf _
  8224. * @since 0.1.0
  8225. * @category Array
  8226. * @param {Array} array The array to query.
  8227. * @returns {Array} Returns the slice of `array`.
  8228. * @example
  8229. *
  8230. * _.initial([1, 2, 3]);
  8231. * // => [1, 2]
  8232. */
  8233. function initial(array) {
  8234. var length = array == null ? 0 : array.length;
  8235. return length ? baseSlice(array, 0, -1) : [];
  8236. }
  8237. /**
  8238. * Creates an array of unique values that are included in all given arrays
  8239. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8240. * for equality comparisons. The order and references of result values are
  8241. * determined by the first array.
  8242. *
  8243. * @static
  8244. * @memberOf _
  8245. * @since 0.1.0
  8246. * @category Array
  8247. * @param {...Array} [arrays] The arrays to inspect.
  8248. * @returns {Array} Returns the new array of intersecting values.
  8249. * @example
  8250. *
  8251. * _.intersection([2, 1], [2, 3]);
  8252. * // => [2]
  8253. */
  8254. var intersection = baseRest(function(arrays) {
  8255. var mapped = arrayMap(arrays, castArrayLikeObject);
  8256. return (mapped.length && mapped[0] === arrays[0])
  8257. ? baseIntersection(mapped)
  8258. : [];
  8259. });
  8260. /**
  8261. * This method is like `_.intersection` except that it accepts `iteratee`
  8262. * which is invoked for each element of each `arrays` to generate the criterion
  8263. * by which they're compared. The order and references of result values are
  8264. * determined by the first array. The iteratee is invoked with one argument:
  8265. * (value).
  8266. *
  8267. * @static
  8268. * @memberOf _
  8269. * @since 4.0.0
  8270. * @category Array
  8271. * @param {...Array} [arrays] The arrays to inspect.
  8272. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8273. * @returns {Array} Returns the new array of intersecting values.
  8274. * @example
  8275. *
  8276. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8277. * // => [2.1]
  8278. *
  8279. * // The `_.property` iteratee shorthand.
  8280. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8281. * // => [{ 'x': 1 }]
  8282. */
  8283. var intersectionBy = baseRest(function(arrays) {
  8284. var iteratee = last(arrays),
  8285. mapped = arrayMap(arrays, castArrayLikeObject);
  8286. if (iteratee === last(mapped)) {
  8287. iteratee = undefined;
  8288. } else {
  8289. mapped.pop();
  8290. }
  8291. return (mapped.length && mapped[0] === arrays[0])
  8292. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8293. : [];
  8294. });
  8295. /**
  8296. * This method is like `_.intersection` except that it accepts `comparator`
  8297. * which is invoked to compare elements of `arrays`. The order and references
  8298. * of result values are determined by the first array. The comparator is
  8299. * invoked with two arguments: (arrVal, othVal).
  8300. *
  8301. * @static
  8302. * @memberOf _
  8303. * @since 4.0.0
  8304. * @category Array
  8305. * @param {...Array} [arrays] The arrays to inspect.
  8306. * @param {Function} [comparator] The comparator invoked per element.
  8307. * @returns {Array} Returns the new array of intersecting values.
  8308. * @example
  8309. *
  8310. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8311. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8312. *
  8313. * _.intersectionWith(objects, others, _.isEqual);
  8314. * // => [{ 'x': 1, 'y': 2 }]
  8315. */
  8316. var intersectionWith = baseRest(function(arrays) {
  8317. var comparator = last(arrays),
  8318. mapped = arrayMap(arrays, castArrayLikeObject);
  8319. comparator = typeof comparator == 'function' ? comparator : undefined;
  8320. if (comparator) {
  8321. mapped.pop();
  8322. }
  8323. return (mapped.length && mapped[0] === arrays[0])
  8324. ? baseIntersection(mapped, undefined, comparator)
  8325. : [];
  8326. });
  8327. /**
  8328. * Converts all elements in `array` into a string separated by `separator`.
  8329. *
  8330. * @static
  8331. * @memberOf _
  8332. * @since 4.0.0
  8333. * @category Array
  8334. * @param {Array} array The array to convert.
  8335. * @param {string} [separator=','] The element separator.
  8336. * @returns {string} Returns the joined string.
  8337. * @example
  8338. *
  8339. * _.join(['a', 'b', 'c'], '~');
  8340. * // => 'a~b~c'
  8341. */
  8342. function join(array, separator) {
  8343. return array == null ? '' : nativeJoin.call(array, separator);
  8344. }
  8345. /**
  8346. * Gets the last element of `array`.
  8347. *
  8348. * @static
  8349. * @memberOf _
  8350. * @since 0.1.0
  8351. * @category Array
  8352. * @param {Array} array The array to query.
  8353. * @returns {*} Returns the last element of `array`.
  8354. * @example
  8355. *
  8356. * _.last([1, 2, 3]);
  8357. * // => 3
  8358. */
  8359. function last(array) {
  8360. var length = array == null ? 0 : array.length;
  8361. return length ? array[length - 1] : undefined;
  8362. }
  8363. /**
  8364. * This method is like `_.indexOf` except that it iterates over elements of
  8365. * `array` from right to left.
  8366. *
  8367. * @static
  8368. * @memberOf _
  8369. * @since 0.1.0
  8370. * @category Array
  8371. * @param {Array} array The array to inspect.
  8372. * @param {*} value The value to search for.
  8373. * @param {number} [fromIndex=array.length-1] The index to search from.
  8374. * @returns {number} Returns the index of the matched value, else `-1`.
  8375. * @example
  8376. *
  8377. * _.lastIndexOf([1, 2, 1, 2], 2);
  8378. * // => 3
  8379. *
  8380. * // Search from the `fromIndex`.
  8381. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8382. * // => 1
  8383. */
  8384. function lastIndexOf(array, value, fromIndex) {
  8385. var length = array == null ? 0 : array.length;
  8386. if (!length) {
  8387. return -1;
  8388. }
  8389. var index = length;
  8390. if (fromIndex !== undefined) {
  8391. index = toInteger(fromIndex);
  8392. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8393. }
  8394. return value === value
  8395. ? strictLastIndexOf(array, value, index)
  8396. : baseFindIndex(array, baseIsNaN, index, true);
  8397. }
  8398. /**
  8399. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8400. * element from the end is returned.
  8401. *
  8402. * @static
  8403. * @memberOf _
  8404. * @since 4.11.0
  8405. * @category Array
  8406. * @param {Array} array The array to query.
  8407. * @param {number} [n=0] The index of the element to return.
  8408. * @returns {*} Returns the nth element of `array`.
  8409. * @example
  8410. *
  8411. * var array = ['a', 'b', 'c', 'd'];
  8412. *
  8413. * _.nth(array, 1);
  8414. * // => 'b'
  8415. *
  8416. * _.nth(array, -2);
  8417. * // => 'c';
  8418. */
  8419. function nth(array, n) {
  8420. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8421. }
  8422. /**
  8423. * Removes all given values from `array` using
  8424. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8425. * for equality comparisons.
  8426. *
  8427. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8428. * to remove elements from an array by predicate.
  8429. *
  8430. * @static
  8431. * @memberOf _
  8432. * @since 2.0.0
  8433. * @category Array
  8434. * @param {Array} array The array to modify.
  8435. * @param {...*} [values] The values to remove.
  8436. * @returns {Array} Returns `array`.
  8437. * @example
  8438. *
  8439. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8440. *
  8441. * _.pull(array, 'a', 'c');
  8442. * console.log(array);
  8443. * // => ['b', 'b']
  8444. */
  8445. var pull = baseRest(pullAll);
  8446. /**
  8447. * This method is like `_.pull` except that it accepts an array of values to remove.
  8448. *
  8449. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8450. *
  8451. * @static
  8452. * @memberOf _
  8453. * @since 4.0.0
  8454. * @category Array
  8455. * @param {Array} array The array to modify.
  8456. * @param {Array} values The values to remove.
  8457. * @returns {Array} Returns `array`.
  8458. * @example
  8459. *
  8460. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8461. *
  8462. * _.pullAll(array, ['a', 'c']);
  8463. * console.log(array);
  8464. * // => ['b', 'b']
  8465. */
  8466. function pullAll(array, values) {
  8467. return (array && array.length && values && values.length)
  8468. ? basePullAll(array, values)
  8469. : array;
  8470. }
  8471. /**
  8472. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8473. * invoked for each element of `array` and `values` to generate the criterion
  8474. * by which they're compared. The iteratee is invoked with one argument: (value).
  8475. *
  8476. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8477. *
  8478. * @static
  8479. * @memberOf _
  8480. * @since 4.0.0
  8481. * @category Array
  8482. * @param {Array} array The array to modify.
  8483. * @param {Array} values The values to remove.
  8484. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8485. * @returns {Array} Returns `array`.
  8486. * @example
  8487. *
  8488. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8489. *
  8490. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8491. * console.log(array);
  8492. * // => [{ 'x': 2 }]
  8493. */
  8494. function pullAllBy(array, values, iteratee) {
  8495. return (array && array.length && values && values.length)
  8496. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8497. : array;
  8498. }
  8499. /**
  8500. * This method is like `_.pullAll` except that it accepts `comparator` which
  8501. * is invoked to compare elements of `array` to `values`. The comparator is
  8502. * invoked with two arguments: (arrVal, othVal).
  8503. *
  8504. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8505. *
  8506. * @static
  8507. * @memberOf _
  8508. * @since 4.6.0
  8509. * @category Array
  8510. * @param {Array} array The array to modify.
  8511. * @param {Array} values The values to remove.
  8512. * @param {Function} [comparator] The comparator invoked per element.
  8513. * @returns {Array} Returns `array`.
  8514. * @example
  8515. *
  8516. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8517. *
  8518. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8519. * console.log(array);
  8520. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8521. */
  8522. function pullAllWith(array, values, comparator) {
  8523. return (array && array.length && values && values.length)
  8524. ? basePullAll(array, values, undefined, comparator)
  8525. : array;
  8526. }
  8527. /**
  8528. * Removes elements from `array` corresponding to `indexes` and returns an
  8529. * array of removed elements.
  8530. *
  8531. * **Note:** Unlike `_.at`, this method mutates `array`.
  8532. *
  8533. * @static
  8534. * @memberOf _
  8535. * @since 3.0.0
  8536. * @category Array
  8537. * @param {Array} array The array to modify.
  8538. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8539. * @returns {Array} Returns the new array of removed elements.
  8540. * @example
  8541. *
  8542. * var array = ['a', 'b', 'c', 'd'];
  8543. * var pulled = _.pullAt(array, [1, 3]);
  8544. *
  8545. * console.log(array);
  8546. * // => ['a', 'c']
  8547. *
  8548. * console.log(pulled);
  8549. * // => ['b', 'd']
  8550. */
  8551. var pullAt = flatRest(function(array, indexes) {
  8552. var length = array == null ? 0 : array.length,
  8553. result = baseAt(array, indexes);
  8554. basePullAt(array, arrayMap(indexes, function(index) {
  8555. return isIndex(index, length) ? +index : index;
  8556. }).sort(compareAscending));
  8557. return result;
  8558. });
  8559. /**
  8560. * Removes all elements from `array` that `predicate` returns truthy for
  8561. * and returns an array of the removed elements. The predicate is invoked
  8562. * with three arguments: (value, index, array).
  8563. *
  8564. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8565. * to pull elements from an array by value.
  8566. *
  8567. * @static
  8568. * @memberOf _
  8569. * @since 2.0.0
  8570. * @category Array
  8571. * @param {Array} array The array to modify.
  8572. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8573. * @returns {Array} Returns the new array of removed elements.
  8574. * @example
  8575. *
  8576. * var array = [1, 2, 3, 4];
  8577. * var evens = _.remove(array, function(n) {
  8578. * return n % 2 == 0;
  8579. * });
  8580. *
  8581. * console.log(array);
  8582. * // => [1, 3]
  8583. *
  8584. * console.log(evens);
  8585. * // => [2, 4]
  8586. */
  8587. function remove(array, predicate) {
  8588. var result = [];
  8589. if (!(array && array.length)) {
  8590. return result;
  8591. }
  8592. var index = -1,
  8593. indexes = [],
  8594. length = array.length;
  8595. predicate = getIteratee(predicate, 3);
  8596. while (++index < length) {
  8597. var value = array[index];
  8598. if (predicate(value, index, array)) {
  8599. result.push(value);
  8600. indexes.push(index);
  8601. }
  8602. }
  8603. basePullAt(array, indexes);
  8604. return result;
  8605. }
  8606. /**
  8607. * Reverses `array` so that the first element becomes the last, the second
  8608. * element becomes the second to last, and so on.
  8609. *
  8610. * **Note:** This method mutates `array` and is based on
  8611. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8612. *
  8613. * @static
  8614. * @memberOf _
  8615. * @since 4.0.0
  8616. * @category Array
  8617. * @param {Array} array The array to modify.
  8618. * @returns {Array} Returns `array`.
  8619. * @example
  8620. *
  8621. * var array = [1, 2, 3];
  8622. *
  8623. * _.reverse(array);
  8624. * // => [3, 2, 1]
  8625. *
  8626. * console.log(array);
  8627. * // => [3, 2, 1]
  8628. */
  8629. function reverse(array) {
  8630. return array == null ? array : nativeReverse.call(array);
  8631. }
  8632. /**
  8633. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8634. *
  8635. * **Note:** This method is used instead of
  8636. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8637. * returned.
  8638. *
  8639. * @static
  8640. * @memberOf _
  8641. * @since 3.0.0
  8642. * @category Array
  8643. * @param {Array} array The array to slice.
  8644. * @param {number} [start=0] The start position.
  8645. * @param {number} [end=array.length] The end position.
  8646. * @returns {Array} Returns the slice of `array`.
  8647. */
  8648. function slice(array, start, end) {
  8649. var length = array == null ? 0 : array.length;
  8650. if (!length) {
  8651. return [];
  8652. }
  8653. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8654. start = 0;
  8655. end = length;
  8656. }
  8657. else {
  8658. start = start == null ? 0 : toInteger(start);
  8659. end = end === undefined ? length : toInteger(end);
  8660. }
  8661. return baseSlice(array, start, end);
  8662. }
  8663. /**
  8664. * Uses a binary search to determine the lowest index at which `value`
  8665. * should be inserted into `array` in order to maintain its sort order.
  8666. *
  8667. * @static
  8668. * @memberOf _
  8669. * @since 0.1.0
  8670. * @category Array
  8671. * @param {Array} array The sorted array to inspect.
  8672. * @param {*} value The value to evaluate.
  8673. * @returns {number} Returns the index at which `value` should be inserted
  8674. * into `array`.
  8675. * @example
  8676. *
  8677. * _.sortedIndex([30, 50], 40);
  8678. * // => 1
  8679. */
  8680. function sortedIndex(array, value) {
  8681. return baseSortedIndex(array, value);
  8682. }
  8683. /**
  8684. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8685. * which is invoked for `value` and each element of `array` to compute their
  8686. * sort ranking. The iteratee is invoked with one argument: (value).
  8687. *
  8688. * @static
  8689. * @memberOf _
  8690. * @since 4.0.0
  8691. * @category Array
  8692. * @param {Array} array The sorted array to inspect.
  8693. * @param {*} value The value to evaluate.
  8694. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8695. * @returns {number} Returns the index at which `value` should be inserted
  8696. * into `array`.
  8697. * @example
  8698. *
  8699. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8700. *
  8701. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8702. * // => 0
  8703. *
  8704. * // The `_.property` iteratee shorthand.
  8705. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8706. * // => 0
  8707. */
  8708. function sortedIndexBy(array, value, iteratee) {
  8709. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8710. }
  8711. /**
  8712. * This method is like `_.indexOf` except that it performs a binary
  8713. * search on a sorted `array`.
  8714. *
  8715. * @static
  8716. * @memberOf _
  8717. * @since 4.0.0
  8718. * @category Array
  8719. * @param {Array} array The array to inspect.
  8720. * @param {*} value The value to search for.
  8721. * @returns {number} Returns the index of the matched value, else `-1`.
  8722. * @example
  8723. *
  8724. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8725. * // => 1
  8726. */
  8727. function sortedIndexOf(array, value) {
  8728. var length = array == null ? 0 : array.length;
  8729. if (length) {
  8730. var index = baseSortedIndex(array, value);
  8731. if (index < length && eq(array[index], value)) {
  8732. return index;
  8733. }
  8734. }
  8735. return -1;
  8736. }
  8737. /**
  8738. * This method is like `_.sortedIndex` except that it returns the highest
  8739. * index at which `value` should be inserted into `array` in order to
  8740. * maintain its sort order.
  8741. *
  8742. * @static
  8743. * @memberOf _
  8744. * @since 3.0.0
  8745. * @category Array
  8746. * @param {Array} array The sorted array to inspect.
  8747. * @param {*} value The value to evaluate.
  8748. * @returns {number} Returns the index at which `value` should be inserted
  8749. * into `array`.
  8750. * @example
  8751. *
  8752. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8753. * // => 4
  8754. */
  8755. function sortedLastIndex(array, value) {
  8756. return baseSortedIndex(array, value, true);
  8757. }
  8758. /**
  8759. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8760. * which is invoked for `value` and each element of `array` to compute their
  8761. * sort ranking. The iteratee is invoked with one argument: (value).
  8762. *
  8763. * @static
  8764. * @memberOf _
  8765. * @since 4.0.0
  8766. * @category Array
  8767. * @param {Array} array The sorted array to inspect.
  8768. * @param {*} value The value to evaluate.
  8769. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8770. * @returns {number} Returns the index at which `value` should be inserted
  8771. * into `array`.
  8772. * @example
  8773. *
  8774. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8775. *
  8776. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8777. * // => 1
  8778. *
  8779. * // The `_.property` iteratee shorthand.
  8780. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8781. * // => 1
  8782. */
  8783. function sortedLastIndexBy(array, value, iteratee) {
  8784. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8785. }
  8786. /**
  8787. * This method is like `_.lastIndexOf` except that it performs a binary
  8788. * search on a sorted `array`.
  8789. *
  8790. * @static
  8791. * @memberOf _
  8792. * @since 4.0.0
  8793. * @category Array
  8794. * @param {Array} array The array to inspect.
  8795. * @param {*} value The value to search for.
  8796. * @returns {number} Returns the index of the matched value, else `-1`.
  8797. * @example
  8798. *
  8799. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8800. * // => 3
  8801. */
  8802. function sortedLastIndexOf(array, value) {
  8803. var length = array == null ? 0 : array.length;
  8804. if (length) {
  8805. var index = baseSortedIndex(array, value, true) - 1;
  8806. if (eq(array[index], value)) {
  8807. return index;
  8808. }
  8809. }
  8810. return -1;
  8811. }
  8812. /**
  8813. * This method is like `_.uniq` except that it's designed and optimized
  8814. * for sorted arrays.
  8815. *
  8816. * @static
  8817. * @memberOf _
  8818. * @since 4.0.0
  8819. * @category Array
  8820. * @param {Array} array The array to inspect.
  8821. * @returns {Array} Returns the new duplicate free array.
  8822. * @example
  8823. *
  8824. * _.sortedUniq([1, 1, 2]);
  8825. * // => [1, 2]
  8826. */
  8827. function sortedUniq(array) {
  8828. return (array && array.length)
  8829. ? baseSortedUniq(array)
  8830. : [];
  8831. }
  8832. /**
  8833. * This method is like `_.uniqBy` except that it's designed and optimized
  8834. * for sorted arrays.
  8835. *
  8836. * @static
  8837. * @memberOf _
  8838. * @since 4.0.0
  8839. * @category Array
  8840. * @param {Array} array The array to inspect.
  8841. * @param {Function} [iteratee] The iteratee invoked per element.
  8842. * @returns {Array} Returns the new duplicate free array.
  8843. * @example
  8844. *
  8845. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8846. * // => [1.1, 2.3]
  8847. */
  8848. function sortedUniqBy(array, iteratee) {
  8849. return (array && array.length)
  8850. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8851. : [];
  8852. }
  8853. /**
  8854. * Gets all but the first element of `array`.
  8855. *
  8856. * @static
  8857. * @memberOf _
  8858. * @since 4.0.0
  8859. * @category Array
  8860. * @param {Array} array The array to query.
  8861. * @returns {Array} Returns the slice of `array`.
  8862. * @example
  8863. *
  8864. * _.tail([1, 2, 3]);
  8865. * // => [2, 3]
  8866. */
  8867. function tail(array) {
  8868. var length = array == null ? 0 : array.length;
  8869. return length ? baseSlice(array, 1, length) : [];
  8870. }
  8871. /**
  8872. * Creates a slice of `array` with `n` elements taken from the beginning.
  8873. *
  8874. * @static
  8875. * @memberOf _
  8876. * @since 0.1.0
  8877. * @category Array
  8878. * @param {Array} array The array to query.
  8879. * @param {number} [n=1] The number of elements to take.
  8880. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8881. * @returns {Array} Returns the slice of `array`.
  8882. * @example
  8883. *
  8884. * _.take([1, 2, 3]);
  8885. * // => [1]
  8886. *
  8887. * _.take([1, 2, 3], 2);
  8888. * // => [1, 2]
  8889. *
  8890. * _.take([1, 2, 3], 5);
  8891. * // => [1, 2, 3]
  8892. *
  8893. * _.take([1, 2, 3], 0);
  8894. * // => []
  8895. */
  8896. function take(array, n, guard) {
  8897. if (!(array && array.length)) {
  8898. return [];
  8899. }
  8900. n = (guard || n === undefined) ? 1 : toInteger(n);
  8901. return baseSlice(array, 0, n < 0 ? 0 : n);
  8902. }
  8903. /**
  8904. * Creates a slice of `array` with `n` elements taken from the end.
  8905. *
  8906. * @static
  8907. * @memberOf _
  8908. * @since 3.0.0
  8909. * @category Array
  8910. * @param {Array} array The array to query.
  8911. * @param {number} [n=1] The number of elements to take.
  8912. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8913. * @returns {Array} Returns the slice of `array`.
  8914. * @example
  8915. *
  8916. * _.takeRight([1, 2, 3]);
  8917. * // => [3]
  8918. *
  8919. * _.takeRight([1, 2, 3], 2);
  8920. * // => [2, 3]
  8921. *
  8922. * _.takeRight([1, 2, 3], 5);
  8923. * // => [1, 2, 3]
  8924. *
  8925. * _.takeRight([1, 2, 3], 0);
  8926. * // => []
  8927. */
  8928. function takeRight(array, n, guard) {
  8929. var length = array == null ? 0 : array.length;
  8930. if (!length) {
  8931. return [];
  8932. }
  8933. n = (guard || n === undefined) ? 1 : toInteger(n);
  8934. n = length - n;
  8935. return baseSlice(array, n < 0 ? 0 : n, length);
  8936. }
  8937. /**
  8938. * Creates a slice of `array` with elements taken from the end. Elements are
  8939. * taken until `predicate` returns falsey. The predicate is invoked with
  8940. * three arguments: (value, index, array).
  8941. *
  8942. * @static
  8943. * @memberOf _
  8944. * @since 3.0.0
  8945. * @category Array
  8946. * @param {Array} array The array to query.
  8947. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8948. * @returns {Array} Returns the slice of `array`.
  8949. * @example
  8950. *
  8951. * var users = [
  8952. * { 'user': 'barney', 'active': true },
  8953. * { 'user': 'fred', 'active': false },
  8954. * { 'user': 'pebbles', 'active': false }
  8955. * ];
  8956. *
  8957. * _.takeRightWhile(users, function(o) { return !o.active; });
  8958. * // => objects for ['fred', 'pebbles']
  8959. *
  8960. * // The `_.matches` iteratee shorthand.
  8961. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8962. * // => objects for ['pebbles']
  8963. *
  8964. * // The `_.matchesProperty` iteratee shorthand.
  8965. * _.takeRightWhile(users, ['active', false]);
  8966. * // => objects for ['fred', 'pebbles']
  8967. *
  8968. * // The `_.property` iteratee shorthand.
  8969. * _.takeRightWhile(users, 'active');
  8970. * // => []
  8971. */
  8972. function takeRightWhile(array, predicate) {
  8973. return (array && array.length)
  8974. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8975. : [];
  8976. }
  8977. /**
  8978. * Creates a slice of `array` with elements taken from the beginning. Elements
  8979. * are taken until `predicate` returns falsey. The predicate is invoked with
  8980. * three arguments: (value, index, array).
  8981. *
  8982. * @static
  8983. * @memberOf _
  8984. * @since 3.0.0
  8985. * @category Array
  8986. * @param {Array} array The array to query.
  8987. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8988. * @returns {Array} Returns the slice of `array`.
  8989. * @example
  8990. *
  8991. * var users = [
  8992. * { 'user': 'barney', 'active': false },
  8993. * { 'user': 'fred', 'active': false },
  8994. * { 'user': 'pebbles', 'active': true }
  8995. * ];
  8996. *
  8997. * _.takeWhile(users, function(o) { return !o.active; });
  8998. * // => objects for ['barney', 'fred']
  8999. *
  9000. * // The `_.matches` iteratee shorthand.
  9001. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9002. * // => objects for ['barney']
  9003. *
  9004. * // The `_.matchesProperty` iteratee shorthand.
  9005. * _.takeWhile(users, ['active', false]);
  9006. * // => objects for ['barney', 'fred']
  9007. *
  9008. * // The `_.property` iteratee shorthand.
  9009. * _.takeWhile(users, 'active');
  9010. * // => []
  9011. */
  9012. function takeWhile(array, predicate) {
  9013. return (array && array.length)
  9014. ? baseWhile(array, getIteratee(predicate, 3))
  9015. : [];
  9016. }
  9017. /**
  9018. * Creates an array of unique values, in order, from all given arrays using
  9019. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9020. * for equality comparisons.
  9021. *
  9022. * @static
  9023. * @memberOf _
  9024. * @since 0.1.0
  9025. * @category Array
  9026. * @param {...Array} [arrays] The arrays to inspect.
  9027. * @returns {Array} Returns the new array of combined values.
  9028. * @example
  9029. *
  9030. * _.union([2], [1, 2]);
  9031. * // => [2, 1]
  9032. */
  9033. var union = baseRest(function(arrays) {
  9034. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9035. });
  9036. /**
  9037. * This method is like `_.union` except that it accepts `iteratee` which is
  9038. * invoked for each element of each `arrays` to generate the criterion by
  9039. * which uniqueness is computed. Result values are chosen from the first
  9040. * array in which the value occurs. The iteratee is invoked with one argument:
  9041. * (value).
  9042. *
  9043. * @static
  9044. * @memberOf _
  9045. * @since 4.0.0
  9046. * @category Array
  9047. * @param {...Array} [arrays] The arrays to inspect.
  9048. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9049. * @returns {Array} Returns the new array of combined values.
  9050. * @example
  9051. *
  9052. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9053. * // => [2.1, 1.2]
  9054. *
  9055. * // The `_.property` iteratee shorthand.
  9056. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9057. * // => [{ 'x': 1 }, { 'x': 2 }]
  9058. */
  9059. var unionBy = baseRest(function(arrays) {
  9060. var iteratee = last(arrays);
  9061. if (isArrayLikeObject(iteratee)) {
  9062. iteratee = undefined;
  9063. }
  9064. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9065. });
  9066. /**
  9067. * This method is like `_.union` except that it accepts `comparator` which
  9068. * is invoked to compare elements of `arrays`. Result values are chosen from
  9069. * the first array in which the value occurs. The comparator is invoked
  9070. * with two arguments: (arrVal, othVal).
  9071. *
  9072. * @static
  9073. * @memberOf _
  9074. * @since 4.0.0
  9075. * @category Array
  9076. * @param {...Array} [arrays] The arrays to inspect.
  9077. * @param {Function} [comparator] The comparator invoked per element.
  9078. * @returns {Array} Returns the new array of combined values.
  9079. * @example
  9080. *
  9081. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9082. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9083. *
  9084. * _.unionWith(objects, others, _.isEqual);
  9085. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9086. */
  9087. var unionWith = baseRest(function(arrays) {
  9088. var comparator = last(arrays);
  9089. comparator = typeof comparator == 'function' ? comparator : undefined;
  9090. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9091. });
  9092. /**
  9093. * Creates a duplicate-free version of an array, using
  9094. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9095. * for equality comparisons, in which only the first occurrence of each element
  9096. * is kept. The order of result values is determined by the order they occur
  9097. * in the array.
  9098. *
  9099. * @static
  9100. * @memberOf _
  9101. * @since 0.1.0
  9102. * @category Array
  9103. * @param {Array} array The array to inspect.
  9104. * @returns {Array} Returns the new duplicate free array.
  9105. * @example
  9106. *
  9107. * _.uniq([2, 1, 2]);
  9108. * // => [2, 1]
  9109. */
  9110. function uniq(array) {
  9111. return (array && array.length) ? baseUniq(array) : [];
  9112. }
  9113. /**
  9114. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9115. * invoked for each element in `array` to generate the criterion by which
  9116. * uniqueness is computed. The order of result values is determined by the
  9117. * order they occur in the array. The iteratee is invoked with one argument:
  9118. * (value).
  9119. *
  9120. * @static
  9121. * @memberOf _
  9122. * @since 4.0.0
  9123. * @category Array
  9124. * @param {Array} array The array to inspect.
  9125. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9126. * @returns {Array} Returns the new duplicate free array.
  9127. * @example
  9128. *
  9129. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9130. * // => [2.1, 1.2]
  9131. *
  9132. * // The `_.property` iteratee shorthand.
  9133. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9134. * // => [{ 'x': 1 }, { 'x': 2 }]
  9135. */
  9136. function uniqBy(array, iteratee) {
  9137. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9138. }
  9139. /**
  9140. * This method is like `_.uniq` except that it accepts `comparator` which
  9141. * is invoked to compare elements of `array`. The order of result values is
  9142. * determined by the order they occur in the array.The comparator is invoked
  9143. * with two arguments: (arrVal, othVal).
  9144. *
  9145. * @static
  9146. * @memberOf _
  9147. * @since 4.0.0
  9148. * @category Array
  9149. * @param {Array} array The array to inspect.
  9150. * @param {Function} [comparator] The comparator invoked per element.
  9151. * @returns {Array} Returns the new duplicate free array.
  9152. * @example
  9153. *
  9154. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9155. *
  9156. * _.uniqWith(objects, _.isEqual);
  9157. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9158. */
  9159. function uniqWith(array, comparator) {
  9160. comparator = typeof comparator == 'function' ? comparator : undefined;
  9161. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9162. }
  9163. /**
  9164. * This method is like `_.zip` except that it accepts an array of grouped
  9165. * elements and creates an array regrouping the elements to their pre-zip
  9166. * configuration.
  9167. *
  9168. * @static
  9169. * @memberOf _
  9170. * @since 1.2.0
  9171. * @category Array
  9172. * @param {Array} array The array of grouped elements to process.
  9173. * @returns {Array} Returns the new array of regrouped elements.
  9174. * @example
  9175. *
  9176. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9177. * // => [['a', 1, true], ['b', 2, false]]
  9178. *
  9179. * _.unzip(zipped);
  9180. * // => [['a', 'b'], [1, 2], [true, false]]
  9181. */
  9182. function unzip(array) {
  9183. if (!(array && array.length)) {
  9184. return [];
  9185. }
  9186. var length = 0;
  9187. array = arrayFilter(array, function(group) {
  9188. if (isArrayLikeObject(group)) {
  9189. length = nativeMax(group.length, length);
  9190. return true;
  9191. }
  9192. });
  9193. return baseTimes(length, function(index) {
  9194. return arrayMap(array, baseProperty(index));
  9195. });
  9196. }
  9197. /**
  9198. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9199. * how regrouped values should be combined. The iteratee is invoked with the
  9200. * elements of each group: (...group).
  9201. *
  9202. * @static
  9203. * @memberOf _
  9204. * @since 3.8.0
  9205. * @category Array
  9206. * @param {Array} array The array of grouped elements to process.
  9207. * @param {Function} [iteratee=_.identity] The function to combine
  9208. * regrouped values.
  9209. * @returns {Array} Returns the new array of regrouped elements.
  9210. * @example
  9211. *
  9212. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9213. * // => [[1, 10, 100], [2, 20, 200]]
  9214. *
  9215. * _.unzipWith(zipped, _.add);
  9216. * // => [3, 30, 300]
  9217. */
  9218. function unzipWith(array, iteratee) {
  9219. if (!(array && array.length)) {
  9220. return [];
  9221. }
  9222. var result = unzip(array);
  9223. if (iteratee == null) {
  9224. return result;
  9225. }
  9226. return arrayMap(result, function(group) {
  9227. return apply(iteratee, undefined, group);
  9228. });
  9229. }
  9230. /**
  9231. * Creates an array excluding all given values using
  9232. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9233. * for equality comparisons.
  9234. *
  9235. * **Note:** Unlike `_.pull`, this method returns a new array.
  9236. *
  9237. * @static
  9238. * @memberOf _
  9239. * @since 0.1.0
  9240. * @category Array
  9241. * @param {Array} array The array to inspect.
  9242. * @param {...*} [values] The values to exclude.
  9243. * @returns {Array} Returns the new array of filtered values.
  9244. * @see _.difference, _.xor
  9245. * @example
  9246. *
  9247. * _.without([2, 1, 2, 3], 1, 2);
  9248. * // => [3]
  9249. */
  9250. var without = baseRest(function(array, values) {
  9251. return isArrayLikeObject(array)
  9252. ? baseDifference(array, values)
  9253. : [];
  9254. });
  9255. /**
  9256. * Creates an array of unique values that is the
  9257. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9258. * of the given arrays. The order of result values is determined by the order
  9259. * they occur in the arrays.
  9260. *
  9261. * @static
  9262. * @memberOf _
  9263. * @since 2.4.0
  9264. * @category Array
  9265. * @param {...Array} [arrays] The arrays to inspect.
  9266. * @returns {Array} Returns the new array of filtered values.
  9267. * @see _.difference, _.without
  9268. * @example
  9269. *
  9270. * _.xor([2, 1], [2, 3]);
  9271. * // => [1, 3]
  9272. */
  9273. var xor = baseRest(function(arrays) {
  9274. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9275. });
  9276. /**
  9277. * This method is like `_.xor` except that it accepts `iteratee` which is
  9278. * invoked for each element of each `arrays` to generate the criterion by
  9279. * which by which they're compared. The order of result values is determined
  9280. * by the order they occur in the arrays. The iteratee is invoked with one
  9281. * argument: (value).
  9282. *
  9283. * @static
  9284. * @memberOf _
  9285. * @since 4.0.0
  9286. * @category Array
  9287. * @param {...Array} [arrays] The arrays to inspect.
  9288. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9289. * @returns {Array} Returns the new array of filtered values.
  9290. * @example
  9291. *
  9292. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9293. * // => [1.2, 3.4]
  9294. *
  9295. * // The `_.property` iteratee shorthand.
  9296. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9297. * // => [{ 'x': 2 }]
  9298. */
  9299. var xorBy = baseRest(function(arrays) {
  9300. var iteratee = last(arrays);
  9301. if (isArrayLikeObject(iteratee)) {
  9302. iteratee = undefined;
  9303. }
  9304. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9305. });
  9306. /**
  9307. * This method is like `_.xor` except that it accepts `comparator` which is
  9308. * invoked to compare elements of `arrays`. The order of result values is
  9309. * determined by the order they occur in the arrays. The comparator is invoked
  9310. * with two arguments: (arrVal, othVal).
  9311. *
  9312. * @static
  9313. * @memberOf _
  9314. * @since 4.0.0
  9315. * @category Array
  9316. * @param {...Array} [arrays] The arrays to inspect.
  9317. * @param {Function} [comparator] The comparator invoked per element.
  9318. * @returns {Array} Returns the new array of filtered values.
  9319. * @example
  9320. *
  9321. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9322. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9323. *
  9324. * _.xorWith(objects, others, _.isEqual);
  9325. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9326. */
  9327. var xorWith = baseRest(function(arrays) {
  9328. var comparator = last(arrays);
  9329. comparator = typeof comparator == 'function' ? comparator : undefined;
  9330. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9331. });
  9332. /**
  9333. * Creates an array of grouped elements, the first of which contains the
  9334. * first elements of the given arrays, the second of which contains the
  9335. * second elements of the given arrays, and so on.
  9336. *
  9337. * @static
  9338. * @memberOf _
  9339. * @since 0.1.0
  9340. * @category Array
  9341. * @param {...Array} [arrays] The arrays to process.
  9342. * @returns {Array} Returns the new array of grouped elements.
  9343. * @example
  9344. *
  9345. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9346. * // => [['a', 1, true], ['b', 2, false]]
  9347. */
  9348. var zip = baseRest(unzip);
  9349. /**
  9350. * This method is like `_.fromPairs` except that it accepts two arrays,
  9351. * one of property identifiers and one of corresponding values.
  9352. *
  9353. * @static
  9354. * @memberOf _
  9355. * @since 0.4.0
  9356. * @category Array
  9357. * @param {Array} [props=[]] The property identifiers.
  9358. * @param {Array} [values=[]] The property values.
  9359. * @returns {Object} Returns the new object.
  9360. * @example
  9361. *
  9362. * _.zipObject(['a', 'b'], [1, 2]);
  9363. * // => { 'a': 1, 'b': 2 }
  9364. */
  9365. function zipObject(props, values) {
  9366. return baseZipObject(props || [], values || [], assignValue);
  9367. }
  9368. /**
  9369. * This method is like `_.zipObject` except that it supports property paths.
  9370. *
  9371. * @static
  9372. * @memberOf _
  9373. * @since 4.1.0
  9374. * @category Array
  9375. * @param {Array} [props=[]] The property identifiers.
  9376. * @param {Array} [values=[]] The property values.
  9377. * @returns {Object} Returns the new object.
  9378. * @example
  9379. *
  9380. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9381. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9382. */
  9383. function zipObjectDeep(props, values) {
  9384. return baseZipObject(props || [], values || [], baseSet);
  9385. }
  9386. /**
  9387. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9388. * how grouped values should be combined. The iteratee is invoked with the
  9389. * elements of each group: (...group).
  9390. *
  9391. * @static
  9392. * @memberOf _
  9393. * @since 3.8.0
  9394. * @category Array
  9395. * @param {...Array} [arrays] The arrays to process.
  9396. * @param {Function} [iteratee=_.identity] The function to combine
  9397. * grouped values.
  9398. * @returns {Array} Returns the new array of grouped elements.
  9399. * @example
  9400. *
  9401. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9402. * return a + b + c;
  9403. * });
  9404. * // => [111, 222]
  9405. */
  9406. var zipWith = baseRest(function(arrays) {
  9407. var length = arrays.length,
  9408. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9409. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9410. return unzipWith(arrays, iteratee);
  9411. });
  9412. /*------------------------------------------------------------------------*/
  9413. /**
  9414. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9415. * chain sequences enabled. The result of such sequences must be unwrapped
  9416. * with `_#value`.
  9417. *
  9418. * @static
  9419. * @memberOf _
  9420. * @since 1.3.0
  9421. * @category Seq
  9422. * @param {*} value The value to wrap.
  9423. * @returns {Object} Returns the new `lodash` wrapper instance.
  9424. * @example
  9425. *
  9426. * var users = [
  9427. * { 'user': 'barney', 'age': 36 },
  9428. * { 'user': 'fred', 'age': 40 },
  9429. * { 'user': 'pebbles', 'age': 1 }
  9430. * ];
  9431. *
  9432. * var youngest = _
  9433. * .chain(users)
  9434. * .sortBy('age')
  9435. * .map(function(o) {
  9436. * return o.user + ' is ' + o.age;
  9437. * })
  9438. * .head()
  9439. * .value();
  9440. * // => 'pebbles is 1'
  9441. */
  9442. function chain(value) {
  9443. var result = lodash(value);
  9444. result.__chain__ = true;
  9445. return result;
  9446. }
  9447. /**
  9448. * This method invokes `interceptor` and returns `value`. The interceptor
  9449. * is invoked with one argument; (value). The purpose of this method is to
  9450. * "tap into" a method chain sequence in order to modify intermediate results.
  9451. *
  9452. * @static
  9453. * @memberOf _
  9454. * @since 0.1.0
  9455. * @category Seq
  9456. * @param {*} value The value to provide to `interceptor`.
  9457. * @param {Function} interceptor The function to invoke.
  9458. * @returns {*} Returns `value`.
  9459. * @example
  9460. *
  9461. * _([1, 2, 3])
  9462. * .tap(function(array) {
  9463. * // Mutate input array.
  9464. * array.pop();
  9465. * })
  9466. * .reverse()
  9467. * .value();
  9468. * // => [2, 1]
  9469. */
  9470. function tap(value, interceptor) {
  9471. interceptor(value);
  9472. return value;
  9473. }
  9474. /**
  9475. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9476. * The purpose of this method is to "pass thru" values replacing intermediate
  9477. * results in a method chain sequence.
  9478. *
  9479. * @static
  9480. * @memberOf _
  9481. * @since 3.0.0
  9482. * @category Seq
  9483. * @param {*} value The value to provide to `interceptor`.
  9484. * @param {Function} interceptor The function to invoke.
  9485. * @returns {*} Returns the result of `interceptor`.
  9486. * @example
  9487. *
  9488. * _(' abc ')
  9489. * .chain()
  9490. * .trim()
  9491. * .thru(function(value) {
  9492. * return [value];
  9493. * })
  9494. * .value();
  9495. * // => ['abc']
  9496. */
  9497. function thru(value, interceptor) {
  9498. return interceptor(value);
  9499. }
  9500. /**
  9501. * This method is the wrapper version of `_.at`.
  9502. *
  9503. * @name at
  9504. * @memberOf _
  9505. * @since 1.0.0
  9506. * @category Seq
  9507. * @param {...(string|string[])} [paths] The property paths to pick.
  9508. * @returns {Object} Returns the new `lodash` wrapper instance.
  9509. * @example
  9510. *
  9511. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9512. *
  9513. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9514. * // => [3, 4]
  9515. */
  9516. var wrapperAt = flatRest(function(paths) {
  9517. var length = paths.length,
  9518. start = length ? paths[0] : 0,
  9519. value = this.__wrapped__,
  9520. interceptor = function(object) { return baseAt(object, paths); };
  9521. if (length > 1 || this.__actions__.length ||
  9522. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9523. return this.thru(interceptor);
  9524. }
  9525. value = value.slice(start, +start + (length ? 1 : 0));
  9526. value.__actions__.push({
  9527. 'func': thru,
  9528. 'args': [interceptor],
  9529. 'thisArg': undefined
  9530. });
  9531. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9532. if (length && !array.length) {
  9533. array.push(undefined);
  9534. }
  9535. return array;
  9536. });
  9537. });
  9538. /**
  9539. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9540. *
  9541. * @name chain
  9542. * @memberOf _
  9543. * @since 0.1.0
  9544. * @category Seq
  9545. * @returns {Object} Returns the new `lodash` wrapper instance.
  9546. * @example
  9547. *
  9548. * var users = [
  9549. * { 'user': 'barney', 'age': 36 },
  9550. * { 'user': 'fred', 'age': 40 }
  9551. * ];
  9552. *
  9553. * // A sequence without explicit chaining.
  9554. * _(users).head();
  9555. * // => { 'user': 'barney', 'age': 36 }
  9556. *
  9557. * // A sequence with explicit chaining.
  9558. * _(users)
  9559. * .chain()
  9560. * .head()
  9561. * .pick('user')
  9562. * .value();
  9563. * // => { 'user': 'barney' }
  9564. */
  9565. function wrapperChain() {
  9566. return chain(this);
  9567. }
  9568. /**
  9569. * Executes the chain sequence and returns the wrapped result.
  9570. *
  9571. * @name commit
  9572. * @memberOf _
  9573. * @since 3.2.0
  9574. * @category Seq
  9575. * @returns {Object} Returns the new `lodash` wrapper instance.
  9576. * @example
  9577. *
  9578. * var array = [1, 2];
  9579. * var wrapped = _(array).push(3);
  9580. *
  9581. * console.log(array);
  9582. * // => [1, 2]
  9583. *
  9584. * wrapped = wrapped.commit();
  9585. * console.log(array);
  9586. * // => [1, 2, 3]
  9587. *
  9588. * wrapped.last();
  9589. * // => 3
  9590. *
  9591. * console.log(array);
  9592. * // => [1, 2, 3]
  9593. */
  9594. function wrapperCommit() {
  9595. return new LodashWrapper(this.value(), this.__chain__);
  9596. }
  9597. /**
  9598. * Gets the next value on a wrapped object following the
  9599. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9600. *
  9601. * @name next
  9602. * @memberOf _
  9603. * @since 4.0.0
  9604. * @category Seq
  9605. * @returns {Object} Returns the next iterator value.
  9606. * @example
  9607. *
  9608. * var wrapped = _([1, 2]);
  9609. *
  9610. * wrapped.next();
  9611. * // => { 'done': false, 'value': 1 }
  9612. *
  9613. * wrapped.next();
  9614. * // => { 'done': false, 'value': 2 }
  9615. *
  9616. * wrapped.next();
  9617. * // => { 'done': true, 'value': undefined }
  9618. */
  9619. function wrapperNext() {
  9620. if (this.__values__ === undefined) {
  9621. this.__values__ = toArray(this.value());
  9622. }
  9623. var done = this.__index__ >= this.__values__.length,
  9624. value = done ? undefined : this.__values__[this.__index__++];
  9625. return { 'done': done, 'value': value };
  9626. }
  9627. /**
  9628. * Enables the wrapper to be iterable.
  9629. *
  9630. * @name Symbol.iterator
  9631. * @memberOf _
  9632. * @since 4.0.0
  9633. * @category Seq
  9634. * @returns {Object} Returns the wrapper object.
  9635. * @example
  9636. *
  9637. * var wrapped = _([1, 2]);
  9638. *
  9639. * wrapped[Symbol.iterator]() === wrapped;
  9640. * // => true
  9641. *
  9642. * Array.from(wrapped);
  9643. * // => [1, 2]
  9644. */
  9645. function wrapperToIterator() {
  9646. return this;
  9647. }
  9648. /**
  9649. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9650. *
  9651. * @name plant
  9652. * @memberOf _
  9653. * @since 3.2.0
  9654. * @category Seq
  9655. * @param {*} value The value to plant.
  9656. * @returns {Object} Returns the new `lodash` wrapper instance.
  9657. * @example
  9658. *
  9659. * function square(n) {
  9660. * return n * n;
  9661. * }
  9662. *
  9663. * var wrapped = _([1, 2]).map(square);
  9664. * var other = wrapped.plant([3, 4]);
  9665. *
  9666. * other.value();
  9667. * // => [9, 16]
  9668. *
  9669. * wrapped.value();
  9670. * // => [1, 4]
  9671. */
  9672. function wrapperPlant(value) {
  9673. var result,
  9674. parent = this;
  9675. while (parent instanceof baseLodash) {
  9676. var clone = wrapperClone(parent);
  9677. clone.__index__ = 0;
  9678. clone.__values__ = undefined;
  9679. if (result) {
  9680. previous.__wrapped__ = clone;
  9681. } else {
  9682. result = clone;
  9683. }
  9684. var previous = clone;
  9685. parent = parent.__wrapped__;
  9686. }
  9687. previous.__wrapped__ = value;
  9688. return result;
  9689. }
  9690. /**
  9691. * This method is the wrapper version of `_.reverse`.
  9692. *
  9693. * **Note:** This method mutates the wrapped array.
  9694. *
  9695. * @name reverse
  9696. * @memberOf _
  9697. * @since 0.1.0
  9698. * @category Seq
  9699. * @returns {Object} Returns the new `lodash` wrapper instance.
  9700. * @example
  9701. *
  9702. * var array = [1, 2, 3];
  9703. *
  9704. * _(array).reverse().value()
  9705. * // => [3, 2, 1]
  9706. *
  9707. * console.log(array);
  9708. * // => [3, 2, 1]
  9709. */
  9710. function wrapperReverse() {
  9711. var value = this.__wrapped__;
  9712. if (value instanceof LazyWrapper) {
  9713. var wrapped = value;
  9714. if (this.__actions__.length) {
  9715. wrapped = new LazyWrapper(this);
  9716. }
  9717. wrapped = wrapped.reverse();
  9718. wrapped.__actions__.push({
  9719. 'func': thru,
  9720. 'args': [reverse],
  9721. 'thisArg': undefined
  9722. });
  9723. return new LodashWrapper(wrapped, this.__chain__);
  9724. }
  9725. return this.thru(reverse);
  9726. }
  9727. /**
  9728. * Executes the chain sequence to resolve the unwrapped value.
  9729. *
  9730. * @name value
  9731. * @memberOf _
  9732. * @since 0.1.0
  9733. * @alias toJSON, valueOf
  9734. * @category Seq
  9735. * @returns {*} Returns the resolved unwrapped value.
  9736. * @example
  9737. *
  9738. * _([1, 2, 3]).value();
  9739. * // => [1, 2, 3]
  9740. */
  9741. function wrapperValue() {
  9742. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9743. }
  9744. /*------------------------------------------------------------------------*/
  9745. /**
  9746. * Creates an object composed of keys generated from the results of running
  9747. * each element of `collection` thru `iteratee`. The corresponding value of
  9748. * each key is the number of times the key was returned by `iteratee`. The
  9749. * iteratee is invoked with one argument: (value).
  9750. *
  9751. * @static
  9752. * @memberOf _
  9753. * @since 0.5.0
  9754. * @category Collection
  9755. * @param {Array|Object} collection The collection to iterate over.
  9756. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9757. * @returns {Object} Returns the composed aggregate object.
  9758. * @example
  9759. *
  9760. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9761. * // => { '4': 1, '6': 2 }
  9762. *
  9763. * // The `_.property` iteratee shorthand.
  9764. * _.countBy(['one', 'two', 'three'], 'length');
  9765. * // => { '3': 2, '5': 1 }
  9766. */
  9767. var countBy = createAggregator(function(result, value, key) {
  9768. if (hasOwnProperty.call(result, key)) {
  9769. ++result[key];
  9770. } else {
  9771. baseAssignValue(result, key, 1);
  9772. }
  9773. });
  9774. /**
  9775. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9776. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9777. * invoked with three arguments: (value, index|key, collection).
  9778. *
  9779. * **Note:** This method returns `true` for
  9780. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9781. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9782. * elements of empty collections.
  9783. *
  9784. * @static
  9785. * @memberOf _
  9786. * @since 0.1.0
  9787. * @category Collection
  9788. * @param {Array|Object} collection The collection to iterate over.
  9789. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9790. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9791. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9792. * else `false`.
  9793. * @example
  9794. *
  9795. * _.every([true, 1, null, 'yes'], Boolean);
  9796. * // => false
  9797. *
  9798. * var users = [
  9799. * { 'user': 'barney', 'age': 36, 'active': false },
  9800. * { 'user': 'fred', 'age': 40, 'active': false }
  9801. * ];
  9802. *
  9803. * // The `_.matches` iteratee shorthand.
  9804. * _.every(users, { 'user': 'barney', 'active': false });
  9805. * // => false
  9806. *
  9807. * // The `_.matchesProperty` iteratee shorthand.
  9808. * _.every(users, ['active', false]);
  9809. * // => true
  9810. *
  9811. * // The `_.property` iteratee shorthand.
  9812. * _.every(users, 'active');
  9813. * // => false
  9814. */
  9815. function every(collection, predicate, guard) {
  9816. var func = isArray(collection) ? arrayEvery : baseEvery;
  9817. if (guard && isIterateeCall(collection, predicate, guard)) {
  9818. predicate = undefined;
  9819. }
  9820. return func(collection, getIteratee(predicate, 3));
  9821. }
  9822. /**
  9823. * Iterates over elements of `collection`, returning an array of all elements
  9824. * `predicate` returns truthy for. The predicate is invoked with three
  9825. * arguments: (value, index|key, collection).
  9826. *
  9827. * **Note:** Unlike `_.remove`, this method returns a new array.
  9828. *
  9829. * @static
  9830. * @memberOf _
  9831. * @since 0.1.0
  9832. * @category Collection
  9833. * @param {Array|Object} collection The collection to iterate over.
  9834. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9835. * @returns {Array} Returns the new filtered array.
  9836. * @see _.reject
  9837. * @example
  9838. *
  9839. * var users = [
  9840. * { 'user': 'barney', 'age': 36, 'active': true },
  9841. * { 'user': 'fred', 'age': 40, 'active': false }
  9842. * ];
  9843. *
  9844. * _.filter(users, function(o) { return !o.active; });
  9845. * // => objects for ['fred']
  9846. *
  9847. * // The `_.matches` iteratee shorthand.
  9848. * _.filter(users, { 'age': 36, 'active': true });
  9849. * // => objects for ['barney']
  9850. *
  9851. * // The `_.matchesProperty` iteratee shorthand.
  9852. * _.filter(users, ['active', false]);
  9853. * // => objects for ['fred']
  9854. *
  9855. * // The `_.property` iteratee shorthand.
  9856. * _.filter(users, 'active');
  9857. * // => objects for ['barney']
  9858. *
  9859. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9860. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9861. * // => objects for ['fred', 'barney']
  9862. */
  9863. function filter(collection, predicate) {
  9864. var func = isArray(collection) ? arrayFilter : baseFilter;
  9865. return func(collection, getIteratee(predicate, 3));
  9866. }
  9867. /**
  9868. * Iterates over elements of `collection`, returning the first element
  9869. * `predicate` returns truthy for. The predicate is invoked with three
  9870. * arguments: (value, index|key, collection).
  9871. *
  9872. * @static
  9873. * @memberOf _
  9874. * @since 0.1.0
  9875. * @category Collection
  9876. * @param {Array|Object} collection The collection to inspect.
  9877. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9878. * @param {number} [fromIndex=0] The index to search from.
  9879. * @returns {*} Returns the matched element, else `undefined`.
  9880. * @example
  9881. *
  9882. * var users = [
  9883. * { 'user': 'barney', 'age': 36, 'active': true },
  9884. * { 'user': 'fred', 'age': 40, 'active': false },
  9885. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9886. * ];
  9887. *
  9888. * _.find(users, function(o) { return o.age < 40; });
  9889. * // => object for 'barney'
  9890. *
  9891. * // The `_.matches` iteratee shorthand.
  9892. * _.find(users, { 'age': 1, 'active': true });
  9893. * // => object for 'pebbles'
  9894. *
  9895. * // The `_.matchesProperty` iteratee shorthand.
  9896. * _.find(users, ['active', false]);
  9897. * // => object for 'fred'
  9898. *
  9899. * // The `_.property` iteratee shorthand.
  9900. * _.find(users, 'active');
  9901. * // => object for 'barney'
  9902. */
  9903. var find = createFind(findIndex);
  9904. /**
  9905. * This method is like `_.find` except that it iterates over elements of
  9906. * `collection` from right to left.
  9907. *
  9908. * @static
  9909. * @memberOf _
  9910. * @since 2.0.0
  9911. * @category Collection
  9912. * @param {Array|Object} collection The collection to inspect.
  9913. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9914. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9915. * @returns {*} Returns the matched element, else `undefined`.
  9916. * @example
  9917. *
  9918. * _.findLast([1, 2, 3, 4], function(n) {
  9919. * return n % 2 == 1;
  9920. * });
  9921. * // => 3
  9922. */
  9923. var findLast = createFind(findLastIndex);
  9924. /**
  9925. * Creates a flattened array of values by running each element in `collection`
  9926. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9927. * with three arguments: (value, index|key, collection).
  9928. *
  9929. * @static
  9930. * @memberOf _
  9931. * @since 4.0.0
  9932. * @category Collection
  9933. * @param {Array|Object} collection The collection to iterate over.
  9934. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9935. * @returns {Array} Returns the new flattened array.
  9936. * @example
  9937. *
  9938. * function duplicate(n) {
  9939. * return [n, n];
  9940. * }
  9941. *
  9942. * _.flatMap([1, 2], duplicate);
  9943. * // => [1, 1, 2, 2]
  9944. */
  9945. function flatMap(collection, iteratee) {
  9946. return baseFlatten(map(collection, iteratee), 1);
  9947. }
  9948. /**
  9949. * This method is like `_.flatMap` except that it recursively flattens the
  9950. * mapped results.
  9951. *
  9952. * @static
  9953. * @memberOf _
  9954. * @since 4.7.0
  9955. * @category Collection
  9956. * @param {Array|Object} collection The collection to iterate over.
  9957. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9958. * @returns {Array} Returns the new flattened array.
  9959. * @example
  9960. *
  9961. * function duplicate(n) {
  9962. * return [[[n, n]]];
  9963. * }
  9964. *
  9965. * _.flatMapDeep([1, 2], duplicate);
  9966. * // => [1, 1, 2, 2]
  9967. */
  9968. function flatMapDeep(collection, iteratee) {
  9969. return baseFlatten(map(collection, iteratee), INFINITY);
  9970. }
  9971. /**
  9972. * This method is like `_.flatMap` except that it recursively flattens the
  9973. * mapped results up to `depth` times.
  9974. *
  9975. * @static
  9976. * @memberOf _
  9977. * @since 4.7.0
  9978. * @category Collection
  9979. * @param {Array|Object} collection The collection to iterate over.
  9980. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9981. * @param {number} [depth=1] The maximum recursion depth.
  9982. * @returns {Array} Returns the new flattened array.
  9983. * @example
  9984. *
  9985. * function duplicate(n) {
  9986. * return [[[n, n]]];
  9987. * }
  9988. *
  9989. * _.flatMapDepth([1, 2], duplicate, 2);
  9990. * // => [[1, 1], [2, 2]]
  9991. */
  9992. function flatMapDepth(collection, iteratee, depth) {
  9993. depth = depth === undefined ? 1 : toInteger(depth);
  9994. return baseFlatten(map(collection, iteratee), depth);
  9995. }
  9996. /**
  9997. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9998. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9999. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10000. *
  10001. * **Note:** As with other "Collections" methods, objects with a "length"
  10002. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10003. * or `_.forOwn` for object iteration.
  10004. *
  10005. * @static
  10006. * @memberOf _
  10007. * @since 0.1.0
  10008. * @alias each
  10009. * @category Collection
  10010. * @param {Array|Object} collection The collection to iterate over.
  10011. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10012. * @returns {Array|Object} Returns `collection`.
  10013. * @see _.forEachRight
  10014. * @example
  10015. *
  10016. * _.forEach([1, 2], function(value) {
  10017. * console.log(value);
  10018. * });
  10019. * // => Logs `1` then `2`.
  10020. *
  10021. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10022. * console.log(key);
  10023. * });
  10024. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10025. */
  10026. function forEach(collection, iteratee) {
  10027. var func = isArray(collection) ? arrayEach : baseEach;
  10028. return func(collection, getIteratee(iteratee, 3));
  10029. }
  10030. /**
  10031. * This method is like `_.forEach` except that it iterates over elements of
  10032. * `collection` from right to left.
  10033. *
  10034. * @static
  10035. * @memberOf _
  10036. * @since 2.0.0
  10037. * @alias eachRight
  10038. * @category Collection
  10039. * @param {Array|Object} collection The collection to iterate over.
  10040. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10041. * @returns {Array|Object} Returns `collection`.
  10042. * @see _.forEach
  10043. * @example
  10044. *
  10045. * _.forEachRight([1, 2], function(value) {
  10046. * console.log(value);
  10047. * });
  10048. * // => Logs `2` then `1`.
  10049. */
  10050. function forEachRight(collection, iteratee) {
  10051. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10052. return func(collection, getIteratee(iteratee, 3));
  10053. }
  10054. /**
  10055. * Creates an object composed of keys generated from the results of running
  10056. * each element of `collection` thru `iteratee`. The order of grouped values
  10057. * is determined by the order they occur in `collection`. The corresponding
  10058. * value of each key is an array of elements responsible for generating the
  10059. * key. The iteratee is invoked with one argument: (value).
  10060. *
  10061. * @static
  10062. * @memberOf _
  10063. * @since 0.1.0
  10064. * @category Collection
  10065. * @param {Array|Object} collection The collection to iterate over.
  10066. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10067. * @returns {Object} Returns the composed aggregate object.
  10068. * @example
  10069. *
  10070. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10071. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10072. *
  10073. * // The `_.property` iteratee shorthand.
  10074. * _.groupBy(['one', 'two', 'three'], 'length');
  10075. * // => { '3': ['one', 'two'], '5': ['three'] }
  10076. */
  10077. var groupBy = createAggregator(function(result, value, key) {
  10078. if (hasOwnProperty.call(result, key)) {
  10079. result[key].push(value);
  10080. } else {
  10081. baseAssignValue(result, key, [value]);
  10082. }
  10083. });
  10084. /**
  10085. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10086. * checked for a substring of `value`, otherwise
  10087. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10088. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10089. * the offset from the end of `collection`.
  10090. *
  10091. * @static
  10092. * @memberOf _
  10093. * @since 0.1.0
  10094. * @category Collection
  10095. * @param {Array|Object|string} collection The collection to inspect.
  10096. * @param {*} value The value to search for.
  10097. * @param {number} [fromIndex=0] The index to search from.
  10098. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10099. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10100. * @example
  10101. *
  10102. * _.includes([1, 2, 3], 1);
  10103. * // => true
  10104. *
  10105. * _.includes([1, 2, 3], 1, 2);
  10106. * // => false
  10107. *
  10108. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10109. * // => true
  10110. *
  10111. * _.includes('abcd', 'bc');
  10112. * // => true
  10113. */
  10114. function includes(collection, value, fromIndex, guard) {
  10115. collection = isArrayLike(collection) ? collection : values(collection);
  10116. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10117. var length = collection.length;
  10118. if (fromIndex < 0) {
  10119. fromIndex = nativeMax(length + fromIndex, 0);
  10120. }
  10121. return isString(collection)
  10122. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10123. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10124. }
  10125. /**
  10126. * Invokes the method at `path` of each element in `collection`, returning
  10127. * an array of the results of each invoked method. Any additional arguments
  10128. * are provided to each invoked method. If `path` is a function, it's invoked
  10129. * for, and `this` bound to, each element in `collection`.
  10130. *
  10131. * @static
  10132. * @memberOf _
  10133. * @since 4.0.0
  10134. * @category Collection
  10135. * @param {Array|Object} collection The collection to iterate over.
  10136. * @param {Array|Function|string} path The path of the method to invoke or
  10137. * the function invoked per iteration.
  10138. * @param {...*} [args] The arguments to invoke each method with.
  10139. * @returns {Array} Returns the array of results.
  10140. * @example
  10141. *
  10142. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10143. * // => [[1, 5, 7], [1, 2, 3]]
  10144. *
  10145. * _.invokeMap([123, 456], String.prototype.split, '');
  10146. * // => [['1', '2', '3'], ['4', '5', '6']]
  10147. */
  10148. var invokeMap = baseRest(function(collection, path, args) {
  10149. var index = -1,
  10150. isFunc = typeof path == 'function',
  10151. result = isArrayLike(collection) ? Array(collection.length) : [];
  10152. baseEach(collection, function(value) {
  10153. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10154. });
  10155. return result;
  10156. });
  10157. /**
  10158. * Creates an object composed of keys generated from the results of running
  10159. * each element of `collection` thru `iteratee`. The corresponding value of
  10160. * each key is the last element responsible for generating the key. The
  10161. * iteratee is invoked with one argument: (value).
  10162. *
  10163. * @static
  10164. * @memberOf _
  10165. * @since 4.0.0
  10166. * @category Collection
  10167. * @param {Array|Object} collection The collection to iterate over.
  10168. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10169. * @returns {Object} Returns the composed aggregate object.
  10170. * @example
  10171. *
  10172. * var array = [
  10173. * { 'dir': 'left', 'code': 97 },
  10174. * { 'dir': 'right', 'code': 100 }
  10175. * ];
  10176. *
  10177. * _.keyBy(array, function(o) {
  10178. * return String.fromCharCode(o.code);
  10179. * });
  10180. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10181. *
  10182. * _.keyBy(array, 'dir');
  10183. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10184. */
  10185. var keyBy = createAggregator(function(result, value, key) {
  10186. baseAssignValue(result, key, value);
  10187. });
  10188. /**
  10189. * Creates an array of values by running each element in `collection` thru
  10190. * `iteratee`. The iteratee is invoked with three arguments:
  10191. * (value, index|key, collection).
  10192. *
  10193. * Many lodash methods are guarded to work as iteratees for methods like
  10194. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10195. *
  10196. * The guarded methods are:
  10197. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10198. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10199. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10200. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10201. *
  10202. * @static
  10203. * @memberOf _
  10204. * @since 0.1.0
  10205. * @category Collection
  10206. * @param {Array|Object} collection The collection to iterate over.
  10207. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10208. * @returns {Array} Returns the new mapped array.
  10209. * @example
  10210. *
  10211. * function square(n) {
  10212. * return n * n;
  10213. * }
  10214. *
  10215. * _.map([4, 8], square);
  10216. * // => [16, 64]
  10217. *
  10218. * _.map({ 'a': 4, 'b': 8 }, square);
  10219. * // => [16, 64] (iteration order is not guaranteed)
  10220. *
  10221. * var users = [
  10222. * { 'user': 'barney' },
  10223. * { 'user': 'fred' }
  10224. * ];
  10225. *
  10226. * // The `_.property` iteratee shorthand.
  10227. * _.map(users, 'user');
  10228. * // => ['barney', 'fred']
  10229. */
  10230. function map(collection, iteratee) {
  10231. var func = isArray(collection) ? arrayMap : baseMap;
  10232. return func(collection, getIteratee(iteratee, 3));
  10233. }
  10234. /**
  10235. * This method is like `_.sortBy` except that it allows specifying the sort
  10236. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10237. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10238. * descending or "asc" for ascending sort order of corresponding values.
  10239. *
  10240. * @static
  10241. * @memberOf _
  10242. * @since 4.0.0
  10243. * @category Collection
  10244. * @param {Array|Object} collection The collection to iterate over.
  10245. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10246. * The iteratees to sort by.
  10247. * @param {string[]} [orders] The sort orders of `iteratees`.
  10248. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10249. * @returns {Array} Returns the new sorted array.
  10250. * @example
  10251. *
  10252. * var users = [
  10253. * { 'user': 'fred', 'age': 48 },
  10254. * { 'user': 'barney', 'age': 34 },
  10255. * { 'user': 'fred', 'age': 40 },
  10256. * { 'user': 'barney', 'age': 36 }
  10257. * ];
  10258. *
  10259. * // Sort by `user` in ascending order and by `age` in descending order.
  10260. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10261. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10262. */
  10263. function orderBy(collection, iteratees, orders, guard) {
  10264. if (collection == null) {
  10265. return [];
  10266. }
  10267. if (!isArray(iteratees)) {
  10268. iteratees = iteratees == null ? [] : [iteratees];
  10269. }
  10270. orders = guard ? undefined : orders;
  10271. if (!isArray(orders)) {
  10272. orders = orders == null ? [] : [orders];
  10273. }
  10274. return baseOrderBy(collection, iteratees, orders);
  10275. }
  10276. /**
  10277. * Creates an array of elements split into two groups, the first of which
  10278. * contains elements `predicate` returns truthy for, the second of which
  10279. * contains elements `predicate` returns falsey for. The predicate is
  10280. * invoked with one argument: (value).
  10281. *
  10282. * @static
  10283. * @memberOf _
  10284. * @since 3.0.0
  10285. * @category Collection
  10286. * @param {Array|Object} collection The collection to iterate over.
  10287. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10288. * @returns {Array} Returns the array of grouped elements.
  10289. * @example
  10290. *
  10291. * var users = [
  10292. * { 'user': 'barney', 'age': 36, 'active': false },
  10293. * { 'user': 'fred', 'age': 40, 'active': true },
  10294. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10295. * ];
  10296. *
  10297. * _.partition(users, function(o) { return o.active; });
  10298. * // => objects for [['fred'], ['barney', 'pebbles']]
  10299. *
  10300. * // The `_.matches` iteratee shorthand.
  10301. * _.partition(users, { 'age': 1, 'active': false });
  10302. * // => objects for [['pebbles'], ['barney', 'fred']]
  10303. *
  10304. * // The `_.matchesProperty` iteratee shorthand.
  10305. * _.partition(users, ['active', false]);
  10306. * // => objects for [['barney', 'pebbles'], ['fred']]
  10307. *
  10308. * // The `_.property` iteratee shorthand.
  10309. * _.partition(users, 'active');
  10310. * // => objects for [['fred'], ['barney', 'pebbles']]
  10311. */
  10312. var partition = createAggregator(function(result, value, key) {
  10313. result[key ? 0 : 1].push(value);
  10314. }, function() { return [[], []]; });
  10315. /**
  10316. * Reduces `collection` to a value which is the accumulated result of running
  10317. * each element in `collection` thru `iteratee`, where each successive
  10318. * invocation is supplied the return value of the previous. If `accumulator`
  10319. * is not given, the first element of `collection` is used as the initial
  10320. * value. The iteratee is invoked with four arguments:
  10321. * (accumulator, value, index|key, collection).
  10322. *
  10323. * Many lodash methods are guarded to work as iteratees for methods like
  10324. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10325. *
  10326. * The guarded methods are:
  10327. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10328. * and `sortBy`
  10329. *
  10330. * @static
  10331. * @memberOf _
  10332. * @since 0.1.0
  10333. * @category Collection
  10334. * @param {Array|Object} collection The collection to iterate over.
  10335. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10336. * @param {*} [accumulator] The initial value.
  10337. * @returns {*} Returns the accumulated value.
  10338. * @see _.reduceRight
  10339. * @example
  10340. *
  10341. * _.reduce([1, 2], function(sum, n) {
  10342. * return sum + n;
  10343. * }, 0);
  10344. * // => 3
  10345. *
  10346. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10347. * (result[value] || (result[value] = [])).push(key);
  10348. * return result;
  10349. * }, {});
  10350. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10351. */
  10352. function reduce(collection, iteratee, accumulator) {
  10353. var func = isArray(collection) ? arrayReduce : baseReduce,
  10354. initAccum = arguments.length < 3;
  10355. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10356. }
  10357. /**
  10358. * This method is like `_.reduce` except that it iterates over elements of
  10359. * `collection` from right to left.
  10360. *
  10361. * @static
  10362. * @memberOf _
  10363. * @since 0.1.0
  10364. * @category Collection
  10365. * @param {Array|Object} collection The collection to iterate over.
  10366. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10367. * @param {*} [accumulator] The initial value.
  10368. * @returns {*} Returns the accumulated value.
  10369. * @see _.reduce
  10370. * @example
  10371. *
  10372. * var array = [[0, 1], [2, 3], [4, 5]];
  10373. *
  10374. * _.reduceRight(array, function(flattened, other) {
  10375. * return flattened.concat(other);
  10376. * }, []);
  10377. * // => [4, 5, 2, 3, 0, 1]
  10378. */
  10379. function reduceRight(collection, iteratee, accumulator) {
  10380. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10381. initAccum = arguments.length < 3;
  10382. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10383. }
  10384. /**
  10385. * The opposite of `_.filter`; this method returns the elements of `collection`
  10386. * that `predicate` does **not** return truthy for.
  10387. *
  10388. * @static
  10389. * @memberOf _
  10390. * @since 0.1.0
  10391. * @category Collection
  10392. * @param {Array|Object} collection The collection to iterate over.
  10393. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10394. * @returns {Array} Returns the new filtered array.
  10395. * @see _.filter
  10396. * @example
  10397. *
  10398. * var users = [
  10399. * { 'user': 'barney', 'age': 36, 'active': false },
  10400. * { 'user': 'fred', 'age': 40, 'active': true }
  10401. * ];
  10402. *
  10403. * _.reject(users, function(o) { return !o.active; });
  10404. * // => objects for ['fred']
  10405. *
  10406. * // The `_.matches` iteratee shorthand.
  10407. * _.reject(users, { 'age': 40, 'active': true });
  10408. * // => objects for ['barney']
  10409. *
  10410. * // The `_.matchesProperty` iteratee shorthand.
  10411. * _.reject(users, ['active', false]);
  10412. * // => objects for ['fred']
  10413. *
  10414. * // The `_.property` iteratee shorthand.
  10415. * _.reject(users, 'active');
  10416. * // => objects for ['barney']
  10417. */
  10418. function reject(collection, predicate) {
  10419. var func = isArray(collection) ? arrayFilter : baseFilter;
  10420. return func(collection, negate(getIteratee(predicate, 3)));
  10421. }
  10422. /**
  10423. * Gets a random element from `collection`.
  10424. *
  10425. * @static
  10426. * @memberOf _
  10427. * @since 2.0.0
  10428. * @category Collection
  10429. * @param {Array|Object} collection The collection to sample.
  10430. * @returns {*} Returns the random element.
  10431. * @example
  10432. *
  10433. * _.sample([1, 2, 3, 4]);
  10434. * // => 2
  10435. */
  10436. function sample(collection) {
  10437. var func = isArray(collection) ? arraySample : baseSample;
  10438. return func(collection);
  10439. }
  10440. /**
  10441. * Gets `n` random elements at unique keys from `collection` up to the
  10442. * size of `collection`.
  10443. *
  10444. * @static
  10445. * @memberOf _
  10446. * @since 4.0.0
  10447. * @category Collection
  10448. * @param {Array|Object} collection The collection to sample.
  10449. * @param {number} [n=1] The number of elements to sample.
  10450. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10451. * @returns {Array} Returns the random elements.
  10452. * @example
  10453. *
  10454. * _.sampleSize([1, 2, 3], 2);
  10455. * // => [3, 1]
  10456. *
  10457. * _.sampleSize([1, 2, 3], 4);
  10458. * // => [2, 3, 1]
  10459. */
  10460. function sampleSize(collection, n, guard) {
  10461. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10462. n = 1;
  10463. } else {
  10464. n = toInteger(n);
  10465. }
  10466. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10467. return func(collection, n);
  10468. }
  10469. /**
  10470. * Creates an array of shuffled values, using a version of the
  10471. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10472. *
  10473. * @static
  10474. * @memberOf _
  10475. * @since 0.1.0
  10476. * @category Collection
  10477. * @param {Array|Object} collection The collection to shuffle.
  10478. * @returns {Array} Returns the new shuffled array.
  10479. * @example
  10480. *
  10481. * _.shuffle([1, 2, 3, 4]);
  10482. * // => [4, 1, 3, 2]
  10483. */
  10484. function shuffle(collection) {
  10485. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10486. return func(collection);
  10487. }
  10488. /**
  10489. * Gets the size of `collection` by returning its length for array-like
  10490. * values or the number of own enumerable string keyed properties for objects.
  10491. *
  10492. * @static
  10493. * @memberOf _
  10494. * @since 0.1.0
  10495. * @category Collection
  10496. * @param {Array|Object|string} collection The collection to inspect.
  10497. * @returns {number} Returns the collection size.
  10498. * @example
  10499. *
  10500. * _.size([1, 2, 3]);
  10501. * // => 3
  10502. *
  10503. * _.size({ 'a': 1, 'b': 2 });
  10504. * // => 2
  10505. *
  10506. * _.size('pebbles');
  10507. * // => 7
  10508. */
  10509. function size(collection) {
  10510. if (collection == null) {
  10511. return 0;
  10512. }
  10513. if (isArrayLike(collection)) {
  10514. return isString(collection) ? stringSize(collection) : collection.length;
  10515. }
  10516. var tag = getTag(collection);
  10517. if (tag == mapTag || tag == setTag) {
  10518. return collection.size;
  10519. }
  10520. return baseKeys(collection).length;
  10521. }
  10522. /**
  10523. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10524. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10525. * invoked with three arguments: (value, index|key, collection).
  10526. *
  10527. * @static
  10528. * @memberOf _
  10529. * @since 0.1.0
  10530. * @category Collection
  10531. * @param {Array|Object} collection The collection to iterate over.
  10532. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10533. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10534. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10535. * else `false`.
  10536. * @example
  10537. *
  10538. * _.some([null, 0, 'yes', false], Boolean);
  10539. * // => true
  10540. *
  10541. * var users = [
  10542. * { 'user': 'barney', 'active': true },
  10543. * { 'user': 'fred', 'active': false }
  10544. * ];
  10545. *
  10546. * // The `_.matches` iteratee shorthand.
  10547. * _.some(users, { 'user': 'barney', 'active': false });
  10548. * // => false
  10549. *
  10550. * // The `_.matchesProperty` iteratee shorthand.
  10551. * _.some(users, ['active', false]);
  10552. * // => true
  10553. *
  10554. * // The `_.property` iteratee shorthand.
  10555. * _.some(users, 'active');
  10556. * // => true
  10557. */
  10558. function some(collection, predicate, guard) {
  10559. var func = isArray(collection) ? arraySome : baseSome;
  10560. if (guard && isIterateeCall(collection, predicate, guard)) {
  10561. predicate = undefined;
  10562. }
  10563. return func(collection, getIteratee(predicate, 3));
  10564. }
  10565. /**
  10566. * Creates an array of elements, sorted in ascending order by the results of
  10567. * running each element in a collection thru each iteratee. This method
  10568. * performs a stable sort, that is, it preserves the original sort order of
  10569. * equal elements. The iteratees are invoked with one argument: (value).
  10570. *
  10571. * @static
  10572. * @memberOf _
  10573. * @since 0.1.0
  10574. * @category Collection
  10575. * @param {Array|Object} collection The collection to iterate over.
  10576. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10577. * The iteratees to sort by.
  10578. * @returns {Array} Returns the new sorted array.
  10579. * @example
  10580. *
  10581. * var users = [
  10582. * { 'user': 'fred', 'age': 48 },
  10583. * { 'user': 'barney', 'age': 36 },
  10584. * { 'user': 'fred', 'age': 30 },
  10585. * { 'user': 'barney', 'age': 34 }
  10586. * ];
  10587. *
  10588. * _.sortBy(users, [function(o) { return o.user; }]);
  10589. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10590. *
  10591. * _.sortBy(users, ['user', 'age']);
  10592. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10593. */
  10594. var sortBy = baseRest(function(collection, iteratees) {
  10595. if (collection == null) {
  10596. return [];
  10597. }
  10598. var length = iteratees.length;
  10599. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10600. iteratees = [];
  10601. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10602. iteratees = [iteratees[0]];
  10603. }
  10604. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10605. });
  10606. /*------------------------------------------------------------------------*/
  10607. /**
  10608. * Gets the timestamp of the number of milliseconds that have elapsed since
  10609. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10610. *
  10611. * @static
  10612. * @memberOf _
  10613. * @since 2.4.0
  10614. * @category Date
  10615. * @returns {number} Returns the timestamp.
  10616. * @example
  10617. *
  10618. * _.defer(function(stamp) {
  10619. * console.log(_.now() - stamp);
  10620. * }, _.now());
  10621. * // => Logs the number of milliseconds it took for the deferred invocation.
  10622. */
  10623. var now = ctxNow || function() {
  10624. return root.Date.now();
  10625. };
  10626. /*------------------------------------------------------------------------*/
  10627. /**
  10628. * The opposite of `_.before`; this method creates a function that invokes
  10629. * `func` once it's called `n` or more times.
  10630. *
  10631. * @static
  10632. * @memberOf _
  10633. * @since 0.1.0
  10634. * @category Function
  10635. * @param {number} n The number of calls before `func` is invoked.
  10636. * @param {Function} func The function to restrict.
  10637. * @returns {Function} Returns the new restricted function.
  10638. * @example
  10639. *
  10640. * var saves = ['profile', 'settings'];
  10641. *
  10642. * var done = _.after(saves.length, function() {
  10643. * console.log('done saving!');
  10644. * });
  10645. *
  10646. * _.forEach(saves, function(type) {
  10647. * asyncSave({ 'type': type, 'complete': done });
  10648. * });
  10649. * // => Logs 'done saving!' after the two async saves have completed.
  10650. */
  10651. function after(n, func) {
  10652. if (typeof func != 'function') {
  10653. throw new TypeError(FUNC_ERROR_TEXT);
  10654. }
  10655. n = toInteger(n);
  10656. return function() {
  10657. if (--n < 1) {
  10658. return func.apply(this, arguments);
  10659. }
  10660. };
  10661. }
  10662. /**
  10663. * Creates a function that invokes `func`, with up to `n` arguments,
  10664. * ignoring any additional arguments.
  10665. *
  10666. * @static
  10667. * @memberOf _
  10668. * @since 3.0.0
  10669. * @category Function
  10670. * @param {Function} func The function to cap arguments for.
  10671. * @param {number} [n=func.length] The arity cap.
  10672. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10673. * @returns {Function} Returns the new capped function.
  10674. * @example
  10675. *
  10676. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10677. * // => [6, 8, 10]
  10678. */
  10679. function ary(func, n, guard) {
  10680. n = guard ? undefined : n;
  10681. n = (func && n == null) ? func.length : n;
  10682. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10683. }
  10684. /**
  10685. * Creates a function that invokes `func`, with the `this` binding and arguments
  10686. * of the created function, while it's called less than `n` times. Subsequent
  10687. * calls to the created function return the result of the last `func` invocation.
  10688. *
  10689. * @static
  10690. * @memberOf _
  10691. * @since 3.0.0
  10692. * @category Function
  10693. * @param {number} n The number of calls at which `func` is no longer invoked.
  10694. * @param {Function} func The function to restrict.
  10695. * @returns {Function} Returns the new restricted function.
  10696. * @example
  10697. *
  10698. * jQuery(element).on('click', _.before(5, addContactToList));
  10699. * // => Allows adding up to 4 contacts to the list.
  10700. */
  10701. function before(n, func) {
  10702. var result;
  10703. if (typeof func != 'function') {
  10704. throw new TypeError(FUNC_ERROR_TEXT);
  10705. }
  10706. n = toInteger(n);
  10707. return function() {
  10708. if (--n > 0) {
  10709. result = func.apply(this, arguments);
  10710. }
  10711. if (n <= 1) {
  10712. func = undefined;
  10713. }
  10714. return result;
  10715. };
  10716. }
  10717. /**
  10718. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10719. * and `partials` prepended to the arguments it receives.
  10720. *
  10721. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10722. * may be used as a placeholder for partially applied arguments.
  10723. *
  10724. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10725. * property of bound functions.
  10726. *
  10727. * @static
  10728. * @memberOf _
  10729. * @since 0.1.0
  10730. * @category Function
  10731. * @param {Function} func The function to bind.
  10732. * @param {*} thisArg The `this` binding of `func`.
  10733. * @param {...*} [partials] The arguments to be partially applied.
  10734. * @returns {Function} Returns the new bound function.
  10735. * @example
  10736. *
  10737. * function greet(greeting, punctuation) {
  10738. * return greeting + ' ' + this.user + punctuation;
  10739. * }
  10740. *
  10741. * var object = { 'user': 'fred' };
  10742. *
  10743. * var bound = _.bind(greet, object, 'hi');
  10744. * bound('!');
  10745. * // => 'hi fred!'
  10746. *
  10747. * // Bound with placeholders.
  10748. * var bound = _.bind(greet, object, _, '!');
  10749. * bound('hi');
  10750. * // => 'hi fred!'
  10751. */
  10752. var bind = baseRest(function(func, thisArg, partials) {
  10753. var bitmask = WRAP_BIND_FLAG;
  10754. if (partials.length) {
  10755. var holders = replaceHolders(partials, getHolder(bind));
  10756. bitmask |= WRAP_PARTIAL_FLAG;
  10757. }
  10758. return createWrap(func, bitmask, thisArg, partials, holders);
  10759. });
  10760. /**
  10761. * Creates a function that invokes the method at `object[key]` with `partials`
  10762. * prepended to the arguments it receives.
  10763. *
  10764. * This method differs from `_.bind` by allowing bound functions to reference
  10765. * methods that may be redefined or don't yet exist. See
  10766. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10767. * for more details.
  10768. *
  10769. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10770. * builds, may be used as a placeholder for partially applied arguments.
  10771. *
  10772. * @static
  10773. * @memberOf _
  10774. * @since 0.10.0
  10775. * @category Function
  10776. * @param {Object} object The object to invoke the method on.
  10777. * @param {string} key The key of the method.
  10778. * @param {...*} [partials] The arguments to be partially applied.
  10779. * @returns {Function} Returns the new bound function.
  10780. * @example
  10781. *
  10782. * var object = {
  10783. * 'user': 'fred',
  10784. * 'greet': function(greeting, punctuation) {
  10785. * return greeting + ' ' + this.user + punctuation;
  10786. * }
  10787. * };
  10788. *
  10789. * var bound = _.bindKey(object, 'greet', 'hi');
  10790. * bound('!');
  10791. * // => 'hi fred!'
  10792. *
  10793. * object.greet = function(greeting, punctuation) {
  10794. * return greeting + 'ya ' + this.user + punctuation;
  10795. * };
  10796. *
  10797. * bound('!');
  10798. * // => 'hiya fred!'
  10799. *
  10800. * // Bound with placeholders.
  10801. * var bound = _.bindKey(object, 'greet', _, '!');
  10802. * bound('hi');
  10803. * // => 'hiya fred!'
  10804. */
  10805. var bindKey = baseRest(function(object, key, partials) {
  10806. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10807. if (partials.length) {
  10808. var holders = replaceHolders(partials, getHolder(bindKey));
  10809. bitmask |= WRAP_PARTIAL_FLAG;
  10810. }
  10811. return createWrap(key, bitmask, object, partials, holders);
  10812. });
  10813. /**
  10814. * Creates a function that accepts arguments of `func` and either invokes
  10815. * `func` returning its result, if at least `arity` number of arguments have
  10816. * been provided, or returns a function that accepts the remaining `func`
  10817. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10818. * is not sufficient.
  10819. *
  10820. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10821. * may be used as a placeholder for provided arguments.
  10822. *
  10823. * **Note:** This method doesn't set the "length" property of curried functions.
  10824. *
  10825. * @static
  10826. * @memberOf _
  10827. * @since 2.0.0
  10828. * @category Function
  10829. * @param {Function} func The function to curry.
  10830. * @param {number} [arity=func.length] The arity of `func`.
  10831. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10832. * @returns {Function} Returns the new curried function.
  10833. * @example
  10834. *
  10835. * var abc = function(a, b, c) {
  10836. * return [a, b, c];
  10837. * };
  10838. *
  10839. * var curried = _.curry(abc);
  10840. *
  10841. * curried(1)(2)(3);
  10842. * // => [1, 2, 3]
  10843. *
  10844. * curried(1, 2)(3);
  10845. * // => [1, 2, 3]
  10846. *
  10847. * curried(1, 2, 3);
  10848. * // => [1, 2, 3]
  10849. *
  10850. * // Curried with placeholders.
  10851. * curried(1)(_, 3)(2);
  10852. * // => [1, 2, 3]
  10853. */
  10854. function curry(func, arity, guard) {
  10855. arity = guard ? undefined : arity;
  10856. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10857. result.placeholder = curry.placeholder;
  10858. return result;
  10859. }
  10860. /**
  10861. * This method is like `_.curry` except that arguments are applied to `func`
  10862. * in the manner of `_.partialRight` instead of `_.partial`.
  10863. *
  10864. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10865. * builds, may be used as a placeholder for provided arguments.
  10866. *
  10867. * **Note:** This method doesn't set the "length" property of curried functions.
  10868. *
  10869. * @static
  10870. * @memberOf _
  10871. * @since 3.0.0
  10872. * @category Function
  10873. * @param {Function} func The function to curry.
  10874. * @param {number} [arity=func.length] The arity of `func`.
  10875. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10876. * @returns {Function} Returns the new curried function.
  10877. * @example
  10878. *
  10879. * var abc = function(a, b, c) {
  10880. * return [a, b, c];
  10881. * };
  10882. *
  10883. * var curried = _.curryRight(abc);
  10884. *
  10885. * curried(3)(2)(1);
  10886. * // => [1, 2, 3]
  10887. *
  10888. * curried(2, 3)(1);
  10889. * // => [1, 2, 3]
  10890. *
  10891. * curried(1, 2, 3);
  10892. * // => [1, 2, 3]
  10893. *
  10894. * // Curried with placeholders.
  10895. * curried(3)(1, _)(2);
  10896. * // => [1, 2, 3]
  10897. */
  10898. function curryRight(func, arity, guard) {
  10899. arity = guard ? undefined : arity;
  10900. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10901. result.placeholder = curryRight.placeholder;
  10902. return result;
  10903. }
  10904. /**
  10905. * Creates a debounced function that delays invoking `func` until after `wait`
  10906. * milliseconds have elapsed since the last time the debounced function was
  10907. * invoked. The debounced function comes with a `cancel` method to cancel
  10908. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10909. * Provide `options` to indicate whether `func` should be invoked on the
  10910. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10911. * with the last arguments provided to the debounced function. Subsequent
  10912. * calls to the debounced function return the result of the last `func`
  10913. * invocation.
  10914. *
  10915. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10916. * invoked on the trailing edge of the timeout only if the debounced function
  10917. * is invoked more than once during the `wait` timeout.
  10918. *
  10919. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10920. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10921. *
  10922. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10923. * for details over the differences between `_.debounce` and `_.throttle`.
  10924. *
  10925. * @static
  10926. * @memberOf _
  10927. * @since 0.1.0
  10928. * @category Function
  10929. * @param {Function} func The function to debounce.
  10930. * @param {number} [wait=0] The number of milliseconds to delay.
  10931. * @param {Object} [options={}] The options object.
  10932. * @param {boolean} [options.leading=false]
  10933. * Specify invoking on the leading edge of the timeout.
  10934. * @param {number} [options.maxWait]
  10935. * The maximum time `func` is allowed to be delayed before it's invoked.
  10936. * @param {boolean} [options.trailing=true]
  10937. * Specify invoking on the trailing edge of the timeout.
  10938. * @returns {Function} Returns the new debounced function.
  10939. * @example
  10940. *
  10941. * // Avoid costly calculations while the window size is in flux.
  10942. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10943. *
  10944. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10945. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10946. * 'leading': true,
  10947. * 'trailing': false
  10948. * }));
  10949. *
  10950. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10951. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10952. * var source = new EventSource('/stream');
  10953. * jQuery(source).on('message', debounced);
  10954. *
  10955. * // Cancel the trailing debounced invocation.
  10956. * jQuery(window).on('popstate', debounced.cancel);
  10957. */
  10958. function debounce(func, wait, options) {
  10959. var lastArgs,
  10960. lastThis,
  10961. maxWait,
  10962. result,
  10963. timerId,
  10964. lastCallTime,
  10965. lastInvokeTime = 0,
  10966. leading = false,
  10967. maxing = false,
  10968. trailing = true;
  10969. if (typeof func != 'function') {
  10970. throw new TypeError(FUNC_ERROR_TEXT);
  10971. }
  10972. wait = toNumber(wait) || 0;
  10973. if (isObject(options)) {
  10974. leading = !!options.leading;
  10975. maxing = 'maxWait' in options;
  10976. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10977. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10978. }
  10979. function invokeFunc(time) {
  10980. var args = lastArgs,
  10981. thisArg = lastThis;
  10982. lastArgs = lastThis = undefined;
  10983. lastInvokeTime = time;
  10984. result = func.apply(thisArg, args);
  10985. return result;
  10986. }
  10987. function leadingEdge(time) {
  10988. // Reset any `maxWait` timer.
  10989. lastInvokeTime = time;
  10990. // Start the timer for the trailing edge.
  10991. timerId = setTimeout(timerExpired, wait);
  10992. // Invoke the leading edge.
  10993. return leading ? invokeFunc(time) : result;
  10994. }
  10995. function remainingWait(time) {
  10996. var timeSinceLastCall = time - lastCallTime,
  10997. timeSinceLastInvoke = time - lastInvokeTime,
  10998. timeWaiting = wait - timeSinceLastCall;
  10999. return maxing
  11000. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11001. : timeWaiting;
  11002. }
  11003. function shouldInvoke(time) {
  11004. var timeSinceLastCall = time - lastCallTime,
  11005. timeSinceLastInvoke = time - lastInvokeTime;
  11006. // Either this is the first call, activity has stopped and we're at the
  11007. // trailing edge, the system time has gone backwards and we're treating
  11008. // it as the trailing edge, or we've hit the `maxWait` limit.
  11009. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11010. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11011. }
  11012. function timerExpired() {
  11013. var time = now();
  11014. if (shouldInvoke(time)) {
  11015. return trailingEdge(time);
  11016. }
  11017. // Restart the timer.
  11018. timerId = setTimeout(timerExpired, remainingWait(time));
  11019. }
  11020. function trailingEdge(time) {
  11021. timerId = undefined;
  11022. // Only invoke if we have `lastArgs` which means `func` has been
  11023. // debounced at least once.
  11024. if (trailing && lastArgs) {
  11025. return invokeFunc(time);
  11026. }
  11027. lastArgs = lastThis = undefined;
  11028. return result;
  11029. }
  11030. function cancel() {
  11031. if (timerId !== undefined) {
  11032. clearTimeout(timerId);
  11033. }
  11034. lastInvokeTime = 0;
  11035. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11036. }
  11037. function flush() {
  11038. return timerId === undefined ? result : trailingEdge(now());
  11039. }
  11040. function debounced() {
  11041. var time = now(),
  11042. isInvoking = shouldInvoke(time);
  11043. lastArgs = arguments;
  11044. lastThis = this;
  11045. lastCallTime = time;
  11046. if (isInvoking) {
  11047. if (timerId === undefined) {
  11048. return leadingEdge(lastCallTime);
  11049. }
  11050. if (maxing) {
  11051. // Handle invocations in a tight loop.
  11052. clearTimeout(timerId);
  11053. timerId = setTimeout(timerExpired, wait);
  11054. return invokeFunc(lastCallTime);
  11055. }
  11056. }
  11057. if (timerId === undefined) {
  11058. timerId = setTimeout(timerExpired, wait);
  11059. }
  11060. return result;
  11061. }
  11062. debounced.cancel = cancel;
  11063. debounced.flush = flush;
  11064. return debounced;
  11065. }
  11066. /**
  11067. * Defers invoking the `func` until the current call stack has cleared. Any
  11068. * additional arguments are provided to `func` when it's invoked.
  11069. *
  11070. * @static
  11071. * @memberOf _
  11072. * @since 0.1.0
  11073. * @category Function
  11074. * @param {Function} func The function to defer.
  11075. * @param {...*} [args] The arguments to invoke `func` with.
  11076. * @returns {number} Returns the timer id.
  11077. * @example
  11078. *
  11079. * _.defer(function(text) {
  11080. * console.log(text);
  11081. * }, 'deferred');
  11082. * // => Logs 'deferred' after one millisecond.
  11083. */
  11084. var defer = baseRest(function(func, args) {
  11085. return baseDelay(func, 1, args);
  11086. });
  11087. /**
  11088. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11089. * provided to `func` when it's invoked.
  11090. *
  11091. * @static
  11092. * @memberOf _
  11093. * @since 0.1.0
  11094. * @category Function
  11095. * @param {Function} func The function to delay.
  11096. * @param {number} wait The number of milliseconds to delay invocation.
  11097. * @param {...*} [args] The arguments to invoke `func` with.
  11098. * @returns {number} Returns the timer id.
  11099. * @example
  11100. *
  11101. * _.delay(function(text) {
  11102. * console.log(text);
  11103. * }, 1000, 'later');
  11104. * // => Logs 'later' after one second.
  11105. */
  11106. var delay = baseRest(function(func, wait, args) {
  11107. return baseDelay(func, toNumber(wait) || 0, args);
  11108. });
  11109. /**
  11110. * Creates a function that invokes `func` with arguments reversed.
  11111. *
  11112. * @static
  11113. * @memberOf _
  11114. * @since 4.0.0
  11115. * @category Function
  11116. * @param {Function} func The function to flip arguments for.
  11117. * @returns {Function} Returns the new flipped function.
  11118. * @example
  11119. *
  11120. * var flipped = _.flip(function() {
  11121. * return _.toArray(arguments);
  11122. * });
  11123. *
  11124. * flipped('a', 'b', 'c', 'd');
  11125. * // => ['d', 'c', 'b', 'a']
  11126. */
  11127. function flip(func) {
  11128. return createWrap(func, WRAP_FLIP_FLAG);
  11129. }
  11130. /**
  11131. * Creates a function that memoizes the result of `func`. If `resolver` is
  11132. * provided, it determines the cache key for storing the result based on the
  11133. * arguments provided to the memoized function. By default, the first argument
  11134. * provided to the memoized function is used as the map cache key. The `func`
  11135. * is invoked with the `this` binding of the memoized function.
  11136. *
  11137. * **Note:** The cache is exposed as the `cache` property on the memoized
  11138. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11139. * constructor with one whose instances implement the
  11140. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11141. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11142. *
  11143. * @static
  11144. * @memberOf _
  11145. * @since 0.1.0
  11146. * @category Function
  11147. * @param {Function} func The function to have its output memoized.
  11148. * @param {Function} [resolver] The function to resolve the cache key.
  11149. * @returns {Function} Returns the new memoized function.
  11150. * @example
  11151. *
  11152. * var object = { 'a': 1, 'b': 2 };
  11153. * var other = { 'c': 3, 'd': 4 };
  11154. *
  11155. * var values = _.memoize(_.values);
  11156. * values(object);
  11157. * // => [1, 2]
  11158. *
  11159. * values(other);
  11160. * // => [3, 4]
  11161. *
  11162. * object.a = 2;
  11163. * values(object);
  11164. * // => [1, 2]
  11165. *
  11166. * // Modify the result cache.
  11167. * values.cache.set(object, ['a', 'b']);
  11168. * values(object);
  11169. * // => ['a', 'b']
  11170. *
  11171. * // Replace `_.memoize.Cache`.
  11172. * _.memoize.Cache = WeakMap;
  11173. */
  11174. function memoize(func, resolver) {
  11175. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11176. throw new TypeError(FUNC_ERROR_TEXT);
  11177. }
  11178. var memoized = function() {
  11179. var args = arguments,
  11180. key = resolver ? resolver.apply(this, args) : args[0],
  11181. cache = memoized.cache;
  11182. if (cache.has(key)) {
  11183. return cache.get(key);
  11184. }
  11185. var result = func.apply(this, args);
  11186. memoized.cache = cache.set(key, result) || cache;
  11187. return result;
  11188. };
  11189. memoized.cache = new (memoize.Cache || MapCache);
  11190. return memoized;
  11191. }
  11192. // Expose `MapCache`.
  11193. memoize.Cache = MapCache;
  11194. /**
  11195. * Creates a function that negates the result of the predicate `func`. The
  11196. * `func` predicate is invoked with the `this` binding and arguments of the
  11197. * created function.
  11198. *
  11199. * @static
  11200. * @memberOf _
  11201. * @since 3.0.0
  11202. * @category Function
  11203. * @param {Function} predicate The predicate to negate.
  11204. * @returns {Function} Returns the new negated function.
  11205. * @example
  11206. *
  11207. * function isEven(n) {
  11208. * return n % 2 == 0;
  11209. * }
  11210. *
  11211. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11212. * // => [1, 3, 5]
  11213. */
  11214. function negate(predicate) {
  11215. if (typeof predicate != 'function') {
  11216. throw new TypeError(FUNC_ERROR_TEXT);
  11217. }
  11218. return function() {
  11219. var args = arguments;
  11220. switch (args.length) {
  11221. case 0: return !predicate.call(this);
  11222. case 1: return !predicate.call(this, args[0]);
  11223. case 2: return !predicate.call(this, args[0], args[1]);
  11224. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11225. }
  11226. return !predicate.apply(this, args);
  11227. };
  11228. }
  11229. /**
  11230. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11231. * to the function return the value of the first invocation. The `func` is
  11232. * invoked with the `this` binding and arguments of the created function.
  11233. *
  11234. * @static
  11235. * @memberOf _
  11236. * @since 0.1.0
  11237. * @category Function
  11238. * @param {Function} func The function to restrict.
  11239. * @returns {Function} Returns the new restricted function.
  11240. * @example
  11241. *
  11242. * var initialize = _.once(createApplication);
  11243. * initialize();
  11244. * initialize();
  11245. * // => `createApplication` is invoked once
  11246. */
  11247. function once(func) {
  11248. return before(2, func);
  11249. }
  11250. /**
  11251. * Creates a function that invokes `func` with its arguments transformed.
  11252. *
  11253. * @static
  11254. * @since 4.0.0
  11255. * @memberOf _
  11256. * @category Function
  11257. * @param {Function} func The function to wrap.
  11258. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11259. * The argument transforms.
  11260. * @returns {Function} Returns the new function.
  11261. * @example
  11262. *
  11263. * function doubled(n) {
  11264. * return n * 2;
  11265. * }
  11266. *
  11267. * function square(n) {
  11268. * return n * n;
  11269. * }
  11270. *
  11271. * var func = _.overArgs(function(x, y) {
  11272. * return [x, y];
  11273. * }, [square, doubled]);
  11274. *
  11275. * func(9, 3);
  11276. * // => [81, 6]
  11277. *
  11278. * func(10, 5);
  11279. * // => [100, 10]
  11280. */
  11281. var overArgs = castRest(function(func, transforms) {
  11282. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11283. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11284. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11285. var funcsLength = transforms.length;
  11286. return baseRest(function(args) {
  11287. var index = -1,
  11288. length = nativeMin(args.length, funcsLength);
  11289. while (++index < length) {
  11290. args[index] = transforms[index].call(this, args[index]);
  11291. }
  11292. return apply(func, this, args);
  11293. });
  11294. });
  11295. /**
  11296. * Creates a function that invokes `func` with `partials` prepended to the
  11297. * arguments it receives. This method is like `_.bind` except it does **not**
  11298. * alter the `this` binding.
  11299. *
  11300. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11301. * builds, may be used as a placeholder for partially applied arguments.
  11302. *
  11303. * **Note:** This method doesn't set the "length" property of partially
  11304. * applied functions.
  11305. *
  11306. * @static
  11307. * @memberOf _
  11308. * @since 0.2.0
  11309. * @category Function
  11310. * @param {Function} func The function to partially apply arguments to.
  11311. * @param {...*} [partials] The arguments to be partially applied.
  11312. * @returns {Function} Returns the new partially applied function.
  11313. * @example
  11314. *
  11315. * function greet(greeting, name) {
  11316. * return greeting + ' ' + name;
  11317. * }
  11318. *
  11319. * var sayHelloTo = _.partial(greet, 'hello');
  11320. * sayHelloTo('fred');
  11321. * // => 'hello fred'
  11322. *
  11323. * // Partially applied with placeholders.
  11324. * var greetFred = _.partial(greet, _, 'fred');
  11325. * greetFred('hi');
  11326. * // => 'hi fred'
  11327. */
  11328. var partial = baseRest(function(func, partials) {
  11329. var holders = replaceHolders(partials, getHolder(partial));
  11330. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11331. });
  11332. /**
  11333. * This method is like `_.partial` except that partially applied arguments
  11334. * are appended to the arguments it receives.
  11335. *
  11336. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11337. * builds, may be used as a placeholder for partially applied arguments.
  11338. *
  11339. * **Note:** This method doesn't set the "length" property of partially
  11340. * applied functions.
  11341. *
  11342. * @static
  11343. * @memberOf _
  11344. * @since 1.0.0
  11345. * @category Function
  11346. * @param {Function} func The function to partially apply arguments to.
  11347. * @param {...*} [partials] The arguments to be partially applied.
  11348. * @returns {Function} Returns the new partially applied function.
  11349. * @example
  11350. *
  11351. * function greet(greeting, name) {
  11352. * return greeting + ' ' + name;
  11353. * }
  11354. *
  11355. * var greetFred = _.partialRight(greet, 'fred');
  11356. * greetFred('hi');
  11357. * // => 'hi fred'
  11358. *
  11359. * // Partially applied with placeholders.
  11360. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11361. * sayHelloTo('fred');
  11362. * // => 'hello fred'
  11363. */
  11364. var partialRight = baseRest(function(func, partials) {
  11365. var holders = replaceHolders(partials, getHolder(partialRight));
  11366. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11367. });
  11368. /**
  11369. * Creates a function that invokes `func` with arguments arranged according
  11370. * to the specified `indexes` where the argument value at the first index is
  11371. * provided as the first argument, the argument value at the second index is
  11372. * provided as the second argument, and so on.
  11373. *
  11374. * @static
  11375. * @memberOf _
  11376. * @since 3.0.0
  11377. * @category Function
  11378. * @param {Function} func The function to rearrange arguments for.
  11379. * @param {...(number|number[])} indexes The arranged argument indexes.
  11380. * @returns {Function} Returns the new function.
  11381. * @example
  11382. *
  11383. * var rearged = _.rearg(function(a, b, c) {
  11384. * return [a, b, c];
  11385. * }, [2, 0, 1]);
  11386. *
  11387. * rearged('b', 'c', 'a')
  11388. * // => ['a', 'b', 'c']
  11389. */
  11390. var rearg = flatRest(function(func, indexes) {
  11391. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11392. });
  11393. /**
  11394. * Creates a function that invokes `func` with the `this` binding of the
  11395. * created function and arguments from `start` and beyond provided as
  11396. * an array.
  11397. *
  11398. * **Note:** This method is based on the
  11399. * [rest parameter](https://mdn.io/rest_parameters).
  11400. *
  11401. * @static
  11402. * @memberOf _
  11403. * @since 4.0.0
  11404. * @category Function
  11405. * @param {Function} func The function to apply a rest parameter to.
  11406. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11407. * @returns {Function} Returns the new function.
  11408. * @example
  11409. *
  11410. * var say = _.rest(function(what, names) {
  11411. * return what + ' ' + _.initial(names).join(', ') +
  11412. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11413. * });
  11414. *
  11415. * say('hello', 'fred', 'barney', 'pebbles');
  11416. * // => 'hello fred, barney, & pebbles'
  11417. */
  11418. function rest(func, start) {
  11419. if (typeof func != 'function') {
  11420. throw new TypeError(FUNC_ERROR_TEXT);
  11421. }
  11422. start = start === undefined ? start : toInteger(start);
  11423. return baseRest(func, start);
  11424. }
  11425. /**
  11426. * Creates a function that invokes `func` with the `this` binding of the
  11427. * create function and an array of arguments much like
  11428. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11429. *
  11430. * **Note:** This method is based on the
  11431. * [spread operator](https://mdn.io/spread_operator).
  11432. *
  11433. * @static
  11434. * @memberOf _
  11435. * @since 3.2.0
  11436. * @category Function
  11437. * @param {Function} func The function to spread arguments over.
  11438. * @param {number} [start=0] The start position of the spread.
  11439. * @returns {Function} Returns the new function.
  11440. * @example
  11441. *
  11442. * var say = _.spread(function(who, what) {
  11443. * return who + ' says ' + what;
  11444. * });
  11445. *
  11446. * say(['fred', 'hello']);
  11447. * // => 'fred says hello'
  11448. *
  11449. * var numbers = Promise.all([
  11450. * Promise.resolve(40),
  11451. * Promise.resolve(36)
  11452. * ]);
  11453. *
  11454. * numbers.then(_.spread(function(x, y) {
  11455. * return x + y;
  11456. * }));
  11457. * // => a Promise of 76
  11458. */
  11459. function spread(func, start) {
  11460. if (typeof func != 'function') {
  11461. throw new TypeError(FUNC_ERROR_TEXT);
  11462. }
  11463. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11464. return baseRest(function(args) {
  11465. var array = args[start],
  11466. otherArgs = castSlice(args, 0, start);
  11467. if (array) {
  11468. arrayPush(otherArgs, array);
  11469. }
  11470. return apply(func, this, otherArgs);
  11471. });
  11472. }
  11473. /**
  11474. * Creates a throttled function that only invokes `func` at most once per
  11475. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11476. * method to cancel delayed `func` invocations and a `flush` method to
  11477. * immediately invoke them. Provide `options` to indicate whether `func`
  11478. * should be invoked on the leading and/or trailing edge of the `wait`
  11479. * timeout. The `func` is invoked with the last arguments provided to the
  11480. * throttled function. Subsequent calls to the throttled function return the
  11481. * result of the last `func` invocation.
  11482. *
  11483. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11484. * invoked on the trailing edge of the timeout only if the throttled function
  11485. * is invoked more than once during the `wait` timeout.
  11486. *
  11487. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11488. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11489. *
  11490. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11491. * for details over the differences between `_.throttle` and `_.debounce`.
  11492. *
  11493. * @static
  11494. * @memberOf _
  11495. * @since 0.1.0
  11496. * @category Function
  11497. * @param {Function} func The function to throttle.
  11498. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11499. * @param {Object} [options={}] The options object.
  11500. * @param {boolean} [options.leading=true]
  11501. * Specify invoking on the leading edge of the timeout.
  11502. * @param {boolean} [options.trailing=true]
  11503. * Specify invoking on the trailing edge of the timeout.
  11504. * @returns {Function} Returns the new throttled function.
  11505. * @example
  11506. *
  11507. * // Avoid excessively updating the position while scrolling.
  11508. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11509. *
  11510. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11511. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11512. * jQuery(element).on('click', throttled);
  11513. *
  11514. * // Cancel the trailing throttled invocation.
  11515. * jQuery(window).on('popstate', throttled.cancel);
  11516. */
  11517. function throttle(func, wait, options) {
  11518. var leading = true,
  11519. trailing = true;
  11520. if (typeof func != 'function') {
  11521. throw new TypeError(FUNC_ERROR_TEXT);
  11522. }
  11523. if (isObject(options)) {
  11524. leading = 'leading' in options ? !!options.leading : leading;
  11525. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11526. }
  11527. return debounce(func, wait, {
  11528. 'leading': leading,
  11529. 'maxWait': wait,
  11530. 'trailing': trailing
  11531. });
  11532. }
  11533. /**
  11534. * Creates a function that accepts up to one argument, ignoring any
  11535. * additional arguments.
  11536. *
  11537. * @static
  11538. * @memberOf _
  11539. * @since 4.0.0
  11540. * @category Function
  11541. * @param {Function} func The function to cap arguments for.
  11542. * @returns {Function} Returns the new capped function.
  11543. * @example
  11544. *
  11545. * _.map(['6', '8', '10'], _.unary(parseInt));
  11546. * // => [6, 8, 10]
  11547. */
  11548. function unary(func) {
  11549. return ary(func, 1);
  11550. }
  11551. /**
  11552. * Creates a function that provides `value` to `wrapper` as its first
  11553. * argument. Any additional arguments provided to the function are appended
  11554. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11555. * binding of the created function.
  11556. *
  11557. * @static
  11558. * @memberOf _
  11559. * @since 0.1.0
  11560. * @category Function
  11561. * @param {*} value The value to wrap.
  11562. * @param {Function} [wrapper=identity] The wrapper function.
  11563. * @returns {Function} Returns the new function.
  11564. * @example
  11565. *
  11566. * var p = _.wrap(_.escape, function(func, text) {
  11567. * return '<p>' + func(text) + '</p>';
  11568. * });
  11569. *
  11570. * p('fred, barney, & pebbles');
  11571. * // => '<p>fred, barney, &amp; pebbles</p>'
  11572. */
  11573. function wrap(value, wrapper) {
  11574. return partial(castFunction(wrapper), value);
  11575. }
  11576. /*------------------------------------------------------------------------*/
  11577. /**
  11578. * Casts `value` as an array if it's not one.
  11579. *
  11580. * @static
  11581. * @memberOf _
  11582. * @since 4.4.0
  11583. * @category Lang
  11584. * @param {*} value The value to inspect.
  11585. * @returns {Array} Returns the cast array.
  11586. * @example
  11587. *
  11588. * _.castArray(1);
  11589. * // => [1]
  11590. *
  11591. * _.castArray({ 'a': 1 });
  11592. * // => [{ 'a': 1 }]
  11593. *
  11594. * _.castArray('abc');
  11595. * // => ['abc']
  11596. *
  11597. * _.castArray(null);
  11598. * // => [null]
  11599. *
  11600. * _.castArray(undefined);
  11601. * // => [undefined]
  11602. *
  11603. * _.castArray();
  11604. * // => []
  11605. *
  11606. * var array = [1, 2, 3];
  11607. * console.log(_.castArray(array) === array);
  11608. * // => true
  11609. */
  11610. function castArray() {
  11611. if (!arguments.length) {
  11612. return [];
  11613. }
  11614. var value = arguments[0];
  11615. return isArray(value) ? value : [value];
  11616. }
  11617. /**
  11618. * Creates a shallow clone of `value`.
  11619. *
  11620. * **Note:** This method is loosely based on the
  11621. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11622. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11623. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11624. * arrays. The own enumerable properties of `arguments` objects are cloned
  11625. * as plain objects. An empty object is returned for uncloneable values such
  11626. * as error objects, functions, DOM nodes, and WeakMaps.
  11627. *
  11628. * @static
  11629. * @memberOf _
  11630. * @since 0.1.0
  11631. * @category Lang
  11632. * @param {*} value The value to clone.
  11633. * @returns {*} Returns the cloned value.
  11634. * @see _.cloneDeep
  11635. * @example
  11636. *
  11637. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11638. *
  11639. * var shallow = _.clone(objects);
  11640. * console.log(shallow[0] === objects[0]);
  11641. * // => true
  11642. */
  11643. function clone(value) {
  11644. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11645. }
  11646. /**
  11647. * This method is like `_.clone` except that it accepts `customizer` which
  11648. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11649. * cloning is handled by the method instead. The `customizer` is invoked with
  11650. * up to four arguments; (value [, index|key, object, stack]).
  11651. *
  11652. * @static
  11653. * @memberOf _
  11654. * @since 4.0.0
  11655. * @category Lang
  11656. * @param {*} value The value to clone.
  11657. * @param {Function} [customizer] The function to customize cloning.
  11658. * @returns {*} Returns the cloned value.
  11659. * @see _.cloneDeepWith
  11660. * @example
  11661. *
  11662. * function customizer(value) {
  11663. * if (_.isElement(value)) {
  11664. * return value.cloneNode(false);
  11665. * }
  11666. * }
  11667. *
  11668. * var el = _.cloneWith(document.body, customizer);
  11669. *
  11670. * console.log(el === document.body);
  11671. * // => false
  11672. * console.log(el.nodeName);
  11673. * // => 'BODY'
  11674. * console.log(el.childNodes.length);
  11675. * // => 0
  11676. */
  11677. function cloneWith(value, customizer) {
  11678. customizer = typeof customizer == 'function' ? customizer : undefined;
  11679. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11680. }
  11681. /**
  11682. * This method is like `_.clone` except that it recursively clones `value`.
  11683. *
  11684. * @static
  11685. * @memberOf _
  11686. * @since 1.0.0
  11687. * @category Lang
  11688. * @param {*} value The value to recursively clone.
  11689. * @returns {*} Returns the deep cloned value.
  11690. * @see _.clone
  11691. * @example
  11692. *
  11693. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11694. *
  11695. * var deep = _.cloneDeep(objects);
  11696. * console.log(deep[0] === objects[0]);
  11697. * // => false
  11698. */
  11699. function cloneDeep(value) {
  11700. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11701. }
  11702. /**
  11703. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11704. *
  11705. * @static
  11706. * @memberOf _
  11707. * @since 4.0.0
  11708. * @category Lang
  11709. * @param {*} value The value to recursively clone.
  11710. * @param {Function} [customizer] The function to customize cloning.
  11711. * @returns {*} Returns the deep cloned value.
  11712. * @see _.cloneWith
  11713. * @example
  11714. *
  11715. * function customizer(value) {
  11716. * if (_.isElement(value)) {
  11717. * return value.cloneNode(true);
  11718. * }
  11719. * }
  11720. *
  11721. * var el = _.cloneDeepWith(document.body, customizer);
  11722. *
  11723. * console.log(el === document.body);
  11724. * // => false
  11725. * console.log(el.nodeName);
  11726. * // => 'BODY'
  11727. * console.log(el.childNodes.length);
  11728. * // => 20
  11729. */
  11730. function cloneDeepWith(value, customizer) {
  11731. customizer = typeof customizer == 'function' ? customizer : undefined;
  11732. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11733. }
  11734. /**
  11735. * Checks if `object` conforms to `source` by invoking the predicate
  11736. * properties of `source` with the corresponding property values of `object`.
  11737. *
  11738. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11739. * partially applied.
  11740. *
  11741. * @static
  11742. * @memberOf _
  11743. * @since 4.14.0
  11744. * @category Lang
  11745. * @param {Object} object The object to inspect.
  11746. * @param {Object} source The object of property predicates to conform to.
  11747. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11748. * @example
  11749. *
  11750. * var object = { 'a': 1, 'b': 2 };
  11751. *
  11752. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11753. * // => true
  11754. *
  11755. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11756. * // => false
  11757. */
  11758. function conformsTo(object, source) {
  11759. return source == null || baseConformsTo(object, source, keys(source));
  11760. }
  11761. /**
  11762. * Performs a
  11763. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11764. * comparison between two values to determine if they are equivalent.
  11765. *
  11766. * @static
  11767. * @memberOf _
  11768. * @since 4.0.0
  11769. * @category Lang
  11770. * @param {*} value The value to compare.
  11771. * @param {*} other The other value to compare.
  11772. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11773. * @example
  11774. *
  11775. * var object = { 'a': 1 };
  11776. * var other = { 'a': 1 };
  11777. *
  11778. * _.eq(object, object);
  11779. * // => true
  11780. *
  11781. * _.eq(object, other);
  11782. * // => false
  11783. *
  11784. * _.eq('a', 'a');
  11785. * // => true
  11786. *
  11787. * _.eq('a', Object('a'));
  11788. * // => false
  11789. *
  11790. * _.eq(NaN, NaN);
  11791. * // => true
  11792. */
  11793. function eq(value, other) {
  11794. return value === other || (value !== value && other !== other);
  11795. }
  11796. /**
  11797. * Checks if `value` is greater than `other`.
  11798. *
  11799. * @static
  11800. * @memberOf _
  11801. * @since 3.9.0
  11802. * @category Lang
  11803. * @param {*} value The value to compare.
  11804. * @param {*} other The other value to compare.
  11805. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11806. * else `false`.
  11807. * @see _.lt
  11808. * @example
  11809. *
  11810. * _.gt(3, 1);
  11811. * // => true
  11812. *
  11813. * _.gt(3, 3);
  11814. * // => false
  11815. *
  11816. * _.gt(1, 3);
  11817. * // => false
  11818. */
  11819. var gt = createRelationalOperation(baseGt);
  11820. /**
  11821. * Checks if `value` is greater than or equal to `other`.
  11822. *
  11823. * @static
  11824. * @memberOf _
  11825. * @since 3.9.0
  11826. * @category Lang
  11827. * @param {*} value The value to compare.
  11828. * @param {*} other The other value to compare.
  11829. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11830. * `other`, else `false`.
  11831. * @see _.lte
  11832. * @example
  11833. *
  11834. * _.gte(3, 1);
  11835. * // => true
  11836. *
  11837. * _.gte(3, 3);
  11838. * // => true
  11839. *
  11840. * _.gte(1, 3);
  11841. * // => false
  11842. */
  11843. var gte = createRelationalOperation(function(value, other) {
  11844. return value >= other;
  11845. });
  11846. /**
  11847. * Checks if `value` is likely an `arguments` object.
  11848. *
  11849. * @static
  11850. * @memberOf _
  11851. * @since 0.1.0
  11852. * @category Lang
  11853. * @param {*} value The value to check.
  11854. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11855. * else `false`.
  11856. * @example
  11857. *
  11858. * _.isArguments(function() { return arguments; }());
  11859. * // => true
  11860. *
  11861. * _.isArguments([1, 2, 3]);
  11862. * // => false
  11863. */
  11864. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11865. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11866. !propertyIsEnumerable.call(value, 'callee');
  11867. };
  11868. /**
  11869. * Checks if `value` is classified as an `Array` object.
  11870. *
  11871. * @static
  11872. * @memberOf _
  11873. * @since 0.1.0
  11874. * @category Lang
  11875. * @param {*} value The value to check.
  11876. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11877. * @example
  11878. *
  11879. * _.isArray([1, 2, 3]);
  11880. * // => true
  11881. *
  11882. * _.isArray(document.body.children);
  11883. * // => false
  11884. *
  11885. * _.isArray('abc');
  11886. * // => false
  11887. *
  11888. * _.isArray(_.noop);
  11889. * // => false
  11890. */
  11891. var isArray = Array.isArray;
  11892. /**
  11893. * Checks if `value` is classified as an `ArrayBuffer` object.
  11894. *
  11895. * @static
  11896. * @memberOf _
  11897. * @since 4.3.0
  11898. * @category Lang
  11899. * @param {*} value The value to check.
  11900. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11901. * @example
  11902. *
  11903. * _.isArrayBuffer(new ArrayBuffer(2));
  11904. * // => true
  11905. *
  11906. * _.isArrayBuffer(new Array(2));
  11907. * // => false
  11908. */
  11909. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11910. /**
  11911. * Checks if `value` is array-like. A value is considered array-like if it's
  11912. * not a function and has a `value.length` that's an integer greater than or
  11913. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11914. *
  11915. * @static
  11916. * @memberOf _
  11917. * @since 4.0.0
  11918. * @category Lang
  11919. * @param {*} value The value to check.
  11920. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11921. * @example
  11922. *
  11923. * _.isArrayLike([1, 2, 3]);
  11924. * // => true
  11925. *
  11926. * _.isArrayLike(document.body.children);
  11927. * // => true
  11928. *
  11929. * _.isArrayLike('abc');
  11930. * // => true
  11931. *
  11932. * _.isArrayLike(_.noop);
  11933. * // => false
  11934. */
  11935. function isArrayLike(value) {
  11936. return value != null && isLength(value.length) && !isFunction(value);
  11937. }
  11938. /**
  11939. * This method is like `_.isArrayLike` except that it also checks if `value`
  11940. * is an object.
  11941. *
  11942. * @static
  11943. * @memberOf _
  11944. * @since 4.0.0
  11945. * @category Lang
  11946. * @param {*} value The value to check.
  11947. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11948. * else `false`.
  11949. * @example
  11950. *
  11951. * _.isArrayLikeObject([1, 2, 3]);
  11952. * // => true
  11953. *
  11954. * _.isArrayLikeObject(document.body.children);
  11955. * // => true
  11956. *
  11957. * _.isArrayLikeObject('abc');
  11958. * // => false
  11959. *
  11960. * _.isArrayLikeObject(_.noop);
  11961. * // => false
  11962. */
  11963. function isArrayLikeObject(value) {
  11964. return isObjectLike(value) && isArrayLike(value);
  11965. }
  11966. /**
  11967. * Checks if `value` is classified as a boolean primitive or object.
  11968. *
  11969. * @static
  11970. * @memberOf _
  11971. * @since 0.1.0
  11972. * @category Lang
  11973. * @param {*} value The value to check.
  11974. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11975. * @example
  11976. *
  11977. * _.isBoolean(false);
  11978. * // => true
  11979. *
  11980. * _.isBoolean(null);
  11981. * // => false
  11982. */
  11983. function isBoolean(value) {
  11984. return value === true || value === false ||
  11985. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11986. }
  11987. /**
  11988. * Checks if `value` is a buffer.
  11989. *
  11990. * @static
  11991. * @memberOf _
  11992. * @since 4.3.0
  11993. * @category Lang
  11994. * @param {*} value The value to check.
  11995. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11996. * @example
  11997. *
  11998. * _.isBuffer(new Buffer(2));
  11999. * // => true
  12000. *
  12001. * _.isBuffer(new Uint8Array(2));
  12002. * // => false
  12003. */
  12004. var isBuffer = nativeIsBuffer || stubFalse;
  12005. /**
  12006. * Checks if `value` is classified as a `Date` object.
  12007. *
  12008. * @static
  12009. * @memberOf _
  12010. * @since 0.1.0
  12011. * @category Lang
  12012. * @param {*} value The value to check.
  12013. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12014. * @example
  12015. *
  12016. * _.isDate(new Date);
  12017. * // => true
  12018. *
  12019. * _.isDate('Mon April 23 2012');
  12020. * // => false
  12021. */
  12022. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12023. /**
  12024. * Checks if `value` is likely a DOM element.
  12025. *
  12026. * @static
  12027. * @memberOf _
  12028. * @since 0.1.0
  12029. * @category Lang
  12030. * @param {*} value The value to check.
  12031. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12032. * @example
  12033. *
  12034. * _.isElement(document.body);
  12035. * // => true
  12036. *
  12037. * _.isElement('<body>');
  12038. * // => false
  12039. */
  12040. function isElement(value) {
  12041. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12042. }
  12043. /**
  12044. * Checks if `value` is an empty object, collection, map, or set.
  12045. *
  12046. * Objects are considered empty if they have no own enumerable string keyed
  12047. * properties.
  12048. *
  12049. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12050. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12051. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12052. *
  12053. * @static
  12054. * @memberOf _
  12055. * @since 0.1.0
  12056. * @category Lang
  12057. * @param {*} value The value to check.
  12058. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12059. * @example
  12060. *
  12061. * _.isEmpty(null);
  12062. * // => true
  12063. *
  12064. * _.isEmpty(true);
  12065. * // => true
  12066. *
  12067. * _.isEmpty(1);
  12068. * // => true
  12069. *
  12070. * _.isEmpty([1, 2, 3]);
  12071. * // => false
  12072. *
  12073. * _.isEmpty({ 'a': 1 });
  12074. * // => false
  12075. */
  12076. function isEmpty(value) {
  12077. if (value == null) {
  12078. return true;
  12079. }
  12080. if (isArrayLike(value) &&
  12081. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12082. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12083. return !value.length;
  12084. }
  12085. var tag = getTag(value);
  12086. if (tag == mapTag || tag == setTag) {
  12087. return !value.size;
  12088. }
  12089. if (isPrototype(value)) {
  12090. return !baseKeys(value).length;
  12091. }
  12092. for (var key in value) {
  12093. if (hasOwnProperty.call(value, key)) {
  12094. return false;
  12095. }
  12096. }
  12097. return true;
  12098. }
  12099. /**
  12100. * Performs a deep comparison between two values to determine if they are
  12101. * equivalent.
  12102. *
  12103. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12104. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12105. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12106. * by their own, not inherited, enumerable properties. Functions and DOM
  12107. * nodes are compared by strict equality, i.e. `===`.
  12108. *
  12109. * @static
  12110. * @memberOf _
  12111. * @since 0.1.0
  12112. * @category Lang
  12113. * @param {*} value The value to compare.
  12114. * @param {*} other The other value to compare.
  12115. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12116. * @example
  12117. *
  12118. * var object = { 'a': 1 };
  12119. * var other = { 'a': 1 };
  12120. *
  12121. * _.isEqual(object, other);
  12122. * // => true
  12123. *
  12124. * object === other;
  12125. * // => false
  12126. */
  12127. function isEqual(value, other) {
  12128. return baseIsEqual(value, other);
  12129. }
  12130. /**
  12131. * This method is like `_.isEqual` except that it accepts `customizer` which
  12132. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12133. * are handled by the method instead. The `customizer` is invoked with up to
  12134. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12135. *
  12136. * @static
  12137. * @memberOf _
  12138. * @since 4.0.0
  12139. * @category Lang
  12140. * @param {*} value The value to compare.
  12141. * @param {*} other The other value to compare.
  12142. * @param {Function} [customizer] The function to customize comparisons.
  12143. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12144. * @example
  12145. *
  12146. * function isGreeting(value) {
  12147. * return /^h(?:i|ello)$/.test(value);
  12148. * }
  12149. *
  12150. * function customizer(objValue, othValue) {
  12151. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12152. * return true;
  12153. * }
  12154. * }
  12155. *
  12156. * var array = ['hello', 'goodbye'];
  12157. * var other = ['hi', 'goodbye'];
  12158. *
  12159. * _.isEqualWith(array, other, customizer);
  12160. * // => true
  12161. */
  12162. function isEqualWith(value, other, customizer) {
  12163. customizer = typeof customizer == 'function' ? customizer : undefined;
  12164. var result = customizer ? customizer(value, other) : undefined;
  12165. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12166. }
  12167. /**
  12168. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12169. * `SyntaxError`, `TypeError`, or `URIError` object.
  12170. *
  12171. * @static
  12172. * @memberOf _
  12173. * @since 3.0.0
  12174. * @category Lang
  12175. * @param {*} value The value to check.
  12176. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12177. * @example
  12178. *
  12179. * _.isError(new Error);
  12180. * // => true
  12181. *
  12182. * _.isError(Error);
  12183. * // => false
  12184. */
  12185. function isError(value) {
  12186. if (!isObjectLike(value)) {
  12187. return false;
  12188. }
  12189. var tag = baseGetTag(value);
  12190. return tag == errorTag || tag == domExcTag ||
  12191. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12192. }
  12193. /**
  12194. * Checks if `value` is a finite primitive number.
  12195. *
  12196. * **Note:** This method is based on
  12197. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12198. *
  12199. * @static
  12200. * @memberOf _
  12201. * @since 0.1.0
  12202. * @category Lang
  12203. * @param {*} value The value to check.
  12204. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12205. * @example
  12206. *
  12207. * _.isFinite(3);
  12208. * // => true
  12209. *
  12210. * _.isFinite(Number.MIN_VALUE);
  12211. * // => true
  12212. *
  12213. * _.isFinite(Infinity);
  12214. * // => false
  12215. *
  12216. * _.isFinite('3');
  12217. * // => false
  12218. */
  12219. function isFinite(value) {
  12220. return typeof value == 'number' && nativeIsFinite(value);
  12221. }
  12222. /**
  12223. * Checks if `value` is classified as a `Function` object.
  12224. *
  12225. * @static
  12226. * @memberOf _
  12227. * @since 0.1.0
  12228. * @category Lang
  12229. * @param {*} value The value to check.
  12230. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12231. * @example
  12232. *
  12233. * _.isFunction(_);
  12234. * // => true
  12235. *
  12236. * _.isFunction(/abc/);
  12237. * // => false
  12238. */
  12239. function isFunction(value) {
  12240. if (!isObject(value)) {
  12241. return false;
  12242. }
  12243. // The use of `Object#toString` avoids issues with the `typeof` operator
  12244. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12245. var tag = baseGetTag(value);
  12246. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12247. }
  12248. /**
  12249. * Checks if `value` is an integer.
  12250. *
  12251. * **Note:** This method is based on
  12252. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12253. *
  12254. * @static
  12255. * @memberOf _
  12256. * @since 4.0.0
  12257. * @category Lang
  12258. * @param {*} value The value to check.
  12259. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12260. * @example
  12261. *
  12262. * _.isInteger(3);
  12263. * // => true
  12264. *
  12265. * _.isInteger(Number.MIN_VALUE);
  12266. * // => false
  12267. *
  12268. * _.isInteger(Infinity);
  12269. * // => false
  12270. *
  12271. * _.isInteger('3');
  12272. * // => false
  12273. */
  12274. function isInteger(value) {
  12275. return typeof value == 'number' && value == toInteger(value);
  12276. }
  12277. /**
  12278. * Checks if `value` is a valid array-like length.
  12279. *
  12280. * **Note:** This method is loosely based on
  12281. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12282. *
  12283. * @static
  12284. * @memberOf _
  12285. * @since 4.0.0
  12286. * @category Lang
  12287. * @param {*} value The value to check.
  12288. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12289. * @example
  12290. *
  12291. * _.isLength(3);
  12292. * // => true
  12293. *
  12294. * _.isLength(Number.MIN_VALUE);
  12295. * // => false
  12296. *
  12297. * _.isLength(Infinity);
  12298. * // => false
  12299. *
  12300. * _.isLength('3');
  12301. * // => false
  12302. */
  12303. function isLength(value) {
  12304. return typeof value == 'number' &&
  12305. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12306. }
  12307. /**
  12308. * Checks if `value` is the
  12309. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12310. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12311. *
  12312. * @static
  12313. * @memberOf _
  12314. * @since 0.1.0
  12315. * @category Lang
  12316. * @param {*} value The value to check.
  12317. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12318. * @example
  12319. *
  12320. * _.isObject({});
  12321. * // => true
  12322. *
  12323. * _.isObject([1, 2, 3]);
  12324. * // => true
  12325. *
  12326. * _.isObject(_.noop);
  12327. * // => true
  12328. *
  12329. * _.isObject(null);
  12330. * // => false
  12331. */
  12332. function isObject(value) {
  12333. var type = typeof value;
  12334. return value != null && (type == 'object' || type == 'function');
  12335. }
  12336. /**
  12337. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12338. * and has a `typeof` result of "object".
  12339. *
  12340. * @static
  12341. * @memberOf _
  12342. * @since 4.0.0
  12343. * @category Lang
  12344. * @param {*} value The value to check.
  12345. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12346. * @example
  12347. *
  12348. * _.isObjectLike({});
  12349. * // => true
  12350. *
  12351. * _.isObjectLike([1, 2, 3]);
  12352. * // => true
  12353. *
  12354. * _.isObjectLike(_.noop);
  12355. * // => false
  12356. *
  12357. * _.isObjectLike(null);
  12358. * // => false
  12359. */
  12360. function isObjectLike(value) {
  12361. return value != null && typeof value == 'object';
  12362. }
  12363. /**
  12364. * Checks if `value` is classified as a `Map` object.
  12365. *
  12366. * @static
  12367. * @memberOf _
  12368. * @since 4.3.0
  12369. * @category Lang
  12370. * @param {*} value The value to check.
  12371. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12372. * @example
  12373. *
  12374. * _.isMap(new Map);
  12375. * // => true
  12376. *
  12377. * _.isMap(new WeakMap);
  12378. * // => false
  12379. */
  12380. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12381. /**
  12382. * Performs a partial deep comparison between `object` and `source` to
  12383. * determine if `object` contains equivalent property values.
  12384. *
  12385. * **Note:** This method is equivalent to `_.matches` when `source` is
  12386. * partially applied.
  12387. *
  12388. * Partial comparisons will match empty array and empty object `source`
  12389. * values against any array or object value, respectively. See `_.isEqual`
  12390. * for a list of supported value comparisons.
  12391. *
  12392. * @static
  12393. * @memberOf _
  12394. * @since 3.0.0
  12395. * @category Lang
  12396. * @param {Object} object The object to inspect.
  12397. * @param {Object} source The object of property values to match.
  12398. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12399. * @example
  12400. *
  12401. * var object = { 'a': 1, 'b': 2 };
  12402. *
  12403. * _.isMatch(object, { 'b': 2 });
  12404. * // => true
  12405. *
  12406. * _.isMatch(object, { 'b': 1 });
  12407. * // => false
  12408. */
  12409. function isMatch(object, source) {
  12410. return object === source || baseIsMatch(object, source, getMatchData(source));
  12411. }
  12412. /**
  12413. * This method is like `_.isMatch` except that it accepts `customizer` which
  12414. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12415. * are handled by the method instead. The `customizer` is invoked with five
  12416. * arguments: (objValue, srcValue, index|key, object, source).
  12417. *
  12418. * @static
  12419. * @memberOf _
  12420. * @since 4.0.0
  12421. * @category Lang
  12422. * @param {Object} object The object to inspect.
  12423. * @param {Object} source The object of property values to match.
  12424. * @param {Function} [customizer] The function to customize comparisons.
  12425. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12426. * @example
  12427. *
  12428. * function isGreeting(value) {
  12429. * return /^h(?:i|ello)$/.test(value);
  12430. * }
  12431. *
  12432. * function customizer(objValue, srcValue) {
  12433. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12434. * return true;
  12435. * }
  12436. * }
  12437. *
  12438. * var object = { 'greeting': 'hello' };
  12439. * var source = { 'greeting': 'hi' };
  12440. *
  12441. * _.isMatchWith(object, source, customizer);
  12442. * // => true
  12443. */
  12444. function isMatchWith(object, source, customizer) {
  12445. customizer = typeof customizer == 'function' ? customizer : undefined;
  12446. return baseIsMatch(object, source, getMatchData(source), customizer);
  12447. }
  12448. /**
  12449. * Checks if `value` is `NaN`.
  12450. *
  12451. * **Note:** This method is based on
  12452. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12453. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12454. * `undefined` and other non-number values.
  12455. *
  12456. * @static
  12457. * @memberOf _
  12458. * @since 0.1.0
  12459. * @category Lang
  12460. * @param {*} value The value to check.
  12461. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12462. * @example
  12463. *
  12464. * _.isNaN(NaN);
  12465. * // => true
  12466. *
  12467. * _.isNaN(new Number(NaN));
  12468. * // => true
  12469. *
  12470. * isNaN(undefined);
  12471. * // => true
  12472. *
  12473. * _.isNaN(undefined);
  12474. * // => false
  12475. */
  12476. function isNaN(value) {
  12477. // An `NaN` primitive is the only value that is not equal to itself.
  12478. // Perform the `toStringTag` check first to avoid errors with some
  12479. // ActiveX objects in IE.
  12480. return isNumber(value) && value != +value;
  12481. }
  12482. /**
  12483. * Checks if `value` is a pristine native function.
  12484. *
  12485. * **Note:** This method can't reliably detect native functions in the presence
  12486. * of the core-js package because core-js circumvents this kind of detection.
  12487. * Despite multiple requests, the core-js maintainer has made it clear: any
  12488. * attempt to fix the detection will be obstructed. As a result, we're left
  12489. * with little choice but to throw an error. Unfortunately, this also affects
  12490. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12491. * which rely on core-js.
  12492. *
  12493. * @static
  12494. * @memberOf _
  12495. * @since 3.0.0
  12496. * @category Lang
  12497. * @param {*} value The value to check.
  12498. * @returns {boolean} Returns `true` if `value` is a native function,
  12499. * else `false`.
  12500. * @example
  12501. *
  12502. * _.isNative(Array.prototype.push);
  12503. * // => true
  12504. *
  12505. * _.isNative(_);
  12506. * // => false
  12507. */
  12508. function isNative(value) {
  12509. if (isMaskable(value)) {
  12510. throw new Error(CORE_ERROR_TEXT);
  12511. }
  12512. return baseIsNative(value);
  12513. }
  12514. /**
  12515. * Checks if `value` is `null`.
  12516. *
  12517. * @static
  12518. * @memberOf _
  12519. * @since 0.1.0
  12520. * @category Lang
  12521. * @param {*} value The value to check.
  12522. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12523. * @example
  12524. *
  12525. * _.isNull(null);
  12526. * // => true
  12527. *
  12528. * _.isNull(void 0);
  12529. * // => false
  12530. */
  12531. function isNull(value) {
  12532. return value === null;
  12533. }
  12534. /**
  12535. * Checks if `value` is `null` or `undefined`.
  12536. *
  12537. * @static
  12538. * @memberOf _
  12539. * @since 4.0.0
  12540. * @category Lang
  12541. * @param {*} value The value to check.
  12542. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12543. * @example
  12544. *
  12545. * _.isNil(null);
  12546. * // => true
  12547. *
  12548. * _.isNil(void 0);
  12549. * // => true
  12550. *
  12551. * _.isNil(NaN);
  12552. * // => false
  12553. */
  12554. function isNil(value) {
  12555. return value == null;
  12556. }
  12557. /**
  12558. * Checks if `value` is classified as a `Number` primitive or object.
  12559. *
  12560. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12561. * classified as numbers, use the `_.isFinite` method.
  12562. *
  12563. * @static
  12564. * @memberOf _
  12565. * @since 0.1.0
  12566. * @category Lang
  12567. * @param {*} value The value to check.
  12568. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12569. * @example
  12570. *
  12571. * _.isNumber(3);
  12572. * // => true
  12573. *
  12574. * _.isNumber(Number.MIN_VALUE);
  12575. * // => true
  12576. *
  12577. * _.isNumber(Infinity);
  12578. * // => true
  12579. *
  12580. * _.isNumber('3');
  12581. * // => false
  12582. */
  12583. function isNumber(value) {
  12584. return typeof value == 'number' ||
  12585. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12586. }
  12587. /**
  12588. * Checks if `value` is a plain object, that is, an object created by the
  12589. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12590. *
  12591. * @static
  12592. * @memberOf _
  12593. * @since 0.8.0
  12594. * @category Lang
  12595. * @param {*} value The value to check.
  12596. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12597. * @example
  12598. *
  12599. * function Foo() {
  12600. * this.a = 1;
  12601. * }
  12602. *
  12603. * _.isPlainObject(new Foo);
  12604. * // => false
  12605. *
  12606. * _.isPlainObject([1, 2, 3]);
  12607. * // => false
  12608. *
  12609. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12610. * // => true
  12611. *
  12612. * _.isPlainObject(Object.create(null));
  12613. * // => true
  12614. */
  12615. function isPlainObject(value) {
  12616. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12617. return false;
  12618. }
  12619. var proto = getPrototype(value);
  12620. if (proto === null) {
  12621. return true;
  12622. }
  12623. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12624. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12625. funcToString.call(Ctor) == objectCtorString;
  12626. }
  12627. /**
  12628. * Checks if `value` is classified as a `RegExp` object.
  12629. *
  12630. * @static
  12631. * @memberOf _
  12632. * @since 0.1.0
  12633. * @category Lang
  12634. * @param {*} value The value to check.
  12635. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12636. * @example
  12637. *
  12638. * _.isRegExp(/abc/);
  12639. * // => true
  12640. *
  12641. * _.isRegExp('/abc/');
  12642. * // => false
  12643. */
  12644. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12645. /**
  12646. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12647. * double precision number which isn't the result of a rounded unsafe integer.
  12648. *
  12649. * **Note:** This method is based on
  12650. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12651. *
  12652. * @static
  12653. * @memberOf _
  12654. * @since 4.0.0
  12655. * @category Lang
  12656. * @param {*} value The value to check.
  12657. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12658. * @example
  12659. *
  12660. * _.isSafeInteger(3);
  12661. * // => true
  12662. *
  12663. * _.isSafeInteger(Number.MIN_VALUE);
  12664. * // => false
  12665. *
  12666. * _.isSafeInteger(Infinity);
  12667. * // => false
  12668. *
  12669. * _.isSafeInteger('3');
  12670. * // => false
  12671. */
  12672. function isSafeInteger(value) {
  12673. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12674. }
  12675. /**
  12676. * Checks if `value` is classified as a `Set` object.
  12677. *
  12678. * @static
  12679. * @memberOf _
  12680. * @since 4.3.0
  12681. * @category Lang
  12682. * @param {*} value The value to check.
  12683. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12684. * @example
  12685. *
  12686. * _.isSet(new Set);
  12687. * // => true
  12688. *
  12689. * _.isSet(new WeakSet);
  12690. * // => false
  12691. */
  12692. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12693. /**
  12694. * Checks if `value` is classified as a `String` primitive or object.
  12695. *
  12696. * @static
  12697. * @since 0.1.0
  12698. * @memberOf _
  12699. * @category Lang
  12700. * @param {*} value The value to check.
  12701. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12702. * @example
  12703. *
  12704. * _.isString('abc');
  12705. * // => true
  12706. *
  12707. * _.isString(1);
  12708. * // => false
  12709. */
  12710. function isString(value) {
  12711. return typeof value == 'string' ||
  12712. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12713. }
  12714. /**
  12715. * Checks if `value` is classified as a `Symbol` primitive or object.
  12716. *
  12717. * @static
  12718. * @memberOf _
  12719. * @since 4.0.0
  12720. * @category Lang
  12721. * @param {*} value The value to check.
  12722. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12723. * @example
  12724. *
  12725. * _.isSymbol(Symbol.iterator);
  12726. * // => true
  12727. *
  12728. * _.isSymbol('abc');
  12729. * // => false
  12730. */
  12731. function isSymbol(value) {
  12732. return typeof value == 'symbol' ||
  12733. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12734. }
  12735. /**
  12736. * Checks if `value` is classified as a typed array.
  12737. *
  12738. * @static
  12739. * @memberOf _
  12740. * @since 3.0.0
  12741. * @category Lang
  12742. * @param {*} value The value to check.
  12743. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12744. * @example
  12745. *
  12746. * _.isTypedArray(new Uint8Array);
  12747. * // => true
  12748. *
  12749. * _.isTypedArray([]);
  12750. * // => false
  12751. */
  12752. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12753. /**
  12754. * Checks if `value` is `undefined`.
  12755. *
  12756. * @static
  12757. * @since 0.1.0
  12758. * @memberOf _
  12759. * @category Lang
  12760. * @param {*} value The value to check.
  12761. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12762. * @example
  12763. *
  12764. * _.isUndefined(void 0);
  12765. * // => true
  12766. *
  12767. * _.isUndefined(null);
  12768. * // => false
  12769. */
  12770. function isUndefined(value) {
  12771. return value === undefined;
  12772. }
  12773. /**
  12774. * Checks if `value` is classified as a `WeakMap` object.
  12775. *
  12776. * @static
  12777. * @memberOf _
  12778. * @since 4.3.0
  12779. * @category Lang
  12780. * @param {*} value The value to check.
  12781. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12782. * @example
  12783. *
  12784. * _.isWeakMap(new WeakMap);
  12785. * // => true
  12786. *
  12787. * _.isWeakMap(new Map);
  12788. * // => false
  12789. */
  12790. function isWeakMap(value) {
  12791. return isObjectLike(value) && getTag(value) == weakMapTag;
  12792. }
  12793. /**
  12794. * Checks if `value` is classified as a `WeakSet` object.
  12795. *
  12796. * @static
  12797. * @memberOf _
  12798. * @since 4.3.0
  12799. * @category Lang
  12800. * @param {*} value The value to check.
  12801. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12802. * @example
  12803. *
  12804. * _.isWeakSet(new WeakSet);
  12805. * // => true
  12806. *
  12807. * _.isWeakSet(new Set);
  12808. * // => false
  12809. */
  12810. function isWeakSet(value) {
  12811. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12812. }
  12813. /**
  12814. * Checks if `value` is less than `other`.
  12815. *
  12816. * @static
  12817. * @memberOf _
  12818. * @since 3.9.0
  12819. * @category Lang
  12820. * @param {*} value The value to compare.
  12821. * @param {*} other The other value to compare.
  12822. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12823. * else `false`.
  12824. * @see _.gt
  12825. * @example
  12826. *
  12827. * _.lt(1, 3);
  12828. * // => true
  12829. *
  12830. * _.lt(3, 3);
  12831. * // => false
  12832. *
  12833. * _.lt(3, 1);
  12834. * // => false
  12835. */
  12836. var lt = createRelationalOperation(baseLt);
  12837. /**
  12838. * Checks if `value` is less than or equal to `other`.
  12839. *
  12840. * @static
  12841. * @memberOf _
  12842. * @since 3.9.0
  12843. * @category Lang
  12844. * @param {*} value The value to compare.
  12845. * @param {*} other The other value to compare.
  12846. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12847. * `other`, else `false`.
  12848. * @see _.gte
  12849. * @example
  12850. *
  12851. * _.lte(1, 3);
  12852. * // => true
  12853. *
  12854. * _.lte(3, 3);
  12855. * // => true
  12856. *
  12857. * _.lte(3, 1);
  12858. * // => false
  12859. */
  12860. var lte = createRelationalOperation(function(value, other) {
  12861. return value <= other;
  12862. });
  12863. /**
  12864. * Converts `value` to an array.
  12865. *
  12866. * @static
  12867. * @since 0.1.0
  12868. * @memberOf _
  12869. * @category Lang
  12870. * @param {*} value The value to convert.
  12871. * @returns {Array} Returns the converted array.
  12872. * @example
  12873. *
  12874. * _.toArray({ 'a': 1, 'b': 2 });
  12875. * // => [1, 2]
  12876. *
  12877. * _.toArray('abc');
  12878. * // => ['a', 'b', 'c']
  12879. *
  12880. * _.toArray(1);
  12881. * // => []
  12882. *
  12883. * _.toArray(null);
  12884. * // => []
  12885. */
  12886. function toArray(value) {
  12887. if (!value) {
  12888. return [];
  12889. }
  12890. if (isArrayLike(value)) {
  12891. return isString(value) ? stringToArray(value) : copyArray(value);
  12892. }
  12893. if (symIterator && value[symIterator]) {
  12894. return iteratorToArray(value[symIterator]());
  12895. }
  12896. var tag = getTag(value),
  12897. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12898. return func(value);
  12899. }
  12900. /**
  12901. * Converts `value` to a finite number.
  12902. *
  12903. * @static
  12904. * @memberOf _
  12905. * @since 4.12.0
  12906. * @category Lang
  12907. * @param {*} value The value to convert.
  12908. * @returns {number} Returns the converted number.
  12909. * @example
  12910. *
  12911. * _.toFinite(3.2);
  12912. * // => 3.2
  12913. *
  12914. * _.toFinite(Number.MIN_VALUE);
  12915. * // => 5e-324
  12916. *
  12917. * _.toFinite(Infinity);
  12918. * // => 1.7976931348623157e+308
  12919. *
  12920. * _.toFinite('3.2');
  12921. * // => 3.2
  12922. */
  12923. function toFinite(value) {
  12924. if (!value) {
  12925. return value === 0 ? value : 0;
  12926. }
  12927. value = toNumber(value);
  12928. if (value === INFINITY || value === -INFINITY) {
  12929. var sign = (value < 0 ? -1 : 1);
  12930. return sign * MAX_INTEGER;
  12931. }
  12932. return value === value ? value : 0;
  12933. }
  12934. /**
  12935. * Converts `value` to an integer.
  12936. *
  12937. * **Note:** This method is loosely based on
  12938. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12939. *
  12940. * @static
  12941. * @memberOf _
  12942. * @since 4.0.0
  12943. * @category Lang
  12944. * @param {*} value The value to convert.
  12945. * @returns {number} Returns the converted integer.
  12946. * @example
  12947. *
  12948. * _.toInteger(3.2);
  12949. * // => 3
  12950. *
  12951. * _.toInteger(Number.MIN_VALUE);
  12952. * // => 0
  12953. *
  12954. * _.toInteger(Infinity);
  12955. * // => 1.7976931348623157e+308
  12956. *
  12957. * _.toInteger('3.2');
  12958. * // => 3
  12959. */
  12960. function toInteger(value) {
  12961. var result = toFinite(value),
  12962. remainder = result % 1;
  12963. return result === result ? (remainder ? result - remainder : result) : 0;
  12964. }
  12965. /**
  12966. * Converts `value` to an integer suitable for use as the length of an
  12967. * array-like object.
  12968. *
  12969. * **Note:** This method is based on
  12970. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12971. *
  12972. * @static
  12973. * @memberOf _
  12974. * @since 4.0.0
  12975. * @category Lang
  12976. * @param {*} value The value to convert.
  12977. * @returns {number} Returns the converted integer.
  12978. * @example
  12979. *
  12980. * _.toLength(3.2);
  12981. * // => 3
  12982. *
  12983. * _.toLength(Number.MIN_VALUE);
  12984. * // => 0
  12985. *
  12986. * _.toLength(Infinity);
  12987. * // => 4294967295
  12988. *
  12989. * _.toLength('3.2');
  12990. * // => 3
  12991. */
  12992. function toLength(value) {
  12993. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12994. }
  12995. /**
  12996. * Converts `value` to a number.
  12997. *
  12998. * @static
  12999. * @memberOf _
  13000. * @since 4.0.0
  13001. * @category Lang
  13002. * @param {*} value The value to process.
  13003. * @returns {number} Returns the number.
  13004. * @example
  13005. *
  13006. * _.toNumber(3.2);
  13007. * // => 3.2
  13008. *
  13009. * _.toNumber(Number.MIN_VALUE);
  13010. * // => 5e-324
  13011. *
  13012. * _.toNumber(Infinity);
  13013. * // => Infinity
  13014. *
  13015. * _.toNumber('3.2');
  13016. * // => 3.2
  13017. */
  13018. function toNumber(value) {
  13019. if (typeof value == 'number') {
  13020. return value;
  13021. }
  13022. if (isSymbol(value)) {
  13023. return NAN;
  13024. }
  13025. if (isObject(value)) {
  13026. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13027. value = isObject(other) ? (other + '') : other;
  13028. }
  13029. if (typeof value != 'string') {
  13030. return value === 0 ? value : +value;
  13031. }
  13032. value = baseTrim(value);
  13033. var isBinary = reIsBinary.test(value);
  13034. return (isBinary || reIsOctal.test(value))
  13035. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13036. : (reIsBadHex.test(value) ? NAN : +value);
  13037. }
  13038. /**
  13039. * Converts `value` to a plain object flattening inherited enumerable string
  13040. * keyed properties of `value` to own properties of the plain object.
  13041. *
  13042. * @static
  13043. * @memberOf _
  13044. * @since 3.0.0
  13045. * @category Lang
  13046. * @param {*} value The value to convert.
  13047. * @returns {Object} Returns the converted plain object.
  13048. * @example
  13049. *
  13050. * function Foo() {
  13051. * this.b = 2;
  13052. * }
  13053. *
  13054. * Foo.prototype.c = 3;
  13055. *
  13056. * _.assign({ 'a': 1 }, new Foo);
  13057. * // => { 'a': 1, 'b': 2 }
  13058. *
  13059. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13060. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13061. */
  13062. function toPlainObject(value) {
  13063. return copyObject(value, keysIn(value));
  13064. }
  13065. /**
  13066. * Converts `value` to a safe integer. A safe integer can be compared and
  13067. * represented correctly.
  13068. *
  13069. * @static
  13070. * @memberOf _
  13071. * @since 4.0.0
  13072. * @category Lang
  13073. * @param {*} value The value to convert.
  13074. * @returns {number} Returns the converted integer.
  13075. * @example
  13076. *
  13077. * _.toSafeInteger(3.2);
  13078. * // => 3
  13079. *
  13080. * _.toSafeInteger(Number.MIN_VALUE);
  13081. * // => 0
  13082. *
  13083. * _.toSafeInteger(Infinity);
  13084. * // => 9007199254740991
  13085. *
  13086. * _.toSafeInteger('3.2');
  13087. * // => 3
  13088. */
  13089. function toSafeInteger(value) {
  13090. return value
  13091. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13092. : (value === 0 ? value : 0);
  13093. }
  13094. /**
  13095. * Converts `value` to a string. An empty string is returned for `null`
  13096. * and `undefined` values. The sign of `-0` is preserved.
  13097. *
  13098. * @static
  13099. * @memberOf _
  13100. * @since 4.0.0
  13101. * @category Lang
  13102. * @param {*} value The value to convert.
  13103. * @returns {string} Returns the converted string.
  13104. * @example
  13105. *
  13106. * _.toString(null);
  13107. * // => ''
  13108. *
  13109. * _.toString(-0);
  13110. * // => '-0'
  13111. *
  13112. * _.toString([1, 2, 3]);
  13113. * // => '1,2,3'
  13114. */
  13115. function toString(value) {
  13116. return value == null ? '' : baseToString(value);
  13117. }
  13118. /*------------------------------------------------------------------------*/
  13119. /**
  13120. * Assigns own enumerable string keyed properties of source objects to the
  13121. * destination object. Source objects are applied from left to right.
  13122. * Subsequent sources overwrite property assignments of previous sources.
  13123. *
  13124. * **Note:** This method mutates `object` and is loosely based on
  13125. * [`Object.assign`](https://mdn.io/Object/assign).
  13126. *
  13127. * @static
  13128. * @memberOf _
  13129. * @since 0.10.0
  13130. * @category Object
  13131. * @param {Object} object The destination object.
  13132. * @param {...Object} [sources] The source objects.
  13133. * @returns {Object} Returns `object`.
  13134. * @see _.assignIn
  13135. * @example
  13136. *
  13137. * function Foo() {
  13138. * this.a = 1;
  13139. * }
  13140. *
  13141. * function Bar() {
  13142. * this.c = 3;
  13143. * }
  13144. *
  13145. * Foo.prototype.b = 2;
  13146. * Bar.prototype.d = 4;
  13147. *
  13148. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13149. * // => { 'a': 1, 'c': 3 }
  13150. */
  13151. var assign = createAssigner(function(object, source) {
  13152. if (isPrototype(source) || isArrayLike(source)) {
  13153. copyObject(source, keys(source), object);
  13154. return;
  13155. }
  13156. for (var key in source) {
  13157. if (hasOwnProperty.call(source, key)) {
  13158. assignValue(object, key, source[key]);
  13159. }
  13160. }
  13161. });
  13162. /**
  13163. * This method is like `_.assign` except that it iterates over own and
  13164. * inherited source properties.
  13165. *
  13166. * **Note:** This method mutates `object`.
  13167. *
  13168. * @static
  13169. * @memberOf _
  13170. * @since 4.0.0
  13171. * @alias extend
  13172. * @category Object
  13173. * @param {Object} object The destination object.
  13174. * @param {...Object} [sources] The source objects.
  13175. * @returns {Object} Returns `object`.
  13176. * @see _.assign
  13177. * @example
  13178. *
  13179. * function Foo() {
  13180. * this.a = 1;
  13181. * }
  13182. *
  13183. * function Bar() {
  13184. * this.c = 3;
  13185. * }
  13186. *
  13187. * Foo.prototype.b = 2;
  13188. * Bar.prototype.d = 4;
  13189. *
  13190. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13191. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13192. */
  13193. var assignIn = createAssigner(function(object, source) {
  13194. copyObject(source, keysIn(source), object);
  13195. });
  13196. /**
  13197. * This method is like `_.assignIn` except that it accepts `customizer`
  13198. * which is invoked to produce the assigned values. If `customizer` returns
  13199. * `undefined`, assignment is handled by the method instead. The `customizer`
  13200. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13201. *
  13202. * **Note:** This method mutates `object`.
  13203. *
  13204. * @static
  13205. * @memberOf _
  13206. * @since 4.0.0
  13207. * @alias extendWith
  13208. * @category Object
  13209. * @param {Object} object The destination object.
  13210. * @param {...Object} sources The source objects.
  13211. * @param {Function} [customizer] The function to customize assigned values.
  13212. * @returns {Object} Returns `object`.
  13213. * @see _.assignWith
  13214. * @example
  13215. *
  13216. * function customizer(objValue, srcValue) {
  13217. * return _.isUndefined(objValue) ? srcValue : objValue;
  13218. * }
  13219. *
  13220. * var defaults = _.partialRight(_.assignInWith, customizer);
  13221. *
  13222. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13223. * // => { 'a': 1, 'b': 2 }
  13224. */
  13225. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13226. copyObject(source, keysIn(source), object, customizer);
  13227. });
  13228. /**
  13229. * This method is like `_.assign` except that it accepts `customizer`
  13230. * which is invoked to produce the assigned values. If `customizer` returns
  13231. * `undefined`, assignment is handled by the method instead. The `customizer`
  13232. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13233. *
  13234. * **Note:** This method mutates `object`.
  13235. *
  13236. * @static
  13237. * @memberOf _
  13238. * @since 4.0.0
  13239. * @category Object
  13240. * @param {Object} object The destination object.
  13241. * @param {...Object} sources The source objects.
  13242. * @param {Function} [customizer] The function to customize assigned values.
  13243. * @returns {Object} Returns `object`.
  13244. * @see _.assignInWith
  13245. * @example
  13246. *
  13247. * function customizer(objValue, srcValue) {
  13248. * return _.isUndefined(objValue) ? srcValue : objValue;
  13249. * }
  13250. *
  13251. * var defaults = _.partialRight(_.assignWith, customizer);
  13252. *
  13253. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13254. * // => { 'a': 1, 'b': 2 }
  13255. */
  13256. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13257. copyObject(source, keys(source), object, customizer);
  13258. });
  13259. /**
  13260. * Creates an array of values corresponding to `paths` of `object`.
  13261. *
  13262. * @static
  13263. * @memberOf _
  13264. * @since 1.0.0
  13265. * @category Object
  13266. * @param {Object} object The object to iterate over.
  13267. * @param {...(string|string[])} [paths] The property paths to pick.
  13268. * @returns {Array} Returns the picked values.
  13269. * @example
  13270. *
  13271. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13272. *
  13273. * _.at(object, ['a[0].b.c', 'a[1]']);
  13274. * // => [3, 4]
  13275. */
  13276. var at = flatRest(baseAt);
  13277. /**
  13278. * Creates an object that inherits from the `prototype` object. If a
  13279. * `properties` object is given, its own enumerable string keyed properties
  13280. * are assigned to the created object.
  13281. *
  13282. * @static
  13283. * @memberOf _
  13284. * @since 2.3.0
  13285. * @category Object
  13286. * @param {Object} prototype The object to inherit from.
  13287. * @param {Object} [properties] The properties to assign to the object.
  13288. * @returns {Object} Returns the new object.
  13289. * @example
  13290. *
  13291. * function Shape() {
  13292. * this.x = 0;
  13293. * this.y = 0;
  13294. * }
  13295. *
  13296. * function Circle() {
  13297. * Shape.call(this);
  13298. * }
  13299. *
  13300. * Circle.prototype = _.create(Shape.prototype, {
  13301. * 'constructor': Circle
  13302. * });
  13303. *
  13304. * var circle = new Circle;
  13305. * circle instanceof Circle;
  13306. * // => true
  13307. *
  13308. * circle instanceof Shape;
  13309. * // => true
  13310. */
  13311. function create(prototype, properties) {
  13312. var result = baseCreate(prototype);
  13313. return properties == null ? result : baseAssign(result, properties);
  13314. }
  13315. /**
  13316. * Assigns own and inherited enumerable string keyed properties of source
  13317. * objects to the destination object for all destination properties that
  13318. * resolve to `undefined`. Source objects are applied from left to right.
  13319. * Once a property is set, additional values of the same property are ignored.
  13320. *
  13321. * **Note:** This method mutates `object`.
  13322. *
  13323. * @static
  13324. * @since 0.1.0
  13325. * @memberOf _
  13326. * @category Object
  13327. * @param {Object} object The destination object.
  13328. * @param {...Object} [sources] The source objects.
  13329. * @returns {Object} Returns `object`.
  13330. * @see _.defaultsDeep
  13331. * @example
  13332. *
  13333. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13334. * // => { 'a': 1, 'b': 2 }
  13335. */
  13336. var defaults = baseRest(function(object, sources) {
  13337. object = Object(object);
  13338. var index = -1;
  13339. var length = sources.length;
  13340. var guard = length > 2 ? sources[2] : undefined;
  13341. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13342. length = 1;
  13343. }
  13344. while (++index < length) {
  13345. var source = sources[index];
  13346. var props = keysIn(source);
  13347. var propsIndex = -1;
  13348. var propsLength = props.length;
  13349. while (++propsIndex < propsLength) {
  13350. var key = props[propsIndex];
  13351. var value = object[key];
  13352. if (value === undefined ||
  13353. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13354. object[key] = source[key];
  13355. }
  13356. }
  13357. }
  13358. return object;
  13359. });
  13360. /**
  13361. * This method is like `_.defaults` except that it recursively assigns
  13362. * default properties.
  13363. *
  13364. * **Note:** This method mutates `object`.
  13365. *
  13366. * @static
  13367. * @memberOf _
  13368. * @since 3.10.0
  13369. * @category Object
  13370. * @param {Object} object The destination object.
  13371. * @param {...Object} [sources] The source objects.
  13372. * @returns {Object} Returns `object`.
  13373. * @see _.defaults
  13374. * @example
  13375. *
  13376. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13377. * // => { 'a': { 'b': 2, 'c': 3 } }
  13378. */
  13379. var defaultsDeep = baseRest(function(args) {
  13380. args.push(undefined, customDefaultsMerge);
  13381. return apply(mergeWith, undefined, args);
  13382. });
  13383. /**
  13384. * This method is like `_.find` except that it returns the key of the first
  13385. * element `predicate` returns truthy for instead of the element itself.
  13386. *
  13387. * @static
  13388. * @memberOf _
  13389. * @since 1.1.0
  13390. * @category Object
  13391. * @param {Object} object The object to inspect.
  13392. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13393. * @returns {string|undefined} Returns the key of the matched element,
  13394. * else `undefined`.
  13395. * @example
  13396. *
  13397. * var users = {
  13398. * 'barney': { 'age': 36, 'active': true },
  13399. * 'fred': { 'age': 40, 'active': false },
  13400. * 'pebbles': { 'age': 1, 'active': true }
  13401. * };
  13402. *
  13403. * _.findKey(users, function(o) { return o.age < 40; });
  13404. * // => 'barney' (iteration order is not guaranteed)
  13405. *
  13406. * // The `_.matches` iteratee shorthand.
  13407. * _.findKey(users, { 'age': 1, 'active': true });
  13408. * // => 'pebbles'
  13409. *
  13410. * // The `_.matchesProperty` iteratee shorthand.
  13411. * _.findKey(users, ['active', false]);
  13412. * // => 'fred'
  13413. *
  13414. * // The `_.property` iteratee shorthand.
  13415. * _.findKey(users, 'active');
  13416. * // => 'barney'
  13417. */
  13418. function findKey(object, predicate) {
  13419. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13420. }
  13421. /**
  13422. * This method is like `_.findKey` except that it iterates over elements of
  13423. * a collection in the opposite order.
  13424. *
  13425. * @static
  13426. * @memberOf _
  13427. * @since 2.0.0
  13428. * @category Object
  13429. * @param {Object} object The object to inspect.
  13430. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13431. * @returns {string|undefined} Returns the key of the matched element,
  13432. * else `undefined`.
  13433. * @example
  13434. *
  13435. * var users = {
  13436. * 'barney': { 'age': 36, 'active': true },
  13437. * 'fred': { 'age': 40, 'active': false },
  13438. * 'pebbles': { 'age': 1, 'active': true }
  13439. * };
  13440. *
  13441. * _.findLastKey(users, function(o) { return o.age < 40; });
  13442. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13443. *
  13444. * // The `_.matches` iteratee shorthand.
  13445. * _.findLastKey(users, { 'age': 36, 'active': true });
  13446. * // => 'barney'
  13447. *
  13448. * // The `_.matchesProperty` iteratee shorthand.
  13449. * _.findLastKey(users, ['active', false]);
  13450. * // => 'fred'
  13451. *
  13452. * // The `_.property` iteratee shorthand.
  13453. * _.findLastKey(users, 'active');
  13454. * // => 'pebbles'
  13455. */
  13456. function findLastKey(object, predicate) {
  13457. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13458. }
  13459. /**
  13460. * Iterates over own and inherited enumerable string keyed properties of an
  13461. * object and invokes `iteratee` for each property. The iteratee is invoked
  13462. * with three arguments: (value, key, object). Iteratee functions may exit
  13463. * iteration early by explicitly returning `false`.
  13464. *
  13465. * @static
  13466. * @memberOf _
  13467. * @since 0.3.0
  13468. * @category Object
  13469. * @param {Object} object The object to iterate over.
  13470. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13471. * @returns {Object} Returns `object`.
  13472. * @see _.forInRight
  13473. * @example
  13474. *
  13475. * function Foo() {
  13476. * this.a = 1;
  13477. * this.b = 2;
  13478. * }
  13479. *
  13480. * Foo.prototype.c = 3;
  13481. *
  13482. * _.forIn(new Foo, function(value, key) {
  13483. * console.log(key);
  13484. * });
  13485. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13486. */
  13487. function forIn(object, iteratee) {
  13488. return object == null
  13489. ? object
  13490. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13491. }
  13492. /**
  13493. * This method is like `_.forIn` except that it iterates over properties of
  13494. * `object` in the opposite order.
  13495. *
  13496. * @static
  13497. * @memberOf _
  13498. * @since 2.0.0
  13499. * @category Object
  13500. * @param {Object} object The object to iterate over.
  13501. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13502. * @returns {Object} Returns `object`.
  13503. * @see _.forIn
  13504. * @example
  13505. *
  13506. * function Foo() {
  13507. * this.a = 1;
  13508. * this.b = 2;
  13509. * }
  13510. *
  13511. * Foo.prototype.c = 3;
  13512. *
  13513. * _.forInRight(new Foo, function(value, key) {
  13514. * console.log(key);
  13515. * });
  13516. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13517. */
  13518. function forInRight(object, iteratee) {
  13519. return object == null
  13520. ? object
  13521. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13522. }
  13523. /**
  13524. * Iterates over own enumerable string keyed properties of an object and
  13525. * invokes `iteratee` for each property. The iteratee is invoked with three
  13526. * arguments: (value, key, object). Iteratee functions may exit iteration
  13527. * early by explicitly returning `false`.
  13528. *
  13529. * @static
  13530. * @memberOf _
  13531. * @since 0.3.0
  13532. * @category Object
  13533. * @param {Object} object The object to iterate over.
  13534. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13535. * @returns {Object} Returns `object`.
  13536. * @see _.forOwnRight
  13537. * @example
  13538. *
  13539. * function Foo() {
  13540. * this.a = 1;
  13541. * this.b = 2;
  13542. * }
  13543. *
  13544. * Foo.prototype.c = 3;
  13545. *
  13546. * _.forOwn(new Foo, function(value, key) {
  13547. * console.log(key);
  13548. * });
  13549. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13550. */
  13551. function forOwn(object, iteratee) {
  13552. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13553. }
  13554. /**
  13555. * This method is like `_.forOwn` except that it iterates over properties of
  13556. * `object` in the opposite order.
  13557. *
  13558. * @static
  13559. * @memberOf _
  13560. * @since 2.0.0
  13561. * @category Object
  13562. * @param {Object} object The object to iterate over.
  13563. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13564. * @returns {Object} Returns `object`.
  13565. * @see _.forOwn
  13566. * @example
  13567. *
  13568. * function Foo() {
  13569. * this.a = 1;
  13570. * this.b = 2;
  13571. * }
  13572. *
  13573. * Foo.prototype.c = 3;
  13574. *
  13575. * _.forOwnRight(new Foo, function(value, key) {
  13576. * console.log(key);
  13577. * });
  13578. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13579. */
  13580. function forOwnRight(object, iteratee) {
  13581. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13582. }
  13583. /**
  13584. * Creates an array of function property names from own enumerable properties
  13585. * of `object`.
  13586. *
  13587. * @static
  13588. * @since 0.1.0
  13589. * @memberOf _
  13590. * @category Object
  13591. * @param {Object} object The object to inspect.
  13592. * @returns {Array} Returns the function names.
  13593. * @see _.functionsIn
  13594. * @example
  13595. *
  13596. * function Foo() {
  13597. * this.a = _.constant('a');
  13598. * this.b = _.constant('b');
  13599. * }
  13600. *
  13601. * Foo.prototype.c = _.constant('c');
  13602. *
  13603. * _.functions(new Foo);
  13604. * // => ['a', 'b']
  13605. */
  13606. function functions(object) {
  13607. return object == null ? [] : baseFunctions(object, keys(object));
  13608. }
  13609. /**
  13610. * Creates an array of function property names from own and inherited
  13611. * enumerable properties of `object`.
  13612. *
  13613. * @static
  13614. * @memberOf _
  13615. * @since 4.0.0
  13616. * @category Object
  13617. * @param {Object} object The object to inspect.
  13618. * @returns {Array} Returns the function names.
  13619. * @see _.functions
  13620. * @example
  13621. *
  13622. * function Foo() {
  13623. * this.a = _.constant('a');
  13624. * this.b = _.constant('b');
  13625. * }
  13626. *
  13627. * Foo.prototype.c = _.constant('c');
  13628. *
  13629. * _.functionsIn(new Foo);
  13630. * // => ['a', 'b', 'c']
  13631. */
  13632. function functionsIn(object) {
  13633. return object == null ? [] : baseFunctions(object, keysIn(object));
  13634. }
  13635. /**
  13636. * Gets the value at `path` of `object`. If the resolved value is
  13637. * `undefined`, the `defaultValue` is returned in its place.
  13638. *
  13639. * @static
  13640. * @memberOf _
  13641. * @since 3.7.0
  13642. * @category Object
  13643. * @param {Object} object The object to query.
  13644. * @param {Array|string} path The path of the property to get.
  13645. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13646. * @returns {*} Returns the resolved value.
  13647. * @example
  13648. *
  13649. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13650. *
  13651. * _.get(object, 'a[0].b.c');
  13652. * // => 3
  13653. *
  13654. * _.get(object, ['a', '0', 'b', 'c']);
  13655. * // => 3
  13656. *
  13657. * _.get(object, 'a.b.c', 'default');
  13658. * // => 'default'
  13659. */
  13660. function get(object, path, defaultValue) {
  13661. var result = object == null ? undefined : baseGet(object, path);
  13662. return result === undefined ? defaultValue : result;
  13663. }
  13664. /**
  13665. * Checks if `path` is a direct property of `object`.
  13666. *
  13667. * @static
  13668. * @since 0.1.0
  13669. * @memberOf _
  13670. * @category Object
  13671. * @param {Object} object The object to query.
  13672. * @param {Array|string} path The path to check.
  13673. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13674. * @example
  13675. *
  13676. * var object = { 'a': { 'b': 2 } };
  13677. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13678. *
  13679. * _.has(object, 'a');
  13680. * // => true
  13681. *
  13682. * _.has(object, 'a.b');
  13683. * // => true
  13684. *
  13685. * _.has(object, ['a', 'b']);
  13686. * // => true
  13687. *
  13688. * _.has(other, 'a');
  13689. * // => false
  13690. */
  13691. function has(object, path) {
  13692. return object != null && hasPath(object, path, baseHas);
  13693. }
  13694. /**
  13695. * Checks if `path` is a direct or inherited property of `object`.
  13696. *
  13697. * @static
  13698. * @memberOf _
  13699. * @since 4.0.0
  13700. * @category Object
  13701. * @param {Object} object The object to query.
  13702. * @param {Array|string} path The path to check.
  13703. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13704. * @example
  13705. *
  13706. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13707. *
  13708. * _.hasIn(object, 'a');
  13709. * // => true
  13710. *
  13711. * _.hasIn(object, 'a.b');
  13712. * // => true
  13713. *
  13714. * _.hasIn(object, ['a', 'b']);
  13715. * // => true
  13716. *
  13717. * _.hasIn(object, 'b');
  13718. * // => false
  13719. */
  13720. function hasIn(object, path) {
  13721. return object != null && hasPath(object, path, baseHasIn);
  13722. }
  13723. /**
  13724. * Creates an object composed of the inverted keys and values of `object`.
  13725. * If `object` contains duplicate values, subsequent values overwrite
  13726. * property assignments of previous values.
  13727. *
  13728. * @static
  13729. * @memberOf _
  13730. * @since 0.7.0
  13731. * @category Object
  13732. * @param {Object} object The object to invert.
  13733. * @returns {Object} Returns the new inverted object.
  13734. * @example
  13735. *
  13736. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13737. *
  13738. * _.invert(object);
  13739. * // => { '1': 'c', '2': 'b' }
  13740. */
  13741. var invert = createInverter(function(result, value, key) {
  13742. if (value != null &&
  13743. typeof value.toString != 'function') {
  13744. value = nativeObjectToString.call(value);
  13745. }
  13746. result[value] = key;
  13747. }, constant(identity));
  13748. /**
  13749. * This method is like `_.invert` except that the inverted object is generated
  13750. * from the results of running each element of `object` thru `iteratee`. The
  13751. * corresponding inverted value of each inverted key is an array of keys
  13752. * responsible for generating the inverted value. The iteratee is invoked
  13753. * with one argument: (value).
  13754. *
  13755. * @static
  13756. * @memberOf _
  13757. * @since 4.1.0
  13758. * @category Object
  13759. * @param {Object} object The object to invert.
  13760. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13761. * @returns {Object} Returns the new inverted object.
  13762. * @example
  13763. *
  13764. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13765. *
  13766. * _.invertBy(object);
  13767. * // => { '1': ['a', 'c'], '2': ['b'] }
  13768. *
  13769. * _.invertBy(object, function(value) {
  13770. * return 'group' + value;
  13771. * });
  13772. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13773. */
  13774. var invertBy = createInverter(function(result, value, key) {
  13775. if (value != null &&
  13776. typeof value.toString != 'function') {
  13777. value = nativeObjectToString.call(value);
  13778. }
  13779. if (hasOwnProperty.call(result, value)) {
  13780. result[value].push(key);
  13781. } else {
  13782. result[value] = [key];
  13783. }
  13784. }, getIteratee);
  13785. /**
  13786. * Invokes the method at `path` of `object`.
  13787. *
  13788. * @static
  13789. * @memberOf _
  13790. * @since 4.0.0
  13791. * @category Object
  13792. * @param {Object} object The object to query.
  13793. * @param {Array|string} path The path of the method to invoke.
  13794. * @param {...*} [args] The arguments to invoke the method with.
  13795. * @returns {*} Returns the result of the invoked method.
  13796. * @example
  13797. *
  13798. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13799. *
  13800. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13801. * // => [2, 3]
  13802. */
  13803. var invoke = baseRest(baseInvoke);
  13804. /**
  13805. * Creates an array of the own enumerable property names of `object`.
  13806. *
  13807. * **Note:** Non-object values are coerced to objects. See the
  13808. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13809. * for more details.
  13810. *
  13811. * @static
  13812. * @since 0.1.0
  13813. * @memberOf _
  13814. * @category Object
  13815. * @param {Object} object The object to query.
  13816. * @returns {Array} Returns the array of property names.
  13817. * @example
  13818. *
  13819. * function Foo() {
  13820. * this.a = 1;
  13821. * this.b = 2;
  13822. * }
  13823. *
  13824. * Foo.prototype.c = 3;
  13825. *
  13826. * _.keys(new Foo);
  13827. * // => ['a', 'b'] (iteration order is not guaranteed)
  13828. *
  13829. * _.keys('hi');
  13830. * // => ['0', '1']
  13831. */
  13832. function keys(object) {
  13833. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13834. }
  13835. /**
  13836. * Creates an array of the own and inherited enumerable property names of `object`.
  13837. *
  13838. * **Note:** Non-object values are coerced to objects.
  13839. *
  13840. * @static
  13841. * @memberOf _
  13842. * @since 3.0.0
  13843. * @category Object
  13844. * @param {Object} object The object to query.
  13845. * @returns {Array} Returns the array of property names.
  13846. * @example
  13847. *
  13848. * function Foo() {
  13849. * this.a = 1;
  13850. * this.b = 2;
  13851. * }
  13852. *
  13853. * Foo.prototype.c = 3;
  13854. *
  13855. * _.keysIn(new Foo);
  13856. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13857. */
  13858. function keysIn(object) {
  13859. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13860. }
  13861. /**
  13862. * The opposite of `_.mapValues`; this method creates an object with the
  13863. * same values as `object` and keys generated by running each own enumerable
  13864. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13865. * with three arguments: (value, key, object).
  13866. *
  13867. * @static
  13868. * @memberOf _
  13869. * @since 3.8.0
  13870. * @category Object
  13871. * @param {Object} object The object to iterate over.
  13872. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13873. * @returns {Object} Returns the new mapped object.
  13874. * @see _.mapValues
  13875. * @example
  13876. *
  13877. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13878. * return key + value;
  13879. * });
  13880. * // => { 'a1': 1, 'b2': 2 }
  13881. */
  13882. function mapKeys(object, iteratee) {
  13883. var result = {};
  13884. iteratee = getIteratee(iteratee, 3);
  13885. baseForOwn(object, function(value, key, object) {
  13886. baseAssignValue(result, iteratee(value, key, object), value);
  13887. });
  13888. return result;
  13889. }
  13890. /**
  13891. * Creates an object with the same keys as `object` and values generated
  13892. * by running each own enumerable string keyed property of `object` thru
  13893. * `iteratee`. The iteratee is invoked with three arguments:
  13894. * (value, key, object).
  13895. *
  13896. * @static
  13897. * @memberOf _
  13898. * @since 2.4.0
  13899. * @category Object
  13900. * @param {Object} object The object to iterate over.
  13901. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13902. * @returns {Object} Returns the new mapped object.
  13903. * @see _.mapKeys
  13904. * @example
  13905. *
  13906. * var users = {
  13907. * 'fred': { 'user': 'fred', 'age': 40 },
  13908. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13909. * };
  13910. *
  13911. * _.mapValues(users, function(o) { return o.age; });
  13912. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13913. *
  13914. * // The `_.property` iteratee shorthand.
  13915. * _.mapValues(users, 'age');
  13916. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13917. */
  13918. function mapValues(object, iteratee) {
  13919. var result = {};
  13920. iteratee = getIteratee(iteratee, 3);
  13921. baseForOwn(object, function(value, key, object) {
  13922. baseAssignValue(result, key, iteratee(value, key, object));
  13923. });
  13924. return result;
  13925. }
  13926. /**
  13927. * This method is like `_.assign` except that it recursively merges own and
  13928. * inherited enumerable string keyed properties of source objects into the
  13929. * destination object. Source properties that resolve to `undefined` are
  13930. * skipped if a destination value exists. Array and plain object properties
  13931. * are merged recursively. Other objects and value types are overridden by
  13932. * assignment. Source objects are applied from left to right. Subsequent
  13933. * sources overwrite property assignments of previous sources.
  13934. *
  13935. * **Note:** This method mutates `object`.
  13936. *
  13937. * @static
  13938. * @memberOf _
  13939. * @since 0.5.0
  13940. * @category Object
  13941. * @param {Object} object The destination object.
  13942. * @param {...Object} [sources] The source objects.
  13943. * @returns {Object} Returns `object`.
  13944. * @example
  13945. *
  13946. * var object = {
  13947. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13948. * };
  13949. *
  13950. * var other = {
  13951. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13952. * };
  13953. *
  13954. * _.merge(object, other);
  13955. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13956. */
  13957. var merge = createAssigner(function(object, source, srcIndex) {
  13958. baseMerge(object, source, srcIndex);
  13959. });
  13960. /**
  13961. * This method is like `_.merge` except that it accepts `customizer` which
  13962. * is invoked to produce the merged values of the destination and source
  13963. * properties. If `customizer` returns `undefined`, merging is handled by the
  13964. * method instead. The `customizer` is invoked with six arguments:
  13965. * (objValue, srcValue, key, object, source, stack).
  13966. *
  13967. * **Note:** This method mutates `object`.
  13968. *
  13969. * @static
  13970. * @memberOf _
  13971. * @since 4.0.0
  13972. * @category Object
  13973. * @param {Object} object The destination object.
  13974. * @param {...Object} sources The source objects.
  13975. * @param {Function} customizer The function to customize assigned values.
  13976. * @returns {Object} Returns `object`.
  13977. * @example
  13978. *
  13979. * function customizer(objValue, srcValue) {
  13980. * if (_.isArray(objValue)) {
  13981. * return objValue.concat(srcValue);
  13982. * }
  13983. * }
  13984. *
  13985. * var object = { 'a': [1], 'b': [2] };
  13986. * var other = { 'a': [3], 'b': [4] };
  13987. *
  13988. * _.mergeWith(object, other, customizer);
  13989. * // => { 'a': [1, 3], 'b': [2, 4] }
  13990. */
  13991. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13992. baseMerge(object, source, srcIndex, customizer);
  13993. });
  13994. /**
  13995. * The opposite of `_.pick`; this method creates an object composed of the
  13996. * own and inherited enumerable property paths of `object` that are not omitted.
  13997. *
  13998. * **Note:** This method is considerably slower than `_.pick`.
  13999. *
  14000. * @static
  14001. * @since 0.1.0
  14002. * @memberOf _
  14003. * @category Object
  14004. * @param {Object} object The source object.
  14005. * @param {...(string|string[])} [paths] The property paths to omit.
  14006. * @returns {Object} Returns the new object.
  14007. * @example
  14008. *
  14009. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14010. *
  14011. * _.omit(object, ['a', 'c']);
  14012. * // => { 'b': '2' }
  14013. */
  14014. var omit = flatRest(function(object, paths) {
  14015. var result = {};
  14016. if (object == null) {
  14017. return result;
  14018. }
  14019. var isDeep = false;
  14020. paths = arrayMap(paths, function(path) {
  14021. path = castPath(path, object);
  14022. isDeep || (isDeep = path.length > 1);
  14023. return path;
  14024. });
  14025. copyObject(object, getAllKeysIn(object), result);
  14026. if (isDeep) {
  14027. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14028. }
  14029. var length = paths.length;
  14030. while (length--) {
  14031. baseUnset(result, paths[length]);
  14032. }
  14033. return result;
  14034. });
  14035. /**
  14036. * The opposite of `_.pickBy`; this method creates an object composed of
  14037. * the own and inherited enumerable string keyed properties of `object` that
  14038. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14039. * arguments: (value, key).
  14040. *
  14041. * @static
  14042. * @memberOf _
  14043. * @since 4.0.0
  14044. * @category Object
  14045. * @param {Object} object The source object.
  14046. * @param {Function} [predicate=_.identity] The function invoked per property.
  14047. * @returns {Object} Returns the new object.
  14048. * @example
  14049. *
  14050. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14051. *
  14052. * _.omitBy(object, _.isNumber);
  14053. * // => { 'b': '2' }
  14054. */
  14055. function omitBy(object, predicate) {
  14056. return pickBy(object, negate(getIteratee(predicate)));
  14057. }
  14058. /**
  14059. * Creates an object composed of the picked `object` properties.
  14060. *
  14061. * @static
  14062. * @since 0.1.0
  14063. * @memberOf _
  14064. * @category Object
  14065. * @param {Object} object The source object.
  14066. * @param {...(string|string[])} [paths] The property paths to pick.
  14067. * @returns {Object} Returns the new object.
  14068. * @example
  14069. *
  14070. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14071. *
  14072. * _.pick(object, ['a', 'c']);
  14073. * // => { 'a': 1, 'c': 3 }
  14074. */
  14075. var pick = flatRest(function(object, paths) {
  14076. return object == null ? {} : basePick(object, paths);
  14077. });
  14078. /**
  14079. * Creates an object composed of the `object` properties `predicate` returns
  14080. * truthy for. The predicate is invoked with two arguments: (value, key).
  14081. *
  14082. * @static
  14083. * @memberOf _
  14084. * @since 4.0.0
  14085. * @category Object
  14086. * @param {Object} object The source object.
  14087. * @param {Function} [predicate=_.identity] The function invoked per property.
  14088. * @returns {Object} Returns the new object.
  14089. * @example
  14090. *
  14091. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14092. *
  14093. * _.pickBy(object, _.isNumber);
  14094. * // => { 'a': 1, 'c': 3 }
  14095. */
  14096. function pickBy(object, predicate) {
  14097. if (object == null) {
  14098. return {};
  14099. }
  14100. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14101. return [prop];
  14102. });
  14103. predicate = getIteratee(predicate);
  14104. return basePickBy(object, props, function(value, path) {
  14105. return predicate(value, path[0]);
  14106. });
  14107. }
  14108. /**
  14109. * This method is like `_.get` except that if the resolved value is a
  14110. * function it's invoked with the `this` binding of its parent object and
  14111. * its result is returned.
  14112. *
  14113. * @static
  14114. * @since 0.1.0
  14115. * @memberOf _
  14116. * @category Object
  14117. * @param {Object} object The object to query.
  14118. * @param {Array|string} path The path of the property to resolve.
  14119. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14120. * @returns {*} Returns the resolved value.
  14121. * @example
  14122. *
  14123. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14124. *
  14125. * _.result(object, 'a[0].b.c1');
  14126. * // => 3
  14127. *
  14128. * _.result(object, 'a[0].b.c2');
  14129. * // => 4
  14130. *
  14131. * _.result(object, 'a[0].b.c3', 'default');
  14132. * // => 'default'
  14133. *
  14134. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14135. * // => 'default'
  14136. */
  14137. function result(object, path, defaultValue) {
  14138. path = castPath(path, object);
  14139. var index = -1,
  14140. length = path.length;
  14141. // Ensure the loop is entered when path is empty.
  14142. if (!length) {
  14143. length = 1;
  14144. object = undefined;
  14145. }
  14146. while (++index < length) {
  14147. var value = object == null ? undefined : object[toKey(path[index])];
  14148. if (value === undefined) {
  14149. index = length;
  14150. value = defaultValue;
  14151. }
  14152. object = isFunction(value) ? value.call(object) : value;
  14153. }
  14154. return object;
  14155. }
  14156. /**
  14157. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14158. * it's created. Arrays are created for missing index properties while objects
  14159. * are created for all other missing properties. Use `_.setWith` to customize
  14160. * `path` creation.
  14161. *
  14162. * **Note:** This method mutates `object`.
  14163. *
  14164. * @static
  14165. * @memberOf _
  14166. * @since 3.7.0
  14167. * @category Object
  14168. * @param {Object} object The object to modify.
  14169. * @param {Array|string} path The path of the property to set.
  14170. * @param {*} value The value to set.
  14171. * @returns {Object} Returns `object`.
  14172. * @example
  14173. *
  14174. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14175. *
  14176. * _.set(object, 'a[0].b.c', 4);
  14177. * console.log(object.a[0].b.c);
  14178. * // => 4
  14179. *
  14180. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14181. * console.log(object.x[0].y.z);
  14182. * // => 5
  14183. */
  14184. function set(object, path, value) {
  14185. return object == null ? object : baseSet(object, path, value);
  14186. }
  14187. /**
  14188. * This method is like `_.set` except that it accepts `customizer` which is
  14189. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14190. * path creation is handled by the method instead. The `customizer` is invoked
  14191. * with three arguments: (nsValue, key, nsObject).
  14192. *
  14193. * **Note:** This method mutates `object`.
  14194. *
  14195. * @static
  14196. * @memberOf _
  14197. * @since 4.0.0
  14198. * @category Object
  14199. * @param {Object} object The object to modify.
  14200. * @param {Array|string} path The path of the property to set.
  14201. * @param {*} value The value to set.
  14202. * @param {Function} [customizer] The function to customize assigned values.
  14203. * @returns {Object} Returns `object`.
  14204. * @example
  14205. *
  14206. * var object = {};
  14207. *
  14208. * _.setWith(object, '[0][1]', 'a', Object);
  14209. * // => { '0': { '1': 'a' } }
  14210. */
  14211. function setWith(object, path, value, customizer) {
  14212. customizer = typeof customizer == 'function' ? customizer : undefined;
  14213. return object == null ? object : baseSet(object, path, value, customizer);
  14214. }
  14215. /**
  14216. * Creates an array of own enumerable string keyed-value pairs for `object`
  14217. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14218. * entries are returned.
  14219. *
  14220. * @static
  14221. * @memberOf _
  14222. * @since 4.0.0
  14223. * @alias entries
  14224. * @category Object
  14225. * @param {Object} object The object to query.
  14226. * @returns {Array} Returns the key-value pairs.
  14227. * @example
  14228. *
  14229. * function Foo() {
  14230. * this.a = 1;
  14231. * this.b = 2;
  14232. * }
  14233. *
  14234. * Foo.prototype.c = 3;
  14235. *
  14236. * _.toPairs(new Foo);
  14237. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14238. */
  14239. var toPairs = createToPairs(keys);
  14240. /**
  14241. * Creates an array of own and inherited enumerable string keyed-value pairs
  14242. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14243. * or set, its entries are returned.
  14244. *
  14245. * @static
  14246. * @memberOf _
  14247. * @since 4.0.0
  14248. * @alias entriesIn
  14249. * @category Object
  14250. * @param {Object} object The object to query.
  14251. * @returns {Array} Returns the key-value pairs.
  14252. * @example
  14253. *
  14254. * function Foo() {
  14255. * this.a = 1;
  14256. * this.b = 2;
  14257. * }
  14258. *
  14259. * Foo.prototype.c = 3;
  14260. *
  14261. * _.toPairsIn(new Foo);
  14262. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14263. */
  14264. var toPairsIn = createToPairs(keysIn);
  14265. /**
  14266. * An alternative to `_.reduce`; this method transforms `object` to a new
  14267. * `accumulator` object which is the result of running each of its own
  14268. * enumerable string keyed properties thru `iteratee`, with each invocation
  14269. * potentially mutating the `accumulator` object. If `accumulator` is not
  14270. * provided, a new object with the same `[[Prototype]]` will be used. The
  14271. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14272. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14273. *
  14274. * @static
  14275. * @memberOf _
  14276. * @since 1.3.0
  14277. * @category Object
  14278. * @param {Object} object The object to iterate over.
  14279. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14280. * @param {*} [accumulator] The custom accumulator value.
  14281. * @returns {*} Returns the accumulated value.
  14282. * @example
  14283. *
  14284. * _.transform([2, 3, 4], function(result, n) {
  14285. * result.push(n *= n);
  14286. * return n % 2 == 0;
  14287. * }, []);
  14288. * // => [4, 9]
  14289. *
  14290. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14291. * (result[value] || (result[value] = [])).push(key);
  14292. * }, {});
  14293. * // => { '1': ['a', 'c'], '2': ['b'] }
  14294. */
  14295. function transform(object, iteratee, accumulator) {
  14296. var isArr = isArray(object),
  14297. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14298. iteratee = getIteratee(iteratee, 4);
  14299. if (accumulator == null) {
  14300. var Ctor = object && object.constructor;
  14301. if (isArrLike) {
  14302. accumulator = isArr ? new Ctor : [];
  14303. }
  14304. else if (isObject(object)) {
  14305. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14306. }
  14307. else {
  14308. accumulator = {};
  14309. }
  14310. }
  14311. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14312. return iteratee(accumulator, value, index, object);
  14313. });
  14314. return accumulator;
  14315. }
  14316. /**
  14317. * Removes the property at `path` of `object`.
  14318. *
  14319. * **Note:** This method mutates `object`.
  14320. *
  14321. * @static
  14322. * @memberOf _
  14323. * @since 4.0.0
  14324. * @category Object
  14325. * @param {Object} object The object to modify.
  14326. * @param {Array|string} path The path of the property to unset.
  14327. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14328. * @example
  14329. *
  14330. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14331. * _.unset(object, 'a[0].b.c');
  14332. * // => true
  14333. *
  14334. * console.log(object);
  14335. * // => { 'a': [{ 'b': {} }] };
  14336. *
  14337. * _.unset(object, ['a', '0', 'b', 'c']);
  14338. * // => true
  14339. *
  14340. * console.log(object);
  14341. * // => { 'a': [{ 'b': {} }] };
  14342. */
  14343. function unset(object, path) {
  14344. return object == null ? true : baseUnset(object, path);
  14345. }
  14346. /**
  14347. * This method is like `_.set` except that accepts `updater` to produce the
  14348. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14349. * is invoked with one argument: (value).
  14350. *
  14351. * **Note:** This method mutates `object`.
  14352. *
  14353. * @static
  14354. * @memberOf _
  14355. * @since 4.6.0
  14356. * @category Object
  14357. * @param {Object} object The object to modify.
  14358. * @param {Array|string} path The path of the property to set.
  14359. * @param {Function} updater The function to produce the updated value.
  14360. * @returns {Object} Returns `object`.
  14361. * @example
  14362. *
  14363. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14364. *
  14365. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14366. * console.log(object.a[0].b.c);
  14367. * // => 9
  14368. *
  14369. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14370. * console.log(object.x[0].y.z);
  14371. * // => 0
  14372. */
  14373. function update(object, path, updater) {
  14374. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14375. }
  14376. /**
  14377. * This method is like `_.update` except that it accepts `customizer` which is
  14378. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14379. * path creation is handled by the method instead. The `customizer` is invoked
  14380. * with three arguments: (nsValue, key, nsObject).
  14381. *
  14382. * **Note:** This method mutates `object`.
  14383. *
  14384. * @static
  14385. * @memberOf _
  14386. * @since 4.6.0
  14387. * @category Object
  14388. * @param {Object} object The object to modify.
  14389. * @param {Array|string} path The path of the property to set.
  14390. * @param {Function} updater The function to produce the updated value.
  14391. * @param {Function} [customizer] The function to customize assigned values.
  14392. * @returns {Object} Returns `object`.
  14393. * @example
  14394. *
  14395. * var object = {};
  14396. *
  14397. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14398. * // => { '0': { '1': 'a' } }
  14399. */
  14400. function updateWith(object, path, updater, customizer) {
  14401. customizer = typeof customizer == 'function' ? customizer : undefined;
  14402. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14403. }
  14404. /**
  14405. * Creates an array of the own enumerable string keyed property values of `object`.
  14406. *
  14407. * **Note:** Non-object values are coerced to objects.
  14408. *
  14409. * @static
  14410. * @since 0.1.0
  14411. * @memberOf _
  14412. * @category Object
  14413. * @param {Object} object The object to query.
  14414. * @returns {Array} Returns the array of property values.
  14415. * @example
  14416. *
  14417. * function Foo() {
  14418. * this.a = 1;
  14419. * this.b = 2;
  14420. * }
  14421. *
  14422. * Foo.prototype.c = 3;
  14423. *
  14424. * _.values(new Foo);
  14425. * // => [1, 2] (iteration order is not guaranteed)
  14426. *
  14427. * _.values('hi');
  14428. * // => ['h', 'i']
  14429. */
  14430. function values(object) {
  14431. return object == null ? [] : baseValues(object, keys(object));
  14432. }
  14433. /**
  14434. * Creates an array of the own and inherited enumerable string keyed property
  14435. * values of `object`.
  14436. *
  14437. * **Note:** Non-object values are coerced to objects.
  14438. *
  14439. * @static
  14440. * @memberOf _
  14441. * @since 3.0.0
  14442. * @category Object
  14443. * @param {Object} object The object to query.
  14444. * @returns {Array} Returns the array of property values.
  14445. * @example
  14446. *
  14447. * function Foo() {
  14448. * this.a = 1;
  14449. * this.b = 2;
  14450. * }
  14451. *
  14452. * Foo.prototype.c = 3;
  14453. *
  14454. * _.valuesIn(new Foo);
  14455. * // => [1, 2, 3] (iteration order is not guaranteed)
  14456. */
  14457. function valuesIn(object) {
  14458. return object == null ? [] : baseValues(object, keysIn(object));
  14459. }
  14460. /*------------------------------------------------------------------------*/
  14461. /**
  14462. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14463. *
  14464. * @static
  14465. * @memberOf _
  14466. * @since 4.0.0
  14467. * @category Number
  14468. * @param {number} number The number to clamp.
  14469. * @param {number} [lower] The lower bound.
  14470. * @param {number} upper The upper bound.
  14471. * @returns {number} Returns the clamped number.
  14472. * @example
  14473. *
  14474. * _.clamp(-10, -5, 5);
  14475. * // => -5
  14476. *
  14477. * _.clamp(10, -5, 5);
  14478. * // => 5
  14479. */
  14480. function clamp(number, lower, upper) {
  14481. if (upper === undefined) {
  14482. upper = lower;
  14483. lower = undefined;
  14484. }
  14485. if (upper !== undefined) {
  14486. upper = toNumber(upper);
  14487. upper = upper === upper ? upper : 0;
  14488. }
  14489. if (lower !== undefined) {
  14490. lower = toNumber(lower);
  14491. lower = lower === lower ? lower : 0;
  14492. }
  14493. return baseClamp(toNumber(number), lower, upper);
  14494. }
  14495. /**
  14496. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14497. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14498. * If `start` is greater than `end` the params are swapped to support
  14499. * negative ranges.
  14500. *
  14501. * @static
  14502. * @memberOf _
  14503. * @since 3.3.0
  14504. * @category Number
  14505. * @param {number} number The number to check.
  14506. * @param {number} [start=0] The start of the range.
  14507. * @param {number} end The end of the range.
  14508. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14509. * @see _.range, _.rangeRight
  14510. * @example
  14511. *
  14512. * _.inRange(3, 2, 4);
  14513. * // => true
  14514. *
  14515. * _.inRange(4, 8);
  14516. * // => true
  14517. *
  14518. * _.inRange(4, 2);
  14519. * // => false
  14520. *
  14521. * _.inRange(2, 2);
  14522. * // => false
  14523. *
  14524. * _.inRange(1.2, 2);
  14525. * // => true
  14526. *
  14527. * _.inRange(5.2, 4);
  14528. * // => false
  14529. *
  14530. * _.inRange(-3, -2, -6);
  14531. * // => true
  14532. */
  14533. function inRange(number, start, end) {
  14534. start = toFinite(start);
  14535. if (end === undefined) {
  14536. end = start;
  14537. start = 0;
  14538. } else {
  14539. end = toFinite(end);
  14540. }
  14541. number = toNumber(number);
  14542. return baseInRange(number, start, end);
  14543. }
  14544. /**
  14545. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14546. * If only one argument is provided a number between `0` and the given number
  14547. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14548. * floats, a floating-point number is returned instead of an integer.
  14549. *
  14550. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14551. * floating-point values which can produce unexpected results.
  14552. *
  14553. * @static
  14554. * @memberOf _
  14555. * @since 0.7.0
  14556. * @category Number
  14557. * @param {number} [lower=0] The lower bound.
  14558. * @param {number} [upper=1] The upper bound.
  14559. * @param {boolean} [floating] Specify returning a floating-point number.
  14560. * @returns {number} Returns the random number.
  14561. * @example
  14562. *
  14563. * _.random(0, 5);
  14564. * // => an integer between 0 and 5
  14565. *
  14566. * _.random(5);
  14567. * // => also an integer between 0 and 5
  14568. *
  14569. * _.random(5, true);
  14570. * // => a floating-point number between 0 and 5
  14571. *
  14572. * _.random(1.2, 5.2);
  14573. * // => a floating-point number between 1.2 and 5.2
  14574. */
  14575. function random(lower, upper, floating) {
  14576. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14577. upper = floating = undefined;
  14578. }
  14579. if (floating === undefined) {
  14580. if (typeof upper == 'boolean') {
  14581. floating = upper;
  14582. upper = undefined;
  14583. }
  14584. else if (typeof lower == 'boolean') {
  14585. floating = lower;
  14586. lower = undefined;
  14587. }
  14588. }
  14589. if (lower === undefined && upper === undefined) {
  14590. lower = 0;
  14591. upper = 1;
  14592. }
  14593. else {
  14594. lower = toFinite(lower);
  14595. if (upper === undefined) {
  14596. upper = lower;
  14597. lower = 0;
  14598. } else {
  14599. upper = toFinite(upper);
  14600. }
  14601. }
  14602. if (lower > upper) {
  14603. var temp = lower;
  14604. lower = upper;
  14605. upper = temp;
  14606. }
  14607. if (floating || lower % 1 || upper % 1) {
  14608. var rand = nativeRandom();
  14609. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14610. }
  14611. return baseRandom(lower, upper);
  14612. }
  14613. /*------------------------------------------------------------------------*/
  14614. /**
  14615. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14616. *
  14617. * @static
  14618. * @memberOf _
  14619. * @since 3.0.0
  14620. * @category String
  14621. * @param {string} [string=''] The string to convert.
  14622. * @returns {string} Returns the camel cased string.
  14623. * @example
  14624. *
  14625. * _.camelCase('Foo Bar');
  14626. * // => 'fooBar'
  14627. *
  14628. * _.camelCase('--foo-bar--');
  14629. * // => 'fooBar'
  14630. *
  14631. * _.camelCase('__FOO_BAR__');
  14632. * // => 'fooBar'
  14633. */
  14634. var camelCase = createCompounder(function(result, word, index) {
  14635. word = word.toLowerCase();
  14636. return result + (index ? capitalize(word) : word);
  14637. });
  14638. /**
  14639. * Converts the first character of `string` to upper case and the remaining
  14640. * to lower case.
  14641. *
  14642. * @static
  14643. * @memberOf _
  14644. * @since 3.0.0
  14645. * @category String
  14646. * @param {string} [string=''] The string to capitalize.
  14647. * @returns {string} Returns the capitalized string.
  14648. * @example
  14649. *
  14650. * _.capitalize('FRED');
  14651. * // => 'Fred'
  14652. */
  14653. function capitalize(string) {
  14654. return upperFirst(toString(string).toLowerCase());
  14655. }
  14656. /**
  14657. * Deburrs `string` by converting
  14658. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14659. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14660. * letters to basic Latin letters and removing
  14661. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14662. *
  14663. * @static
  14664. * @memberOf _
  14665. * @since 3.0.0
  14666. * @category String
  14667. * @param {string} [string=''] The string to deburr.
  14668. * @returns {string} Returns the deburred string.
  14669. * @example
  14670. *
  14671. * _.deburr('déjà vu');
  14672. * // => 'deja vu'
  14673. */
  14674. function deburr(string) {
  14675. string = toString(string);
  14676. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14677. }
  14678. /**
  14679. * Checks if `string` ends with the given target string.
  14680. *
  14681. * @static
  14682. * @memberOf _
  14683. * @since 3.0.0
  14684. * @category String
  14685. * @param {string} [string=''] The string to inspect.
  14686. * @param {string} [target] The string to search for.
  14687. * @param {number} [position=string.length] The position to search up to.
  14688. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14689. * else `false`.
  14690. * @example
  14691. *
  14692. * _.endsWith('abc', 'c');
  14693. * // => true
  14694. *
  14695. * _.endsWith('abc', 'b');
  14696. * // => false
  14697. *
  14698. * _.endsWith('abc', 'b', 2);
  14699. * // => true
  14700. */
  14701. function endsWith(string, target, position) {
  14702. string = toString(string);
  14703. target = baseToString(target);
  14704. var length = string.length;
  14705. position = position === undefined
  14706. ? length
  14707. : baseClamp(toInteger(position), 0, length);
  14708. var end = position;
  14709. position -= target.length;
  14710. return position >= 0 && string.slice(position, end) == target;
  14711. }
  14712. /**
  14713. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14714. * corresponding HTML entities.
  14715. *
  14716. * **Note:** No other characters are escaped. To escape additional
  14717. * characters use a third-party library like [_he_](https://mths.be/he).
  14718. *
  14719. * Though the ">" character is escaped for symmetry, characters like
  14720. * ">" and "/" don't need escaping in HTML and have no special meaning
  14721. * unless they're part of a tag or unquoted attribute value. See
  14722. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14723. * (under "semi-related fun fact") for more details.
  14724. *
  14725. * When working with HTML you should always
  14726. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14727. * XSS vectors.
  14728. *
  14729. * @static
  14730. * @since 0.1.0
  14731. * @memberOf _
  14732. * @category String
  14733. * @param {string} [string=''] The string to escape.
  14734. * @returns {string} Returns the escaped string.
  14735. * @example
  14736. *
  14737. * _.escape('fred, barney, & pebbles');
  14738. * // => 'fred, barney, &amp; pebbles'
  14739. */
  14740. function escape(string) {
  14741. string = toString(string);
  14742. return (string && reHasUnescapedHtml.test(string))
  14743. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14744. : string;
  14745. }
  14746. /**
  14747. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14748. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14749. *
  14750. * @static
  14751. * @memberOf _
  14752. * @since 3.0.0
  14753. * @category String
  14754. * @param {string} [string=''] The string to escape.
  14755. * @returns {string} Returns the escaped string.
  14756. * @example
  14757. *
  14758. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14759. * // => '\[lodash\]\(https://lodash\.com/\)'
  14760. */
  14761. function escapeRegExp(string) {
  14762. string = toString(string);
  14763. return (string && reHasRegExpChar.test(string))
  14764. ? string.replace(reRegExpChar, '\\$&')
  14765. : string;
  14766. }
  14767. /**
  14768. * Converts `string` to
  14769. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14770. *
  14771. * @static
  14772. * @memberOf _
  14773. * @since 3.0.0
  14774. * @category String
  14775. * @param {string} [string=''] The string to convert.
  14776. * @returns {string} Returns the kebab cased string.
  14777. * @example
  14778. *
  14779. * _.kebabCase('Foo Bar');
  14780. * // => 'foo-bar'
  14781. *
  14782. * _.kebabCase('fooBar');
  14783. * // => 'foo-bar'
  14784. *
  14785. * _.kebabCase('__FOO_BAR__');
  14786. * // => 'foo-bar'
  14787. */
  14788. var kebabCase = createCompounder(function(result, word, index) {
  14789. return result + (index ? '-' : '') + word.toLowerCase();
  14790. });
  14791. /**
  14792. * Converts `string`, as space separated words, to lower case.
  14793. *
  14794. * @static
  14795. * @memberOf _
  14796. * @since 4.0.0
  14797. * @category String
  14798. * @param {string} [string=''] The string to convert.
  14799. * @returns {string} Returns the lower cased string.
  14800. * @example
  14801. *
  14802. * _.lowerCase('--Foo-Bar--');
  14803. * // => 'foo bar'
  14804. *
  14805. * _.lowerCase('fooBar');
  14806. * // => 'foo bar'
  14807. *
  14808. * _.lowerCase('__FOO_BAR__');
  14809. * // => 'foo bar'
  14810. */
  14811. var lowerCase = createCompounder(function(result, word, index) {
  14812. return result + (index ? ' ' : '') + word.toLowerCase();
  14813. });
  14814. /**
  14815. * Converts the first character of `string` to lower case.
  14816. *
  14817. * @static
  14818. * @memberOf _
  14819. * @since 4.0.0
  14820. * @category String
  14821. * @param {string} [string=''] The string to convert.
  14822. * @returns {string} Returns the converted string.
  14823. * @example
  14824. *
  14825. * _.lowerFirst('Fred');
  14826. * // => 'fred'
  14827. *
  14828. * _.lowerFirst('FRED');
  14829. * // => 'fRED'
  14830. */
  14831. var lowerFirst = createCaseFirst('toLowerCase');
  14832. /**
  14833. * Pads `string` on the left and right sides if it's shorter than `length`.
  14834. * Padding characters are truncated if they can't be evenly divided by `length`.
  14835. *
  14836. * @static
  14837. * @memberOf _
  14838. * @since 3.0.0
  14839. * @category String
  14840. * @param {string} [string=''] The string to pad.
  14841. * @param {number} [length=0] The padding length.
  14842. * @param {string} [chars=' '] The string used as padding.
  14843. * @returns {string} Returns the padded string.
  14844. * @example
  14845. *
  14846. * _.pad('abc', 8);
  14847. * // => ' abc '
  14848. *
  14849. * _.pad('abc', 8, '_-');
  14850. * // => '_-abc_-_'
  14851. *
  14852. * _.pad('abc', 3);
  14853. * // => 'abc'
  14854. */
  14855. function pad(string, length, chars) {
  14856. string = toString(string);
  14857. length = toInteger(length);
  14858. var strLength = length ? stringSize(string) : 0;
  14859. if (!length || strLength >= length) {
  14860. return string;
  14861. }
  14862. var mid = (length - strLength) / 2;
  14863. return (
  14864. createPadding(nativeFloor(mid), chars) +
  14865. string +
  14866. createPadding(nativeCeil(mid), chars)
  14867. );
  14868. }
  14869. /**
  14870. * Pads `string` on the right side if it's shorter than `length`. Padding
  14871. * characters are truncated if they exceed `length`.
  14872. *
  14873. * @static
  14874. * @memberOf _
  14875. * @since 4.0.0
  14876. * @category String
  14877. * @param {string} [string=''] The string to pad.
  14878. * @param {number} [length=0] The padding length.
  14879. * @param {string} [chars=' '] The string used as padding.
  14880. * @returns {string} Returns the padded string.
  14881. * @example
  14882. *
  14883. * _.padEnd('abc', 6);
  14884. * // => 'abc '
  14885. *
  14886. * _.padEnd('abc', 6, '_-');
  14887. * // => 'abc_-_'
  14888. *
  14889. * _.padEnd('abc', 3);
  14890. * // => 'abc'
  14891. */
  14892. function padEnd(string, length, chars) {
  14893. string = toString(string);
  14894. length = toInteger(length);
  14895. var strLength = length ? stringSize(string) : 0;
  14896. return (length && strLength < length)
  14897. ? (string + createPadding(length - strLength, chars))
  14898. : string;
  14899. }
  14900. /**
  14901. * Pads `string` on the left side if it's shorter than `length`. Padding
  14902. * characters are truncated if they exceed `length`.
  14903. *
  14904. * @static
  14905. * @memberOf _
  14906. * @since 4.0.0
  14907. * @category String
  14908. * @param {string} [string=''] The string to pad.
  14909. * @param {number} [length=0] The padding length.
  14910. * @param {string} [chars=' '] The string used as padding.
  14911. * @returns {string} Returns the padded string.
  14912. * @example
  14913. *
  14914. * _.padStart('abc', 6);
  14915. * // => ' abc'
  14916. *
  14917. * _.padStart('abc', 6, '_-');
  14918. * // => '_-_abc'
  14919. *
  14920. * _.padStart('abc', 3);
  14921. * // => 'abc'
  14922. */
  14923. function padStart(string, length, chars) {
  14924. string = toString(string);
  14925. length = toInteger(length);
  14926. var strLength = length ? stringSize(string) : 0;
  14927. return (length && strLength < length)
  14928. ? (createPadding(length - strLength, chars) + string)
  14929. : string;
  14930. }
  14931. /**
  14932. * Converts `string` to an integer of the specified radix. If `radix` is
  14933. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14934. * hexadecimal, in which case a `radix` of `16` is used.
  14935. *
  14936. * **Note:** This method aligns with the
  14937. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14938. *
  14939. * @static
  14940. * @memberOf _
  14941. * @since 1.1.0
  14942. * @category String
  14943. * @param {string} string The string to convert.
  14944. * @param {number} [radix=10] The radix to interpret `value` by.
  14945. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14946. * @returns {number} Returns the converted integer.
  14947. * @example
  14948. *
  14949. * _.parseInt('08');
  14950. * // => 8
  14951. *
  14952. * _.map(['6', '08', '10'], _.parseInt);
  14953. * // => [6, 8, 10]
  14954. */
  14955. function parseInt(string, radix, guard) {
  14956. if (guard || radix == null) {
  14957. radix = 0;
  14958. } else if (radix) {
  14959. radix = +radix;
  14960. }
  14961. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14962. }
  14963. /**
  14964. * Repeats the given string `n` times.
  14965. *
  14966. * @static
  14967. * @memberOf _
  14968. * @since 3.0.0
  14969. * @category String
  14970. * @param {string} [string=''] The string to repeat.
  14971. * @param {number} [n=1] The number of times to repeat the string.
  14972. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14973. * @returns {string} Returns the repeated string.
  14974. * @example
  14975. *
  14976. * _.repeat('*', 3);
  14977. * // => '***'
  14978. *
  14979. * _.repeat('abc', 2);
  14980. * // => 'abcabc'
  14981. *
  14982. * _.repeat('abc', 0);
  14983. * // => ''
  14984. */
  14985. function repeat(string, n, guard) {
  14986. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14987. n = 1;
  14988. } else {
  14989. n = toInteger(n);
  14990. }
  14991. return baseRepeat(toString(string), n);
  14992. }
  14993. /**
  14994. * Replaces matches for `pattern` in `string` with `replacement`.
  14995. *
  14996. * **Note:** This method is based on
  14997. * [`String#replace`](https://mdn.io/String/replace).
  14998. *
  14999. * @static
  15000. * @memberOf _
  15001. * @since 4.0.0
  15002. * @category String
  15003. * @param {string} [string=''] The string to modify.
  15004. * @param {RegExp|string} pattern The pattern to replace.
  15005. * @param {Function|string} replacement The match replacement.
  15006. * @returns {string} Returns the modified string.
  15007. * @example
  15008. *
  15009. * _.replace('Hi Fred', 'Fred', 'Barney');
  15010. * // => 'Hi Barney'
  15011. */
  15012. function replace() {
  15013. var args = arguments,
  15014. string = toString(args[0]);
  15015. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15016. }
  15017. /**
  15018. * Converts `string` to
  15019. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15020. *
  15021. * @static
  15022. * @memberOf _
  15023. * @since 3.0.0
  15024. * @category String
  15025. * @param {string} [string=''] The string to convert.
  15026. * @returns {string} Returns the snake cased string.
  15027. * @example
  15028. *
  15029. * _.snakeCase('Foo Bar');
  15030. * // => 'foo_bar'
  15031. *
  15032. * _.snakeCase('fooBar');
  15033. * // => 'foo_bar'
  15034. *
  15035. * _.snakeCase('--FOO-BAR--');
  15036. * // => 'foo_bar'
  15037. */
  15038. var snakeCase = createCompounder(function(result, word, index) {
  15039. return result + (index ? '_' : '') + word.toLowerCase();
  15040. });
  15041. /**
  15042. * Splits `string` by `separator`.
  15043. *
  15044. * **Note:** This method is based on
  15045. * [`String#split`](https://mdn.io/String/split).
  15046. *
  15047. * @static
  15048. * @memberOf _
  15049. * @since 4.0.0
  15050. * @category String
  15051. * @param {string} [string=''] The string to split.
  15052. * @param {RegExp|string} separator The separator pattern to split by.
  15053. * @param {number} [limit] The length to truncate results to.
  15054. * @returns {Array} Returns the string segments.
  15055. * @example
  15056. *
  15057. * _.split('a-b-c', '-', 2);
  15058. * // => ['a', 'b']
  15059. */
  15060. function split(string, separator, limit) {
  15061. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15062. separator = limit = undefined;
  15063. }
  15064. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15065. if (!limit) {
  15066. return [];
  15067. }
  15068. string = toString(string);
  15069. if (string && (
  15070. typeof separator == 'string' ||
  15071. (separator != null && !isRegExp(separator))
  15072. )) {
  15073. separator = baseToString(separator);
  15074. if (!separator && hasUnicode(string)) {
  15075. return castSlice(stringToArray(string), 0, limit);
  15076. }
  15077. }
  15078. return string.split(separator, limit);
  15079. }
  15080. /**
  15081. * Converts `string` to
  15082. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15083. *
  15084. * @static
  15085. * @memberOf _
  15086. * @since 3.1.0
  15087. * @category String
  15088. * @param {string} [string=''] The string to convert.
  15089. * @returns {string} Returns the start cased string.
  15090. * @example
  15091. *
  15092. * _.startCase('--foo-bar--');
  15093. * // => 'Foo Bar'
  15094. *
  15095. * _.startCase('fooBar');
  15096. * // => 'Foo Bar'
  15097. *
  15098. * _.startCase('__FOO_BAR__');
  15099. * // => 'FOO BAR'
  15100. */
  15101. var startCase = createCompounder(function(result, word, index) {
  15102. return result + (index ? ' ' : '') + upperFirst(word);
  15103. });
  15104. /**
  15105. * Checks if `string` starts with the given target string.
  15106. *
  15107. * @static
  15108. * @memberOf _
  15109. * @since 3.0.0
  15110. * @category String
  15111. * @param {string} [string=''] The string to inspect.
  15112. * @param {string} [target] The string to search for.
  15113. * @param {number} [position=0] The position to search from.
  15114. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15115. * else `false`.
  15116. * @example
  15117. *
  15118. * _.startsWith('abc', 'a');
  15119. * // => true
  15120. *
  15121. * _.startsWith('abc', 'b');
  15122. * // => false
  15123. *
  15124. * _.startsWith('abc', 'b', 1);
  15125. * // => true
  15126. */
  15127. function startsWith(string, target, position) {
  15128. string = toString(string);
  15129. position = position == null
  15130. ? 0
  15131. : baseClamp(toInteger(position), 0, string.length);
  15132. target = baseToString(target);
  15133. return string.slice(position, position + target.length) == target;
  15134. }
  15135. /**
  15136. * Creates a compiled template function that can interpolate data properties
  15137. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15138. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15139. * properties may be accessed as free variables in the template. If a setting
  15140. * object is given, it takes precedence over `_.templateSettings` values.
  15141. *
  15142. * **Note:** In the development build `_.template` utilizes
  15143. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15144. * for easier debugging.
  15145. *
  15146. * For more information on precompiling templates see
  15147. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15148. *
  15149. * For more information on Chrome extension sandboxes see
  15150. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15151. *
  15152. * @static
  15153. * @since 0.1.0
  15154. * @memberOf _
  15155. * @category String
  15156. * @param {string} [string=''] The template string.
  15157. * @param {Object} [options={}] The options object.
  15158. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15159. * The HTML "escape" delimiter.
  15160. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15161. * The "evaluate" delimiter.
  15162. * @param {Object} [options.imports=_.templateSettings.imports]
  15163. * An object to import into the template as free variables.
  15164. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15165. * The "interpolate" delimiter.
  15166. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15167. * The sourceURL of the compiled template.
  15168. * @param {string} [options.variable='obj']
  15169. * The data object variable name.
  15170. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15171. * @returns {Function} Returns the compiled template function.
  15172. * @example
  15173. *
  15174. * // Use the "interpolate" delimiter to create a compiled template.
  15175. * var compiled = _.template('hello <%= user %>!');
  15176. * compiled({ 'user': 'fred' });
  15177. * // => 'hello fred!'
  15178. *
  15179. * // Use the HTML "escape" delimiter to escape data property values.
  15180. * var compiled = _.template('<b><%- value %></b>');
  15181. * compiled({ 'value': '<script>' });
  15182. * // => '<b>&lt;script&gt;</b>'
  15183. *
  15184. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15185. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15186. * compiled({ 'users': ['fred', 'barney'] });
  15187. * // => '<li>fred</li><li>barney</li>'
  15188. *
  15189. * // Use the internal `print` function in "evaluate" delimiters.
  15190. * var compiled = _.template('<% print("hello " + user); %>!');
  15191. * compiled({ 'user': 'barney' });
  15192. * // => 'hello barney!'
  15193. *
  15194. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15195. * // Disable support by replacing the "interpolate" delimiter.
  15196. * var compiled = _.template('hello ${ user }!');
  15197. * compiled({ 'user': 'pebbles' });
  15198. * // => 'hello pebbles!'
  15199. *
  15200. * // Use backslashes to treat delimiters as plain text.
  15201. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15202. * compiled({ 'value': 'ignored' });
  15203. * // => '<%- value %>'
  15204. *
  15205. * // Use the `imports` option to import `jQuery` as `jq`.
  15206. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15207. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15208. * compiled({ 'users': ['fred', 'barney'] });
  15209. * // => '<li>fred</li><li>barney</li>'
  15210. *
  15211. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15212. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15213. * compiled(data);
  15214. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15215. *
  15216. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15217. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15218. * compiled.source;
  15219. * // => function(data) {
  15220. * // var __t, __p = '';
  15221. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15222. * // return __p;
  15223. * // }
  15224. *
  15225. * // Use custom template delimiters.
  15226. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15227. * var compiled = _.template('hello {{ user }}!');
  15228. * compiled({ 'user': 'mustache' });
  15229. * // => 'hello mustache!'
  15230. *
  15231. * // Use the `source` property to inline compiled templates for meaningful
  15232. * // line numbers in error messages and stack traces.
  15233. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15234. * var JST = {\
  15235. * "main": ' + _.template(mainText).source + '\
  15236. * };\
  15237. * ');
  15238. */
  15239. function template(string, options, guard) {
  15240. // Based on John Resig's `tmpl` implementation
  15241. // (http://ejohn.org/blog/javascript-micro-templating/)
  15242. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15243. var settings = lodash.templateSettings;
  15244. if (guard && isIterateeCall(string, options, guard)) {
  15245. options = undefined;
  15246. }
  15247. string = toString(string);
  15248. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15249. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15250. importsKeys = keys(imports),
  15251. importsValues = baseValues(imports, importsKeys);
  15252. var isEscaping,
  15253. isEvaluating,
  15254. index = 0,
  15255. interpolate = options.interpolate || reNoMatch,
  15256. source = "__p += '";
  15257. // Compile the regexp to match each delimiter.
  15258. var reDelimiters = RegExp(
  15259. (options.escape || reNoMatch).source + '|' +
  15260. interpolate.source + '|' +
  15261. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15262. (options.evaluate || reNoMatch).source + '|$'
  15263. , 'g');
  15264. // Use a sourceURL for easier debugging.
  15265. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15266. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15267. // and escape the comment, thus injecting code that gets evaled.
  15268. var sourceURL = '//# sourceURL=' +
  15269. (hasOwnProperty.call(options, 'sourceURL')
  15270. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15271. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15272. ) + '\n';
  15273. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15274. interpolateValue || (interpolateValue = esTemplateValue);
  15275. // Escape characters that can't be included in string literals.
  15276. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15277. // Replace delimiters with snippets.
  15278. if (escapeValue) {
  15279. isEscaping = true;
  15280. source += "' +\n__e(" + escapeValue + ") +\n'";
  15281. }
  15282. if (evaluateValue) {
  15283. isEvaluating = true;
  15284. source += "';\n" + evaluateValue + ";\n__p += '";
  15285. }
  15286. if (interpolateValue) {
  15287. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15288. }
  15289. index = offset + match.length;
  15290. // The JS engine embedded in Adobe products needs `match` returned in
  15291. // order to produce the correct `offset` value.
  15292. return match;
  15293. });
  15294. source += "';\n";
  15295. // If `variable` is not specified wrap a with-statement around the generated
  15296. // code to add the data object to the top of the scope chain.
  15297. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15298. if (!variable) {
  15299. source = 'with (obj) {\n' + source + '\n}\n';
  15300. }
  15301. // Throw an error if a forbidden character was found in `variable`, to prevent
  15302. // potential command injection attacks.
  15303. else if (reForbiddenIdentifierChars.test(variable)) {
  15304. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15305. }
  15306. // Cleanup code by stripping empty strings.
  15307. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15308. .replace(reEmptyStringMiddle, '$1')
  15309. .replace(reEmptyStringTrailing, '$1;');
  15310. // Frame code as the function body.
  15311. source = 'function(' + (variable || 'obj') + ') {\n' +
  15312. (variable
  15313. ? ''
  15314. : 'obj || (obj = {});\n'
  15315. ) +
  15316. "var __t, __p = ''" +
  15317. (isEscaping
  15318. ? ', __e = _.escape'
  15319. : ''
  15320. ) +
  15321. (isEvaluating
  15322. ? ', __j = Array.prototype.join;\n' +
  15323. "function print() { __p += __j.call(arguments, '') }\n"
  15324. : ';\n'
  15325. ) +
  15326. source +
  15327. 'return __p\n}';
  15328. var result = attempt(function() {
  15329. return Function(importsKeys, sourceURL + 'return ' + source)
  15330. .apply(undefined, importsValues);
  15331. });
  15332. // Provide the compiled function's source by its `toString` method or
  15333. // the `source` property as a convenience for inlining compiled templates.
  15334. result.source = source;
  15335. if (isError(result)) {
  15336. throw result;
  15337. }
  15338. return result;
  15339. }
  15340. /**
  15341. * Converts `string`, as a whole, to lower case just like
  15342. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15343. *
  15344. * @static
  15345. * @memberOf _
  15346. * @since 4.0.0
  15347. * @category String
  15348. * @param {string} [string=''] The string to convert.
  15349. * @returns {string} Returns the lower cased string.
  15350. * @example
  15351. *
  15352. * _.toLower('--Foo-Bar--');
  15353. * // => '--foo-bar--'
  15354. *
  15355. * _.toLower('fooBar');
  15356. * // => 'foobar'
  15357. *
  15358. * _.toLower('__FOO_BAR__');
  15359. * // => '__foo_bar__'
  15360. */
  15361. function toLower(value) {
  15362. return toString(value).toLowerCase();
  15363. }
  15364. /**
  15365. * Converts `string`, as a whole, to upper case just like
  15366. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15367. *
  15368. * @static
  15369. * @memberOf _
  15370. * @since 4.0.0
  15371. * @category String
  15372. * @param {string} [string=''] The string to convert.
  15373. * @returns {string} Returns the upper cased string.
  15374. * @example
  15375. *
  15376. * _.toUpper('--foo-bar--');
  15377. * // => '--FOO-BAR--'
  15378. *
  15379. * _.toUpper('fooBar');
  15380. * // => 'FOOBAR'
  15381. *
  15382. * _.toUpper('__foo_bar__');
  15383. * // => '__FOO_BAR__'
  15384. */
  15385. function toUpper(value) {
  15386. return toString(value).toUpperCase();
  15387. }
  15388. /**
  15389. * Removes leading and trailing whitespace or specified characters from `string`.
  15390. *
  15391. * @static
  15392. * @memberOf _
  15393. * @since 3.0.0
  15394. * @category String
  15395. * @param {string} [string=''] The string to trim.
  15396. * @param {string} [chars=whitespace] The characters to trim.
  15397. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15398. * @returns {string} Returns the trimmed string.
  15399. * @example
  15400. *
  15401. * _.trim(' abc ');
  15402. * // => 'abc'
  15403. *
  15404. * _.trim('-_-abc-_-', '_-');
  15405. * // => 'abc'
  15406. *
  15407. * _.map([' foo ', ' bar '], _.trim);
  15408. * // => ['foo', 'bar']
  15409. */
  15410. function trim(string, chars, guard) {
  15411. string = toString(string);
  15412. if (string && (guard || chars === undefined)) {
  15413. return baseTrim(string);
  15414. }
  15415. if (!string || !(chars = baseToString(chars))) {
  15416. return string;
  15417. }
  15418. var strSymbols = stringToArray(string),
  15419. chrSymbols = stringToArray(chars),
  15420. start = charsStartIndex(strSymbols, chrSymbols),
  15421. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15422. return castSlice(strSymbols, start, end).join('');
  15423. }
  15424. /**
  15425. * Removes trailing whitespace or specified characters from `string`.
  15426. *
  15427. * @static
  15428. * @memberOf _
  15429. * @since 4.0.0
  15430. * @category String
  15431. * @param {string} [string=''] The string to trim.
  15432. * @param {string} [chars=whitespace] The characters to trim.
  15433. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15434. * @returns {string} Returns the trimmed string.
  15435. * @example
  15436. *
  15437. * _.trimEnd(' abc ');
  15438. * // => ' abc'
  15439. *
  15440. * _.trimEnd('-_-abc-_-', '_-');
  15441. * // => '-_-abc'
  15442. */
  15443. function trimEnd(string, chars, guard) {
  15444. string = toString(string);
  15445. if (string && (guard || chars === undefined)) {
  15446. return string.slice(0, trimmedEndIndex(string) + 1);
  15447. }
  15448. if (!string || !(chars = baseToString(chars))) {
  15449. return string;
  15450. }
  15451. var strSymbols = stringToArray(string),
  15452. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15453. return castSlice(strSymbols, 0, end).join('');
  15454. }
  15455. /**
  15456. * Removes leading whitespace or specified characters from `string`.
  15457. *
  15458. * @static
  15459. * @memberOf _
  15460. * @since 4.0.0
  15461. * @category String
  15462. * @param {string} [string=''] The string to trim.
  15463. * @param {string} [chars=whitespace] The characters to trim.
  15464. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15465. * @returns {string} Returns the trimmed string.
  15466. * @example
  15467. *
  15468. * _.trimStart(' abc ');
  15469. * // => 'abc '
  15470. *
  15471. * _.trimStart('-_-abc-_-', '_-');
  15472. * // => 'abc-_-'
  15473. */
  15474. function trimStart(string, chars, guard) {
  15475. string = toString(string);
  15476. if (string && (guard || chars === undefined)) {
  15477. return string.replace(reTrimStart, '');
  15478. }
  15479. if (!string || !(chars = baseToString(chars))) {
  15480. return string;
  15481. }
  15482. var strSymbols = stringToArray(string),
  15483. start = charsStartIndex(strSymbols, stringToArray(chars));
  15484. return castSlice(strSymbols, start).join('');
  15485. }
  15486. /**
  15487. * Truncates `string` if it's longer than the given maximum string length.
  15488. * The last characters of the truncated string are replaced with the omission
  15489. * string which defaults to "...".
  15490. *
  15491. * @static
  15492. * @memberOf _
  15493. * @since 4.0.0
  15494. * @category String
  15495. * @param {string} [string=''] The string to truncate.
  15496. * @param {Object} [options={}] The options object.
  15497. * @param {number} [options.length=30] The maximum string length.
  15498. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15499. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15500. * @returns {string} Returns the truncated string.
  15501. * @example
  15502. *
  15503. * _.truncate('hi-diddly-ho there, neighborino');
  15504. * // => 'hi-diddly-ho there, neighbo...'
  15505. *
  15506. * _.truncate('hi-diddly-ho there, neighborino', {
  15507. * 'length': 24,
  15508. * 'separator': ' '
  15509. * });
  15510. * // => 'hi-diddly-ho there,...'
  15511. *
  15512. * _.truncate('hi-diddly-ho there, neighborino', {
  15513. * 'length': 24,
  15514. * 'separator': /,? +/
  15515. * });
  15516. * // => 'hi-diddly-ho there...'
  15517. *
  15518. * _.truncate('hi-diddly-ho there, neighborino', {
  15519. * 'omission': ' [...]'
  15520. * });
  15521. * // => 'hi-diddly-ho there, neig [...]'
  15522. */
  15523. function truncate(string, options) {
  15524. var length = DEFAULT_TRUNC_LENGTH,
  15525. omission = DEFAULT_TRUNC_OMISSION;
  15526. if (isObject(options)) {
  15527. var separator = 'separator' in options ? options.separator : separator;
  15528. length = 'length' in options ? toInteger(options.length) : length;
  15529. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15530. }
  15531. string = toString(string);
  15532. var strLength = string.length;
  15533. if (hasUnicode(string)) {
  15534. var strSymbols = stringToArray(string);
  15535. strLength = strSymbols.length;
  15536. }
  15537. if (length >= strLength) {
  15538. return string;
  15539. }
  15540. var end = length - stringSize(omission);
  15541. if (end < 1) {
  15542. return omission;
  15543. }
  15544. var result = strSymbols
  15545. ? castSlice(strSymbols, 0, end).join('')
  15546. : string.slice(0, end);
  15547. if (separator === undefined) {
  15548. return result + omission;
  15549. }
  15550. if (strSymbols) {
  15551. end += (result.length - end);
  15552. }
  15553. if (isRegExp(separator)) {
  15554. if (string.slice(end).search(separator)) {
  15555. var match,
  15556. substring = result;
  15557. if (!separator.global) {
  15558. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15559. }
  15560. separator.lastIndex = 0;
  15561. while ((match = separator.exec(substring))) {
  15562. var newEnd = match.index;
  15563. }
  15564. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15565. }
  15566. } else if (string.indexOf(baseToString(separator), end) != end) {
  15567. var index = result.lastIndexOf(separator);
  15568. if (index > -1) {
  15569. result = result.slice(0, index);
  15570. }
  15571. }
  15572. return result + omission;
  15573. }
  15574. /**
  15575. * The inverse of `_.escape`; this method converts the HTML entities
  15576. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15577. * their corresponding characters.
  15578. *
  15579. * **Note:** No other HTML entities are unescaped. To unescape additional
  15580. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15581. *
  15582. * @static
  15583. * @memberOf _
  15584. * @since 0.6.0
  15585. * @category String
  15586. * @param {string} [string=''] The string to unescape.
  15587. * @returns {string} Returns the unescaped string.
  15588. * @example
  15589. *
  15590. * _.unescape('fred, barney, &amp; pebbles');
  15591. * // => 'fred, barney, & pebbles'
  15592. */
  15593. function unescape(string) {
  15594. string = toString(string);
  15595. return (string && reHasEscapedHtml.test(string))
  15596. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15597. : string;
  15598. }
  15599. /**
  15600. * Converts `string`, as space separated words, to upper case.
  15601. *
  15602. * @static
  15603. * @memberOf _
  15604. * @since 4.0.0
  15605. * @category String
  15606. * @param {string} [string=''] The string to convert.
  15607. * @returns {string} Returns the upper cased string.
  15608. * @example
  15609. *
  15610. * _.upperCase('--foo-bar');
  15611. * // => 'FOO BAR'
  15612. *
  15613. * _.upperCase('fooBar');
  15614. * // => 'FOO BAR'
  15615. *
  15616. * _.upperCase('__foo_bar__');
  15617. * // => 'FOO BAR'
  15618. */
  15619. var upperCase = createCompounder(function(result, word, index) {
  15620. return result + (index ? ' ' : '') + word.toUpperCase();
  15621. });
  15622. /**
  15623. * Converts the first character of `string` to upper case.
  15624. *
  15625. * @static
  15626. * @memberOf _
  15627. * @since 4.0.0
  15628. * @category String
  15629. * @param {string} [string=''] The string to convert.
  15630. * @returns {string} Returns the converted string.
  15631. * @example
  15632. *
  15633. * _.upperFirst('fred');
  15634. * // => 'Fred'
  15635. *
  15636. * _.upperFirst('FRED');
  15637. * // => 'FRED'
  15638. */
  15639. var upperFirst = createCaseFirst('toUpperCase');
  15640. /**
  15641. * Splits `string` into an array of its words.
  15642. *
  15643. * @static
  15644. * @memberOf _
  15645. * @since 3.0.0
  15646. * @category String
  15647. * @param {string} [string=''] The string to inspect.
  15648. * @param {RegExp|string} [pattern] The pattern to match words.
  15649. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15650. * @returns {Array} Returns the words of `string`.
  15651. * @example
  15652. *
  15653. * _.words('fred, barney, & pebbles');
  15654. * // => ['fred', 'barney', 'pebbles']
  15655. *
  15656. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15657. * // => ['fred', 'barney', '&', 'pebbles']
  15658. */
  15659. function words(string, pattern, guard) {
  15660. string = toString(string);
  15661. pattern = guard ? undefined : pattern;
  15662. if (pattern === undefined) {
  15663. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15664. }
  15665. return string.match(pattern) || [];
  15666. }
  15667. /*------------------------------------------------------------------------*/
  15668. /**
  15669. * Attempts to invoke `func`, returning either the result or the caught error
  15670. * object. Any additional arguments are provided to `func` when it's invoked.
  15671. *
  15672. * @static
  15673. * @memberOf _
  15674. * @since 3.0.0
  15675. * @category Util
  15676. * @param {Function} func The function to attempt.
  15677. * @param {...*} [args] The arguments to invoke `func` with.
  15678. * @returns {*} Returns the `func` result or error object.
  15679. * @example
  15680. *
  15681. * // Avoid throwing errors for invalid selectors.
  15682. * var elements = _.attempt(function(selector) {
  15683. * return document.querySelectorAll(selector);
  15684. * }, '>_>');
  15685. *
  15686. * if (_.isError(elements)) {
  15687. * elements = [];
  15688. * }
  15689. */
  15690. var attempt = baseRest(function(func, args) {
  15691. try {
  15692. return apply(func, undefined, args);
  15693. } catch (e) {
  15694. return isError(e) ? e : new Error(e);
  15695. }
  15696. });
  15697. /**
  15698. * Binds methods of an object to the object itself, overwriting the existing
  15699. * method.
  15700. *
  15701. * **Note:** This method doesn't set the "length" property of bound functions.
  15702. *
  15703. * @static
  15704. * @since 0.1.0
  15705. * @memberOf _
  15706. * @category Util
  15707. * @param {Object} object The object to bind and assign the bound methods to.
  15708. * @param {...(string|string[])} methodNames The object method names to bind.
  15709. * @returns {Object} Returns `object`.
  15710. * @example
  15711. *
  15712. * var view = {
  15713. * 'label': 'docs',
  15714. * 'click': function() {
  15715. * console.log('clicked ' + this.label);
  15716. * }
  15717. * };
  15718. *
  15719. * _.bindAll(view, ['click']);
  15720. * jQuery(element).on('click', view.click);
  15721. * // => Logs 'clicked docs' when clicked.
  15722. */
  15723. var bindAll = flatRest(function(object, methodNames) {
  15724. arrayEach(methodNames, function(key) {
  15725. key = toKey(key);
  15726. baseAssignValue(object, key, bind(object[key], object));
  15727. });
  15728. return object;
  15729. });
  15730. /**
  15731. * Creates a function that iterates over `pairs` and invokes the corresponding
  15732. * function of the first predicate to return truthy. The predicate-function
  15733. * pairs are invoked with the `this` binding and arguments of the created
  15734. * function.
  15735. *
  15736. * @static
  15737. * @memberOf _
  15738. * @since 4.0.0
  15739. * @category Util
  15740. * @param {Array} pairs The predicate-function pairs.
  15741. * @returns {Function} Returns the new composite function.
  15742. * @example
  15743. *
  15744. * var func = _.cond([
  15745. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15746. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15747. * [_.stubTrue, _.constant('no match')]
  15748. * ]);
  15749. *
  15750. * func({ 'a': 1, 'b': 2 });
  15751. * // => 'matches A'
  15752. *
  15753. * func({ 'a': 0, 'b': 1 });
  15754. * // => 'matches B'
  15755. *
  15756. * func({ 'a': '1', 'b': '2' });
  15757. * // => 'no match'
  15758. */
  15759. function cond(pairs) {
  15760. var length = pairs == null ? 0 : pairs.length,
  15761. toIteratee = getIteratee();
  15762. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15763. if (typeof pair[1] != 'function') {
  15764. throw new TypeError(FUNC_ERROR_TEXT);
  15765. }
  15766. return [toIteratee(pair[0]), pair[1]];
  15767. });
  15768. return baseRest(function(args) {
  15769. var index = -1;
  15770. while (++index < length) {
  15771. var pair = pairs[index];
  15772. if (apply(pair[0], this, args)) {
  15773. return apply(pair[1], this, args);
  15774. }
  15775. }
  15776. });
  15777. }
  15778. /**
  15779. * Creates a function that invokes the predicate properties of `source` with
  15780. * the corresponding property values of a given object, returning `true` if
  15781. * all predicates return truthy, else `false`.
  15782. *
  15783. * **Note:** The created function is equivalent to `_.conformsTo` with
  15784. * `source` partially applied.
  15785. *
  15786. * @static
  15787. * @memberOf _
  15788. * @since 4.0.0
  15789. * @category Util
  15790. * @param {Object} source The object of property predicates to conform to.
  15791. * @returns {Function} Returns the new spec function.
  15792. * @example
  15793. *
  15794. * var objects = [
  15795. * { 'a': 2, 'b': 1 },
  15796. * { 'a': 1, 'b': 2 }
  15797. * ];
  15798. *
  15799. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15800. * // => [{ 'a': 1, 'b': 2 }]
  15801. */
  15802. function conforms(source) {
  15803. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15804. }
  15805. /**
  15806. * Creates a function that returns `value`.
  15807. *
  15808. * @static
  15809. * @memberOf _
  15810. * @since 2.4.0
  15811. * @category Util
  15812. * @param {*} value The value to return from the new function.
  15813. * @returns {Function} Returns the new constant function.
  15814. * @example
  15815. *
  15816. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15817. *
  15818. * console.log(objects);
  15819. * // => [{ 'a': 1 }, { 'a': 1 }]
  15820. *
  15821. * console.log(objects[0] === objects[1]);
  15822. * // => true
  15823. */
  15824. function constant(value) {
  15825. return function() {
  15826. return value;
  15827. };
  15828. }
  15829. /**
  15830. * Checks `value` to determine whether a default value should be returned in
  15831. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15832. * or `undefined`.
  15833. *
  15834. * @static
  15835. * @memberOf _
  15836. * @since 4.14.0
  15837. * @category Util
  15838. * @param {*} value The value to check.
  15839. * @param {*} defaultValue The default value.
  15840. * @returns {*} Returns the resolved value.
  15841. * @example
  15842. *
  15843. * _.defaultTo(1, 10);
  15844. * // => 1
  15845. *
  15846. * _.defaultTo(undefined, 10);
  15847. * // => 10
  15848. */
  15849. function defaultTo(value, defaultValue) {
  15850. return (value == null || value !== value) ? defaultValue : value;
  15851. }
  15852. /**
  15853. * Creates a function that returns the result of invoking the given functions
  15854. * with the `this` binding of the created function, where each successive
  15855. * invocation is supplied the return value of the previous.
  15856. *
  15857. * @static
  15858. * @memberOf _
  15859. * @since 3.0.0
  15860. * @category Util
  15861. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15862. * @returns {Function} Returns the new composite function.
  15863. * @see _.flowRight
  15864. * @example
  15865. *
  15866. * function square(n) {
  15867. * return n * n;
  15868. * }
  15869. *
  15870. * var addSquare = _.flow([_.add, square]);
  15871. * addSquare(1, 2);
  15872. * // => 9
  15873. */
  15874. var flow = createFlow();
  15875. /**
  15876. * This method is like `_.flow` except that it creates a function that
  15877. * invokes the given functions from right to left.
  15878. *
  15879. * @static
  15880. * @since 3.0.0
  15881. * @memberOf _
  15882. * @category Util
  15883. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15884. * @returns {Function} Returns the new composite function.
  15885. * @see _.flow
  15886. * @example
  15887. *
  15888. * function square(n) {
  15889. * return n * n;
  15890. * }
  15891. *
  15892. * var addSquare = _.flowRight([square, _.add]);
  15893. * addSquare(1, 2);
  15894. * // => 9
  15895. */
  15896. var flowRight = createFlow(true);
  15897. /**
  15898. * This method returns the first argument it receives.
  15899. *
  15900. * @static
  15901. * @since 0.1.0
  15902. * @memberOf _
  15903. * @category Util
  15904. * @param {*} value Any value.
  15905. * @returns {*} Returns `value`.
  15906. * @example
  15907. *
  15908. * var object = { 'a': 1 };
  15909. *
  15910. * console.log(_.identity(object) === object);
  15911. * // => true
  15912. */
  15913. function identity(value) {
  15914. return value;
  15915. }
  15916. /**
  15917. * Creates a function that invokes `func` with the arguments of the created
  15918. * function. If `func` is a property name, the created function returns the
  15919. * property value for a given element. If `func` is an array or object, the
  15920. * created function returns `true` for elements that contain the equivalent
  15921. * source properties, otherwise it returns `false`.
  15922. *
  15923. * @static
  15924. * @since 4.0.0
  15925. * @memberOf _
  15926. * @category Util
  15927. * @param {*} [func=_.identity] The value to convert to a callback.
  15928. * @returns {Function} Returns the callback.
  15929. * @example
  15930. *
  15931. * var users = [
  15932. * { 'user': 'barney', 'age': 36, 'active': true },
  15933. * { 'user': 'fred', 'age': 40, 'active': false }
  15934. * ];
  15935. *
  15936. * // The `_.matches` iteratee shorthand.
  15937. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15938. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15939. *
  15940. * // The `_.matchesProperty` iteratee shorthand.
  15941. * _.filter(users, _.iteratee(['user', 'fred']));
  15942. * // => [{ 'user': 'fred', 'age': 40 }]
  15943. *
  15944. * // The `_.property` iteratee shorthand.
  15945. * _.map(users, _.iteratee('user'));
  15946. * // => ['barney', 'fred']
  15947. *
  15948. * // Create custom iteratee shorthands.
  15949. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15950. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15951. * return func.test(string);
  15952. * };
  15953. * });
  15954. *
  15955. * _.filter(['abc', 'def'], /ef/);
  15956. * // => ['def']
  15957. */
  15958. function iteratee(func) {
  15959. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15960. }
  15961. /**
  15962. * Creates a function that performs a partial deep comparison between a given
  15963. * object and `source`, returning `true` if the given object has equivalent
  15964. * property values, else `false`.
  15965. *
  15966. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15967. * partially applied.
  15968. *
  15969. * Partial comparisons will match empty array and empty object `source`
  15970. * values against any array or object value, respectively. See `_.isEqual`
  15971. * for a list of supported value comparisons.
  15972. *
  15973. * **Note:** Multiple values can be checked by combining several matchers
  15974. * using `_.overSome`
  15975. *
  15976. * @static
  15977. * @memberOf _
  15978. * @since 3.0.0
  15979. * @category Util
  15980. * @param {Object} source The object of property values to match.
  15981. * @returns {Function} Returns the new spec function.
  15982. * @example
  15983. *
  15984. * var objects = [
  15985. * { 'a': 1, 'b': 2, 'c': 3 },
  15986. * { 'a': 4, 'b': 5, 'c': 6 }
  15987. * ];
  15988. *
  15989. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15990. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15991. *
  15992. * // Checking for several possible values
  15993. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15994. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15995. */
  15996. function matches(source) {
  15997. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15998. }
  15999. /**
  16000. * Creates a function that performs a partial deep comparison between the
  16001. * value at `path` of a given object to `srcValue`, returning `true` if the
  16002. * object value is equivalent, else `false`.
  16003. *
  16004. * **Note:** Partial comparisons will match empty array and empty object
  16005. * `srcValue` values against any array or object value, respectively. See
  16006. * `_.isEqual` for a list of supported value comparisons.
  16007. *
  16008. * **Note:** Multiple values can be checked by combining several matchers
  16009. * using `_.overSome`
  16010. *
  16011. * @static
  16012. * @memberOf _
  16013. * @since 3.2.0
  16014. * @category Util
  16015. * @param {Array|string} path The path of the property to get.
  16016. * @param {*} srcValue The value to match.
  16017. * @returns {Function} Returns the new spec function.
  16018. * @example
  16019. *
  16020. * var objects = [
  16021. * { 'a': 1, 'b': 2, 'c': 3 },
  16022. * { 'a': 4, 'b': 5, 'c': 6 }
  16023. * ];
  16024. *
  16025. * _.find(objects, _.matchesProperty('a', 4));
  16026. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16027. *
  16028. * // Checking for several possible values
  16029. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16030. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16031. */
  16032. function matchesProperty(path, srcValue) {
  16033. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16034. }
  16035. /**
  16036. * Creates a function that invokes the method at `path` of a given object.
  16037. * Any additional arguments are provided to the invoked method.
  16038. *
  16039. * @static
  16040. * @memberOf _
  16041. * @since 3.7.0
  16042. * @category Util
  16043. * @param {Array|string} path The path of the method to invoke.
  16044. * @param {...*} [args] The arguments to invoke the method with.
  16045. * @returns {Function} Returns the new invoker function.
  16046. * @example
  16047. *
  16048. * var objects = [
  16049. * { 'a': { 'b': _.constant(2) } },
  16050. * { 'a': { 'b': _.constant(1) } }
  16051. * ];
  16052. *
  16053. * _.map(objects, _.method('a.b'));
  16054. * // => [2, 1]
  16055. *
  16056. * _.map(objects, _.method(['a', 'b']));
  16057. * // => [2, 1]
  16058. */
  16059. var method = baseRest(function(path, args) {
  16060. return function(object) {
  16061. return baseInvoke(object, path, args);
  16062. };
  16063. });
  16064. /**
  16065. * The opposite of `_.method`; this method creates a function that invokes
  16066. * the method at a given path of `object`. Any additional arguments are
  16067. * provided to the invoked method.
  16068. *
  16069. * @static
  16070. * @memberOf _
  16071. * @since 3.7.0
  16072. * @category Util
  16073. * @param {Object} object The object to query.
  16074. * @param {...*} [args] The arguments to invoke the method with.
  16075. * @returns {Function} Returns the new invoker function.
  16076. * @example
  16077. *
  16078. * var array = _.times(3, _.constant),
  16079. * object = { 'a': array, 'b': array, 'c': array };
  16080. *
  16081. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16082. * // => [2, 0]
  16083. *
  16084. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16085. * // => [2, 0]
  16086. */
  16087. var methodOf = baseRest(function(object, args) {
  16088. return function(path) {
  16089. return baseInvoke(object, path, args);
  16090. };
  16091. });
  16092. /**
  16093. * Adds all own enumerable string keyed function properties of a source
  16094. * object to the destination object. If `object` is a function, then methods
  16095. * are added to its prototype as well.
  16096. *
  16097. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16098. * avoid conflicts caused by modifying the original.
  16099. *
  16100. * @static
  16101. * @since 0.1.0
  16102. * @memberOf _
  16103. * @category Util
  16104. * @param {Function|Object} [object=lodash] The destination object.
  16105. * @param {Object} source The object of functions to add.
  16106. * @param {Object} [options={}] The options object.
  16107. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16108. * @returns {Function|Object} Returns `object`.
  16109. * @example
  16110. *
  16111. * function vowels(string) {
  16112. * return _.filter(string, function(v) {
  16113. * return /[aeiou]/i.test(v);
  16114. * });
  16115. * }
  16116. *
  16117. * _.mixin({ 'vowels': vowels });
  16118. * _.vowels('fred');
  16119. * // => ['e']
  16120. *
  16121. * _('fred').vowels().value();
  16122. * // => ['e']
  16123. *
  16124. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16125. * _('fred').vowels();
  16126. * // => ['e']
  16127. */
  16128. function mixin(object, source, options) {
  16129. var props = keys(source),
  16130. methodNames = baseFunctions(source, props);
  16131. if (options == null &&
  16132. !(isObject(source) && (methodNames.length || !props.length))) {
  16133. options = source;
  16134. source = object;
  16135. object = this;
  16136. methodNames = baseFunctions(source, keys(source));
  16137. }
  16138. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16139. isFunc = isFunction(object);
  16140. arrayEach(methodNames, function(methodName) {
  16141. var func = source[methodName];
  16142. object[methodName] = func;
  16143. if (isFunc) {
  16144. object.prototype[methodName] = function() {
  16145. var chainAll = this.__chain__;
  16146. if (chain || chainAll) {
  16147. var result = object(this.__wrapped__),
  16148. actions = result.__actions__ = copyArray(this.__actions__);
  16149. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16150. result.__chain__ = chainAll;
  16151. return result;
  16152. }
  16153. return func.apply(object, arrayPush([this.value()], arguments));
  16154. };
  16155. }
  16156. });
  16157. return object;
  16158. }
  16159. /**
  16160. * Reverts the `_` variable to its previous value and returns a reference to
  16161. * the `lodash` function.
  16162. *
  16163. * @static
  16164. * @since 0.1.0
  16165. * @memberOf _
  16166. * @category Util
  16167. * @returns {Function} Returns the `lodash` function.
  16168. * @example
  16169. *
  16170. * var lodash = _.noConflict();
  16171. */
  16172. function noConflict() {
  16173. if (root._ === this) {
  16174. root._ = oldDash;
  16175. }
  16176. return this;
  16177. }
  16178. /**
  16179. * This method returns `undefined`.
  16180. *
  16181. * @static
  16182. * @memberOf _
  16183. * @since 2.3.0
  16184. * @category Util
  16185. * @example
  16186. *
  16187. * _.times(2, _.noop);
  16188. * // => [undefined, undefined]
  16189. */
  16190. function noop() {
  16191. // No operation performed.
  16192. }
  16193. /**
  16194. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16195. * the nth argument from the end is returned.
  16196. *
  16197. * @static
  16198. * @memberOf _
  16199. * @since 4.0.0
  16200. * @category Util
  16201. * @param {number} [n=0] The index of the argument to return.
  16202. * @returns {Function} Returns the new pass-thru function.
  16203. * @example
  16204. *
  16205. * var func = _.nthArg(1);
  16206. * func('a', 'b', 'c', 'd');
  16207. * // => 'b'
  16208. *
  16209. * var func = _.nthArg(-2);
  16210. * func('a', 'b', 'c', 'd');
  16211. * // => 'c'
  16212. */
  16213. function nthArg(n) {
  16214. n = toInteger(n);
  16215. return baseRest(function(args) {
  16216. return baseNth(args, n);
  16217. });
  16218. }
  16219. /**
  16220. * Creates a function that invokes `iteratees` with the arguments it receives
  16221. * and returns their results.
  16222. *
  16223. * @static
  16224. * @memberOf _
  16225. * @since 4.0.0
  16226. * @category Util
  16227. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16228. * The iteratees to invoke.
  16229. * @returns {Function} Returns the new function.
  16230. * @example
  16231. *
  16232. * var func = _.over([Math.max, Math.min]);
  16233. *
  16234. * func(1, 2, 3, 4);
  16235. * // => [4, 1]
  16236. */
  16237. var over = createOver(arrayMap);
  16238. /**
  16239. * Creates a function that checks if **all** of the `predicates` return
  16240. * truthy when invoked with the arguments it receives.
  16241. *
  16242. * Following shorthands are possible for providing predicates.
  16243. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16244. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16245. *
  16246. * @static
  16247. * @memberOf _
  16248. * @since 4.0.0
  16249. * @category Util
  16250. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16251. * The predicates to check.
  16252. * @returns {Function} Returns the new function.
  16253. * @example
  16254. *
  16255. * var func = _.overEvery([Boolean, isFinite]);
  16256. *
  16257. * func('1');
  16258. * // => true
  16259. *
  16260. * func(null);
  16261. * // => false
  16262. *
  16263. * func(NaN);
  16264. * // => false
  16265. */
  16266. var overEvery = createOver(arrayEvery);
  16267. /**
  16268. * Creates a function that checks if **any** of the `predicates` return
  16269. * truthy when invoked with the arguments it receives.
  16270. *
  16271. * Following shorthands are possible for providing predicates.
  16272. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16273. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16274. *
  16275. * @static
  16276. * @memberOf _
  16277. * @since 4.0.0
  16278. * @category Util
  16279. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16280. * The predicates to check.
  16281. * @returns {Function} Returns the new function.
  16282. * @example
  16283. *
  16284. * var func = _.overSome([Boolean, isFinite]);
  16285. *
  16286. * func('1');
  16287. * // => true
  16288. *
  16289. * func(null);
  16290. * // => true
  16291. *
  16292. * func(NaN);
  16293. * // => false
  16294. *
  16295. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16296. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16297. */
  16298. var overSome = createOver(arraySome);
  16299. /**
  16300. * Creates a function that returns the value at `path` of a given object.
  16301. *
  16302. * @static
  16303. * @memberOf _
  16304. * @since 2.4.0
  16305. * @category Util
  16306. * @param {Array|string} path The path of the property to get.
  16307. * @returns {Function} Returns the new accessor function.
  16308. * @example
  16309. *
  16310. * var objects = [
  16311. * { 'a': { 'b': 2 } },
  16312. * { 'a': { 'b': 1 } }
  16313. * ];
  16314. *
  16315. * _.map(objects, _.property('a.b'));
  16316. * // => [2, 1]
  16317. *
  16318. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16319. * // => [1, 2]
  16320. */
  16321. function property(path) {
  16322. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16323. }
  16324. /**
  16325. * The opposite of `_.property`; this method creates a function that returns
  16326. * the value at a given path of `object`.
  16327. *
  16328. * @static
  16329. * @memberOf _
  16330. * @since 3.0.0
  16331. * @category Util
  16332. * @param {Object} object The object to query.
  16333. * @returns {Function} Returns the new accessor function.
  16334. * @example
  16335. *
  16336. * var array = [0, 1, 2],
  16337. * object = { 'a': array, 'b': array, 'c': array };
  16338. *
  16339. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16340. * // => [2, 0]
  16341. *
  16342. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16343. * // => [2, 0]
  16344. */
  16345. function propertyOf(object) {
  16346. return function(path) {
  16347. return object == null ? undefined : baseGet(object, path);
  16348. };
  16349. }
  16350. /**
  16351. * Creates an array of numbers (positive and/or negative) progressing from
  16352. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16353. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16354. * it's set to `start` with `start` then set to `0`.
  16355. *
  16356. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16357. * floating-point values which can produce unexpected results.
  16358. *
  16359. * @static
  16360. * @since 0.1.0
  16361. * @memberOf _
  16362. * @category Util
  16363. * @param {number} [start=0] The start of the range.
  16364. * @param {number} end The end of the range.
  16365. * @param {number} [step=1] The value to increment or decrement by.
  16366. * @returns {Array} Returns the range of numbers.
  16367. * @see _.inRange, _.rangeRight
  16368. * @example
  16369. *
  16370. * _.range(4);
  16371. * // => [0, 1, 2, 3]
  16372. *
  16373. * _.range(-4);
  16374. * // => [0, -1, -2, -3]
  16375. *
  16376. * _.range(1, 5);
  16377. * // => [1, 2, 3, 4]
  16378. *
  16379. * _.range(0, 20, 5);
  16380. * // => [0, 5, 10, 15]
  16381. *
  16382. * _.range(0, -4, -1);
  16383. * // => [0, -1, -2, -3]
  16384. *
  16385. * _.range(1, 4, 0);
  16386. * // => [1, 1, 1]
  16387. *
  16388. * _.range(0);
  16389. * // => []
  16390. */
  16391. var range = createRange();
  16392. /**
  16393. * This method is like `_.range` except that it populates values in
  16394. * descending order.
  16395. *
  16396. * @static
  16397. * @memberOf _
  16398. * @since 4.0.0
  16399. * @category Util
  16400. * @param {number} [start=0] The start of the range.
  16401. * @param {number} end The end of the range.
  16402. * @param {number} [step=1] The value to increment or decrement by.
  16403. * @returns {Array} Returns the range of numbers.
  16404. * @see _.inRange, _.range
  16405. * @example
  16406. *
  16407. * _.rangeRight(4);
  16408. * // => [3, 2, 1, 0]
  16409. *
  16410. * _.rangeRight(-4);
  16411. * // => [-3, -2, -1, 0]
  16412. *
  16413. * _.rangeRight(1, 5);
  16414. * // => [4, 3, 2, 1]
  16415. *
  16416. * _.rangeRight(0, 20, 5);
  16417. * // => [15, 10, 5, 0]
  16418. *
  16419. * _.rangeRight(0, -4, -1);
  16420. * // => [-3, -2, -1, 0]
  16421. *
  16422. * _.rangeRight(1, 4, 0);
  16423. * // => [1, 1, 1]
  16424. *
  16425. * _.rangeRight(0);
  16426. * // => []
  16427. */
  16428. var rangeRight = createRange(true);
  16429. /**
  16430. * This method returns a new empty array.
  16431. *
  16432. * @static
  16433. * @memberOf _
  16434. * @since 4.13.0
  16435. * @category Util
  16436. * @returns {Array} Returns the new empty array.
  16437. * @example
  16438. *
  16439. * var arrays = _.times(2, _.stubArray);
  16440. *
  16441. * console.log(arrays);
  16442. * // => [[], []]
  16443. *
  16444. * console.log(arrays[0] === arrays[1]);
  16445. * // => false
  16446. */
  16447. function stubArray() {
  16448. return [];
  16449. }
  16450. /**
  16451. * This method returns `false`.
  16452. *
  16453. * @static
  16454. * @memberOf _
  16455. * @since 4.13.0
  16456. * @category Util
  16457. * @returns {boolean} Returns `false`.
  16458. * @example
  16459. *
  16460. * _.times(2, _.stubFalse);
  16461. * // => [false, false]
  16462. */
  16463. function stubFalse() {
  16464. return false;
  16465. }
  16466. /**
  16467. * This method returns a new empty object.
  16468. *
  16469. * @static
  16470. * @memberOf _
  16471. * @since 4.13.0
  16472. * @category Util
  16473. * @returns {Object} Returns the new empty object.
  16474. * @example
  16475. *
  16476. * var objects = _.times(2, _.stubObject);
  16477. *
  16478. * console.log(objects);
  16479. * // => [{}, {}]
  16480. *
  16481. * console.log(objects[0] === objects[1]);
  16482. * // => false
  16483. */
  16484. function stubObject() {
  16485. return {};
  16486. }
  16487. /**
  16488. * This method returns an empty string.
  16489. *
  16490. * @static
  16491. * @memberOf _
  16492. * @since 4.13.0
  16493. * @category Util
  16494. * @returns {string} Returns the empty string.
  16495. * @example
  16496. *
  16497. * _.times(2, _.stubString);
  16498. * // => ['', '']
  16499. */
  16500. function stubString() {
  16501. return '';
  16502. }
  16503. /**
  16504. * This method returns `true`.
  16505. *
  16506. * @static
  16507. * @memberOf _
  16508. * @since 4.13.0
  16509. * @category Util
  16510. * @returns {boolean} Returns `true`.
  16511. * @example
  16512. *
  16513. * _.times(2, _.stubTrue);
  16514. * // => [true, true]
  16515. */
  16516. function stubTrue() {
  16517. return true;
  16518. }
  16519. /**
  16520. * Invokes the iteratee `n` times, returning an array of the results of
  16521. * each invocation. The iteratee is invoked with one argument; (index).
  16522. *
  16523. * @static
  16524. * @since 0.1.0
  16525. * @memberOf _
  16526. * @category Util
  16527. * @param {number} n The number of times to invoke `iteratee`.
  16528. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16529. * @returns {Array} Returns the array of results.
  16530. * @example
  16531. *
  16532. * _.times(3, String);
  16533. * // => ['0', '1', '2']
  16534. *
  16535. * _.times(4, _.constant(0));
  16536. * // => [0, 0, 0, 0]
  16537. */
  16538. function times(n, iteratee) {
  16539. n = toInteger(n);
  16540. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16541. return [];
  16542. }
  16543. var index = MAX_ARRAY_LENGTH,
  16544. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16545. iteratee = getIteratee(iteratee);
  16546. n -= MAX_ARRAY_LENGTH;
  16547. var result = baseTimes(length, iteratee);
  16548. while (++index < n) {
  16549. iteratee(index);
  16550. }
  16551. return result;
  16552. }
  16553. /**
  16554. * Converts `value` to a property path array.
  16555. *
  16556. * @static
  16557. * @memberOf _
  16558. * @since 4.0.0
  16559. * @category Util
  16560. * @param {*} value The value to convert.
  16561. * @returns {Array} Returns the new property path array.
  16562. * @example
  16563. *
  16564. * _.toPath('a.b.c');
  16565. * // => ['a', 'b', 'c']
  16566. *
  16567. * _.toPath('a[0].b.c');
  16568. * // => ['a', '0', 'b', 'c']
  16569. */
  16570. function toPath(value) {
  16571. if (isArray(value)) {
  16572. return arrayMap(value, toKey);
  16573. }
  16574. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16575. }
  16576. /**
  16577. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16578. *
  16579. * @static
  16580. * @since 0.1.0
  16581. * @memberOf _
  16582. * @category Util
  16583. * @param {string} [prefix=''] The value to prefix the ID with.
  16584. * @returns {string} Returns the unique ID.
  16585. * @example
  16586. *
  16587. * _.uniqueId('contact_');
  16588. * // => 'contact_104'
  16589. *
  16590. * _.uniqueId();
  16591. * // => '105'
  16592. */
  16593. function uniqueId(prefix) {
  16594. var id = ++idCounter;
  16595. return toString(prefix) + id;
  16596. }
  16597. /*------------------------------------------------------------------------*/
  16598. /**
  16599. * Adds two numbers.
  16600. *
  16601. * @static
  16602. * @memberOf _
  16603. * @since 3.4.0
  16604. * @category Math
  16605. * @param {number} augend The first number in an addition.
  16606. * @param {number} addend The second number in an addition.
  16607. * @returns {number} Returns the total.
  16608. * @example
  16609. *
  16610. * _.add(6, 4);
  16611. * // => 10
  16612. */
  16613. var add = createMathOperation(function(augend, addend) {
  16614. return augend + addend;
  16615. }, 0);
  16616. /**
  16617. * Computes `number` rounded up to `precision`.
  16618. *
  16619. * @static
  16620. * @memberOf _
  16621. * @since 3.10.0
  16622. * @category Math
  16623. * @param {number} number The number to round up.
  16624. * @param {number} [precision=0] The precision to round up to.
  16625. * @returns {number} Returns the rounded up number.
  16626. * @example
  16627. *
  16628. * _.ceil(4.006);
  16629. * // => 5
  16630. *
  16631. * _.ceil(6.004, 2);
  16632. * // => 6.01
  16633. *
  16634. * _.ceil(6040, -2);
  16635. * // => 6100
  16636. */
  16637. var ceil = createRound('ceil');
  16638. /**
  16639. * Divide two numbers.
  16640. *
  16641. * @static
  16642. * @memberOf _
  16643. * @since 4.7.0
  16644. * @category Math
  16645. * @param {number} dividend The first number in a division.
  16646. * @param {number} divisor The second number in a division.
  16647. * @returns {number} Returns the quotient.
  16648. * @example
  16649. *
  16650. * _.divide(6, 4);
  16651. * // => 1.5
  16652. */
  16653. var divide = createMathOperation(function(dividend, divisor) {
  16654. return dividend / divisor;
  16655. }, 1);
  16656. /**
  16657. * Computes `number` rounded down to `precision`.
  16658. *
  16659. * @static
  16660. * @memberOf _
  16661. * @since 3.10.0
  16662. * @category Math
  16663. * @param {number} number The number to round down.
  16664. * @param {number} [precision=0] The precision to round down to.
  16665. * @returns {number} Returns the rounded down number.
  16666. * @example
  16667. *
  16668. * _.floor(4.006);
  16669. * // => 4
  16670. *
  16671. * _.floor(0.046, 2);
  16672. * // => 0.04
  16673. *
  16674. * _.floor(4060, -2);
  16675. * // => 4000
  16676. */
  16677. var floor = createRound('floor');
  16678. /**
  16679. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16680. * `undefined` is returned.
  16681. *
  16682. * @static
  16683. * @since 0.1.0
  16684. * @memberOf _
  16685. * @category Math
  16686. * @param {Array} array The array to iterate over.
  16687. * @returns {*} Returns the maximum value.
  16688. * @example
  16689. *
  16690. * _.max([4, 2, 8, 6]);
  16691. * // => 8
  16692. *
  16693. * _.max([]);
  16694. * // => undefined
  16695. */
  16696. function max(array) {
  16697. return (array && array.length)
  16698. ? baseExtremum(array, identity, baseGt)
  16699. : undefined;
  16700. }
  16701. /**
  16702. * This method is like `_.max` except that it accepts `iteratee` which is
  16703. * invoked for each element in `array` to generate the criterion by which
  16704. * the value is ranked. The iteratee is invoked with one argument: (value).
  16705. *
  16706. * @static
  16707. * @memberOf _
  16708. * @since 4.0.0
  16709. * @category Math
  16710. * @param {Array} array The array to iterate over.
  16711. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16712. * @returns {*} Returns the maximum value.
  16713. * @example
  16714. *
  16715. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16716. *
  16717. * _.maxBy(objects, function(o) { return o.n; });
  16718. * // => { 'n': 2 }
  16719. *
  16720. * // The `_.property` iteratee shorthand.
  16721. * _.maxBy(objects, 'n');
  16722. * // => { 'n': 2 }
  16723. */
  16724. function maxBy(array, iteratee) {
  16725. return (array && array.length)
  16726. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16727. : undefined;
  16728. }
  16729. /**
  16730. * Computes the mean of the values in `array`.
  16731. *
  16732. * @static
  16733. * @memberOf _
  16734. * @since 4.0.0
  16735. * @category Math
  16736. * @param {Array} array The array to iterate over.
  16737. * @returns {number} Returns the mean.
  16738. * @example
  16739. *
  16740. * _.mean([4, 2, 8, 6]);
  16741. * // => 5
  16742. */
  16743. function mean(array) {
  16744. return baseMean(array, identity);
  16745. }
  16746. /**
  16747. * This method is like `_.mean` except that it accepts `iteratee` which is
  16748. * invoked for each element in `array` to generate the value to be averaged.
  16749. * The iteratee is invoked with one argument: (value).
  16750. *
  16751. * @static
  16752. * @memberOf _
  16753. * @since 4.7.0
  16754. * @category Math
  16755. * @param {Array} array The array to iterate over.
  16756. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16757. * @returns {number} Returns the mean.
  16758. * @example
  16759. *
  16760. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16761. *
  16762. * _.meanBy(objects, function(o) { return o.n; });
  16763. * // => 5
  16764. *
  16765. * // The `_.property` iteratee shorthand.
  16766. * _.meanBy(objects, 'n');
  16767. * // => 5
  16768. */
  16769. function meanBy(array, iteratee) {
  16770. return baseMean(array, getIteratee(iteratee, 2));
  16771. }
  16772. /**
  16773. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16774. * `undefined` is returned.
  16775. *
  16776. * @static
  16777. * @since 0.1.0
  16778. * @memberOf _
  16779. * @category Math
  16780. * @param {Array} array The array to iterate over.
  16781. * @returns {*} Returns the minimum value.
  16782. * @example
  16783. *
  16784. * _.min([4, 2, 8, 6]);
  16785. * // => 2
  16786. *
  16787. * _.min([]);
  16788. * // => undefined
  16789. */
  16790. function min(array) {
  16791. return (array && array.length)
  16792. ? baseExtremum(array, identity, baseLt)
  16793. : undefined;
  16794. }
  16795. /**
  16796. * This method is like `_.min` except that it accepts `iteratee` which is
  16797. * invoked for each element in `array` to generate the criterion by which
  16798. * the value is ranked. The iteratee is invoked with one argument: (value).
  16799. *
  16800. * @static
  16801. * @memberOf _
  16802. * @since 4.0.0
  16803. * @category Math
  16804. * @param {Array} array The array to iterate over.
  16805. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16806. * @returns {*} Returns the minimum value.
  16807. * @example
  16808. *
  16809. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16810. *
  16811. * _.minBy(objects, function(o) { return o.n; });
  16812. * // => { 'n': 1 }
  16813. *
  16814. * // The `_.property` iteratee shorthand.
  16815. * _.minBy(objects, 'n');
  16816. * // => { 'n': 1 }
  16817. */
  16818. function minBy(array, iteratee) {
  16819. return (array && array.length)
  16820. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16821. : undefined;
  16822. }
  16823. /**
  16824. * Multiply two numbers.
  16825. *
  16826. * @static
  16827. * @memberOf _
  16828. * @since 4.7.0
  16829. * @category Math
  16830. * @param {number} multiplier The first number in a multiplication.
  16831. * @param {number} multiplicand The second number in a multiplication.
  16832. * @returns {number} Returns the product.
  16833. * @example
  16834. *
  16835. * _.multiply(6, 4);
  16836. * // => 24
  16837. */
  16838. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16839. return multiplier * multiplicand;
  16840. }, 1);
  16841. /**
  16842. * Computes `number` rounded to `precision`.
  16843. *
  16844. * @static
  16845. * @memberOf _
  16846. * @since 3.10.0
  16847. * @category Math
  16848. * @param {number} number The number to round.
  16849. * @param {number} [precision=0] The precision to round to.
  16850. * @returns {number} Returns the rounded number.
  16851. * @example
  16852. *
  16853. * _.round(4.006);
  16854. * // => 4
  16855. *
  16856. * _.round(4.006, 2);
  16857. * // => 4.01
  16858. *
  16859. * _.round(4060, -2);
  16860. * // => 4100
  16861. */
  16862. var round = createRound('round');
  16863. /**
  16864. * Subtract two numbers.
  16865. *
  16866. * @static
  16867. * @memberOf _
  16868. * @since 4.0.0
  16869. * @category Math
  16870. * @param {number} minuend The first number in a subtraction.
  16871. * @param {number} subtrahend The second number in a subtraction.
  16872. * @returns {number} Returns the difference.
  16873. * @example
  16874. *
  16875. * _.subtract(6, 4);
  16876. * // => 2
  16877. */
  16878. var subtract = createMathOperation(function(minuend, subtrahend) {
  16879. return minuend - subtrahend;
  16880. }, 0);
  16881. /**
  16882. * Computes the sum of the values in `array`.
  16883. *
  16884. * @static
  16885. * @memberOf _
  16886. * @since 3.4.0
  16887. * @category Math
  16888. * @param {Array} array The array to iterate over.
  16889. * @returns {number} Returns the sum.
  16890. * @example
  16891. *
  16892. * _.sum([4, 2, 8, 6]);
  16893. * // => 20
  16894. */
  16895. function sum(array) {
  16896. return (array && array.length)
  16897. ? baseSum(array, identity)
  16898. : 0;
  16899. }
  16900. /**
  16901. * This method is like `_.sum` except that it accepts `iteratee` which is
  16902. * invoked for each element in `array` to generate the value to be summed.
  16903. * The iteratee is invoked with one argument: (value).
  16904. *
  16905. * @static
  16906. * @memberOf _
  16907. * @since 4.0.0
  16908. * @category Math
  16909. * @param {Array} array The array to iterate over.
  16910. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16911. * @returns {number} Returns the sum.
  16912. * @example
  16913. *
  16914. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16915. *
  16916. * _.sumBy(objects, function(o) { return o.n; });
  16917. * // => 20
  16918. *
  16919. * // The `_.property` iteratee shorthand.
  16920. * _.sumBy(objects, 'n');
  16921. * // => 20
  16922. */
  16923. function sumBy(array, iteratee) {
  16924. return (array && array.length)
  16925. ? baseSum(array, getIteratee(iteratee, 2))
  16926. : 0;
  16927. }
  16928. /*------------------------------------------------------------------------*/
  16929. // Add methods that return wrapped values in chain sequences.
  16930. lodash.after = after;
  16931. lodash.ary = ary;
  16932. lodash.assign = assign;
  16933. lodash.assignIn = assignIn;
  16934. lodash.assignInWith = assignInWith;
  16935. lodash.assignWith = assignWith;
  16936. lodash.at = at;
  16937. lodash.before = before;
  16938. lodash.bind = bind;
  16939. lodash.bindAll = bindAll;
  16940. lodash.bindKey = bindKey;
  16941. lodash.castArray = castArray;
  16942. lodash.chain = chain;
  16943. lodash.chunk = chunk;
  16944. lodash.compact = compact;
  16945. lodash.concat = concat;
  16946. lodash.cond = cond;
  16947. lodash.conforms = conforms;
  16948. lodash.constant = constant;
  16949. lodash.countBy = countBy;
  16950. lodash.create = create;
  16951. lodash.curry = curry;
  16952. lodash.curryRight = curryRight;
  16953. lodash.debounce = debounce;
  16954. lodash.defaults = defaults;
  16955. lodash.defaultsDeep = defaultsDeep;
  16956. lodash.defer = defer;
  16957. lodash.delay = delay;
  16958. lodash.difference = difference;
  16959. lodash.differenceBy = differenceBy;
  16960. lodash.differenceWith = differenceWith;
  16961. lodash.drop = drop;
  16962. lodash.dropRight = dropRight;
  16963. lodash.dropRightWhile = dropRightWhile;
  16964. lodash.dropWhile = dropWhile;
  16965. lodash.fill = fill;
  16966. lodash.filter = filter;
  16967. lodash.flatMap = flatMap;
  16968. lodash.flatMapDeep = flatMapDeep;
  16969. lodash.flatMapDepth = flatMapDepth;
  16970. lodash.flatten = flatten;
  16971. lodash.flattenDeep = flattenDeep;
  16972. lodash.flattenDepth = flattenDepth;
  16973. lodash.flip = flip;
  16974. lodash.flow = flow;
  16975. lodash.flowRight = flowRight;
  16976. lodash.fromPairs = fromPairs;
  16977. lodash.functions = functions;
  16978. lodash.functionsIn = functionsIn;
  16979. lodash.groupBy = groupBy;
  16980. lodash.initial = initial;
  16981. lodash.intersection = intersection;
  16982. lodash.intersectionBy = intersectionBy;
  16983. lodash.intersectionWith = intersectionWith;
  16984. lodash.invert = invert;
  16985. lodash.invertBy = invertBy;
  16986. lodash.invokeMap = invokeMap;
  16987. lodash.iteratee = iteratee;
  16988. lodash.keyBy = keyBy;
  16989. lodash.keys = keys;
  16990. lodash.keysIn = keysIn;
  16991. lodash.map = map;
  16992. lodash.mapKeys = mapKeys;
  16993. lodash.mapValues = mapValues;
  16994. lodash.matches = matches;
  16995. lodash.matchesProperty = matchesProperty;
  16996. lodash.memoize = memoize;
  16997. lodash.merge = merge;
  16998. lodash.mergeWith = mergeWith;
  16999. lodash.method = method;
  17000. lodash.methodOf = methodOf;
  17001. lodash.mixin = mixin;
  17002. lodash.negate = negate;
  17003. lodash.nthArg = nthArg;
  17004. lodash.omit = omit;
  17005. lodash.omitBy = omitBy;
  17006. lodash.once = once;
  17007. lodash.orderBy = orderBy;
  17008. lodash.over = over;
  17009. lodash.overArgs = overArgs;
  17010. lodash.overEvery = overEvery;
  17011. lodash.overSome = overSome;
  17012. lodash.partial = partial;
  17013. lodash.partialRight = partialRight;
  17014. lodash.partition = partition;
  17015. lodash.pick = pick;
  17016. lodash.pickBy = pickBy;
  17017. lodash.property = property;
  17018. lodash.propertyOf = propertyOf;
  17019. lodash.pull = pull;
  17020. lodash.pullAll = pullAll;
  17021. lodash.pullAllBy = pullAllBy;
  17022. lodash.pullAllWith = pullAllWith;
  17023. lodash.pullAt = pullAt;
  17024. lodash.range = range;
  17025. lodash.rangeRight = rangeRight;
  17026. lodash.rearg = rearg;
  17027. lodash.reject = reject;
  17028. lodash.remove = remove;
  17029. lodash.rest = rest;
  17030. lodash.reverse = reverse;
  17031. lodash.sampleSize = sampleSize;
  17032. lodash.set = set;
  17033. lodash.setWith = setWith;
  17034. lodash.shuffle = shuffle;
  17035. lodash.slice = slice;
  17036. lodash.sortBy = sortBy;
  17037. lodash.sortedUniq = sortedUniq;
  17038. lodash.sortedUniqBy = sortedUniqBy;
  17039. lodash.split = split;
  17040. lodash.spread = spread;
  17041. lodash.tail = tail;
  17042. lodash.take = take;
  17043. lodash.takeRight = takeRight;
  17044. lodash.takeRightWhile = takeRightWhile;
  17045. lodash.takeWhile = takeWhile;
  17046. lodash.tap = tap;
  17047. lodash.throttle = throttle;
  17048. lodash.thru = thru;
  17049. lodash.toArray = toArray;
  17050. lodash.toPairs = toPairs;
  17051. lodash.toPairsIn = toPairsIn;
  17052. lodash.toPath = toPath;
  17053. lodash.toPlainObject = toPlainObject;
  17054. lodash.transform = transform;
  17055. lodash.unary = unary;
  17056. lodash.union = union;
  17057. lodash.unionBy = unionBy;
  17058. lodash.unionWith = unionWith;
  17059. lodash.uniq = uniq;
  17060. lodash.uniqBy = uniqBy;
  17061. lodash.uniqWith = uniqWith;
  17062. lodash.unset = unset;
  17063. lodash.unzip = unzip;
  17064. lodash.unzipWith = unzipWith;
  17065. lodash.update = update;
  17066. lodash.updateWith = updateWith;
  17067. lodash.values = values;
  17068. lodash.valuesIn = valuesIn;
  17069. lodash.without = without;
  17070. lodash.words = words;
  17071. lodash.wrap = wrap;
  17072. lodash.xor = xor;
  17073. lodash.xorBy = xorBy;
  17074. lodash.xorWith = xorWith;
  17075. lodash.zip = zip;
  17076. lodash.zipObject = zipObject;
  17077. lodash.zipObjectDeep = zipObjectDeep;
  17078. lodash.zipWith = zipWith;
  17079. // Add aliases.
  17080. lodash.entries = toPairs;
  17081. lodash.entriesIn = toPairsIn;
  17082. lodash.extend = assignIn;
  17083. lodash.extendWith = assignInWith;
  17084. // Add methods to `lodash.prototype`.
  17085. mixin(lodash, lodash);
  17086. /*------------------------------------------------------------------------*/
  17087. // Add methods that return unwrapped values in chain sequences.
  17088. lodash.add = add;
  17089. lodash.attempt = attempt;
  17090. lodash.camelCase = camelCase;
  17091. lodash.capitalize = capitalize;
  17092. lodash.ceil = ceil;
  17093. lodash.clamp = clamp;
  17094. lodash.clone = clone;
  17095. lodash.cloneDeep = cloneDeep;
  17096. lodash.cloneDeepWith = cloneDeepWith;
  17097. lodash.cloneWith = cloneWith;
  17098. lodash.conformsTo = conformsTo;
  17099. lodash.deburr = deburr;
  17100. lodash.defaultTo = defaultTo;
  17101. lodash.divide = divide;
  17102. lodash.endsWith = endsWith;
  17103. lodash.eq = eq;
  17104. lodash.escape = escape;
  17105. lodash.escapeRegExp = escapeRegExp;
  17106. lodash.every = every;
  17107. lodash.find = find;
  17108. lodash.findIndex = findIndex;
  17109. lodash.findKey = findKey;
  17110. lodash.findLast = findLast;
  17111. lodash.findLastIndex = findLastIndex;
  17112. lodash.findLastKey = findLastKey;
  17113. lodash.floor = floor;
  17114. lodash.forEach = forEach;
  17115. lodash.forEachRight = forEachRight;
  17116. lodash.forIn = forIn;
  17117. lodash.forInRight = forInRight;
  17118. lodash.forOwn = forOwn;
  17119. lodash.forOwnRight = forOwnRight;
  17120. lodash.get = get;
  17121. lodash.gt = gt;
  17122. lodash.gte = gte;
  17123. lodash.has = has;
  17124. lodash.hasIn = hasIn;
  17125. lodash.head = head;
  17126. lodash.identity = identity;
  17127. lodash.includes = includes;
  17128. lodash.indexOf = indexOf;
  17129. lodash.inRange = inRange;
  17130. lodash.invoke = invoke;
  17131. lodash.isArguments = isArguments;
  17132. lodash.isArray = isArray;
  17133. lodash.isArrayBuffer = isArrayBuffer;
  17134. lodash.isArrayLike = isArrayLike;
  17135. lodash.isArrayLikeObject = isArrayLikeObject;
  17136. lodash.isBoolean = isBoolean;
  17137. lodash.isBuffer = isBuffer;
  17138. lodash.isDate = isDate;
  17139. lodash.isElement = isElement;
  17140. lodash.isEmpty = isEmpty;
  17141. lodash.isEqual = isEqual;
  17142. lodash.isEqualWith = isEqualWith;
  17143. lodash.isError = isError;
  17144. lodash.isFinite = isFinite;
  17145. lodash.isFunction = isFunction;
  17146. lodash.isInteger = isInteger;
  17147. lodash.isLength = isLength;
  17148. lodash.isMap = isMap;
  17149. lodash.isMatch = isMatch;
  17150. lodash.isMatchWith = isMatchWith;
  17151. lodash.isNaN = isNaN;
  17152. lodash.isNative = isNative;
  17153. lodash.isNil = isNil;
  17154. lodash.isNull = isNull;
  17155. lodash.isNumber = isNumber;
  17156. lodash.isObject = isObject;
  17157. lodash.isObjectLike = isObjectLike;
  17158. lodash.isPlainObject = isPlainObject;
  17159. lodash.isRegExp = isRegExp;
  17160. lodash.isSafeInteger = isSafeInteger;
  17161. lodash.isSet = isSet;
  17162. lodash.isString = isString;
  17163. lodash.isSymbol = isSymbol;
  17164. lodash.isTypedArray = isTypedArray;
  17165. lodash.isUndefined = isUndefined;
  17166. lodash.isWeakMap = isWeakMap;
  17167. lodash.isWeakSet = isWeakSet;
  17168. lodash.join = join;
  17169. lodash.kebabCase = kebabCase;
  17170. lodash.last = last;
  17171. lodash.lastIndexOf = lastIndexOf;
  17172. lodash.lowerCase = lowerCase;
  17173. lodash.lowerFirst = lowerFirst;
  17174. lodash.lt = lt;
  17175. lodash.lte = lte;
  17176. lodash.max = max;
  17177. lodash.maxBy = maxBy;
  17178. lodash.mean = mean;
  17179. lodash.meanBy = meanBy;
  17180. lodash.min = min;
  17181. lodash.minBy = minBy;
  17182. lodash.stubArray = stubArray;
  17183. lodash.stubFalse = stubFalse;
  17184. lodash.stubObject = stubObject;
  17185. lodash.stubString = stubString;
  17186. lodash.stubTrue = stubTrue;
  17187. lodash.multiply = multiply;
  17188. lodash.nth = nth;
  17189. lodash.noConflict = noConflict;
  17190. lodash.noop = noop;
  17191. lodash.now = now;
  17192. lodash.pad = pad;
  17193. lodash.padEnd = padEnd;
  17194. lodash.padStart = padStart;
  17195. lodash.parseInt = parseInt;
  17196. lodash.random = random;
  17197. lodash.reduce = reduce;
  17198. lodash.reduceRight = reduceRight;
  17199. lodash.repeat = repeat;
  17200. lodash.replace = replace;
  17201. lodash.result = result;
  17202. lodash.round = round;
  17203. lodash.runInContext = runInContext;
  17204. lodash.sample = sample;
  17205. lodash.size = size;
  17206. lodash.snakeCase = snakeCase;
  17207. lodash.some = some;
  17208. lodash.sortedIndex = sortedIndex;
  17209. lodash.sortedIndexBy = sortedIndexBy;
  17210. lodash.sortedIndexOf = sortedIndexOf;
  17211. lodash.sortedLastIndex = sortedLastIndex;
  17212. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17213. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17214. lodash.startCase = startCase;
  17215. lodash.startsWith = startsWith;
  17216. lodash.subtract = subtract;
  17217. lodash.sum = sum;
  17218. lodash.sumBy = sumBy;
  17219. lodash.template = template;
  17220. lodash.times = times;
  17221. lodash.toFinite = toFinite;
  17222. lodash.toInteger = toInteger;
  17223. lodash.toLength = toLength;
  17224. lodash.toLower = toLower;
  17225. lodash.toNumber = toNumber;
  17226. lodash.toSafeInteger = toSafeInteger;
  17227. lodash.toString = toString;
  17228. lodash.toUpper = toUpper;
  17229. lodash.trim = trim;
  17230. lodash.trimEnd = trimEnd;
  17231. lodash.trimStart = trimStart;
  17232. lodash.truncate = truncate;
  17233. lodash.unescape = unescape;
  17234. lodash.uniqueId = uniqueId;
  17235. lodash.upperCase = upperCase;
  17236. lodash.upperFirst = upperFirst;
  17237. // Add aliases.
  17238. lodash.each = forEach;
  17239. lodash.eachRight = forEachRight;
  17240. lodash.first = head;
  17241. mixin(lodash, (function() {
  17242. var source = {};
  17243. baseForOwn(lodash, function(func, methodName) {
  17244. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17245. source[methodName] = func;
  17246. }
  17247. });
  17248. return source;
  17249. }()), { 'chain': false });
  17250. /*------------------------------------------------------------------------*/
  17251. /**
  17252. * The semantic version number.
  17253. *
  17254. * @static
  17255. * @memberOf _
  17256. * @type {string}
  17257. */
  17258. lodash.VERSION = VERSION;
  17259. // Assign default placeholders.
  17260. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17261. lodash[methodName].placeholder = lodash;
  17262. });
  17263. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17264. arrayEach(['drop', 'take'], function(methodName, index) {
  17265. LazyWrapper.prototype[methodName] = function(n) {
  17266. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17267. var result = (this.__filtered__ && !index)
  17268. ? new LazyWrapper(this)
  17269. : this.clone();
  17270. if (result.__filtered__) {
  17271. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17272. } else {
  17273. result.__views__.push({
  17274. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17275. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17276. });
  17277. }
  17278. return result;
  17279. };
  17280. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17281. return this.reverse()[methodName](n).reverse();
  17282. };
  17283. });
  17284. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17285. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17286. var type = index + 1,
  17287. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17288. LazyWrapper.prototype[methodName] = function(iteratee) {
  17289. var result = this.clone();
  17290. result.__iteratees__.push({
  17291. 'iteratee': getIteratee(iteratee, 3),
  17292. 'type': type
  17293. });
  17294. result.__filtered__ = result.__filtered__ || isFilter;
  17295. return result;
  17296. };
  17297. });
  17298. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17299. arrayEach(['head', 'last'], function(methodName, index) {
  17300. var takeName = 'take' + (index ? 'Right' : '');
  17301. LazyWrapper.prototype[methodName] = function() {
  17302. return this[takeName](1).value()[0];
  17303. };
  17304. });
  17305. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17306. arrayEach(['initial', 'tail'], function(methodName, index) {
  17307. var dropName = 'drop' + (index ? '' : 'Right');
  17308. LazyWrapper.prototype[methodName] = function() {
  17309. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17310. };
  17311. });
  17312. LazyWrapper.prototype.compact = function() {
  17313. return this.filter(identity);
  17314. };
  17315. LazyWrapper.prototype.find = function(predicate) {
  17316. return this.filter(predicate).head();
  17317. };
  17318. LazyWrapper.prototype.findLast = function(predicate) {
  17319. return this.reverse().find(predicate);
  17320. };
  17321. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17322. if (typeof path == 'function') {
  17323. return new LazyWrapper(this);
  17324. }
  17325. return this.map(function(value) {
  17326. return baseInvoke(value, path, args);
  17327. });
  17328. });
  17329. LazyWrapper.prototype.reject = function(predicate) {
  17330. return this.filter(negate(getIteratee(predicate)));
  17331. };
  17332. LazyWrapper.prototype.slice = function(start, end) {
  17333. start = toInteger(start);
  17334. var result = this;
  17335. if (result.__filtered__ && (start > 0 || end < 0)) {
  17336. return new LazyWrapper(result);
  17337. }
  17338. if (start < 0) {
  17339. result = result.takeRight(-start);
  17340. } else if (start) {
  17341. result = result.drop(start);
  17342. }
  17343. if (end !== undefined) {
  17344. end = toInteger(end);
  17345. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17346. }
  17347. return result;
  17348. };
  17349. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17350. return this.reverse().takeWhile(predicate).reverse();
  17351. };
  17352. LazyWrapper.prototype.toArray = function() {
  17353. return this.take(MAX_ARRAY_LENGTH);
  17354. };
  17355. // Add `LazyWrapper` methods to `lodash.prototype`.
  17356. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17357. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17358. isTaker = /^(?:head|last)$/.test(methodName),
  17359. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17360. retUnwrapped = isTaker || /^find/.test(methodName);
  17361. if (!lodashFunc) {
  17362. return;
  17363. }
  17364. lodash.prototype[methodName] = function() {
  17365. var value = this.__wrapped__,
  17366. args = isTaker ? [1] : arguments,
  17367. isLazy = value instanceof LazyWrapper,
  17368. iteratee = args[0],
  17369. useLazy = isLazy || isArray(value);
  17370. var interceptor = function(value) {
  17371. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17372. return (isTaker && chainAll) ? result[0] : result;
  17373. };
  17374. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17375. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17376. isLazy = useLazy = false;
  17377. }
  17378. var chainAll = this.__chain__,
  17379. isHybrid = !!this.__actions__.length,
  17380. isUnwrapped = retUnwrapped && !chainAll,
  17381. onlyLazy = isLazy && !isHybrid;
  17382. if (!retUnwrapped && useLazy) {
  17383. value = onlyLazy ? value : new LazyWrapper(this);
  17384. var result = func.apply(value, args);
  17385. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17386. return new LodashWrapper(result, chainAll);
  17387. }
  17388. if (isUnwrapped && onlyLazy) {
  17389. return func.apply(this, args);
  17390. }
  17391. result = this.thru(interceptor);
  17392. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17393. };
  17394. });
  17395. // Add `Array` methods to `lodash.prototype`.
  17396. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17397. var func = arrayProto[methodName],
  17398. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17399. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17400. lodash.prototype[methodName] = function() {
  17401. var args = arguments;
  17402. if (retUnwrapped && !this.__chain__) {
  17403. var value = this.value();
  17404. return func.apply(isArray(value) ? value : [], args);
  17405. }
  17406. return this[chainName](function(value) {
  17407. return func.apply(isArray(value) ? value : [], args);
  17408. });
  17409. };
  17410. });
  17411. // Map minified method names to their real names.
  17412. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17413. var lodashFunc = lodash[methodName];
  17414. if (lodashFunc) {
  17415. var key = lodashFunc.name + '';
  17416. if (!hasOwnProperty.call(realNames, key)) {
  17417. realNames[key] = [];
  17418. }
  17419. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17420. }
  17421. });
  17422. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17423. 'name': 'wrapper',
  17424. 'func': undefined
  17425. }];
  17426. // Add methods to `LazyWrapper`.
  17427. LazyWrapper.prototype.clone = lazyClone;
  17428. LazyWrapper.prototype.reverse = lazyReverse;
  17429. LazyWrapper.prototype.value = lazyValue;
  17430. // Add chain sequence methods to the `lodash` wrapper.
  17431. lodash.prototype.at = wrapperAt;
  17432. lodash.prototype.chain = wrapperChain;
  17433. lodash.prototype.commit = wrapperCommit;
  17434. lodash.prototype.next = wrapperNext;
  17435. lodash.prototype.plant = wrapperPlant;
  17436. lodash.prototype.reverse = wrapperReverse;
  17437. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17438. // Add lazy aliases.
  17439. lodash.prototype.first = lodash.prototype.head;
  17440. if (symIterator) {
  17441. lodash.prototype[symIterator] = wrapperToIterator;
  17442. }
  17443. return lodash;
  17444. });
  17445. /*--------------------------------------------------------------------------*/
  17446. // Export lodash.
  17447. var _ = runInContext();
  17448. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17449. if (true) {
  17450. // Expose Lodash on the global object to prevent errors when Lodash is
  17451. // loaded by a script tag in the presence of an AMD loader.
  17452. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17453. // Use `_.noConflict` to remove Lodash from the global object.
  17454. root._ = _;
  17455. // Define as an anonymous module so, through path mapping, it can be
  17456. // referenced as the "underscore" module.
  17457. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17458. return _;
  17459. }).call(exports, __webpack_require__, exports, module),
  17460. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17461. }
  17462. // Check for `exports` after `define` in case a build optimizer adds it.
  17463. else {}
  17464. }.call(this));
  17465. /***/ }),
  17466. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17467. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17468. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17469. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17470. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17471. "use strict";
  17472. __webpack_require__.r(__webpack_exports__);
  17473. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17474. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17475. /* harmony export */ });
  17476. /* 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");
  17477. /* 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__);
  17478. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17479. var options = {};
  17480. options.insert = "head";
  17481. options.singleton = false;
  17482. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17483. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17484. /***/ }),
  17485. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17486. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17487. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17488. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17489. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17490. "use strict";
  17491. __webpack_require__.r(__webpack_exports__);
  17492. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17493. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17494. /* harmony export */ });
  17495. /* 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");
  17496. /* 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__);
  17497. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17498. var options = {};
  17499. options.insert = "head";
  17500. options.singleton = false;
  17501. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17502. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17503. /***/ }),
  17504. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17505. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17506. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17507. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17508. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17509. "use strict";
  17510. __webpack_require__.r(__webpack_exports__);
  17511. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17512. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17513. /* harmony export */ });
  17514. /* 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");
  17515. /* 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__);
  17516. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17517. var options = {};
  17518. options.insert = "head";
  17519. options.singleton = false;
  17520. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17521. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17522. /***/ }),
  17523. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17524. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17525. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17526. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17527. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17528. "use strict";
  17529. __webpack_require__.r(__webpack_exports__);
  17530. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17531. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17532. /* harmony export */ });
  17533. /* 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");
  17534. /* 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__);
  17535. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17536. var options = {};
  17537. options.insert = "head";
  17538. options.singleton = false;
  17539. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17540. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17541. /***/ }),
  17542. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17543. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17544. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17545. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17547. "use strict";
  17548. __webpack_require__.r(__webpack_exports__);
  17549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17550. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17551. /* harmony export */ });
  17552. /* 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");
  17553. /* 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__);
  17554. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17555. var options = {};
  17556. options.insert = "head";
  17557. options.singleton = false;
  17558. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17559. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17560. /***/ }),
  17561. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17562. /*!******************************************************!*\
  17563. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17564. \******************************************************/
  17565. /***/ ((__unused_webpack_module, exports) => {
  17566. "use strict";
  17567. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17568. // runtime helper for setting properties on components
  17569. // in a tree-shakable way
  17570. exports["default"] = (sfc, props) => {
  17571. const target = sfc.__vccOpts || sfc;
  17572. for (const [key, val] of props) {
  17573. target[key] = val;
  17574. }
  17575. return target;
  17576. };
  17577. /***/ }),
  17578. /***/ "./resources/js/components/AppButtonLink.vue":
  17579. /*!***************************************************!*\
  17580. !*** ./resources/js/components/AppButtonLink.vue ***!
  17581. \***************************************************/
  17582. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17583. "use strict";
  17584. __webpack_require__.r(__webpack_exports__);
  17585. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17586. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17587. /* harmony export */ });
  17588. /* harmony import */ var _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");
  17589. /* 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");
  17590. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17591. ;
  17592. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_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"]])
  17593. /* hot reload */
  17594. if (false) {}
  17595. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17596. /***/ }),
  17597. /***/ "./resources/js/components/AppFooter.vue":
  17598. /*!***********************************************!*\
  17599. !*** ./resources/js/components/AppFooter.vue ***!
  17600. \***********************************************/
  17601. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17602. "use strict";
  17603. __webpack_require__.r(__webpack_exports__);
  17604. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17605. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17606. /* harmony export */ });
  17607. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17608. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17609. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17610. const script = {}
  17611. ;
  17612. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17613. /* hot reload */
  17614. if (false) {}
  17615. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17616. /***/ }),
  17617. /***/ "./resources/js/components/AppMessage.vue":
  17618. /*!************************************************!*\
  17619. !*** ./resources/js/components/AppMessage.vue ***!
  17620. \************************************************/
  17621. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17622. "use strict";
  17623. __webpack_require__.r(__webpack_exports__);
  17624. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17625. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17626. /* harmony export */ });
  17627. /* 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");
  17628. /* 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");
  17629. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17630. ;
  17631. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17632. /* hot reload */
  17633. if (false) {}
  17634. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17635. /***/ }),
  17636. /***/ "./resources/js/components/AppPagination.vue":
  17637. /*!***************************************************!*\
  17638. !*** ./resources/js/components/AppPagination.vue ***!
  17639. \***************************************************/
  17640. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17641. "use strict";
  17642. __webpack_require__.r(__webpack_exports__);
  17643. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17644. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17645. /* harmony export */ });
  17646. /* 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");
  17647. /* 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");
  17648. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17649. ;
  17650. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17651. /* hot reload */
  17652. if (false) {}
  17653. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17654. /***/ }),
  17655. /***/ "./resources/js/components/AppSidebar.vue":
  17656. /*!************************************************!*\
  17657. !*** ./resources/js/components/AppSidebar.vue ***!
  17658. \************************************************/
  17659. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17660. "use strict";
  17661. __webpack_require__.r(__webpack_exports__);
  17662. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17663. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17664. /* harmony export */ });
  17665. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17666. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17667. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17668. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17669. ;
  17670. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17671. /* hot reload */
  17672. if (false) {}
  17673. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17674. /***/ }),
  17675. /***/ "./resources/js/components/AppSubSidebar.vue":
  17676. /*!***************************************************!*\
  17677. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17678. \***************************************************/
  17679. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17680. "use strict";
  17681. __webpack_require__.r(__webpack_exports__);
  17682. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17683. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17684. /* harmony export */ });
  17685. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17686. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17687. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17688. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17689. ;
  17690. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17691. /* hot reload */
  17692. if (false) {}
  17693. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17694. /***/ }),
  17695. /***/ "./resources/js/components/AppTopBar.vue":
  17696. /*!***********************************************!*\
  17697. !*** ./resources/js/components/AppTopBar.vue ***!
  17698. \***********************************************/
  17699. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17700. "use strict";
  17701. __webpack_require__.r(__webpack_exports__);
  17702. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17703. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17704. /* harmony export */ });
  17705. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17706. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17707. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17708. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17709. ;
  17710. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17711. /* hot reload */
  17712. if (false) {}
  17713. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17714. /***/ }),
  17715. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17716. /*!**************************************************!*\
  17717. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17718. \**************************************************/
  17719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17720. "use strict";
  17721. __webpack_require__.r(__webpack_exports__);
  17722. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17723. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17724. /* harmony export */ });
  17725. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17726. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17727. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17728. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17729. ;
  17730. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17731. /* hot reload */
  17732. if (false) {}
  17733. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17734. /***/ }),
  17735. /***/ "./resources/js/pages/mutation/Report.vue":
  17736. /*!************************************************!*\
  17737. !*** ./resources/js/pages/mutation/Report.vue ***!
  17738. \************************************************/
  17739. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17740. "use strict";
  17741. __webpack_require__.r(__webpack_exports__);
  17742. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17743. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17744. /* harmony export */ });
  17745. /* harmony import */ var _Report_vue_vue_type_template_id_289c9421__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Report.vue?vue&type=template&id=289c9421 */ "./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421");
  17746. /* harmony import */ var _Report_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Report.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js");
  17747. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17748. ;
  17749. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Report_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Report_vue_vue_type_template_id_289c9421__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/mutation/Report.vue"]])
  17750. /* hot reload */
  17751. if (false) {}
  17752. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17753. /***/ }),
  17754. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17755. /*!**************************************************************************************!*\
  17756. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17757. \**************************************************************************************/
  17758. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17759. "use strict";
  17760. __webpack_require__.r(__webpack_exports__);
  17761. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17762. /* 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"])
  17763. /* harmony export */ });
  17764. /* 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");
  17765. /***/ }),
  17766. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17767. /*!***********************************************************************************!*\
  17768. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17769. \***********************************************************************************/
  17770. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17771. "use strict";
  17772. __webpack_require__.r(__webpack_exports__);
  17773. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17774. /* 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"])
  17775. /* harmony export */ });
  17776. /* 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");
  17777. /***/ }),
  17778. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17779. /*!**************************************************************************************!*\
  17780. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17781. \**************************************************************************************/
  17782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17783. "use strict";
  17784. __webpack_require__.r(__webpack_exports__);
  17785. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17786. /* 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"])
  17787. /* harmony export */ });
  17788. /* 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");
  17789. /***/ }),
  17790. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17791. /*!***********************************************************************************!*\
  17792. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17793. \***********************************************************************************/
  17794. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17795. "use strict";
  17796. __webpack_require__.r(__webpack_exports__);
  17797. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17798. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17799. /* harmony export */ });
  17800. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17801. /***/ }),
  17802. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17803. /*!**************************************************************************************!*\
  17804. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17805. \**************************************************************************************/
  17806. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17807. "use strict";
  17808. __webpack_require__.r(__webpack_exports__);
  17809. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17810. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17811. /* harmony export */ });
  17812. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17813. /***/ }),
  17814. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17815. /*!**********************************************************************************!*\
  17816. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17817. \**********************************************************************************/
  17818. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17819. "use strict";
  17820. __webpack_require__.r(__webpack_exports__);
  17821. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17822. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17823. /* harmony export */ });
  17824. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17825. /***/ }),
  17826. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17827. /*!*************************************************************************************!*\
  17828. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17829. \*************************************************************************************/
  17830. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17831. "use strict";
  17832. __webpack_require__.r(__webpack_exports__);
  17833. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17834. /* 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"])
  17835. /* harmony export */ });
  17836. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17837. /***/ }),
  17838. /***/ "./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js":
  17839. /*!***********************************************************************************!*\
  17840. !*** ./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js ***!
  17841. \***********************************************************************************/
  17842. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17843. "use strict";
  17844. __webpack_require__.r(__webpack_exports__);
  17845. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17846. /* 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_Report_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17847. /* harmony export */ });
  17848. /* 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_Report_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]!./Report.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/mutation/Report.vue?vue&type=script&setup=true&lang=js");
  17849. /***/ }),
  17850. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17851. /*!*********************************************************************************!*\
  17852. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17853. \*********************************************************************************/
  17854. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17855. "use strict";
  17856. __webpack_require__.r(__webpack_exports__);
  17857. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17858. /* 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)
  17859. /* harmony export */ });
  17860. /* 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");
  17861. /***/ }),
  17862. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17863. /*!*****************************************************************************************!*\
  17864. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17865. \*****************************************************************************************/
  17866. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17867. "use strict";
  17868. __webpack_require__.r(__webpack_exports__);
  17869. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17870. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17871. /* harmony export */ });
  17872. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17873. /***/ }),
  17874. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17875. /*!******************************************************************************!*\
  17876. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17877. \******************************************************************************/
  17878. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17879. "use strict";
  17880. __webpack_require__.r(__webpack_exports__);
  17881. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17882. /* 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)
  17883. /* harmony export */ });
  17884. /* 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");
  17885. /***/ }),
  17886. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17887. /*!*********************************************************************************!*\
  17888. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17889. \*********************************************************************************/
  17890. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17891. "use strict";
  17892. __webpack_require__.r(__webpack_exports__);
  17893. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17894. /* 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)
  17895. /* harmony export */ });
  17896. /* 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");
  17897. /***/ }),
  17898. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17899. /*!******************************************************************************************!*\
  17900. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17901. \******************************************************************************************/
  17902. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17903. "use strict";
  17904. __webpack_require__.r(__webpack_exports__);
  17905. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17906. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17907. /* harmony export */ });
  17908. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17909. /***/ }),
  17910. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17911. /*!*********************************************************************************************!*\
  17912. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17913. \*********************************************************************************************/
  17914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17915. "use strict";
  17916. __webpack_require__.r(__webpack_exports__);
  17917. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17918. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17919. /* harmony export */ });
  17920. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17921. /***/ }),
  17922. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17923. /*!*****************************************************************************************!*\
  17924. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17925. \*****************************************************************************************/
  17926. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17927. "use strict";
  17928. __webpack_require__.r(__webpack_exports__);
  17929. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17930. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17931. /* harmony export */ });
  17932. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17933. /***/ }),
  17934. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17935. /*!********************************************************************************************!*\
  17936. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17937. \********************************************************************************************/
  17938. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17939. "use strict";
  17940. __webpack_require__.r(__webpack_exports__);
  17941. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17942. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17943. /* harmony export */ });
  17944. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17945. /***/ }),
  17946. /***/ "./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421":
  17947. /*!******************************************************************************!*\
  17948. !*** ./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421 ***!
  17949. \******************************************************************************/
  17950. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17951. "use strict";
  17952. __webpack_require__.r(__webpack_exports__);
  17953. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17954. /* 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_Report_vue_vue_type_template_id_289c9421__WEBPACK_IMPORTED_MODULE_0__.render)
  17955. /* harmony export */ });
  17956. /* 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_Report_vue_vue_type_template_id_289c9421__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]!./Report.vue?vue&type=template&id=289c9421 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/mutation/Report.vue?vue&type=template&id=289c9421");
  17957. /***/ }),
  17958. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17959. /*!********************************************************************************************************!*\
  17960. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17961. \********************************************************************************************************/
  17962. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17963. "use strict";
  17964. __webpack_require__.r(__webpack_exports__);
  17965. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17966. /***/ }),
  17967. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17968. /*!*********************************************************************************************************!*\
  17969. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17970. \*********************************************************************************************************/
  17971. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17972. "use strict";
  17973. __webpack_require__.r(__webpack_exports__);
  17974. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17975. /***/ }),
  17976. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17977. /*!************************************************************************************************************!*\
  17978. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17979. \************************************************************************************************************/
  17980. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17981. "use strict";
  17982. __webpack_require__.r(__webpack_exports__);
  17983. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17984. /***/ }),
  17985. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17986. /*!********************************************************************************************************!*\
  17987. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17988. \********************************************************************************************************/
  17989. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17990. "use strict";
  17991. __webpack_require__.r(__webpack_exports__);
  17992. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17993. /***/ }),
  17994. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17995. /*!***********************************************************************************************************!*\
  17996. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17997. \***********************************************************************************************************/
  17998. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17999. "use strict";
  18000. __webpack_require__.r(__webpack_exports__);
  18001. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  18002. /***/ })
  18003. }]);