resources_js_pages_mutation_Report_vue.js 707KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493
  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. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  944. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  945. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  946. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  947. title: "Laporan Mutasi"
  948. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  949. "responsive-layout": "scroll",
  950. "column-resize-mode": "expand",
  951. value: $props.mutations.details.data,
  952. "row-hover": true,
  953. "striped-rows": true
  954. }, {
  955. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  956. 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, {
  957. "touch-u-i": "",
  958. "class": "w-full",
  959. modelValue: $setup.dates,
  960. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  961. return $setup.dates = $event;
  962. }),
  963. "selection-mode": "range",
  964. placeholder: "filter waktu...",
  965. "date-format": "dd/mm/yy",
  966. "manual-input": false
  967. }, null, 8
  968. /* PROPS */
  969. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  970. label: "reset",
  971. "class": "p-button-link",
  972. onClick: $setup.filterReset
  973. })])])]), (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"], {
  974. key: 0,
  975. label: "Export excel",
  976. "class-button": "p-button-outlined md:w-16rem",
  977. icon: "pi pi-file-excel",
  978. "inertia-link": false,
  979. href: $setup.exportExcelLink
  980. }, null, 8
  981. /* PROPS */
  982. , ["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
  983. /* TEXT */
  984. )])]), (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
  985. /* TEXT */
  986. )])]), (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
  987. /* TEXT */
  988. )])])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  989. }),
  990. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  991. 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) {
  992. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  993. field: value.field,
  994. header: value.header,
  995. key: value.field
  996. }, null, 8
  997. /* PROPS */
  998. , ["field", "header"]);
  999. }), 128
  1000. /* KEYED_FRAGMENT */
  1001. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1002. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1003. var data = _ref.data;
  1004. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  1005. icon: "pi pi-link",
  1006. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  1007. href: $setup.linkReference(data)
  1008. }, null, 8
  1009. /* PROPS */
  1010. , ["href"]), [[_directive_tooltip, 'Detail Pengeluaran', void 0, {
  1011. bottom: true
  1012. }]])];
  1013. }),
  1014. _: 1
  1015. /* STABLE */
  1016. })];
  1017. }),
  1018. _: 1
  1019. /* STABLE */
  1020. }, 8
  1021. /* PROPS */
  1022. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1023. links: $props.mutations.details.links
  1024. }, null, 8
  1025. /* PROPS */
  1026. , ["links"])];
  1027. }),
  1028. _: 1
  1029. /* STABLE */
  1030. });
  1031. }
  1032. /***/ }),
  1033. /***/ "./resources/js/components/useDateRangeFilter.js":
  1034. /*!*******************************************************!*\
  1035. !*** ./resources/js/components/useDateRangeFilter.js ***!
  1036. \*******************************************************/
  1037. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1038. "use strict";
  1039. __webpack_require__.r(__webpack_exports__);
  1040. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1041. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  1042. /* harmony export */ });
  1043. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1044. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  1045. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  1046. function useDateRangeFilter(props) {
  1047. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1048. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1049. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1050. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1051. if (!props.initialDateRange) {
  1052. return;
  1053. }
  1054. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  1055. if (props.initialDateRange[1]) {
  1056. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  1057. } else {
  1058. dates.value = [new Date(props.props.initialDateRange[1]), null];
  1059. }
  1060. }
  1061. });
  1062. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  1063. if (dates.value[1]) {
  1064. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1065. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  1066. } else if (dates.value[0]) {
  1067. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1068. endDate.value = null;
  1069. }
  1070. });
  1071. return {
  1072. dates: dates,
  1073. startDate: startDate,
  1074. endDate: endDate
  1075. };
  1076. }
  1077. /***/ }),
  1078. /***/ "./resources/js/pages/mutation/tableHeader.js":
  1079. /*!****************************************************!*\
  1080. !*** ./resources/js/pages/mutation/tableHeader.js ***!
  1081. \****************************************************/
  1082. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1083. "use strict";
  1084. __webpack_require__.r(__webpack_exports__);
  1085. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1086. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1087. /* harmony export */ });
  1088. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  1089. field: 'createdAt',
  1090. header: 'Tanggal'
  1091. }, {
  1092. field: 'type',
  1093. header: 'Tipe'
  1094. }, {
  1095. field: 'amount',
  1096. header: 'Nilai'
  1097. }]);
  1098. /***/ }),
  1099. /***/ "./resources/js/utils/menu.js":
  1100. /*!************************************!*\
  1101. !*** ./resources/js/utils/menu.js ***!
  1102. \************************************/
  1103. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1104. "use strict";
  1105. __webpack_require__.r(__webpack_exports__);
  1106. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1107. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1108. /* harmony export */ });
  1109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1110. // Admin
  1111. 1: [{
  1112. label: 'Home',
  1113. items: [{
  1114. label: 'Dashboard',
  1115. icon: 'pi pi-home',
  1116. to: '/dashboards',
  1117. component: 'home/Index'
  1118. }]
  1119. }, {
  1120. label: 'Master',
  1121. items: [{
  1122. label: 'User',
  1123. icon: 'pi pi-user',
  1124. to: '/users',
  1125. component: 'user/Index'
  1126. }]
  1127. }],
  1128. // Supervisor
  1129. 2: [{
  1130. label: 'Home',
  1131. items: [{
  1132. label: 'Dashboard',
  1133. icon: 'pi pi-home',
  1134. to: '/dashboards',
  1135. component: 'home/Index'
  1136. }]
  1137. }, {
  1138. label: 'Menu',
  1139. items: [{
  1140. label: 'Pengeluaran',
  1141. icon: 'pi pi-wallet',
  1142. to: '/expenses',
  1143. component: 'expense/Index'
  1144. }, {
  1145. label: 'Laporan',
  1146. icon: 'pi pi-book',
  1147. items: [{
  1148. label: 'Mutasi',
  1149. icon: 'pi pi-circle',
  1150. to: '/reports/mutations',
  1151. component: 'mutation/Report'
  1152. }]
  1153. }]
  1154. }, {
  1155. label: 'Master',
  1156. items: [{
  1157. label: 'Jenis Kendaraan',
  1158. icon: 'pi pi-car',
  1159. to: '/type-vehicles',
  1160. component: 'typevehicle/Index'
  1161. }, {
  1162. label: 'Jenis Member',
  1163. icon: 'pi pi-id-card',
  1164. to: '/type-members',
  1165. component: 'typemember/Index'
  1166. }]
  1167. }, {
  1168. label: 'Pengaturan',
  1169. items: [{
  1170. label: 'Tarif Parkir',
  1171. icon: 'pi pi-car',
  1172. to: '/parking-fees/create',
  1173. component: 'parkingfee/Create'
  1174. }]
  1175. }],
  1176. // Operator
  1177. 3: [{
  1178. label: 'Home',
  1179. items: [{
  1180. label: 'Dashboard',
  1181. icon: 'pi pi-home',
  1182. to: '/dashboards',
  1183. component: 'home/Index'
  1184. }]
  1185. }, {
  1186. label: 'Transaksi',
  1187. items: [{
  1188. label: 'Transaksi Keluar',
  1189. icon: 'pi pi-car',
  1190. to: '/transactions/create',
  1191. component: 'transaction/Create'
  1192. }]
  1193. }, {
  1194. label: 'Menu',
  1195. items: [{
  1196. label: 'Pengeluaran',
  1197. icon: 'pi pi-wallet',
  1198. to: '/expenses',
  1199. component: 'expense/Index'
  1200. }, {
  1201. label: 'Member',
  1202. icon: 'pi pi-id-card',
  1203. to: '/members',
  1204. component: 'member/Index'
  1205. }, {
  1206. label: 'Top Up',
  1207. icon: 'pi pi-car',
  1208. to: '/top-ups',
  1209. component: 'topup/Index'
  1210. }]
  1211. }]
  1212. });
  1213. /***/ }),
  1214. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1215. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1216. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1217. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1218. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1219. "use strict";
  1220. __webpack_require__.r(__webpack_exports__);
  1221. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1222. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1223. /* harmony export */ });
  1224. /* 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");
  1225. /* 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__);
  1226. // Imports
  1227. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1228. // Module
  1229. ___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}", ""]);
  1230. // Exports
  1231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1232. /***/ }),
  1233. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1234. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1235. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1236. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1237. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1238. "use strict";
  1239. __webpack_require__.r(__webpack_exports__);
  1240. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1241. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1242. /* harmony export */ });
  1243. /* 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");
  1244. /* 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__);
  1245. // Imports
  1246. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1247. // Module
  1248. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1249. // Exports
  1250. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1251. /***/ }),
  1252. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1253. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1254. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1255. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1256. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1257. "use strict";
  1258. __webpack_require__.r(__webpack_exports__);
  1259. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1260. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1261. /* harmony export */ });
  1262. /* 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");
  1263. /* 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__);
  1264. // Imports
  1265. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1266. // Module
  1267. ___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}", ""]);
  1268. // Exports
  1269. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1270. /***/ }),
  1271. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1272. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1273. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1274. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1275. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1276. "use strict";
  1277. __webpack_require__.r(__webpack_exports__);
  1278. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1279. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1280. /* harmony export */ });
  1281. /* 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");
  1282. /* 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__);
  1283. // Imports
  1284. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1285. // Module
  1286. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-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}", ""]);
  1287. // Exports
  1288. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1289. /***/ }),
  1290. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1291. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1292. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1293. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1294. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1295. "use strict";
  1296. __webpack_require__.r(__webpack_exports__);
  1297. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1298. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1299. /* harmony export */ });
  1300. /* 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");
  1301. /* 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__);
  1302. // Imports
  1303. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1304. // Module
  1305. ___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: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-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: 995;\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}", ""]);
  1306. // Exports
  1307. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1308. /***/ }),
  1309. /***/ "./node_modules/dayjs/dayjs.min.js":
  1310. /*!*****************************************!*\
  1311. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1312. \*****************************************/
  1313. /***/ (function(module) {
  1314. !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}));
  1315. /***/ }),
  1316. /***/ "./node_modules/lodash/lodash.js":
  1317. /*!***************************************!*\
  1318. !*** ./node_modules/lodash/lodash.js ***!
  1319. \***************************************/
  1320. /***/ (function(module, exports, __webpack_require__) {
  1321. /* module decorator */ module = __webpack_require__.nmd(module);
  1322. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1323. * @license
  1324. * Lodash <https://lodash.com/>
  1325. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1326. * Released under MIT license <https://lodash.com/license>
  1327. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1328. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1329. */
  1330. ;(function() {
  1331. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1332. var undefined;
  1333. /** Used as the semantic version number. */
  1334. var VERSION = '4.17.21';
  1335. /** Used as the size to enable large array optimizations. */
  1336. var LARGE_ARRAY_SIZE = 200;
  1337. /** Error message constants. */
  1338. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1339. FUNC_ERROR_TEXT = 'Expected a function',
  1340. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1341. /** Used to stand-in for `undefined` hash values. */
  1342. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1343. /** Used as the maximum memoize cache size. */
  1344. var MAX_MEMOIZE_SIZE = 500;
  1345. /** Used as the internal argument placeholder. */
  1346. var PLACEHOLDER = '__lodash_placeholder__';
  1347. /** Used to compose bitmasks for cloning. */
  1348. var CLONE_DEEP_FLAG = 1,
  1349. CLONE_FLAT_FLAG = 2,
  1350. CLONE_SYMBOLS_FLAG = 4;
  1351. /** Used to compose bitmasks for value comparisons. */
  1352. var COMPARE_PARTIAL_FLAG = 1,
  1353. COMPARE_UNORDERED_FLAG = 2;
  1354. /** Used to compose bitmasks for function metadata. */
  1355. var WRAP_BIND_FLAG = 1,
  1356. WRAP_BIND_KEY_FLAG = 2,
  1357. WRAP_CURRY_BOUND_FLAG = 4,
  1358. WRAP_CURRY_FLAG = 8,
  1359. WRAP_CURRY_RIGHT_FLAG = 16,
  1360. WRAP_PARTIAL_FLAG = 32,
  1361. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1362. WRAP_ARY_FLAG = 128,
  1363. WRAP_REARG_FLAG = 256,
  1364. WRAP_FLIP_FLAG = 512;
  1365. /** Used as default options for `_.truncate`. */
  1366. var DEFAULT_TRUNC_LENGTH = 30,
  1367. DEFAULT_TRUNC_OMISSION = '...';
  1368. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1369. var HOT_COUNT = 800,
  1370. HOT_SPAN = 16;
  1371. /** Used to indicate the type of lazy iteratees. */
  1372. var LAZY_FILTER_FLAG = 1,
  1373. LAZY_MAP_FLAG = 2,
  1374. LAZY_WHILE_FLAG = 3;
  1375. /** Used as references for various `Number` constants. */
  1376. var INFINITY = 1 / 0,
  1377. MAX_SAFE_INTEGER = 9007199254740991,
  1378. MAX_INTEGER = 1.7976931348623157e+308,
  1379. NAN = 0 / 0;
  1380. /** Used as references for the maximum length and index of an array. */
  1381. var MAX_ARRAY_LENGTH = 4294967295,
  1382. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1383. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1384. /** Used to associate wrap methods with their bit flags. */
  1385. var wrapFlags = [
  1386. ['ary', WRAP_ARY_FLAG],
  1387. ['bind', WRAP_BIND_FLAG],
  1388. ['bindKey', WRAP_BIND_KEY_FLAG],
  1389. ['curry', WRAP_CURRY_FLAG],
  1390. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1391. ['flip', WRAP_FLIP_FLAG],
  1392. ['partial', WRAP_PARTIAL_FLAG],
  1393. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1394. ['rearg', WRAP_REARG_FLAG]
  1395. ];
  1396. /** `Object#toString` result references. */
  1397. var argsTag = '[object Arguments]',
  1398. arrayTag = '[object Array]',
  1399. asyncTag = '[object AsyncFunction]',
  1400. boolTag = '[object Boolean]',
  1401. dateTag = '[object Date]',
  1402. domExcTag = '[object DOMException]',
  1403. errorTag = '[object Error]',
  1404. funcTag = '[object Function]',
  1405. genTag = '[object GeneratorFunction]',
  1406. mapTag = '[object Map]',
  1407. numberTag = '[object Number]',
  1408. nullTag = '[object Null]',
  1409. objectTag = '[object Object]',
  1410. promiseTag = '[object Promise]',
  1411. proxyTag = '[object Proxy]',
  1412. regexpTag = '[object RegExp]',
  1413. setTag = '[object Set]',
  1414. stringTag = '[object String]',
  1415. symbolTag = '[object Symbol]',
  1416. undefinedTag = '[object Undefined]',
  1417. weakMapTag = '[object WeakMap]',
  1418. weakSetTag = '[object WeakSet]';
  1419. var arrayBufferTag = '[object ArrayBuffer]',
  1420. dataViewTag = '[object DataView]',
  1421. float32Tag = '[object Float32Array]',
  1422. float64Tag = '[object Float64Array]',
  1423. int8Tag = '[object Int8Array]',
  1424. int16Tag = '[object Int16Array]',
  1425. int32Tag = '[object Int32Array]',
  1426. uint8Tag = '[object Uint8Array]',
  1427. uint8ClampedTag = '[object Uint8ClampedArray]',
  1428. uint16Tag = '[object Uint16Array]',
  1429. uint32Tag = '[object Uint32Array]';
  1430. /** Used to match empty string literals in compiled template source. */
  1431. var reEmptyStringLeading = /\b__p \+= '';/g,
  1432. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1433. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1434. /** Used to match HTML entities and HTML characters. */
  1435. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1436. reUnescapedHtml = /[&<>"']/g,
  1437. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1438. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1439. /** Used to match template delimiters. */
  1440. var reEscape = /<%-([\s\S]+?)%>/g,
  1441. reEvaluate = /<%([\s\S]+?)%>/g,
  1442. reInterpolate = /<%=([\s\S]+?)%>/g;
  1443. /** Used to match property names within property paths. */
  1444. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1445. reIsPlainProp = /^\w*$/,
  1446. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1447. /**
  1448. * Used to match `RegExp`
  1449. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1450. */
  1451. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1452. reHasRegExpChar = RegExp(reRegExpChar.source);
  1453. /** Used to match leading whitespace. */
  1454. var reTrimStart = /^\s+/;
  1455. /** Used to match a single whitespace character. */
  1456. var reWhitespace = /\s/;
  1457. /** Used to match wrap detail comments. */
  1458. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1459. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1460. reSplitDetails = /,? & /;
  1461. /** Used to match words composed of alphanumeric characters. */
  1462. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1463. /**
  1464. * Used to validate the `validate` option in `_.template` variable.
  1465. *
  1466. * Forbids characters which could potentially change the meaning of the function argument definition:
  1467. * - "()," (modification of function parameters)
  1468. * - "=" (default value)
  1469. * - "[]{}" (destructuring of function parameters)
  1470. * - "/" (beginning of a comment)
  1471. * - whitespace
  1472. */
  1473. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1474. /** Used to match backslashes in property paths. */
  1475. var reEscapeChar = /\\(\\)?/g;
  1476. /**
  1477. * Used to match
  1478. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1479. */
  1480. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1481. /** Used to match `RegExp` flags from their coerced string values. */
  1482. var reFlags = /\w*$/;
  1483. /** Used to detect bad signed hexadecimal string values. */
  1484. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1485. /** Used to detect binary string values. */
  1486. var reIsBinary = /^0b[01]+$/i;
  1487. /** Used to detect host constructors (Safari). */
  1488. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1489. /** Used to detect octal string values. */
  1490. var reIsOctal = /^0o[0-7]+$/i;
  1491. /** Used to detect unsigned integer values. */
  1492. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1493. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1494. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1495. /** Used to ensure capturing order of template delimiters. */
  1496. var reNoMatch = /($^)/;
  1497. /** Used to match unescaped characters in compiled string literals. */
  1498. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1499. /** Used to compose unicode character classes. */
  1500. var rsAstralRange = '\\ud800-\\udfff',
  1501. rsComboMarksRange = '\\u0300-\\u036f',
  1502. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1503. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1504. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1505. rsDingbatRange = '\\u2700-\\u27bf',
  1506. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1507. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1508. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1509. rsPunctuationRange = '\\u2000-\\u206f',
  1510. 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',
  1511. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1512. rsVarRange = '\\ufe0e\\ufe0f',
  1513. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1514. /** Used to compose unicode capture groups. */
  1515. var rsApos = "['\u2019]",
  1516. rsAstral = '[' + rsAstralRange + ']',
  1517. rsBreak = '[' + rsBreakRange + ']',
  1518. rsCombo = '[' + rsComboRange + ']',
  1519. rsDigits = '\\d+',
  1520. rsDingbat = '[' + rsDingbatRange + ']',
  1521. rsLower = '[' + rsLowerRange + ']',
  1522. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1523. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1524. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1525. rsNonAstral = '[^' + rsAstralRange + ']',
  1526. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1527. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1528. rsUpper = '[' + rsUpperRange + ']',
  1529. rsZWJ = '\\u200d';
  1530. /** Used to compose unicode regexes. */
  1531. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1532. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1533. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1534. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1535. reOptMod = rsModifier + '?',
  1536. rsOptVar = '[' + rsVarRange + ']?',
  1537. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1538. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1539. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1540. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1541. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1542. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1543. /** Used to match apostrophes. */
  1544. var reApos = RegExp(rsApos, 'g');
  1545. /**
  1546. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1547. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1548. */
  1549. var reComboMark = RegExp(rsCombo, 'g');
  1550. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1551. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1552. /** Used to match complex or compound words. */
  1553. var reUnicodeWord = RegExp([
  1554. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1555. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1556. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1557. rsUpper + '+' + rsOptContrUpper,
  1558. rsOrdUpper,
  1559. rsOrdLower,
  1560. rsDigits,
  1561. rsEmoji
  1562. ].join('|'), 'g');
  1563. /** 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/). */
  1564. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1565. /** Used to detect strings that need a more robust regexp to match words. */
  1566. 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 ]/;
  1567. /** Used to assign default `context` object properties. */
  1568. var contextProps = [
  1569. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1570. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1571. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1572. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1573. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1574. ];
  1575. /** Used to make template sourceURLs easier to identify. */
  1576. var templateCounter = -1;
  1577. /** Used to identify `toStringTag` values of typed arrays. */
  1578. var typedArrayTags = {};
  1579. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1580. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1581. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1582. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1583. typedArrayTags[uint32Tag] = true;
  1584. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1585. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1586. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1587. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1588. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1589. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1590. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1591. typedArrayTags[weakMapTag] = false;
  1592. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1593. var cloneableTags = {};
  1594. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1595. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1596. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1597. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1598. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1599. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1600. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1601. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1602. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1603. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1604. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1605. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1606. cloneableTags[weakMapTag] = false;
  1607. /** Used to map Latin Unicode letters to basic Latin letters. */
  1608. var deburredLetters = {
  1609. // Latin-1 Supplement block.
  1610. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1611. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1612. '\xc7': 'C', '\xe7': 'c',
  1613. '\xd0': 'D', '\xf0': 'd',
  1614. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1615. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1616. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1617. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1618. '\xd1': 'N', '\xf1': 'n',
  1619. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1620. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1621. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1622. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1623. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1624. '\xc6': 'Ae', '\xe6': 'ae',
  1625. '\xde': 'Th', '\xfe': 'th',
  1626. '\xdf': 'ss',
  1627. // Latin Extended-A block.
  1628. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1629. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1630. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1631. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1632. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1633. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1634. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1635. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1636. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1637. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1638. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1639. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1640. '\u0134': 'J', '\u0135': 'j',
  1641. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1642. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1643. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1644. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1645. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1646. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1647. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1648. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1649. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1650. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1651. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1652. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1653. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1654. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1655. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1656. '\u0174': 'W', '\u0175': 'w',
  1657. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1658. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1659. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1660. '\u0132': 'IJ', '\u0133': 'ij',
  1661. '\u0152': 'Oe', '\u0153': 'oe',
  1662. '\u0149': "'n", '\u017f': 's'
  1663. };
  1664. /** Used to map characters to HTML entities. */
  1665. var htmlEscapes = {
  1666. '&': '&amp;',
  1667. '<': '&lt;',
  1668. '>': '&gt;',
  1669. '"': '&quot;',
  1670. "'": '&#39;'
  1671. };
  1672. /** Used to map HTML entities to characters. */
  1673. var htmlUnescapes = {
  1674. '&amp;': '&',
  1675. '&lt;': '<',
  1676. '&gt;': '>',
  1677. '&quot;': '"',
  1678. '&#39;': "'"
  1679. };
  1680. /** Used to escape characters for inclusion in compiled string literals. */
  1681. var stringEscapes = {
  1682. '\\': '\\',
  1683. "'": "'",
  1684. '\n': 'n',
  1685. '\r': 'r',
  1686. '\u2028': 'u2028',
  1687. '\u2029': 'u2029'
  1688. };
  1689. /** Built-in method references without a dependency on `root`. */
  1690. var freeParseFloat = parseFloat,
  1691. freeParseInt = parseInt;
  1692. /** Detect free variable `global` from Node.js. */
  1693. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1694. /** Detect free variable `self`. */
  1695. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1696. /** Used as a reference to the global object. */
  1697. var root = freeGlobal || freeSelf || Function('return this')();
  1698. /** Detect free variable `exports`. */
  1699. var freeExports = true && exports && !exports.nodeType && exports;
  1700. /** Detect free variable `module`. */
  1701. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1702. /** Detect the popular CommonJS extension `module.exports`. */
  1703. var moduleExports = freeModule && freeModule.exports === freeExports;
  1704. /** Detect free variable `process` from Node.js. */
  1705. var freeProcess = moduleExports && freeGlobal.process;
  1706. /** Used to access faster Node.js helpers. */
  1707. var nodeUtil = (function() {
  1708. try {
  1709. // Use `util.types` for Node.js 10+.
  1710. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1711. if (types) {
  1712. return types;
  1713. }
  1714. // Legacy `process.binding('util')` for Node.js < 10.
  1715. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1716. } catch (e) {}
  1717. }());
  1718. /* Node.js helper references. */
  1719. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1720. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1721. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1722. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1723. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1724. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1725. /*--------------------------------------------------------------------------*/
  1726. /**
  1727. * A faster alternative to `Function#apply`, this function invokes `func`
  1728. * with the `this` binding of `thisArg` and the arguments of `args`.
  1729. *
  1730. * @private
  1731. * @param {Function} func The function to invoke.
  1732. * @param {*} thisArg The `this` binding of `func`.
  1733. * @param {Array} args The arguments to invoke `func` with.
  1734. * @returns {*} Returns the result of `func`.
  1735. */
  1736. function apply(func, thisArg, args) {
  1737. switch (args.length) {
  1738. case 0: return func.call(thisArg);
  1739. case 1: return func.call(thisArg, args[0]);
  1740. case 2: return func.call(thisArg, args[0], args[1]);
  1741. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1742. }
  1743. return func.apply(thisArg, args);
  1744. }
  1745. /**
  1746. * A specialized version of `baseAggregator` for arrays.
  1747. *
  1748. * @private
  1749. * @param {Array} [array] The array to iterate over.
  1750. * @param {Function} setter The function to set `accumulator` values.
  1751. * @param {Function} iteratee The iteratee to transform keys.
  1752. * @param {Object} accumulator The initial aggregated object.
  1753. * @returns {Function} Returns `accumulator`.
  1754. */
  1755. function arrayAggregator(array, setter, iteratee, accumulator) {
  1756. var index = -1,
  1757. length = array == null ? 0 : array.length;
  1758. while (++index < length) {
  1759. var value = array[index];
  1760. setter(accumulator, value, iteratee(value), array);
  1761. }
  1762. return accumulator;
  1763. }
  1764. /**
  1765. * A specialized version of `_.forEach` for arrays without support for
  1766. * iteratee shorthands.
  1767. *
  1768. * @private
  1769. * @param {Array} [array] The array to iterate over.
  1770. * @param {Function} iteratee The function invoked per iteration.
  1771. * @returns {Array} Returns `array`.
  1772. */
  1773. function arrayEach(array, iteratee) {
  1774. var index = -1,
  1775. length = array == null ? 0 : array.length;
  1776. while (++index < length) {
  1777. if (iteratee(array[index], index, array) === false) {
  1778. break;
  1779. }
  1780. }
  1781. return array;
  1782. }
  1783. /**
  1784. * A specialized version of `_.forEachRight` for arrays without support for
  1785. * iteratee shorthands.
  1786. *
  1787. * @private
  1788. * @param {Array} [array] The array to iterate over.
  1789. * @param {Function} iteratee The function invoked per iteration.
  1790. * @returns {Array} Returns `array`.
  1791. */
  1792. function arrayEachRight(array, iteratee) {
  1793. var length = array == null ? 0 : array.length;
  1794. while (length--) {
  1795. if (iteratee(array[length], length, array) === false) {
  1796. break;
  1797. }
  1798. }
  1799. return array;
  1800. }
  1801. /**
  1802. * A specialized version of `_.every` for arrays without support for
  1803. * iteratee shorthands.
  1804. *
  1805. * @private
  1806. * @param {Array} [array] The array to iterate over.
  1807. * @param {Function} predicate The function invoked per iteration.
  1808. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1809. * else `false`.
  1810. */
  1811. function arrayEvery(array, predicate) {
  1812. var index = -1,
  1813. length = array == null ? 0 : array.length;
  1814. while (++index < length) {
  1815. if (!predicate(array[index], index, array)) {
  1816. return false;
  1817. }
  1818. }
  1819. return true;
  1820. }
  1821. /**
  1822. * A specialized version of `_.filter` for arrays without support for
  1823. * iteratee shorthands.
  1824. *
  1825. * @private
  1826. * @param {Array} [array] The array to iterate over.
  1827. * @param {Function} predicate The function invoked per iteration.
  1828. * @returns {Array} Returns the new filtered array.
  1829. */
  1830. function arrayFilter(array, predicate) {
  1831. var index = -1,
  1832. length = array == null ? 0 : array.length,
  1833. resIndex = 0,
  1834. result = [];
  1835. while (++index < length) {
  1836. var value = array[index];
  1837. if (predicate(value, index, array)) {
  1838. result[resIndex++] = value;
  1839. }
  1840. }
  1841. return result;
  1842. }
  1843. /**
  1844. * A specialized version of `_.includes` for arrays without support for
  1845. * specifying an index to search from.
  1846. *
  1847. * @private
  1848. * @param {Array} [array] The array to inspect.
  1849. * @param {*} target The value to search for.
  1850. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1851. */
  1852. function arrayIncludes(array, value) {
  1853. var length = array == null ? 0 : array.length;
  1854. return !!length && baseIndexOf(array, value, 0) > -1;
  1855. }
  1856. /**
  1857. * This function is like `arrayIncludes` except that it accepts a comparator.
  1858. *
  1859. * @private
  1860. * @param {Array} [array] The array to inspect.
  1861. * @param {*} target The value to search for.
  1862. * @param {Function} comparator The comparator invoked per element.
  1863. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1864. */
  1865. function arrayIncludesWith(array, value, comparator) {
  1866. var index = -1,
  1867. length = array == null ? 0 : array.length;
  1868. while (++index < length) {
  1869. if (comparator(value, array[index])) {
  1870. return true;
  1871. }
  1872. }
  1873. return false;
  1874. }
  1875. /**
  1876. * A specialized version of `_.map` for arrays without support for iteratee
  1877. * shorthands.
  1878. *
  1879. * @private
  1880. * @param {Array} [array] The array to iterate over.
  1881. * @param {Function} iteratee The function invoked per iteration.
  1882. * @returns {Array} Returns the new mapped array.
  1883. */
  1884. function arrayMap(array, iteratee) {
  1885. var index = -1,
  1886. length = array == null ? 0 : array.length,
  1887. result = Array(length);
  1888. while (++index < length) {
  1889. result[index] = iteratee(array[index], index, array);
  1890. }
  1891. return result;
  1892. }
  1893. /**
  1894. * Appends the elements of `values` to `array`.
  1895. *
  1896. * @private
  1897. * @param {Array} array The array to modify.
  1898. * @param {Array} values The values to append.
  1899. * @returns {Array} Returns `array`.
  1900. */
  1901. function arrayPush(array, values) {
  1902. var index = -1,
  1903. length = values.length,
  1904. offset = array.length;
  1905. while (++index < length) {
  1906. array[offset + index] = values[index];
  1907. }
  1908. return array;
  1909. }
  1910. /**
  1911. * A specialized version of `_.reduce` for arrays without support for
  1912. * iteratee shorthands.
  1913. *
  1914. * @private
  1915. * @param {Array} [array] The array to iterate over.
  1916. * @param {Function} iteratee The function invoked per iteration.
  1917. * @param {*} [accumulator] The initial value.
  1918. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1919. * the initial value.
  1920. * @returns {*} Returns the accumulated value.
  1921. */
  1922. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1923. var index = -1,
  1924. length = array == null ? 0 : array.length;
  1925. if (initAccum && length) {
  1926. accumulator = array[++index];
  1927. }
  1928. while (++index < length) {
  1929. accumulator = iteratee(accumulator, array[index], index, array);
  1930. }
  1931. return accumulator;
  1932. }
  1933. /**
  1934. * A specialized version of `_.reduceRight` for arrays without support for
  1935. * iteratee shorthands.
  1936. *
  1937. * @private
  1938. * @param {Array} [array] The array to iterate over.
  1939. * @param {Function} iteratee The function invoked per iteration.
  1940. * @param {*} [accumulator] The initial value.
  1941. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1942. * the initial value.
  1943. * @returns {*} Returns the accumulated value.
  1944. */
  1945. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1946. var length = array == null ? 0 : array.length;
  1947. if (initAccum && length) {
  1948. accumulator = array[--length];
  1949. }
  1950. while (length--) {
  1951. accumulator = iteratee(accumulator, array[length], length, array);
  1952. }
  1953. return accumulator;
  1954. }
  1955. /**
  1956. * A specialized version of `_.some` for arrays without support for iteratee
  1957. * shorthands.
  1958. *
  1959. * @private
  1960. * @param {Array} [array] The array to iterate over.
  1961. * @param {Function} predicate The function invoked per iteration.
  1962. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1963. * else `false`.
  1964. */
  1965. function arraySome(array, predicate) {
  1966. var index = -1,
  1967. length = array == null ? 0 : array.length;
  1968. while (++index < length) {
  1969. if (predicate(array[index], index, array)) {
  1970. return true;
  1971. }
  1972. }
  1973. return false;
  1974. }
  1975. /**
  1976. * Gets the size of an ASCII `string`.
  1977. *
  1978. * @private
  1979. * @param {string} string The string inspect.
  1980. * @returns {number} Returns the string size.
  1981. */
  1982. var asciiSize = baseProperty('length');
  1983. /**
  1984. * Converts an ASCII `string` to an array.
  1985. *
  1986. * @private
  1987. * @param {string} string The string to convert.
  1988. * @returns {Array} Returns the converted array.
  1989. */
  1990. function asciiToArray(string) {
  1991. return string.split('');
  1992. }
  1993. /**
  1994. * Splits an ASCII `string` into an array of its words.
  1995. *
  1996. * @private
  1997. * @param {string} The string to inspect.
  1998. * @returns {Array} Returns the words of `string`.
  1999. */
  2000. function asciiWords(string) {
  2001. return string.match(reAsciiWord) || [];
  2002. }
  2003. /**
  2004. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2005. * without support for iteratee shorthands, which iterates over `collection`
  2006. * using `eachFunc`.
  2007. *
  2008. * @private
  2009. * @param {Array|Object} collection The collection to inspect.
  2010. * @param {Function} predicate The function invoked per iteration.
  2011. * @param {Function} eachFunc The function to iterate over `collection`.
  2012. * @returns {*} Returns the found element or its key, else `undefined`.
  2013. */
  2014. function baseFindKey(collection, predicate, eachFunc) {
  2015. var result;
  2016. eachFunc(collection, function(value, key, collection) {
  2017. if (predicate(value, key, collection)) {
  2018. result = key;
  2019. return false;
  2020. }
  2021. });
  2022. return result;
  2023. }
  2024. /**
  2025. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2026. * support for iteratee shorthands.
  2027. *
  2028. * @private
  2029. * @param {Array} array The array to inspect.
  2030. * @param {Function} predicate The function invoked per iteration.
  2031. * @param {number} fromIndex The index to search from.
  2032. * @param {boolean} [fromRight] Specify iterating from right to left.
  2033. * @returns {number} Returns the index of the matched value, else `-1`.
  2034. */
  2035. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2036. var length = array.length,
  2037. index = fromIndex + (fromRight ? 1 : -1);
  2038. while ((fromRight ? index-- : ++index < length)) {
  2039. if (predicate(array[index], index, array)) {
  2040. return index;
  2041. }
  2042. }
  2043. return -1;
  2044. }
  2045. /**
  2046. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2047. *
  2048. * @private
  2049. * @param {Array} array The array to inspect.
  2050. * @param {*} value The value to search for.
  2051. * @param {number} fromIndex The index to search from.
  2052. * @returns {number} Returns the index of the matched value, else `-1`.
  2053. */
  2054. function baseIndexOf(array, value, fromIndex) {
  2055. return value === value
  2056. ? strictIndexOf(array, value, fromIndex)
  2057. : baseFindIndex(array, baseIsNaN, fromIndex);
  2058. }
  2059. /**
  2060. * This function is like `baseIndexOf` except that it accepts a comparator.
  2061. *
  2062. * @private
  2063. * @param {Array} array The array to inspect.
  2064. * @param {*} value The value to search for.
  2065. * @param {number} fromIndex The index to search from.
  2066. * @param {Function} comparator The comparator invoked per element.
  2067. * @returns {number} Returns the index of the matched value, else `-1`.
  2068. */
  2069. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2070. var index = fromIndex - 1,
  2071. length = array.length;
  2072. while (++index < length) {
  2073. if (comparator(array[index], value)) {
  2074. return index;
  2075. }
  2076. }
  2077. return -1;
  2078. }
  2079. /**
  2080. * The base implementation of `_.isNaN` without support for number objects.
  2081. *
  2082. * @private
  2083. * @param {*} value The value to check.
  2084. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2085. */
  2086. function baseIsNaN(value) {
  2087. return value !== value;
  2088. }
  2089. /**
  2090. * The base implementation of `_.mean` and `_.meanBy` without support for
  2091. * iteratee shorthands.
  2092. *
  2093. * @private
  2094. * @param {Array} array The array to iterate over.
  2095. * @param {Function} iteratee The function invoked per iteration.
  2096. * @returns {number} Returns the mean.
  2097. */
  2098. function baseMean(array, iteratee) {
  2099. var length = array == null ? 0 : array.length;
  2100. return length ? (baseSum(array, iteratee) / length) : NAN;
  2101. }
  2102. /**
  2103. * The base implementation of `_.property` without support for deep paths.
  2104. *
  2105. * @private
  2106. * @param {string} key The key of the property to get.
  2107. * @returns {Function} Returns the new accessor function.
  2108. */
  2109. function baseProperty(key) {
  2110. return function(object) {
  2111. return object == null ? undefined : object[key];
  2112. };
  2113. }
  2114. /**
  2115. * The base implementation of `_.propertyOf` without support for deep paths.
  2116. *
  2117. * @private
  2118. * @param {Object} object The object to query.
  2119. * @returns {Function} Returns the new accessor function.
  2120. */
  2121. function basePropertyOf(object) {
  2122. return function(key) {
  2123. return object == null ? undefined : object[key];
  2124. };
  2125. }
  2126. /**
  2127. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2128. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2129. *
  2130. * @private
  2131. * @param {Array|Object} collection The collection to iterate over.
  2132. * @param {Function} iteratee The function invoked per iteration.
  2133. * @param {*} accumulator The initial value.
  2134. * @param {boolean} initAccum Specify using the first or last element of
  2135. * `collection` as the initial value.
  2136. * @param {Function} eachFunc The function to iterate over `collection`.
  2137. * @returns {*} Returns the accumulated value.
  2138. */
  2139. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2140. eachFunc(collection, function(value, index, collection) {
  2141. accumulator = initAccum
  2142. ? (initAccum = false, value)
  2143. : iteratee(accumulator, value, index, collection);
  2144. });
  2145. return accumulator;
  2146. }
  2147. /**
  2148. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2149. * sort order of `array` and replaces criteria objects with their corresponding
  2150. * values.
  2151. *
  2152. * @private
  2153. * @param {Array} array The array to sort.
  2154. * @param {Function} comparer The function to define sort order.
  2155. * @returns {Array} Returns `array`.
  2156. */
  2157. function baseSortBy(array, comparer) {
  2158. var length = array.length;
  2159. array.sort(comparer);
  2160. while (length--) {
  2161. array[length] = array[length].value;
  2162. }
  2163. return array;
  2164. }
  2165. /**
  2166. * The base implementation of `_.sum` and `_.sumBy` without support for
  2167. * iteratee shorthands.
  2168. *
  2169. * @private
  2170. * @param {Array} array The array to iterate over.
  2171. * @param {Function} iteratee The function invoked per iteration.
  2172. * @returns {number} Returns the sum.
  2173. */
  2174. function baseSum(array, iteratee) {
  2175. var result,
  2176. index = -1,
  2177. length = array.length;
  2178. while (++index < length) {
  2179. var current = iteratee(array[index]);
  2180. if (current !== undefined) {
  2181. result = result === undefined ? current : (result + current);
  2182. }
  2183. }
  2184. return result;
  2185. }
  2186. /**
  2187. * The base implementation of `_.times` without support for iteratee shorthands
  2188. * or max array length checks.
  2189. *
  2190. * @private
  2191. * @param {number} n The number of times to invoke `iteratee`.
  2192. * @param {Function} iteratee The function invoked per iteration.
  2193. * @returns {Array} Returns the array of results.
  2194. */
  2195. function baseTimes(n, iteratee) {
  2196. var index = -1,
  2197. result = Array(n);
  2198. while (++index < n) {
  2199. result[index] = iteratee(index);
  2200. }
  2201. return result;
  2202. }
  2203. /**
  2204. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2205. * of key-value pairs for `object` corresponding to the property names of `props`.
  2206. *
  2207. * @private
  2208. * @param {Object} object The object to query.
  2209. * @param {Array} props The property names to get values for.
  2210. * @returns {Object} Returns the key-value pairs.
  2211. */
  2212. function baseToPairs(object, props) {
  2213. return arrayMap(props, function(key) {
  2214. return [key, object[key]];
  2215. });
  2216. }
  2217. /**
  2218. * The base implementation of `_.trim`.
  2219. *
  2220. * @private
  2221. * @param {string} string The string to trim.
  2222. * @returns {string} Returns the trimmed string.
  2223. */
  2224. function baseTrim(string) {
  2225. return string
  2226. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2227. : string;
  2228. }
  2229. /**
  2230. * The base implementation of `_.unary` without support for storing metadata.
  2231. *
  2232. * @private
  2233. * @param {Function} func The function to cap arguments for.
  2234. * @returns {Function} Returns the new capped function.
  2235. */
  2236. function baseUnary(func) {
  2237. return function(value) {
  2238. return func(value);
  2239. };
  2240. }
  2241. /**
  2242. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2243. * array of `object` property values corresponding to the property names
  2244. * of `props`.
  2245. *
  2246. * @private
  2247. * @param {Object} object The object to query.
  2248. * @param {Array} props The property names to get values for.
  2249. * @returns {Object} Returns the array of property values.
  2250. */
  2251. function baseValues(object, props) {
  2252. return arrayMap(props, function(key) {
  2253. return object[key];
  2254. });
  2255. }
  2256. /**
  2257. * Checks if a `cache` value for `key` exists.
  2258. *
  2259. * @private
  2260. * @param {Object} cache The cache to query.
  2261. * @param {string} key The key of the entry to check.
  2262. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2263. */
  2264. function cacheHas(cache, key) {
  2265. return cache.has(key);
  2266. }
  2267. /**
  2268. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2269. * that is not found in the character symbols.
  2270. *
  2271. * @private
  2272. * @param {Array} strSymbols The string symbols to inspect.
  2273. * @param {Array} chrSymbols The character symbols to find.
  2274. * @returns {number} Returns the index of the first unmatched string symbol.
  2275. */
  2276. function charsStartIndex(strSymbols, chrSymbols) {
  2277. var index = -1,
  2278. length = strSymbols.length;
  2279. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2280. return index;
  2281. }
  2282. /**
  2283. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2284. * that is not found in the character symbols.
  2285. *
  2286. * @private
  2287. * @param {Array} strSymbols The string symbols to inspect.
  2288. * @param {Array} chrSymbols The character symbols to find.
  2289. * @returns {number} Returns the index of the last unmatched string symbol.
  2290. */
  2291. function charsEndIndex(strSymbols, chrSymbols) {
  2292. var index = strSymbols.length;
  2293. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2294. return index;
  2295. }
  2296. /**
  2297. * Gets the number of `placeholder` occurrences in `array`.
  2298. *
  2299. * @private
  2300. * @param {Array} array The array to inspect.
  2301. * @param {*} placeholder The placeholder to search for.
  2302. * @returns {number} Returns the placeholder count.
  2303. */
  2304. function countHolders(array, placeholder) {
  2305. var length = array.length,
  2306. result = 0;
  2307. while (length--) {
  2308. if (array[length] === placeholder) {
  2309. ++result;
  2310. }
  2311. }
  2312. return result;
  2313. }
  2314. /**
  2315. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2316. * letters to basic Latin letters.
  2317. *
  2318. * @private
  2319. * @param {string} letter The matched letter to deburr.
  2320. * @returns {string} Returns the deburred letter.
  2321. */
  2322. var deburrLetter = basePropertyOf(deburredLetters);
  2323. /**
  2324. * Used by `_.escape` to convert characters to HTML entities.
  2325. *
  2326. * @private
  2327. * @param {string} chr The matched character to escape.
  2328. * @returns {string} Returns the escaped character.
  2329. */
  2330. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2331. /**
  2332. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2333. *
  2334. * @private
  2335. * @param {string} chr The matched character to escape.
  2336. * @returns {string} Returns the escaped character.
  2337. */
  2338. function escapeStringChar(chr) {
  2339. return '\\' + stringEscapes[chr];
  2340. }
  2341. /**
  2342. * Gets the value at `key` of `object`.
  2343. *
  2344. * @private
  2345. * @param {Object} [object] The object to query.
  2346. * @param {string} key The key of the property to get.
  2347. * @returns {*} Returns the property value.
  2348. */
  2349. function getValue(object, key) {
  2350. return object == null ? undefined : object[key];
  2351. }
  2352. /**
  2353. * Checks if `string` contains Unicode symbols.
  2354. *
  2355. * @private
  2356. * @param {string} string The string to inspect.
  2357. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2358. */
  2359. function hasUnicode(string) {
  2360. return reHasUnicode.test(string);
  2361. }
  2362. /**
  2363. * Checks if `string` contains a word composed of Unicode symbols.
  2364. *
  2365. * @private
  2366. * @param {string} string The string to inspect.
  2367. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2368. */
  2369. function hasUnicodeWord(string) {
  2370. return reHasUnicodeWord.test(string);
  2371. }
  2372. /**
  2373. * Converts `iterator` to an array.
  2374. *
  2375. * @private
  2376. * @param {Object} iterator The iterator to convert.
  2377. * @returns {Array} Returns the converted array.
  2378. */
  2379. function iteratorToArray(iterator) {
  2380. var data,
  2381. result = [];
  2382. while (!(data = iterator.next()).done) {
  2383. result.push(data.value);
  2384. }
  2385. return result;
  2386. }
  2387. /**
  2388. * Converts `map` to its key-value pairs.
  2389. *
  2390. * @private
  2391. * @param {Object} map The map to convert.
  2392. * @returns {Array} Returns the key-value pairs.
  2393. */
  2394. function mapToArray(map) {
  2395. var index = -1,
  2396. result = Array(map.size);
  2397. map.forEach(function(value, key) {
  2398. result[++index] = [key, value];
  2399. });
  2400. return result;
  2401. }
  2402. /**
  2403. * Creates a unary function that invokes `func` with its argument transformed.
  2404. *
  2405. * @private
  2406. * @param {Function} func The function to wrap.
  2407. * @param {Function} transform The argument transform.
  2408. * @returns {Function} Returns the new function.
  2409. */
  2410. function overArg(func, transform) {
  2411. return function(arg) {
  2412. return func(transform(arg));
  2413. };
  2414. }
  2415. /**
  2416. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2417. * and returns an array of their indexes.
  2418. *
  2419. * @private
  2420. * @param {Array} array The array to modify.
  2421. * @param {*} placeholder The placeholder to replace.
  2422. * @returns {Array} Returns the new array of placeholder indexes.
  2423. */
  2424. function replaceHolders(array, placeholder) {
  2425. var index = -1,
  2426. length = array.length,
  2427. resIndex = 0,
  2428. result = [];
  2429. while (++index < length) {
  2430. var value = array[index];
  2431. if (value === placeholder || value === PLACEHOLDER) {
  2432. array[index] = PLACEHOLDER;
  2433. result[resIndex++] = index;
  2434. }
  2435. }
  2436. return result;
  2437. }
  2438. /**
  2439. * Converts `set` to an array of its values.
  2440. *
  2441. * @private
  2442. * @param {Object} set The set to convert.
  2443. * @returns {Array} Returns the values.
  2444. */
  2445. function setToArray(set) {
  2446. var index = -1,
  2447. result = Array(set.size);
  2448. set.forEach(function(value) {
  2449. result[++index] = value;
  2450. });
  2451. return result;
  2452. }
  2453. /**
  2454. * Converts `set` to its value-value pairs.
  2455. *
  2456. * @private
  2457. * @param {Object} set The set to convert.
  2458. * @returns {Array} Returns the value-value pairs.
  2459. */
  2460. function setToPairs(set) {
  2461. var index = -1,
  2462. result = Array(set.size);
  2463. set.forEach(function(value) {
  2464. result[++index] = [value, value];
  2465. });
  2466. return result;
  2467. }
  2468. /**
  2469. * A specialized version of `_.indexOf` which performs strict equality
  2470. * comparisons of values, i.e. `===`.
  2471. *
  2472. * @private
  2473. * @param {Array} array The array to inspect.
  2474. * @param {*} value The value to search for.
  2475. * @param {number} fromIndex The index to search from.
  2476. * @returns {number} Returns the index of the matched value, else `-1`.
  2477. */
  2478. function strictIndexOf(array, value, fromIndex) {
  2479. var index = fromIndex - 1,
  2480. length = array.length;
  2481. while (++index < length) {
  2482. if (array[index] === value) {
  2483. return index;
  2484. }
  2485. }
  2486. return -1;
  2487. }
  2488. /**
  2489. * A specialized version of `_.lastIndexOf` which performs strict equality
  2490. * comparisons of values, i.e. `===`.
  2491. *
  2492. * @private
  2493. * @param {Array} array The array to inspect.
  2494. * @param {*} value The value to search for.
  2495. * @param {number} fromIndex The index to search from.
  2496. * @returns {number} Returns the index of the matched value, else `-1`.
  2497. */
  2498. function strictLastIndexOf(array, value, fromIndex) {
  2499. var index = fromIndex + 1;
  2500. while (index--) {
  2501. if (array[index] === value) {
  2502. return index;
  2503. }
  2504. }
  2505. return index;
  2506. }
  2507. /**
  2508. * Gets the number of symbols in `string`.
  2509. *
  2510. * @private
  2511. * @param {string} string The string to inspect.
  2512. * @returns {number} Returns the string size.
  2513. */
  2514. function stringSize(string) {
  2515. return hasUnicode(string)
  2516. ? unicodeSize(string)
  2517. : asciiSize(string);
  2518. }
  2519. /**
  2520. * Converts `string` to an array.
  2521. *
  2522. * @private
  2523. * @param {string} string The string to convert.
  2524. * @returns {Array} Returns the converted array.
  2525. */
  2526. function stringToArray(string) {
  2527. return hasUnicode(string)
  2528. ? unicodeToArray(string)
  2529. : asciiToArray(string);
  2530. }
  2531. /**
  2532. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2533. * character of `string`.
  2534. *
  2535. * @private
  2536. * @param {string} string The string to inspect.
  2537. * @returns {number} Returns the index of the last non-whitespace character.
  2538. */
  2539. function trimmedEndIndex(string) {
  2540. var index = string.length;
  2541. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2542. return index;
  2543. }
  2544. /**
  2545. * Used by `_.unescape` to convert HTML entities to characters.
  2546. *
  2547. * @private
  2548. * @param {string} chr The matched character to unescape.
  2549. * @returns {string} Returns the unescaped character.
  2550. */
  2551. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2552. /**
  2553. * Gets the size of a Unicode `string`.
  2554. *
  2555. * @private
  2556. * @param {string} string The string inspect.
  2557. * @returns {number} Returns the string size.
  2558. */
  2559. function unicodeSize(string) {
  2560. var result = reUnicode.lastIndex = 0;
  2561. while (reUnicode.test(string)) {
  2562. ++result;
  2563. }
  2564. return result;
  2565. }
  2566. /**
  2567. * Converts a Unicode `string` to an array.
  2568. *
  2569. * @private
  2570. * @param {string} string The string to convert.
  2571. * @returns {Array} Returns the converted array.
  2572. */
  2573. function unicodeToArray(string) {
  2574. return string.match(reUnicode) || [];
  2575. }
  2576. /**
  2577. * Splits a Unicode `string` into an array of its words.
  2578. *
  2579. * @private
  2580. * @param {string} The string to inspect.
  2581. * @returns {Array} Returns the words of `string`.
  2582. */
  2583. function unicodeWords(string) {
  2584. return string.match(reUnicodeWord) || [];
  2585. }
  2586. /*--------------------------------------------------------------------------*/
  2587. /**
  2588. * Create a new pristine `lodash` function using the `context` object.
  2589. *
  2590. * @static
  2591. * @memberOf _
  2592. * @since 1.1.0
  2593. * @category Util
  2594. * @param {Object} [context=root] The context object.
  2595. * @returns {Function} Returns a new `lodash` function.
  2596. * @example
  2597. *
  2598. * _.mixin({ 'foo': _.constant('foo') });
  2599. *
  2600. * var lodash = _.runInContext();
  2601. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2602. *
  2603. * _.isFunction(_.foo);
  2604. * // => true
  2605. * _.isFunction(_.bar);
  2606. * // => false
  2607. *
  2608. * lodash.isFunction(lodash.foo);
  2609. * // => false
  2610. * lodash.isFunction(lodash.bar);
  2611. * // => true
  2612. *
  2613. * // Create a suped-up `defer` in Node.js.
  2614. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2615. */
  2616. var runInContext = (function runInContext(context) {
  2617. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2618. /** Built-in constructor references. */
  2619. var Array = context.Array,
  2620. Date = context.Date,
  2621. Error = context.Error,
  2622. Function = context.Function,
  2623. Math = context.Math,
  2624. Object = context.Object,
  2625. RegExp = context.RegExp,
  2626. String = context.String,
  2627. TypeError = context.TypeError;
  2628. /** Used for built-in method references. */
  2629. var arrayProto = Array.prototype,
  2630. funcProto = Function.prototype,
  2631. objectProto = Object.prototype;
  2632. /** Used to detect overreaching core-js shims. */
  2633. var coreJsData = context['__core-js_shared__'];
  2634. /** Used to resolve the decompiled source of functions. */
  2635. var funcToString = funcProto.toString;
  2636. /** Used to check objects for own properties. */
  2637. var hasOwnProperty = objectProto.hasOwnProperty;
  2638. /** Used to generate unique IDs. */
  2639. var idCounter = 0;
  2640. /** Used to detect methods masquerading as native. */
  2641. var maskSrcKey = (function() {
  2642. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2643. return uid ? ('Symbol(src)_1.' + uid) : '';
  2644. }());
  2645. /**
  2646. * Used to resolve the
  2647. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2648. * of values.
  2649. */
  2650. var nativeObjectToString = objectProto.toString;
  2651. /** Used to infer the `Object` constructor. */
  2652. var objectCtorString = funcToString.call(Object);
  2653. /** Used to restore the original `_` reference in `_.noConflict`. */
  2654. var oldDash = root._;
  2655. /** Used to detect if a method is native. */
  2656. var reIsNative = RegExp('^' +
  2657. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2658. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2659. );
  2660. /** Built-in value references. */
  2661. var Buffer = moduleExports ? context.Buffer : undefined,
  2662. Symbol = context.Symbol,
  2663. Uint8Array = context.Uint8Array,
  2664. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2665. getPrototype = overArg(Object.getPrototypeOf, Object),
  2666. objectCreate = Object.create,
  2667. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2668. splice = arrayProto.splice,
  2669. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2670. symIterator = Symbol ? Symbol.iterator : undefined,
  2671. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2672. var defineProperty = (function() {
  2673. try {
  2674. var func = getNative(Object, 'defineProperty');
  2675. func({}, '', {});
  2676. return func;
  2677. } catch (e) {}
  2678. }());
  2679. /** Mocked built-ins. */
  2680. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2681. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2682. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2683. /* Built-in method references for those with the same name as other `lodash` methods. */
  2684. var nativeCeil = Math.ceil,
  2685. nativeFloor = Math.floor,
  2686. nativeGetSymbols = Object.getOwnPropertySymbols,
  2687. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2688. nativeIsFinite = context.isFinite,
  2689. nativeJoin = arrayProto.join,
  2690. nativeKeys = overArg(Object.keys, Object),
  2691. nativeMax = Math.max,
  2692. nativeMin = Math.min,
  2693. nativeNow = Date.now,
  2694. nativeParseInt = context.parseInt,
  2695. nativeRandom = Math.random,
  2696. nativeReverse = arrayProto.reverse;
  2697. /* Built-in method references that are verified to be native. */
  2698. var DataView = getNative(context, 'DataView'),
  2699. Map = getNative(context, 'Map'),
  2700. Promise = getNative(context, 'Promise'),
  2701. Set = getNative(context, 'Set'),
  2702. WeakMap = getNative(context, 'WeakMap'),
  2703. nativeCreate = getNative(Object, 'create');
  2704. /** Used to store function metadata. */
  2705. var metaMap = WeakMap && new WeakMap;
  2706. /** Used to lookup unminified function names. */
  2707. var realNames = {};
  2708. /** Used to detect maps, sets, and weakmaps. */
  2709. var dataViewCtorString = toSource(DataView),
  2710. mapCtorString = toSource(Map),
  2711. promiseCtorString = toSource(Promise),
  2712. setCtorString = toSource(Set),
  2713. weakMapCtorString = toSource(WeakMap);
  2714. /** Used to convert symbols to primitives and strings. */
  2715. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2716. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2717. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2718. /*------------------------------------------------------------------------*/
  2719. /**
  2720. * Creates a `lodash` object which wraps `value` to enable implicit method
  2721. * chain sequences. Methods that operate on and return arrays, collections,
  2722. * and functions can be chained together. Methods that retrieve a single value
  2723. * or may return a primitive value will automatically end the chain sequence
  2724. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2725. * with `_#value`.
  2726. *
  2727. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2728. * enabled using `_.chain`.
  2729. *
  2730. * The execution of chained methods is lazy, that is, it's deferred until
  2731. * `_#value` is implicitly or explicitly called.
  2732. *
  2733. * Lazy evaluation allows several methods to support shortcut fusion.
  2734. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2735. * the creation of intermediate arrays and can greatly reduce the number of
  2736. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2737. * fusion if the section is applied to an array and iteratees accept only
  2738. * one argument. The heuristic for whether a section qualifies for shortcut
  2739. * fusion is subject to change.
  2740. *
  2741. * Chaining is supported in custom builds as long as the `_#value` method is
  2742. * directly or indirectly included in the build.
  2743. *
  2744. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2745. *
  2746. * The wrapper `Array` methods are:
  2747. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2748. *
  2749. * The wrapper `String` methods are:
  2750. * `replace` and `split`
  2751. *
  2752. * The wrapper methods that support shortcut fusion are:
  2753. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2754. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2755. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2756. *
  2757. * The chainable wrapper methods are:
  2758. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2759. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2760. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2761. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2762. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2763. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2764. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2765. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2766. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2767. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2768. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2769. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2770. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2771. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2772. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2773. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2774. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2775. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2776. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2777. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2778. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2779. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2780. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2781. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2782. *
  2783. * The wrapper methods that are **not** chainable by default are:
  2784. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2785. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2786. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2787. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2788. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2789. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2790. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2791. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2792. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2793. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2794. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2795. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2796. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2797. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2798. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2799. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2800. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2801. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2802. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2803. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2804. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2805. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2806. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2807. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2808. * `upperFirst`, `value`, and `words`
  2809. *
  2810. * @name _
  2811. * @constructor
  2812. * @category Seq
  2813. * @param {*} value The value to wrap in a `lodash` instance.
  2814. * @returns {Object} Returns the new `lodash` wrapper instance.
  2815. * @example
  2816. *
  2817. * function square(n) {
  2818. * return n * n;
  2819. * }
  2820. *
  2821. * var wrapped = _([1, 2, 3]);
  2822. *
  2823. * // Returns an unwrapped value.
  2824. * wrapped.reduce(_.add);
  2825. * // => 6
  2826. *
  2827. * // Returns a wrapped value.
  2828. * var squares = wrapped.map(square);
  2829. *
  2830. * _.isArray(squares);
  2831. * // => false
  2832. *
  2833. * _.isArray(squares.value());
  2834. * // => true
  2835. */
  2836. function lodash(value) {
  2837. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2838. if (value instanceof LodashWrapper) {
  2839. return value;
  2840. }
  2841. if (hasOwnProperty.call(value, '__wrapped__')) {
  2842. return wrapperClone(value);
  2843. }
  2844. }
  2845. return new LodashWrapper(value);
  2846. }
  2847. /**
  2848. * The base implementation of `_.create` without support for assigning
  2849. * properties to the created object.
  2850. *
  2851. * @private
  2852. * @param {Object} proto The object to inherit from.
  2853. * @returns {Object} Returns the new object.
  2854. */
  2855. var baseCreate = (function() {
  2856. function object() {}
  2857. return function(proto) {
  2858. if (!isObject(proto)) {
  2859. return {};
  2860. }
  2861. if (objectCreate) {
  2862. return objectCreate(proto);
  2863. }
  2864. object.prototype = proto;
  2865. var result = new object;
  2866. object.prototype = undefined;
  2867. return result;
  2868. };
  2869. }());
  2870. /**
  2871. * The function whose prototype chain sequence wrappers inherit from.
  2872. *
  2873. * @private
  2874. */
  2875. function baseLodash() {
  2876. // No operation performed.
  2877. }
  2878. /**
  2879. * The base constructor for creating `lodash` wrapper objects.
  2880. *
  2881. * @private
  2882. * @param {*} value The value to wrap.
  2883. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2884. */
  2885. function LodashWrapper(value, chainAll) {
  2886. this.__wrapped__ = value;
  2887. this.__actions__ = [];
  2888. this.__chain__ = !!chainAll;
  2889. this.__index__ = 0;
  2890. this.__values__ = undefined;
  2891. }
  2892. /**
  2893. * By default, the template delimiters used by lodash are like those in
  2894. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2895. * following template settings to use alternative delimiters.
  2896. *
  2897. * @static
  2898. * @memberOf _
  2899. * @type {Object}
  2900. */
  2901. lodash.templateSettings = {
  2902. /**
  2903. * Used to detect `data` property values to be HTML-escaped.
  2904. *
  2905. * @memberOf _.templateSettings
  2906. * @type {RegExp}
  2907. */
  2908. 'escape': reEscape,
  2909. /**
  2910. * Used to detect code to be evaluated.
  2911. *
  2912. * @memberOf _.templateSettings
  2913. * @type {RegExp}
  2914. */
  2915. 'evaluate': reEvaluate,
  2916. /**
  2917. * Used to detect `data` property values to inject.
  2918. *
  2919. * @memberOf _.templateSettings
  2920. * @type {RegExp}
  2921. */
  2922. 'interpolate': reInterpolate,
  2923. /**
  2924. * Used to reference the data object in the template text.
  2925. *
  2926. * @memberOf _.templateSettings
  2927. * @type {string}
  2928. */
  2929. 'variable': '',
  2930. /**
  2931. * Used to import variables into the compiled template.
  2932. *
  2933. * @memberOf _.templateSettings
  2934. * @type {Object}
  2935. */
  2936. 'imports': {
  2937. /**
  2938. * A reference to the `lodash` function.
  2939. *
  2940. * @memberOf _.templateSettings.imports
  2941. * @type {Function}
  2942. */
  2943. '_': lodash
  2944. }
  2945. };
  2946. // Ensure wrappers are instances of `baseLodash`.
  2947. lodash.prototype = baseLodash.prototype;
  2948. lodash.prototype.constructor = lodash;
  2949. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2950. LodashWrapper.prototype.constructor = LodashWrapper;
  2951. /*------------------------------------------------------------------------*/
  2952. /**
  2953. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2954. *
  2955. * @private
  2956. * @constructor
  2957. * @param {*} value The value to wrap.
  2958. */
  2959. function LazyWrapper(value) {
  2960. this.__wrapped__ = value;
  2961. this.__actions__ = [];
  2962. this.__dir__ = 1;
  2963. this.__filtered__ = false;
  2964. this.__iteratees__ = [];
  2965. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2966. this.__views__ = [];
  2967. }
  2968. /**
  2969. * Creates a clone of the lazy wrapper object.
  2970. *
  2971. * @private
  2972. * @name clone
  2973. * @memberOf LazyWrapper
  2974. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2975. */
  2976. function lazyClone() {
  2977. var result = new LazyWrapper(this.__wrapped__);
  2978. result.__actions__ = copyArray(this.__actions__);
  2979. result.__dir__ = this.__dir__;
  2980. result.__filtered__ = this.__filtered__;
  2981. result.__iteratees__ = copyArray(this.__iteratees__);
  2982. result.__takeCount__ = this.__takeCount__;
  2983. result.__views__ = copyArray(this.__views__);
  2984. return result;
  2985. }
  2986. /**
  2987. * Reverses the direction of lazy iteration.
  2988. *
  2989. * @private
  2990. * @name reverse
  2991. * @memberOf LazyWrapper
  2992. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2993. */
  2994. function lazyReverse() {
  2995. if (this.__filtered__) {
  2996. var result = new LazyWrapper(this);
  2997. result.__dir__ = -1;
  2998. result.__filtered__ = true;
  2999. } else {
  3000. result = this.clone();
  3001. result.__dir__ *= -1;
  3002. }
  3003. return result;
  3004. }
  3005. /**
  3006. * Extracts the unwrapped value from its lazy wrapper.
  3007. *
  3008. * @private
  3009. * @name value
  3010. * @memberOf LazyWrapper
  3011. * @returns {*} Returns the unwrapped value.
  3012. */
  3013. function lazyValue() {
  3014. var array = this.__wrapped__.value(),
  3015. dir = this.__dir__,
  3016. isArr = isArray(array),
  3017. isRight = dir < 0,
  3018. arrLength = isArr ? array.length : 0,
  3019. view = getView(0, arrLength, this.__views__),
  3020. start = view.start,
  3021. end = view.end,
  3022. length = end - start,
  3023. index = isRight ? end : (start - 1),
  3024. iteratees = this.__iteratees__,
  3025. iterLength = iteratees.length,
  3026. resIndex = 0,
  3027. takeCount = nativeMin(length, this.__takeCount__);
  3028. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3029. return baseWrapperValue(array, this.__actions__);
  3030. }
  3031. var result = [];
  3032. outer:
  3033. while (length-- && resIndex < takeCount) {
  3034. index += dir;
  3035. var iterIndex = -1,
  3036. value = array[index];
  3037. while (++iterIndex < iterLength) {
  3038. var data = iteratees[iterIndex],
  3039. iteratee = data.iteratee,
  3040. type = data.type,
  3041. computed = iteratee(value);
  3042. if (type == LAZY_MAP_FLAG) {
  3043. value = computed;
  3044. } else if (!computed) {
  3045. if (type == LAZY_FILTER_FLAG) {
  3046. continue outer;
  3047. } else {
  3048. break outer;
  3049. }
  3050. }
  3051. }
  3052. result[resIndex++] = value;
  3053. }
  3054. return result;
  3055. }
  3056. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3057. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3058. LazyWrapper.prototype.constructor = LazyWrapper;
  3059. /*------------------------------------------------------------------------*/
  3060. /**
  3061. * Creates a hash object.
  3062. *
  3063. * @private
  3064. * @constructor
  3065. * @param {Array} [entries] The key-value pairs to cache.
  3066. */
  3067. function Hash(entries) {
  3068. var index = -1,
  3069. length = entries == null ? 0 : entries.length;
  3070. this.clear();
  3071. while (++index < length) {
  3072. var entry = entries[index];
  3073. this.set(entry[0], entry[1]);
  3074. }
  3075. }
  3076. /**
  3077. * Removes all key-value entries from the hash.
  3078. *
  3079. * @private
  3080. * @name clear
  3081. * @memberOf Hash
  3082. */
  3083. function hashClear() {
  3084. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3085. this.size = 0;
  3086. }
  3087. /**
  3088. * Removes `key` and its value from the hash.
  3089. *
  3090. * @private
  3091. * @name delete
  3092. * @memberOf Hash
  3093. * @param {Object} hash The hash to modify.
  3094. * @param {string} key The key of the value to remove.
  3095. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3096. */
  3097. function hashDelete(key) {
  3098. var result = this.has(key) && delete this.__data__[key];
  3099. this.size -= result ? 1 : 0;
  3100. return result;
  3101. }
  3102. /**
  3103. * Gets the hash value for `key`.
  3104. *
  3105. * @private
  3106. * @name get
  3107. * @memberOf Hash
  3108. * @param {string} key The key of the value to get.
  3109. * @returns {*} Returns the entry value.
  3110. */
  3111. function hashGet(key) {
  3112. var data = this.__data__;
  3113. if (nativeCreate) {
  3114. var result = data[key];
  3115. return result === HASH_UNDEFINED ? undefined : result;
  3116. }
  3117. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3118. }
  3119. /**
  3120. * Checks if a hash value for `key` exists.
  3121. *
  3122. * @private
  3123. * @name has
  3124. * @memberOf Hash
  3125. * @param {string} key The key of the entry to check.
  3126. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3127. */
  3128. function hashHas(key) {
  3129. var data = this.__data__;
  3130. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3131. }
  3132. /**
  3133. * Sets the hash `key` to `value`.
  3134. *
  3135. * @private
  3136. * @name set
  3137. * @memberOf Hash
  3138. * @param {string} key The key of the value to set.
  3139. * @param {*} value The value to set.
  3140. * @returns {Object} Returns the hash instance.
  3141. */
  3142. function hashSet(key, value) {
  3143. var data = this.__data__;
  3144. this.size += this.has(key) ? 0 : 1;
  3145. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3146. return this;
  3147. }
  3148. // Add methods to `Hash`.
  3149. Hash.prototype.clear = hashClear;
  3150. Hash.prototype['delete'] = hashDelete;
  3151. Hash.prototype.get = hashGet;
  3152. Hash.prototype.has = hashHas;
  3153. Hash.prototype.set = hashSet;
  3154. /*------------------------------------------------------------------------*/
  3155. /**
  3156. * Creates an list cache object.
  3157. *
  3158. * @private
  3159. * @constructor
  3160. * @param {Array} [entries] The key-value pairs to cache.
  3161. */
  3162. function ListCache(entries) {
  3163. var index = -1,
  3164. length = entries == null ? 0 : entries.length;
  3165. this.clear();
  3166. while (++index < length) {
  3167. var entry = entries[index];
  3168. this.set(entry[0], entry[1]);
  3169. }
  3170. }
  3171. /**
  3172. * Removes all key-value entries from the list cache.
  3173. *
  3174. * @private
  3175. * @name clear
  3176. * @memberOf ListCache
  3177. */
  3178. function listCacheClear() {
  3179. this.__data__ = [];
  3180. this.size = 0;
  3181. }
  3182. /**
  3183. * Removes `key` and its value from the list cache.
  3184. *
  3185. * @private
  3186. * @name delete
  3187. * @memberOf ListCache
  3188. * @param {string} key The key of the value to remove.
  3189. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3190. */
  3191. function listCacheDelete(key) {
  3192. var data = this.__data__,
  3193. index = assocIndexOf(data, key);
  3194. if (index < 0) {
  3195. return false;
  3196. }
  3197. var lastIndex = data.length - 1;
  3198. if (index == lastIndex) {
  3199. data.pop();
  3200. } else {
  3201. splice.call(data, index, 1);
  3202. }
  3203. --this.size;
  3204. return true;
  3205. }
  3206. /**
  3207. * Gets the list cache value for `key`.
  3208. *
  3209. * @private
  3210. * @name get
  3211. * @memberOf ListCache
  3212. * @param {string} key The key of the value to get.
  3213. * @returns {*} Returns the entry value.
  3214. */
  3215. function listCacheGet(key) {
  3216. var data = this.__data__,
  3217. index = assocIndexOf(data, key);
  3218. return index < 0 ? undefined : data[index][1];
  3219. }
  3220. /**
  3221. * Checks if a list cache value for `key` exists.
  3222. *
  3223. * @private
  3224. * @name has
  3225. * @memberOf ListCache
  3226. * @param {string} key The key of the entry to check.
  3227. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3228. */
  3229. function listCacheHas(key) {
  3230. return assocIndexOf(this.__data__, key) > -1;
  3231. }
  3232. /**
  3233. * Sets the list cache `key` to `value`.
  3234. *
  3235. * @private
  3236. * @name set
  3237. * @memberOf ListCache
  3238. * @param {string} key The key of the value to set.
  3239. * @param {*} value The value to set.
  3240. * @returns {Object} Returns the list cache instance.
  3241. */
  3242. function listCacheSet(key, value) {
  3243. var data = this.__data__,
  3244. index = assocIndexOf(data, key);
  3245. if (index < 0) {
  3246. ++this.size;
  3247. data.push([key, value]);
  3248. } else {
  3249. data[index][1] = value;
  3250. }
  3251. return this;
  3252. }
  3253. // Add methods to `ListCache`.
  3254. ListCache.prototype.clear = listCacheClear;
  3255. ListCache.prototype['delete'] = listCacheDelete;
  3256. ListCache.prototype.get = listCacheGet;
  3257. ListCache.prototype.has = listCacheHas;
  3258. ListCache.prototype.set = listCacheSet;
  3259. /*------------------------------------------------------------------------*/
  3260. /**
  3261. * Creates a map cache object to store key-value pairs.
  3262. *
  3263. * @private
  3264. * @constructor
  3265. * @param {Array} [entries] The key-value pairs to cache.
  3266. */
  3267. function MapCache(entries) {
  3268. var index = -1,
  3269. length = entries == null ? 0 : entries.length;
  3270. this.clear();
  3271. while (++index < length) {
  3272. var entry = entries[index];
  3273. this.set(entry[0], entry[1]);
  3274. }
  3275. }
  3276. /**
  3277. * Removes all key-value entries from the map.
  3278. *
  3279. * @private
  3280. * @name clear
  3281. * @memberOf MapCache
  3282. */
  3283. function mapCacheClear() {
  3284. this.size = 0;
  3285. this.__data__ = {
  3286. 'hash': new Hash,
  3287. 'map': new (Map || ListCache),
  3288. 'string': new Hash
  3289. };
  3290. }
  3291. /**
  3292. * Removes `key` and its value from the map.
  3293. *
  3294. * @private
  3295. * @name delete
  3296. * @memberOf MapCache
  3297. * @param {string} key The key of the value to remove.
  3298. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3299. */
  3300. function mapCacheDelete(key) {
  3301. var result = getMapData(this, key)['delete'](key);
  3302. this.size -= result ? 1 : 0;
  3303. return result;
  3304. }
  3305. /**
  3306. * Gets the map value for `key`.
  3307. *
  3308. * @private
  3309. * @name get
  3310. * @memberOf MapCache
  3311. * @param {string} key The key of the value to get.
  3312. * @returns {*} Returns the entry value.
  3313. */
  3314. function mapCacheGet(key) {
  3315. return getMapData(this, key).get(key);
  3316. }
  3317. /**
  3318. * Checks if a map value for `key` exists.
  3319. *
  3320. * @private
  3321. * @name has
  3322. * @memberOf MapCache
  3323. * @param {string} key The key of the entry to check.
  3324. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3325. */
  3326. function mapCacheHas(key) {
  3327. return getMapData(this, key).has(key);
  3328. }
  3329. /**
  3330. * Sets the map `key` to `value`.
  3331. *
  3332. * @private
  3333. * @name set
  3334. * @memberOf MapCache
  3335. * @param {string} key The key of the value to set.
  3336. * @param {*} value The value to set.
  3337. * @returns {Object} Returns the map cache instance.
  3338. */
  3339. function mapCacheSet(key, value) {
  3340. var data = getMapData(this, key),
  3341. size = data.size;
  3342. data.set(key, value);
  3343. this.size += data.size == size ? 0 : 1;
  3344. return this;
  3345. }
  3346. // Add methods to `MapCache`.
  3347. MapCache.prototype.clear = mapCacheClear;
  3348. MapCache.prototype['delete'] = mapCacheDelete;
  3349. MapCache.prototype.get = mapCacheGet;
  3350. MapCache.prototype.has = mapCacheHas;
  3351. MapCache.prototype.set = mapCacheSet;
  3352. /*------------------------------------------------------------------------*/
  3353. /**
  3354. *
  3355. * Creates an array cache object to store unique values.
  3356. *
  3357. * @private
  3358. * @constructor
  3359. * @param {Array} [values] The values to cache.
  3360. */
  3361. function SetCache(values) {
  3362. var index = -1,
  3363. length = values == null ? 0 : values.length;
  3364. this.__data__ = new MapCache;
  3365. while (++index < length) {
  3366. this.add(values[index]);
  3367. }
  3368. }
  3369. /**
  3370. * Adds `value` to the array cache.
  3371. *
  3372. * @private
  3373. * @name add
  3374. * @memberOf SetCache
  3375. * @alias push
  3376. * @param {*} value The value to cache.
  3377. * @returns {Object} Returns the cache instance.
  3378. */
  3379. function setCacheAdd(value) {
  3380. this.__data__.set(value, HASH_UNDEFINED);
  3381. return this;
  3382. }
  3383. /**
  3384. * Checks if `value` is in the array cache.
  3385. *
  3386. * @private
  3387. * @name has
  3388. * @memberOf SetCache
  3389. * @param {*} value The value to search for.
  3390. * @returns {number} Returns `true` if `value` is found, else `false`.
  3391. */
  3392. function setCacheHas(value) {
  3393. return this.__data__.has(value);
  3394. }
  3395. // Add methods to `SetCache`.
  3396. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3397. SetCache.prototype.has = setCacheHas;
  3398. /*------------------------------------------------------------------------*/
  3399. /**
  3400. * Creates a stack cache object to store key-value pairs.
  3401. *
  3402. * @private
  3403. * @constructor
  3404. * @param {Array} [entries] The key-value pairs to cache.
  3405. */
  3406. function Stack(entries) {
  3407. var data = this.__data__ = new ListCache(entries);
  3408. this.size = data.size;
  3409. }
  3410. /**
  3411. * Removes all key-value entries from the stack.
  3412. *
  3413. * @private
  3414. * @name clear
  3415. * @memberOf Stack
  3416. */
  3417. function stackClear() {
  3418. this.__data__ = new ListCache;
  3419. this.size = 0;
  3420. }
  3421. /**
  3422. * Removes `key` and its value from the stack.
  3423. *
  3424. * @private
  3425. * @name delete
  3426. * @memberOf Stack
  3427. * @param {string} key The key of the value to remove.
  3428. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3429. */
  3430. function stackDelete(key) {
  3431. var data = this.__data__,
  3432. result = data['delete'](key);
  3433. this.size = data.size;
  3434. return result;
  3435. }
  3436. /**
  3437. * Gets the stack value for `key`.
  3438. *
  3439. * @private
  3440. * @name get
  3441. * @memberOf Stack
  3442. * @param {string} key The key of the value to get.
  3443. * @returns {*} Returns the entry value.
  3444. */
  3445. function stackGet(key) {
  3446. return this.__data__.get(key);
  3447. }
  3448. /**
  3449. * Checks if a stack value for `key` exists.
  3450. *
  3451. * @private
  3452. * @name has
  3453. * @memberOf Stack
  3454. * @param {string} key The key of the entry to check.
  3455. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3456. */
  3457. function stackHas(key) {
  3458. return this.__data__.has(key);
  3459. }
  3460. /**
  3461. * Sets the stack `key` to `value`.
  3462. *
  3463. * @private
  3464. * @name set
  3465. * @memberOf Stack
  3466. * @param {string} key The key of the value to set.
  3467. * @param {*} value The value to set.
  3468. * @returns {Object} Returns the stack cache instance.
  3469. */
  3470. function stackSet(key, value) {
  3471. var data = this.__data__;
  3472. if (data instanceof ListCache) {
  3473. var pairs = data.__data__;
  3474. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3475. pairs.push([key, value]);
  3476. this.size = ++data.size;
  3477. return this;
  3478. }
  3479. data = this.__data__ = new MapCache(pairs);
  3480. }
  3481. data.set(key, value);
  3482. this.size = data.size;
  3483. return this;
  3484. }
  3485. // Add methods to `Stack`.
  3486. Stack.prototype.clear = stackClear;
  3487. Stack.prototype['delete'] = stackDelete;
  3488. Stack.prototype.get = stackGet;
  3489. Stack.prototype.has = stackHas;
  3490. Stack.prototype.set = stackSet;
  3491. /*------------------------------------------------------------------------*/
  3492. /**
  3493. * Creates an array of the enumerable property names of the array-like `value`.
  3494. *
  3495. * @private
  3496. * @param {*} value The value to query.
  3497. * @param {boolean} inherited Specify returning inherited property names.
  3498. * @returns {Array} Returns the array of property names.
  3499. */
  3500. function arrayLikeKeys(value, inherited) {
  3501. var isArr = isArray(value),
  3502. isArg = !isArr && isArguments(value),
  3503. isBuff = !isArr && !isArg && isBuffer(value),
  3504. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3505. skipIndexes = isArr || isArg || isBuff || isType,
  3506. result = skipIndexes ? baseTimes(value.length, String) : [],
  3507. length = result.length;
  3508. for (var key in value) {
  3509. if ((inherited || hasOwnProperty.call(value, key)) &&
  3510. !(skipIndexes && (
  3511. // Safari 9 has enumerable `arguments.length` in strict mode.
  3512. key == 'length' ||
  3513. // Node.js 0.10 has enumerable non-index properties on buffers.
  3514. (isBuff && (key == 'offset' || key == 'parent')) ||
  3515. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3516. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3517. // Skip index properties.
  3518. isIndex(key, length)
  3519. ))) {
  3520. result.push(key);
  3521. }
  3522. }
  3523. return result;
  3524. }
  3525. /**
  3526. * A specialized version of `_.sample` for arrays.
  3527. *
  3528. * @private
  3529. * @param {Array} array The array to sample.
  3530. * @returns {*} Returns the random element.
  3531. */
  3532. function arraySample(array) {
  3533. var length = array.length;
  3534. return length ? array[baseRandom(0, length - 1)] : undefined;
  3535. }
  3536. /**
  3537. * A specialized version of `_.sampleSize` for arrays.
  3538. *
  3539. * @private
  3540. * @param {Array} array The array to sample.
  3541. * @param {number} n The number of elements to sample.
  3542. * @returns {Array} Returns the random elements.
  3543. */
  3544. function arraySampleSize(array, n) {
  3545. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3546. }
  3547. /**
  3548. * A specialized version of `_.shuffle` for arrays.
  3549. *
  3550. * @private
  3551. * @param {Array} array The array to shuffle.
  3552. * @returns {Array} Returns the new shuffled array.
  3553. */
  3554. function arrayShuffle(array) {
  3555. return shuffleSelf(copyArray(array));
  3556. }
  3557. /**
  3558. * This function is like `assignValue` except that it doesn't assign
  3559. * `undefined` values.
  3560. *
  3561. * @private
  3562. * @param {Object} object The object to modify.
  3563. * @param {string} key The key of the property to assign.
  3564. * @param {*} value The value to assign.
  3565. */
  3566. function assignMergeValue(object, key, value) {
  3567. if ((value !== undefined && !eq(object[key], value)) ||
  3568. (value === undefined && !(key in object))) {
  3569. baseAssignValue(object, key, value);
  3570. }
  3571. }
  3572. /**
  3573. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3574. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3575. * for equality comparisons.
  3576. *
  3577. * @private
  3578. * @param {Object} object The object to modify.
  3579. * @param {string} key The key of the property to assign.
  3580. * @param {*} value The value to assign.
  3581. */
  3582. function assignValue(object, key, value) {
  3583. var objValue = object[key];
  3584. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3585. (value === undefined && !(key in object))) {
  3586. baseAssignValue(object, key, value);
  3587. }
  3588. }
  3589. /**
  3590. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3591. *
  3592. * @private
  3593. * @param {Array} array The array to inspect.
  3594. * @param {*} key The key to search for.
  3595. * @returns {number} Returns the index of the matched value, else `-1`.
  3596. */
  3597. function assocIndexOf(array, key) {
  3598. var length = array.length;
  3599. while (length--) {
  3600. if (eq(array[length][0], key)) {
  3601. return length;
  3602. }
  3603. }
  3604. return -1;
  3605. }
  3606. /**
  3607. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3608. * by `iteratee` and values set by `setter`.
  3609. *
  3610. * @private
  3611. * @param {Array|Object} collection The collection to iterate over.
  3612. * @param {Function} setter The function to set `accumulator` values.
  3613. * @param {Function} iteratee The iteratee to transform keys.
  3614. * @param {Object} accumulator The initial aggregated object.
  3615. * @returns {Function} Returns `accumulator`.
  3616. */
  3617. function baseAggregator(collection, setter, iteratee, accumulator) {
  3618. baseEach(collection, function(value, key, collection) {
  3619. setter(accumulator, value, iteratee(value), collection);
  3620. });
  3621. return accumulator;
  3622. }
  3623. /**
  3624. * The base implementation of `_.assign` without support for multiple sources
  3625. * or `customizer` functions.
  3626. *
  3627. * @private
  3628. * @param {Object} object The destination object.
  3629. * @param {Object} source The source object.
  3630. * @returns {Object} Returns `object`.
  3631. */
  3632. function baseAssign(object, source) {
  3633. return object && copyObject(source, keys(source), object);
  3634. }
  3635. /**
  3636. * The base implementation of `_.assignIn` without support for multiple sources
  3637. * or `customizer` functions.
  3638. *
  3639. * @private
  3640. * @param {Object} object The destination object.
  3641. * @param {Object} source The source object.
  3642. * @returns {Object} Returns `object`.
  3643. */
  3644. function baseAssignIn(object, source) {
  3645. return object && copyObject(source, keysIn(source), object);
  3646. }
  3647. /**
  3648. * The base implementation of `assignValue` and `assignMergeValue` without
  3649. * value checks.
  3650. *
  3651. * @private
  3652. * @param {Object} object The object to modify.
  3653. * @param {string} key The key of the property to assign.
  3654. * @param {*} value The value to assign.
  3655. */
  3656. function baseAssignValue(object, key, value) {
  3657. if (key == '__proto__' && defineProperty) {
  3658. defineProperty(object, key, {
  3659. 'configurable': true,
  3660. 'enumerable': true,
  3661. 'value': value,
  3662. 'writable': true
  3663. });
  3664. } else {
  3665. object[key] = value;
  3666. }
  3667. }
  3668. /**
  3669. * The base implementation of `_.at` without support for individual paths.
  3670. *
  3671. * @private
  3672. * @param {Object} object The object to iterate over.
  3673. * @param {string[]} paths The property paths to pick.
  3674. * @returns {Array} Returns the picked elements.
  3675. */
  3676. function baseAt(object, paths) {
  3677. var index = -1,
  3678. length = paths.length,
  3679. result = Array(length),
  3680. skip = object == null;
  3681. while (++index < length) {
  3682. result[index] = skip ? undefined : get(object, paths[index]);
  3683. }
  3684. return result;
  3685. }
  3686. /**
  3687. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3688. *
  3689. * @private
  3690. * @param {number} number The number to clamp.
  3691. * @param {number} [lower] The lower bound.
  3692. * @param {number} upper The upper bound.
  3693. * @returns {number} Returns the clamped number.
  3694. */
  3695. function baseClamp(number, lower, upper) {
  3696. if (number === number) {
  3697. if (upper !== undefined) {
  3698. number = number <= upper ? number : upper;
  3699. }
  3700. if (lower !== undefined) {
  3701. number = number >= lower ? number : lower;
  3702. }
  3703. }
  3704. return number;
  3705. }
  3706. /**
  3707. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3708. * traversed objects.
  3709. *
  3710. * @private
  3711. * @param {*} value The value to clone.
  3712. * @param {boolean} bitmask The bitmask flags.
  3713. * 1 - Deep clone
  3714. * 2 - Flatten inherited properties
  3715. * 4 - Clone symbols
  3716. * @param {Function} [customizer] The function to customize cloning.
  3717. * @param {string} [key] The key of `value`.
  3718. * @param {Object} [object] The parent object of `value`.
  3719. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3720. * @returns {*} Returns the cloned value.
  3721. */
  3722. function baseClone(value, bitmask, customizer, key, object, stack) {
  3723. var result,
  3724. isDeep = bitmask & CLONE_DEEP_FLAG,
  3725. isFlat = bitmask & CLONE_FLAT_FLAG,
  3726. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3727. if (customizer) {
  3728. result = object ? customizer(value, key, object, stack) : customizer(value);
  3729. }
  3730. if (result !== undefined) {
  3731. return result;
  3732. }
  3733. if (!isObject(value)) {
  3734. return value;
  3735. }
  3736. var isArr = isArray(value);
  3737. if (isArr) {
  3738. result = initCloneArray(value);
  3739. if (!isDeep) {
  3740. return copyArray(value, result);
  3741. }
  3742. } else {
  3743. var tag = getTag(value),
  3744. isFunc = tag == funcTag || tag == genTag;
  3745. if (isBuffer(value)) {
  3746. return cloneBuffer(value, isDeep);
  3747. }
  3748. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3749. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3750. if (!isDeep) {
  3751. return isFlat
  3752. ? copySymbolsIn(value, baseAssignIn(result, value))
  3753. : copySymbols(value, baseAssign(result, value));
  3754. }
  3755. } else {
  3756. if (!cloneableTags[tag]) {
  3757. return object ? value : {};
  3758. }
  3759. result = initCloneByTag(value, tag, isDeep);
  3760. }
  3761. }
  3762. // Check for circular references and return its corresponding clone.
  3763. stack || (stack = new Stack);
  3764. var stacked = stack.get(value);
  3765. if (stacked) {
  3766. return stacked;
  3767. }
  3768. stack.set(value, result);
  3769. if (isSet(value)) {
  3770. value.forEach(function(subValue) {
  3771. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3772. });
  3773. } else if (isMap(value)) {
  3774. value.forEach(function(subValue, key) {
  3775. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3776. });
  3777. }
  3778. var keysFunc = isFull
  3779. ? (isFlat ? getAllKeysIn : getAllKeys)
  3780. : (isFlat ? keysIn : keys);
  3781. var props = isArr ? undefined : keysFunc(value);
  3782. arrayEach(props || value, function(subValue, key) {
  3783. if (props) {
  3784. key = subValue;
  3785. subValue = value[key];
  3786. }
  3787. // Recursively populate clone (susceptible to call stack limits).
  3788. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3789. });
  3790. return result;
  3791. }
  3792. /**
  3793. * The base implementation of `_.conforms` which doesn't clone `source`.
  3794. *
  3795. * @private
  3796. * @param {Object} source The object of property predicates to conform to.
  3797. * @returns {Function} Returns the new spec function.
  3798. */
  3799. function baseConforms(source) {
  3800. var props = keys(source);
  3801. return function(object) {
  3802. return baseConformsTo(object, source, props);
  3803. };
  3804. }
  3805. /**
  3806. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3807. *
  3808. * @private
  3809. * @param {Object} object The object to inspect.
  3810. * @param {Object} source The object of property predicates to conform to.
  3811. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3812. */
  3813. function baseConformsTo(object, source, props) {
  3814. var length = props.length;
  3815. if (object == null) {
  3816. return !length;
  3817. }
  3818. object = Object(object);
  3819. while (length--) {
  3820. var key = props[length],
  3821. predicate = source[key],
  3822. value = object[key];
  3823. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3824. return false;
  3825. }
  3826. }
  3827. return true;
  3828. }
  3829. /**
  3830. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3831. * to provide to `func`.
  3832. *
  3833. * @private
  3834. * @param {Function} func The function to delay.
  3835. * @param {number} wait The number of milliseconds to delay invocation.
  3836. * @param {Array} args The arguments to provide to `func`.
  3837. * @returns {number|Object} Returns the timer id or timeout object.
  3838. */
  3839. function baseDelay(func, wait, args) {
  3840. if (typeof func != 'function') {
  3841. throw new TypeError(FUNC_ERROR_TEXT);
  3842. }
  3843. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3844. }
  3845. /**
  3846. * The base implementation of methods like `_.difference` without support
  3847. * for excluding multiple arrays or iteratee shorthands.
  3848. *
  3849. * @private
  3850. * @param {Array} array The array to inspect.
  3851. * @param {Array} values The values to exclude.
  3852. * @param {Function} [iteratee] The iteratee invoked per element.
  3853. * @param {Function} [comparator] The comparator invoked per element.
  3854. * @returns {Array} Returns the new array of filtered values.
  3855. */
  3856. function baseDifference(array, values, iteratee, comparator) {
  3857. var index = -1,
  3858. includes = arrayIncludes,
  3859. isCommon = true,
  3860. length = array.length,
  3861. result = [],
  3862. valuesLength = values.length;
  3863. if (!length) {
  3864. return result;
  3865. }
  3866. if (iteratee) {
  3867. values = arrayMap(values, baseUnary(iteratee));
  3868. }
  3869. if (comparator) {
  3870. includes = arrayIncludesWith;
  3871. isCommon = false;
  3872. }
  3873. else if (values.length >= LARGE_ARRAY_SIZE) {
  3874. includes = cacheHas;
  3875. isCommon = false;
  3876. values = new SetCache(values);
  3877. }
  3878. outer:
  3879. while (++index < length) {
  3880. var value = array[index],
  3881. computed = iteratee == null ? value : iteratee(value);
  3882. value = (comparator || value !== 0) ? value : 0;
  3883. if (isCommon && computed === computed) {
  3884. var valuesIndex = valuesLength;
  3885. while (valuesIndex--) {
  3886. if (values[valuesIndex] === computed) {
  3887. continue outer;
  3888. }
  3889. }
  3890. result.push(value);
  3891. }
  3892. else if (!includes(values, computed, comparator)) {
  3893. result.push(value);
  3894. }
  3895. }
  3896. return result;
  3897. }
  3898. /**
  3899. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3900. *
  3901. * @private
  3902. * @param {Array|Object} collection The collection to iterate over.
  3903. * @param {Function} iteratee The function invoked per iteration.
  3904. * @returns {Array|Object} Returns `collection`.
  3905. */
  3906. var baseEach = createBaseEach(baseForOwn);
  3907. /**
  3908. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3909. *
  3910. * @private
  3911. * @param {Array|Object} collection The collection to iterate over.
  3912. * @param {Function} iteratee The function invoked per iteration.
  3913. * @returns {Array|Object} Returns `collection`.
  3914. */
  3915. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3916. /**
  3917. * The base implementation of `_.every` without support for iteratee shorthands.
  3918. *
  3919. * @private
  3920. * @param {Array|Object} collection The collection to iterate over.
  3921. * @param {Function} predicate The function invoked per iteration.
  3922. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3923. * else `false`
  3924. */
  3925. function baseEvery(collection, predicate) {
  3926. var result = true;
  3927. baseEach(collection, function(value, index, collection) {
  3928. result = !!predicate(value, index, collection);
  3929. return result;
  3930. });
  3931. return result;
  3932. }
  3933. /**
  3934. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3935. * `comparator` to determine the extremum value.
  3936. *
  3937. * @private
  3938. * @param {Array} array The array to iterate over.
  3939. * @param {Function} iteratee The iteratee invoked per iteration.
  3940. * @param {Function} comparator The comparator used to compare values.
  3941. * @returns {*} Returns the extremum value.
  3942. */
  3943. function baseExtremum(array, iteratee, comparator) {
  3944. var index = -1,
  3945. length = array.length;
  3946. while (++index < length) {
  3947. var value = array[index],
  3948. current = iteratee(value);
  3949. if (current != null && (computed === undefined
  3950. ? (current === current && !isSymbol(current))
  3951. : comparator(current, computed)
  3952. )) {
  3953. var computed = current,
  3954. result = value;
  3955. }
  3956. }
  3957. return result;
  3958. }
  3959. /**
  3960. * The base implementation of `_.fill` without an iteratee call guard.
  3961. *
  3962. * @private
  3963. * @param {Array} array The array to fill.
  3964. * @param {*} value The value to fill `array` with.
  3965. * @param {number} [start=0] The start position.
  3966. * @param {number} [end=array.length] The end position.
  3967. * @returns {Array} Returns `array`.
  3968. */
  3969. function baseFill(array, value, start, end) {
  3970. var length = array.length;
  3971. start = toInteger(start);
  3972. if (start < 0) {
  3973. start = -start > length ? 0 : (length + start);
  3974. }
  3975. end = (end === undefined || end > length) ? length : toInteger(end);
  3976. if (end < 0) {
  3977. end += length;
  3978. }
  3979. end = start > end ? 0 : toLength(end);
  3980. while (start < end) {
  3981. array[start++] = value;
  3982. }
  3983. return array;
  3984. }
  3985. /**
  3986. * The base implementation of `_.filter` without support for iteratee shorthands.
  3987. *
  3988. * @private
  3989. * @param {Array|Object} collection The collection to iterate over.
  3990. * @param {Function} predicate The function invoked per iteration.
  3991. * @returns {Array} Returns the new filtered array.
  3992. */
  3993. function baseFilter(collection, predicate) {
  3994. var result = [];
  3995. baseEach(collection, function(value, index, collection) {
  3996. if (predicate(value, index, collection)) {
  3997. result.push(value);
  3998. }
  3999. });
  4000. return result;
  4001. }
  4002. /**
  4003. * The base implementation of `_.flatten` with support for restricting flattening.
  4004. *
  4005. * @private
  4006. * @param {Array} array The array to flatten.
  4007. * @param {number} depth The maximum recursion depth.
  4008. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4009. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4010. * @param {Array} [result=[]] The initial result value.
  4011. * @returns {Array} Returns the new flattened array.
  4012. */
  4013. function baseFlatten(array, depth, predicate, isStrict, result) {
  4014. var index = -1,
  4015. length = array.length;
  4016. predicate || (predicate = isFlattenable);
  4017. result || (result = []);
  4018. while (++index < length) {
  4019. var value = array[index];
  4020. if (depth > 0 && predicate(value)) {
  4021. if (depth > 1) {
  4022. // Recursively flatten arrays (susceptible to call stack limits).
  4023. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4024. } else {
  4025. arrayPush(result, value);
  4026. }
  4027. } else if (!isStrict) {
  4028. result[result.length] = value;
  4029. }
  4030. }
  4031. return result;
  4032. }
  4033. /**
  4034. * The base implementation of `baseForOwn` which iterates over `object`
  4035. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4036. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4037. *
  4038. * @private
  4039. * @param {Object} object The object to iterate over.
  4040. * @param {Function} iteratee The function invoked per iteration.
  4041. * @param {Function} keysFunc The function to get the keys of `object`.
  4042. * @returns {Object} Returns `object`.
  4043. */
  4044. var baseFor = createBaseFor();
  4045. /**
  4046. * This function is like `baseFor` except that it iterates over properties
  4047. * in the opposite order.
  4048. *
  4049. * @private
  4050. * @param {Object} object The object to iterate over.
  4051. * @param {Function} iteratee The function invoked per iteration.
  4052. * @param {Function} keysFunc The function to get the keys of `object`.
  4053. * @returns {Object} Returns `object`.
  4054. */
  4055. var baseForRight = createBaseFor(true);
  4056. /**
  4057. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4058. *
  4059. * @private
  4060. * @param {Object} object The object to iterate over.
  4061. * @param {Function} iteratee The function invoked per iteration.
  4062. * @returns {Object} Returns `object`.
  4063. */
  4064. function baseForOwn(object, iteratee) {
  4065. return object && baseFor(object, iteratee, keys);
  4066. }
  4067. /**
  4068. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4069. *
  4070. * @private
  4071. * @param {Object} object The object to iterate over.
  4072. * @param {Function} iteratee The function invoked per iteration.
  4073. * @returns {Object} Returns `object`.
  4074. */
  4075. function baseForOwnRight(object, iteratee) {
  4076. return object && baseForRight(object, iteratee, keys);
  4077. }
  4078. /**
  4079. * The base implementation of `_.functions` which creates an array of
  4080. * `object` function property names filtered from `props`.
  4081. *
  4082. * @private
  4083. * @param {Object} object The object to inspect.
  4084. * @param {Array} props The property names to filter.
  4085. * @returns {Array} Returns the function names.
  4086. */
  4087. function baseFunctions(object, props) {
  4088. return arrayFilter(props, function(key) {
  4089. return isFunction(object[key]);
  4090. });
  4091. }
  4092. /**
  4093. * The base implementation of `_.get` without support for default values.
  4094. *
  4095. * @private
  4096. * @param {Object} object The object to query.
  4097. * @param {Array|string} path The path of the property to get.
  4098. * @returns {*} Returns the resolved value.
  4099. */
  4100. function baseGet(object, path) {
  4101. path = castPath(path, object);
  4102. var index = 0,
  4103. length = path.length;
  4104. while (object != null && index < length) {
  4105. object = object[toKey(path[index++])];
  4106. }
  4107. return (index && index == length) ? object : undefined;
  4108. }
  4109. /**
  4110. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4111. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4112. * symbols of `object`.
  4113. *
  4114. * @private
  4115. * @param {Object} object The object to query.
  4116. * @param {Function} keysFunc The function to get the keys of `object`.
  4117. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4118. * @returns {Array} Returns the array of property names and symbols.
  4119. */
  4120. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4121. var result = keysFunc(object);
  4122. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4123. }
  4124. /**
  4125. * The base implementation of `getTag` without fallbacks for buggy environments.
  4126. *
  4127. * @private
  4128. * @param {*} value The value to query.
  4129. * @returns {string} Returns the `toStringTag`.
  4130. */
  4131. function baseGetTag(value) {
  4132. if (value == null) {
  4133. return value === undefined ? undefinedTag : nullTag;
  4134. }
  4135. return (symToStringTag && symToStringTag in Object(value))
  4136. ? getRawTag(value)
  4137. : objectToString(value);
  4138. }
  4139. /**
  4140. * The base implementation of `_.gt` which doesn't coerce arguments.
  4141. *
  4142. * @private
  4143. * @param {*} value The value to compare.
  4144. * @param {*} other The other value to compare.
  4145. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4146. * else `false`.
  4147. */
  4148. function baseGt(value, other) {
  4149. return value > other;
  4150. }
  4151. /**
  4152. * The base implementation of `_.has` without support for deep paths.
  4153. *
  4154. * @private
  4155. * @param {Object} [object] The object to query.
  4156. * @param {Array|string} key The key to check.
  4157. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4158. */
  4159. function baseHas(object, key) {
  4160. return object != null && hasOwnProperty.call(object, key);
  4161. }
  4162. /**
  4163. * The base implementation of `_.hasIn` without support for deep paths.
  4164. *
  4165. * @private
  4166. * @param {Object} [object] The object to query.
  4167. * @param {Array|string} key The key to check.
  4168. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4169. */
  4170. function baseHasIn(object, key) {
  4171. return object != null && key in Object(object);
  4172. }
  4173. /**
  4174. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4175. *
  4176. * @private
  4177. * @param {number} number The number to check.
  4178. * @param {number} start The start of the range.
  4179. * @param {number} end The end of the range.
  4180. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4181. */
  4182. function baseInRange(number, start, end) {
  4183. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4184. }
  4185. /**
  4186. * The base implementation of methods like `_.intersection`, without support
  4187. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4188. *
  4189. * @private
  4190. * @param {Array} arrays The arrays to inspect.
  4191. * @param {Function} [iteratee] The iteratee invoked per element.
  4192. * @param {Function} [comparator] The comparator invoked per element.
  4193. * @returns {Array} Returns the new array of shared values.
  4194. */
  4195. function baseIntersection(arrays, iteratee, comparator) {
  4196. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4197. length = arrays[0].length,
  4198. othLength = arrays.length,
  4199. othIndex = othLength,
  4200. caches = Array(othLength),
  4201. maxLength = Infinity,
  4202. result = [];
  4203. while (othIndex--) {
  4204. var array = arrays[othIndex];
  4205. if (othIndex && iteratee) {
  4206. array = arrayMap(array, baseUnary(iteratee));
  4207. }
  4208. maxLength = nativeMin(array.length, maxLength);
  4209. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4210. ? new SetCache(othIndex && array)
  4211. : undefined;
  4212. }
  4213. array = arrays[0];
  4214. var index = -1,
  4215. seen = caches[0];
  4216. outer:
  4217. while (++index < length && result.length < maxLength) {
  4218. var value = array[index],
  4219. computed = iteratee ? iteratee(value) : value;
  4220. value = (comparator || value !== 0) ? value : 0;
  4221. if (!(seen
  4222. ? cacheHas(seen, computed)
  4223. : includes(result, computed, comparator)
  4224. )) {
  4225. othIndex = othLength;
  4226. while (--othIndex) {
  4227. var cache = caches[othIndex];
  4228. if (!(cache
  4229. ? cacheHas(cache, computed)
  4230. : includes(arrays[othIndex], computed, comparator))
  4231. ) {
  4232. continue outer;
  4233. }
  4234. }
  4235. if (seen) {
  4236. seen.push(computed);
  4237. }
  4238. result.push(value);
  4239. }
  4240. }
  4241. return result;
  4242. }
  4243. /**
  4244. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4245. * `object` with values transformed by `iteratee` and set by `setter`.
  4246. *
  4247. * @private
  4248. * @param {Object} object The object to iterate over.
  4249. * @param {Function} setter The function to set `accumulator` values.
  4250. * @param {Function} iteratee The iteratee to transform values.
  4251. * @param {Object} accumulator The initial inverted object.
  4252. * @returns {Function} Returns `accumulator`.
  4253. */
  4254. function baseInverter(object, setter, iteratee, accumulator) {
  4255. baseForOwn(object, function(value, key, object) {
  4256. setter(accumulator, iteratee(value), key, object);
  4257. });
  4258. return accumulator;
  4259. }
  4260. /**
  4261. * The base implementation of `_.invoke` without support for individual
  4262. * method arguments.
  4263. *
  4264. * @private
  4265. * @param {Object} object The object to query.
  4266. * @param {Array|string} path The path of the method to invoke.
  4267. * @param {Array} args The arguments to invoke the method with.
  4268. * @returns {*} Returns the result of the invoked method.
  4269. */
  4270. function baseInvoke(object, path, args) {
  4271. path = castPath(path, object);
  4272. object = parent(object, path);
  4273. var func = object == null ? object : object[toKey(last(path))];
  4274. return func == null ? undefined : apply(func, object, args);
  4275. }
  4276. /**
  4277. * The base implementation of `_.isArguments`.
  4278. *
  4279. * @private
  4280. * @param {*} value The value to check.
  4281. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4282. */
  4283. function baseIsArguments(value) {
  4284. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4285. }
  4286. /**
  4287. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4288. *
  4289. * @private
  4290. * @param {*} value The value to check.
  4291. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4292. */
  4293. function baseIsArrayBuffer(value) {
  4294. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4295. }
  4296. /**
  4297. * The base implementation of `_.isDate` without Node.js optimizations.
  4298. *
  4299. * @private
  4300. * @param {*} value The value to check.
  4301. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4302. */
  4303. function baseIsDate(value) {
  4304. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4305. }
  4306. /**
  4307. * The base implementation of `_.isEqual` which supports partial comparisons
  4308. * and tracks traversed objects.
  4309. *
  4310. * @private
  4311. * @param {*} value The value to compare.
  4312. * @param {*} other The other value to compare.
  4313. * @param {boolean} bitmask The bitmask flags.
  4314. * 1 - Unordered comparison
  4315. * 2 - Partial comparison
  4316. * @param {Function} [customizer] The function to customize comparisons.
  4317. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4318. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4319. */
  4320. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4321. if (value === other) {
  4322. return true;
  4323. }
  4324. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4325. return value !== value && other !== other;
  4326. }
  4327. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4328. }
  4329. /**
  4330. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4331. * deep comparisons and tracks traversed objects enabling objects with circular
  4332. * references to be compared.
  4333. *
  4334. * @private
  4335. * @param {Object} object The object to compare.
  4336. * @param {Object} other The other object to compare.
  4337. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4338. * @param {Function} customizer The function to customize comparisons.
  4339. * @param {Function} equalFunc The function to determine equivalents of values.
  4340. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4341. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4342. */
  4343. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4344. var objIsArr = isArray(object),
  4345. othIsArr = isArray(other),
  4346. objTag = objIsArr ? arrayTag : getTag(object),
  4347. othTag = othIsArr ? arrayTag : getTag(other);
  4348. objTag = objTag == argsTag ? objectTag : objTag;
  4349. othTag = othTag == argsTag ? objectTag : othTag;
  4350. var objIsObj = objTag == objectTag,
  4351. othIsObj = othTag == objectTag,
  4352. isSameTag = objTag == othTag;
  4353. if (isSameTag && isBuffer(object)) {
  4354. if (!isBuffer(other)) {
  4355. return false;
  4356. }
  4357. objIsArr = true;
  4358. objIsObj = false;
  4359. }
  4360. if (isSameTag && !objIsObj) {
  4361. stack || (stack = new Stack);
  4362. return (objIsArr || isTypedArray(object))
  4363. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4364. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4365. }
  4366. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4367. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4368. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4369. if (objIsWrapped || othIsWrapped) {
  4370. var objUnwrapped = objIsWrapped ? object.value() : object,
  4371. othUnwrapped = othIsWrapped ? other.value() : other;
  4372. stack || (stack = new Stack);
  4373. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4374. }
  4375. }
  4376. if (!isSameTag) {
  4377. return false;
  4378. }
  4379. stack || (stack = new Stack);
  4380. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4381. }
  4382. /**
  4383. * The base implementation of `_.isMap` without Node.js optimizations.
  4384. *
  4385. * @private
  4386. * @param {*} value The value to check.
  4387. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4388. */
  4389. function baseIsMap(value) {
  4390. return isObjectLike(value) && getTag(value) == mapTag;
  4391. }
  4392. /**
  4393. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4394. *
  4395. * @private
  4396. * @param {Object} object The object to inspect.
  4397. * @param {Object} source The object of property values to match.
  4398. * @param {Array} matchData The property names, values, and compare flags to match.
  4399. * @param {Function} [customizer] The function to customize comparisons.
  4400. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4401. */
  4402. function baseIsMatch(object, source, matchData, customizer) {
  4403. var index = matchData.length,
  4404. length = index,
  4405. noCustomizer = !customizer;
  4406. if (object == null) {
  4407. return !length;
  4408. }
  4409. object = Object(object);
  4410. while (index--) {
  4411. var data = matchData[index];
  4412. if ((noCustomizer && data[2])
  4413. ? data[1] !== object[data[0]]
  4414. : !(data[0] in object)
  4415. ) {
  4416. return false;
  4417. }
  4418. }
  4419. while (++index < length) {
  4420. data = matchData[index];
  4421. var key = data[0],
  4422. objValue = object[key],
  4423. srcValue = data[1];
  4424. if (noCustomizer && data[2]) {
  4425. if (objValue === undefined && !(key in object)) {
  4426. return false;
  4427. }
  4428. } else {
  4429. var stack = new Stack;
  4430. if (customizer) {
  4431. var result = customizer(objValue, srcValue, key, object, source, stack);
  4432. }
  4433. if (!(result === undefined
  4434. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4435. : result
  4436. )) {
  4437. return false;
  4438. }
  4439. }
  4440. }
  4441. return true;
  4442. }
  4443. /**
  4444. * The base implementation of `_.isNative` without bad shim checks.
  4445. *
  4446. * @private
  4447. * @param {*} value The value to check.
  4448. * @returns {boolean} Returns `true` if `value` is a native function,
  4449. * else `false`.
  4450. */
  4451. function baseIsNative(value) {
  4452. if (!isObject(value) || isMasked(value)) {
  4453. return false;
  4454. }
  4455. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4456. return pattern.test(toSource(value));
  4457. }
  4458. /**
  4459. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4460. *
  4461. * @private
  4462. * @param {*} value The value to check.
  4463. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4464. */
  4465. function baseIsRegExp(value) {
  4466. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4467. }
  4468. /**
  4469. * The base implementation of `_.isSet` without Node.js optimizations.
  4470. *
  4471. * @private
  4472. * @param {*} value The value to check.
  4473. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4474. */
  4475. function baseIsSet(value) {
  4476. return isObjectLike(value) && getTag(value) == setTag;
  4477. }
  4478. /**
  4479. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4480. *
  4481. * @private
  4482. * @param {*} value The value to check.
  4483. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4484. */
  4485. function baseIsTypedArray(value) {
  4486. return isObjectLike(value) &&
  4487. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4488. }
  4489. /**
  4490. * The base implementation of `_.iteratee`.
  4491. *
  4492. * @private
  4493. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4494. * @returns {Function} Returns the iteratee.
  4495. */
  4496. function baseIteratee(value) {
  4497. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4498. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4499. if (typeof value == 'function') {
  4500. return value;
  4501. }
  4502. if (value == null) {
  4503. return identity;
  4504. }
  4505. if (typeof value == 'object') {
  4506. return isArray(value)
  4507. ? baseMatchesProperty(value[0], value[1])
  4508. : baseMatches(value);
  4509. }
  4510. return property(value);
  4511. }
  4512. /**
  4513. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4514. *
  4515. * @private
  4516. * @param {Object} object The object to query.
  4517. * @returns {Array} Returns the array of property names.
  4518. */
  4519. function baseKeys(object) {
  4520. if (!isPrototype(object)) {
  4521. return nativeKeys(object);
  4522. }
  4523. var result = [];
  4524. for (var key in Object(object)) {
  4525. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4526. result.push(key);
  4527. }
  4528. }
  4529. return result;
  4530. }
  4531. /**
  4532. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4533. *
  4534. * @private
  4535. * @param {Object} object The object to query.
  4536. * @returns {Array} Returns the array of property names.
  4537. */
  4538. function baseKeysIn(object) {
  4539. if (!isObject(object)) {
  4540. return nativeKeysIn(object);
  4541. }
  4542. var isProto = isPrototype(object),
  4543. result = [];
  4544. for (var key in object) {
  4545. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4546. result.push(key);
  4547. }
  4548. }
  4549. return result;
  4550. }
  4551. /**
  4552. * The base implementation of `_.lt` which doesn't coerce arguments.
  4553. *
  4554. * @private
  4555. * @param {*} value The value to compare.
  4556. * @param {*} other The other value to compare.
  4557. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4558. * else `false`.
  4559. */
  4560. function baseLt(value, other) {
  4561. return value < other;
  4562. }
  4563. /**
  4564. * The base implementation of `_.map` without support for iteratee shorthands.
  4565. *
  4566. * @private
  4567. * @param {Array|Object} collection The collection to iterate over.
  4568. * @param {Function} iteratee The function invoked per iteration.
  4569. * @returns {Array} Returns the new mapped array.
  4570. */
  4571. function baseMap(collection, iteratee) {
  4572. var index = -1,
  4573. result = isArrayLike(collection) ? Array(collection.length) : [];
  4574. baseEach(collection, function(value, key, collection) {
  4575. result[++index] = iteratee(value, key, collection);
  4576. });
  4577. return result;
  4578. }
  4579. /**
  4580. * The base implementation of `_.matches` which doesn't clone `source`.
  4581. *
  4582. * @private
  4583. * @param {Object} source The object of property values to match.
  4584. * @returns {Function} Returns the new spec function.
  4585. */
  4586. function baseMatches(source) {
  4587. var matchData = getMatchData(source);
  4588. if (matchData.length == 1 && matchData[0][2]) {
  4589. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4590. }
  4591. return function(object) {
  4592. return object === source || baseIsMatch(object, source, matchData);
  4593. };
  4594. }
  4595. /**
  4596. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4597. *
  4598. * @private
  4599. * @param {string} path The path of the property to get.
  4600. * @param {*} srcValue The value to match.
  4601. * @returns {Function} Returns the new spec function.
  4602. */
  4603. function baseMatchesProperty(path, srcValue) {
  4604. if (isKey(path) && isStrictComparable(srcValue)) {
  4605. return matchesStrictComparable(toKey(path), srcValue);
  4606. }
  4607. return function(object) {
  4608. var objValue = get(object, path);
  4609. return (objValue === undefined && objValue === srcValue)
  4610. ? hasIn(object, path)
  4611. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4612. };
  4613. }
  4614. /**
  4615. * The base implementation of `_.merge` without support for multiple sources.
  4616. *
  4617. * @private
  4618. * @param {Object} object The destination object.
  4619. * @param {Object} source The source object.
  4620. * @param {number} srcIndex The index of `source`.
  4621. * @param {Function} [customizer] The function to customize merged values.
  4622. * @param {Object} [stack] Tracks traversed source values and their merged
  4623. * counterparts.
  4624. */
  4625. function baseMerge(object, source, srcIndex, customizer, stack) {
  4626. if (object === source) {
  4627. return;
  4628. }
  4629. baseFor(source, function(srcValue, key) {
  4630. stack || (stack = new Stack);
  4631. if (isObject(srcValue)) {
  4632. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4633. }
  4634. else {
  4635. var newValue = customizer
  4636. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4637. : undefined;
  4638. if (newValue === undefined) {
  4639. newValue = srcValue;
  4640. }
  4641. assignMergeValue(object, key, newValue);
  4642. }
  4643. }, keysIn);
  4644. }
  4645. /**
  4646. * A specialized version of `baseMerge` for arrays and objects which performs
  4647. * deep merges and tracks traversed objects enabling objects with circular
  4648. * references to be merged.
  4649. *
  4650. * @private
  4651. * @param {Object} object The destination object.
  4652. * @param {Object} source The source object.
  4653. * @param {string} key The key of the value to merge.
  4654. * @param {number} srcIndex The index of `source`.
  4655. * @param {Function} mergeFunc The function to merge values.
  4656. * @param {Function} [customizer] The function to customize assigned values.
  4657. * @param {Object} [stack] Tracks traversed source values and their merged
  4658. * counterparts.
  4659. */
  4660. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4661. var objValue = safeGet(object, key),
  4662. srcValue = safeGet(source, key),
  4663. stacked = stack.get(srcValue);
  4664. if (stacked) {
  4665. assignMergeValue(object, key, stacked);
  4666. return;
  4667. }
  4668. var newValue = customizer
  4669. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4670. : undefined;
  4671. var isCommon = newValue === undefined;
  4672. if (isCommon) {
  4673. var isArr = isArray(srcValue),
  4674. isBuff = !isArr && isBuffer(srcValue),
  4675. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4676. newValue = srcValue;
  4677. if (isArr || isBuff || isTyped) {
  4678. if (isArray(objValue)) {
  4679. newValue = objValue;
  4680. }
  4681. else if (isArrayLikeObject(objValue)) {
  4682. newValue = copyArray(objValue);
  4683. }
  4684. else if (isBuff) {
  4685. isCommon = false;
  4686. newValue = cloneBuffer(srcValue, true);
  4687. }
  4688. else if (isTyped) {
  4689. isCommon = false;
  4690. newValue = cloneTypedArray(srcValue, true);
  4691. }
  4692. else {
  4693. newValue = [];
  4694. }
  4695. }
  4696. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4697. newValue = objValue;
  4698. if (isArguments(objValue)) {
  4699. newValue = toPlainObject(objValue);
  4700. }
  4701. else if (!isObject(objValue) || isFunction(objValue)) {
  4702. newValue = initCloneObject(srcValue);
  4703. }
  4704. }
  4705. else {
  4706. isCommon = false;
  4707. }
  4708. }
  4709. if (isCommon) {
  4710. // Recursively merge objects and arrays (susceptible to call stack limits).
  4711. stack.set(srcValue, newValue);
  4712. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4713. stack['delete'](srcValue);
  4714. }
  4715. assignMergeValue(object, key, newValue);
  4716. }
  4717. /**
  4718. * The base implementation of `_.nth` which doesn't coerce arguments.
  4719. *
  4720. * @private
  4721. * @param {Array} array The array to query.
  4722. * @param {number} n The index of the element to return.
  4723. * @returns {*} Returns the nth element of `array`.
  4724. */
  4725. function baseNth(array, n) {
  4726. var length = array.length;
  4727. if (!length) {
  4728. return;
  4729. }
  4730. n += n < 0 ? length : 0;
  4731. return isIndex(n, length) ? array[n] : undefined;
  4732. }
  4733. /**
  4734. * The base implementation of `_.orderBy` without param guards.
  4735. *
  4736. * @private
  4737. * @param {Array|Object} collection The collection to iterate over.
  4738. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4739. * @param {string[]} orders The sort orders of `iteratees`.
  4740. * @returns {Array} Returns the new sorted array.
  4741. */
  4742. function baseOrderBy(collection, iteratees, orders) {
  4743. if (iteratees.length) {
  4744. iteratees = arrayMap(iteratees, function(iteratee) {
  4745. if (isArray(iteratee)) {
  4746. return function(value) {
  4747. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4748. }
  4749. }
  4750. return iteratee;
  4751. });
  4752. } else {
  4753. iteratees = [identity];
  4754. }
  4755. var index = -1;
  4756. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4757. var result = baseMap(collection, function(value, key, collection) {
  4758. var criteria = arrayMap(iteratees, function(iteratee) {
  4759. return iteratee(value);
  4760. });
  4761. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4762. });
  4763. return baseSortBy(result, function(object, other) {
  4764. return compareMultiple(object, other, orders);
  4765. });
  4766. }
  4767. /**
  4768. * The base implementation of `_.pick` without support for individual
  4769. * property identifiers.
  4770. *
  4771. * @private
  4772. * @param {Object} object The source object.
  4773. * @param {string[]} paths The property paths to pick.
  4774. * @returns {Object} Returns the new object.
  4775. */
  4776. function basePick(object, paths) {
  4777. return basePickBy(object, paths, function(value, path) {
  4778. return hasIn(object, path);
  4779. });
  4780. }
  4781. /**
  4782. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4783. *
  4784. * @private
  4785. * @param {Object} object The source object.
  4786. * @param {string[]} paths The property paths to pick.
  4787. * @param {Function} predicate The function invoked per property.
  4788. * @returns {Object} Returns the new object.
  4789. */
  4790. function basePickBy(object, paths, predicate) {
  4791. var index = -1,
  4792. length = paths.length,
  4793. result = {};
  4794. while (++index < length) {
  4795. var path = paths[index],
  4796. value = baseGet(object, path);
  4797. if (predicate(value, path)) {
  4798. baseSet(result, castPath(path, object), value);
  4799. }
  4800. }
  4801. return result;
  4802. }
  4803. /**
  4804. * A specialized version of `baseProperty` which supports deep paths.
  4805. *
  4806. * @private
  4807. * @param {Array|string} path The path of the property to get.
  4808. * @returns {Function} Returns the new accessor function.
  4809. */
  4810. function basePropertyDeep(path) {
  4811. return function(object) {
  4812. return baseGet(object, path);
  4813. };
  4814. }
  4815. /**
  4816. * The base implementation of `_.pullAllBy` without support for iteratee
  4817. * shorthands.
  4818. *
  4819. * @private
  4820. * @param {Array} array The array to modify.
  4821. * @param {Array} values The values to remove.
  4822. * @param {Function} [iteratee] The iteratee invoked per element.
  4823. * @param {Function} [comparator] The comparator invoked per element.
  4824. * @returns {Array} Returns `array`.
  4825. */
  4826. function basePullAll(array, values, iteratee, comparator) {
  4827. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4828. index = -1,
  4829. length = values.length,
  4830. seen = array;
  4831. if (array === values) {
  4832. values = copyArray(values);
  4833. }
  4834. if (iteratee) {
  4835. seen = arrayMap(array, baseUnary(iteratee));
  4836. }
  4837. while (++index < length) {
  4838. var fromIndex = 0,
  4839. value = values[index],
  4840. computed = iteratee ? iteratee(value) : value;
  4841. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4842. if (seen !== array) {
  4843. splice.call(seen, fromIndex, 1);
  4844. }
  4845. splice.call(array, fromIndex, 1);
  4846. }
  4847. }
  4848. return array;
  4849. }
  4850. /**
  4851. * The base implementation of `_.pullAt` without support for individual
  4852. * indexes or capturing the removed elements.
  4853. *
  4854. * @private
  4855. * @param {Array} array The array to modify.
  4856. * @param {number[]} indexes The indexes of elements to remove.
  4857. * @returns {Array} Returns `array`.
  4858. */
  4859. function basePullAt(array, indexes) {
  4860. var length = array ? indexes.length : 0,
  4861. lastIndex = length - 1;
  4862. while (length--) {
  4863. var index = indexes[length];
  4864. if (length == lastIndex || index !== previous) {
  4865. var previous = index;
  4866. if (isIndex(index)) {
  4867. splice.call(array, index, 1);
  4868. } else {
  4869. baseUnset(array, index);
  4870. }
  4871. }
  4872. }
  4873. return array;
  4874. }
  4875. /**
  4876. * The base implementation of `_.random` without support for returning
  4877. * floating-point numbers.
  4878. *
  4879. * @private
  4880. * @param {number} lower The lower bound.
  4881. * @param {number} upper The upper bound.
  4882. * @returns {number} Returns the random number.
  4883. */
  4884. function baseRandom(lower, upper) {
  4885. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4886. }
  4887. /**
  4888. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4889. * coerce arguments.
  4890. *
  4891. * @private
  4892. * @param {number} start The start of the range.
  4893. * @param {number} end The end of the range.
  4894. * @param {number} step The value to increment or decrement by.
  4895. * @param {boolean} [fromRight] Specify iterating from right to left.
  4896. * @returns {Array} Returns the range of numbers.
  4897. */
  4898. function baseRange(start, end, step, fromRight) {
  4899. var index = -1,
  4900. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4901. result = Array(length);
  4902. while (length--) {
  4903. result[fromRight ? length : ++index] = start;
  4904. start += step;
  4905. }
  4906. return result;
  4907. }
  4908. /**
  4909. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4910. *
  4911. * @private
  4912. * @param {string} string The string to repeat.
  4913. * @param {number} n The number of times to repeat the string.
  4914. * @returns {string} Returns the repeated string.
  4915. */
  4916. function baseRepeat(string, n) {
  4917. var result = '';
  4918. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4919. return result;
  4920. }
  4921. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4922. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4923. do {
  4924. if (n % 2) {
  4925. result += string;
  4926. }
  4927. n = nativeFloor(n / 2);
  4928. if (n) {
  4929. string += string;
  4930. }
  4931. } while (n);
  4932. return result;
  4933. }
  4934. /**
  4935. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4936. *
  4937. * @private
  4938. * @param {Function} func The function to apply a rest parameter to.
  4939. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4940. * @returns {Function} Returns the new function.
  4941. */
  4942. function baseRest(func, start) {
  4943. return setToString(overRest(func, start, identity), func + '');
  4944. }
  4945. /**
  4946. * The base implementation of `_.sample`.
  4947. *
  4948. * @private
  4949. * @param {Array|Object} collection The collection to sample.
  4950. * @returns {*} Returns the random element.
  4951. */
  4952. function baseSample(collection) {
  4953. return arraySample(values(collection));
  4954. }
  4955. /**
  4956. * The base implementation of `_.sampleSize` without param guards.
  4957. *
  4958. * @private
  4959. * @param {Array|Object} collection The collection to sample.
  4960. * @param {number} n The number of elements to sample.
  4961. * @returns {Array} Returns the random elements.
  4962. */
  4963. function baseSampleSize(collection, n) {
  4964. var array = values(collection);
  4965. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4966. }
  4967. /**
  4968. * The base implementation of `_.set`.
  4969. *
  4970. * @private
  4971. * @param {Object} object The object to modify.
  4972. * @param {Array|string} path The path of the property to set.
  4973. * @param {*} value The value to set.
  4974. * @param {Function} [customizer] The function to customize path creation.
  4975. * @returns {Object} Returns `object`.
  4976. */
  4977. function baseSet(object, path, value, customizer) {
  4978. if (!isObject(object)) {
  4979. return object;
  4980. }
  4981. path = castPath(path, object);
  4982. var index = -1,
  4983. length = path.length,
  4984. lastIndex = length - 1,
  4985. nested = object;
  4986. while (nested != null && ++index < length) {
  4987. var key = toKey(path[index]),
  4988. newValue = value;
  4989. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4990. return object;
  4991. }
  4992. if (index != lastIndex) {
  4993. var objValue = nested[key];
  4994. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4995. if (newValue === undefined) {
  4996. newValue = isObject(objValue)
  4997. ? objValue
  4998. : (isIndex(path[index + 1]) ? [] : {});
  4999. }
  5000. }
  5001. assignValue(nested, key, newValue);
  5002. nested = nested[key];
  5003. }
  5004. return object;
  5005. }
  5006. /**
  5007. * The base implementation of `setData` without support for hot loop shorting.
  5008. *
  5009. * @private
  5010. * @param {Function} func The function to associate metadata with.
  5011. * @param {*} data The metadata.
  5012. * @returns {Function} Returns `func`.
  5013. */
  5014. var baseSetData = !metaMap ? identity : function(func, data) {
  5015. metaMap.set(func, data);
  5016. return func;
  5017. };
  5018. /**
  5019. * The base implementation of `setToString` without support for hot loop shorting.
  5020. *
  5021. * @private
  5022. * @param {Function} func The function to modify.
  5023. * @param {Function} string The `toString` result.
  5024. * @returns {Function} Returns `func`.
  5025. */
  5026. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5027. return defineProperty(func, 'toString', {
  5028. 'configurable': true,
  5029. 'enumerable': false,
  5030. 'value': constant(string),
  5031. 'writable': true
  5032. });
  5033. };
  5034. /**
  5035. * The base implementation of `_.shuffle`.
  5036. *
  5037. * @private
  5038. * @param {Array|Object} collection The collection to shuffle.
  5039. * @returns {Array} Returns the new shuffled array.
  5040. */
  5041. function baseShuffle(collection) {
  5042. return shuffleSelf(values(collection));
  5043. }
  5044. /**
  5045. * The base implementation of `_.slice` without an iteratee call guard.
  5046. *
  5047. * @private
  5048. * @param {Array} array The array to slice.
  5049. * @param {number} [start=0] The start position.
  5050. * @param {number} [end=array.length] The end position.
  5051. * @returns {Array} Returns the slice of `array`.
  5052. */
  5053. function baseSlice(array, start, end) {
  5054. var index = -1,
  5055. length = array.length;
  5056. if (start < 0) {
  5057. start = -start > length ? 0 : (length + start);
  5058. }
  5059. end = end > length ? length : end;
  5060. if (end < 0) {
  5061. end += length;
  5062. }
  5063. length = start > end ? 0 : ((end - start) >>> 0);
  5064. start >>>= 0;
  5065. var result = Array(length);
  5066. while (++index < length) {
  5067. result[index] = array[index + start];
  5068. }
  5069. return result;
  5070. }
  5071. /**
  5072. * The base implementation of `_.some` without support for iteratee shorthands.
  5073. *
  5074. * @private
  5075. * @param {Array|Object} collection The collection to iterate over.
  5076. * @param {Function} predicate The function invoked per iteration.
  5077. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5078. * else `false`.
  5079. */
  5080. function baseSome(collection, predicate) {
  5081. var result;
  5082. baseEach(collection, function(value, index, collection) {
  5083. result = predicate(value, index, collection);
  5084. return !result;
  5085. });
  5086. return !!result;
  5087. }
  5088. /**
  5089. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5090. * performs a binary search of `array` to determine the index at which `value`
  5091. * should be inserted into `array` in order to maintain its sort order.
  5092. *
  5093. * @private
  5094. * @param {Array} array The sorted array to inspect.
  5095. * @param {*} value The value to evaluate.
  5096. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5097. * @returns {number} Returns the index at which `value` should be inserted
  5098. * into `array`.
  5099. */
  5100. function baseSortedIndex(array, value, retHighest) {
  5101. var low = 0,
  5102. high = array == null ? low : array.length;
  5103. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5104. while (low < high) {
  5105. var mid = (low + high) >>> 1,
  5106. computed = array[mid];
  5107. if (computed !== null && !isSymbol(computed) &&
  5108. (retHighest ? (computed <= value) : (computed < value))) {
  5109. low = mid + 1;
  5110. } else {
  5111. high = mid;
  5112. }
  5113. }
  5114. return high;
  5115. }
  5116. return baseSortedIndexBy(array, value, identity, retHighest);
  5117. }
  5118. /**
  5119. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5120. * which invokes `iteratee` for `value` and each element of `array` to compute
  5121. * their sort ranking. The iteratee is invoked with one argument; (value).
  5122. *
  5123. * @private
  5124. * @param {Array} array The sorted array to inspect.
  5125. * @param {*} value The value to evaluate.
  5126. * @param {Function} iteratee The iteratee invoked per element.
  5127. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5128. * @returns {number} Returns the index at which `value` should be inserted
  5129. * into `array`.
  5130. */
  5131. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5132. var low = 0,
  5133. high = array == null ? 0 : array.length;
  5134. if (high === 0) {
  5135. return 0;
  5136. }
  5137. value = iteratee(value);
  5138. var valIsNaN = value !== value,
  5139. valIsNull = value === null,
  5140. valIsSymbol = isSymbol(value),
  5141. valIsUndefined = value === undefined;
  5142. while (low < high) {
  5143. var mid = nativeFloor((low + high) / 2),
  5144. computed = iteratee(array[mid]),
  5145. othIsDefined = computed !== undefined,
  5146. othIsNull = computed === null,
  5147. othIsReflexive = computed === computed,
  5148. othIsSymbol = isSymbol(computed);
  5149. if (valIsNaN) {
  5150. var setLow = retHighest || othIsReflexive;
  5151. } else if (valIsUndefined) {
  5152. setLow = othIsReflexive && (retHighest || othIsDefined);
  5153. } else if (valIsNull) {
  5154. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5155. } else if (valIsSymbol) {
  5156. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5157. } else if (othIsNull || othIsSymbol) {
  5158. setLow = false;
  5159. } else {
  5160. setLow = retHighest ? (computed <= value) : (computed < value);
  5161. }
  5162. if (setLow) {
  5163. low = mid + 1;
  5164. } else {
  5165. high = mid;
  5166. }
  5167. }
  5168. return nativeMin(high, MAX_ARRAY_INDEX);
  5169. }
  5170. /**
  5171. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5172. * support for iteratee shorthands.
  5173. *
  5174. * @private
  5175. * @param {Array} array The array to inspect.
  5176. * @param {Function} [iteratee] The iteratee invoked per element.
  5177. * @returns {Array} Returns the new duplicate free array.
  5178. */
  5179. function baseSortedUniq(array, iteratee) {
  5180. var index = -1,
  5181. length = array.length,
  5182. resIndex = 0,
  5183. result = [];
  5184. while (++index < length) {
  5185. var value = array[index],
  5186. computed = iteratee ? iteratee(value) : value;
  5187. if (!index || !eq(computed, seen)) {
  5188. var seen = computed;
  5189. result[resIndex++] = value === 0 ? 0 : value;
  5190. }
  5191. }
  5192. return result;
  5193. }
  5194. /**
  5195. * The base implementation of `_.toNumber` which doesn't ensure correct
  5196. * conversions of binary, hexadecimal, or octal string values.
  5197. *
  5198. * @private
  5199. * @param {*} value The value to process.
  5200. * @returns {number} Returns the number.
  5201. */
  5202. function baseToNumber(value) {
  5203. if (typeof value == 'number') {
  5204. return value;
  5205. }
  5206. if (isSymbol(value)) {
  5207. return NAN;
  5208. }
  5209. return +value;
  5210. }
  5211. /**
  5212. * The base implementation of `_.toString` which doesn't convert nullish
  5213. * values to empty strings.
  5214. *
  5215. * @private
  5216. * @param {*} value The value to process.
  5217. * @returns {string} Returns the string.
  5218. */
  5219. function baseToString(value) {
  5220. // Exit early for strings to avoid a performance hit in some environments.
  5221. if (typeof value == 'string') {
  5222. return value;
  5223. }
  5224. if (isArray(value)) {
  5225. // Recursively convert values (susceptible to call stack limits).
  5226. return arrayMap(value, baseToString) + '';
  5227. }
  5228. if (isSymbol(value)) {
  5229. return symbolToString ? symbolToString.call(value) : '';
  5230. }
  5231. var result = (value + '');
  5232. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5233. }
  5234. /**
  5235. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5236. *
  5237. * @private
  5238. * @param {Array} array The array to inspect.
  5239. * @param {Function} [iteratee] The iteratee invoked per element.
  5240. * @param {Function} [comparator] The comparator invoked per element.
  5241. * @returns {Array} Returns the new duplicate free array.
  5242. */
  5243. function baseUniq(array, iteratee, comparator) {
  5244. var index = -1,
  5245. includes = arrayIncludes,
  5246. length = array.length,
  5247. isCommon = true,
  5248. result = [],
  5249. seen = result;
  5250. if (comparator) {
  5251. isCommon = false;
  5252. includes = arrayIncludesWith;
  5253. }
  5254. else if (length >= LARGE_ARRAY_SIZE) {
  5255. var set = iteratee ? null : createSet(array);
  5256. if (set) {
  5257. return setToArray(set);
  5258. }
  5259. isCommon = false;
  5260. includes = cacheHas;
  5261. seen = new SetCache;
  5262. }
  5263. else {
  5264. seen = iteratee ? [] : result;
  5265. }
  5266. outer:
  5267. while (++index < length) {
  5268. var value = array[index],
  5269. computed = iteratee ? iteratee(value) : value;
  5270. value = (comparator || value !== 0) ? value : 0;
  5271. if (isCommon && computed === computed) {
  5272. var seenIndex = seen.length;
  5273. while (seenIndex--) {
  5274. if (seen[seenIndex] === computed) {
  5275. continue outer;
  5276. }
  5277. }
  5278. if (iteratee) {
  5279. seen.push(computed);
  5280. }
  5281. result.push(value);
  5282. }
  5283. else if (!includes(seen, computed, comparator)) {
  5284. if (seen !== result) {
  5285. seen.push(computed);
  5286. }
  5287. result.push(value);
  5288. }
  5289. }
  5290. return result;
  5291. }
  5292. /**
  5293. * The base implementation of `_.unset`.
  5294. *
  5295. * @private
  5296. * @param {Object} object The object to modify.
  5297. * @param {Array|string} path The property path to unset.
  5298. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5299. */
  5300. function baseUnset(object, path) {
  5301. path = castPath(path, object);
  5302. object = parent(object, path);
  5303. return object == null || delete object[toKey(last(path))];
  5304. }
  5305. /**
  5306. * The base implementation of `_.update`.
  5307. *
  5308. * @private
  5309. * @param {Object} object The object to modify.
  5310. * @param {Array|string} path The path of the property to update.
  5311. * @param {Function} updater The function to produce the updated value.
  5312. * @param {Function} [customizer] The function to customize path creation.
  5313. * @returns {Object} Returns `object`.
  5314. */
  5315. function baseUpdate(object, path, updater, customizer) {
  5316. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5317. }
  5318. /**
  5319. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5320. * without support for iteratee shorthands.
  5321. *
  5322. * @private
  5323. * @param {Array} array The array to query.
  5324. * @param {Function} predicate The function invoked per iteration.
  5325. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5326. * @param {boolean} [fromRight] Specify iterating from right to left.
  5327. * @returns {Array} Returns the slice of `array`.
  5328. */
  5329. function baseWhile(array, predicate, isDrop, fromRight) {
  5330. var length = array.length,
  5331. index = fromRight ? length : -1;
  5332. while ((fromRight ? index-- : ++index < length) &&
  5333. predicate(array[index], index, array)) {}
  5334. return isDrop
  5335. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5336. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5337. }
  5338. /**
  5339. * The base implementation of `wrapperValue` which returns the result of
  5340. * performing a sequence of actions on the unwrapped `value`, where each
  5341. * successive action is supplied the return value of the previous.
  5342. *
  5343. * @private
  5344. * @param {*} value The unwrapped value.
  5345. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5346. * @returns {*} Returns the resolved value.
  5347. */
  5348. function baseWrapperValue(value, actions) {
  5349. var result = value;
  5350. if (result instanceof LazyWrapper) {
  5351. result = result.value();
  5352. }
  5353. return arrayReduce(actions, function(result, action) {
  5354. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5355. }, result);
  5356. }
  5357. /**
  5358. * The base implementation of methods like `_.xor`, without support for
  5359. * iteratee shorthands, that accepts an array of arrays to inspect.
  5360. *
  5361. * @private
  5362. * @param {Array} arrays The arrays to inspect.
  5363. * @param {Function} [iteratee] The iteratee invoked per element.
  5364. * @param {Function} [comparator] The comparator invoked per element.
  5365. * @returns {Array} Returns the new array of values.
  5366. */
  5367. function baseXor(arrays, iteratee, comparator) {
  5368. var length = arrays.length;
  5369. if (length < 2) {
  5370. return length ? baseUniq(arrays[0]) : [];
  5371. }
  5372. var index = -1,
  5373. result = Array(length);
  5374. while (++index < length) {
  5375. var array = arrays[index],
  5376. othIndex = -1;
  5377. while (++othIndex < length) {
  5378. if (othIndex != index) {
  5379. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5380. }
  5381. }
  5382. }
  5383. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5384. }
  5385. /**
  5386. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5387. *
  5388. * @private
  5389. * @param {Array} props The property identifiers.
  5390. * @param {Array} values The property values.
  5391. * @param {Function} assignFunc The function to assign values.
  5392. * @returns {Object} Returns the new object.
  5393. */
  5394. function baseZipObject(props, values, assignFunc) {
  5395. var index = -1,
  5396. length = props.length,
  5397. valsLength = values.length,
  5398. result = {};
  5399. while (++index < length) {
  5400. var value = index < valsLength ? values[index] : undefined;
  5401. assignFunc(result, props[index], value);
  5402. }
  5403. return result;
  5404. }
  5405. /**
  5406. * Casts `value` to an empty array if it's not an array like object.
  5407. *
  5408. * @private
  5409. * @param {*} value The value to inspect.
  5410. * @returns {Array|Object} Returns the cast array-like object.
  5411. */
  5412. function castArrayLikeObject(value) {
  5413. return isArrayLikeObject(value) ? value : [];
  5414. }
  5415. /**
  5416. * Casts `value` to `identity` if it's not a function.
  5417. *
  5418. * @private
  5419. * @param {*} value The value to inspect.
  5420. * @returns {Function} Returns cast function.
  5421. */
  5422. function castFunction(value) {
  5423. return typeof value == 'function' ? value : identity;
  5424. }
  5425. /**
  5426. * Casts `value` to a path array if it's not one.
  5427. *
  5428. * @private
  5429. * @param {*} value The value to inspect.
  5430. * @param {Object} [object] The object to query keys on.
  5431. * @returns {Array} Returns the cast property path array.
  5432. */
  5433. function castPath(value, object) {
  5434. if (isArray(value)) {
  5435. return value;
  5436. }
  5437. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5438. }
  5439. /**
  5440. * A `baseRest` alias which can be replaced with `identity` by module
  5441. * replacement plugins.
  5442. *
  5443. * @private
  5444. * @type {Function}
  5445. * @param {Function} func The function to apply a rest parameter to.
  5446. * @returns {Function} Returns the new function.
  5447. */
  5448. var castRest = baseRest;
  5449. /**
  5450. * Casts `array` to a slice if it's needed.
  5451. *
  5452. * @private
  5453. * @param {Array} array The array to inspect.
  5454. * @param {number} start The start position.
  5455. * @param {number} [end=array.length] The end position.
  5456. * @returns {Array} Returns the cast slice.
  5457. */
  5458. function castSlice(array, start, end) {
  5459. var length = array.length;
  5460. end = end === undefined ? length : end;
  5461. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5462. }
  5463. /**
  5464. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5465. *
  5466. * @private
  5467. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5468. */
  5469. var clearTimeout = ctxClearTimeout || function(id) {
  5470. return root.clearTimeout(id);
  5471. };
  5472. /**
  5473. * Creates a clone of `buffer`.
  5474. *
  5475. * @private
  5476. * @param {Buffer} buffer The buffer to clone.
  5477. * @param {boolean} [isDeep] Specify a deep clone.
  5478. * @returns {Buffer} Returns the cloned buffer.
  5479. */
  5480. function cloneBuffer(buffer, isDeep) {
  5481. if (isDeep) {
  5482. return buffer.slice();
  5483. }
  5484. var length = buffer.length,
  5485. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5486. buffer.copy(result);
  5487. return result;
  5488. }
  5489. /**
  5490. * Creates a clone of `arrayBuffer`.
  5491. *
  5492. * @private
  5493. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5494. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5495. */
  5496. function cloneArrayBuffer(arrayBuffer) {
  5497. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5498. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5499. return result;
  5500. }
  5501. /**
  5502. * Creates a clone of `dataView`.
  5503. *
  5504. * @private
  5505. * @param {Object} dataView The data view to clone.
  5506. * @param {boolean} [isDeep] Specify a deep clone.
  5507. * @returns {Object} Returns the cloned data view.
  5508. */
  5509. function cloneDataView(dataView, isDeep) {
  5510. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5511. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5512. }
  5513. /**
  5514. * Creates a clone of `regexp`.
  5515. *
  5516. * @private
  5517. * @param {Object} regexp The regexp to clone.
  5518. * @returns {Object} Returns the cloned regexp.
  5519. */
  5520. function cloneRegExp(regexp) {
  5521. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5522. result.lastIndex = regexp.lastIndex;
  5523. return result;
  5524. }
  5525. /**
  5526. * Creates a clone of the `symbol` object.
  5527. *
  5528. * @private
  5529. * @param {Object} symbol The symbol object to clone.
  5530. * @returns {Object} Returns the cloned symbol object.
  5531. */
  5532. function cloneSymbol(symbol) {
  5533. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5534. }
  5535. /**
  5536. * Creates a clone of `typedArray`.
  5537. *
  5538. * @private
  5539. * @param {Object} typedArray The typed array to clone.
  5540. * @param {boolean} [isDeep] Specify a deep clone.
  5541. * @returns {Object} Returns the cloned typed array.
  5542. */
  5543. function cloneTypedArray(typedArray, isDeep) {
  5544. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5545. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5546. }
  5547. /**
  5548. * Compares values to sort them in ascending order.
  5549. *
  5550. * @private
  5551. * @param {*} value The value to compare.
  5552. * @param {*} other The other value to compare.
  5553. * @returns {number} Returns the sort order indicator for `value`.
  5554. */
  5555. function compareAscending(value, other) {
  5556. if (value !== other) {
  5557. var valIsDefined = value !== undefined,
  5558. valIsNull = value === null,
  5559. valIsReflexive = value === value,
  5560. valIsSymbol = isSymbol(value);
  5561. var othIsDefined = other !== undefined,
  5562. othIsNull = other === null,
  5563. othIsReflexive = other === other,
  5564. othIsSymbol = isSymbol(other);
  5565. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5566. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5567. (valIsNull && othIsDefined && othIsReflexive) ||
  5568. (!valIsDefined && othIsReflexive) ||
  5569. !valIsReflexive) {
  5570. return 1;
  5571. }
  5572. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5573. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5574. (othIsNull && valIsDefined && valIsReflexive) ||
  5575. (!othIsDefined && valIsReflexive) ||
  5576. !othIsReflexive) {
  5577. return -1;
  5578. }
  5579. }
  5580. return 0;
  5581. }
  5582. /**
  5583. * Used by `_.orderBy` to compare multiple properties of a value to another
  5584. * and stable sort them.
  5585. *
  5586. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5587. * specify an order of "desc" for descending or "asc" for ascending sort order
  5588. * of corresponding values.
  5589. *
  5590. * @private
  5591. * @param {Object} object The object to compare.
  5592. * @param {Object} other The other object to compare.
  5593. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5594. * @returns {number} Returns the sort order indicator for `object`.
  5595. */
  5596. function compareMultiple(object, other, orders) {
  5597. var index = -1,
  5598. objCriteria = object.criteria,
  5599. othCriteria = other.criteria,
  5600. length = objCriteria.length,
  5601. ordersLength = orders.length;
  5602. while (++index < length) {
  5603. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5604. if (result) {
  5605. if (index >= ordersLength) {
  5606. return result;
  5607. }
  5608. var order = orders[index];
  5609. return result * (order == 'desc' ? -1 : 1);
  5610. }
  5611. }
  5612. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5613. // that causes it, under certain circumstances, to provide the same value for
  5614. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5615. // for more details.
  5616. //
  5617. // This also ensures a stable sort in V8 and other engines.
  5618. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5619. return object.index - other.index;
  5620. }
  5621. /**
  5622. * Creates an array that is the composition of partially applied arguments,
  5623. * placeholders, and provided arguments into a single array of arguments.
  5624. *
  5625. * @private
  5626. * @param {Array} args The provided arguments.
  5627. * @param {Array} partials The arguments to prepend to those provided.
  5628. * @param {Array} holders The `partials` placeholder indexes.
  5629. * @params {boolean} [isCurried] Specify composing for a curried function.
  5630. * @returns {Array} Returns the new array of composed arguments.
  5631. */
  5632. function composeArgs(args, partials, holders, isCurried) {
  5633. var argsIndex = -1,
  5634. argsLength = args.length,
  5635. holdersLength = holders.length,
  5636. leftIndex = -1,
  5637. leftLength = partials.length,
  5638. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5639. result = Array(leftLength + rangeLength),
  5640. isUncurried = !isCurried;
  5641. while (++leftIndex < leftLength) {
  5642. result[leftIndex] = partials[leftIndex];
  5643. }
  5644. while (++argsIndex < holdersLength) {
  5645. if (isUncurried || argsIndex < argsLength) {
  5646. result[holders[argsIndex]] = args[argsIndex];
  5647. }
  5648. }
  5649. while (rangeLength--) {
  5650. result[leftIndex++] = args[argsIndex++];
  5651. }
  5652. return result;
  5653. }
  5654. /**
  5655. * This function is like `composeArgs` except that the arguments composition
  5656. * is tailored for `_.partialRight`.
  5657. *
  5658. * @private
  5659. * @param {Array} args The provided arguments.
  5660. * @param {Array} partials The arguments to append to those provided.
  5661. * @param {Array} holders The `partials` placeholder indexes.
  5662. * @params {boolean} [isCurried] Specify composing for a curried function.
  5663. * @returns {Array} Returns the new array of composed arguments.
  5664. */
  5665. function composeArgsRight(args, partials, holders, isCurried) {
  5666. var argsIndex = -1,
  5667. argsLength = args.length,
  5668. holdersIndex = -1,
  5669. holdersLength = holders.length,
  5670. rightIndex = -1,
  5671. rightLength = partials.length,
  5672. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5673. result = Array(rangeLength + rightLength),
  5674. isUncurried = !isCurried;
  5675. while (++argsIndex < rangeLength) {
  5676. result[argsIndex] = args[argsIndex];
  5677. }
  5678. var offset = argsIndex;
  5679. while (++rightIndex < rightLength) {
  5680. result[offset + rightIndex] = partials[rightIndex];
  5681. }
  5682. while (++holdersIndex < holdersLength) {
  5683. if (isUncurried || argsIndex < argsLength) {
  5684. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5685. }
  5686. }
  5687. return result;
  5688. }
  5689. /**
  5690. * Copies the values of `source` to `array`.
  5691. *
  5692. * @private
  5693. * @param {Array} source The array to copy values from.
  5694. * @param {Array} [array=[]] The array to copy values to.
  5695. * @returns {Array} Returns `array`.
  5696. */
  5697. function copyArray(source, array) {
  5698. var index = -1,
  5699. length = source.length;
  5700. array || (array = Array(length));
  5701. while (++index < length) {
  5702. array[index] = source[index];
  5703. }
  5704. return array;
  5705. }
  5706. /**
  5707. * Copies properties of `source` to `object`.
  5708. *
  5709. * @private
  5710. * @param {Object} source The object to copy properties from.
  5711. * @param {Array} props The property identifiers to copy.
  5712. * @param {Object} [object={}] The object to copy properties to.
  5713. * @param {Function} [customizer] The function to customize copied values.
  5714. * @returns {Object} Returns `object`.
  5715. */
  5716. function copyObject(source, props, object, customizer) {
  5717. var isNew = !object;
  5718. object || (object = {});
  5719. var index = -1,
  5720. length = props.length;
  5721. while (++index < length) {
  5722. var key = props[index];
  5723. var newValue = customizer
  5724. ? customizer(object[key], source[key], key, object, source)
  5725. : undefined;
  5726. if (newValue === undefined) {
  5727. newValue = source[key];
  5728. }
  5729. if (isNew) {
  5730. baseAssignValue(object, key, newValue);
  5731. } else {
  5732. assignValue(object, key, newValue);
  5733. }
  5734. }
  5735. return object;
  5736. }
  5737. /**
  5738. * Copies own symbols of `source` to `object`.
  5739. *
  5740. * @private
  5741. * @param {Object} source The object to copy symbols from.
  5742. * @param {Object} [object={}] The object to copy symbols to.
  5743. * @returns {Object} Returns `object`.
  5744. */
  5745. function copySymbols(source, object) {
  5746. return copyObject(source, getSymbols(source), object);
  5747. }
  5748. /**
  5749. * Copies own and inherited symbols of `source` to `object`.
  5750. *
  5751. * @private
  5752. * @param {Object} source The object to copy symbols from.
  5753. * @param {Object} [object={}] The object to copy symbols to.
  5754. * @returns {Object} Returns `object`.
  5755. */
  5756. function copySymbolsIn(source, object) {
  5757. return copyObject(source, getSymbolsIn(source), object);
  5758. }
  5759. /**
  5760. * Creates a function like `_.groupBy`.
  5761. *
  5762. * @private
  5763. * @param {Function} setter The function to set accumulator values.
  5764. * @param {Function} [initializer] The accumulator object initializer.
  5765. * @returns {Function} Returns the new aggregator function.
  5766. */
  5767. function createAggregator(setter, initializer) {
  5768. return function(collection, iteratee) {
  5769. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5770. accumulator = initializer ? initializer() : {};
  5771. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5772. };
  5773. }
  5774. /**
  5775. * Creates a function like `_.assign`.
  5776. *
  5777. * @private
  5778. * @param {Function} assigner The function to assign values.
  5779. * @returns {Function} Returns the new assigner function.
  5780. */
  5781. function createAssigner(assigner) {
  5782. return baseRest(function(object, sources) {
  5783. var index = -1,
  5784. length = sources.length,
  5785. customizer = length > 1 ? sources[length - 1] : undefined,
  5786. guard = length > 2 ? sources[2] : undefined;
  5787. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5788. ? (length--, customizer)
  5789. : undefined;
  5790. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5791. customizer = length < 3 ? undefined : customizer;
  5792. length = 1;
  5793. }
  5794. object = Object(object);
  5795. while (++index < length) {
  5796. var source = sources[index];
  5797. if (source) {
  5798. assigner(object, source, index, customizer);
  5799. }
  5800. }
  5801. return object;
  5802. });
  5803. }
  5804. /**
  5805. * Creates a `baseEach` or `baseEachRight` function.
  5806. *
  5807. * @private
  5808. * @param {Function} eachFunc The function to iterate over a collection.
  5809. * @param {boolean} [fromRight] Specify iterating from right to left.
  5810. * @returns {Function} Returns the new base function.
  5811. */
  5812. function createBaseEach(eachFunc, fromRight) {
  5813. return function(collection, iteratee) {
  5814. if (collection == null) {
  5815. return collection;
  5816. }
  5817. if (!isArrayLike(collection)) {
  5818. return eachFunc(collection, iteratee);
  5819. }
  5820. var length = collection.length,
  5821. index = fromRight ? length : -1,
  5822. iterable = Object(collection);
  5823. while ((fromRight ? index-- : ++index < length)) {
  5824. if (iteratee(iterable[index], index, iterable) === false) {
  5825. break;
  5826. }
  5827. }
  5828. return collection;
  5829. };
  5830. }
  5831. /**
  5832. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5833. *
  5834. * @private
  5835. * @param {boolean} [fromRight] Specify iterating from right to left.
  5836. * @returns {Function} Returns the new base function.
  5837. */
  5838. function createBaseFor(fromRight) {
  5839. return function(object, iteratee, keysFunc) {
  5840. var index = -1,
  5841. iterable = Object(object),
  5842. props = keysFunc(object),
  5843. length = props.length;
  5844. while (length--) {
  5845. var key = props[fromRight ? length : ++index];
  5846. if (iteratee(iterable[key], key, iterable) === false) {
  5847. break;
  5848. }
  5849. }
  5850. return object;
  5851. };
  5852. }
  5853. /**
  5854. * Creates a function that wraps `func` to invoke it with the optional `this`
  5855. * binding of `thisArg`.
  5856. *
  5857. * @private
  5858. * @param {Function} func The function to wrap.
  5859. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5860. * @param {*} [thisArg] The `this` binding of `func`.
  5861. * @returns {Function} Returns the new wrapped function.
  5862. */
  5863. function createBind(func, bitmask, thisArg) {
  5864. var isBind = bitmask & WRAP_BIND_FLAG,
  5865. Ctor = createCtor(func);
  5866. function wrapper() {
  5867. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5868. return fn.apply(isBind ? thisArg : this, arguments);
  5869. }
  5870. return wrapper;
  5871. }
  5872. /**
  5873. * Creates a function like `_.lowerFirst`.
  5874. *
  5875. * @private
  5876. * @param {string} methodName The name of the `String` case method to use.
  5877. * @returns {Function} Returns the new case function.
  5878. */
  5879. function createCaseFirst(methodName) {
  5880. return function(string) {
  5881. string = toString(string);
  5882. var strSymbols = hasUnicode(string)
  5883. ? stringToArray(string)
  5884. : undefined;
  5885. var chr = strSymbols
  5886. ? strSymbols[0]
  5887. : string.charAt(0);
  5888. var trailing = strSymbols
  5889. ? castSlice(strSymbols, 1).join('')
  5890. : string.slice(1);
  5891. return chr[methodName]() + trailing;
  5892. };
  5893. }
  5894. /**
  5895. * Creates a function like `_.camelCase`.
  5896. *
  5897. * @private
  5898. * @param {Function} callback The function to combine each word.
  5899. * @returns {Function} Returns the new compounder function.
  5900. */
  5901. function createCompounder(callback) {
  5902. return function(string) {
  5903. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5904. };
  5905. }
  5906. /**
  5907. * Creates a function that produces an instance of `Ctor` regardless of
  5908. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5909. *
  5910. * @private
  5911. * @param {Function} Ctor The constructor to wrap.
  5912. * @returns {Function} Returns the new wrapped function.
  5913. */
  5914. function createCtor(Ctor) {
  5915. return function() {
  5916. // Use a `switch` statement to work with class constructors. See
  5917. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5918. // for more details.
  5919. var args = arguments;
  5920. switch (args.length) {
  5921. case 0: return new Ctor;
  5922. case 1: return new Ctor(args[0]);
  5923. case 2: return new Ctor(args[0], args[1]);
  5924. case 3: return new Ctor(args[0], args[1], args[2]);
  5925. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5926. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5927. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5928. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5929. }
  5930. var thisBinding = baseCreate(Ctor.prototype),
  5931. result = Ctor.apply(thisBinding, args);
  5932. // Mimic the constructor's `return` behavior.
  5933. // See https://es5.github.io/#x13.2.2 for more details.
  5934. return isObject(result) ? result : thisBinding;
  5935. };
  5936. }
  5937. /**
  5938. * Creates a function that wraps `func` to enable currying.
  5939. *
  5940. * @private
  5941. * @param {Function} func The function to wrap.
  5942. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5943. * @param {number} arity The arity of `func`.
  5944. * @returns {Function} Returns the new wrapped function.
  5945. */
  5946. function createCurry(func, bitmask, arity) {
  5947. var Ctor = createCtor(func);
  5948. function wrapper() {
  5949. var length = arguments.length,
  5950. args = Array(length),
  5951. index = length,
  5952. placeholder = getHolder(wrapper);
  5953. while (index--) {
  5954. args[index] = arguments[index];
  5955. }
  5956. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5957. ? []
  5958. : replaceHolders(args, placeholder);
  5959. length -= holders.length;
  5960. if (length < arity) {
  5961. return createRecurry(
  5962. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5963. args, holders, undefined, undefined, arity - length);
  5964. }
  5965. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5966. return apply(fn, this, args);
  5967. }
  5968. return wrapper;
  5969. }
  5970. /**
  5971. * Creates a `_.find` or `_.findLast` function.
  5972. *
  5973. * @private
  5974. * @param {Function} findIndexFunc The function to find the collection index.
  5975. * @returns {Function} Returns the new find function.
  5976. */
  5977. function createFind(findIndexFunc) {
  5978. return function(collection, predicate, fromIndex) {
  5979. var iterable = Object(collection);
  5980. if (!isArrayLike(collection)) {
  5981. var iteratee = getIteratee(predicate, 3);
  5982. collection = keys(collection);
  5983. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5984. }
  5985. var index = findIndexFunc(collection, predicate, fromIndex);
  5986. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5987. };
  5988. }
  5989. /**
  5990. * Creates a `_.flow` or `_.flowRight` function.
  5991. *
  5992. * @private
  5993. * @param {boolean} [fromRight] Specify iterating from right to left.
  5994. * @returns {Function} Returns the new flow function.
  5995. */
  5996. function createFlow(fromRight) {
  5997. return flatRest(function(funcs) {
  5998. var length = funcs.length,
  5999. index = length,
  6000. prereq = LodashWrapper.prototype.thru;
  6001. if (fromRight) {
  6002. funcs.reverse();
  6003. }
  6004. while (index--) {
  6005. var func = funcs[index];
  6006. if (typeof func != 'function') {
  6007. throw new TypeError(FUNC_ERROR_TEXT);
  6008. }
  6009. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6010. var wrapper = new LodashWrapper([], true);
  6011. }
  6012. }
  6013. index = wrapper ? index : length;
  6014. while (++index < length) {
  6015. func = funcs[index];
  6016. var funcName = getFuncName(func),
  6017. data = funcName == 'wrapper' ? getData(func) : undefined;
  6018. if (data && isLaziable(data[0]) &&
  6019. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6020. !data[4].length && data[9] == 1
  6021. ) {
  6022. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6023. } else {
  6024. wrapper = (func.length == 1 && isLaziable(func))
  6025. ? wrapper[funcName]()
  6026. : wrapper.thru(func);
  6027. }
  6028. }
  6029. return function() {
  6030. var args = arguments,
  6031. value = args[0];
  6032. if (wrapper && args.length == 1 && isArray(value)) {
  6033. return wrapper.plant(value).value();
  6034. }
  6035. var index = 0,
  6036. result = length ? funcs[index].apply(this, args) : value;
  6037. while (++index < length) {
  6038. result = funcs[index].call(this, result);
  6039. }
  6040. return result;
  6041. };
  6042. });
  6043. }
  6044. /**
  6045. * Creates a function that wraps `func` to invoke it with optional `this`
  6046. * binding of `thisArg`, partial application, and currying.
  6047. *
  6048. * @private
  6049. * @param {Function|string} func The function or method name to wrap.
  6050. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6051. * @param {*} [thisArg] The `this` binding of `func`.
  6052. * @param {Array} [partials] The arguments to prepend to those provided to
  6053. * the new function.
  6054. * @param {Array} [holders] The `partials` placeholder indexes.
  6055. * @param {Array} [partialsRight] The arguments to append to those provided
  6056. * to the new function.
  6057. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6058. * @param {Array} [argPos] The argument positions of the new function.
  6059. * @param {number} [ary] The arity cap of `func`.
  6060. * @param {number} [arity] The arity of `func`.
  6061. * @returns {Function} Returns the new wrapped function.
  6062. */
  6063. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6064. var isAry = bitmask & WRAP_ARY_FLAG,
  6065. isBind = bitmask & WRAP_BIND_FLAG,
  6066. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6067. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6068. isFlip = bitmask & WRAP_FLIP_FLAG,
  6069. Ctor = isBindKey ? undefined : createCtor(func);
  6070. function wrapper() {
  6071. var length = arguments.length,
  6072. args = Array(length),
  6073. index = length;
  6074. while (index--) {
  6075. args[index] = arguments[index];
  6076. }
  6077. if (isCurried) {
  6078. var placeholder = getHolder(wrapper),
  6079. holdersCount = countHolders(args, placeholder);
  6080. }
  6081. if (partials) {
  6082. args = composeArgs(args, partials, holders, isCurried);
  6083. }
  6084. if (partialsRight) {
  6085. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6086. }
  6087. length -= holdersCount;
  6088. if (isCurried && length < arity) {
  6089. var newHolders = replaceHolders(args, placeholder);
  6090. return createRecurry(
  6091. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6092. args, newHolders, argPos, ary, arity - length
  6093. );
  6094. }
  6095. var thisBinding = isBind ? thisArg : this,
  6096. fn = isBindKey ? thisBinding[func] : func;
  6097. length = args.length;
  6098. if (argPos) {
  6099. args = reorder(args, argPos);
  6100. } else if (isFlip && length > 1) {
  6101. args.reverse();
  6102. }
  6103. if (isAry && ary < length) {
  6104. args.length = ary;
  6105. }
  6106. if (this && this !== root && this instanceof wrapper) {
  6107. fn = Ctor || createCtor(fn);
  6108. }
  6109. return fn.apply(thisBinding, args);
  6110. }
  6111. return wrapper;
  6112. }
  6113. /**
  6114. * Creates a function like `_.invertBy`.
  6115. *
  6116. * @private
  6117. * @param {Function} setter The function to set accumulator values.
  6118. * @param {Function} toIteratee The function to resolve iteratees.
  6119. * @returns {Function} Returns the new inverter function.
  6120. */
  6121. function createInverter(setter, toIteratee) {
  6122. return function(object, iteratee) {
  6123. return baseInverter(object, setter, toIteratee(iteratee), {});
  6124. };
  6125. }
  6126. /**
  6127. * Creates a function that performs a mathematical operation on two values.
  6128. *
  6129. * @private
  6130. * @param {Function} operator The function to perform the operation.
  6131. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6132. * @returns {Function} Returns the new mathematical operation function.
  6133. */
  6134. function createMathOperation(operator, defaultValue) {
  6135. return function(value, other) {
  6136. var result;
  6137. if (value === undefined && other === undefined) {
  6138. return defaultValue;
  6139. }
  6140. if (value !== undefined) {
  6141. result = value;
  6142. }
  6143. if (other !== undefined) {
  6144. if (result === undefined) {
  6145. return other;
  6146. }
  6147. if (typeof value == 'string' || typeof other == 'string') {
  6148. value = baseToString(value);
  6149. other = baseToString(other);
  6150. } else {
  6151. value = baseToNumber(value);
  6152. other = baseToNumber(other);
  6153. }
  6154. result = operator(value, other);
  6155. }
  6156. return result;
  6157. };
  6158. }
  6159. /**
  6160. * Creates a function like `_.over`.
  6161. *
  6162. * @private
  6163. * @param {Function} arrayFunc The function to iterate over iteratees.
  6164. * @returns {Function} Returns the new over function.
  6165. */
  6166. function createOver(arrayFunc) {
  6167. return flatRest(function(iteratees) {
  6168. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6169. return baseRest(function(args) {
  6170. var thisArg = this;
  6171. return arrayFunc(iteratees, function(iteratee) {
  6172. return apply(iteratee, thisArg, args);
  6173. });
  6174. });
  6175. });
  6176. }
  6177. /**
  6178. * Creates the padding for `string` based on `length`. The `chars` string
  6179. * is truncated if the number of characters exceeds `length`.
  6180. *
  6181. * @private
  6182. * @param {number} length The padding length.
  6183. * @param {string} [chars=' '] The string used as padding.
  6184. * @returns {string} Returns the padding for `string`.
  6185. */
  6186. function createPadding(length, chars) {
  6187. chars = chars === undefined ? ' ' : baseToString(chars);
  6188. var charsLength = chars.length;
  6189. if (charsLength < 2) {
  6190. return charsLength ? baseRepeat(chars, length) : chars;
  6191. }
  6192. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6193. return hasUnicode(chars)
  6194. ? castSlice(stringToArray(result), 0, length).join('')
  6195. : result.slice(0, length);
  6196. }
  6197. /**
  6198. * Creates a function that wraps `func` to invoke it with the `this` binding
  6199. * of `thisArg` and `partials` prepended to the arguments it receives.
  6200. *
  6201. * @private
  6202. * @param {Function} func The function to wrap.
  6203. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6204. * @param {*} thisArg The `this` binding of `func`.
  6205. * @param {Array} partials The arguments to prepend to those provided to
  6206. * the new function.
  6207. * @returns {Function} Returns the new wrapped function.
  6208. */
  6209. function createPartial(func, bitmask, thisArg, partials) {
  6210. var isBind = bitmask & WRAP_BIND_FLAG,
  6211. Ctor = createCtor(func);
  6212. function wrapper() {
  6213. var argsIndex = -1,
  6214. argsLength = arguments.length,
  6215. leftIndex = -1,
  6216. leftLength = partials.length,
  6217. args = Array(leftLength + argsLength),
  6218. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6219. while (++leftIndex < leftLength) {
  6220. args[leftIndex] = partials[leftIndex];
  6221. }
  6222. while (argsLength--) {
  6223. args[leftIndex++] = arguments[++argsIndex];
  6224. }
  6225. return apply(fn, isBind ? thisArg : this, args);
  6226. }
  6227. return wrapper;
  6228. }
  6229. /**
  6230. * Creates a `_.range` or `_.rangeRight` function.
  6231. *
  6232. * @private
  6233. * @param {boolean} [fromRight] Specify iterating from right to left.
  6234. * @returns {Function} Returns the new range function.
  6235. */
  6236. function createRange(fromRight) {
  6237. return function(start, end, step) {
  6238. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6239. end = step = undefined;
  6240. }
  6241. // Ensure the sign of `-0` is preserved.
  6242. start = toFinite(start);
  6243. if (end === undefined) {
  6244. end = start;
  6245. start = 0;
  6246. } else {
  6247. end = toFinite(end);
  6248. }
  6249. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6250. return baseRange(start, end, step, fromRight);
  6251. };
  6252. }
  6253. /**
  6254. * Creates a function that performs a relational operation on two values.
  6255. *
  6256. * @private
  6257. * @param {Function} operator The function to perform the operation.
  6258. * @returns {Function} Returns the new relational operation function.
  6259. */
  6260. function createRelationalOperation(operator) {
  6261. return function(value, other) {
  6262. if (!(typeof value == 'string' && typeof other == 'string')) {
  6263. value = toNumber(value);
  6264. other = toNumber(other);
  6265. }
  6266. return operator(value, other);
  6267. };
  6268. }
  6269. /**
  6270. * Creates a function that wraps `func` to continue currying.
  6271. *
  6272. * @private
  6273. * @param {Function} func The function to wrap.
  6274. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6275. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6276. * @param {*} placeholder The placeholder value.
  6277. * @param {*} [thisArg] The `this` binding of `func`.
  6278. * @param {Array} [partials] The arguments to prepend to those provided to
  6279. * the new function.
  6280. * @param {Array} [holders] The `partials` placeholder indexes.
  6281. * @param {Array} [argPos] The argument positions of the new function.
  6282. * @param {number} [ary] The arity cap of `func`.
  6283. * @param {number} [arity] The arity of `func`.
  6284. * @returns {Function} Returns the new wrapped function.
  6285. */
  6286. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6287. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6288. newHolders = isCurry ? holders : undefined,
  6289. newHoldersRight = isCurry ? undefined : holders,
  6290. newPartials = isCurry ? partials : undefined,
  6291. newPartialsRight = isCurry ? undefined : partials;
  6292. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6293. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6294. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6295. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6296. }
  6297. var newData = [
  6298. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6299. newHoldersRight, argPos, ary, arity
  6300. ];
  6301. var result = wrapFunc.apply(undefined, newData);
  6302. if (isLaziable(func)) {
  6303. setData(result, newData);
  6304. }
  6305. result.placeholder = placeholder;
  6306. return setWrapToString(result, func, bitmask);
  6307. }
  6308. /**
  6309. * Creates a function like `_.round`.
  6310. *
  6311. * @private
  6312. * @param {string} methodName The name of the `Math` method to use when rounding.
  6313. * @returns {Function} Returns the new round function.
  6314. */
  6315. function createRound(methodName) {
  6316. var func = Math[methodName];
  6317. return function(number, precision) {
  6318. number = toNumber(number);
  6319. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6320. if (precision && nativeIsFinite(number)) {
  6321. // Shift with exponential notation to avoid floating-point issues.
  6322. // See [MDN](https://mdn.io/round#Examples) for more details.
  6323. var pair = (toString(number) + 'e').split('e'),
  6324. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6325. pair = (toString(value) + 'e').split('e');
  6326. return +(pair[0] + 'e' + (+pair[1] - precision));
  6327. }
  6328. return func(number);
  6329. };
  6330. }
  6331. /**
  6332. * Creates a set object of `values`.
  6333. *
  6334. * @private
  6335. * @param {Array} values The values to add to the set.
  6336. * @returns {Object} Returns the new set.
  6337. */
  6338. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6339. return new Set(values);
  6340. };
  6341. /**
  6342. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6343. *
  6344. * @private
  6345. * @param {Function} keysFunc The function to get the keys of a given object.
  6346. * @returns {Function} Returns the new pairs function.
  6347. */
  6348. function createToPairs(keysFunc) {
  6349. return function(object) {
  6350. var tag = getTag(object);
  6351. if (tag == mapTag) {
  6352. return mapToArray(object);
  6353. }
  6354. if (tag == setTag) {
  6355. return setToPairs(object);
  6356. }
  6357. return baseToPairs(object, keysFunc(object));
  6358. };
  6359. }
  6360. /**
  6361. * Creates a function that either curries or invokes `func` with optional
  6362. * `this` binding and partially applied arguments.
  6363. *
  6364. * @private
  6365. * @param {Function|string} func The function or method name to wrap.
  6366. * @param {number} bitmask The bitmask flags.
  6367. * 1 - `_.bind`
  6368. * 2 - `_.bindKey`
  6369. * 4 - `_.curry` or `_.curryRight` of a bound function
  6370. * 8 - `_.curry`
  6371. * 16 - `_.curryRight`
  6372. * 32 - `_.partial`
  6373. * 64 - `_.partialRight`
  6374. * 128 - `_.rearg`
  6375. * 256 - `_.ary`
  6376. * 512 - `_.flip`
  6377. * @param {*} [thisArg] The `this` binding of `func`.
  6378. * @param {Array} [partials] The arguments to be partially applied.
  6379. * @param {Array} [holders] The `partials` placeholder indexes.
  6380. * @param {Array} [argPos] The argument positions of the new function.
  6381. * @param {number} [ary] The arity cap of `func`.
  6382. * @param {number} [arity] The arity of `func`.
  6383. * @returns {Function} Returns the new wrapped function.
  6384. */
  6385. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6386. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6387. if (!isBindKey && typeof func != 'function') {
  6388. throw new TypeError(FUNC_ERROR_TEXT);
  6389. }
  6390. var length = partials ? partials.length : 0;
  6391. if (!length) {
  6392. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6393. partials = holders = undefined;
  6394. }
  6395. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6396. arity = arity === undefined ? arity : toInteger(arity);
  6397. length -= holders ? holders.length : 0;
  6398. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6399. var partialsRight = partials,
  6400. holdersRight = holders;
  6401. partials = holders = undefined;
  6402. }
  6403. var data = isBindKey ? undefined : getData(func);
  6404. var newData = [
  6405. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6406. argPos, ary, arity
  6407. ];
  6408. if (data) {
  6409. mergeData(newData, data);
  6410. }
  6411. func = newData[0];
  6412. bitmask = newData[1];
  6413. thisArg = newData[2];
  6414. partials = newData[3];
  6415. holders = newData[4];
  6416. arity = newData[9] = newData[9] === undefined
  6417. ? (isBindKey ? 0 : func.length)
  6418. : nativeMax(newData[9] - length, 0);
  6419. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6420. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6421. }
  6422. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6423. var result = createBind(func, bitmask, thisArg);
  6424. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6425. result = createCurry(func, bitmask, arity);
  6426. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6427. result = createPartial(func, bitmask, thisArg, partials);
  6428. } else {
  6429. result = createHybrid.apply(undefined, newData);
  6430. }
  6431. var setter = data ? baseSetData : setData;
  6432. return setWrapToString(setter(result, newData), func, bitmask);
  6433. }
  6434. /**
  6435. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6436. * of source objects to the destination object for all destination properties
  6437. * that resolve to `undefined`.
  6438. *
  6439. * @private
  6440. * @param {*} objValue The destination value.
  6441. * @param {*} srcValue The source value.
  6442. * @param {string} key The key of the property to assign.
  6443. * @param {Object} object The parent object of `objValue`.
  6444. * @returns {*} Returns the value to assign.
  6445. */
  6446. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6447. if (objValue === undefined ||
  6448. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6449. return srcValue;
  6450. }
  6451. return objValue;
  6452. }
  6453. /**
  6454. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6455. * objects into destination objects that are passed thru.
  6456. *
  6457. * @private
  6458. * @param {*} objValue The destination value.
  6459. * @param {*} srcValue The source value.
  6460. * @param {string} key The key of the property to merge.
  6461. * @param {Object} object The parent object of `objValue`.
  6462. * @param {Object} source The parent object of `srcValue`.
  6463. * @param {Object} [stack] Tracks traversed source values and their merged
  6464. * counterparts.
  6465. * @returns {*} Returns the value to assign.
  6466. */
  6467. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6468. if (isObject(objValue) && isObject(srcValue)) {
  6469. // Recursively merge objects and arrays (susceptible to call stack limits).
  6470. stack.set(srcValue, objValue);
  6471. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6472. stack['delete'](srcValue);
  6473. }
  6474. return objValue;
  6475. }
  6476. /**
  6477. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6478. * objects.
  6479. *
  6480. * @private
  6481. * @param {*} value The value to inspect.
  6482. * @param {string} key The key of the property to inspect.
  6483. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6484. */
  6485. function customOmitClone(value) {
  6486. return isPlainObject(value) ? undefined : value;
  6487. }
  6488. /**
  6489. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6490. * partial deep comparisons.
  6491. *
  6492. * @private
  6493. * @param {Array} array The array to compare.
  6494. * @param {Array} other The other array to compare.
  6495. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6496. * @param {Function} customizer The function to customize comparisons.
  6497. * @param {Function} equalFunc The function to determine equivalents of values.
  6498. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6499. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6500. */
  6501. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6502. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6503. arrLength = array.length,
  6504. othLength = other.length;
  6505. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6506. return false;
  6507. }
  6508. // Check that cyclic values are equal.
  6509. var arrStacked = stack.get(array);
  6510. var othStacked = stack.get(other);
  6511. if (arrStacked && othStacked) {
  6512. return arrStacked == other && othStacked == array;
  6513. }
  6514. var index = -1,
  6515. result = true,
  6516. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6517. stack.set(array, other);
  6518. stack.set(other, array);
  6519. // Ignore non-index properties.
  6520. while (++index < arrLength) {
  6521. var arrValue = array[index],
  6522. othValue = other[index];
  6523. if (customizer) {
  6524. var compared = isPartial
  6525. ? customizer(othValue, arrValue, index, other, array, stack)
  6526. : customizer(arrValue, othValue, index, array, other, stack);
  6527. }
  6528. if (compared !== undefined) {
  6529. if (compared) {
  6530. continue;
  6531. }
  6532. result = false;
  6533. break;
  6534. }
  6535. // Recursively compare arrays (susceptible to call stack limits).
  6536. if (seen) {
  6537. if (!arraySome(other, function(othValue, othIndex) {
  6538. if (!cacheHas(seen, othIndex) &&
  6539. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6540. return seen.push(othIndex);
  6541. }
  6542. })) {
  6543. result = false;
  6544. break;
  6545. }
  6546. } else if (!(
  6547. arrValue === othValue ||
  6548. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6549. )) {
  6550. result = false;
  6551. break;
  6552. }
  6553. }
  6554. stack['delete'](array);
  6555. stack['delete'](other);
  6556. return result;
  6557. }
  6558. /**
  6559. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6560. * the same `toStringTag`.
  6561. *
  6562. * **Note:** This function only supports comparing values with tags of
  6563. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6564. *
  6565. * @private
  6566. * @param {Object} object The object to compare.
  6567. * @param {Object} other The other object to compare.
  6568. * @param {string} tag The `toStringTag` of the objects to compare.
  6569. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6570. * @param {Function} customizer The function to customize comparisons.
  6571. * @param {Function} equalFunc The function to determine equivalents of values.
  6572. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6573. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6574. */
  6575. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6576. switch (tag) {
  6577. case dataViewTag:
  6578. if ((object.byteLength != other.byteLength) ||
  6579. (object.byteOffset != other.byteOffset)) {
  6580. return false;
  6581. }
  6582. object = object.buffer;
  6583. other = other.buffer;
  6584. case arrayBufferTag:
  6585. if ((object.byteLength != other.byteLength) ||
  6586. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6587. return false;
  6588. }
  6589. return true;
  6590. case boolTag:
  6591. case dateTag:
  6592. case numberTag:
  6593. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6594. // Invalid dates are coerced to `NaN`.
  6595. return eq(+object, +other);
  6596. case errorTag:
  6597. return object.name == other.name && object.message == other.message;
  6598. case regexpTag:
  6599. case stringTag:
  6600. // Coerce regexes to strings and treat strings, primitives and objects,
  6601. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6602. // for more details.
  6603. return object == (other + '');
  6604. case mapTag:
  6605. var convert = mapToArray;
  6606. case setTag:
  6607. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6608. convert || (convert = setToArray);
  6609. if (object.size != other.size && !isPartial) {
  6610. return false;
  6611. }
  6612. // Assume cyclic values are equal.
  6613. var stacked = stack.get(object);
  6614. if (stacked) {
  6615. return stacked == other;
  6616. }
  6617. bitmask |= COMPARE_UNORDERED_FLAG;
  6618. // Recursively compare objects (susceptible to call stack limits).
  6619. stack.set(object, other);
  6620. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6621. stack['delete'](object);
  6622. return result;
  6623. case symbolTag:
  6624. if (symbolValueOf) {
  6625. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6626. }
  6627. }
  6628. return false;
  6629. }
  6630. /**
  6631. * A specialized version of `baseIsEqualDeep` for objects with support for
  6632. * partial deep comparisons.
  6633. *
  6634. * @private
  6635. * @param {Object} object The object to compare.
  6636. * @param {Object} other The other object to compare.
  6637. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6638. * @param {Function} customizer The function to customize comparisons.
  6639. * @param {Function} equalFunc The function to determine equivalents of values.
  6640. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6641. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6642. */
  6643. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6644. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6645. objProps = getAllKeys(object),
  6646. objLength = objProps.length,
  6647. othProps = getAllKeys(other),
  6648. othLength = othProps.length;
  6649. if (objLength != othLength && !isPartial) {
  6650. return false;
  6651. }
  6652. var index = objLength;
  6653. while (index--) {
  6654. var key = objProps[index];
  6655. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6656. return false;
  6657. }
  6658. }
  6659. // Check that cyclic values are equal.
  6660. var objStacked = stack.get(object);
  6661. var othStacked = stack.get(other);
  6662. if (objStacked && othStacked) {
  6663. return objStacked == other && othStacked == object;
  6664. }
  6665. var result = true;
  6666. stack.set(object, other);
  6667. stack.set(other, object);
  6668. var skipCtor = isPartial;
  6669. while (++index < objLength) {
  6670. key = objProps[index];
  6671. var objValue = object[key],
  6672. othValue = other[key];
  6673. if (customizer) {
  6674. var compared = isPartial
  6675. ? customizer(othValue, objValue, key, other, object, stack)
  6676. : customizer(objValue, othValue, key, object, other, stack);
  6677. }
  6678. // Recursively compare objects (susceptible to call stack limits).
  6679. if (!(compared === undefined
  6680. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6681. : compared
  6682. )) {
  6683. result = false;
  6684. break;
  6685. }
  6686. skipCtor || (skipCtor = key == 'constructor');
  6687. }
  6688. if (result && !skipCtor) {
  6689. var objCtor = object.constructor,
  6690. othCtor = other.constructor;
  6691. // Non `Object` object instances with different constructors are not equal.
  6692. if (objCtor != othCtor &&
  6693. ('constructor' in object && 'constructor' in other) &&
  6694. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6695. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6696. result = false;
  6697. }
  6698. }
  6699. stack['delete'](object);
  6700. stack['delete'](other);
  6701. return result;
  6702. }
  6703. /**
  6704. * A specialized version of `baseRest` which flattens the rest array.
  6705. *
  6706. * @private
  6707. * @param {Function} func The function to apply a rest parameter to.
  6708. * @returns {Function} Returns the new function.
  6709. */
  6710. function flatRest(func) {
  6711. return setToString(overRest(func, undefined, flatten), func + '');
  6712. }
  6713. /**
  6714. * Creates an array of own enumerable property names and symbols of `object`.
  6715. *
  6716. * @private
  6717. * @param {Object} object The object to query.
  6718. * @returns {Array} Returns the array of property names and symbols.
  6719. */
  6720. function getAllKeys(object) {
  6721. return baseGetAllKeys(object, keys, getSymbols);
  6722. }
  6723. /**
  6724. * Creates an array of own and inherited enumerable property names and
  6725. * symbols of `object`.
  6726. *
  6727. * @private
  6728. * @param {Object} object The object to query.
  6729. * @returns {Array} Returns the array of property names and symbols.
  6730. */
  6731. function getAllKeysIn(object) {
  6732. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6733. }
  6734. /**
  6735. * Gets metadata for `func`.
  6736. *
  6737. * @private
  6738. * @param {Function} func The function to query.
  6739. * @returns {*} Returns the metadata for `func`.
  6740. */
  6741. var getData = !metaMap ? noop : function(func) {
  6742. return metaMap.get(func);
  6743. };
  6744. /**
  6745. * Gets the name of `func`.
  6746. *
  6747. * @private
  6748. * @param {Function} func The function to query.
  6749. * @returns {string} Returns the function name.
  6750. */
  6751. function getFuncName(func) {
  6752. var result = (func.name + ''),
  6753. array = realNames[result],
  6754. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6755. while (length--) {
  6756. var data = array[length],
  6757. otherFunc = data.func;
  6758. if (otherFunc == null || otherFunc == func) {
  6759. return data.name;
  6760. }
  6761. }
  6762. return result;
  6763. }
  6764. /**
  6765. * Gets the argument placeholder value for `func`.
  6766. *
  6767. * @private
  6768. * @param {Function} func The function to inspect.
  6769. * @returns {*} Returns the placeholder value.
  6770. */
  6771. function getHolder(func) {
  6772. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6773. return object.placeholder;
  6774. }
  6775. /**
  6776. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6777. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6778. * If arguments are provided, the chosen function is invoked with them and
  6779. * its result is returned.
  6780. *
  6781. * @private
  6782. * @param {*} [value] The value to convert to an iteratee.
  6783. * @param {number} [arity] The arity of the created iteratee.
  6784. * @returns {Function} Returns the chosen function or its result.
  6785. */
  6786. function getIteratee() {
  6787. var result = lodash.iteratee || iteratee;
  6788. result = result === iteratee ? baseIteratee : result;
  6789. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6790. }
  6791. /**
  6792. * Gets the data for `map`.
  6793. *
  6794. * @private
  6795. * @param {Object} map The map to query.
  6796. * @param {string} key The reference key.
  6797. * @returns {*} Returns the map data.
  6798. */
  6799. function getMapData(map, key) {
  6800. var data = map.__data__;
  6801. return isKeyable(key)
  6802. ? data[typeof key == 'string' ? 'string' : 'hash']
  6803. : data.map;
  6804. }
  6805. /**
  6806. * Gets the property names, values, and compare flags of `object`.
  6807. *
  6808. * @private
  6809. * @param {Object} object The object to query.
  6810. * @returns {Array} Returns the match data of `object`.
  6811. */
  6812. function getMatchData(object) {
  6813. var result = keys(object),
  6814. length = result.length;
  6815. while (length--) {
  6816. var key = result[length],
  6817. value = object[key];
  6818. result[length] = [key, value, isStrictComparable(value)];
  6819. }
  6820. return result;
  6821. }
  6822. /**
  6823. * Gets the native function at `key` of `object`.
  6824. *
  6825. * @private
  6826. * @param {Object} object The object to query.
  6827. * @param {string} key The key of the method to get.
  6828. * @returns {*} Returns the function if it's native, else `undefined`.
  6829. */
  6830. function getNative(object, key) {
  6831. var value = getValue(object, key);
  6832. return baseIsNative(value) ? value : undefined;
  6833. }
  6834. /**
  6835. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6836. *
  6837. * @private
  6838. * @param {*} value The value to query.
  6839. * @returns {string} Returns the raw `toStringTag`.
  6840. */
  6841. function getRawTag(value) {
  6842. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6843. tag = value[symToStringTag];
  6844. try {
  6845. value[symToStringTag] = undefined;
  6846. var unmasked = true;
  6847. } catch (e) {}
  6848. var result = nativeObjectToString.call(value);
  6849. if (unmasked) {
  6850. if (isOwn) {
  6851. value[symToStringTag] = tag;
  6852. } else {
  6853. delete value[symToStringTag];
  6854. }
  6855. }
  6856. return result;
  6857. }
  6858. /**
  6859. * Creates an array of the own enumerable symbols of `object`.
  6860. *
  6861. * @private
  6862. * @param {Object} object The object to query.
  6863. * @returns {Array} Returns the array of symbols.
  6864. */
  6865. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6866. if (object == null) {
  6867. return [];
  6868. }
  6869. object = Object(object);
  6870. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6871. return propertyIsEnumerable.call(object, symbol);
  6872. });
  6873. };
  6874. /**
  6875. * Creates an array of the own and inherited enumerable symbols of `object`.
  6876. *
  6877. * @private
  6878. * @param {Object} object The object to query.
  6879. * @returns {Array} Returns the array of symbols.
  6880. */
  6881. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6882. var result = [];
  6883. while (object) {
  6884. arrayPush(result, getSymbols(object));
  6885. object = getPrototype(object);
  6886. }
  6887. return result;
  6888. };
  6889. /**
  6890. * Gets the `toStringTag` of `value`.
  6891. *
  6892. * @private
  6893. * @param {*} value The value to query.
  6894. * @returns {string} Returns the `toStringTag`.
  6895. */
  6896. var getTag = baseGetTag;
  6897. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6898. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6899. (Map && getTag(new Map) != mapTag) ||
  6900. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6901. (Set && getTag(new Set) != setTag) ||
  6902. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6903. getTag = function(value) {
  6904. var result = baseGetTag(value),
  6905. Ctor = result == objectTag ? value.constructor : undefined,
  6906. ctorString = Ctor ? toSource(Ctor) : '';
  6907. if (ctorString) {
  6908. switch (ctorString) {
  6909. case dataViewCtorString: return dataViewTag;
  6910. case mapCtorString: return mapTag;
  6911. case promiseCtorString: return promiseTag;
  6912. case setCtorString: return setTag;
  6913. case weakMapCtorString: return weakMapTag;
  6914. }
  6915. }
  6916. return result;
  6917. };
  6918. }
  6919. /**
  6920. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6921. *
  6922. * @private
  6923. * @param {number} start The start of the view.
  6924. * @param {number} end The end of the view.
  6925. * @param {Array} transforms The transformations to apply to the view.
  6926. * @returns {Object} Returns an object containing the `start` and `end`
  6927. * positions of the view.
  6928. */
  6929. function getView(start, end, transforms) {
  6930. var index = -1,
  6931. length = transforms.length;
  6932. while (++index < length) {
  6933. var data = transforms[index],
  6934. size = data.size;
  6935. switch (data.type) {
  6936. case 'drop': start += size; break;
  6937. case 'dropRight': end -= size; break;
  6938. case 'take': end = nativeMin(end, start + size); break;
  6939. case 'takeRight': start = nativeMax(start, end - size); break;
  6940. }
  6941. }
  6942. return { 'start': start, 'end': end };
  6943. }
  6944. /**
  6945. * Extracts wrapper details from the `source` body comment.
  6946. *
  6947. * @private
  6948. * @param {string} source The source to inspect.
  6949. * @returns {Array} Returns the wrapper details.
  6950. */
  6951. function getWrapDetails(source) {
  6952. var match = source.match(reWrapDetails);
  6953. return match ? match[1].split(reSplitDetails) : [];
  6954. }
  6955. /**
  6956. * Checks if `path` exists on `object`.
  6957. *
  6958. * @private
  6959. * @param {Object} object The object to query.
  6960. * @param {Array|string} path The path to check.
  6961. * @param {Function} hasFunc The function to check properties.
  6962. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6963. */
  6964. function hasPath(object, path, hasFunc) {
  6965. path = castPath(path, object);
  6966. var index = -1,
  6967. length = path.length,
  6968. result = false;
  6969. while (++index < length) {
  6970. var key = toKey(path[index]);
  6971. if (!(result = object != null && hasFunc(object, key))) {
  6972. break;
  6973. }
  6974. object = object[key];
  6975. }
  6976. if (result || ++index != length) {
  6977. return result;
  6978. }
  6979. length = object == null ? 0 : object.length;
  6980. return !!length && isLength(length) && isIndex(key, length) &&
  6981. (isArray(object) || isArguments(object));
  6982. }
  6983. /**
  6984. * Initializes an array clone.
  6985. *
  6986. * @private
  6987. * @param {Array} array The array to clone.
  6988. * @returns {Array} Returns the initialized clone.
  6989. */
  6990. function initCloneArray(array) {
  6991. var length = array.length,
  6992. result = new array.constructor(length);
  6993. // Add properties assigned by `RegExp#exec`.
  6994. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6995. result.index = array.index;
  6996. result.input = array.input;
  6997. }
  6998. return result;
  6999. }
  7000. /**
  7001. * Initializes an object clone.
  7002. *
  7003. * @private
  7004. * @param {Object} object The object to clone.
  7005. * @returns {Object} Returns the initialized clone.
  7006. */
  7007. function initCloneObject(object) {
  7008. return (typeof object.constructor == 'function' && !isPrototype(object))
  7009. ? baseCreate(getPrototype(object))
  7010. : {};
  7011. }
  7012. /**
  7013. * Initializes an object clone based on its `toStringTag`.
  7014. *
  7015. * **Note:** This function only supports cloning values with tags of
  7016. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7017. *
  7018. * @private
  7019. * @param {Object} object The object to clone.
  7020. * @param {string} tag The `toStringTag` of the object to clone.
  7021. * @param {boolean} [isDeep] Specify a deep clone.
  7022. * @returns {Object} Returns the initialized clone.
  7023. */
  7024. function initCloneByTag(object, tag, isDeep) {
  7025. var Ctor = object.constructor;
  7026. switch (tag) {
  7027. case arrayBufferTag:
  7028. return cloneArrayBuffer(object);
  7029. case boolTag:
  7030. case dateTag:
  7031. return new Ctor(+object);
  7032. case dataViewTag:
  7033. return cloneDataView(object, isDeep);
  7034. case float32Tag: case float64Tag:
  7035. case int8Tag: case int16Tag: case int32Tag:
  7036. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7037. return cloneTypedArray(object, isDeep);
  7038. case mapTag:
  7039. return new Ctor;
  7040. case numberTag:
  7041. case stringTag:
  7042. return new Ctor(object);
  7043. case regexpTag:
  7044. return cloneRegExp(object);
  7045. case setTag:
  7046. return new Ctor;
  7047. case symbolTag:
  7048. return cloneSymbol(object);
  7049. }
  7050. }
  7051. /**
  7052. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7053. *
  7054. * @private
  7055. * @param {string} source The source to modify.
  7056. * @returns {Array} details The details to insert.
  7057. * @returns {string} Returns the modified source.
  7058. */
  7059. function insertWrapDetails(source, details) {
  7060. var length = details.length;
  7061. if (!length) {
  7062. return source;
  7063. }
  7064. var lastIndex = length - 1;
  7065. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7066. details = details.join(length > 2 ? ', ' : ' ');
  7067. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7068. }
  7069. /**
  7070. * Checks if `value` is a flattenable `arguments` object or array.
  7071. *
  7072. * @private
  7073. * @param {*} value The value to check.
  7074. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7075. */
  7076. function isFlattenable(value) {
  7077. return isArray(value) || isArguments(value) ||
  7078. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7079. }
  7080. /**
  7081. * Checks if `value` is a valid array-like index.
  7082. *
  7083. * @private
  7084. * @param {*} value The value to check.
  7085. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7086. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7087. */
  7088. function isIndex(value, length) {
  7089. var type = typeof value;
  7090. length = length == null ? MAX_SAFE_INTEGER : length;
  7091. return !!length &&
  7092. (type == 'number' ||
  7093. (type != 'symbol' && reIsUint.test(value))) &&
  7094. (value > -1 && value % 1 == 0 && value < length);
  7095. }
  7096. /**
  7097. * Checks if the given arguments are from an iteratee call.
  7098. *
  7099. * @private
  7100. * @param {*} value The potential iteratee value argument.
  7101. * @param {*} index The potential iteratee index or key argument.
  7102. * @param {*} object The potential iteratee object argument.
  7103. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7104. * else `false`.
  7105. */
  7106. function isIterateeCall(value, index, object) {
  7107. if (!isObject(object)) {
  7108. return false;
  7109. }
  7110. var type = typeof index;
  7111. if (type == 'number'
  7112. ? (isArrayLike(object) && isIndex(index, object.length))
  7113. : (type == 'string' && index in object)
  7114. ) {
  7115. return eq(object[index], value);
  7116. }
  7117. return false;
  7118. }
  7119. /**
  7120. * Checks if `value` is a property name and not a property path.
  7121. *
  7122. * @private
  7123. * @param {*} value The value to check.
  7124. * @param {Object} [object] The object to query keys on.
  7125. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7126. */
  7127. function isKey(value, object) {
  7128. if (isArray(value)) {
  7129. return false;
  7130. }
  7131. var type = typeof value;
  7132. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7133. value == null || isSymbol(value)) {
  7134. return true;
  7135. }
  7136. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7137. (object != null && value in Object(object));
  7138. }
  7139. /**
  7140. * Checks if `value` is suitable for use as unique object key.
  7141. *
  7142. * @private
  7143. * @param {*} value The value to check.
  7144. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7145. */
  7146. function isKeyable(value) {
  7147. var type = typeof value;
  7148. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7149. ? (value !== '__proto__')
  7150. : (value === null);
  7151. }
  7152. /**
  7153. * Checks if `func` has a lazy counterpart.
  7154. *
  7155. * @private
  7156. * @param {Function} func The function to check.
  7157. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7158. * else `false`.
  7159. */
  7160. function isLaziable(func) {
  7161. var funcName = getFuncName(func),
  7162. other = lodash[funcName];
  7163. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7164. return false;
  7165. }
  7166. if (func === other) {
  7167. return true;
  7168. }
  7169. var data = getData(other);
  7170. return !!data && func === data[0];
  7171. }
  7172. /**
  7173. * Checks if `func` has its source masked.
  7174. *
  7175. * @private
  7176. * @param {Function} func The function to check.
  7177. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7178. */
  7179. function isMasked(func) {
  7180. return !!maskSrcKey && (maskSrcKey in func);
  7181. }
  7182. /**
  7183. * Checks if `func` is capable of being masked.
  7184. *
  7185. * @private
  7186. * @param {*} value The value to check.
  7187. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7188. */
  7189. var isMaskable = coreJsData ? isFunction : stubFalse;
  7190. /**
  7191. * Checks if `value` is likely a prototype object.
  7192. *
  7193. * @private
  7194. * @param {*} value The value to check.
  7195. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7196. */
  7197. function isPrototype(value) {
  7198. var Ctor = value && value.constructor,
  7199. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7200. return value === proto;
  7201. }
  7202. /**
  7203. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7204. *
  7205. * @private
  7206. * @param {*} value The value to check.
  7207. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7208. * equality comparisons, else `false`.
  7209. */
  7210. function isStrictComparable(value) {
  7211. return value === value && !isObject(value);
  7212. }
  7213. /**
  7214. * A specialized version of `matchesProperty` for source values suitable
  7215. * for strict equality comparisons, i.e. `===`.
  7216. *
  7217. * @private
  7218. * @param {string} key The key of the property to get.
  7219. * @param {*} srcValue The value to match.
  7220. * @returns {Function} Returns the new spec function.
  7221. */
  7222. function matchesStrictComparable(key, srcValue) {
  7223. return function(object) {
  7224. if (object == null) {
  7225. return false;
  7226. }
  7227. return object[key] === srcValue &&
  7228. (srcValue !== undefined || (key in Object(object)));
  7229. };
  7230. }
  7231. /**
  7232. * A specialized version of `_.memoize` which clears the memoized function's
  7233. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7234. *
  7235. * @private
  7236. * @param {Function} func The function to have its output memoized.
  7237. * @returns {Function} Returns the new memoized function.
  7238. */
  7239. function memoizeCapped(func) {
  7240. var result = memoize(func, function(key) {
  7241. if (cache.size === MAX_MEMOIZE_SIZE) {
  7242. cache.clear();
  7243. }
  7244. return key;
  7245. });
  7246. var cache = result.cache;
  7247. return result;
  7248. }
  7249. /**
  7250. * Merges the function metadata of `source` into `data`.
  7251. *
  7252. * Merging metadata reduces the number of wrappers used to invoke a function.
  7253. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7254. * may be applied regardless of execution order. Methods like `_.ary` and
  7255. * `_.rearg` modify function arguments, making the order in which they are
  7256. * executed important, preventing the merging of metadata. However, we make
  7257. * an exception for a safe combined case where curried functions have `_.ary`
  7258. * and or `_.rearg` applied.
  7259. *
  7260. * @private
  7261. * @param {Array} data The destination metadata.
  7262. * @param {Array} source The source metadata.
  7263. * @returns {Array} Returns `data`.
  7264. */
  7265. function mergeData(data, source) {
  7266. var bitmask = data[1],
  7267. srcBitmask = source[1],
  7268. newBitmask = bitmask | srcBitmask,
  7269. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7270. var isCombo =
  7271. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7272. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7273. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7274. // Exit early if metadata can't be merged.
  7275. if (!(isCommon || isCombo)) {
  7276. return data;
  7277. }
  7278. // Use source `thisArg` if available.
  7279. if (srcBitmask & WRAP_BIND_FLAG) {
  7280. data[2] = source[2];
  7281. // Set when currying a bound function.
  7282. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7283. }
  7284. // Compose partial arguments.
  7285. var value = source[3];
  7286. if (value) {
  7287. var partials = data[3];
  7288. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7289. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7290. }
  7291. // Compose partial right arguments.
  7292. value = source[5];
  7293. if (value) {
  7294. partials = data[5];
  7295. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7296. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7297. }
  7298. // Use source `argPos` if available.
  7299. value = source[7];
  7300. if (value) {
  7301. data[7] = value;
  7302. }
  7303. // Use source `ary` if it's smaller.
  7304. if (srcBitmask & WRAP_ARY_FLAG) {
  7305. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7306. }
  7307. // Use source `arity` if one is not provided.
  7308. if (data[9] == null) {
  7309. data[9] = source[9];
  7310. }
  7311. // Use source `func` and merge bitmasks.
  7312. data[0] = source[0];
  7313. data[1] = newBitmask;
  7314. return data;
  7315. }
  7316. /**
  7317. * This function is like
  7318. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7319. * except that it includes inherited enumerable properties.
  7320. *
  7321. * @private
  7322. * @param {Object} object The object to query.
  7323. * @returns {Array} Returns the array of property names.
  7324. */
  7325. function nativeKeysIn(object) {
  7326. var result = [];
  7327. if (object != null) {
  7328. for (var key in Object(object)) {
  7329. result.push(key);
  7330. }
  7331. }
  7332. return result;
  7333. }
  7334. /**
  7335. * Converts `value` to a string using `Object.prototype.toString`.
  7336. *
  7337. * @private
  7338. * @param {*} value The value to convert.
  7339. * @returns {string} Returns the converted string.
  7340. */
  7341. function objectToString(value) {
  7342. return nativeObjectToString.call(value);
  7343. }
  7344. /**
  7345. * A specialized version of `baseRest` which transforms the rest array.
  7346. *
  7347. * @private
  7348. * @param {Function} func The function to apply a rest parameter to.
  7349. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7350. * @param {Function} transform The rest array transform.
  7351. * @returns {Function} Returns the new function.
  7352. */
  7353. function overRest(func, start, transform) {
  7354. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7355. return function() {
  7356. var args = arguments,
  7357. index = -1,
  7358. length = nativeMax(args.length - start, 0),
  7359. array = Array(length);
  7360. while (++index < length) {
  7361. array[index] = args[start + index];
  7362. }
  7363. index = -1;
  7364. var otherArgs = Array(start + 1);
  7365. while (++index < start) {
  7366. otherArgs[index] = args[index];
  7367. }
  7368. otherArgs[start] = transform(array);
  7369. return apply(func, this, otherArgs);
  7370. };
  7371. }
  7372. /**
  7373. * Gets the parent value at `path` of `object`.
  7374. *
  7375. * @private
  7376. * @param {Object} object The object to query.
  7377. * @param {Array} path The path to get the parent value of.
  7378. * @returns {*} Returns the parent value.
  7379. */
  7380. function parent(object, path) {
  7381. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7382. }
  7383. /**
  7384. * Reorder `array` according to the specified indexes where the element at
  7385. * the first index is assigned as the first element, the element at
  7386. * the second index is assigned as the second element, and so on.
  7387. *
  7388. * @private
  7389. * @param {Array} array The array to reorder.
  7390. * @param {Array} indexes The arranged array indexes.
  7391. * @returns {Array} Returns `array`.
  7392. */
  7393. function reorder(array, indexes) {
  7394. var arrLength = array.length,
  7395. length = nativeMin(indexes.length, arrLength),
  7396. oldArray = copyArray(array);
  7397. while (length--) {
  7398. var index = indexes[length];
  7399. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7400. }
  7401. return array;
  7402. }
  7403. /**
  7404. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7405. *
  7406. * @private
  7407. * @param {Object} object The object to query.
  7408. * @param {string} key The key of the property to get.
  7409. * @returns {*} Returns the property value.
  7410. */
  7411. function safeGet(object, key) {
  7412. if (key === 'constructor' && typeof object[key] === 'function') {
  7413. return;
  7414. }
  7415. if (key == '__proto__') {
  7416. return;
  7417. }
  7418. return object[key];
  7419. }
  7420. /**
  7421. * Sets metadata for `func`.
  7422. *
  7423. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7424. * period of time, it will trip its breaker and transition to an identity
  7425. * function to avoid garbage collection pauses in V8. See
  7426. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7427. * for more details.
  7428. *
  7429. * @private
  7430. * @param {Function} func The function to associate metadata with.
  7431. * @param {*} data The metadata.
  7432. * @returns {Function} Returns `func`.
  7433. */
  7434. var setData = shortOut(baseSetData);
  7435. /**
  7436. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7437. *
  7438. * @private
  7439. * @param {Function} func The function to delay.
  7440. * @param {number} wait The number of milliseconds to delay invocation.
  7441. * @returns {number|Object} Returns the timer id or timeout object.
  7442. */
  7443. var setTimeout = ctxSetTimeout || function(func, wait) {
  7444. return root.setTimeout(func, wait);
  7445. };
  7446. /**
  7447. * Sets the `toString` method of `func` to return `string`.
  7448. *
  7449. * @private
  7450. * @param {Function} func The function to modify.
  7451. * @param {Function} string The `toString` result.
  7452. * @returns {Function} Returns `func`.
  7453. */
  7454. var setToString = shortOut(baseSetToString);
  7455. /**
  7456. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7457. * with wrapper details in a comment at the top of the source body.
  7458. *
  7459. * @private
  7460. * @param {Function} wrapper The function to modify.
  7461. * @param {Function} reference The reference function.
  7462. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7463. * @returns {Function} Returns `wrapper`.
  7464. */
  7465. function setWrapToString(wrapper, reference, bitmask) {
  7466. var source = (reference + '');
  7467. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7468. }
  7469. /**
  7470. * Creates a function that'll short out and invoke `identity` instead
  7471. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7472. * milliseconds.
  7473. *
  7474. * @private
  7475. * @param {Function} func The function to restrict.
  7476. * @returns {Function} Returns the new shortable function.
  7477. */
  7478. function shortOut(func) {
  7479. var count = 0,
  7480. lastCalled = 0;
  7481. return function() {
  7482. var stamp = nativeNow(),
  7483. remaining = HOT_SPAN - (stamp - lastCalled);
  7484. lastCalled = stamp;
  7485. if (remaining > 0) {
  7486. if (++count >= HOT_COUNT) {
  7487. return arguments[0];
  7488. }
  7489. } else {
  7490. count = 0;
  7491. }
  7492. return func.apply(undefined, arguments);
  7493. };
  7494. }
  7495. /**
  7496. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7497. *
  7498. * @private
  7499. * @param {Array} array The array to shuffle.
  7500. * @param {number} [size=array.length] The size of `array`.
  7501. * @returns {Array} Returns `array`.
  7502. */
  7503. function shuffleSelf(array, size) {
  7504. var index = -1,
  7505. length = array.length,
  7506. lastIndex = length - 1;
  7507. size = size === undefined ? length : size;
  7508. while (++index < size) {
  7509. var rand = baseRandom(index, lastIndex),
  7510. value = array[rand];
  7511. array[rand] = array[index];
  7512. array[index] = value;
  7513. }
  7514. array.length = size;
  7515. return array;
  7516. }
  7517. /**
  7518. * Converts `string` to a property path array.
  7519. *
  7520. * @private
  7521. * @param {string} string The string to convert.
  7522. * @returns {Array} Returns the property path array.
  7523. */
  7524. var stringToPath = memoizeCapped(function(string) {
  7525. var result = [];
  7526. if (string.charCodeAt(0) === 46 /* . */) {
  7527. result.push('');
  7528. }
  7529. string.replace(rePropName, function(match, number, quote, subString) {
  7530. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7531. });
  7532. return result;
  7533. });
  7534. /**
  7535. * Converts `value` to a string key if it's not a string or symbol.
  7536. *
  7537. * @private
  7538. * @param {*} value The value to inspect.
  7539. * @returns {string|symbol} Returns the key.
  7540. */
  7541. function toKey(value) {
  7542. if (typeof value == 'string' || isSymbol(value)) {
  7543. return value;
  7544. }
  7545. var result = (value + '');
  7546. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7547. }
  7548. /**
  7549. * Converts `func` to its source code.
  7550. *
  7551. * @private
  7552. * @param {Function} func The function to convert.
  7553. * @returns {string} Returns the source code.
  7554. */
  7555. function toSource(func) {
  7556. if (func != null) {
  7557. try {
  7558. return funcToString.call(func);
  7559. } catch (e) {}
  7560. try {
  7561. return (func + '');
  7562. } catch (e) {}
  7563. }
  7564. return '';
  7565. }
  7566. /**
  7567. * Updates wrapper `details` based on `bitmask` flags.
  7568. *
  7569. * @private
  7570. * @returns {Array} details The details to modify.
  7571. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7572. * @returns {Array} Returns `details`.
  7573. */
  7574. function updateWrapDetails(details, bitmask) {
  7575. arrayEach(wrapFlags, function(pair) {
  7576. var value = '_.' + pair[0];
  7577. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7578. details.push(value);
  7579. }
  7580. });
  7581. return details.sort();
  7582. }
  7583. /**
  7584. * Creates a clone of `wrapper`.
  7585. *
  7586. * @private
  7587. * @param {Object} wrapper The wrapper to clone.
  7588. * @returns {Object} Returns the cloned wrapper.
  7589. */
  7590. function wrapperClone(wrapper) {
  7591. if (wrapper instanceof LazyWrapper) {
  7592. return wrapper.clone();
  7593. }
  7594. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7595. result.__actions__ = copyArray(wrapper.__actions__);
  7596. result.__index__ = wrapper.__index__;
  7597. result.__values__ = wrapper.__values__;
  7598. return result;
  7599. }
  7600. /*------------------------------------------------------------------------*/
  7601. /**
  7602. * Creates an array of elements split into groups the length of `size`.
  7603. * If `array` can't be split evenly, the final chunk will be the remaining
  7604. * elements.
  7605. *
  7606. * @static
  7607. * @memberOf _
  7608. * @since 3.0.0
  7609. * @category Array
  7610. * @param {Array} array The array to process.
  7611. * @param {number} [size=1] The length of each chunk
  7612. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7613. * @returns {Array} Returns the new array of chunks.
  7614. * @example
  7615. *
  7616. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7617. * // => [['a', 'b'], ['c', 'd']]
  7618. *
  7619. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7620. * // => [['a', 'b', 'c'], ['d']]
  7621. */
  7622. function chunk(array, size, guard) {
  7623. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7624. size = 1;
  7625. } else {
  7626. size = nativeMax(toInteger(size), 0);
  7627. }
  7628. var length = array == null ? 0 : array.length;
  7629. if (!length || size < 1) {
  7630. return [];
  7631. }
  7632. var index = 0,
  7633. resIndex = 0,
  7634. result = Array(nativeCeil(length / size));
  7635. while (index < length) {
  7636. result[resIndex++] = baseSlice(array, index, (index += size));
  7637. }
  7638. return result;
  7639. }
  7640. /**
  7641. * Creates an array with all falsey values removed. The values `false`, `null`,
  7642. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7643. *
  7644. * @static
  7645. * @memberOf _
  7646. * @since 0.1.0
  7647. * @category Array
  7648. * @param {Array} array The array to compact.
  7649. * @returns {Array} Returns the new array of filtered values.
  7650. * @example
  7651. *
  7652. * _.compact([0, 1, false, 2, '', 3]);
  7653. * // => [1, 2, 3]
  7654. */
  7655. function compact(array) {
  7656. var index = -1,
  7657. length = array == null ? 0 : array.length,
  7658. resIndex = 0,
  7659. result = [];
  7660. while (++index < length) {
  7661. var value = array[index];
  7662. if (value) {
  7663. result[resIndex++] = value;
  7664. }
  7665. }
  7666. return result;
  7667. }
  7668. /**
  7669. * Creates a new array concatenating `array` with any additional arrays
  7670. * and/or values.
  7671. *
  7672. * @static
  7673. * @memberOf _
  7674. * @since 4.0.0
  7675. * @category Array
  7676. * @param {Array} array The array to concatenate.
  7677. * @param {...*} [values] The values to concatenate.
  7678. * @returns {Array} Returns the new concatenated array.
  7679. * @example
  7680. *
  7681. * var array = [1];
  7682. * var other = _.concat(array, 2, [3], [[4]]);
  7683. *
  7684. * console.log(other);
  7685. * // => [1, 2, 3, [4]]
  7686. *
  7687. * console.log(array);
  7688. * // => [1]
  7689. */
  7690. function concat() {
  7691. var length = arguments.length;
  7692. if (!length) {
  7693. return [];
  7694. }
  7695. var args = Array(length - 1),
  7696. array = arguments[0],
  7697. index = length;
  7698. while (index--) {
  7699. args[index - 1] = arguments[index];
  7700. }
  7701. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7702. }
  7703. /**
  7704. * Creates an array of `array` values not included in the other given arrays
  7705. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7706. * for equality comparisons. The order and references of result values are
  7707. * determined by the first array.
  7708. *
  7709. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7710. *
  7711. * @static
  7712. * @memberOf _
  7713. * @since 0.1.0
  7714. * @category Array
  7715. * @param {Array} array The array to inspect.
  7716. * @param {...Array} [values] The values to exclude.
  7717. * @returns {Array} Returns the new array of filtered values.
  7718. * @see _.without, _.xor
  7719. * @example
  7720. *
  7721. * _.difference([2, 1], [2, 3]);
  7722. * // => [1]
  7723. */
  7724. var difference = baseRest(function(array, values) {
  7725. return isArrayLikeObject(array)
  7726. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7727. : [];
  7728. });
  7729. /**
  7730. * This method is like `_.difference` except that it accepts `iteratee` which
  7731. * is invoked for each element of `array` and `values` to generate the criterion
  7732. * by which they're compared. The order and references of result values are
  7733. * determined by the first array. The iteratee is invoked with one argument:
  7734. * (value).
  7735. *
  7736. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7737. *
  7738. * @static
  7739. * @memberOf _
  7740. * @since 4.0.0
  7741. * @category Array
  7742. * @param {Array} array The array to inspect.
  7743. * @param {...Array} [values] The values to exclude.
  7744. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7745. * @returns {Array} Returns the new array of filtered values.
  7746. * @example
  7747. *
  7748. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7749. * // => [1.2]
  7750. *
  7751. * // The `_.property` iteratee shorthand.
  7752. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7753. * // => [{ 'x': 2 }]
  7754. */
  7755. var differenceBy = baseRest(function(array, values) {
  7756. var iteratee = last(values);
  7757. if (isArrayLikeObject(iteratee)) {
  7758. iteratee = undefined;
  7759. }
  7760. return isArrayLikeObject(array)
  7761. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7762. : [];
  7763. });
  7764. /**
  7765. * This method is like `_.difference` except that it accepts `comparator`
  7766. * which is invoked to compare elements of `array` to `values`. The order and
  7767. * references of result values are determined by the first array. The comparator
  7768. * is invoked with two arguments: (arrVal, othVal).
  7769. *
  7770. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7771. *
  7772. * @static
  7773. * @memberOf _
  7774. * @since 4.0.0
  7775. * @category Array
  7776. * @param {Array} array The array to inspect.
  7777. * @param {...Array} [values] The values to exclude.
  7778. * @param {Function} [comparator] The comparator invoked per element.
  7779. * @returns {Array} Returns the new array of filtered values.
  7780. * @example
  7781. *
  7782. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7783. *
  7784. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7785. * // => [{ 'x': 2, 'y': 1 }]
  7786. */
  7787. var differenceWith = baseRest(function(array, values) {
  7788. var comparator = last(values);
  7789. if (isArrayLikeObject(comparator)) {
  7790. comparator = undefined;
  7791. }
  7792. return isArrayLikeObject(array)
  7793. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7794. : [];
  7795. });
  7796. /**
  7797. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7798. *
  7799. * @static
  7800. * @memberOf _
  7801. * @since 0.5.0
  7802. * @category Array
  7803. * @param {Array} array The array to query.
  7804. * @param {number} [n=1] The number of elements to drop.
  7805. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7806. * @returns {Array} Returns the slice of `array`.
  7807. * @example
  7808. *
  7809. * _.drop([1, 2, 3]);
  7810. * // => [2, 3]
  7811. *
  7812. * _.drop([1, 2, 3], 2);
  7813. * // => [3]
  7814. *
  7815. * _.drop([1, 2, 3], 5);
  7816. * // => []
  7817. *
  7818. * _.drop([1, 2, 3], 0);
  7819. * // => [1, 2, 3]
  7820. */
  7821. function drop(array, n, guard) {
  7822. var length = array == null ? 0 : array.length;
  7823. if (!length) {
  7824. return [];
  7825. }
  7826. n = (guard || n === undefined) ? 1 : toInteger(n);
  7827. return baseSlice(array, n < 0 ? 0 : n, length);
  7828. }
  7829. /**
  7830. * Creates a slice of `array` with `n` elements dropped from the end.
  7831. *
  7832. * @static
  7833. * @memberOf _
  7834. * @since 3.0.0
  7835. * @category Array
  7836. * @param {Array} array The array to query.
  7837. * @param {number} [n=1] The number of elements to drop.
  7838. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7839. * @returns {Array} Returns the slice of `array`.
  7840. * @example
  7841. *
  7842. * _.dropRight([1, 2, 3]);
  7843. * // => [1, 2]
  7844. *
  7845. * _.dropRight([1, 2, 3], 2);
  7846. * // => [1]
  7847. *
  7848. * _.dropRight([1, 2, 3], 5);
  7849. * // => []
  7850. *
  7851. * _.dropRight([1, 2, 3], 0);
  7852. * // => [1, 2, 3]
  7853. */
  7854. function dropRight(array, n, guard) {
  7855. var length = array == null ? 0 : array.length;
  7856. if (!length) {
  7857. return [];
  7858. }
  7859. n = (guard || n === undefined) ? 1 : toInteger(n);
  7860. n = length - n;
  7861. return baseSlice(array, 0, n < 0 ? 0 : n);
  7862. }
  7863. /**
  7864. * Creates a slice of `array` excluding elements dropped from the end.
  7865. * Elements are dropped until `predicate` returns falsey. The predicate is
  7866. * invoked with three arguments: (value, index, array).
  7867. *
  7868. * @static
  7869. * @memberOf _
  7870. * @since 3.0.0
  7871. * @category Array
  7872. * @param {Array} array The array to query.
  7873. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7874. * @returns {Array} Returns the slice of `array`.
  7875. * @example
  7876. *
  7877. * var users = [
  7878. * { 'user': 'barney', 'active': true },
  7879. * { 'user': 'fred', 'active': false },
  7880. * { 'user': 'pebbles', 'active': false }
  7881. * ];
  7882. *
  7883. * _.dropRightWhile(users, function(o) { return !o.active; });
  7884. * // => objects for ['barney']
  7885. *
  7886. * // The `_.matches` iteratee shorthand.
  7887. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7888. * // => objects for ['barney', 'fred']
  7889. *
  7890. * // The `_.matchesProperty` iteratee shorthand.
  7891. * _.dropRightWhile(users, ['active', false]);
  7892. * // => objects for ['barney']
  7893. *
  7894. * // The `_.property` iteratee shorthand.
  7895. * _.dropRightWhile(users, 'active');
  7896. * // => objects for ['barney', 'fred', 'pebbles']
  7897. */
  7898. function dropRightWhile(array, predicate) {
  7899. return (array && array.length)
  7900. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7901. : [];
  7902. }
  7903. /**
  7904. * Creates a slice of `array` excluding elements dropped from the beginning.
  7905. * Elements are dropped until `predicate` returns falsey. The predicate is
  7906. * invoked with three arguments: (value, index, array).
  7907. *
  7908. * @static
  7909. * @memberOf _
  7910. * @since 3.0.0
  7911. * @category Array
  7912. * @param {Array} array The array to query.
  7913. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7914. * @returns {Array} Returns the slice of `array`.
  7915. * @example
  7916. *
  7917. * var users = [
  7918. * { 'user': 'barney', 'active': false },
  7919. * { 'user': 'fred', 'active': false },
  7920. * { 'user': 'pebbles', 'active': true }
  7921. * ];
  7922. *
  7923. * _.dropWhile(users, function(o) { return !o.active; });
  7924. * // => objects for ['pebbles']
  7925. *
  7926. * // The `_.matches` iteratee shorthand.
  7927. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7928. * // => objects for ['fred', 'pebbles']
  7929. *
  7930. * // The `_.matchesProperty` iteratee shorthand.
  7931. * _.dropWhile(users, ['active', false]);
  7932. * // => objects for ['pebbles']
  7933. *
  7934. * // The `_.property` iteratee shorthand.
  7935. * _.dropWhile(users, 'active');
  7936. * // => objects for ['barney', 'fred', 'pebbles']
  7937. */
  7938. function dropWhile(array, predicate) {
  7939. return (array && array.length)
  7940. ? baseWhile(array, getIteratee(predicate, 3), true)
  7941. : [];
  7942. }
  7943. /**
  7944. * Fills elements of `array` with `value` from `start` up to, but not
  7945. * including, `end`.
  7946. *
  7947. * **Note:** This method mutates `array`.
  7948. *
  7949. * @static
  7950. * @memberOf _
  7951. * @since 3.2.0
  7952. * @category Array
  7953. * @param {Array} array The array to fill.
  7954. * @param {*} value The value to fill `array` with.
  7955. * @param {number} [start=0] The start position.
  7956. * @param {number} [end=array.length] The end position.
  7957. * @returns {Array} Returns `array`.
  7958. * @example
  7959. *
  7960. * var array = [1, 2, 3];
  7961. *
  7962. * _.fill(array, 'a');
  7963. * console.log(array);
  7964. * // => ['a', 'a', 'a']
  7965. *
  7966. * _.fill(Array(3), 2);
  7967. * // => [2, 2, 2]
  7968. *
  7969. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7970. * // => [4, '*', '*', 10]
  7971. */
  7972. function fill(array, value, start, end) {
  7973. var length = array == null ? 0 : array.length;
  7974. if (!length) {
  7975. return [];
  7976. }
  7977. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7978. start = 0;
  7979. end = length;
  7980. }
  7981. return baseFill(array, value, start, end);
  7982. }
  7983. /**
  7984. * This method is like `_.find` except that it returns the index of the first
  7985. * element `predicate` returns truthy for instead of the element itself.
  7986. *
  7987. * @static
  7988. * @memberOf _
  7989. * @since 1.1.0
  7990. * @category Array
  7991. * @param {Array} array The array to inspect.
  7992. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7993. * @param {number} [fromIndex=0] The index to search from.
  7994. * @returns {number} Returns the index of the found element, else `-1`.
  7995. * @example
  7996. *
  7997. * var users = [
  7998. * { 'user': 'barney', 'active': false },
  7999. * { 'user': 'fred', 'active': false },
  8000. * { 'user': 'pebbles', 'active': true }
  8001. * ];
  8002. *
  8003. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8004. * // => 0
  8005. *
  8006. * // The `_.matches` iteratee shorthand.
  8007. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8008. * // => 1
  8009. *
  8010. * // The `_.matchesProperty` iteratee shorthand.
  8011. * _.findIndex(users, ['active', false]);
  8012. * // => 0
  8013. *
  8014. * // The `_.property` iteratee shorthand.
  8015. * _.findIndex(users, 'active');
  8016. * // => 2
  8017. */
  8018. function findIndex(array, predicate, fromIndex) {
  8019. var length = array == null ? 0 : array.length;
  8020. if (!length) {
  8021. return -1;
  8022. }
  8023. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8024. if (index < 0) {
  8025. index = nativeMax(length + index, 0);
  8026. }
  8027. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8028. }
  8029. /**
  8030. * This method is like `_.findIndex` except that it iterates over elements
  8031. * of `collection` from right to left.
  8032. *
  8033. * @static
  8034. * @memberOf _
  8035. * @since 2.0.0
  8036. * @category Array
  8037. * @param {Array} array The array to inspect.
  8038. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8039. * @param {number} [fromIndex=array.length-1] The index to search from.
  8040. * @returns {number} Returns the index of the found element, else `-1`.
  8041. * @example
  8042. *
  8043. * var users = [
  8044. * { 'user': 'barney', 'active': true },
  8045. * { 'user': 'fred', 'active': false },
  8046. * { 'user': 'pebbles', 'active': false }
  8047. * ];
  8048. *
  8049. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8050. * // => 2
  8051. *
  8052. * // The `_.matches` iteratee shorthand.
  8053. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8054. * // => 0
  8055. *
  8056. * // The `_.matchesProperty` iteratee shorthand.
  8057. * _.findLastIndex(users, ['active', false]);
  8058. * // => 2
  8059. *
  8060. * // The `_.property` iteratee shorthand.
  8061. * _.findLastIndex(users, 'active');
  8062. * // => 0
  8063. */
  8064. function findLastIndex(array, predicate, fromIndex) {
  8065. var length = array == null ? 0 : array.length;
  8066. if (!length) {
  8067. return -1;
  8068. }
  8069. var index = length - 1;
  8070. if (fromIndex !== undefined) {
  8071. index = toInteger(fromIndex);
  8072. index = fromIndex < 0
  8073. ? nativeMax(length + index, 0)
  8074. : nativeMin(index, length - 1);
  8075. }
  8076. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8077. }
  8078. /**
  8079. * Flattens `array` a single level deep.
  8080. *
  8081. * @static
  8082. * @memberOf _
  8083. * @since 0.1.0
  8084. * @category Array
  8085. * @param {Array} array The array to flatten.
  8086. * @returns {Array} Returns the new flattened array.
  8087. * @example
  8088. *
  8089. * _.flatten([1, [2, [3, [4]], 5]]);
  8090. * // => [1, 2, [3, [4]], 5]
  8091. */
  8092. function flatten(array) {
  8093. var length = array == null ? 0 : array.length;
  8094. return length ? baseFlatten(array, 1) : [];
  8095. }
  8096. /**
  8097. * Recursively flattens `array`.
  8098. *
  8099. * @static
  8100. * @memberOf _
  8101. * @since 3.0.0
  8102. * @category Array
  8103. * @param {Array} array The array to flatten.
  8104. * @returns {Array} Returns the new flattened array.
  8105. * @example
  8106. *
  8107. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8108. * // => [1, 2, 3, 4, 5]
  8109. */
  8110. function flattenDeep(array) {
  8111. var length = array == null ? 0 : array.length;
  8112. return length ? baseFlatten(array, INFINITY) : [];
  8113. }
  8114. /**
  8115. * Recursively flatten `array` up to `depth` times.
  8116. *
  8117. * @static
  8118. * @memberOf _
  8119. * @since 4.4.0
  8120. * @category Array
  8121. * @param {Array} array The array to flatten.
  8122. * @param {number} [depth=1] The maximum recursion depth.
  8123. * @returns {Array} Returns the new flattened array.
  8124. * @example
  8125. *
  8126. * var array = [1, [2, [3, [4]], 5]];
  8127. *
  8128. * _.flattenDepth(array, 1);
  8129. * // => [1, 2, [3, [4]], 5]
  8130. *
  8131. * _.flattenDepth(array, 2);
  8132. * // => [1, 2, 3, [4], 5]
  8133. */
  8134. function flattenDepth(array, depth) {
  8135. var length = array == null ? 0 : array.length;
  8136. if (!length) {
  8137. return [];
  8138. }
  8139. depth = depth === undefined ? 1 : toInteger(depth);
  8140. return baseFlatten(array, depth);
  8141. }
  8142. /**
  8143. * The inverse of `_.toPairs`; this method returns an object composed
  8144. * from key-value `pairs`.
  8145. *
  8146. * @static
  8147. * @memberOf _
  8148. * @since 4.0.0
  8149. * @category Array
  8150. * @param {Array} pairs The key-value pairs.
  8151. * @returns {Object} Returns the new object.
  8152. * @example
  8153. *
  8154. * _.fromPairs([['a', 1], ['b', 2]]);
  8155. * // => { 'a': 1, 'b': 2 }
  8156. */
  8157. function fromPairs(pairs) {
  8158. var index = -1,
  8159. length = pairs == null ? 0 : pairs.length,
  8160. result = {};
  8161. while (++index < length) {
  8162. var pair = pairs[index];
  8163. result[pair[0]] = pair[1];
  8164. }
  8165. return result;
  8166. }
  8167. /**
  8168. * Gets the first element of `array`.
  8169. *
  8170. * @static
  8171. * @memberOf _
  8172. * @since 0.1.0
  8173. * @alias first
  8174. * @category Array
  8175. * @param {Array} array The array to query.
  8176. * @returns {*} Returns the first element of `array`.
  8177. * @example
  8178. *
  8179. * _.head([1, 2, 3]);
  8180. * // => 1
  8181. *
  8182. * _.head([]);
  8183. * // => undefined
  8184. */
  8185. function head(array) {
  8186. return (array && array.length) ? array[0] : undefined;
  8187. }
  8188. /**
  8189. * Gets the index at which the first occurrence of `value` is found in `array`
  8190. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8191. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8192. * offset from the end of `array`.
  8193. *
  8194. * @static
  8195. * @memberOf _
  8196. * @since 0.1.0
  8197. * @category Array
  8198. * @param {Array} array The array to inspect.
  8199. * @param {*} value The value to search for.
  8200. * @param {number} [fromIndex=0] The index to search from.
  8201. * @returns {number} Returns the index of the matched value, else `-1`.
  8202. * @example
  8203. *
  8204. * _.indexOf([1, 2, 1, 2], 2);
  8205. * // => 1
  8206. *
  8207. * // Search from the `fromIndex`.
  8208. * _.indexOf([1, 2, 1, 2], 2, 2);
  8209. * // => 3
  8210. */
  8211. function indexOf(array, value, fromIndex) {
  8212. var length = array == null ? 0 : array.length;
  8213. if (!length) {
  8214. return -1;
  8215. }
  8216. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8217. if (index < 0) {
  8218. index = nativeMax(length + index, 0);
  8219. }
  8220. return baseIndexOf(array, value, index);
  8221. }
  8222. /**
  8223. * Gets all but the last element of `array`.
  8224. *
  8225. * @static
  8226. * @memberOf _
  8227. * @since 0.1.0
  8228. * @category Array
  8229. * @param {Array} array The array to query.
  8230. * @returns {Array} Returns the slice of `array`.
  8231. * @example
  8232. *
  8233. * _.initial([1, 2, 3]);
  8234. * // => [1, 2]
  8235. */
  8236. function initial(array) {
  8237. var length = array == null ? 0 : array.length;
  8238. return length ? baseSlice(array, 0, -1) : [];
  8239. }
  8240. /**
  8241. * Creates an array of unique values that are included in all given arrays
  8242. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8243. * for equality comparisons. The order and references of result values are
  8244. * determined by the first array.
  8245. *
  8246. * @static
  8247. * @memberOf _
  8248. * @since 0.1.0
  8249. * @category Array
  8250. * @param {...Array} [arrays] The arrays to inspect.
  8251. * @returns {Array} Returns the new array of intersecting values.
  8252. * @example
  8253. *
  8254. * _.intersection([2, 1], [2, 3]);
  8255. * // => [2]
  8256. */
  8257. var intersection = baseRest(function(arrays) {
  8258. var mapped = arrayMap(arrays, castArrayLikeObject);
  8259. return (mapped.length && mapped[0] === arrays[0])
  8260. ? baseIntersection(mapped)
  8261. : [];
  8262. });
  8263. /**
  8264. * This method is like `_.intersection` except that it accepts `iteratee`
  8265. * which is invoked for each element of each `arrays` to generate the criterion
  8266. * by which they're compared. The order and references of result values are
  8267. * determined by the first array. The iteratee is invoked with one argument:
  8268. * (value).
  8269. *
  8270. * @static
  8271. * @memberOf _
  8272. * @since 4.0.0
  8273. * @category Array
  8274. * @param {...Array} [arrays] The arrays to inspect.
  8275. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8276. * @returns {Array} Returns the new array of intersecting values.
  8277. * @example
  8278. *
  8279. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8280. * // => [2.1]
  8281. *
  8282. * // The `_.property` iteratee shorthand.
  8283. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8284. * // => [{ 'x': 1 }]
  8285. */
  8286. var intersectionBy = baseRest(function(arrays) {
  8287. var iteratee = last(arrays),
  8288. mapped = arrayMap(arrays, castArrayLikeObject);
  8289. if (iteratee === last(mapped)) {
  8290. iteratee = undefined;
  8291. } else {
  8292. mapped.pop();
  8293. }
  8294. return (mapped.length && mapped[0] === arrays[0])
  8295. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8296. : [];
  8297. });
  8298. /**
  8299. * This method is like `_.intersection` except that it accepts `comparator`
  8300. * which is invoked to compare elements of `arrays`. The order and references
  8301. * of result values are determined by the first array. The comparator is
  8302. * invoked with two arguments: (arrVal, othVal).
  8303. *
  8304. * @static
  8305. * @memberOf _
  8306. * @since 4.0.0
  8307. * @category Array
  8308. * @param {...Array} [arrays] The arrays to inspect.
  8309. * @param {Function} [comparator] The comparator invoked per element.
  8310. * @returns {Array} Returns the new array of intersecting values.
  8311. * @example
  8312. *
  8313. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8314. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8315. *
  8316. * _.intersectionWith(objects, others, _.isEqual);
  8317. * // => [{ 'x': 1, 'y': 2 }]
  8318. */
  8319. var intersectionWith = baseRest(function(arrays) {
  8320. var comparator = last(arrays),
  8321. mapped = arrayMap(arrays, castArrayLikeObject);
  8322. comparator = typeof comparator == 'function' ? comparator : undefined;
  8323. if (comparator) {
  8324. mapped.pop();
  8325. }
  8326. return (mapped.length && mapped[0] === arrays[0])
  8327. ? baseIntersection(mapped, undefined, comparator)
  8328. : [];
  8329. });
  8330. /**
  8331. * Converts all elements in `array` into a string separated by `separator`.
  8332. *
  8333. * @static
  8334. * @memberOf _
  8335. * @since 4.0.0
  8336. * @category Array
  8337. * @param {Array} array The array to convert.
  8338. * @param {string} [separator=','] The element separator.
  8339. * @returns {string} Returns the joined string.
  8340. * @example
  8341. *
  8342. * _.join(['a', 'b', 'c'], '~');
  8343. * // => 'a~b~c'
  8344. */
  8345. function join(array, separator) {
  8346. return array == null ? '' : nativeJoin.call(array, separator);
  8347. }
  8348. /**
  8349. * Gets the last element of `array`.
  8350. *
  8351. * @static
  8352. * @memberOf _
  8353. * @since 0.1.0
  8354. * @category Array
  8355. * @param {Array} array The array to query.
  8356. * @returns {*} Returns the last element of `array`.
  8357. * @example
  8358. *
  8359. * _.last([1, 2, 3]);
  8360. * // => 3
  8361. */
  8362. function last(array) {
  8363. var length = array == null ? 0 : array.length;
  8364. return length ? array[length - 1] : undefined;
  8365. }
  8366. /**
  8367. * This method is like `_.indexOf` except that it iterates over elements of
  8368. * `array` from right to left.
  8369. *
  8370. * @static
  8371. * @memberOf _
  8372. * @since 0.1.0
  8373. * @category Array
  8374. * @param {Array} array The array to inspect.
  8375. * @param {*} value The value to search for.
  8376. * @param {number} [fromIndex=array.length-1] The index to search from.
  8377. * @returns {number} Returns the index of the matched value, else `-1`.
  8378. * @example
  8379. *
  8380. * _.lastIndexOf([1, 2, 1, 2], 2);
  8381. * // => 3
  8382. *
  8383. * // Search from the `fromIndex`.
  8384. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8385. * // => 1
  8386. */
  8387. function lastIndexOf(array, value, fromIndex) {
  8388. var length = array == null ? 0 : array.length;
  8389. if (!length) {
  8390. return -1;
  8391. }
  8392. var index = length;
  8393. if (fromIndex !== undefined) {
  8394. index = toInteger(fromIndex);
  8395. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8396. }
  8397. return value === value
  8398. ? strictLastIndexOf(array, value, index)
  8399. : baseFindIndex(array, baseIsNaN, index, true);
  8400. }
  8401. /**
  8402. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8403. * element from the end is returned.
  8404. *
  8405. * @static
  8406. * @memberOf _
  8407. * @since 4.11.0
  8408. * @category Array
  8409. * @param {Array} array The array to query.
  8410. * @param {number} [n=0] The index of the element to return.
  8411. * @returns {*} Returns the nth element of `array`.
  8412. * @example
  8413. *
  8414. * var array = ['a', 'b', 'c', 'd'];
  8415. *
  8416. * _.nth(array, 1);
  8417. * // => 'b'
  8418. *
  8419. * _.nth(array, -2);
  8420. * // => 'c';
  8421. */
  8422. function nth(array, n) {
  8423. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8424. }
  8425. /**
  8426. * Removes all given values from `array` using
  8427. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8428. * for equality comparisons.
  8429. *
  8430. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8431. * to remove elements from an array by predicate.
  8432. *
  8433. * @static
  8434. * @memberOf _
  8435. * @since 2.0.0
  8436. * @category Array
  8437. * @param {Array} array The array to modify.
  8438. * @param {...*} [values] The values to remove.
  8439. * @returns {Array} Returns `array`.
  8440. * @example
  8441. *
  8442. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8443. *
  8444. * _.pull(array, 'a', 'c');
  8445. * console.log(array);
  8446. * // => ['b', 'b']
  8447. */
  8448. var pull = baseRest(pullAll);
  8449. /**
  8450. * This method is like `_.pull` except that it accepts an array of values to remove.
  8451. *
  8452. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8453. *
  8454. * @static
  8455. * @memberOf _
  8456. * @since 4.0.0
  8457. * @category Array
  8458. * @param {Array} array The array to modify.
  8459. * @param {Array} values The values to remove.
  8460. * @returns {Array} Returns `array`.
  8461. * @example
  8462. *
  8463. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8464. *
  8465. * _.pullAll(array, ['a', 'c']);
  8466. * console.log(array);
  8467. * // => ['b', 'b']
  8468. */
  8469. function pullAll(array, values) {
  8470. return (array && array.length && values && values.length)
  8471. ? basePullAll(array, values)
  8472. : array;
  8473. }
  8474. /**
  8475. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8476. * invoked for each element of `array` and `values` to generate the criterion
  8477. * by which they're compared. The iteratee is invoked with one argument: (value).
  8478. *
  8479. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8480. *
  8481. * @static
  8482. * @memberOf _
  8483. * @since 4.0.0
  8484. * @category Array
  8485. * @param {Array} array The array to modify.
  8486. * @param {Array} values The values to remove.
  8487. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8488. * @returns {Array} Returns `array`.
  8489. * @example
  8490. *
  8491. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8492. *
  8493. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8494. * console.log(array);
  8495. * // => [{ 'x': 2 }]
  8496. */
  8497. function pullAllBy(array, values, iteratee) {
  8498. return (array && array.length && values && values.length)
  8499. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8500. : array;
  8501. }
  8502. /**
  8503. * This method is like `_.pullAll` except that it accepts `comparator` which
  8504. * is invoked to compare elements of `array` to `values`. The comparator is
  8505. * invoked with two arguments: (arrVal, othVal).
  8506. *
  8507. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8508. *
  8509. * @static
  8510. * @memberOf _
  8511. * @since 4.6.0
  8512. * @category Array
  8513. * @param {Array} array The array to modify.
  8514. * @param {Array} values The values to remove.
  8515. * @param {Function} [comparator] The comparator invoked per element.
  8516. * @returns {Array} Returns `array`.
  8517. * @example
  8518. *
  8519. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8520. *
  8521. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8522. * console.log(array);
  8523. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8524. */
  8525. function pullAllWith(array, values, comparator) {
  8526. return (array && array.length && values && values.length)
  8527. ? basePullAll(array, values, undefined, comparator)
  8528. : array;
  8529. }
  8530. /**
  8531. * Removes elements from `array` corresponding to `indexes` and returns an
  8532. * array of removed elements.
  8533. *
  8534. * **Note:** Unlike `_.at`, this method mutates `array`.
  8535. *
  8536. * @static
  8537. * @memberOf _
  8538. * @since 3.0.0
  8539. * @category Array
  8540. * @param {Array} array The array to modify.
  8541. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8542. * @returns {Array} Returns the new array of removed elements.
  8543. * @example
  8544. *
  8545. * var array = ['a', 'b', 'c', 'd'];
  8546. * var pulled = _.pullAt(array, [1, 3]);
  8547. *
  8548. * console.log(array);
  8549. * // => ['a', 'c']
  8550. *
  8551. * console.log(pulled);
  8552. * // => ['b', 'd']
  8553. */
  8554. var pullAt = flatRest(function(array, indexes) {
  8555. var length = array == null ? 0 : array.length,
  8556. result = baseAt(array, indexes);
  8557. basePullAt(array, arrayMap(indexes, function(index) {
  8558. return isIndex(index, length) ? +index : index;
  8559. }).sort(compareAscending));
  8560. return result;
  8561. });
  8562. /**
  8563. * Removes all elements from `array` that `predicate` returns truthy for
  8564. * and returns an array of the removed elements. The predicate is invoked
  8565. * with three arguments: (value, index, array).
  8566. *
  8567. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8568. * to pull elements from an array by value.
  8569. *
  8570. * @static
  8571. * @memberOf _
  8572. * @since 2.0.0
  8573. * @category Array
  8574. * @param {Array} array The array to modify.
  8575. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8576. * @returns {Array} Returns the new array of removed elements.
  8577. * @example
  8578. *
  8579. * var array = [1, 2, 3, 4];
  8580. * var evens = _.remove(array, function(n) {
  8581. * return n % 2 == 0;
  8582. * });
  8583. *
  8584. * console.log(array);
  8585. * // => [1, 3]
  8586. *
  8587. * console.log(evens);
  8588. * // => [2, 4]
  8589. */
  8590. function remove(array, predicate) {
  8591. var result = [];
  8592. if (!(array && array.length)) {
  8593. return result;
  8594. }
  8595. var index = -1,
  8596. indexes = [],
  8597. length = array.length;
  8598. predicate = getIteratee(predicate, 3);
  8599. while (++index < length) {
  8600. var value = array[index];
  8601. if (predicate(value, index, array)) {
  8602. result.push(value);
  8603. indexes.push(index);
  8604. }
  8605. }
  8606. basePullAt(array, indexes);
  8607. return result;
  8608. }
  8609. /**
  8610. * Reverses `array` so that the first element becomes the last, the second
  8611. * element becomes the second to last, and so on.
  8612. *
  8613. * **Note:** This method mutates `array` and is based on
  8614. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8615. *
  8616. * @static
  8617. * @memberOf _
  8618. * @since 4.0.0
  8619. * @category Array
  8620. * @param {Array} array The array to modify.
  8621. * @returns {Array} Returns `array`.
  8622. * @example
  8623. *
  8624. * var array = [1, 2, 3];
  8625. *
  8626. * _.reverse(array);
  8627. * // => [3, 2, 1]
  8628. *
  8629. * console.log(array);
  8630. * // => [3, 2, 1]
  8631. */
  8632. function reverse(array) {
  8633. return array == null ? array : nativeReverse.call(array);
  8634. }
  8635. /**
  8636. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8637. *
  8638. * **Note:** This method is used instead of
  8639. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8640. * returned.
  8641. *
  8642. * @static
  8643. * @memberOf _
  8644. * @since 3.0.0
  8645. * @category Array
  8646. * @param {Array} array The array to slice.
  8647. * @param {number} [start=0] The start position.
  8648. * @param {number} [end=array.length] The end position.
  8649. * @returns {Array} Returns the slice of `array`.
  8650. */
  8651. function slice(array, start, end) {
  8652. var length = array == null ? 0 : array.length;
  8653. if (!length) {
  8654. return [];
  8655. }
  8656. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8657. start = 0;
  8658. end = length;
  8659. }
  8660. else {
  8661. start = start == null ? 0 : toInteger(start);
  8662. end = end === undefined ? length : toInteger(end);
  8663. }
  8664. return baseSlice(array, start, end);
  8665. }
  8666. /**
  8667. * Uses a binary search to determine the lowest index at which `value`
  8668. * should be inserted into `array` in order to maintain its sort order.
  8669. *
  8670. * @static
  8671. * @memberOf _
  8672. * @since 0.1.0
  8673. * @category Array
  8674. * @param {Array} array The sorted array to inspect.
  8675. * @param {*} value The value to evaluate.
  8676. * @returns {number} Returns the index at which `value` should be inserted
  8677. * into `array`.
  8678. * @example
  8679. *
  8680. * _.sortedIndex([30, 50], 40);
  8681. * // => 1
  8682. */
  8683. function sortedIndex(array, value) {
  8684. return baseSortedIndex(array, value);
  8685. }
  8686. /**
  8687. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8688. * which is invoked for `value` and each element of `array` to compute their
  8689. * sort ranking. The iteratee is invoked with one argument: (value).
  8690. *
  8691. * @static
  8692. * @memberOf _
  8693. * @since 4.0.0
  8694. * @category Array
  8695. * @param {Array} array The sorted array to inspect.
  8696. * @param {*} value The value to evaluate.
  8697. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8698. * @returns {number} Returns the index at which `value` should be inserted
  8699. * into `array`.
  8700. * @example
  8701. *
  8702. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8703. *
  8704. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8705. * // => 0
  8706. *
  8707. * // The `_.property` iteratee shorthand.
  8708. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8709. * // => 0
  8710. */
  8711. function sortedIndexBy(array, value, iteratee) {
  8712. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8713. }
  8714. /**
  8715. * This method is like `_.indexOf` except that it performs a binary
  8716. * search on a sorted `array`.
  8717. *
  8718. * @static
  8719. * @memberOf _
  8720. * @since 4.0.0
  8721. * @category Array
  8722. * @param {Array} array The array to inspect.
  8723. * @param {*} value The value to search for.
  8724. * @returns {number} Returns the index of the matched value, else `-1`.
  8725. * @example
  8726. *
  8727. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8728. * // => 1
  8729. */
  8730. function sortedIndexOf(array, value) {
  8731. var length = array == null ? 0 : array.length;
  8732. if (length) {
  8733. var index = baseSortedIndex(array, value);
  8734. if (index < length && eq(array[index], value)) {
  8735. return index;
  8736. }
  8737. }
  8738. return -1;
  8739. }
  8740. /**
  8741. * This method is like `_.sortedIndex` except that it returns the highest
  8742. * index at which `value` should be inserted into `array` in order to
  8743. * maintain its sort order.
  8744. *
  8745. * @static
  8746. * @memberOf _
  8747. * @since 3.0.0
  8748. * @category Array
  8749. * @param {Array} array The sorted array to inspect.
  8750. * @param {*} value The value to evaluate.
  8751. * @returns {number} Returns the index at which `value` should be inserted
  8752. * into `array`.
  8753. * @example
  8754. *
  8755. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8756. * // => 4
  8757. */
  8758. function sortedLastIndex(array, value) {
  8759. return baseSortedIndex(array, value, true);
  8760. }
  8761. /**
  8762. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8763. * which is invoked for `value` and each element of `array` to compute their
  8764. * sort ranking. The iteratee is invoked with one argument: (value).
  8765. *
  8766. * @static
  8767. * @memberOf _
  8768. * @since 4.0.0
  8769. * @category Array
  8770. * @param {Array} array The sorted array to inspect.
  8771. * @param {*} value The value to evaluate.
  8772. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8773. * @returns {number} Returns the index at which `value` should be inserted
  8774. * into `array`.
  8775. * @example
  8776. *
  8777. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8778. *
  8779. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8780. * // => 1
  8781. *
  8782. * // The `_.property` iteratee shorthand.
  8783. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8784. * // => 1
  8785. */
  8786. function sortedLastIndexBy(array, value, iteratee) {
  8787. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8788. }
  8789. /**
  8790. * This method is like `_.lastIndexOf` except that it performs a binary
  8791. * search on a sorted `array`.
  8792. *
  8793. * @static
  8794. * @memberOf _
  8795. * @since 4.0.0
  8796. * @category Array
  8797. * @param {Array} array The array to inspect.
  8798. * @param {*} value The value to search for.
  8799. * @returns {number} Returns the index of the matched value, else `-1`.
  8800. * @example
  8801. *
  8802. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8803. * // => 3
  8804. */
  8805. function sortedLastIndexOf(array, value) {
  8806. var length = array == null ? 0 : array.length;
  8807. if (length) {
  8808. var index = baseSortedIndex(array, value, true) - 1;
  8809. if (eq(array[index], value)) {
  8810. return index;
  8811. }
  8812. }
  8813. return -1;
  8814. }
  8815. /**
  8816. * This method is like `_.uniq` except that it's designed and optimized
  8817. * for sorted arrays.
  8818. *
  8819. * @static
  8820. * @memberOf _
  8821. * @since 4.0.0
  8822. * @category Array
  8823. * @param {Array} array The array to inspect.
  8824. * @returns {Array} Returns the new duplicate free array.
  8825. * @example
  8826. *
  8827. * _.sortedUniq([1, 1, 2]);
  8828. * // => [1, 2]
  8829. */
  8830. function sortedUniq(array) {
  8831. return (array && array.length)
  8832. ? baseSortedUniq(array)
  8833. : [];
  8834. }
  8835. /**
  8836. * This method is like `_.uniqBy` except that it's designed and optimized
  8837. * for sorted arrays.
  8838. *
  8839. * @static
  8840. * @memberOf _
  8841. * @since 4.0.0
  8842. * @category Array
  8843. * @param {Array} array The array to inspect.
  8844. * @param {Function} [iteratee] The iteratee invoked per element.
  8845. * @returns {Array} Returns the new duplicate free array.
  8846. * @example
  8847. *
  8848. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8849. * // => [1.1, 2.3]
  8850. */
  8851. function sortedUniqBy(array, iteratee) {
  8852. return (array && array.length)
  8853. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8854. : [];
  8855. }
  8856. /**
  8857. * Gets all but the first element of `array`.
  8858. *
  8859. * @static
  8860. * @memberOf _
  8861. * @since 4.0.0
  8862. * @category Array
  8863. * @param {Array} array The array to query.
  8864. * @returns {Array} Returns the slice of `array`.
  8865. * @example
  8866. *
  8867. * _.tail([1, 2, 3]);
  8868. * // => [2, 3]
  8869. */
  8870. function tail(array) {
  8871. var length = array == null ? 0 : array.length;
  8872. return length ? baseSlice(array, 1, length) : [];
  8873. }
  8874. /**
  8875. * Creates a slice of `array` with `n` elements taken from the beginning.
  8876. *
  8877. * @static
  8878. * @memberOf _
  8879. * @since 0.1.0
  8880. * @category Array
  8881. * @param {Array} array The array to query.
  8882. * @param {number} [n=1] The number of elements to take.
  8883. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8884. * @returns {Array} Returns the slice of `array`.
  8885. * @example
  8886. *
  8887. * _.take([1, 2, 3]);
  8888. * // => [1]
  8889. *
  8890. * _.take([1, 2, 3], 2);
  8891. * // => [1, 2]
  8892. *
  8893. * _.take([1, 2, 3], 5);
  8894. * // => [1, 2, 3]
  8895. *
  8896. * _.take([1, 2, 3], 0);
  8897. * // => []
  8898. */
  8899. function take(array, n, guard) {
  8900. if (!(array && array.length)) {
  8901. return [];
  8902. }
  8903. n = (guard || n === undefined) ? 1 : toInteger(n);
  8904. return baseSlice(array, 0, n < 0 ? 0 : n);
  8905. }
  8906. /**
  8907. * Creates a slice of `array` with `n` elements taken from the end.
  8908. *
  8909. * @static
  8910. * @memberOf _
  8911. * @since 3.0.0
  8912. * @category Array
  8913. * @param {Array} array The array to query.
  8914. * @param {number} [n=1] The number of elements to take.
  8915. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8916. * @returns {Array} Returns the slice of `array`.
  8917. * @example
  8918. *
  8919. * _.takeRight([1, 2, 3]);
  8920. * // => [3]
  8921. *
  8922. * _.takeRight([1, 2, 3], 2);
  8923. * // => [2, 3]
  8924. *
  8925. * _.takeRight([1, 2, 3], 5);
  8926. * // => [1, 2, 3]
  8927. *
  8928. * _.takeRight([1, 2, 3], 0);
  8929. * // => []
  8930. */
  8931. function takeRight(array, n, guard) {
  8932. var length = array == null ? 0 : array.length;
  8933. if (!length) {
  8934. return [];
  8935. }
  8936. n = (guard || n === undefined) ? 1 : toInteger(n);
  8937. n = length - n;
  8938. return baseSlice(array, n < 0 ? 0 : n, length);
  8939. }
  8940. /**
  8941. * Creates a slice of `array` with elements taken from the end. Elements are
  8942. * taken until `predicate` returns falsey. The predicate is invoked with
  8943. * three arguments: (value, index, array).
  8944. *
  8945. * @static
  8946. * @memberOf _
  8947. * @since 3.0.0
  8948. * @category Array
  8949. * @param {Array} array The array to query.
  8950. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8951. * @returns {Array} Returns the slice of `array`.
  8952. * @example
  8953. *
  8954. * var users = [
  8955. * { 'user': 'barney', 'active': true },
  8956. * { 'user': 'fred', 'active': false },
  8957. * { 'user': 'pebbles', 'active': false }
  8958. * ];
  8959. *
  8960. * _.takeRightWhile(users, function(o) { return !o.active; });
  8961. * // => objects for ['fred', 'pebbles']
  8962. *
  8963. * // The `_.matches` iteratee shorthand.
  8964. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8965. * // => objects for ['pebbles']
  8966. *
  8967. * // The `_.matchesProperty` iteratee shorthand.
  8968. * _.takeRightWhile(users, ['active', false]);
  8969. * // => objects for ['fred', 'pebbles']
  8970. *
  8971. * // The `_.property` iteratee shorthand.
  8972. * _.takeRightWhile(users, 'active');
  8973. * // => []
  8974. */
  8975. function takeRightWhile(array, predicate) {
  8976. return (array && array.length)
  8977. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8978. : [];
  8979. }
  8980. /**
  8981. * Creates a slice of `array` with elements taken from the beginning. Elements
  8982. * are taken until `predicate` returns falsey. The predicate is invoked with
  8983. * three arguments: (value, index, array).
  8984. *
  8985. * @static
  8986. * @memberOf _
  8987. * @since 3.0.0
  8988. * @category Array
  8989. * @param {Array} array The array to query.
  8990. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8991. * @returns {Array} Returns the slice of `array`.
  8992. * @example
  8993. *
  8994. * var users = [
  8995. * { 'user': 'barney', 'active': false },
  8996. * { 'user': 'fred', 'active': false },
  8997. * { 'user': 'pebbles', 'active': true }
  8998. * ];
  8999. *
  9000. * _.takeWhile(users, function(o) { return !o.active; });
  9001. * // => objects for ['barney', 'fred']
  9002. *
  9003. * // The `_.matches` iteratee shorthand.
  9004. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9005. * // => objects for ['barney']
  9006. *
  9007. * // The `_.matchesProperty` iteratee shorthand.
  9008. * _.takeWhile(users, ['active', false]);
  9009. * // => objects for ['barney', 'fred']
  9010. *
  9011. * // The `_.property` iteratee shorthand.
  9012. * _.takeWhile(users, 'active');
  9013. * // => []
  9014. */
  9015. function takeWhile(array, predicate) {
  9016. return (array && array.length)
  9017. ? baseWhile(array, getIteratee(predicate, 3))
  9018. : [];
  9019. }
  9020. /**
  9021. * Creates an array of unique values, in order, from all given arrays using
  9022. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9023. * for equality comparisons.
  9024. *
  9025. * @static
  9026. * @memberOf _
  9027. * @since 0.1.0
  9028. * @category Array
  9029. * @param {...Array} [arrays] The arrays to inspect.
  9030. * @returns {Array} Returns the new array of combined values.
  9031. * @example
  9032. *
  9033. * _.union([2], [1, 2]);
  9034. * // => [2, 1]
  9035. */
  9036. var union = baseRest(function(arrays) {
  9037. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9038. });
  9039. /**
  9040. * This method is like `_.union` except that it accepts `iteratee` which is
  9041. * invoked for each element of each `arrays` to generate the criterion by
  9042. * which uniqueness is computed. Result values are chosen from the first
  9043. * array in which the value occurs. The iteratee is invoked with one argument:
  9044. * (value).
  9045. *
  9046. * @static
  9047. * @memberOf _
  9048. * @since 4.0.0
  9049. * @category Array
  9050. * @param {...Array} [arrays] The arrays to inspect.
  9051. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9052. * @returns {Array} Returns the new array of combined values.
  9053. * @example
  9054. *
  9055. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9056. * // => [2.1, 1.2]
  9057. *
  9058. * // The `_.property` iteratee shorthand.
  9059. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9060. * // => [{ 'x': 1 }, { 'x': 2 }]
  9061. */
  9062. var unionBy = baseRest(function(arrays) {
  9063. var iteratee = last(arrays);
  9064. if (isArrayLikeObject(iteratee)) {
  9065. iteratee = undefined;
  9066. }
  9067. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9068. });
  9069. /**
  9070. * This method is like `_.union` except that it accepts `comparator` which
  9071. * is invoked to compare elements of `arrays`. Result values are chosen from
  9072. * the first array in which the value occurs. The comparator is invoked
  9073. * with two arguments: (arrVal, othVal).
  9074. *
  9075. * @static
  9076. * @memberOf _
  9077. * @since 4.0.0
  9078. * @category Array
  9079. * @param {...Array} [arrays] The arrays to inspect.
  9080. * @param {Function} [comparator] The comparator invoked per element.
  9081. * @returns {Array} Returns the new array of combined values.
  9082. * @example
  9083. *
  9084. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9085. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9086. *
  9087. * _.unionWith(objects, others, _.isEqual);
  9088. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9089. */
  9090. var unionWith = baseRest(function(arrays) {
  9091. var comparator = last(arrays);
  9092. comparator = typeof comparator == 'function' ? comparator : undefined;
  9093. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9094. });
  9095. /**
  9096. * Creates a duplicate-free version of an array, using
  9097. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9098. * for equality comparisons, in which only the first occurrence of each element
  9099. * is kept. The order of result values is determined by the order they occur
  9100. * in the array.
  9101. *
  9102. * @static
  9103. * @memberOf _
  9104. * @since 0.1.0
  9105. * @category Array
  9106. * @param {Array} array The array to inspect.
  9107. * @returns {Array} Returns the new duplicate free array.
  9108. * @example
  9109. *
  9110. * _.uniq([2, 1, 2]);
  9111. * // => [2, 1]
  9112. */
  9113. function uniq(array) {
  9114. return (array && array.length) ? baseUniq(array) : [];
  9115. }
  9116. /**
  9117. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9118. * invoked for each element in `array` to generate the criterion by which
  9119. * uniqueness is computed. The order of result values is determined by the
  9120. * order they occur in the array. The iteratee is invoked with one argument:
  9121. * (value).
  9122. *
  9123. * @static
  9124. * @memberOf _
  9125. * @since 4.0.0
  9126. * @category Array
  9127. * @param {Array} array The array to inspect.
  9128. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9129. * @returns {Array} Returns the new duplicate free array.
  9130. * @example
  9131. *
  9132. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9133. * // => [2.1, 1.2]
  9134. *
  9135. * // The `_.property` iteratee shorthand.
  9136. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9137. * // => [{ 'x': 1 }, { 'x': 2 }]
  9138. */
  9139. function uniqBy(array, iteratee) {
  9140. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9141. }
  9142. /**
  9143. * This method is like `_.uniq` except that it accepts `comparator` which
  9144. * is invoked to compare elements of `array`. The order of result values is
  9145. * determined by the order they occur in the array.The comparator is invoked
  9146. * with two arguments: (arrVal, othVal).
  9147. *
  9148. * @static
  9149. * @memberOf _
  9150. * @since 4.0.0
  9151. * @category Array
  9152. * @param {Array} array The array to inspect.
  9153. * @param {Function} [comparator] The comparator invoked per element.
  9154. * @returns {Array} Returns the new duplicate free array.
  9155. * @example
  9156. *
  9157. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9158. *
  9159. * _.uniqWith(objects, _.isEqual);
  9160. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9161. */
  9162. function uniqWith(array, comparator) {
  9163. comparator = typeof comparator == 'function' ? comparator : undefined;
  9164. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9165. }
  9166. /**
  9167. * This method is like `_.zip` except that it accepts an array of grouped
  9168. * elements and creates an array regrouping the elements to their pre-zip
  9169. * configuration.
  9170. *
  9171. * @static
  9172. * @memberOf _
  9173. * @since 1.2.0
  9174. * @category Array
  9175. * @param {Array} array The array of grouped elements to process.
  9176. * @returns {Array} Returns the new array of regrouped elements.
  9177. * @example
  9178. *
  9179. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9180. * // => [['a', 1, true], ['b', 2, false]]
  9181. *
  9182. * _.unzip(zipped);
  9183. * // => [['a', 'b'], [1, 2], [true, false]]
  9184. */
  9185. function unzip(array) {
  9186. if (!(array && array.length)) {
  9187. return [];
  9188. }
  9189. var length = 0;
  9190. array = arrayFilter(array, function(group) {
  9191. if (isArrayLikeObject(group)) {
  9192. length = nativeMax(group.length, length);
  9193. return true;
  9194. }
  9195. });
  9196. return baseTimes(length, function(index) {
  9197. return arrayMap(array, baseProperty(index));
  9198. });
  9199. }
  9200. /**
  9201. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9202. * how regrouped values should be combined. The iteratee is invoked with the
  9203. * elements of each group: (...group).
  9204. *
  9205. * @static
  9206. * @memberOf _
  9207. * @since 3.8.0
  9208. * @category Array
  9209. * @param {Array} array The array of grouped elements to process.
  9210. * @param {Function} [iteratee=_.identity] The function to combine
  9211. * regrouped values.
  9212. * @returns {Array} Returns the new array of regrouped elements.
  9213. * @example
  9214. *
  9215. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9216. * // => [[1, 10, 100], [2, 20, 200]]
  9217. *
  9218. * _.unzipWith(zipped, _.add);
  9219. * // => [3, 30, 300]
  9220. */
  9221. function unzipWith(array, iteratee) {
  9222. if (!(array && array.length)) {
  9223. return [];
  9224. }
  9225. var result = unzip(array);
  9226. if (iteratee == null) {
  9227. return result;
  9228. }
  9229. return arrayMap(result, function(group) {
  9230. return apply(iteratee, undefined, group);
  9231. });
  9232. }
  9233. /**
  9234. * Creates an array excluding all given values using
  9235. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9236. * for equality comparisons.
  9237. *
  9238. * **Note:** Unlike `_.pull`, this method returns a new array.
  9239. *
  9240. * @static
  9241. * @memberOf _
  9242. * @since 0.1.0
  9243. * @category Array
  9244. * @param {Array} array The array to inspect.
  9245. * @param {...*} [values] The values to exclude.
  9246. * @returns {Array} Returns the new array of filtered values.
  9247. * @see _.difference, _.xor
  9248. * @example
  9249. *
  9250. * _.without([2, 1, 2, 3], 1, 2);
  9251. * // => [3]
  9252. */
  9253. var without = baseRest(function(array, values) {
  9254. return isArrayLikeObject(array)
  9255. ? baseDifference(array, values)
  9256. : [];
  9257. });
  9258. /**
  9259. * Creates an array of unique values that is the
  9260. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9261. * of the given arrays. The order of result values is determined by the order
  9262. * they occur in the arrays.
  9263. *
  9264. * @static
  9265. * @memberOf _
  9266. * @since 2.4.0
  9267. * @category Array
  9268. * @param {...Array} [arrays] The arrays to inspect.
  9269. * @returns {Array} Returns the new array of filtered values.
  9270. * @see _.difference, _.without
  9271. * @example
  9272. *
  9273. * _.xor([2, 1], [2, 3]);
  9274. * // => [1, 3]
  9275. */
  9276. var xor = baseRest(function(arrays) {
  9277. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9278. });
  9279. /**
  9280. * This method is like `_.xor` except that it accepts `iteratee` which is
  9281. * invoked for each element of each `arrays` to generate the criterion by
  9282. * which by which they're compared. The order of result values is determined
  9283. * by the order they occur in the arrays. The iteratee is invoked with one
  9284. * argument: (value).
  9285. *
  9286. * @static
  9287. * @memberOf _
  9288. * @since 4.0.0
  9289. * @category Array
  9290. * @param {...Array} [arrays] The arrays to inspect.
  9291. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9292. * @returns {Array} Returns the new array of filtered values.
  9293. * @example
  9294. *
  9295. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9296. * // => [1.2, 3.4]
  9297. *
  9298. * // The `_.property` iteratee shorthand.
  9299. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9300. * // => [{ 'x': 2 }]
  9301. */
  9302. var xorBy = baseRest(function(arrays) {
  9303. var iteratee = last(arrays);
  9304. if (isArrayLikeObject(iteratee)) {
  9305. iteratee = undefined;
  9306. }
  9307. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9308. });
  9309. /**
  9310. * This method is like `_.xor` except that it accepts `comparator` which is
  9311. * invoked to compare elements of `arrays`. The order of result values is
  9312. * determined by the order they occur in the arrays. The comparator is invoked
  9313. * with two arguments: (arrVal, othVal).
  9314. *
  9315. * @static
  9316. * @memberOf _
  9317. * @since 4.0.0
  9318. * @category Array
  9319. * @param {...Array} [arrays] The arrays to inspect.
  9320. * @param {Function} [comparator] The comparator invoked per element.
  9321. * @returns {Array} Returns the new array of filtered values.
  9322. * @example
  9323. *
  9324. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9325. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9326. *
  9327. * _.xorWith(objects, others, _.isEqual);
  9328. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9329. */
  9330. var xorWith = baseRest(function(arrays) {
  9331. var comparator = last(arrays);
  9332. comparator = typeof comparator == 'function' ? comparator : undefined;
  9333. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9334. });
  9335. /**
  9336. * Creates an array of grouped elements, the first of which contains the
  9337. * first elements of the given arrays, the second of which contains the
  9338. * second elements of the given arrays, and so on.
  9339. *
  9340. * @static
  9341. * @memberOf _
  9342. * @since 0.1.0
  9343. * @category Array
  9344. * @param {...Array} [arrays] The arrays to process.
  9345. * @returns {Array} Returns the new array of grouped elements.
  9346. * @example
  9347. *
  9348. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9349. * // => [['a', 1, true], ['b', 2, false]]
  9350. */
  9351. var zip = baseRest(unzip);
  9352. /**
  9353. * This method is like `_.fromPairs` except that it accepts two arrays,
  9354. * one of property identifiers and one of corresponding values.
  9355. *
  9356. * @static
  9357. * @memberOf _
  9358. * @since 0.4.0
  9359. * @category Array
  9360. * @param {Array} [props=[]] The property identifiers.
  9361. * @param {Array} [values=[]] The property values.
  9362. * @returns {Object} Returns the new object.
  9363. * @example
  9364. *
  9365. * _.zipObject(['a', 'b'], [1, 2]);
  9366. * // => { 'a': 1, 'b': 2 }
  9367. */
  9368. function zipObject(props, values) {
  9369. return baseZipObject(props || [], values || [], assignValue);
  9370. }
  9371. /**
  9372. * This method is like `_.zipObject` except that it supports property paths.
  9373. *
  9374. * @static
  9375. * @memberOf _
  9376. * @since 4.1.0
  9377. * @category Array
  9378. * @param {Array} [props=[]] The property identifiers.
  9379. * @param {Array} [values=[]] The property values.
  9380. * @returns {Object} Returns the new object.
  9381. * @example
  9382. *
  9383. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9384. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9385. */
  9386. function zipObjectDeep(props, values) {
  9387. return baseZipObject(props || [], values || [], baseSet);
  9388. }
  9389. /**
  9390. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9391. * how grouped values should be combined. The iteratee is invoked with the
  9392. * elements of each group: (...group).
  9393. *
  9394. * @static
  9395. * @memberOf _
  9396. * @since 3.8.0
  9397. * @category Array
  9398. * @param {...Array} [arrays] The arrays to process.
  9399. * @param {Function} [iteratee=_.identity] The function to combine
  9400. * grouped values.
  9401. * @returns {Array} Returns the new array of grouped elements.
  9402. * @example
  9403. *
  9404. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9405. * return a + b + c;
  9406. * });
  9407. * // => [111, 222]
  9408. */
  9409. var zipWith = baseRest(function(arrays) {
  9410. var length = arrays.length,
  9411. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9412. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9413. return unzipWith(arrays, iteratee);
  9414. });
  9415. /*------------------------------------------------------------------------*/
  9416. /**
  9417. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9418. * chain sequences enabled. The result of such sequences must be unwrapped
  9419. * with `_#value`.
  9420. *
  9421. * @static
  9422. * @memberOf _
  9423. * @since 1.3.0
  9424. * @category Seq
  9425. * @param {*} value The value to wrap.
  9426. * @returns {Object} Returns the new `lodash` wrapper instance.
  9427. * @example
  9428. *
  9429. * var users = [
  9430. * { 'user': 'barney', 'age': 36 },
  9431. * { 'user': 'fred', 'age': 40 },
  9432. * { 'user': 'pebbles', 'age': 1 }
  9433. * ];
  9434. *
  9435. * var youngest = _
  9436. * .chain(users)
  9437. * .sortBy('age')
  9438. * .map(function(o) {
  9439. * return o.user + ' is ' + o.age;
  9440. * })
  9441. * .head()
  9442. * .value();
  9443. * // => 'pebbles is 1'
  9444. */
  9445. function chain(value) {
  9446. var result = lodash(value);
  9447. result.__chain__ = true;
  9448. return result;
  9449. }
  9450. /**
  9451. * This method invokes `interceptor` and returns `value`. The interceptor
  9452. * is invoked with one argument; (value). The purpose of this method is to
  9453. * "tap into" a method chain sequence in order to modify intermediate results.
  9454. *
  9455. * @static
  9456. * @memberOf _
  9457. * @since 0.1.0
  9458. * @category Seq
  9459. * @param {*} value The value to provide to `interceptor`.
  9460. * @param {Function} interceptor The function to invoke.
  9461. * @returns {*} Returns `value`.
  9462. * @example
  9463. *
  9464. * _([1, 2, 3])
  9465. * .tap(function(array) {
  9466. * // Mutate input array.
  9467. * array.pop();
  9468. * })
  9469. * .reverse()
  9470. * .value();
  9471. * // => [2, 1]
  9472. */
  9473. function tap(value, interceptor) {
  9474. interceptor(value);
  9475. return value;
  9476. }
  9477. /**
  9478. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9479. * The purpose of this method is to "pass thru" values replacing intermediate
  9480. * results in a method chain sequence.
  9481. *
  9482. * @static
  9483. * @memberOf _
  9484. * @since 3.0.0
  9485. * @category Seq
  9486. * @param {*} value The value to provide to `interceptor`.
  9487. * @param {Function} interceptor The function to invoke.
  9488. * @returns {*} Returns the result of `interceptor`.
  9489. * @example
  9490. *
  9491. * _(' abc ')
  9492. * .chain()
  9493. * .trim()
  9494. * .thru(function(value) {
  9495. * return [value];
  9496. * })
  9497. * .value();
  9498. * // => ['abc']
  9499. */
  9500. function thru(value, interceptor) {
  9501. return interceptor(value);
  9502. }
  9503. /**
  9504. * This method is the wrapper version of `_.at`.
  9505. *
  9506. * @name at
  9507. * @memberOf _
  9508. * @since 1.0.0
  9509. * @category Seq
  9510. * @param {...(string|string[])} [paths] The property paths to pick.
  9511. * @returns {Object} Returns the new `lodash` wrapper instance.
  9512. * @example
  9513. *
  9514. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9515. *
  9516. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9517. * // => [3, 4]
  9518. */
  9519. var wrapperAt = flatRest(function(paths) {
  9520. var length = paths.length,
  9521. start = length ? paths[0] : 0,
  9522. value = this.__wrapped__,
  9523. interceptor = function(object) { return baseAt(object, paths); };
  9524. if (length > 1 || this.__actions__.length ||
  9525. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9526. return this.thru(interceptor);
  9527. }
  9528. value = value.slice(start, +start + (length ? 1 : 0));
  9529. value.__actions__.push({
  9530. 'func': thru,
  9531. 'args': [interceptor],
  9532. 'thisArg': undefined
  9533. });
  9534. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9535. if (length && !array.length) {
  9536. array.push(undefined);
  9537. }
  9538. return array;
  9539. });
  9540. });
  9541. /**
  9542. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9543. *
  9544. * @name chain
  9545. * @memberOf _
  9546. * @since 0.1.0
  9547. * @category Seq
  9548. * @returns {Object} Returns the new `lodash` wrapper instance.
  9549. * @example
  9550. *
  9551. * var users = [
  9552. * { 'user': 'barney', 'age': 36 },
  9553. * { 'user': 'fred', 'age': 40 }
  9554. * ];
  9555. *
  9556. * // A sequence without explicit chaining.
  9557. * _(users).head();
  9558. * // => { 'user': 'barney', 'age': 36 }
  9559. *
  9560. * // A sequence with explicit chaining.
  9561. * _(users)
  9562. * .chain()
  9563. * .head()
  9564. * .pick('user')
  9565. * .value();
  9566. * // => { 'user': 'barney' }
  9567. */
  9568. function wrapperChain() {
  9569. return chain(this);
  9570. }
  9571. /**
  9572. * Executes the chain sequence and returns the wrapped result.
  9573. *
  9574. * @name commit
  9575. * @memberOf _
  9576. * @since 3.2.0
  9577. * @category Seq
  9578. * @returns {Object} Returns the new `lodash` wrapper instance.
  9579. * @example
  9580. *
  9581. * var array = [1, 2];
  9582. * var wrapped = _(array).push(3);
  9583. *
  9584. * console.log(array);
  9585. * // => [1, 2]
  9586. *
  9587. * wrapped = wrapped.commit();
  9588. * console.log(array);
  9589. * // => [1, 2, 3]
  9590. *
  9591. * wrapped.last();
  9592. * // => 3
  9593. *
  9594. * console.log(array);
  9595. * // => [1, 2, 3]
  9596. */
  9597. function wrapperCommit() {
  9598. return new LodashWrapper(this.value(), this.__chain__);
  9599. }
  9600. /**
  9601. * Gets the next value on a wrapped object following the
  9602. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9603. *
  9604. * @name next
  9605. * @memberOf _
  9606. * @since 4.0.0
  9607. * @category Seq
  9608. * @returns {Object} Returns the next iterator value.
  9609. * @example
  9610. *
  9611. * var wrapped = _([1, 2]);
  9612. *
  9613. * wrapped.next();
  9614. * // => { 'done': false, 'value': 1 }
  9615. *
  9616. * wrapped.next();
  9617. * // => { 'done': false, 'value': 2 }
  9618. *
  9619. * wrapped.next();
  9620. * // => { 'done': true, 'value': undefined }
  9621. */
  9622. function wrapperNext() {
  9623. if (this.__values__ === undefined) {
  9624. this.__values__ = toArray(this.value());
  9625. }
  9626. var done = this.__index__ >= this.__values__.length,
  9627. value = done ? undefined : this.__values__[this.__index__++];
  9628. return { 'done': done, 'value': value };
  9629. }
  9630. /**
  9631. * Enables the wrapper to be iterable.
  9632. *
  9633. * @name Symbol.iterator
  9634. * @memberOf _
  9635. * @since 4.0.0
  9636. * @category Seq
  9637. * @returns {Object} Returns the wrapper object.
  9638. * @example
  9639. *
  9640. * var wrapped = _([1, 2]);
  9641. *
  9642. * wrapped[Symbol.iterator]() === wrapped;
  9643. * // => true
  9644. *
  9645. * Array.from(wrapped);
  9646. * // => [1, 2]
  9647. */
  9648. function wrapperToIterator() {
  9649. return this;
  9650. }
  9651. /**
  9652. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9653. *
  9654. * @name plant
  9655. * @memberOf _
  9656. * @since 3.2.0
  9657. * @category Seq
  9658. * @param {*} value The value to plant.
  9659. * @returns {Object} Returns the new `lodash` wrapper instance.
  9660. * @example
  9661. *
  9662. * function square(n) {
  9663. * return n * n;
  9664. * }
  9665. *
  9666. * var wrapped = _([1, 2]).map(square);
  9667. * var other = wrapped.plant([3, 4]);
  9668. *
  9669. * other.value();
  9670. * // => [9, 16]
  9671. *
  9672. * wrapped.value();
  9673. * // => [1, 4]
  9674. */
  9675. function wrapperPlant(value) {
  9676. var result,
  9677. parent = this;
  9678. while (parent instanceof baseLodash) {
  9679. var clone = wrapperClone(parent);
  9680. clone.__index__ = 0;
  9681. clone.__values__ = undefined;
  9682. if (result) {
  9683. previous.__wrapped__ = clone;
  9684. } else {
  9685. result = clone;
  9686. }
  9687. var previous = clone;
  9688. parent = parent.__wrapped__;
  9689. }
  9690. previous.__wrapped__ = value;
  9691. return result;
  9692. }
  9693. /**
  9694. * This method is the wrapper version of `_.reverse`.
  9695. *
  9696. * **Note:** This method mutates the wrapped array.
  9697. *
  9698. * @name reverse
  9699. * @memberOf _
  9700. * @since 0.1.0
  9701. * @category Seq
  9702. * @returns {Object} Returns the new `lodash` wrapper instance.
  9703. * @example
  9704. *
  9705. * var array = [1, 2, 3];
  9706. *
  9707. * _(array).reverse().value()
  9708. * // => [3, 2, 1]
  9709. *
  9710. * console.log(array);
  9711. * // => [3, 2, 1]
  9712. */
  9713. function wrapperReverse() {
  9714. var value = this.__wrapped__;
  9715. if (value instanceof LazyWrapper) {
  9716. var wrapped = value;
  9717. if (this.__actions__.length) {
  9718. wrapped = new LazyWrapper(this);
  9719. }
  9720. wrapped = wrapped.reverse();
  9721. wrapped.__actions__.push({
  9722. 'func': thru,
  9723. 'args': [reverse],
  9724. 'thisArg': undefined
  9725. });
  9726. return new LodashWrapper(wrapped, this.__chain__);
  9727. }
  9728. return this.thru(reverse);
  9729. }
  9730. /**
  9731. * Executes the chain sequence to resolve the unwrapped value.
  9732. *
  9733. * @name value
  9734. * @memberOf _
  9735. * @since 0.1.0
  9736. * @alias toJSON, valueOf
  9737. * @category Seq
  9738. * @returns {*} Returns the resolved unwrapped value.
  9739. * @example
  9740. *
  9741. * _([1, 2, 3]).value();
  9742. * // => [1, 2, 3]
  9743. */
  9744. function wrapperValue() {
  9745. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9746. }
  9747. /*------------------------------------------------------------------------*/
  9748. /**
  9749. * Creates an object composed of keys generated from the results of running
  9750. * each element of `collection` thru `iteratee`. The corresponding value of
  9751. * each key is the number of times the key was returned by `iteratee`. The
  9752. * iteratee is invoked with one argument: (value).
  9753. *
  9754. * @static
  9755. * @memberOf _
  9756. * @since 0.5.0
  9757. * @category Collection
  9758. * @param {Array|Object} collection The collection to iterate over.
  9759. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9760. * @returns {Object} Returns the composed aggregate object.
  9761. * @example
  9762. *
  9763. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9764. * // => { '4': 1, '6': 2 }
  9765. *
  9766. * // The `_.property` iteratee shorthand.
  9767. * _.countBy(['one', 'two', 'three'], 'length');
  9768. * // => { '3': 2, '5': 1 }
  9769. */
  9770. var countBy = createAggregator(function(result, value, key) {
  9771. if (hasOwnProperty.call(result, key)) {
  9772. ++result[key];
  9773. } else {
  9774. baseAssignValue(result, key, 1);
  9775. }
  9776. });
  9777. /**
  9778. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9779. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9780. * invoked with three arguments: (value, index|key, collection).
  9781. *
  9782. * **Note:** This method returns `true` for
  9783. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9784. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9785. * elements of empty collections.
  9786. *
  9787. * @static
  9788. * @memberOf _
  9789. * @since 0.1.0
  9790. * @category Collection
  9791. * @param {Array|Object} collection The collection to iterate over.
  9792. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9793. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9794. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9795. * else `false`.
  9796. * @example
  9797. *
  9798. * _.every([true, 1, null, 'yes'], Boolean);
  9799. * // => false
  9800. *
  9801. * var users = [
  9802. * { 'user': 'barney', 'age': 36, 'active': false },
  9803. * { 'user': 'fred', 'age': 40, 'active': false }
  9804. * ];
  9805. *
  9806. * // The `_.matches` iteratee shorthand.
  9807. * _.every(users, { 'user': 'barney', 'active': false });
  9808. * // => false
  9809. *
  9810. * // The `_.matchesProperty` iteratee shorthand.
  9811. * _.every(users, ['active', false]);
  9812. * // => true
  9813. *
  9814. * // The `_.property` iteratee shorthand.
  9815. * _.every(users, 'active');
  9816. * // => false
  9817. */
  9818. function every(collection, predicate, guard) {
  9819. var func = isArray(collection) ? arrayEvery : baseEvery;
  9820. if (guard && isIterateeCall(collection, predicate, guard)) {
  9821. predicate = undefined;
  9822. }
  9823. return func(collection, getIteratee(predicate, 3));
  9824. }
  9825. /**
  9826. * Iterates over elements of `collection`, returning an array of all elements
  9827. * `predicate` returns truthy for. The predicate is invoked with three
  9828. * arguments: (value, index|key, collection).
  9829. *
  9830. * **Note:** Unlike `_.remove`, this method returns a new array.
  9831. *
  9832. * @static
  9833. * @memberOf _
  9834. * @since 0.1.0
  9835. * @category Collection
  9836. * @param {Array|Object} collection The collection to iterate over.
  9837. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9838. * @returns {Array} Returns the new filtered array.
  9839. * @see _.reject
  9840. * @example
  9841. *
  9842. * var users = [
  9843. * { 'user': 'barney', 'age': 36, 'active': true },
  9844. * { 'user': 'fred', 'age': 40, 'active': false }
  9845. * ];
  9846. *
  9847. * _.filter(users, function(o) { return !o.active; });
  9848. * // => objects for ['fred']
  9849. *
  9850. * // The `_.matches` iteratee shorthand.
  9851. * _.filter(users, { 'age': 36, 'active': true });
  9852. * // => objects for ['barney']
  9853. *
  9854. * // The `_.matchesProperty` iteratee shorthand.
  9855. * _.filter(users, ['active', false]);
  9856. * // => objects for ['fred']
  9857. *
  9858. * // The `_.property` iteratee shorthand.
  9859. * _.filter(users, 'active');
  9860. * // => objects for ['barney']
  9861. *
  9862. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9863. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9864. * // => objects for ['fred', 'barney']
  9865. */
  9866. function filter(collection, predicate) {
  9867. var func = isArray(collection) ? arrayFilter : baseFilter;
  9868. return func(collection, getIteratee(predicate, 3));
  9869. }
  9870. /**
  9871. * Iterates over elements of `collection`, returning the first element
  9872. * `predicate` returns truthy for. The predicate is invoked with three
  9873. * arguments: (value, index|key, collection).
  9874. *
  9875. * @static
  9876. * @memberOf _
  9877. * @since 0.1.0
  9878. * @category Collection
  9879. * @param {Array|Object} collection The collection to inspect.
  9880. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9881. * @param {number} [fromIndex=0] The index to search from.
  9882. * @returns {*} Returns the matched element, else `undefined`.
  9883. * @example
  9884. *
  9885. * var users = [
  9886. * { 'user': 'barney', 'age': 36, 'active': true },
  9887. * { 'user': 'fred', 'age': 40, 'active': false },
  9888. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9889. * ];
  9890. *
  9891. * _.find(users, function(o) { return o.age < 40; });
  9892. * // => object for 'barney'
  9893. *
  9894. * // The `_.matches` iteratee shorthand.
  9895. * _.find(users, { 'age': 1, 'active': true });
  9896. * // => object for 'pebbles'
  9897. *
  9898. * // The `_.matchesProperty` iteratee shorthand.
  9899. * _.find(users, ['active', false]);
  9900. * // => object for 'fred'
  9901. *
  9902. * // The `_.property` iteratee shorthand.
  9903. * _.find(users, 'active');
  9904. * // => object for 'barney'
  9905. */
  9906. var find = createFind(findIndex);
  9907. /**
  9908. * This method is like `_.find` except that it iterates over elements of
  9909. * `collection` from right to left.
  9910. *
  9911. * @static
  9912. * @memberOf _
  9913. * @since 2.0.0
  9914. * @category Collection
  9915. * @param {Array|Object} collection The collection to inspect.
  9916. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9917. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9918. * @returns {*} Returns the matched element, else `undefined`.
  9919. * @example
  9920. *
  9921. * _.findLast([1, 2, 3, 4], function(n) {
  9922. * return n % 2 == 1;
  9923. * });
  9924. * // => 3
  9925. */
  9926. var findLast = createFind(findLastIndex);
  9927. /**
  9928. * Creates a flattened array of values by running each element in `collection`
  9929. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9930. * with three arguments: (value, index|key, collection).
  9931. *
  9932. * @static
  9933. * @memberOf _
  9934. * @since 4.0.0
  9935. * @category Collection
  9936. * @param {Array|Object} collection The collection to iterate over.
  9937. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9938. * @returns {Array} Returns the new flattened array.
  9939. * @example
  9940. *
  9941. * function duplicate(n) {
  9942. * return [n, n];
  9943. * }
  9944. *
  9945. * _.flatMap([1, 2], duplicate);
  9946. * // => [1, 1, 2, 2]
  9947. */
  9948. function flatMap(collection, iteratee) {
  9949. return baseFlatten(map(collection, iteratee), 1);
  9950. }
  9951. /**
  9952. * This method is like `_.flatMap` except that it recursively flattens the
  9953. * mapped results.
  9954. *
  9955. * @static
  9956. * @memberOf _
  9957. * @since 4.7.0
  9958. * @category Collection
  9959. * @param {Array|Object} collection The collection to iterate over.
  9960. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9961. * @returns {Array} Returns the new flattened array.
  9962. * @example
  9963. *
  9964. * function duplicate(n) {
  9965. * return [[[n, n]]];
  9966. * }
  9967. *
  9968. * _.flatMapDeep([1, 2], duplicate);
  9969. * // => [1, 1, 2, 2]
  9970. */
  9971. function flatMapDeep(collection, iteratee) {
  9972. return baseFlatten(map(collection, iteratee), INFINITY);
  9973. }
  9974. /**
  9975. * This method is like `_.flatMap` except that it recursively flattens the
  9976. * mapped results up to `depth` times.
  9977. *
  9978. * @static
  9979. * @memberOf _
  9980. * @since 4.7.0
  9981. * @category Collection
  9982. * @param {Array|Object} collection The collection to iterate over.
  9983. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9984. * @param {number} [depth=1] The maximum recursion depth.
  9985. * @returns {Array} Returns the new flattened array.
  9986. * @example
  9987. *
  9988. * function duplicate(n) {
  9989. * return [[[n, n]]];
  9990. * }
  9991. *
  9992. * _.flatMapDepth([1, 2], duplicate, 2);
  9993. * // => [[1, 1], [2, 2]]
  9994. */
  9995. function flatMapDepth(collection, iteratee, depth) {
  9996. depth = depth === undefined ? 1 : toInteger(depth);
  9997. return baseFlatten(map(collection, iteratee), depth);
  9998. }
  9999. /**
  10000. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10001. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10002. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10003. *
  10004. * **Note:** As with other "Collections" methods, objects with a "length"
  10005. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10006. * or `_.forOwn` for object iteration.
  10007. *
  10008. * @static
  10009. * @memberOf _
  10010. * @since 0.1.0
  10011. * @alias each
  10012. * @category Collection
  10013. * @param {Array|Object} collection The collection to iterate over.
  10014. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10015. * @returns {Array|Object} Returns `collection`.
  10016. * @see _.forEachRight
  10017. * @example
  10018. *
  10019. * _.forEach([1, 2], function(value) {
  10020. * console.log(value);
  10021. * });
  10022. * // => Logs `1` then `2`.
  10023. *
  10024. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10025. * console.log(key);
  10026. * });
  10027. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10028. */
  10029. function forEach(collection, iteratee) {
  10030. var func = isArray(collection) ? arrayEach : baseEach;
  10031. return func(collection, getIteratee(iteratee, 3));
  10032. }
  10033. /**
  10034. * This method is like `_.forEach` except that it iterates over elements of
  10035. * `collection` from right to left.
  10036. *
  10037. * @static
  10038. * @memberOf _
  10039. * @since 2.0.0
  10040. * @alias eachRight
  10041. * @category Collection
  10042. * @param {Array|Object} collection The collection to iterate over.
  10043. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10044. * @returns {Array|Object} Returns `collection`.
  10045. * @see _.forEach
  10046. * @example
  10047. *
  10048. * _.forEachRight([1, 2], function(value) {
  10049. * console.log(value);
  10050. * });
  10051. * // => Logs `2` then `1`.
  10052. */
  10053. function forEachRight(collection, iteratee) {
  10054. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10055. return func(collection, getIteratee(iteratee, 3));
  10056. }
  10057. /**
  10058. * Creates an object composed of keys generated from the results of running
  10059. * each element of `collection` thru `iteratee`. The order of grouped values
  10060. * is determined by the order they occur in `collection`. The corresponding
  10061. * value of each key is an array of elements responsible for generating the
  10062. * key. The iteratee is invoked with one argument: (value).
  10063. *
  10064. * @static
  10065. * @memberOf _
  10066. * @since 0.1.0
  10067. * @category Collection
  10068. * @param {Array|Object} collection The collection to iterate over.
  10069. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10070. * @returns {Object} Returns the composed aggregate object.
  10071. * @example
  10072. *
  10073. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10074. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10075. *
  10076. * // The `_.property` iteratee shorthand.
  10077. * _.groupBy(['one', 'two', 'three'], 'length');
  10078. * // => { '3': ['one', 'two'], '5': ['three'] }
  10079. */
  10080. var groupBy = createAggregator(function(result, value, key) {
  10081. if (hasOwnProperty.call(result, key)) {
  10082. result[key].push(value);
  10083. } else {
  10084. baseAssignValue(result, key, [value]);
  10085. }
  10086. });
  10087. /**
  10088. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10089. * checked for a substring of `value`, otherwise
  10090. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10091. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10092. * the offset from the end of `collection`.
  10093. *
  10094. * @static
  10095. * @memberOf _
  10096. * @since 0.1.0
  10097. * @category Collection
  10098. * @param {Array|Object|string} collection The collection to inspect.
  10099. * @param {*} value The value to search for.
  10100. * @param {number} [fromIndex=0] The index to search from.
  10101. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10102. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10103. * @example
  10104. *
  10105. * _.includes([1, 2, 3], 1);
  10106. * // => true
  10107. *
  10108. * _.includes([1, 2, 3], 1, 2);
  10109. * // => false
  10110. *
  10111. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10112. * // => true
  10113. *
  10114. * _.includes('abcd', 'bc');
  10115. * // => true
  10116. */
  10117. function includes(collection, value, fromIndex, guard) {
  10118. collection = isArrayLike(collection) ? collection : values(collection);
  10119. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10120. var length = collection.length;
  10121. if (fromIndex < 0) {
  10122. fromIndex = nativeMax(length + fromIndex, 0);
  10123. }
  10124. return isString(collection)
  10125. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10126. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10127. }
  10128. /**
  10129. * Invokes the method at `path` of each element in `collection`, returning
  10130. * an array of the results of each invoked method. Any additional arguments
  10131. * are provided to each invoked method. If `path` is a function, it's invoked
  10132. * for, and `this` bound to, each element in `collection`.
  10133. *
  10134. * @static
  10135. * @memberOf _
  10136. * @since 4.0.0
  10137. * @category Collection
  10138. * @param {Array|Object} collection The collection to iterate over.
  10139. * @param {Array|Function|string} path The path of the method to invoke or
  10140. * the function invoked per iteration.
  10141. * @param {...*} [args] The arguments to invoke each method with.
  10142. * @returns {Array} Returns the array of results.
  10143. * @example
  10144. *
  10145. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10146. * // => [[1, 5, 7], [1, 2, 3]]
  10147. *
  10148. * _.invokeMap([123, 456], String.prototype.split, '');
  10149. * // => [['1', '2', '3'], ['4', '5', '6']]
  10150. */
  10151. var invokeMap = baseRest(function(collection, path, args) {
  10152. var index = -1,
  10153. isFunc = typeof path == 'function',
  10154. result = isArrayLike(collection) ? Array(collection.length) : [];
  10155. baseEach(collection, function(value) {
  10156. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10157. });
  10158. return result;
  10159. });
  10160. /**
  10161. * Creates an object composed of keys generated from the results of running
  10162. * each element of `collection` thru `iteratee`. The corresponding value of
  10163. * each key is the last element responsible for generating the key. The
  10164. * iteratee is invoked with one argument: (value).
  10165. *
  10166. * @static
  10167. * @memberOf _
  10168. * @since 4.0.0
  10169. * @category Collection
  10170. * @param {Array|Object} collection The collection to iterate over.
  10171. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10172. * @returns {Object} Returns the composed aggregate object.
  10173. * @example
  10174. *
  10175. * var array = [
  10176. * { 'dir': 'left', 'code': 97 },
  10177. * { 'dir': 'right', 'code': 100 }
  10178. * ];
  10179. *
  10180. * _.keyBy(array, function(o) {
  10181. * return String.fromCharCode(o.code);
  10182. * });
  10183. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10184. *
  10185. * _.keyBy(array, 'dir');
  10186. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10187. */
  10188. var keyBy = createAggregator(function(result, value, key) {
  10189. baseAssignValue(result, key, value);
  10190. });
  10191. /**
  10192. * Creates an array of values by running each element in `collection` thru
  10193. * `iteratee`. The iteratee is invoked with three arguments:
  10194. * (value, index|key, collection).
  10195. *
  10196. * Many lodash methods are guarded to work as iteratees for methods like
  10197. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10198. *
  10199. * The guarded methods are:
  10200. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10201. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10202. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10203. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10204. *
  10205. * @static
  10206. * @memberOf _
  10207. * @since 0.1.0
  10208. * @category Collection
  10209. * @param {Array|Object} collection The collection to iterate over.
  10210. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10211. * @returns {Array} Returns the new mapped array.
  10212. * @example
  10213. *
  10214. * function square(n) {
  10215. * return n * n;
  10216. * }
  10217. *
  10218. * _.map([4, 8], square);
  10219. * // => [16, 64]
  10220. *
  10221. * _.map({ 'a': 4, 'b': 8 }, square);
  10222. * // => [16, 64] (iteration order is not guaranteed)
  10223. *
  10224. * var users = [
  10225. * { 'user': 'barney' },
  10226. * { 'user': 'fred' }
  10227. * ];
  10228. *
  10229. * // The `_.property` iteratee shorthand.
  10230. * _.map(users, 'user');
  10231. * // => ['barney', 'fred']
  10232. */
  10233. function map(collection, iteratee) {
  10234. var func = isArray(collection) ? arrayMap : baseMap;
  10235. return func(collection, getIteratee(iteratee, 3));
  10236. }
  10237. /**
  10238. * This method is like `_.sortBy` except that it allows specifying the sort
  10239. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10240. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10241. * descending or "asc" for ascending sort order of corresponding values.
  10242. *
  10243. * @static
  10244. * @memberOf _
  10245. * @since 4.0.0
  10246. * @category Collection
  10247. * @param {Array|Object} collection The collection to iterate over.
  10248. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10249. * The iteratees to sort by.
  10250. * @param {string[]} [orders] The sort orders of `iteratees`.
  10251. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10252. * @returns {Array} Returns the new sorted array.
  10253. * @example
  10254. *
  10255. * var users = [
  10256. * { 'user': 'fred', 'age': 48 },
  10257. * { 'user': 'barney', 'age': 34 },
  10258. * { 'user': 'fred', 'age': 40 },
  10259. * { 'user': 'barney', 'age': 36 }
  10260. * ];
  10261. *
  10262. * // Sort by `user` in ascending order and by `age` in descending order.
  10263. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10264. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10265. */
  10266. function orderBy(collection, iteratees, orders, guard) {
  10267. if (collection == null) {
  10268. return [];
  10269. }
  10270. if (!isArray(iteratees)) {
  10271. iteratees = iteratees == null ? [] : [iteratees];
  10272. }
  10273. orders = guard ? undefined : orders;
  10274. if (!isArray(orders)) {
  10275. orders = orders == null ? [] : [orders];
  10276. }
  10277. return baseOrderBy(collection, iteratees, orders);
  10278. }
  10279. /**
  10280. * Creates an array of elements split into two groups, the first of which
  10281. * contains elements `predicate` returns truthy for, the second of which
  10282. * contains elements `predicate` returns falsey for. The predicate is
  10283. * invoked with one argument: (value).
  10284. *
  10285. * @static
  10286. * @memberOf _
  10287. * @since 3.0.0
  10288. * @category Collection
  10289. * @param {Array|Object} collection The collection to iterate over.
  10290. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10291. * @returns {Array} Returns the array of grouped elements.
  10292. * @example
  10293. *
  10294. * var users = [
  10295. * { 'user': 'barney', 'age': 36, 'active': false },
  10296. * { 'user': 'fred', 'age': 40, 'active': true },
  10297. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10298. * ];
  10299. *
  10300. * _.partition(users, function(o) { return o.active; });
  10301. * // => objects for [['fred'], ['barney', 'pebbles']]
  10302. *
  10303. * // The `_.matches` iteratee shorthand.
  10304. * _.partition(users, { 'age': 1, 'active': false });
  10305. * // => objects for [['pebbles'], ['barney', 'fred']]
  10306. *
  10307. * // The `_.matchesProperty` iteratee shorthand.
  10308. * _.partition(users, ['active', false]);
  10309. * // => objects for [['barney', 'pebbles'], ['fred']]
  10310. *
  10311. * // The `_.property` iteratee shorthand.
  10312. * _.partition(users, 'active');
  10313. * // => objects for [['fred'], ['barney', 'pebbles']]
  10314. */
  10315. var partition = createAggregator(function(result, value, key) {
  10316. result[key ? 0 : 1].push(value);
  10317. }, function() { return [[], []]; });
  10318. /**
  10319. * Reduces `collection` to a value which is the accumulated result of running
  10320. * each element in `collection` thru `iteratee`, where each successive
  10321. * invocation is supplied the return value of the previous. If `accumulator`
  10322. * is not given, the first element of `collection` is used as the initial
  10323. * value. The iteratee is invoked with four arguments:
  10324. * (accumulator, value, index|key, collection).
  10325. *
  10326. * Many lodash methods are guarded to work as iteratees for methods like
  10327. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10328. *
  10329. * The guarded methods are:
  10330. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10331. * and `sortBy`
  10332. *
  10333. * @static
  10334. * @memberOf _
  10335. * @since 0.1.0
  10336. * @category Collection
  10337. * @param {Array|Object} collection The collection to iterate over.
  10338. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10339. * @param {*} [accumulator] The initial value.
  10340. * @returns {*} Returns the accumulated value.
  10341. * @see _.reduceRight
  10342. * @example
  10343. *
  10344. * _.reduce([1, 2], function(sum, n) {
  10345. * return sum + n;
  10346. * }, 0);
  10347. * // => 3
  10348. *
  10349. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10350. * (result[value] || (result[value] = [])).push(key);
  10351. * return result;
  10352. * }, {});
  10353. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10354. */
  10355. function reduce(collection, iteratee, accumulator) {
  10356. var func = isArray(collection) ? arrayReduce : baseReduce,
  10357. initAccum = arguments.length < 3;
  10358. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10359. }
  10360. /**
  10361. * This method is like `_.reduce` except that it iterates over elements of
  10362. * `collection` from right to left.
  10363. *
  10364. * @static
  10365. * @memberOf _
  10366. * @since 0.1.0
  10367. * @category Collection
  10368. * @param {Array|Object} collection The collection to iterate over.
  10369. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10370. * @param {*} [accumulator] The initial value.
  10371. * @returns {*} Returns the accumulated value.
  10372. * @see _.reduce
  10373. * @example
  10374. *
  10375. * var array = [[0, 1], [2, 3], [4, 5]];
  10376. *
  10377. * _.reduceRight(array, function(flattened, other) {
  10378. * return flattened.concat(other);
  10379. * }, []);
  10380. * // => [4, 5, 2, 3, 0, 1]
  10381. */
  10382. function reduceRight(collection, iteratee, accumulator) {
  10383. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10384. initAccum = arguments.length < 3;
  10385. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10386. }
  10387. /**
  10388. * The opposite of `_.filter`; this method returns the elements of `collection`
  10389. * that `predicate` does **not** return truthy for.
  10390. *
  10391. * @static
  10392. * @memberOf _
  10393. * @since 0.1.0
  10394. * @category Collection
  10395. * @param {Array|Object} collection The collection to iterate over.
  10396. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10397. * @returns {Array} Returns the new filtered array.
  10398. * @see _.filter
  10399. * @example
  10400. *
  10401. * var users = [
  10402. * { 'user': 'barney', 'age': 36, 'active': false },
  10403. * { 'user': 'fred', 'age': 40, 'active': true }
  10404. * ];
  10405. *
  10406. * _.reject(users, function(o) { return !o.active; });
  10407. * // => objects for ['fred']
  10408. *
  10409. * // The `_.matches` iteratee shorthand.
  10410. * _.reject(users, { 'age': 40, 'active': true });
  10411. * // => objects for ['barney']
  10412. *
  10413. * // The `_.matchesProperty` iteratee shorthand.
  10414. * _.reject(users, ['active', false]);
  10415. * // => objects for ['fred']
  10416. *
  10417. * // The `_.property` iteratee shorthand.
  10418. * _.reject(users, 'active');
  10419. * // => objects for ['barney']
  10420. */
  10421. function reject(collection, predicate) {
  10422. var func = isArray(collection) ? arrayFilter : baseFilter;
  10423. return func(collection, negate(getIteratee(predicate, 3)));
  10424. }
  10425. /**
  10426. * Gets a random element from `collection`.
  10427. *
  10428. * @static
  10429. * @memberOf _
  10430. * @since 2.0.0
  10431. * @category Collection
  10432. * @param {Array|Object} collection The collection to sample.
  10433. * @returns {*} Returns the random element.
  10434. * @example
  10435. *
  10436. * _.sample([1, 2, 3, 4]);
  10437. * // => 2
  10438. */
  10439. function sample(collection) {
  10440. var func = isArray(collection) ? arraySample : baseSample;
  10441. return func(collection);
  10442. }
  10443. /**
  10444. * Gets `n` random elements at unique keys from `collection` up to the
  10445. * size of `collection`.
  10446. *
  10447. * @static
  10448. * @memberOf _
  10449. * @since 4.0.0
  10450. * @category Collection
  10451. * @param {Array|Object} collection The collection to sample.
  10452. * @param {number} [n=1] The number of elements to sample.
  10453. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10454. * @returns {Array} Returns the random elements.
  10455. * @example
  10456. *
  10457. * _.sampleSize([1, 2, 3], 2);
  10458. * // => [3, 1]
  10459. *
  10460. * _.sampleSize([1, 2, 3], 4);
  10461. * // => [2, 3, 1]
  10462. */
  10463. function sampleSize(collection, n, guard) {
  10464. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10465. n = 1;
  10466. } else {
  10467. n = toInteger(n);
  10468. }
  10469. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10470. return func(collection, n);
  10471. }
  10472. /**
  10473. * Creates an array of shuffled values, using a version of the
  10474. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10475. *
  10476. * @static
  10477. * @memberOf _
  10478. * @since 0.1.0
  10479. * @category Collection
  10480. * @param {Array|Object} collection The collection to shuffle.
  10481. * @returns {Array} Returns the new shuffled array.
  10482. * @example
  10483. *
  10484. * _.shuffle([1, 2, 3, 4]);
  10485. * // => [4, 1, 3, 2]
  10486. */
  10487. function shuffle(collection) {
  10488. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10489. return func(collection);
  10490. }
  10491. /**
  10492. * Gets the size of `collection` by returning its length for array-like
  10493. * values or the number of own enumerable string keyed properties for objects.
  10494. *
  10495. * @static
  10496. * @memberOf _
  10497. * @since 0.1.0
  10498. * @category Collection
  10499. * @param {Array|Object|string} collection The collection to inspect.
  10500. * @returns {number} Returns the collection size.
  10501. * @example
  10502. *
  10503. * _.size([1, 2, 3]);
  10504. * // => 3
  10505. *
  10506. * _.size({ 'a': 1, 'b': 2 });
  10507. * // => 2
  10508. *
  10509. * _.size('pebbles');
  10510. * // => 7
  10511. */
  10512. function size(collection) {
  10513. if (collection == null) {
  10514. return 0;
  10515. }
  10516. if (isArrayLike(collection)) {
  10517. return isString(collection) ? stringSize(collection) : collection.length;
  10518. }
  10519. var tag = getTag(collection);
  10520. if (tag == mapTag || tag == setTag) {
  10521. return collection.size;
  10522. }
  10523. return baseKeys(collection).length;
  10524. }
  10525. /**
  10526. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10527. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10528. * invoked with three arguments: (value, index|key, collection).
  10529. *
  10530. * @static
  10531. * @memberOf _
  10532. * @since 0.1.0
  10533. * @category Collection
  10534. * @param {Array|Object} collection The collection to iterate over.
  10535. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10536. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10537. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10538. * else `false`.
  10539. * @example
  10540. *
  10541. * _.some([null, 0, 'yes', false], Boolean);
  10542. * // => true
  10543. *
  10544. * var users = [
  10545. * { 'user': 'barney', 'active': true },
  10546. * { 'user': 'fred', 'active': false }
  10547. * ];
  10548. *
  10549. * // The `_.matches` iteratee shorthand.
  10550. * _.some(users, { 'user': 'barney', 'active': false });
  10551. * // => false
  10552. *
  10553. * // The `_.matchesProperty` iteratee shorthand.
  10554. * _.some(users, ['active', false]);
  10555. * // => true
  10556. *
  10557. * // The `_.property` iteratee shorthand.
  10558. * _.some(users, 'active');
  10559. * // => true
  10560. */
  10561. function some(collection, predicate, guard) {
  10562. var func = isArray(collection) ? arraySome : baseSome;
  10563. if (guard && isIterateeCall(collection, predicate, guard)) {
  10564. predicate = undefined;
  10565. }
  10566. return func(collection, getIteratee(predicate, 3));
  10567. }
  10568. /**
  10569. * Creates an array of elements, sorted in ascending order by the results of
  10570. * running each element in a collection thru each iteratee. This method
  10571. * performs a stable sort, that is, it preserves the original sort order of
  10572. * equal elements. The iteratees are invoked with one argument: (value).
  10573. *
  10574. * @static
  10575. * @memberOf _
  10576. * @since 0.1.0
  10577. * @category Collection
  10578. * @param {Array|Object} collection The collection to iterate over.
  10579. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10580. * The iteratees to sort by.
  10581. * @returns {Array} Returns the new sorted array.
  10582. * @example
  10583. *
  10584. * var users = [
  10585. * { 'user': 'fred', 'age': 48 },
  10586. * { 'user': 'barney', 'age': 36 },
  10587. * { 'user': 'fred', 'age': 30 },
  10588. * { 'user': 'barney', 'age': 34 }
  10589. * ];
  10590. *
  10591. * _.sortBy(users, [function(o) { return o.user; }]);
  10592. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10593. *
  10594. * _.sortBy(users, ['user', 'age']);
  10595. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10596. */
  10597. var sortBy = baseRest(function(collection, iteratees) {
  10598. if (collection == null) {
  10599. return [];
  10600. }
  10601. var length = iteratees.length;
  10602. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10603. iteratees = [];
  10604. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10605. iteratees = [iteratees[0]];
  10606. }
  10607. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10608. });
  10609. /*------------------------------------------------------------------------*/
  10610. /**
  10611. * Gets the timestamp of the number of milliseconds that have elapsed since
  10612. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10613. *
  10614. * @static
  10615. * @memberOf _
  10616. * @since 2.4.0
  10617. * @category Date
  10618. * @returns {number} Returns the timestamp.
  10619. * @example
  10620. *
  10621. * _.defer(function(stamp) {
  10622. * console.log(_.now() - stamp);
  10623. * }, _.now());
  10624. * // => Logs the number of milliseconds it took for the deferred invocation.
  10625. */
  10626. var now = ctxNow || function() {
  10627. return root.Date.now();
  10628. };
  10629. /*------------------------------------------------------------------------*/
  10630. /**
  10631. * The opposite of `_.before`; this method creates a function that invokes
  10632. * `func` once it's called `n` or more times.
  10633. *
  10634. * @static
  10635. * @memberOf _
  10636. * @since 0.1.0
  10637. * @category Function
  10638. * @param {number} n The number of calls before `func` is invoked.
  10639. * @param {Function} func The function to restrict.
  10640. * @returns {Function} Returns the new restricted function.
  10641. * @example
  10642. *
  10643. * var saves = ['profile', 'settings'];
  10644. *
  10645. * var done = _.after(saves.length, function() {
  10646. * console.log('done saving!');
  10647. * });
  10648. *
  10649. * _.forEach(saves, function(type) {
  10650. * asyncSave({ 'type': type, 'complete': done });
  10651. * });
  10652. * // => Logs 'done saving!' after the two async saves have completed.
  10653. */
  10654. function after(n, func) {
  10655. if (typeof func != 'function') {
  10656. throw new TypeError(FUNC_ERROR_TEXT);
  10657. }
  10658. n = toInteger(n);
  10659. return function() {
  10660. if (--n < 1) {
  10661. return func.apply(this, arguments);
  10662. }
  10663. };
  10664. }
  10665. /**
  10666. * Creates a function that invokes `func`, with up to `n` arguments,
  10667. * ignoring any additional arguments.
  10668. *
  10669. * @static
  10670. * @memberOf _
  10671. * @since 3.0.0
  10672. * @category Function
  10673. * @param {Function} func The function to cap arguments for.
  10674. * @param {number} [n=func.length] The arity cap.
  10675. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10676. * @returns {Function} Returns the new capped function.
  10677. * @example
  10678. *
  10679. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10680. * // => [6, 8, 10]
  10681. */
  10682. function ary(func, n, guard) {
  10683. n = guard ? undefined : n;
  10684. n = (func && n == null) ? func.length : n;
  10685. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10686. }
  10687. /**
  10688. * Creates a function that invokes `func`, with the `this` binding and arguments
  10689. * of the created function, while it's called less than `n` times. Subsequent
  10690. * calls to the created function return the result of the last `func` invocation.
  10691. *
  10692. * @static
  10693. * @memberOf _
  10694. * @since 3.0.0
  10695. * @category Function
  10696. * @param {number} n The number of calls at which `func` is no longer invoked.
  10697. * @param {Function} func The function to restrict.
  10698. * @returns {Function} Returns the new restricted function.
  10699. * @example
  10700. *
  10701. * jQuery(element).on('click', _.before(5, addContactToList));
  10702. * // => Allows adding up to 4 contacts to the list.
  10703. */
  10704. function before(n, func) {
  10705. var result;
  10706. if (typeof func != 'function') {
  10707. throw new TypeError(FUNC_ERROR_TEXT);
  10708. }
  10709. n = toInteger(n);
  10710. return function() {
  10711. if (--n > 0) {
  10712. result = func.apply(this, arguments);
  10713. }
  10714. if (n <= 1) {
  10715. func = undefined;
  10716. }
  10717. return result;
  10718. };
  10719. }
  10720. /**
  10721. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10722. * and `partials` prepended to the arguments it receives.
  10723. *
  10724. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10725. * may be used as a placeholder for partially applied arguments.
  10726. *
  10727. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10728. * property of bound functions.
  10729. *
  10730. * @static
  10731. * @memberOf _
  10732. * @since 0.1.0
  10733. * @category Function
  10734. * @param {Function} func The function to bind.
  10735. * @param {*} thisArg The `this` binding of `func`.
  10736. * @param {...*} [partials] The arguments to be partially applied.
  10737. * @returns {Function} Returns the new bound function.
  10738. * @example
  10739. *
  10740. * function greet(greeting, punctuation) {
  10741. * return greeting + ' ' + this.user + punctuation;
  10742. * }
  10743. *
  10744. * var object = { 'user': 'fred' };
  10745. *
  10746. * var bound = _.bind(greet, object, 'hi');
  10747. * bound('!');
  10748. * // => 'hi fred!'
  10749. *
  10750. * // Bound with placeholders.
  10751. * var bound = _.bind(greet, object, _, '!');
  10752. * bound('hi');
  10753. * // => 'hi fred!'
  10754. */
  10755. var bind = baseRest(function(func, thisArg, partials) {
  10756. var bitmask = WRAP_BIND_FLAG;
  10757. if (partials.length) {
  10758. var holders = replaceHolders(partials, getHolder(bind));
  10759. bitmask |= WRAP_PARTIAL_FLAG;
  10760. }
  10761. return createWrap(func, bitmask, thisArg, partials, holders);
  10762. });
  10763. /**
  10764. * Creates a function that invokes the method at `object[key]` with `partials`
  10765. * prepended to the arguments it receives.
  10766. *
  10767. * This method differs from `_.bind` by allowing bound functions to reference
  10768. * methods that may be redefined or don't yet exist. See
  10769. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10770. * for more details.
  10771. *
  10772. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10773. * builds, may be used as a placeholder for partially applied arguments.
  10774. *
  10775. * @static
  10776. * @memberOf _
  10777. * @since 0.10.0
  10778. * @category Function
  10779. * @param {Object} object The object to invoke the method on.
  10780. * @param {string} key The key of the method.
  10781. * @param {...*} [partials] The arguments to be partially applied.
  10782. * @returns {Function} Returns the new bound function.
  10783. * @example
  10784. *
  10785. * var object = {
  10786. * 'user': 'fred',
  10787. * 'greet': function(greeting, punctuation) {
  10788. * return greeting + ' ' + this.user + punctuation;
  10789. * }
  10790. * };
  10791. *
  10792. * var bound = _.bindKey(object, 'greet', 'hi');
  10793. * bound('!');
  10794. * // => 'hi fred!'
  10795. *
  10796. * object.greet = function(greeting, punctuation) {
  10797. * return greeting + 'ya ' + this.user + punctuation;
  10798. * };
  10799. *
  10800. * bound('!');
  10801. * // => 'hiya fred!'
  10802. *
  10803. * // Bound with placeholders.
  10804. * var bound = _.bindKey(object, 'greet', _, '!');
  10805. * bound('hi');
  10806. * // => 'hiya fred!'
  10807. */
  10808. var bindKey = baseRest(function(object, key, partials) {
  10809. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10810. if (partials.length) {
  10811. var holders = replaceHolders(partials, getHolder(bindKey));
  10812. bitmask |= WRAP_PARTIAL_FLAG;
  10813. }
  10814. return createWrap(key, bitmask, object, partials, holders);
  10815. });
  10816. /**
  10817. * Creates a function that accepts arguments of `func` and either invokes
  10818. * `func` returning its result, if at least `arity` number of arguments have
  10819. * been provided, or returns a function that accepts the remaining `func`
  10820. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10821. * is not sufficient.
  10822. *
  10823. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10824. * may be used as a placeholder for provided arguments.
  10825. *
  10826. * **Note:** This method doesn't set the "length" property of curried functions.
  10827. *
  10828. * @static
  10829. * @memberOf _
  10830. * @since 2.0.0
  10831. * @category Function
  10832. * @param {Function} func The function to curry.
  10833. * @param {number} [arity=func.length] The arity of `func`.
  10834. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10835. * @returns {Function} Returns the new curried function.
  10836. * @example
  10837. *
  10838. * var abc = function(a, b, c) {
  10839. * return [a, b, c];
  10840. * };
  10841. *
  10842. * var curried = _.curry(abc);
  10843. *
  10844. * curried(1)(2)(3);
  10845. * // => [1, 2, 3]
  10846. *
  10847. * curried(1, 2)(3);
  10848. * // => [1, 2, 3]
  10849. *
  10850. * curried(1, 2, 3);
  10851. * // => [1, 2, 3]
  10852. *
  10853. * // Curried with placeholders.
  10854. * curried(1)(_, 3)(2);
  10855. * // => [1, 2, 3]
  10856. */
  10857. function curry(func, arity, guard) {
  10858. arity = guard ? undefined : arity;
  10859. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10860. result.placeholder = curry.placeholder;
  10861. return result;
  10862. }
  10863. /**
  10864. * This method is like `_.curry` except that arguments are applied to `func`
  10865. * in the manner of `_.partialRight` instead of `_.partial`.
  10866. *
  10867. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10868. * builds, may be used as a placeholder for provided arguments.
  10869. *
  10870. * **Note:** This method doesn't set the "length" property of curried functions.
  10871. *
  10872. * @static
  10873. * @memberOf _
  10874. * @since 3.0.0
  10875. * @category Function
  10876. * @param {Function} func The function to curry.
  10877. * @param {number} [arity=func.length] The arity of `func`.
  10878. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10879. * @returns {Function} Returns the new curried function.
  10880. * @example
  10881. *
  10882. * var abc = function(a, b, c) {
  10883. * return [a, b, c];
  10884. * };
  10885. *
  10886. * var curried = _.curryRight(abc);
  10887. *
  10888. * curried(3)(2)(1);
  10889. * // => [1, 2, 3]
  10890. *
  10891. * curried(2, 3)(1);
  10892. * // => [1, 2, 3]
  10893. *
  10894. * curried(1, 2, 3);
  10895. * // => [1, 2, 3]
  10896. *
  10897. * // Curried with placeholders.
  10898. * curried(3)(1, _)(2);
  10899. * // => [1, 2, 3]
  10900. */
  10901. function curryRight(func, arity, guard) {
  10902. arity = guard ? undefined : arity;
  10903. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10904. result.placeholder = curryRight.placeholder;
  10905. return result;
  10906. }
  10907. /**
  10908. * Creates a debounced function that delays invoking `func` until after `wait`
  10909. * milliseconds have elapsed since the last time the debounced function was
  10910. * invoked. The debounced function comes with a `cancel` method to cancel
  10911. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10912. * Provide `options` to indicate whether `func` should be invoked on the
  10913. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10914. * with the last arguments provided to the debounced function. Subsequent
  10915. * calls to the debounced function return the result of the last `func`
  10916. * invocation.
  10917. *
  10918. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10919. * invoked on the trailing edge of the timeout only if the debounced function
  10920. * is invoked more than once during the `wait` timeout.
  10921. *
  10922. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10923. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10924. *
  10925. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10926. * for details over the differences between `_.debounce` and `_.throttle`.
  10927. *
  10928. * @static
  10929. * @memberOf _
  10930. * @since 0.1.0
  10931. * @category Function
  10932. * @param {Function} func The function to debounce.
  10933. * @param {number} [wait=0] The number of milliseconds to delay.
  10934. * @param {Object} [options={}] The options object.
  10935. * @param {boolean} [options.leading=false]
  10936. * Specify invoking on the leading edge of the timeout.
  10937. * @param {number} [options.maxWait]
  10938. * The maximum time `func` is allowed to be delayed before it's invoked.
  10939. * @param {boolean} [options.trailing=true]
  10940. * Specify invoking on the trailing edge of the timeout.
  10941. * @returns {Function} Returns the new debounced function.
  10942. * @example
  10943. *
  10944. * // Avoid costly calculations while the window size is in flux.
  10945. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10946. *
  10947. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10948. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10949. * 'leading': true,
  10950. * 'trailing': false
  10951. * }));
  10952. *
  10953. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10954. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10955. * var source = new EventSource('/stream');
  10956. * jQuery(source).on('message', debounced);
  10957. *
  10958. * // Cancel the trailing debounced invocation.
  10959. * jQuery(window).on('popstate', debounced.cancel);
  10960. */
  10961. function debounce(func, wait, options) {
  10962. var lastArgs,
  10963. lastThis,
  10964. maxWait,
  10965. result,
  10966. timerId,
  10967. lastCallTime,
  10968. lastInvokeTime = 0,
  10969. leading = false,
  10970. maxing = false,
  10971. trailing = true;
  10972. if (typeof func != 'function') {
  10973. throw new TypeError(FUNC_ERROR_TEXT);
  10974. }
  10975. wait = toNumber(wait) || 0;
  10976. if (isObject(options)) {
  10977. leading = !!options.leading;
  10978. maxing = 'maxWait' in options;
  10979. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10980. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10981. }
  10982. function invokeFunc(time) {
  10983. var args = lastArgs,
  10984. thisArg = lastThis;
  10985. lastArgs = lastThis = undefined;
  10986. lastInvokeTime = time;
  10987. result = func.apply(thisArg, args);
  10988. return result;
  10989. }
  10990. function leadingEdge(time) {
  10991. // Reset any `maxWait` timer.
  10992. lastInvokeTime = time;
  10993. // Start the timer for the trailing edge.
  10994. timerId = setTimeout(timerExpired, wait);
  10995. // Invoke the leading edge.
  10996. return leading ? invokeFunc(time) : result;
  10997. }
  10998. function remainingWait(time) {
  10999. var timeSinceLastCall = time - lastCallTime,
  11000. timeSinceLastInvoke = time - lastInvokeTime,
  11001. timeWaiting = wait - timeSinceLastCall;
  11002. return maxing
  11003. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11004. : timeWaiting;
  11005. }
  11006. function shouldInvoke(time) {
  11007. var timeSinceLastCall = time - lastCallTime,
  11008. timeSinceLastInvoke = time - lastInvokeTime;
  11009. // Either this is the first call, activity has stopped and we're at the
  11010. // trailing edge, the system time has gone backwards and we're treating
  11011. // it as the trailing edge, or we've hit the `maxWait` limit.
  11012. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11013. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11014. }
  11015. function timerExpired() {
  11016. var time = now();
  11017. if (shouldInvoke(time)) {
  11018. return trailingEdge(time);
  11019. }
  11020. // Restart the timer.
  11021. timerId = setTimeout(timerExpired, remainingWait(time));
  11022. }
  11023. function trailingEdge(time) {
  11024. timerId = undefined;
  11025. // Only invoke if we have `lastArgs` which means `func` has been
  11026. // debounced at least once.
  11027. if (trailing && lastArgs) {
  11028. return invokeFunc(time);
  11029. }
  11030. lastArgs = lastThis = undefined;
  11031. return result;
  11032. }
  11033. function cancel() {
  11034. if (timerId !== undefined) {
  11035. clearTimeout(timerId);
  11036. }
  11037. lastInvokeTime = 0;
  11038. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11039. }
  11040. function flush() {
  11041. return timerId === undefined ? result : trailingEdge(now());
  11042. }
  11043. function debounced() {
  11044. var time = now(),
  11045. isInvoking = shouldInvoke(time);
  11046. lastArgs = arguments;
  11047. lastThis = this;
  11048. lastCallTime = time;
  11049. if (isInvoking) {
  11050. if (timerId === undefined) {
  11051. return leadingEdge(lastCallTime);
  11052. }
  11053. if (maxing) {
  11054. // Handle invocations in a tight loop.
  11055. clearTimeout(timerId);
  11056. timerId = setTimeout(timerExpired, wait);
  11057. return invokeFunc(lastCallTime);
  11058. }
  11059. }
  11060. if (timerId === undefined) {
  11061. timerId = setTimeout(timerExpired, wait);
  11062. }
  11063. return result;
  11064. }
  11065. debounced.cancel = cancel;
  11066. debounced.flush = flush;
  11067. return debounced;
  11068. }
  11069. /**
  11070. * Defers invoking the `func` until the current call stack has cleared. Any
  11071. * additional arguments are provided to `func` when it's invoked.
  11072. *
  11073. * @static
  11074. * @memberOf _
  11075. * @since 0.1.0
  11076. * @category Function
  11077. * @param {Function} func The function to defer.
  11078. * @param {...*} [args] The arguments to invoke `func` with.
  11079. * @returns {number} Returns the timer id.
  11080. * @example
  11081. *
  11082. * _.defer(function(text) {
  11083. * console.log(text);
  11084. * }, 'deferred');
  11085. * // => Logs 'deferred' after one millisecond.
  11086. */
  11087. var defer = baseRest(function(func, args) {
  11088. return baseDelay(func, 1, args);
  11089. });
  11090. /**
  11091. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11092. * provided to `func` when it's invoked.
  11093. *
  11094. * @static
  11095. * @memberOf _
  11096. * @since 0.1.0
  11097. * @category Function
  11098. * @param {Function} func The function to delay.
  11099. * @param {number} wait The number of milliseconds to delay invocation.
  11100. * @param {...*} [args] The arguments to invoke `func` with.
  11101. * @returns {number} Returns the timer id.
  11102. * @example
  11103. *
  11104. * _.delay(function(text) {
  11105. * console.log(text);
  11106. * }, 1000, 'later');
  11107. * // => Logs 'later' after one second.
  11108. */
  11109. var delay = baseRest(function(func, wait, args) {
  11110. return baseDelay(func, toNumber(wait) || 0, args);
  11111. });
  11112. /**
  11113. * Creates a function that invokes `func` with arguments reversed.
  11114. *
  11115. * @static
  11116. * @memberOf _
  11117. * @since 4.0.0
  11118. * @category Function
  11119. * @param {Function} func The function to flip arguments for.
  11120. * @returns {Function} Returns the new flipped function.
  11121. * @example
  11122. *
  11123. * var flipped = _.flip(function() {
  11124. * return _.toArray(arguments);
  11125. * });
  11126. *
  11127. * flipped('a', 'b', 'c', 'd');
  11128. * // => ['d', 'c', 'b', 'a']
  11129. */
  11130. function flip(func) {
  11131. return createWrap(func, WRAP_FLIP_FLAG);
  11132. }
  11133. /**
  11134. * Creates a function that memoizes the result of `func`. If `resolver` is
  11135. * provided, it determines the cache key for storing the result based on the
  11136. * arguments provided to the memoized function. By default, the first argument
  11137. * provided to the memoized function is used as the map cache key. The `func`
  11138. * is invoked with the `this` binding of the memoized function.
  11139. *
  11140. * **Note:** The cache is exposed as the `cache` property on the memoized
  11141. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11142. * constructor with one whose instances implement the
  11143. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11144. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11145. *
  11146. * @static
  11147. * @memberOf _
  11148. * @since 0.1.0
  11149. * @category Function
  11150. * @param {Function} func The function to have its output memoized.
  11151. * @param {Function} [resolver] The function to resolve the cache key.
  11152. * @returns {Function} Returns the new memoized function.
  11153. * @example
  11154. *
  11155. * var object = { 'a': 1, 'b': 2 };
  11156. * var other = { 'c': 3, 'd': 4 };
  11157. *
  11158. * var values = _.memoize(_.values);
  11159. * values(object);
  11160. * // => [1, 2]
  11161. *
  11162. * values(other);
  11163. * // => [3, 4]
  11164. *
  11165. * object.a = 2;
  11166. * values(object);
  11167. * // => [1, 2]
  11168. *
  11169. * // Modify the result cache.
  11170. * values.cache.set(object, ['a', 'b']);
  11171. * values(object);
  11172. * // => ['a', 'b']
  11173. *
  11174. * // Replace `_.memoize.Cache`.
  11175. * _.memoize.Cache = WeakMap;
  11176. */
  11177. function memoize(func, resolver) {
  11178. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11179. throw new TypeError(FUNC_ERROR_TEXT);
  11180. }
  11181. var memoized = function() {
  11182. var args = arguments,
  11183. key = resolver ? resolver.apply(this, args) : args[0],
  11184. cache = memoized.cache;
  11185. if (cache.has(key)) {
  11186. return cache.get(key);
  11187. }
  11188. var result = func.apply(this, args);
  11189. memoized.cache = cache.set(key, result) || cache;
  11190. return result;
  11191. };
  11192. memoized.cache = new (memoize.Cache || MapCache);
  11193. return memoized;
  11194. }
  11195. // Expose `MapCache`.
  11196. memoize.Cache = MapCache;
  11197. /**
  11198. * Creates a function that negates the result of the predicate `func`. The
  11199. * `func` predicate is invoked with the `this` binding and arguments of the
  11200. * created function.
  11201. *
  11202. * @static
  11203. * @memberOf _
  11204. * @since 3.0.0
  11205. * @category Function
  11206. * @param {Function} predicate The predicate to negate.
  11207. * @returns {Function} Returns the new negated function.
  11208. * @example
  11209. *
  11210. * function isEven(n) {
  11211. * return n % 2 == 0;
  11212. * }
  11213. *
  11214. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11215. * // => [1, 3, 5]
  11216. */
  11217. function negate(predicate) {
  11218. if (typeof predicate != 'function') {
  11219. throw new TypeError(FUNC_ERROR_TEXT);
  11220. }
  11221. return function() {
  11222. var args = arguments;
  11223. switch (args.length) {
  11224. case 0: return !predicate.call(this);
  11225. case 1: return !predicate.call(this, args[0]);
  11226. case 2: return !predicate.call(this, args[0], args[1]);
  11227. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11228. }
  11229. return !predicate.apply(this, args);
  11230. };
  11231. }
  11232. /**
  11233. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11234. * to the function return the value of the first invocation. The `func` is
  11235. * invoked with the `this` binding and arguments of the created function.
  11236. *
  11237. * @static
  11238. * @memberOf _
  11239. * @since 0.1.0
  11240. * @category Function
  11241. * @param {Function} func The function to restrict.
  11242. * @returns {Function} Returns the new restricted function.
  11243. * @example
  11244. *
  11245. * var initialize = _.once(createApplication);
  11246. * initialize();
  11247. * initialize();
  11248. * // => `createApplication` is invoked once
  11249. */
  11250. function once(func) {
  11251. return before(2, func);
  11252. }
  11253. /**
  11254. * Creates a function that invokes `func` with its arguments transformed.
  11255. *
  11256. * @static
  11257. * @since 4.0.0
  11258. * @memberOf _
  11259. * @category Function
  11260. * @param {Function} func The function to wrap.
  11261. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11262. * The argument transforms.
  11263. * @returns {Function} Returns the new function.
  11264. * @example
  11265. *
  11266. * function doubled(n) {
  11267. * return n * 2;
  11268. * }
  11269. *
  11270. * function square(n) {
  11271. * return n * n;
  11272. * }
  11273. *
  11274. * var func = _.overArgs(function(x, y) {
  11275. * return [x, y];
  11276. * }, [square, doubled]);
  11277. *
  11278. * func(9, 3);
  11279. * // => [81, 6]
  11280. *
  11281. * func(10, 5);
  11282. * // => [100, 10]
  11283. */
  11284. var overArgs = castRest(function(func, transforms) {
  11285. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11286. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11287. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11288. var funcsLength = transforms.length;
  11289. return baseRest(function(args) {
  11290. var index = -1,
  11291. length = nativeMin(args.length, funcsLength);
  11292. while (++index < length) {
  11293. args[index] = transforms[index].call(this, args[index]);
  11294. }
  11295. return apply(func, this, args);
  11296. });
  11297. });
  11298. /**
  11299. * Creates a function that invokes `func` with `partials` prepended to the
  11300. * arguments it receives. This method is like `_.bind` except it does **not**
  11301. * alter the `this` binding.
  11302. *
  11303. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11304. * builds, may be used as a placeholder for partially applied arguments.
  11305. *
  11306. * **Note:** This method doesn't set the "length" property of partially
  11307. * applied functions.
  11308. *
  11309. * @static
  11310. * @memberOf _
  11311. * @since 0.2.0
  11312. * @category Function
  11313. * @param {Function} func The function to partially apply arguments to.
  11314. * @param {...*} [partials] The arguments to be partially applied.
  11315. * @returns {Function} Returns the new partially applied function.
  11316. * @example
  11317. *
  11318. * function greet(greeting, name) {
  11319. * return greeting + ' ' + name;
  11320. * }
  11321. *
  11322. * var sayHelloTo = _.partial(greet, 'hello');
  11323. * sayHelloTo('fred');
  11324. * // => 'hello fred'
  11325. *
  11326. * // Partially applied with placeholders.
  11327. * var greetFred = _.partial(greet, _, 'fred');
  11328. * greetFred('hi');
  11329. * // => 'hi fred'
  11330. */
  11331. var partial = baseRest(function(func, partials) {
  11332. var holders = replaceHolders(partials, getHolder(partial));
  11333. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11334. });
  11335. /**
  11336. * This method is like `_.partial` except that partially applied arguments
  11337. * are appended to the arguments it receives.
  11338. *
  11339. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11340. * builds, may be used as a placeholder for partially applied arguments.
  11341. *
  11342. * **Note:** This method doesn't set the "length" property of partially
  11343. * applied functions.
  11344. *
  11345. * @static
  11346. * @memberOf _
  11347. * @since 1.0.0
  11348. * @category Function
  11349. * @param {Function} func The function to partially apply arguments to.
  11350. * @param {...*} [partials] The arguments to be partially applied.
  11351. * @returns {Function} Returns the new partially applied function.
  11352. * @example
  11353. *
  11354. * function greet(greeting, name) {
  11355. * return greeting + ' ' + name;
  11356. * }
  11357. *
  11358. * var greetFred = _.partialRight(greet, 'fred');
  11359. * greetFred('hi');
  11360. * // => 'hi fred'
  11361. *
  11362. * // Partially applied with placeholders.
  11363. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11364. * sayHelloTo('fred');
  11365. * // => 'hello fred'
  11366. */
  11367. var partialRight = baseRest(function(func, partials) {
  11368. var holders = replaceHolders(partials, getHolder(partialRight));
  11369. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11370. });
  11371. /**
  11372. * Creates a function that invokes `func` with arguments arranged according
  11373. * to the specified `indexes` where the argument value at the first index is
  11374. * provided as the first argument, the argument value at the second index is
  11375. * provided as the second argument, and so on.
  11376. *
  11377. * @static
  11378. * @memberOf _
  11379. * @since 3.0.0
  11380. * @category Function
  11381. * @param {Function} func The function to rearrange arguments for.
  11382. * @param {...(number|number[])} indexes The arranged argument indexes.
  11383. * @returns {Function} Returns the new function.
  11384. * @example
  11385. *
  11386. * var rearged = _.rearg(function(a, b, c) {
  11387. * return [a, b, c];
  11388. * }, [2, 0, 1]);
  11389. *
  11390. * rearged('b', 'c', 'a')
  11391. * // => ['a', 'b', 'c']
  11392. */
  11393. var rearg = flatRest(function(func, indexes) {
  11394. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11395. });
  11396. /**
  11397. * Creates a function that invokes `func` with the `this` binding of the
  11398. * created function and arguments from `start` and beyond provided as
  11399. * an array.
  11400. *
  11401. * **Note:** This method is based on the
  11402. * [rest parameter](https://mdn.io/rest_parameters).
  11403. *
  11404. * @static
  11405. * @memberOf _
  11406. * @since 4.0.0
  11407. * @category Function
  11408. * @param {Function} func The function to apply a rest parameter to.
  11409. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11410. * @returns {Function} Returns the new function.
  11411. * @example
  11412. *
  11413. * var say = _.rest(function(what, names) {
  11414. * return what + ' ' + _.initial(names).join(', ') +
  11415. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11416. * });
  11417. *
  11418. * say('hello', 'fred', 'barney', 'pebbles');
  11419. * // => 'hello fred, barney, & pebbles'
  11420. */
  11421. function rest(func, start) {
  11422. if (typeof func != 'function') {
  11423. throw new TypeError(FUNC_ERROR_TEXT);
  11424. }
  11425. start = start === undefined ? start : toInteger(start);
  11426. return baseRest(func, start);
  11427. }
  11428. /**
  11429. * Creates a function that invokes `func` with the `this` binding of the
  11430. * create function and an array of arguments much like
  11431. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11432. *
  11433. * **Note:** This method is based on the
  11434. * [spread operator](https://mdn.io/spread_operator).
  11435. *
  11436. * @static
  11437. * @memberOf _
  11438. * @since 3.2.0
  11439. * @category Function
  11440. * @param {Function} func The function to spread arguments over.
  11441. * @param {number} [start=0] The start position of the spread.
  11442. * @returns {Function} Returns the new function.
  11443. * @example
  11444. *
  11445. * var say = _.spread(function(who, what) {
  11446. * return who + ' says ' + what;
  11447. * });
  11448. *
  11449. * say(['fred', 'hello']);
  11450. * // => 'fred says hello'
  11451. *
  11452. * var numbers = Promise.all([
  11453. * Promise.resolve(40),
  11454. * Promise.resolve(36)
  11455. * ]);
  11456. *
  11457. * numbers.then(_.spread(function(x, y) {
  11458. * return x + y;
  11459. * }));
  11460. * // => a Promise of 76
  11461. */
  11462. function spread(func, start) {
  11463. if (typeof func != 'function') {
  11464. throw new TypeError(FUNC_ERROR_TEXT);
  11465. }
  11466. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11467. return baseRest(function(args) {
  11468. var array = args[start],
  11469. otherArgs = castSlice(args, 0, start);
  11470. if (array) {
  11471. arrayPush(otherArgs, array);
  11472. }
  11473. return apply(func, this, otherArgs);
  11474. });
  11475. }
  11476. /**
  11477. * Creates a throttled function that only invokes `func` at most once per
  11478. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11479. * method to cancel delayed `func` invocations and a `flush` method to
  11480. * immediately invoke them. Provide `options` to indicate whether `func`
  11481. * should be invoked on the leading and/or trailing edge of the `wait`
  11482. * timeout. The `func` is invoked with the last arguments provided to the
  11483. * throttled function. Subsequent calls to the throttled function return the
  11484. * result of the last `func` invocation.
  11485. *
  11486. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11487. * invoked on the trailing edge of the timeout only if the throttled function
  11488. * is invoked more than once during the `wait` timeout.
  11489. *
  11490. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11491. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11492. *
  11493. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11494. * for details over the differences between `_.throttle` and `_.debounce`.
  11495. *
  11496. * @static
  11497. * @memberOf _
  11498. * @since 0.1.0
  11499. * @category Function
  11500. * @param {Function} func The function to throttle.
  11501. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11502. * @param {Object} [options={}] The options object.
  11503. * @param {boolean} [options.leading=true]
  11504. * Specify invoking on the leading edge of the timeout.
  11505. * @param {boolean} [options.trailing=true]
  11506. * Specify invoking on the trailing edge of the timeout.
  11507. * @returns {Function} Returns the new throttled function.
  11508. * @example
  11509. *
  11510. * // Avoid excessively updating the position while scrolling.
  11511. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11512. *
  11513. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11514. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11515. * jQuery(element).on('click', throttled);
  11516. *
  11517. * // Cancel the trailing throttled invocation.
  11518. * jQuery(window).on('popstate', throttled.cancel);
  11519. */
  11520. function throttle(func, wait, options) {
  11521. var leading = true,
  11522. trailing = true;
  11523. if (typeof func != 'function') {
  11524. throw new TypeError(FUNC_ERROR_TEXT);
  11525. }
  11526. if (isObject(options)) {
  11527. leading = 'leading' in options ? !!options.leading : leading;
  11528. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11529. }
  11530. return debounce(func, wait, {
  11531. 'leading': leading,
  11532. 'maxWait': wait,
  11533. 'trailing': trailing
  11534. });
  11535. }
  11536. /**
  11537. * Creates a function that accepts up to one argument, ignoring any
  11538. * additional arguments.
  11539. *
  11540. * @static
  11541. * @memberOf _
  11542. * @since 4.0.0
  11543. * @category Function
  11544. * @param {Function} func The function to cap arguments for.
  11545. * @returns {Function} Returns the new capped function.
  11546. * @example
  11547. *
  11548. * _.map(['6', '8', '10'], _.unary(parseInt));
  11549. * // => [6, 8, 10]
  11550. */
  11551. function unary(func) {
  11552. return ary(func, 1);
  11553. }
  11554. /**
  11555. * Creates a function that provides `value` to `wrapper` as its first
  11556. * argument. Any additional arguments provided to the function are appended
  11557. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11558. * binding of the created function.
  11559. *
  11560. * @static
  11561. * @memberOf _
  11562. * @since 0.1.0
  11563. * @category Function
  11564. * @param {*} value The value to wrap.
  11565. * @param {Function} [wrapper=identity] The wrapper function.
  11566. * @returns {Function} Returns the new function.
  11567. * @example
  11568. *
  11569. * var p = _.wrap(_.escape, function(func, text) {
  11570. * return '<p>' + func(text) + '</p>';
  11571. * });
  11572. *
  11573. * p('fred, barney, & pebbles');
  11574. * // => '<p>fred, barney, &amp; pebbles</p>'
  11575. */
  11576. function wrap(value, wrapper) {
  11577. return partial(castFunction(wrapper), value);
  11578. }
  11579. /*------------------------------------------------------------------------*/
  11580. /**
  11581. * Casts `value` as an array if it's not one.
  11582. *
  11583. * @static
  11584. * @memberOf _
  11585. * @since 4.4.0
  11586. * @category Lang
  11587. * @param {*} value The value to inspect.
  11588. * @returns {Array} Returns the cast array.
  11589. * @example
  11590. *
  11591. * _.castArray(1);
  11592. * // => [1]
  11593. *
  11594. * _.castArray({ 'a': 1 });
  11595. * // => [{ 'a': 1 }]
  11596. *
  11597. * _.castArray('abc');
  11598. * // => ['abc']
  11599. *
  11600. * _.castArray(null);
  11601. * // => [null]
  11602. *
  11603. * _.castArray(undefined);
  11604. * // => [undefined]
  11605. *
  11606. * _.castArray();
  11607. * // => []
  11608. *
  11609. * var array = [1, 2, 3];
  11610. * console.log(_.castArray(array) === array);
  11611. * // => true
  11612. */
  11613. function castArray() {
  11614. if (!arguments.length) {
  11615. return [];
  11616. }
  11617. var value = arguments[0];
  11618. return isArray(value) ? value : [value];
  11619. }
  11620. /**
  11621. * Creates a shallow clone of `value`.
  11622. *
  11623. * **Note:** This method is loosely based on the
  11624. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11625. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11626. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11627. * arrays. The own enumerable properties of `arguments` objects are cloned
  11628. * as plain objects. An empty object is returned for uncloneable values such
  11629. * as error objects, functions, DOM nodes, and WeakMaps.
  11630. *
  11631. * @static
  11632. * @memberOf _
  11633. * @since 0.1.0
  11634. * @category Lang
  11635. * @param {*} value The value to clone.
  11636. * @returns {*} Returns the cloned value.
  11637. * @see _.cloneDeep
  11638. * @example
  11639. *
  11640. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11641. *
  11642. * var shallow = _.clone(objects);
  11643. * console.log(shallow[0] === objects[0]);
  11644. * // => true
  11645. */
  11646. function clone(value) {
  11647. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11648. }
  11649. /**
  11650. * This method is like `_.clone` except that it accepts `customizer` which
  11651. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11652. * cloning is handled by the method instead. The `customizer` is invoked with
  11653. * up to four arguments; (value [, index|key, object, stack]).
  11654. *
  11655. * @static
  11656. * @memberOf _
  11657. * @since 4.0.0
  11658. * @category Lang
  11659. * @param {*} value The value to clone.
  11660. * @param {Function} [customizer] The function to customize cloning.
  11661. * @returns {*} Returns the cloned value.
  11662. * @see _.cloneDeepWith
  11663. * @example
  11664. *
  11665. * function customizer(value) {
  11666. * if (_.isElement(value)) {
  11667. * return value.cloneNode(false);
  11668. * }
  11669. * }
  11670. *
  11671. * var el = _.cloneWith(document.body, customizer);
  11672. *
  11673. * console.log(el === document.body);
  11674. * // => false
  11675. * console.log(el.nodeName);
  11676. * // => 'BODY'
  11677. * console.log(el.childNodes.length);
  11678. * // => 0
  11679. */
  11680. function cloneWith(value, customizer) {
  11681. customizer = typeof customizer == 'function' ? customizer : undefined;
  11682. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11683. }
  11684. /**
  11685. * This method is like `_.clone` except that it recursively clones `value`.
  11686. *
  11687. * @static
  11688. * @memberOf _
  11689. * @since 1.0.0
  11690. * @category Lang
  11691. * @param {*} value The value to recursively clone.
  11692. * @returns {*} Returns the deep cloned value.
  11693. * @see _.clone
  11694. * @example
  11695. *
  11696. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11697. *
  11698. * var deep = _.cloneDeep(objects);
  11699. * console.log(deep[0] === objects[0]);
  11700. * // => false
  11701. */
  11702. function cloneDeep(value) {
  11703. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11704. }
  11705. /**
  11706. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11707. *
  11708. * @static
  11709. * @memberOf _
  11710. * @since 4.0.0
  11711. * @category Lang
  11712. * @param {*} value The value to recursively clone.
  11713. * @param {Function} [customizer] The function to customize cloning.
  11714. * @returns {*} Returns the deep cloned value.
  11715. * @see _.cloneWith
  11716. * @example
  11717. *
  11718. * function customizer(value) {
  11719. * if (_.isElement(value)) {
  11720. * return value.cloneNode(true);
  11721. * }
  11722. * }
  11723. *
  11724. * var el = _.cloneDeepWith(document.body, customizer);
  11725. *
  11726. * console.log(el === document.body);
  11727. * // => false
  11728. * console.log(el.nodeName);
  11729. * // => 'BODY'
  11730. * console.log(el.childNodes.length);
  11731. * // => 20
  11732. */
  11733. function cloneDeepWith(value, customizer) {
  11734. customizer = typeof customizer == 'function' ? customizer : undefined;
  11735. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11736. }
  11737. /**
  11738. * Checks if `object` conforms to `source` by invoking the predicate
  11739. * properties of `source` with the corresponding property values of `object`.
  11740. *
  11741. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11742. * partially applied.
  11743. *
  11744. * @static
  11745. * @memberOf _
  11746. * @since 4.14.0
  11747. * @category Lang
  11748. * @param {Object} object The object to inspect.
  11749. * @param {Object} source The object of property predicates to conform to.
  11750. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11751. * @example
  11752. *
  11753. * var object = { 'a': 1, 'b': 2 };
  11754. *
  11755. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11756. * // => true
  11757. *
  11758. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11759. * // => false
  11760. */
  11761. function conformsTo(object, source) {
  11762. return source == null || baseConformsTo(object, source, keys(source));
  11763. }
  11764. /**
  11765. * Performs a
  11766. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11767. * comparison between two values to determine if they are equivalent.
  11768. *
  11769. * @static
  11770. * @memberOf _
  11771. * @since 4.0.0
  11772. * @category Lang
  11773. * @param {*} value The value to compare.
  11774. * @param {*} other The other value to compare.
  11775. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11776. * @example
  11777. *
  11778. * var object = { 'a': 1 };
  11779. * var other = { 'a': 1 };
  11780. *
  11781. * _.eq(object, object);
  11782. * // => true
  11783. *
  11784. * _.eq(object, other);
  11785. * // => false
  11786. *
  11787. * _.eq('a', 'a');
  11788. * // => true
  11789. *
  11790. * _.eq('a', Object('a'));
  11791. * // => false
  11792. *
  11793. * _.eq(NaN, NaN);
  11794. * // => true
  11795. */
  11796. function eq(value, other) {
  11797. return value === other || (value !== value && other !== other);
  11798. }
  11799. /**
  11800. * Checks if `value` is greater than `other`.
  11801. *
  11802. * @static
  11803. * @memberOf _
  11804. * @since 3.9.0
  11805. * @category Lang
  11806. * @param {*} value The value to compare.
  11807. * @param {*} other The other value to compare.
  11808. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11809. * else `false`.
  11810. * @see _.lt
  11811. * @example
  11812. *
  11813. * _.gt(3, 1);
  11814. * // => true
  11815. *
  11816. * _.gt(3, 3);
  11817. * // => false
  11818. *
  11819. * _.gt(1, 3);
  11820. * // => false
  11821. */
  11822. var gt = createRelationalOperation(baseGt);
  11823. /**
  11824. * Checks if `value` is greater than or equal to `other`.
  11825. *
  11826. * @static
  11827. * @memberOf _
  11828. * @since 3.9.0
  11829. * @category Lang
  11830. * @param {*} value The value to compare.
  11831. * @param {*} other The other value to compare.
  11832. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11833. * `other`, else `false`.
  11834. * @see _.lte
  11835. * @example
  11836. *
  11837. * _.gte(3, 1);
  11838. * // => true
  11839. *
  11840. * _.gte(3, 3);
  11841. * // => true
  11842. *
  11843. * _.gte(1, 3);
  11844. * // => false
  11845. */
  11846. var gte = createRelationalOperation(function(value, other) {
  11847. return value >= other;
  11848. });
  11849. /**
  11850. * Checks if `value` is likely an `arguments` object.
  11851. *
  11852. * @static
  11853. * @memberOf _
  11854. * @since 0.1.0
  11855. * @category Lang
  11856. * @param {*} value The value to check.
  11857. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11858. * else `false`.
  11859. * @example
  11860. *
  11861. * _.isArguments(function() { return arguments; }());
  11862. * // => true
  11863. *
  11864. * _.isArguments([1, 2, 3]);
  11865. * // => false
  11866. */
  11867. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11868. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11869. !propertyIsEnumerable.call(value, 'callee');
  11870. };
  11871. /**
  11872. * Checks if `value` is classified as an `Array` object.
  11873. *
  11874. * @static
  11875. * @memberOf _
  11876. * @since 0.1.0
  11877. * @category Lang
  11878. * @param {*} value The value to check.
  11879. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11880. * @example
  11881. *
  11882. * _.isArray([1, 2, 3]);
  11883. * // => true
  11884. *
  11885. * _.isArray(document.body.children);
  11886. * // => false
  11887. *
  11888. * _.isArray('abc');
  11889. * // => false
  11890. *
  11891. * _.isArray(_.noop);
  11892. * // => false
  11893. */
  11894. var isArray = Array.isArray;
  11895. /**
  11896. * Checks if `value` is classified as an `ArrayBuffer` object.
  11897. *
  11898. * @static
  11899. * @memberOf _
  11900. * @since 4.3.0
  11901. * @category Lang
  11902. * @param {*} value The value to check.
  11903. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11904. * @example
  11905. *
  11906. * _.isArrayBuffer(new ArrayBuffer(2));
  11907. * // => true
  11908. *
  11909. * _.isArrayBuffer(new Array(2));
  11910. * // => false
  11911. */
  11912. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11913. /**
  11914. * Checks if `value` is array-like. A value is considered array-like if it's
  11915. * not a function and has a `value.length` that's an integer greater than or
  11916. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11917. *
  11918. * @static
  11919. * @memberOf _
  11920. * @since 4.0.0
  11921. * @category Lang
  11922. * @param {*} value The value to check.
  11923. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11924. * @example
  11925. *
  11926. * _.isArrayLike([1, 2, 3]);
  11927. * // => true
  11928. *
  11929. * _.isArrayLike(document.body.children);
  11930. * // => true
  11931. *
  11932. * _.isArrayLike('abc');
  11933. * // => true
  11934. *
  11935. * _.isArrayLike(_.noop);
  11936. * // => false
  11937. */
  11938. function isArrayLike(value) {
  11939. return value != null && isLength(value.length) && !isFunction(value);
  11940. }
  11941. /**
  11942. * This method is like `_.isArrayLike` except that it also checks if `value`
  11943. * is an object.
  11944. *
  11945. * @static
  11946. * @memberOf _
  11947. * @since 4.0.0
  11948. * @category Lang
  11949. * @param {*} value The value to check.
  11950. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11951. * else `false`.
  11952. * @example
  11953. *
  11954. * _.isArrayLikeObject([1, 2, 3]);
  11955. * // => true
  11956. *
  11957. * _.isArrayLikeObject(document.body.children);
  11958. * // => true
  11959. *
  11960. * _.isArrayLikeObject('abc');
  11961. * // => false
  11962. *
  11963. * _.isArrayLikeObject(_.noop);
  11964. * // => false
  11965. */
  11966. function isArrayLikeObject(value) {
  11967. return isObjectLike(value) && isArrayLike(value);
  11968. }
  11969. /**
  11970. * Checks if `value` is classified as a boolean primitive or object.
  11971. *
  11972. * @static
  11973. * @memberOf _
  11974. * @since 0.1.0
  11975. * @category Lang
  11976. * @param {*} value The value to check.
  11977. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11978. * @example
  11979. *
  11980. * _.isBoolean(false);
  11981. * // => true
  11982. *
  11983. * _.isBoolean(null);
  11984. * // => false
  11985. */
  11986. function isBoolean(value) {
  11987. return value === true || value === false ||
  11988. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11989. }
  11990. /**
  11991. * Checks if `value` is a buffer.
  11992. *
  11993. * @static
  11994. * @memberOf _
  11995. * @since 4.3.0
  11996. * @category Lang
  11997. * @param {*} value The value to check.
  11998. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11999. * @example
  12000. *
  12001. * _.isBuffer(new Buffer(2));
  12002. * // => true
  12003. *
  12004. * _.isBuffer(new Uint8Array(2));
  12005. * // => false
  12006. */
  12007. var isBuffer = nativeIsBuffer || stubFalse;
  12008. /**
  12009. * Checks if `value` is classified as a `Date` object.
  12010. *
  12011. * @static
  12012. * @memberOf _
  12013. * @since 0.1.0
  12014. * @category Lang
  12015. * @param {*} value The value to check.
  12016. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12017. * @example
  12018. *
  12019. * _.isDate(new Date);
  12020. * // => true
  12021. *
  12022. * _.isDate('Mon April 23 2012');
  12023. * // => false
  12024. */
  12025. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12026. /**
  12027. * Checks if `value` is likely a DOM element.
  12028. *
  12029. * @static
  12030. * @memberOf _
  12031. * @since 0.1.0
  12032. * @category Lang
  12033. * @param {*} value The value to check.
  12034. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12035. * @example
  12036. *
  12037. * _.isElement(document.body);
  12038. * // => true
  12039. *
  12040. * _.isElement('<body>');
  12041. * // => false
  12042. */
  12043. function isElement(value) {
  12044. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12045. }
  12046. /**
  12047. * Checks if `value` is an empty object, collection, map, or set.
  12048. *
  12049. * Objects are considered empty if they have no own enumerable string keyed
  12050. * properties.
  12051. *
  12052. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12053. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12054. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12055. *
  12056. * @static
  12057. * @memberOf _
  12058. * @since 0.1.0
  12059. * @category Lang
  12060. * @param {*} value The value to check.
  12061. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12062. * @example
  12063. *
  12064. * _.isEmpty(null);
  12065. * // => true
  12066. *
  12067. * _.isEmpty(true);
  12068. * // => true
  12069. *
  12070. * _.isEmpty(1);
  12071. * // => true
  12072. *
  12073. * _.isEmpty([1, 2, 3]);
  12074. * // => false
  12075. *
  12076. * _.isEmpty({ 'a': 1 });
  12077. * // => false
  12078. */
  12079. function isEmpty(value) {
  12080. if (value == null) {
  12081. return true;
  12082. }
  12083. if (isArrayLike(value) &&
  12084. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12085. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12086. return !value.length;
  12087. }
  12088. var tag = getTag(value);
  12089. if (tag == mapTag || tag == setTag) {
  12090. return !value.size;
  12091. }
  12092. if (isPrototype(value)) {
  12093. return !baseKeys(value).length;
  12094. }
  12095. for (var key in value) {
  12096. if (hasOwnProperty.call(value, key)) {
  12097. return false;
  12098. }
  12099. }
  12100. return true;
  12101. }
  12102. /**
  12103. * Performs a deep comparison between two values to determine if they are
  12104. * equivalent.
  12105. *
  12106. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12107. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12108. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12109. * by their own, not inherited, enumerable properties. Functions and DOM
  12110. * nodes are compared by strict equality, i.e. `===`.
  12111. *
  12112. * @static
  12113. * @memberOf _
  12114. * @since 0.1.0
  12115. * @category Lang
  12116. * @param {*} value The value to compare.
  12117. * @param {*} other The other value to compare.
  12118. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12119. * @example
  12120. *
  12121. * var object = { 'a': 1 };
  12122. * var other = { 'a': 1 };
  12123. *
  12124. * _.isEqual(object, other);
  12125. * // => true
  12126. *
  12127. * object === other;
  12128. * // => false
  12129. */
  12130. function isEqual(value, other) {
  12131. return baseIsEqual(value, other);
  12132. }
  12133. /**
  12134. * This method is like `_.isEqual` except that it accepts `customizer` which
  12135. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12136. * are handled by the method instead. The `customizer` is invoked with up to
  12137. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12138. *
  12139. * @static
  12140. * @memberOf _
  12141. * @since 4.0.0
  12142. * @category Lang
  12143. * @param {*} value The value to compare.
  12144. * @param {*} other The other value to compare.
  12145. * @param {Function} [customizer] The function to customize comparisons.
  12146. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12147. * @example
  12148. *
  12149. * function isGreeting(value) {
  12150. * return /^h(?:i|ello)$/.test(value);
  12151. * }
  12152. *
  12153. * function customizer(objValue, othValue) {
  12154. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12155. * return true;
  12156. * }
  12157. * }
  12158. *
  12159. * var array = ['hello', 'goodbye'];
  12160. * var other = ['hi', 'goodbye'];
  12161. *
  12162. * _.isEqualWith(array, other, customizer);
  12163. * // => true
  12164. */
  12165. function isEqualWith(value, other, customizer) {
  12166. customizer = typeof customizer == 'function' ? customizer : undefined;
  12167. var result = customizer ? customizer(value, other) : undefined;
  12168. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12169. }
  12170. /**
  12171. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12172. * `SyntaxError`, `TypeError`, or `URIError` object.
  12173. *
  12174. * @static
  12175. * @memberOf _
  12176. * @since 3.0.0
  12177. * @category Lang
  12178. * @param {*} value The value to check.
  12179. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12180. * @example
  12181. *
  12182. * _.isError(new Error);
  12183. * // => true
  12184. *
  12185. * _.isError(Error);
  12186. * // => false
  12187. */
  12188. function isError(value) {
  12189. if (!isObjectLike(value)) {
  12190. return false;
  12191. }
  12192. var tag = baseGetTag(value);
  12193. return tag == errorTag || tag == domExcTag ||
  12194. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12195. }
  12196. /**
  12197. * Checks if `value` is a finite primitive number.
  12198. *
  12199. * **Note:** This method is based on
  12200. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12201. *
  12202. * @static
  12203. * @memberOf _
  12204. * @since 0.1.0
  12205. * @category Lang
  12206. * @param {*} value The value to check.
  12207. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12208. * @example
  12209. *
  12210. * _.isFinite(3);
  12211. * // => true
  12212. *
  12213. * _.isFinite(Number.MIN_VALUE);
  12214. * // => true
  12215. *
  12216. * _.isFinite(Infinity);
  12217. * // => false
  12218. *
  12219. * _.isFinite('3');
  12220. * // => false
  12221. */
  12222. function isFinite(value) {
  12223. return typeof value == 'number' && nativeIsFinite(value);
  12224. }
  12225. /**
  12226. * Checks if `value` is classified as a `Function` object.
  12227. *
  12228. * @static
  12229. * @memberOf _
  12230. * @since 0.1.0
  12231. * @category Lang
  12232. * @param {*} value The value to check.
  12233. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12234. * @example
  12235. *
  12236. * _.isFunction(_);
  12237. * // => true
  12238. *
  12239. * _.isFunction(/abc/);
  12240. * // => false
  12241. */
  12242. function isFunction(value) {
  12243. if (!isObject(value)) {
  12244. return false;
  12245. }
  12246. // The use of `Object#toString` avoids issues with the `typeof` operator
  12247. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12248. var tag = baseGetTag(value);
  12249. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12250. }
  12251. /**
  12252. * Checks if `value` is an integer.
  12253. *
  12254. * **Note:** This method is based on
  12255. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12256. *
  12257. * @static
  12258. * @memberOf _
  12259. * @since 4.0.0
  12260. * @category Lang
  12261. * @param {*} value The value to check.
  12262. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12263. * @example
  12264. *
  12265. * _.isInteger(3);
  12266. * // => true
  12267. *
  12268. * _.isInteger(Number.MIN_VALUE);
  12269. * // => false
  12270. *
  12271. * _.isInteger(Infinity);
  12272. * // => false
  12273. *
  12274. * _.isInteger('3');
  12275. * // => false
  12276. */
  12277. function isInteger(value) {
  12278. return typeof value == 'number' && value == toInteger(value);
  12279. }
  12280. /**
  12281. * Checks if `value` is a valid array-like length.
  12282. *
  12283. * **Note:** This method is loosely based on
  12284. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12285. *
  12286. * @static
  12287. * @memberOf _
  12288. * @since 4.0.0
  12289. * @category Lang
  12290. * @param {*} value The value to check.
  12291. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12292. * @example
  12293. *
  12294. * _.isLength(3);
  12295. * // => true
  12296. *
  12297. * _.isLength(Number.MIN_VALUE);
  12298. * // => false
  12299. *
  12300. * _.isLength(Infinity);
  12301. * // => false
  12302. *
  12303. * _.isLength('3');
  12304. * // => false
  12305. */
  12306. function isLength(value) {
  12307. return typeof value == 'number' &&
  12308. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12309. }
  12310. /**
  12311. * Checks if `value` is the
  12312. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12313. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12314. *
  12315. * @static
  12316. * @memberOf _
  12317. * @since 0.1.0
  12318. * @category Lang
  12319. * @param {*} value The value to check.
  12320. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12321. * @example
  12322. *
  12323. * _.isObject({});
  12324. * // => true
  12325. *
  12326. * _.isObject([1, 2, 3]);
  12327. * // => true
  12328. *
  12329. * _.isObject(_.noop);
  12330. * // => true
  12331. *
  12332. * _.isObject(null);
  12333. * // => false
  12334. */
  12335. function isObject(value) {
  12336. var type = typeof value;
  12337. return value != null && (type == 'object' || type == 'function');
  12338. }
  12339. /**
  12340. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12341. * and has a `typeof` result of "object".
  12342. *
  12343. * @static
  12344. * @memberOf _
  12345. * @since 4.0.0
  12346. * @category Lang
  12347. * @param {*} value The value to check.
  12348. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12349. * @example
  12350. *
  12351. * _.isObjectLike({});
  12352. * // => true
  12353. *
  12354. * _.isObjectLike([1, 2, 3]);
  12355. * // => true
  12356. *
  12357. * _.isObjectLike(_.noop);
  12358. * // => false
  12359. *
  12360. * _.isObjectLike(null);
  12361. * // => false
  12362. */
  12363. function isObjectLike(value) {
  12364. return value != null && typeof value == 'object';
  12365. }
  12366. /**
  12367. * Checks if `value` is classified as a `Map` object.
  12368. *
  12369. * @static
  12370. * @memberOf _
  12371. * @since 4.3.0
  12372. * @category Lang
  12373. * @param {*} value The value to check.
  12374. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12375. * @example
  12376. *
  12377. * _.isMap(new Map);
  12378. * // => true
  12379. *
  12380. * _.isMap(new WeakMap);
  12381. * // => false
  12382. */
  12383. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12384. /**
  12385. * Performs a partial deep comparison between `object` and `source` to
  12386. * determine if `object` contains equivalent property values.
  12387. *
  12388. * **Note:** This method is equivalent to `_.matches` when `source` is
  12389. * partially applied.
  12390. *
  12391. * Partial comparisons will match empty array and empty object `source`
  12392. * values against any array or object value, respectively. See `_.isEqual`
  12393. * for a list of supported value comparisons.
  12394. *
  12395. * @static
  12396. * @memberOf _
  12397. * @since 3.0.0
  12398. * @category Lang
  12399. * @param {Object} object The object to inspect.
  12400. * @param {Object} source The object of property values to match.
  12401. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12402. * @example
  12403. *
  12404. * var object = { 'a': 1, 'b': 2 };
  12405. *
  12406. * _.isMatch(object, { 'b': 2 });
  12407. * // => true
  12408. *
  12409. * _.isMatch(object, { 'b': 1 });
  12410. * // => false
  12411. */
  12412. function isMatch(object, source) {
  12413. return object === source || baseIsMatch(object, source, getMatchData(source));
  12414. }
  12415. /**
  12416. * This method is like `_.isMatch` except that it accepts `customizer` which
  12417. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12418. * are handled by the method instead. The `customizer` is invoked with five
  12419. * arguments: (objValue, srcValue, index|key, object, source).
  12420. *
  12421. * @static
  12422. * @memberOf _
  12423. * @since 4.0.0
  12424. * @category Lang
  12425. * @param {Object} object The object to inspect.
  12426. * @param {Object} source The object of property values to match.
  12427. * @param {Function} [customizer] The function to customize comparisons.
  12428. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12429. * @example
  12430. *
  12431. * function isGreeting(value) {
  12432. * return /^h(?:i|ello)$/.test(value);
  12433. * }
  12434. *
  12435. * function customizer(objValue, srcValue) {
  12436. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12437. * return true;
  12438. * }
  12439. * }
  12440. *
  12441. * var object = { 'greeting': 'hello' };
  12442. * var source = { 'greeting': 'hi' };
  12443. *
  12444. * _.isMatchWith(object, source, customizer);
  12445. * // => true
  12446. */
  12447. function isMatchWith(object, source, customizer) {
  12448. customizer = typeof customizer == 'function' ? customizer : undefined;
  12449. return baseIsMatch(object, source, getMatchData(source), customizer);
  12450. }
  12451. /**
  12452. * Checks if `value` is `NaN`.
  12453. *
  12454. * **Note:** This method is based on
  12455. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12456. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12457. * `undefined` and other non-number values.
  12458. *
  12459. * @static
  12460. * @memberOf _
  12461. * @since 0.1.0
  12462. * @category Lang
  12463. * @param {*} value The value to check.
  12464. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12465. * @example
  12466. *
  12467. * _.isNaN(NaN);
  12468. * // => true
  12469. *
  12470. * _.isNaN(new Number(NaN));
  12471. * // => true
  12472. *
  12473. * isNaN(undefined);
  12474. * // => true
  12475. *
  12476. * _.isNaN(undefined);
  12477. * // => false
  12478. */
  12479. function isNaN(value) {
  12480. // An `NaN` primitive is the only value that is not equal to itself.
  12481. // Perform the `toStringTag` check first to avoid errors with some
  12482. // ActiveX objects in IE.
  12483. return isNumber(value) && value != +value;
  12484. }
  12485. /**
  12486. * Checks if `value` is a pristine native function.
  12487. *
  12488. * **Note:** This method can't reliably detect native functions in the presence
  12489. * of the core-js package because core-js circumvents this kind of detection.
  12490. * Despite multiple requests, the core-js maintainer has made it clear: any
  12491. * attempt to fix the detection will be obstructed. As a result, we're left
  12492. * with little choice but to throw an error. Unfortunately, this also affects
  12493. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12494. * which rely on core-js.
  12495. *
  12496. * @static
  12497. * @memberOf _
  12498. * @since 3.0.0
  12499. * @category Lang
  12500. * @param {*} value The value to check.
  12501. * @returns {boolean} Returns `true` if `value` is a native function,
  12502. * else `false`.
  12503. * @example
  12504. *
  12505. * _.isNative(Array.prototype.push);
  12506. * // => true
  12507. *
  12508. * _.isNative(_);
  12509. * // => false
  12510. */
  12511. function isNative(value) {
  12512. if (isMaskable(value)) {
  12513. throw new Error(CORE_ERROR_TEXT);
  12514. }
  12515. return baseIsNative(value);
  12516. }
  12517. /**
  12518. * Checks if `value` is `null`.
  12519. *
  12520. * @static
  12521. * @memberOf _
  12522. * @since 0.1.0
  12523. * @category Lang
  12524. * @param {*} value The value to check.
  12525. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12526. * @example
  12527. *
  12528. * _.isNull(null);
  12529. * // => true
  12530. *
  12531. * _.isNull(void 0);
  12532. * // => false
  12533. */
  12534. function isNull(value) {
  12535. return value === null;
  12536. }
  12537. /**
  12538. * Checks if `value` is `null` or `undefined`.
  12539. *
  12540. * @static
  12541. * @memberOf _
  12542. * @since 4.0.0
  12543. * @category Lang
  12544. * @param {*} value The value to check.
  12545. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12546. * @example
  12547. *
  12548. * _.isNil(null);
  12549. * // => true
  12550. *
  12551. * _.isNil(void 0);
  12552. * // => true
  12553. *
  12554. * _.isNil(NaN);
  12555. * // => false
  12556. */
  12557. function isNil(value) {
  12558. return value == null;
  12559. }
  12560. /**
  12561. * Checks if `value` is classified as a `Number` primitive or object.
  12562. *
  12563. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12564. * classified as numbers, use the `_.isFinite` method.
  12565. *
  12566. * @static
  12567. * @memberOf _
  12568. * @since 0.1.0
  12569. * @category Lang
  12570. * @param {*} value The value to check.
  12571. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12572. * @example
  12573. *
  12574. * _.isNumber(3);
  12575. * // => true
  12576. *
  12577. * _.isNumber(Number.MIN_VALUE);
  12578. * // => true
  12579. *
  12580. * _.isNumber(Infinity);
  12581. * // => true
  12582. *
  12583. * _.isNumber('3');
  12584. * // => false
  12585. */
  12586. function isNumber(value) {
  12587. return typeof value == 'number' ||
  12588. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12589. }
  12590. /**
  12591. * Checks if `value` is a plain object, that is, an object created by the
  12592. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12593. *
  12594. * @static
  12595. * @memberOf _
  12596. * @since 0.8.0
  12597. * @category Lang
  12598. * @param {*} value The value to check.
  12599. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12600. * @example
  12601. *
  12602. * function Foo() {
  12603. * this.a = 1;
  12604. * }
  12605. *
  12606. * _.isPlainObject(new Foo);
  12607. * // => false
  12608. *
  12609. * _.isPlainObject([1, 2, 3]);
  12610. * // => false
  12611. *
  12612. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12613. * // => true
  12614. *
  12615. * _.isPlainObject(Object.create(null));
  12616. * // => true
  12617. */
  12618. function isPlainObject(value) {
  12619. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12620. return false;
  12621. }
  12622. var proto = getPrototype(value);
  12623. if (proto === null) {
  12624. return true;
  12625. }
  12626. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12627. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12628. funcToString.call(Ctor) == objectCtorString;
  12629. }
  12630. /**
  12631. * Checks if `value` is classified as a `RegExp` object.
  12632. *
  12633. * @static
  12634. * @memberOf _
  12635. * @since 0.1.0
  12636. * @category Lang
  12637. * @param {*} value The value to check.
  12638. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12639. * @example
  12640. *
  12641. * _.isRegExp(/abc/);
  12642. * // => true
  12643. *
  12644. * _.isRegExp('/abc/');
  12645. * // => false
  12646. */
  12647. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12648. /**
  12649. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12650. * double precision number which isn't the result of a rounded unsafe integer.
  12651. *
  12652. * **Note:** This method is based on
  12653. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12654. *
  12655. * @static
  12656. * @memberOf _
  12657. * @since 4.0.0
  12658. * @category Lang
  12659. * @param {*} value The value to check.
  12660. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12661. * @example
  12662. *
  12663. * _.isSafeInteger(3);
  12664. * // => true
  12665. *
  12666. * _.isSafeInteger(Number.MIN_VALUE);
  12667. * // => false
  12668. *
  12669. * _.isSafeInteger(Infinity);
  12670. * // => false
  12671. *
  12672. * _.isSafeInteger('3');
  12673. * // => false
  12674. */
  12675. function isSafeInteger(value) {
  12676. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12677. }
  12678. /**
  12679. * Checks if `value` is classified as a `Set` object.
  12680. *
  12681. * @static
  12682. * @memberOf _
  12683. * @since 4.3.0
  12684. * @category Lang
  12685. * @param {*} value The value to check.
  12686. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12687. * @example
  12688. *
  12689. * _.isSet(new Set);
  12690. * // => true
  12691. *
  12692. * _.isSet(new WeakSet);
  12693. * // => false
  12694. */
  12695. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12696. /**
  12697. * Checks if `value` is classified as a `String` primitive or object.
  12698. *
  12699. * @static
  12700. * @since 0.1.0
  12701. * @memberOf _
  12702. * @category Lang
  12703. * @param {*} value The value to check.
  12704. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12705. * @example
  12706. *
  12707. * _.isString('abc');
  12708. * // => true
  12709. *
  12710. * _.isString(1);
  12711. * // => false
  12712. */
  12713. function isString(value) {
  12714. return typeof value == 'string' ||
  12715. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12716. }
  12717. /**
  12718. * Checks if `value` is classified as a `Symbol` primitive or object.
  12719. *
  12720. * @static
  12721. * @memberOf _
  12722. * @since 4.0.0
  12723. * @category Lang
  12724. * @param {*} value The value to check.
  12725. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12726. * @example
  12727. *
  12728. * _.isSymbol(Symbol.iterator);
  12729. * // => true
  12730. *
  12731. * _.isSymbol('abc');
  12732. * // => false
  12733. */
  12734. function isSymbol(value) {
  12735. return typeof value == 'symbol' ||
  12736. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12737. }
  12738. /**
  12739. * Checks if `value` is classified as a typed array.
  12740. *
  12741. * @static
  12742. * @memberOf _
  12743. * @since 3.0.0
  12744. * @category Lang
  12745. * @param {*} value The value to check.
  12746. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12747. * @example
  12748. *
  12749. * _.isTypedArray(new Uint8Array);
  12750. * // => true
  12751. *
  12752. * _.isTypedArray([]);
  12753. * // => false
  12754. */
  12755. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12756. /**
  12757. * Checks if `value` is `undefined`.
  12758. *
  12759. * @static
  12760. * @since 0.1.0
  12761. * @memberOf _
  12762. * @category Lang
  12763. * @param {*} value The value to check.
  12764. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12765. * @example
  12766. *
  12767. * _.isUndefined(void 0);
  12768. * // => true
  12769. *
  12770. * _.isUndefined(null);
  12771. * // => false
  12772. */
  12773. function isUndefined(value) {
  12774. return value === undefined;
  12775. }
  12776. /**
  12777. * Checks if `value` is classified as a `WeakMap` object.
  12778. *
  12779. * @static
  12780. * @memberOf _
  12781. * @since 4.3.0
  12782. * @category Lang
  12783. * @param {*} value The value to check.
  12784. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12785. * @example
  12786. *
  12787. * _.isWeakMap(new WeakMap);
  12788. * // => true
  12789. *
  12790. * _.isWeakMap(new Map);
  12791. * // => false
  12792. */
  12793. function isWeakMap(value) {
  12794. return isObjectLike(value) && getTag(value) == weakMapTag;
  12795. }
  12796. /**
  12797. * Checks if `value` is classified as a `WeakSet` object.
  12798. *
  12799. * @static
  12800. * @memberOf _
  12801. * @since 4.3.0
  12802. * @category Lang
  12803. * @param {*} value The value to check.
  12804. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12805. * @example
  12806. *
  12807. * _.isWeakSet(new WeakSet);
  12808. * // => true
  12809. *
  12810. * _.isWeakSet(new Set);
  12811. * // => false
  12812. */
  12813. function isWeakSet(value) {
  12814. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12815. }
  12816. /**
  12817. * Checks if `value` is less than `other`.
  12818. *
  12819. * @static
  12820. * @memberOf _
  12821. * @since 3.9.0
  12822. * @category Lang
  12823. * @param {*} value The value to compare.
  12824. * @param {*} other The other value to compare.
  12825. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12826. * else `false`.
  12827. * @see _.gt
  12828. * @example
  12829. *
  12830. * _.lt(1, 3);
  12831. * // => true
  12832. *
  12833. * _.lt(3, 3);
  12834. * // => false
  12835. *
  12836. * _.lt(3, 1);
  12837. * // => false
  12838. */
  12839. var lt = createRelationalOperation(baseLt);
  12840. /**
  12841. * Checks if `value` is less than or equal to `other`.
  12842. *
  12843. * @static
  12844. * @memberOf _
  12845. * @since 3.9.0
  12846. * @category Lang
  12847. * @param {*} value The value to compare.
  12848. * @param {*} other The other value to compare.
  12849. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12850. * `other`, else `false`.
  12851. * @see _.gte
  12852. * @example
  12853. *
  12854. * _.lte(1, 3);
  12855. * // => true
  12856. *
  12857. * _.lte(3, 3);
  12858. * // => true
  12859. *
  12860. * _.lte(3, 1);
  12861. * // => false
  12862. */
  12863. var lte = createRelationalOperation(function(value, other) {
  12864. return value <= other;
  12865. });
  12866. /**
  12867. * Converts `value` to an array.
  12868. *
  12869. * @static
  12870. * @since 0.1.0
  12871. * @memberOf _
  12872. * @category Lang
  12873. * @param {*} value The value to convert.
  12874. * @returns {Array} Returns the converted array.
  12875. * @example
  12876. *
  12877. * _.toArray({ 'a': 1, 'b': 2 });
  12878. * // => [1, 2]
  12879. *
  12880. * _.toArray('abc');
  12881. * // => ['a', 'b', 'c']
  12882. *
  12883. * _.toArray(1);
  12884. * // => []
  12885. *
  12886. * _.toArray(null);
  12887. * // => []
  12888. */
  12889. function toArray(value) {
  12890. if (!value) {
  12891. return [];
  12892. }
  12893. if (isArrayLike(value)) {
  12894. return isString(value) ? stringToArray(value) : copyArray(value);
  12895. }
  12896. if (symIterator && value[symIterator]) {
  12897. return iteratorToArray(value[symIterator]());
  12898. }
  12899. var tag = getTag(value),
  12900. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12901. return func(value);
  12902. }
  12903. /**
  12904. * Converts `value` to a finite number.
  12905. *
  12906. * @static
  12907. * @memberOf _
  12908. * @since 4.12.0
  12909. * @category Lang
  12910. * @param {*} value The value to convert.
  12911. * @returns {number} Returns the converted number.
  12912. * @example
  12913. *
  12914. * _.toFinite(3.2);
  12915. * // => 3.2
  12916. *
  12917. * _.toFinite(Number.MIN_VALUE);
  12918. * // => 5e-324
  12919. *
  12920. * _.toFinite(Infinity);
  12921. * // => 1.7976931348623157e+308
  12922. *
  12923. * _.toFinite('3.2');
  12924. * // => 3.2
  12925. */
  12926. function toFinite(value) {
  12927. if (!value) {
  12928. return value === 0 ? value : 0;
  12929. }
  12930. value = toNumber(value);
  12931. if (value === INFINITY || value === -INFINITY) {
  12932. var sign = (value < 0 ? -1 : 1);
  12933. return sign * MAX_INTEGER;
  12934. }
  12935. return value === value ? value : 0;
  12936. }
  12937. /**
  12938. * Converts `value` to an integer.
  12939. *
  12940. * **Note:** This method is loosely based on
  12941. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12942. *
  12943. * @static
  12944. * @memberOf _
  12945. * @since 4.0.0
  12946. * @category Lang
  12947. * @param {*} value The value to convert.
  12948. * @returns {number} Returns the converted integer.
  12949. * @example
  12950. *
  12951. * _.toInteger(3.2);
  12952. * // => 3
  12953. *
  12954. * _.toInteger(Number.MIN_VALUE);
  12955. * // => 0
  12956. *
  12957. * _.toInteger(Infinity);
  12958. * // => 1.7976931348623157e+308
  12959. *
  12960. * _.toInteger('3.2');
  12961. * // => 3
  12962. */
  12963. function toInteger(value) {
  12964. var result = toFinite(value),
  12965. remainder = result % 1;
  12966. return result === result ? (remainder ? result - remainder : result) : 0;
  12967. }
  12968. /**
  12969. * Converts `value` to an integer suitable for use as the length of an
  12970. * array-like object.
  12971. *
  12972. * **Note:** This method is based on
  12973. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12974. *
  12975. * @static
  12976. * @memberOf _
  12977. * @since 4.0.0
  12978. * @category Lang
  12979. * @param {*} value The value to convert.
  12980. * @returns {number} Returns the converted integer.
  12981. * @example
  12982. *
  12983. * _.toLength(3.2);
  12984. * // => 3
  12985. *
  12986. * _.toLength(Number.MIN_VALUE);
  12987. * // => 0
  12988. *
  12989. * _.toLength(Infinity);
  12990. * // => 4294967295
  12991. *
  12992. * _.toLength('3.2');
  12993. * // => 3
  12994. */
  12995. function toLength(value) {
  12996. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12997. }
  12998. /**
  12999. * Converts `value` to a number.
  13000. *
  13001. * @static
  13002. * @memberOf _
  13003. * @since 4.0.0
  13004. * @category Lang
  13005. * @param {*} value The value to process.
  13006. * @returns {number} Returns the number.
  13007. * @example
  13008. *
  13009. * _.toNumber(3.2);
  13010. * // => 3.2
  13011. *
  13012. * _.toNumber(Number.MIN_VALUE);
  13013. * // => 5e-324
  13014. *
  13015. * _.toNumber(Infinity);
  13016. * // => Infinity
  13017. *
  13018. * _.toNumber('3.2');
  13019. * // => 3.2
  13020. */
  13021. function toNumber(value) {
  13022. if (typeof value == 'number') {
  13023. return value;
  13024. }
  13025. if (isSymbol(value)) {
  13026. return NAN;
  13027. }
  13028. if (isObject(value)) {
  13029. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13030. value = isObject(other) ? (other + '') : other;
  13031. }
  13032. if (typeof value != 'string') {
  13033. return value === 0 ? value : +value;
  13034. }
  13035. value = baseTrim(value);
  13036. var isBinary = reIsBinary.test(value);
  13037. return (isBinary || reIsOctal.test(value))
  13038. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13039. : (reIsBadHex.test(value) ? NAN : +value);
  13040. }
  13041. /**
  13042. * Converts `value` to a plain object flattening inherited enumerable string
  13043. * keyed properties of `value` to own properties of the plain object.
  13044. *
  13045. * @static
  13046. * @memberOf _
  13047. * @since 3.0.0
  13048. * @category Lang
  13049. * @param {*} value The value to convert.
  13050. * @returns {Object} Returns the converted plain object.
  13051. * @example
  13052. *
  13053. * function Foo() {
  13054. * this.b = 2;
  13055. * }
  13056. *
  13057. * Foo.prototype.c = 3;
  13058. *
  13059. * _.assign({ 'a': 1 }, new Foo);
  13060. * // => { 'a': 1, 'b': 2 }
  13061. *
  13062. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13063. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13064. */
  13065. function toPlainObject(value) {
  13066. return copyObject(value, keysIn(value));
  13067. }
  13068. /**
  13069. * Converts `value` to a safe integer. A safe integer can be compared and
  13070. * represented correctly.
  13071. *
  13072. * @static
  13073. * @memberOf _
  13074. * @since 4.0.0
  13075. * @category Lang
  13076. * @param {*} value The value to convert.
  13077. * @returns {number} Returns the converted integer.
  13078. * @example
  13079. *
  13080. * _.toSafeInteger(3.2);
  13081. * // => 3
  13082. *
  13083. * _.toSafeInteger(Number.MIN_VALUE);
  13084. * // => 0
  13085. *
  13086. * _.toSafeInteger(Infinity);
  13087. * // => 9007199254740991
  13088. *
  13089. * _.toSafeInteger('3.2');
  13090. * // => 3
  13091. */
  13092. function toSafeInteger(value) {
  13093. return value
  13094. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13095. : (value === 0 ? value : 0);
  13096. }
  13097. /**
  13098. * Converts `value` to a string. An empty string is returned for `null`
  13099. * and `undefined` values. The sign of `-0` is preserved.
  13100. *
  13101. * @static
  13102. * @memberOf _
  13103. * @since 4.0.0
  13104. * @category Lang
  13105. * @param {*} value The value to convert.
  13106. * @returns {string} Returns the converted string.
  13107. * @example
  13108. *
  13109. * _.toString(null);
  13110. * // => ''
  13111. *
  13112. * _.toString(-0);
  13113. * // => '-0'
  13114. *
  13115. * _.toString([1, 2, 3]);
  13116. * // => '1,2,3'
  13117. */
  13118. function toString(value) {
  13119. return value == null ? '' : baseToString(value);
  13120. }
  13121. /*------------------------------------------------------------------------*/
  13122. /**
  13123. * Assigns own enumerable string keyed properties of source objects to the
  13124. * destination object. Source objects are applied from left to right.
  13125. * Subsequent sources overwrite property assignments of previous sources.
  13126. *
  13127. * **Note:** This method mutates `object` and is loosely based on
  13128. * [`Object.assign`](https://mdn.io/Object/assign).
  13129. *
  13130. * @static
  13131. * @memberOf _
  13132. * @since 0.10.0
  13133. * @category Object
  13134. * @param {Object} object The destination object.
  13135. * @param {...Object} [sources] The source objects.
  13136. * @returns {Object} Returns `object`.
  13137. * @see _.assignIn
  13138. * @example
  13139. *
  13140. * function Foo() {
  13141. * this.a = 1;
  13142. * }
  13143. *
  13144. * function Bar() {
  13145. * this.c = 3;
  13146. * }
  13147. *
  13148. * Foo.prototype.b = 2;
  13149. * Bar.prototype.d = 4;
  13150. *
  13151. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13152. * // => { 'a': 1, 'c': 3 }
  13153. */
  13154. var assign = createAssigner(function(object, source) {
  13155. if (isPrototype(source) || isArrayLike(source)) {
  13156. copyObject(source, keys(source), object);
  13157. return;
  13158. }
  13159. for (var key in source) {
  13160. if (hasOwnProperty.call(source, key)) {
  13161. assignValue(object, key, source[key]);
  13162. }
  13163. }
  13164. });
  13165. /**
  13166. * This method is like `_.assign` except that it iterates over own and
  13167. * inherited source properties.
  13168. *
  13169. * **Note:** This method mutates `object`.
  13170. *
  13171. * @static
  13172. * @memberOf _
  13173. * @since 4.0.0
  13174. * @alias extend
  13175. * @category Object
  13176. * @param {Object} object The destination object.
  13177. * @param {...Object} [sources] The source objects.
  13178. * @returns {Object} Returns `object`.
  13179. * @see _.assign
  13180. * @example
  13181. *
  13182. * function Foo() {
  13183. * this.a = 1;
  13184. * }
  13185. *
  13186. * function Bar() {
  13187. * this.c = 3;
  13188. * }
  13189. *
  13190. * Foo.prototype.b = 2;
  13191. * Bar.prototype.d = 4;
  13192. *
  13193. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13194. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13195. */
  13196. var assignIn = createAssigner(function(object, source) {
  13197. copyObject(source, keysIn(source), object);
  13198. });
  13199. /**
  13200. * This method is like `_.assignIn` except that it accepts `customizer`
  13201. * which is invoked to produce the assigned values. If `customizer` returns
  13202. * `undefined`, assignment is handled by the method instead. The `customizer`
  13203. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13204. *
  13205. * **Note:** This method mutates `object`.
  13206. *
  13207. * @static
  13208. * @memberOf _
  13209. * @since 4.0.0
  13210. * @alias extendWith
  13211. * @category Object
  13212. * @param {Object} object The destination object.
  13213. * @param {...Object} sources The source objects.
  13214. * @param {Function} [customizer] The function to customize assigned values.
  13215. * @returns {Object} Returns `object`.
  13216. * @see _.assignWith
  13217. * @example
  13218. *
  13219. * function customizer(objValue, srcValue) {
  13220. * return _.isUndefined(objValue) ? srcValue : objValue;
  13221. * }
  13222. *
  13223. * var defaults = _.partialRight(_.assignInWith, customizer);
  13224. *
  13225. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13226. * // => { 'a': 1, 'b': 2 }
  13227. */
  13228. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13229. copyObject(source, keysIn(source), object, customizer);
  13230. });
  13231. /**
  13232. * This method is like `_.assign` except that it accepts `customizer`
  13233. * which is invoked to produce the assigned values. If `customizer` returns
  13234. * `undefined`, assignment is handled by the method instead. The `customizer`
  13235. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13236. *
  13237. * **Note:** This method mutates `object`.
  13238. *
  13239. * @static
  13240. * @memberOf _
  13241. * @since 4.0.0
  13242. * @category Object
  13243. * @param {Object} object The destination object.
  13244. * @param {...Object} sources The source objects.
  13245. * @param {Function} [customizer] The function to customize assigned values.
  13246. * @returns {Object} Returns `object`.
  13247. * @see _.assignInWith
  13248. * @example
  13249. *
  13250. * function customizer(objValue, srcValue) {
  13251. * return _.isUndefined(objValue) ? srcValue : objValue;
  13252. * }
  13253. *
  13254. * var defaults = _.partialRight(_.assignWith, customizer);
  13255. *
  13256. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13257. * // => { 'a': 1, 'b': 2 }
  13258. */
  13259. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13260. copyObject(source, keys(source), object, customizer);
  13261. });
  13262. /**
  13263. * Creates an array of values corresponding to `paths` of `object`.
  13264. *
  13265. * @static
  13266. * @memberOf _
  13267. * @since 1.0.0
  13268. * @category Object
  13269. * @param {Object} object The object to iterate over.
  13270. * @param {...(string|string[])} [paths] The property paths to pick.
  13271. * @returns {Array} Returns the picked values.
  13272. * @example
  13273. *
  13274. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13275. *
  13276. * _.at(object, ['a[0].b.c', 'a[1]']);
  13277. * // => [3, 4]
  13278. */
  13279. var at = flatRest(baseAt);
  13280. /**
  13281. * Creates an object that inherits from the `prototype` object. If a
  13282. * `properties` object is given, its own enumerable string keyed properties
  13283. * are assigned to the created object.
  13284. *
  13285. * @static
  13286. * @memberOf _
  13287. * @since 2.3.0
  13288. * @category Object
  13289. * @param {Object} prototype The object to inherit from.
  13290. * @param {Object} [properties] The properties to assign to the object.
  13291. * @returns {Object} Returns the new object.
  13292. * @example
  13293. *
  13294. * function Shape() {
  13295. * this.x = 0;
  13296. * this.y = 0;
  13297. * }
  13298. *
  13299. * function Circle() {
  13300. * Shape.call(this);
  13301. * }
  13302. *
  13303. * Circle.prototype = _.create(Shape.prototype, {
  13304. * 'constructor': Circle
  13305. * });
  13306. *
  13307. * var circle = new Circle;
  13308. * circle instanceof Circle;
  13309. * // => true
  13310. *
  13311. * circle instanceof Shape;
  13312. * // => true
  13313. */
  13314. function create(prototype, properties) {
  13315. var result = baseCreate(prototype);
  13316. return properties == null ? result : baseAssign(result, properties);
  13317. }
  13318. /**
  13319. * Assigns own and inherited enumerable string keyed properties of source
  13320. * objects to the destination object for all destination properties that
  13321. * resolve to `undefined`. Source objects are applied from left to right.
  13322. * Once a property is set, additional values of the same property are ignored.
  13323. *
  13324. * **Note:** This method mutates `object`.
  13325. *
  13326. * @static
  13327. * @since 0.1.0
  13328. * @memberOf _
  13329. * @category Object
  13330. * @param {Object} object The destination object.
  13331. * @param {...Object} [sources] The source objects.
  13332. * @returns {Object} Returns `object`.
  13333. * @see _.defaultsDeep
  13334. * @example
  13335. *
  13336. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13337. * // => { 'a': 1, 'b': 2 }
  13338. */
  13339. var defaults = baseRest(function(object, sources) {
  13340. object = Object(object);
  13341. var index = -1;
  13342. var length = sources.length;
  13343. var guard = length > 2 ? sources[2] : undefined;
  13344. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13345. length = 1;
  13346. }
  13347. while (++index < length) {
  13348. var source = sources[index];
  13349. var props = keysIn(source);
  13350. var propsIndex = -1;
  13351. var propsLength = props.length;
  13352. while (++propsIndex < propsLength) {
  13353. var key = props[propsIndex];
  13354. var value = object[key];
  13355. if (value === undefined ||
  13356. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13357. object[key] = source[key];
  13358. }
  13359. }
  13360. }
  13361. return object;
  13362. });
  13363. /**
  13364. * This method is like `_.defaults` except that it recursively assigns
  13365. * default properties.
  13366. *
  13367. * **Note:** This method mutates `object`.
  13368. *
  13369. * @static
  13370. * @memberOf _
  13371. * @since 3.10.0
  13372. * @category Object
  13373. * @param {Object} object The destination object.
  13374. * @param {...Object} [sources] The source objects.
  13375. * @returns {Object} Returns `object`.
  13376. * @see _.defaults
  13377. * @example
  13378. *
  13379. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13380. * // => { 'a': { 'b': 2, 'c': 3 } }
  13381. */
  13382. var defaultsDeep = baseRest(function(args) {
  13383. args.push(undefined, customDefaultsMerge);
  13384. return apply(mergeWith, undefined, args);
  13385. });
  13386. /**
  13387. * This method is like `_.find` except that it returns the key of the first
  13388. * element `predicate` returns truthy for instead of the element itself.
  13389. *
  13390. * @static
  13391. * @memberOf _
  13392. * @since 1.1.0
  13393. * @category Object
  13394. * @param {Object} object The object to inspect.
  13395. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13396. * @returns {string|undefined} Returns the key of the matched element,
  13397. * else `undefined`.
  13398. * @example
  13399. *
  13400. * var users = {
  13401. * 'barney': { 'age': 36, 'active': true },
  13402. * 'fred': { 'age': 40, 'active': false },
  13403. * 'pebbles': { 'age': 1, 'active': true }
  13404. * };
  13405. *
  13406. * _.findKey(users, function(o) { return o.age < 40; });
  13407. * // => 'barney' (iteration order is not guaranteed)
  13408. *
  13409. * // The `_.matches` iteratee shorthand.
  13410. * _.findKey(users, { 'age': 1, 'active': true });
  13411. * // => 'pebbles'
  13412. *
  13413. * // The `_.matchesProperty` iteratee shorthand.
  13414. * _.findKey(users, ['active', false]);
  13415. * // => 'fred'
  13416. *
  13417. * // The `_.property` iteratee shorthand.
  13418. * _.findKey(users, 'active');
  13419. * // => 'barney'
  13420. */
  13421. function findKey(object, predicate) {
  13422. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13423. }
  13424. /**
  13425. * This method is like `_.findKey` except that it iterates over elements of
  13426. * a collection in the opposite order.
  13427. *
  13428. * @static
  13429. * @memberOf _
  13430. * @since 2.0.0
  13431. * @category Object
  13432. * @param {Object} object The object to inspect.
  13433. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13434. * @returns {string|undefined} Returns the key of the matched element,
  13435. * else `undefined`.
  13436. * @example
  13437. *
  13438. * var users = {
  13439. * 'barney': { 'age': 36, 'active': true },
  13440. * 'fred': { 'age': 40, 'active': false },
  13441. * 'pebbles': { 'age': 1, 'active': true }
  13442. * };
  13443. *
  13444. * _.findLastKey(users, function(o) { return o.age < 40; });
  13445. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13446. *
  13447. * // The `_.matches` iteratee shorthand.
  13448. * _.findLastKey(users, { 'age': 36, 'active': true });
  13449. * // => 'barney'
  13450. *
  13451. * // The `_.matchesProperty` iteratee shorthand.
  13452. * _.findLastKey(users, ['active', false]);
  13453. * // => 'fred'
  13454. *
  13455. * // The `_.property` iteratee shorthand.
  13456. * _.findLastKey(users, 'active');
  13457. * // => 'pebbles'
  13458. */
  13459. function findLastKey(object, predicate) {
  13460. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13461. }
  13462. /**
  13463. * Iterates over own and inherited enumerable string keyed properties of an
  13464. * object and invokes `iteratee` for each property. The iteratee is invoked
  13465. * with three arguments: (value, key, object). Iteratee functions may exit
  13466. * iteration early by explicitly returning `false`.
  13467. *
  13468. * @static
  13469. * @memberOf _
  13470. * @since 0.3.0
  13471. * @category Object
  13472. * @param {Object} object The object to iterate over.
  13473. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13474. * @returns {Object} Returns `object`.
  13475. * @see _.forInRight
  13476. * @example
  13477. *
  13478. * function Foo() {
  13479. * this.a = 1;
  13480. * this.b = 2;
  13481. * }
  13482. *
  13483. * Foo.prototype.c = 3;
  13484. *
  13485. * _.forIn(new Foo, function(value, key) {
  13486. * console.log(key);
  13487. * });
  13488. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13489. */
  13490. function forIn(object, iteratee) {
  13491. return object == null
  13492. ? object
  13493. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13494. }
  13495. /**
  13496. * This method is like `_.forIn` except that it iterates over properties of
  13497. * `object` in the opposite order.
  13498. *
  13499. * @static
  13500. * @memberOf _
  13501. * @since 2.0.0
  13502. * @category Object
  13503. * @param {Object} object The object to iterate over.
  13504. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13505. * @returns {Object} Returns `object`.
  13506. * @see _.forIn
  13507. * @example
  13508. *
  13509. * function Foo() {
  13510. * this.a = 1;
  13511. * this.b = 2;
  13512. * }
  13513. *
  13514. * Foo.prototype.c = 3;
  13515. *
  13516. * _.forInRight(new Foo, function(value, key) {
  13517. * console.log(key);
  13518. * });
  13519. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13520. */
  13521. function forInRight(object, iteratee) {
  13522. return object == null
  13523. ? object
  13524. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13525. }
  13526. /**
  13527. * Iterates over own enumerable string keyed properties of an object and
  13528. * invokes `iteratee` for each property. The iteratee is invoked with three
  13529. * arguments: (value, key, object). Iteratee functions may exit iteration
  13530. * early by explicitly returning `false`.
  13531. *
  13532. * @static
  13533. * @memberOf _
  13534. * @since 0.3.0
  13535. * @category Object
  13536. * @param {Object} object The object to iterate over.
  13537. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13538. * @returns {Object} Returns `object`.
  13539. * @see _.forOwnRight
  13540. * @example
  13541. *
  13542. * function Foo() {
  13543. * this.a = 1;
  13544. * this.b = 2;
  13545. * }
  13546. *
  13547. * Foo.prototype.c = 3;
  13548. *
  13549. * _.forOwn(new Foo, function(value, key) {
  13550. * console.log(key);
  13551. * });
  13552. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13553. */
  13554. function forOwn(object, iteratee) {
  13555. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13556. }
  13557. /**
  13558. * This method is like `_.forOwn` except that it iterates over properties of
  13559. * `object` in the opposite order.
  13560. *
  13561. * @static
  13562. * @memberOf _
  13563. * @since 2.0.0
  13564. * @category Object
  13565. * @param {Object} object The object to iterate over.
  13566. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13567. * @returns {Object} Returns `object`.
  13568. * @see _.forOwn
  13569. * @example
  13570. *
  13571. * function Foo() {
  13572. * this.a = 1;
  13573. * this.b = 2;
  13574. * }
  13575. *
  13576. * Foo.prototype.c = 3;
  13577. *
  13578. * _.forOwnRight(new Foo, function(value, key) {
  13579. * console.log(key);
  13580. * });
  13581. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13582. */
  13583. function forOwnRight(object, iteratee) {
  13584. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13585. }
  13586. /**
  13587. * Creates an array of function property names from own enumerable properties
  13588. * of `object`.
  13589. *
  13590. * @static
  13591. * @since 0.1.0
  13592. * @memberOf _
  13593. * @category Object
  13594. * @param {Object} object The object to inspect.
  13595. * @returns {Array} Returns the function names.
  13596. * @see _.functionsIn
  13597. * @example
  13598. *
  13599. * function Foo() {
  13600. * this.a = _.constant('a');
  13601. * this.b = _.constant('b');
  13602. * }
  13603. *
  13604. * Foo.prototype.c = _.constant('c');
  13605. *
  13606. * _.functions(new Foo);
  13607. * // => ['a', 'b']
  13608. */
  13609. function functions(object) {
  13610. return object == null ? [] : baseFunctions(object, keys(object));
  13611. }
  13612. /**
  13613. * Creates an array of function property names from own and inherited
  13614. * enumerable properties of `object`.
  13615. *
  13616. * @static
  13617. * @memberOf _
  13618. * @since 4.0.0
  13619. * @category Object
  13620. * @param {Object} object The object to inspect.
  13621. * @returns {Array} Returns the function names.
  13622. * @see _.functions
  13623. * @example
  13624. *
  13625. * function Foo() {
  13626. * this.a = _.constant('a');
  13627. * this.b = _.constant('b');
  13628. * }
  13629. *
  13630. * Foo.prototype.c = _.constant('c');
  13631. *
  13632. * _.functionsIn(new Foo);
  13633. * // => ['a', 'b', 'c']
  13634. */
  13635. function functionsIn(object) {
  13636. return object == null ? [] : baseFunctions(object, keysIn(object));
  13637. }
  13638. /**
  13639. * Gets the value at `path` of `object`. If the resolved value is
  13640. * `undefined`, the `defaultValue` is returned in its place.
  13641. *
  13642. * @static
  13643. * @memberOf _
  13644. * @since 3.7.0
  13645. * @category Object
  13646. * @param {Object} object The object to query.
  13647. * @param {Array|string} path The path of the property to get.
  13648. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13649. * @returns {*} Returns the resolved value.
  13650. * @example
  13651. *
  13652. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13653. *
  13654. * _.get(object, 'a[0].b.c');
  13655. * // => 3
  13656. *
  13657. * _.get(object, ['a', '0', 'b', 'c']);
  13658. * // => 3
  13659. *
  13660. * _.get(object, 'a.b.c', 'default');
  13661. * // => 'default'
  13662. */
  13663. function get(object, path, defaultValue) {
  13664. var result = object == null ? undefined : baseGet(object, path);
  13665. return result === undefined ? defaultValue : result;
  13666. }
  13667. /**
  13668. * Checks if `path` is a direct property of `object`.
  13669. *
  13670. * @static
  13671. * @since 0.1.0
  13672. * @memberOf _
  13673. * @category Object
  13674. * @param {Object} object The object to query.
  13675. * @param {Array|string} path The path to check.
  13676. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13677. * @example
  13678. *
  13679. * var object = { 'a': { 'b': 2 } };
  13680. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13681. *
  13682. * _.has(object, 'a');
  13683. * // => true
  13684. *
  13685. * _.has(object, 'a.b');
  13686. * // => true
  13687. *
  13688. * _.has(object, ['a', 'b']);
  13689. * // => true
  13690. *
  13691. * _.has(other, 'a');
  13692. * // => false
  13693. */
  13694. function has(object, path) {
  13695. return object != null && hasPath(object, path, baseHas);
  13696. }
  13697. /**
  13698. * Checks if `path` is a direct or inherited property of `object`.
  13699. *
  13700. * @static
  13701. * @memberOf _
  13702. * @since 4.0.0
  13703. * @category Object
  13704. * @param {Object} object The object to query.
  13705. * @param {Array|string} path The path to check.
  13706. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13707. * @example
  13708. *
  13709. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13710. *
  13711. * _.hasIn(object, 'a');
  13712. * // => true
  13713. *
  13714. * _.hasIn(object, 'a.b');
  13715. * // => true
  13716. *
  13717. * _.hasIn(object, ['a', 'b']);
  13718. * // => true
  13719. *
  13720. * _.hasIn(object, 'b');
  13721. * // => false
  13722. */
  13723. function hasIn(object, path) {
  13724. return object != null && hasPath(object, path, baseHasIn);
  13725. }
  13726. /**
  13727. * Creates an object composed of the inverted keys and values of `object`.
  13728. * If `object` contains duplicate values, subsequent values overwrite
  13729. * property assignments of previous values.
  13730. *
  13731. * @static
  13732. * @memberOf _
  13733. * @since 0.7.0
  13734. * @category Object
  13735. * @param {Object} object The object to invert.
  13736. * @returns {Object} Returns the new inverted object.
  13737. * @example
  13738. *
  13739. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13740. *
  13741. * _.invert(object);
  13742. * // => { '1': 'c', '2': 'b' }
  13743. */
  13744. var invert = createInverter(function(result, value, key) {
  13745. if (value != null &&
  13746. typeof value.toString != 'function') {
  13747. value = nativeObjectToString.call(value);
  13748. }
  13749. result[value] = key;
  13750. }, constant(identity));
  13751. /**
  13752. * This method is like `_.invert` except that the inverted object is generated
  13753. * from the results of running each element of `object` thru `iteratee`. The
  13754. * corresponding inverted value of each inverted key is an array of keys
  13755. * responsible for generating the inverted value. The iteratee is invoked
  13756. * with one argument: (value).
  13757. *
  13758. * @static
  13759. * @memberOf _
  13760. * @since 4.1.0
  13761. * @category Object
  13762. * @param {Object} object The object to invert.
  13763. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13764. * @returns {Object} Returns the new inverted object.
  13765. * @example
  13766. *
  13767. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13768. *
  13769. * _.invertBy(object);
  13770. * // => { '1': ['a', 'c'], '2': ['b'] }
  13771. *
  13772. * _.invertBy(object, function(value) {
  13773. * return 'group' + value;
  13774. * });
  13775. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13776. */
  13777. var invertBy = createInverter(function(result, value, key) {
  13778. if (value != null &&
  13779. typeof value.toString != 'function') {
  13780. value = nativeObjectToString.call(value);
  13781. }
  13782. if (hasOwnProperty.call(result, value)) {
  13783. result[value].push(key);
  13784. } else {
  13785. result[value] = [key];
  13786. }
  13787. }, getIteratee);
  13788. /**
  13789. * Invokes the method at `path` of `object`.
  13790. *
  13791. * @static
  13792. * @memberOf _
  13793. * @since 4.0.0
  13794. * @category Object
  13795. * @param {Object} object The object to query.
  13796. * @param {Array|string} path The path of the method to invoke.
  13797. * @param {...*} [args] The arguments to invoke the method with.
  13798. * @returns {*} Returns the result of the invoked method.
  13799. * @example
  13800. *
  13801. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13802. *
  13803. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13804. * // => [2, 3]
  13805. */
  13806. var invoke = baseRest(baseInvoke);
  13807. /**
  13808. * Creates an array of the own enumerable property names of `object`.
  13809. *
  13810. * **Note:** Non-object values are coerced to objects. See the
  13811. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13812. * for more details.
  13813. *
  13814. * @static
  13815. * @since 0.1.0
  13816. * @memberOf _
  13817. * @category Object
  13818. * @param {Object} object The object to query.
  13819. * @returns {Array} Returns the array of property names.
  13820. * @example
  13821. *
  13822. * function Foo() {
  13823. * this.a = 1;
  13824. * this.b = 2;
  13825. * }
  13826. *
  13827. * Foo.prototype.c = 3;
  13828. *
  13829. * _.keys(new Foo);
  13830. * // => ['a', 'b'] (iteration order is not guaranteed)
  13831. *
  13832. * _.keys('hi');
  13833. * // => ['0', '1']
  13834. */
  13835. function keys(object) {
  13836. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13837. }
  13838. /**
  13839. * Creates an array of the own and inherited enumerable property names of `object`.
  13840. *
  13841. * **Note:** Non-object values are coerced to objects.
  13842. *
  13843. * @static
  13844. * @memberOf _
  13845. * @since 3.0.0
  13846. * @category Object
  13847. * @param {Object} object The object to query.
  13848. * @returns {Array} Returns the array of property names.
  13849. * @example
  13850. *
  13851. * function Foo() {
  13852. * this.a = 1;
  13853. * this.b = 2;
  13854. * }
  13855. *
  13856. * Foo.prototype.c = 3;
  13857. *
  13858. * _.keysIn(new Foo);
  13859. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13860. */
  13861. function keysIn(object) {
  13862. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13863. }
  13864. /**
  13865. * The opposite of `_.mapValues`; this method creates an object with the
  13866. * same values as `object` and keys generated by running each own enumerable
  13867. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13868. * with three arguments: (value, key, object).
  13869. *
  13870. * @static
  13871. * @memberOf _
  13872. * @since 3.8.0
  13873. * @category Object
  13874. * @param {Object} object The object to iterate over.
  13875. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13876. * @returns {Object} Returns the new mapped object.
  13877. * @see _.mapValues
  13878. * @example
  13879. *
  13880. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13881. * return key + value;
  13882. * });
  13883. * // => { 'a1': 1, 'b2': 2 }
  13884. */
  13885. function mapKeys(object, iteratee) {
  13886. var result = {};
  13887. iteratee = getIteratee(iteratee, 3);
  13888. baseForOwn(object, function(value, key, object) {
  13889. baseAssignValue(result, iteratee(value, key, object), value);
  13890. });
  13891. return result;
  13892. }
  13893. /**
  13894. * Creates an object with the same keys as `object` and values generated
  13895. * by running each own enumerable string keyed property of `object` thru
  13896. * `iteratee`. The iteratee is invoked with three arguments:
  13897. * (value, key, object).
  13898. *
  13899. * @static
  13900. * @memberOf _
  13901. * @since 2.4.0
  13902. * @category Object
  13903. * @param {Object} object The object to iterate over.
  13904. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13905. * @returns {Object} Returns the new mapped object.
  13906. * @see _.mapKeys
  13907. * @example
  13908. *
  13909. * var users = {
  13910. * 'fred': { 'user': 'fred', 'age': 40 },
  13911. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13912. * };
  13913. *
  13914. * _.mapValues(users, function(o) { return o.age; });
  13915. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13916. *
  13917. * // The `_.property` iteratee shorthand.
  13918. * _.mapValues(users, 'age');
  13919. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13920. */
  13921. function mapValues(object, iteratee) {
  13922. var result = {};
  13923. iteratee = getIteratee(iteratee, 3);
  13924. baseForOwn(object, function(value, key, object) {
  13925. baseAssignValue(result, key, iteratee(value, key, object));
  13926. });
  13927. return result;
  13928. }
  13929. /**
  13930. * This method is like `_.assign` except that it recursively merges own and
  13931. * inherited enumerable string keyed properties of source objects into the
  13932. * destination object. Source properties that resolve to `undefined` are
  13933. * skipped if a destination value exists. Array and plain object properties
  13934. * are merged recursively. Other objects and value types are overridden by
  13935. * assignment. Source objects are applied from left to right. Subsequent
  13936. * sources overwrite property assignments of previous sources.
  13937. *
  13938. * **Note:** This method mutates `object`.
  13939. *
  13940. * @static
  13941. * @memberOf _
  13942. * @since 0.5.0
  13943. * @category Object
  13944. * @param {Object} object The destination object.
  13945. * @param {...Object} [sources] The source objects.
  13946. * @returns {Object} Returns `object`.
  13947. * @example
  13948. *
  13949. * var object = {
  13950. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13951. * };
  13952. *
  13953. * var other = {
  13954. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13955. * };
  13956. *
  13957. * _.merge(object, other);
  13958. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13959. */
  13960. var merge = createAssigner(function(object, source, srcIndex) {
  13961. baseMerge(object, source, srcIndex);
  13962. });
  13963. /**
  13964. * This method is like `_.merge` except that it accepts `customizer` which
  13965. * is invoked to produce the merged values of the destination and source
  13966. * properties. If `customizer` returns `undefined`, merging is handled by the
  13967. * method instead. The `customizer` is invoked with six arguments:
  13968. * (objValue, srcValue, key, object, source, stack).
  13969. *
  13970. * **Note:** This method mutates `object`.
  13971. *
  13972. * @static
  13973. * @memberOf _
  13974. * @since 4.0.0
  13975. * @category Object
  13976. * @param {Object} object The destination object.
  13977. * @param {...Object} sources The source objects.
  13978. * @param {Function} customizer The function to customize assigned values.
  13979. * @returns {Object} Returns `object`.
  13980. * @example
  13981. *
  13982. * function customizer(objValue, srcValue) {
  13983. * if (_.isArray(objValue)) {
  13984. * return objValue.concat(srcValue);
  13985. * }
  13986. * }
  13987. *
  13988. * var object = { 'a': [1], 'b': [2] };
  13989. * var other = { 'a': [3], 'b': [4] };
  13990. *
  13991. * _.mergeWith(object, other, customizer);
  13992. * // => { 'a': [1, 3], 'b': [2, 4] }
  13993. */
  13994. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13995. baseMerge(object, source, srcIndex, customizer);
  13996. });
  13997. /**
  13998. * The opposite of `_.pick`; this method creates an object composed of the
  13999. * own and inherited enumerable property paths of `object` that are not omitted.
  14000. *
  14001. * **Note:** This method is considerably slower than `_.pick`.
  14002. *
  14003. * @static
  14004. * @since 0.1.0
  14005. * @memberOf _
  14006. * @category Object
  14007. * @param {Object} object The source object.
  14008. * @param {...(string|string[])} [paths] The property paths to omit.
  14009. * @returns {Object} Returns the new object.
  14010. * @example
  14011. *
  14012. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14013. *
  14014. * _.omit(object, ['a', 'c']);
  14015. * // => { 'b': '2' }
  14016. */
  14017. var omit = flatRest(function(object, paths) {
  14018. var result = {};
  14019. if (object == null) {
  14020. return result;
  14021. }
  14022. var isDeep = false;
  14023. paths = arrayMap(paths, function(path) {
  14024. path = castPath(path, object);
  14025. isDeep || (isDeep = path.length > 1);
  14026. return path;
  14027. });
  14028. copyObject(object, getAllKeysIn(object), result);
  14029. if (isDeep) {
  14030. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14031. }
  14032. var length = paths.length;
  14033. while (length--) {
  14034. baseUnset(result, paths[length]);
  14035. }
  14036. return result;
  14037. });
  14038. /**
  14039. * The opposite of `_.pickBy`; this method creates an object composed of
  14040. * the own and inherited enumerable string keyed properties of `object` that
  14041. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14042. * arguments: (value, key).
  14043. *
  14044. * @static
  14045. * @memberOf _
  14046. * @since 4.0.0
  14047. * @category Object
  14048. * @param {Object} object The source object.
  14049. * @param {Function} [predicate=_.identity] The function invoked per property.
  14050. * @returns {Object} Returns the new object.
  14051. * @example
  14052. *
  14053. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14054. *
  14055. * _.omitBy(object, _.isNumber);
  14056. * // => { 'b': '2' }
  14057. */
  14058. function omitBy(object, predicate) {
  14059. return pickBy(object, negate(getIteratee(predicate)));
  14060. }
  14061. /**
  14062. * Creates an object composed of the picked `object` properties.
  14063. *
  14064. * @static
  14065. * @since 0.1.0
  14066. * @memberOf _
  14067. * @category Object
  14068. * @param {Object} object The source object.
  14069. * @param {...(string|string[])} [paths] The property paths to pick.
  14070. * @returns {Object} Returns the new object.
  14071. * @example
  14072. *
  14073. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14074. *
  14075. * _.pick(object, ['a', 'c']);
  14076. * // => { 'a': 1, 'c': 3 }
  14077. */
  14078. var pick = flatRest(function(object, paths) {
  14079. return object == null ? {} : basePick(object, paths);
  14080. });
  14081. /**
  14082. * Creates an object composed of the `object` properties `predicate` returns
  14083. * truthy for. The predicate is invoked with two arguments: (value, key).
  14084. *
  14085. * @static
  14086. * @memberOf _
  14087. * @since 4.0.0
  14088. * @category Object
  14089. * @param {Object} object The source object.
  14090. * @param {Function} [predicate=_.identity] The function invoked per property.
  14091. * @returns {Object} Returns the new object.
  14092. * @example
  14093. *
  14094. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14095. *
  14096. * _.pickBy(object, _.isNumber);
  14097. * // => { 'a': 1, 'c': 3 }
  14098. */
  14099. function pickBy(object, predicate) {
  14100. if (object == null) {
  14101. return {};
  14102. }
  14103. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14104. return [prop];
  14105. });
  14106. predicate = getIteratee(predicate);
  14107. return basePickBy(object, props, function(value, path) {
  14108. return predicate(value, path[0]);
  14109. });
  14110. }
  14111. /**
  14112. * This method is like `_.get` except that if the resolved value is a
  14113. * function it's invoked with the `this` binding of its parent object and
  14114. * its result is returned.
  14115. *
  14116. * @static
  14117. * @since 0.1.0
  14118. * @memberOf _
  14119. * @category Object
  14120. * @param {Object} object The object to query.
  14121. * @param {Array|string} path The path of the property to resolve.
  14122. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14123. * @returns {*} Returns the resolved value.
  14124. * @example
  14125. *
  14126. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14127. *
  14128. * _.result(object, 'a[0].b.c1');
  14129. * // => 3
  14130. *
  14131. * _.result(object, 'a[0].b.c2');
  14132. * // => 4
  14133. *
  14134. * _.result(object, 'a[0].b.c3', 'default');
  14135. * // => 'default'
  14136. *
  14137. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14138. * // => 'default'
  14139. */
  14140. function result(object, path, defaultValue) {
  14141. path = castPath(path, object);
  14142. var index = -1,
  14143. length = path.length;
  14144. // Ensure the loop is entered when path is empty.
  14145. if (!length) {
  14146. length = 1;
  14147. object = undefined;
  14148. }
  14149. while (++index < length) {
  14150. var value = object == null ? undefined : object[toKey(path[index])];
  14151. if (value === undefined) {
  14152. index = length;
  14153. value = defaultValue;
  14154. }
  14155. object = isFunction(value) ? value.call(object) : value;
  14156. }
  14157. return object;
  14158. }
  14159. /**
  14160. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14161. * it's created. Arrays are created for missing index properties while objects
  14162. * are created for all other missing properties. Use `_.setWith` to customize
  14163. * `path` creation.
  14164. *
  14165. * **Note:** This method mutates `object`.
  14166. *
  14167. * @static
  14168. * @memberOf _
  14169. * @since 3.7.0
  14170. * @category Object
  14171. * @param {Object} object The object to modify.
  14172. * @param {Array|string} path The path of the property to set.
  14173. * @param {*} value The value to set.
  14174. * @returns {Object} Returns `object`.
  14175. * @example
  14176. *
  14177. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14178. *
  14179. * _.set(object, 'a[0].b.c', 4);
  14180. * console.log(object.a[0].b.c);
  14181. * // => 4
  14182. *
  14183. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14184. * console.log(object.x[0].y.z);
  14185. * // => 5
  14186. */
  14187. function set(object, path, value) {
  14188. return object == null ? object : baseSet(object, path, value);
  14189. }
  14190. /**
  14191. * This method is like `_.set` except that it accepts `customizer` which is
  14192. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14193. * path creation is handled by the method instead. The `customizer` is invoked
  14194. * with three arguments: (nsValue, key, nsObject).
  14195. *
  14196. * **Note:** This method mutates `object`.
  14197. *
  14198. * @static
  14199. * @memberOf _
  14200. * @since 4.0.0
  14201. * @category Object
  14202. * @param {Object} object The object to modify.
  14203. * @param {Array|string} path The path of the property to set.
  14204. * @param {*} value The value to set.
  14205. * @param {Function} [customizer] The function to customize assigned values.
  14206. * @returns {Object} Returns `object`.
  14207. * @example
  14208. *
  14209. * var object = {};
  14210. *
  14211. * _.setWith(object, '[0][1]', 'a', Object);
  14212. * // => { '0': { '1': 'a' } }
  14213. */
  14214. function setWith(object, path, value, customizer) {
  14215. customizer = typeof customizer == 'function' ? customizer : undefined;
  14216. return object == null ? object : baseSet(object, path, value, customizer);
  14217. }
  14218. /**
  14219. * Creates an array of own enumerable string keyed-value pairs for `object`
  14220. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14221. * entries are returned.
  14222. *
  14223. * @static
  14224. * @memberOf _
  14225. * @since 4.0.0
  14226. * @alias entries
  14227. * @category Object
  14228. * @param {Object} object The object to query.
  14229. * @returns {Array} Returns the key-value pairs.
  14230. * @example
  14231. *
  14232. * function Foo() {
  14233. * this.a = 1;
  14234. * this.b = 2;
  14235. * }
  14236. *
  14237. * Foo.prototype.c = 3;
  14238. *
  14239. * _.toPairs(new Foo);
  14240. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14241. */
  14242. var toPairs = createToPairs(keys);
  14243. /**
  14244. * Creates an array of own and inherited enumerable string keyed-value pairs
  14245. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14246. * or set, its entries are returned.
  14247. *
  14248. * @static
  14249. * @memberOf _
  14250. * @since 4.0.0
  14251. * @alias entriesIn
  14252. * @category Object
  14253. * @param {Object} object The object to query.
  14254. * @returns {Array} Returns the key-value pairs.
  14255. * @example
  14256. *
  14257. * function Foo() {
  14258. * this.a = 1;
  14259. * this.b = 2;
  14260. * }
  14261. *
  14262. * Foo.prototype.c = 3;
  14263. *
  14264. * _.toPairsIn(new Foo);
  14265. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14266. */
  14267. var toPairsIn = createToPairs(keysIn);
  14268. /**
  14269. * An alternative to `_.reduce`; this method transforms `object` to a new
  14270. * `accumulator` object which is the result of running each of its own
  14271. * enumerable string keyed properties thru `iteratee`, with each invocation
  14272. * potentially mutating the `accumulator` object. If `accumulator` is not
  14273. * provided, a new object with the same `[[Prototype]]` will be used. The
  14274. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14275. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14276. *
  14277. * @static
  14278. * @memberOf _
  14279. * @since 1.3.0
  14280. * @category Object
  14281. * @param {Object} object The object to iterate over.
  14282. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14283. * @param {*} [accumulator] The custom accumulator value.
  14284. * @returns {*} Returns the accumulated value.
  14285. * @example
  14286. *
  14287. * _.transform([2, 3, 4], function(result, n) {
  14288. * result.push(n *= n);
  14289. * return n % 2 == 0;
  14290. * }, []);
  14291. * // => [4, 9]
  14292. *
  14293. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14294. * (result[value] || (result[value] = [])).push(key);
  14295. * }, {});
  14296. * // => { '1': ['a', 'c'], '2': ['b'] }
  14297. */
  14298. function transform(object, iteratee, accumulator) {
  14299. var isArr = isArray(object),
  14300. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14301. iteratee = getIteratee(iteratee, 4);
  14302. if (accumulator == null) {
  14303. var Ctor = object && object.constructor;
  14304. if (isArrLike) {
  14305. accumulator = isArr ? new Ctor : [];
  14306. }
  14307. else if (isObject(object)) {
  14308. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14309. }
  14310. else {
  14311. accumulator = {};
  14312. }
  14313. }
  14314. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14315. return iteratee(accumulator, value, index, object);
  14316. });
  14317. return accumulator;
  14318. }
  14319. /**
  14320. * Removes the property at `path` of `object`.
  14321. *
  14322. * **Note:** This method mutates `object`.
  14323. *
  14324. * @static
  14325. * @memberOf _
  14326. * @since 4.0.0
  14327. * @category Object
  14328. * @param {Object} object The object to modify.
  14329. * @param {Array|string} path The path of the property to unset.
  14330. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14331. * @example
  14332. *
  14333. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14334. * _.unset(object, 'a[0].b.c');
  14335. * // => true
  14336. *
  14337. * console.log(object);
  14338. * // => { 'a': [{ 'b': {} }] };
  14339. *
  14340. * _.unset(object, ['a', '0', 'b', 'c']);
  14341. * // => true
  14342. *
  14343. * console.log(object);
  14344. * // => { 'a': [{ 'b': {} }] };
  14345. */
  14346. function unset(object, path) {
  14347. return object == null ? true : baseUnset(object, path);
  14348. }
  14349. /**
  14350. * This method is like `_.set` except that accepts `updater` to produce the
  14351. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14352. * is invoked with one argument: (value).
  14353. *
  14354. * **Note:** This method mutates `object`.
  14355. *
  14356. * @static
  14357. * @memberOf _
  14358. * @since 4.6.0
  14359. * @category Object
  14360. * @param {Object} object The object to modify.
  14361. * @param {Array|string} path The path of the property to set.
  14362. * @param {Function} updater The function to produce the updated value.
  14363. * @returns {Object} Returns `object`.
  14364. * @example
  14365. *
  14366. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14367. *
  14368. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14369. * console.log(object.a[0].b.c);
  14370. * // => 9
  14371. *
  14372. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14373. * console.log(object.x[0].y.z);
  14374. * // => 0
  14375. */
  14376. function update(object, path, updater) {
  14377. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14378. }
  14379. /**
  14380. * This method is like `_.update` except that it accepts `customizer` which is
  14381. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14382. * path creation is handled by the method instead. The `customizer` is invoked
  14383. * with three arguments: (nsValue, key, nsObject).
  14384. *
  14385. * **Note:** This method mutates `object`.
  14386. *
  14387. * @static
  14388. * @memberOf _
  14389. * @since 4.6.0
  14390. * @category Object
  14391. * @param {Object} object The object to modify.
  14392. * @param {Array|string} path The path of the property to set.
  14393. * @param {Function} updater The function to produce the updated value.
  14394. * @param {Function} [customizer] The function to customize assigned values.
  14395. * @returns {Object} Returns `object`.
  14396. * @example
  14397. *
  14398. * var object = {};
  14399. *
  14400. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14401. * // => { '0': { '1': 'a' } }
  14402. */
  14403. function updateWith(object, path, updater, customizer) {
  14404. customizer = typeof customizer == 'function' ? customizer : undefined;
  14405. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14406. }
  14407. /**
  14408. * Creates an array of the own enumerable string keyed property values of `object`.
  14409. *
  14410. * **Note:** Non-object values are coerced to objects.
  14411. *
  14412. * @static
  14413. * @since 0.1.0
  14414. * @memberOf _
  14415. * @category Object
  14416. * @param {Object} object The object to query.
  14417. * @returns {Array} Returns the array of property values.
  14418. * @example
  14419. *
  14420. * function Foo() {
  14421. * this.a = 1;
  14422. * this.b = 2;
  14423. * }
  14424. *
  14425. * Foo.prototype.c = 3;
  14426. *
  14427. * _.values(new Foo);
  14428. * // => [1, 2] (iteration order is not guaranteed)
  14429. *
  14430. * _.values('hi');
  14431. * // => ['h', 'i']
  14432. */
  14433. function values(object) {
  14434. return object == null ? [] : baseValues(object, keys(object));
  14435. }
  14436. /**
  14437. * Creates an array of the own and inherited enumerable string keyed property
  14438. * values of `object`.
  14439. *
  14440. * **Note:** Non-object values are coerced to objects.
  14441. *
  14442. * @static
  14443. * @memberOf _
  14444. * @since 3.0.0
  14445. * @category Object
  14446. * @param {Object} object The object to query.
  14447. * @returns {Array} Returns the array of property values.
  14448. * @example
  14449. *
  14450. * function Foo() {
  14451. * this.a = 1;
  14452. * this.b = 2;
  14453. * }
  14454. *
  14455. * Foo.prototype.c = 3;
  14456. *
  14457. * _.valuesIn(new Foo);
  14458. * // => [1, 2, 3] (iteration order is not guaranteed)
  14459. */
  14460. function valuesIn(object) {
  14461. return object == null ? [] : baseValues(object, keysIn(object));
  14462. }
  14463. /*------------------------------------------------------------------------*/
  14464. /**
  14465. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14466. *
  14467. * @static
  14468. * @memberOf _
  14469. * @since 4.0.0
  14470. * @category Number
  14471. * @param {number} number The number to clamp.
  14472. * @param {number} [lower] The lower bound.
  14473. * @param {number} upper The upper bound.
  14474. * @returns {number} Returns the clamped number.
  14475. * @example
  14476. *
  14477. * _.clamp(-10, -5, 5);
  14478. * // => -5
  14479. *
  14480. * _.clamp(10, -5, 5);
  14481. * // => 5
  14482. */
  14483. function clamp(number, lower, upper) {
  14484. if (upper === undefined) {
  14485. upper = lower;
  14486. lower = undefined;
  14487. }
  14488. if (upper !== undefined) {
  14489. upper = toNumber(upper);
  14490. upper = upper === upper ? upper : 0;
  14491. }
  14492. if (lower !== undefined) {
  14493. lower = toNumber(lower);
  14494. lower = lower === lower ? lower : 0;
  14495. }
  14496. return baseClamp(toNumber(number), lower, upper);
  14497. }
  14498. /**
  14499. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14500. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14501. * If `start` is greater than `end` the params are swapped to support
  14502. * negative ranges.
  14503. *
  14504. * @static
  14505. * @memberOf _
  14506. * @since 3.3.0
  14507. * @category Number
  14508. * @param {number} number The number to check.
  14509. * @param {number} [start=0] The start of the range.
  14510. * @param {number} end The end of the range.
  14511. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14512. * @see _.range, _.rangeRight
  14513. * @example
  14514. *
  14515. * _.inRange(3, 2, 4);
  14516. * // => true
  14517. *
  14518. * _.inRange(4, 8);
  14519. * // => true
  14520. *
  14521. * _.inRange(4, 2);
  14522. * // => false
  14523. *
  14524. * _.inRange(2, 2);
  14525. * // => false
  14526. *
  14527. * _.inRange(1.2, 2);
  14528. * // => true
  14529. *
  14530. * _.inRange(5.2, 4);
  14531. * // => false
  14532. *
  14533. * _.inRange(-3, -2, -6);
  14534. * // => true
  14535. */
  14536. function inRange(number, start, end) {
  14537. start = toFinite(start);
  14538. if (end === undefined) {
  14539. end = start;
  14540. start = 0;
  14541. } else {
  14542. end = toFinite(end);
  14543. }
  14544. number = toNumber(number);
  14545. return baseInRange(number, start, end);
  14546. }
  14547. /**
  14548. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14549. * If only one argument is provided a number between `0` and the given number
  14550. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14551. * floats, a floating-point number is returned instead of an integer.
  14552. *
  14553. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14554. * floating-point values which can produce unexpected results.
  14555. *
  14556. * @static
  14557. * @memberOf _
  14558. * @since 0.7.0
  14559. * @category Number
  14560. * @param {number} [lower=0] The lower bound.
  14561. * @param {number} [upper=1] The upper bound.
  14562. * @param {boolean} [floating] Specify returning a floating-point number.
  14563. * @returns {number} Returns the random number.
  14564. * @example
  14565. *
  14566. * _.random(0, 5);
  14567. * // => an integer between 0 and 5
  14568. *
  14569. * _.random(5);
  14570. * // => also an integer between 0 and 5
  14571. *
  14572. * _.random(5, true);
  14573. * // => a floating-point number between 0 and 5
  14574. *
  14575. * _.random(1.2, 5.2);
  14576. * // => a floating-point number between 1.2 and 5.2
  14577. */
  14578. function random(lower, upper, floating) {
  14579. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14580. upper = floating = undefined;
  14581. }
  14582. if (floating === undefined) {
  14583. if (typeof upper == 'boolean') {
  14584. floating = upper;
  14585. upper = undefined;
  14586. }
  14587. else if (typeof lower == 'boolean') {
  14588. floating = lower;
  14589. lower = undefined;
  14590. }
  14591. }
  14592. if (lower === undefined && upper === undefined) {
  14593. lower = 0;
  14594. upper = 1;
  14595. }
  14596. else {
  14597. lower = toFinite(lower);
  14598. if (upper === undefined) {
  14599. upper = lower;
  14600. lower = 0;
  14601. } else {
  14602. upper = toFinite(upper);
  14603. }
  14604. }
  14605. if (lower > upper) {
  14606. var temp = lower;
  14607. lower = upper;
  14608. upper = temp;
  14609. }
  14610. if (floating || lower % 1 || upper % 1) {
  14611. var rand = nativeRandom();
  14612. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14613. }
  14614. return baseRandom(lower, upper);
  14615. }
  14616. /*------------------------------------------------------------------------*/
  14617. /**
  14618. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14619. *
  14620. * @static
  14621. * @memberOf _
  14622. * @since 3.0.0
  14623. * @category String
  14624. * @param {string} [string=''] The string to convert.
  14625. * @returns {string} Returns the camel cased string.
  14626. * @example
  14627. *
  14628. * _.camelCase('Foo Bar');
  14629. * // => 'fooBar'
  14630. *
  14631. * _.camelCase('--foo-bar--');
  14632. * // => 'fooBar'
  14633. *
  14634. * _.camelCase('__FOO_BAR__');
  14635. * // => 'fooBar'
  14636. */
  14637. var camelCase = createCompounder(function(result, word, index) {
  14638. word = word.toLowerCase();
  14639. return result + (index ? capitalize(word) : word);
  14640. });
  14641. /**
  14642. * Converts the first character of `string` to upper case and the remaining
  14643. * to lower case.
  14644. *
  14645. * @static
  14646. * @memberOf _
  14647. * @since 3.0.0
  14648. * @category String
  14649. * @param {string} [string=''] The string to capitalize.
  14650. * @returns {string} Returns the capitalized string.
  14651. * @example
  14652. *
  14653. * _.capitalize('FRED');
  14654. * // => 'Fred'
  14655. */
  14656. function capitalize(string) {
  14657. return upperFirst(toString(string).toLowerCase());
  14658. }
  14659. /**
  14660. * Deburrs `string` by converting
  14661. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14662. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14663. * letters to basic Latin letters and removing
  14664. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14665. *
  14666. * @static
  14667. * @memberOf _
  14668. * @since 3.0.0
  14669. * @category String
  14670. * @param {string} [string=''] The string to deburr.
  14671. * @returns {string} Returns the deburred string.
  14672. * @example
  14673. *
  14674. * _.deburr('déjà vu');
  14675. * // => 'deja vu'
  14676. */
  14677. function deburr(string) {
  14678. string = toString(string);
  14679. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14680. }
  14681. /**
  14682. * Checks if `string` ends with the given target string.
  14683. *
  14684. * @static
  14685. * @memberOf _
  14686. * @since 3.0.0
  14687. * @category String
  14688. * @param {string} [string=''] The string to inspect.
  14689. * @param {string} [target] The string to search for.
  14690. * @param {number} [position=string.length] The position to search up to.
  14691. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14692. * else `false`.
  14693. * @example
  14694. *
  14695. * _.endsWith('abc', 'c');
  14696. * // => true
  14697. *
  14698. * _.endsWith('abc', 'b');
  14699. * // => false
  14700. *
  14701. * _.endsWith('abc', 'b', 2);
  14702. * // => true
  14703. */
  14704. function endsWith(string, target, position) {
  14705. string = toString(string);
  14706. target = baseToString(target);
  14707. var length = string.length;
  14708. position = position === undefined
  14709. ? length
  14710. : baseClamp(toInteger(position), 0, length);
  14711. var end = position;
  14712. position -= target.length;
  14713. return position >= 0 && string.slice(position, end) == target;
  14714. }
  14715. /**
  14716. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14717. * corresponding HTML entities.
  14718. *
  14719. * **Note:** No other characters are escaped. To escape additional
  14720. * characters use a third-party library like [_he_](https://mths.be/he).
  14721. *
  14722. * Though the ">" character is escaped for symmetry, characters like
  14723. * ">" and "/" don't need escaping in HTML and have no special meaning
  14724. * unless they're part of a tag or unquoted attribute value. See
  14725. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14726. * (under "semi-related fun fact") for more details.
  14727. *
  14728. * When working with HTML you should always
  14729. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14730. * XSS vectors.
  14731. *
  14732. * @static
  14733. * @since 0.1.0
  14734. * @memberOf _
  14735. * @category String
  14736. * @param {string} [string=''] The string to escape.
  14737. * @returns {string} Returns the escaped string.
  14738. * @example
  14739. *
  14740. * _.escape('fred, barney, & pebbles');
  14741. * // => 'fred, barney, &amp; pebbles'
  14742. */
  14743. function escape(string) {
  14744. string = toString(string);
  14745. return (string && reHasUnescapedHtml.test(string))
  14746. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14747. : string;
  14748. }
  14749. /**
  14750. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14751. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14752. *
  14753. * @static
  14754. * @memberOf _
  14755. * @since 3.0.0
  14756. * @category String
  14757. * @param {string} [string=''] The string to escape.
  14758. * @returns {string} Returns the escaped string.
  14759. * @example
  14760. *
  14761. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14762. * // => '\[lodash\]\(https://lodash\.com/\)'
  14763. */
  14764. function escapeRegExp(string) {
  14765. string = toString(string);
  14766. return (string && reHasRegExpChar.test(string))
  14767. ? string.replace(reRegExpChar, '\\$&')
  14768. : string;
  14769. }
  14770. /**
  14771. * Converts `string` to
  14772. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14773. *
  14774. * @static
  14775. * @memberOf _
  14776. * @since 3.0.0
  14777. * @category String
  14778. * @param {string} [string=''] The string to convert.
  14779. * @returns {string} Returns the kebab cased string.
  14780. * @example
  14781. *
  14782. * _.kebabCase('Foo Bar');
  14783. * // => 'foo-bar'
  14784. *
  14785. * _.kebabCase('fooBar');
  14786. * // => 'foo-bar'
  14787. *
  14788. * _.kebabCase('__FOO_BAR__');
  14789. * // => 'foo-bar'
  14790. */
  14791. var kebabCase = createCompounder(function(result, word, index) {
  14792. return result + (index ? '-' : '') + word.toLowerCase();
  14793. });
  14794. /**
  14795. * Converts `string`, as space separated words, to lower case.
  14796. *
  14797. * @static
  14798. * @memberOf _
  14799. * @since 4.0.0
  14800. * @category String
  14801. * @param {string} [string=''] The string to convert.
  14802. * @returns {string} Returns the lower cased string.
  14803. * @example
  14804. *
  14805. * _.lowerCase('--Foo-Bar--');
  14806. * // => 'foo bar'
  14807. *
  14808. * _.lowerCase('fooBar');
  14809. * // => 'foo bar'
  14810. *
  14811. * _.lowerCase('__FOO_BAR__');
  14812. * // => 'foo bar'
  14813. */
  14814. var lowerCase = createCompounder(function(result, word, index) {
  14815. return result + (index ? ' ' : '') + word.toLowerCase();
  14816. });
  14817. /**
  14818. * Converts the first character of `string` to lower case.
  14819. *
  14820. * @static
  14821. * @memberOf _
  14822. * @since 4.0.0
  14823. * @category String
  14824. * @param {string} [string=''] The string to convert.
  14825. * @returns {string} Returns the converted string.
  14826. * @example
  14827. *
  14828. * _.lowerFirst('Fred');
  14829. * // => 'fred'
  14830. *
  14831. * _.lowerFirst('FRED');
  14832. * // => 'fRED'
  14833. */
  14834. var lowerFirst = createCaseFirst('toLowerCase');
  14835. /**
  14836. * Pads `string` on the left and right sides if it's shorter than `length`.
  14837. * Padding characters are truncated if they can't be evenly divided by `length`.
  14838. *
  14839. * @static
  14840. * @memberOf _
  14841. * @since 3.0.0
  14842. * @category String
  14843. * @param {string} [string=''] The string to pad.
  14844. * @param {number} [length=0] The padding length.
  14845. * @param {string} [chars=' '] The string used as padding.
  14846. * @returns {string} Returns the padded string.
  14847. * @example
  14848. *
  14849. * _.pad('abc', 8);
  14850. * // => ' abc '
  14851. *
  14852. * _.pad('abc', 8, '_-');
  14853. * // => '_-abc_-_'
  14854. *
  14855. * _.pad('abc', 3);
  14856. * // => 'abc'
  14857. */
  14858. function pad(string, length, chars) {
  14859. string = toString(string);
  14860. length = toInteger(length);
  14861. var strLength = length ? stringSize(string) : 0;
  14862. if (!length || strLength >= length) {
  14863. return string;
  14864. }
  14865. var mid = (length - strLength) / 2;
  14866. return (
  14867. createPadding(nativeFloor(mid), chars) +
  14868. string +
  14869. createPadding(nativeCeil(mid), chars)
  14870. );
  14871. }
  14872. /**
  14873. * Pads `string` on the right side if it's shorter than `length`. Padding
  14874. * characters are truncated if they exceed `length`.
  14875. *
  14876. * @static
  14877. * @memberOf _
  14878. * @since 4.0.0
  14879. * @category String
  14880. * @param {string} [string=''] The string to pad.
  14881. * @param {number} [length=0] The padding length.
  14882. * @param {string} [chars=' '] The string used as padding.
  14883. * @returns {string} Returns the padded string.
  14884. * @example
  14885. *
  14886. * _.padEnd('abc', 6);
  14887. * // => 'abc '
  14888. *
  14889. * _.padEnd('abc', 6, '_-');
  14890. * // => 'abc_-_'
  14891. *
  14892. * _.padEnd('abc', 3);
  14893. * // => 'abc'
  14894. */
  14895. function padEnd(string, length, chars) {
  14896. string = toString(string);
  14897. length = toInteger(length);
  14898. var strLength = length ? stringSize(string) : 0;
  14899. return (length && strLength < length)
  14900. ? (string + createPadding(length - strLength, chars))
  14901. : string;
  14902. }
  14903. /**
  14904. * Pads `string` on the left side if it's shorter than `length`. Padding
  14905. * characters are truncated if they exceed `length`.
  14906. *
  14907. * @static
  14908. * @memberOf _
  14909. * @since 4.0.0
  14910. * @category String
  14911. * @param {string} [string=''] The string to pad.
  14912. * @param {number} [length=0] The padding length.
  14913. * @param {string} [chars=' '] The string used as padding.
  14914. * @returns {string} Returns the padded string.
  14915. * @example
  14916. *
  14917. * _.padStart('abc', 6);
  14918. * // => ' abc'
  14919. *
  14920. * _.padStart('abc', 6, '_-');
  14921. * // => '_-_abc'
  14922. *
  14923. * _.padStart('abc', 3);
  14924. * // => 'abc'
  14925. */
  14926. function padStart(string, length, chars) {
  14927. string = toString(string);
  14928. length = toInteger(length);
  14929. var strLength = length ? stringSize(string) : 0;
  14930. return (length && strLength < length)
  14931. ? (createPadding(length - strLength, chars) + string)
  14932. : string;
  14933. }
  14934. /**
  14935. * Converts `string` to an integer of the specified radix. If `radix` is
  14936. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14937. * hexadecimal, in which case a `radix` of `16` is used.
  14938. *
  14939. * **Note:** This method aligns with the
  14940. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14941. *
  14942. * @static
  14943. * @memberOf _
  14944. * @since 1.1.0
  14945. * @category String
  14946. * @param {string} string The string to convert.
  14947. * @param {number} [radix=10] The radix to interpret `value` by.
  14948. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14949. * @returns {number} Returns the converted integer.
  14950. * @example
  14951. *
  14952. * _.parseInt('08');
  14953. * // => 8
  14954. *
  14955. * _.map(['6', '08', '10'], _.parseInt);
  14956. * // => [6, 8, 10]
  14957. */
  14958. function parseInt(string, radix, guard) {
  14959. if (guard || radix == null) {
  14960. radix = 0;
  14961. } else if (radix) {
  14962. radix = +radix;
  14963. }
  14964. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14965. }
  14966. /**
  14967. * Repeats the given string `n` times.
  14968. *
  14969. * @static
  14970. * @memberOf _
  14971. * @since 3.0.0
  14972. * @category String
  14973. * @param {string} [string=''] The string to repeat.
  14974. * @param {number} [n=1] The number of times to repeat the string.
  14975. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14976. * @returns {string} Returns the repeated string.
  14977. * @example
  14978. *
  14979. * _.repeat('*', 3);
  14980. * // => '***'
  14981. *
  14982. * _.repeat('abc', 2);
  14983. * // => 'abcabc'
  14984. *
  14985. * _.repeat('abc', 0);
  14986. * // => ''
  14987. */
  14988. function repeat(string, n, guard) {
  14989. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14990. n = 1;
  14991. } else {
  14992. n = toInteger(n);
  14993. }
  14994. return baseRepeat(toString(string), n);
  14995. }
  14996. /**
  14997. * Replaces matches for `pattern` in `string` with `replacement`.
  14998. *
  14999. * **Note:** This method is based on
  15000. * [`String#replace`](https://mdn.io/String/replace).
  15001. *
  15002. * @static
  15003. * @memberOf _
  15004. * @since 4.0.0
  15005. * @category String
  15006. * @param {string} [string=''] The string to modify.
  15007. * @param {RegExp|string} pattern The pattern to replace.
  15008. * @param {Function|string} replacement The match replacement.
  15009. * @returns {string} Returns the modified string.
  15010. * @example
  15011. *
  15012. * _.replace('Hi Fred', 'Fred', 'Barney');
  15013. * // => 'Hi Barney'
  15014. */
  15015. function replace() {
  15016. var args = arguments,
  15017. string = toString(args[0]);
  15018. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15019. }
  15020. /**
  15021. * Converts `string` to
  15022. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15023. *
  15024. * @static
  15025. * @memberOf _
  15026. * @since 3.0.0
  15027. * @category String
  15028. * @param {string} [string=''] The string to convert.
  15029. * @returns {string} Returns the snake cased string.
  15030. * @example
  15031. *
  15032. * _.snakeCase('Foo Bar');
  15033. * // => 'foo_bar'
  15034. *
  15035. * _.snakeCase('fooBar');
  15036. * // => 'foo_bar'
  15037. *
  15038. * _.snakeCase('--FOO-BAR--');
  15039. * // => 'foo_bar'
  15040. */
  15041. var snakeCase = createCompounder(function(result, word, index) {
  15042. return result + (index ? '_' : '') + word.toLowerCase();
  15043. });
  15044. /**
  15045. * Splits `string` by `separator`.
  15046. *
  15047. * **Note:** This method is based on
  15048. * [`String#split`](https://mdn.io/String/split).
  15049. *
  15050. * @static
  15051. * @memberOf _
  15052. * @since 4.0.0
  15053. * @category String
  15054. * @param {string} [string=''] The string to split.
  15055. * @param {RegExp|string} separator The separator pattern to split by.
  15056. * @param {number} [limit] The length to truncate results to.
  15057. * @returns {Array} Returns the string segments.
  15058. * @example
  15059. *
  15060. * _.split('a-b-c', '-', 2);
  15061. * // => ['a', 'b']
  15062. */
  15063. function split(string, separator, limit) {
  15064. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15065. separator = limit = undefined;
  15066. }
  15067. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15068. if (!limit) {
  15069. return [];
  15070. }
  15071. string = toString(string);
  15072. if (string && (
  15073. typeof separator == 'string' ||
  15074. (separator != null && !isRegExp(separator))
  15075. )) {
  15076. separator = baseToString(separator);
  15077. if (!separator && hasUnicode(string)) {
  15078. return castSlice(stringToArray(string), 0, limit);
  15079. }
  15080. }
  15081. return string.split(separator, limit);
  15082. }
  15083. /**
  15084. * Converts `string` to
  15085. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15086. *
  15087. * @static
  15088. * @memberOf _
  15089. * @since 3.1.0
  15090. * @category String
  15091. * @param {string} [string=''] The string to convert.
  15092. * @returns {string} Returns the start cased string.
  15093. * @example
  15094. *
  15095. * _.startCase('--foo-bar--');
  15096. * // => 'Foo Bar'
  15097. *
  15098. * _.startCase('fooBar');
  15099. * // => 'Foo Bar'
  15100. *
  15101. * _.startCase('__FOO_BAR__');
  15102. * // => 'FOO BAR'
  15103. */
  15104. var startCase = createCompounder(function(result, word, index) {
  15105. return result + (index ? ' ' : '') + upperFirst(word);
  15106. });
  15107. /**
  15108. * Checks if `string` starts with the given target string.
  15109. *
  15110. * @static
  15111. * @memberOf _
  15112. * @since 3.0.0
  15113. * @category String
  15114. * @param {string} [string=''] The string to inspect.
  15115. * @param {string} [target] The string to search for.
  15116. * @param {number} [position=0] The position to search from.
  15117. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15118. * else `false`.
  15119. * @example
  15120. *
  15121. * _.startsWith('abc', 'a');
  15122. * // => true
  15123. *
  15124. * _.startsWith('abc', 'b');
  15125. * // => false
  15126. *
  15127. * _.startsWith('abc', 'b', 1);
  15128. * // => true
  15129. */
  15130. function startsWith(string, target, position) {
  15131. string = toString(string);
  15132. position = position == null
  15133. ? 0
  15134. : baseClamp(toInteger(position), 0, string.length);
  15135. target = baseToString(target);
  15136. return string.slice(position, position + target.length) == target;
  15137. }
  15138. /**
  15139. * Creates a compiled template function that can interpolate data properties
  15140. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15141. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15142. * properties may be accessed as free variables in the template. If a setting
  15143. * object is given, it takes precedence over `_.templateSettings` values.
  15144. *
  15145. * **Note:** In the development build `_.template` utilizes
  15146. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15147. * for easier debugging.
  15148. *
  15149. * For more information on precompiling templates see
  15150. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15151. *
  15152. * For more information on Chrome extension sandboxes see
  15153. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15154. *
  15155. * @static
  15156. * @since 0.1.0
  15157. * @memberOf _
  15158. * @category String
  15159. * @param {string} [string=''] The template string.
  15160. * @param {Object} [options={}] The options object.
  15161. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15162. * The HTML "escape" delimiter.
  15163. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15164. * The "evaluate" delimiter.
  15165. * @param {Object} [options.imports=_.templateSettings.imports]
  15166. * An object to import into the template as free variables.
  15167. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15168. * The "interpolate" delimiter.
  15169. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15170. * The sourceURL of the compiled template.
  15171. * @param {string} [options.variable='obj']
  15172. * The data object variable name.
  15173. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15174. * @returns {Function} Returns the compiled template function.
  15175. * @example
  15176. *
  15177. * // Use the "interpolate" delimiter to create a compiled template.
  15178. * var compiled = _.template('hello <%= user %>!');
  15179. * compiled({ 'user': 'fred' });
  15180. * // => 'hello fred!'
  15181. *
  15182. * // Use the HTML "escape" delimiter to escape data property values.
  15183. * var compiled = _.template('<b><%- value %></b>');
  15184. * compiled({ 'value': '<script>' });
  15185. * // => '<b>&lt;script&gt;</b>'
  15186. *
  15187. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15188. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15189. * compiled({ 'users': ['fred', 'barney'] });
  15190. * // => '<li>fred</li><li>barney</li>'
  15191. *
  15192. * // Use the internal `print` function in "evaluate" delimiters.
  15193. * var compiled = _.template('<% print("hello " + user); %>!');
  15194. * compiled({ 'user': 'barney' });
  15195. * // => 'hello barney!'
  15196. *
  15197. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15198. * // Disable support by replacing the "interpolate" delimiter.
  15199. * var compiled = _.template('hello ${ user }!');
  15200. * compiled({ 'user': 'pebbles' });
  15201. * // => 'hello pebbles!'
  15202. *
  15203. * // Use backslashes to treat delimiters as plain text.
  15204. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15205. * compiled({ 'value': 'ignored' });
  15206. * // => '<%- value %>'
  15207. *
  15208. * // Use the `imports` option to import `jQuery` as `jq`.
  15209. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15210. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15211. * compiled({ 'users': ['fred', 'barney'] });
  15212. * // => '<li>fred</li><li>barney</li>'
  15213. *
  15214. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15215. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15216. * compiled(data);
  15217. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15218. *
  15219. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15220. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15221. * compiled.source;
  15222. * // => function(data) {
  15223. * // var __t, __p = '';
  15224. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15225. * // return __p;
  15226. * // }
  15227. *
  15228. * // Use custom template delimiters.
  15229. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15230. * var compiled = _.template('hello {{ user }}!');
  15231. * compiled({ 'user': 'mustache' });
  15232. * // => 'hello mustache!'
  15233. *
  15234. * // Use the `source` property to inline compiled templates for meaningful
  15235. * // line numbers in error messages and stack traces.
  15236. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15237. * var JST = {\
  15238. * "main": ' + _.template(mainText).source + '\
  15239. * };\
  15240. * ');
  15241. */
  15242. function template(string, options, guard) {
  15243. // Based on John Resig's `tmpl` implementation
  15244. // (http://ejohn.org/blog/javascript-micro-templating/)
  15245. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15246. var settings = lodash.templateSettings;
  15247. if (guard && isIterateeCall(string, options, guard)) {
  15248. options = undefined;
  15249. }
  15250. string = toString(string);
  15251. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15252. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15253. importsKeys = keys(imports),
  15254. importsValues = baseValues(imports, importsKeys);
  15255. var isEscaping,
  15256. isEvaluating,
  15257. index = 0,
  15258. interpolate = options.interpolate || reNoMatch,
  15259. source = "__p += '";
  15260. // Compile the regexp to match each delimiter.
  15261. var reDelimiters = RegExp(
  15262. (options.escape || reNoMatch).source + '|' +
  15263. interpolate.source + '|' +
  15264. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15265. (options.evaluate || reNoMatch).source + '|$'
  15266. , 'g');
  15267. // Use a sourceURL for easier debugging.
  15268. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15269. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15270. // and escape the comment, thus injecting code that gets evaled.
  15271. var sourceURL = '//# sourceURL=' +
  15272. (hasOwnProperty.call(options, 'sourceURL')
  15273. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15274. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15275. ) + '\n';
  15276. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15277. interpolateValue || (interpolateValue = esTemplateValue);
  15278. // Escape characters that can't be included in string literals.
  15279. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15280. // Replace delimiters with snippets.
  15281. if (escapeValue) {
  15282. isEscaping = true;
  15283. source += "' +\n__e(" + escapeValue + ") +\n'";
  15284. }
  15285. if (evaluateValue) {
  15286. isEvaluating = true;
  15287. source += "';\n" + evaluateValue + ";\n__p += '";
  15288. }
  15289. if (interpolateValue) {
  15290. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15291. }
  15292. index = offset + match.length;
  15293. // The JS engine embedded in Adobe products needs `match` returned in
  15294. // order to produce the correct `offset` value.
  15295. return match;
  15296. });
  15297. source += "';\n";
  15298. // If `variable` is not specified wrap a with-statement around the generated
  15299. // code to add the data object to the top of the scope chain.
  15300. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15301. if (!variable) {
  15302. source = 'with (obj) {\n' + source + '\n}\n';
  15303. }
  15304. // Throw an error if a forbidden character was found in `variable`, to prevent
  15305. // potential command injection attacks.
  15306. else if (reForbiddenIdentifierChars.test(variable)) {
  15307. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15308. }
  15309. // Cleanup code by stripping empty strings.
  15310. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15311. .replace(reEmptyStringMiddle, '$1')
  15312. .replace(reEmptyStringTrailing, '$1;');
  15313. // Frame code as the function body.
  15314. source = 'function(' + (variable || 'obj') + ') {\n' +
  15315. (variable
  15316. ? ''
  15317. : 'obj || (obj = {});\n'
  15318. ) +
  15319. "var __t, __p = ''" +
  15320. (isEscaping
  15321. ? ', __e = _.escape'
  15322. : ''
  15323. ) +
  15324. (isEvaluating
  15325. ? ', __j = Array.prototype.join;\n' +
  15326. "function print() { __p += __j.call(arguments, '') }\n"
  15327. : ';\n'
  15328. ) +
  15329. source +
  15330. 'return __p\n}';
  15331. var result = attempt(function() {
  15332. return Function(importsKeys, sourceURL + 'return ' + source)
  15333. .apply(undefined, importsValues);
  15334. });
  15335. // Provide the compiled function's source by its `toString` method or
  15336. // the `source` property as a convenience for inlining compiled templates.
  15337. result.source = source;
  15338. if (isError(result)) {
  15339. throw result;
  15340. }
  15341. return result;
  15342. }
  15343. /**
  15344. * Converts `string`, as a whole, to lower case just like
  15345. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15346. *
  15347. * @static
  15348. * @memberOf _
  15349. * @since 4.0.0
  15350. * @category String
  15351. * @param {string} [string=''] The string to convert.
  15352. * @returns {string} Returns the lower cased string.
  15353. * @example
  15354. *
  15355. * _.toLower('--Foo-Bar--');
  15356. * // => '--foo-bar--'
  15357. *
  15358. * _.toLower('fooBar');
  15359. * // => 'foobar'
  15360. *
  15361. * _.toLower('__FOO_BAR__');
  15362. * // => '__foo_bar__'
  15363. */
  15364. function toLower(value) {
  15365. return toString(value).toLowerCase();
  15366. }
  15367. /**
  15368. * Converts `string`, as a whole, to upper case just like
  15369. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15370. *
  15371. * @static
  15372. * @memberOf _
  15373. * @since 4.0.0
  15374. * @category String
  15375. * @param {string} [string=''] The string to convert.
  15376. * @returns {string} Returns the upper cased string.
  15377. * @example
  15378. *
  15379. * _.toUpper('--foo-bar--');
  15380. * // => '--FOO-BAR--'
  15381. *
  15382. * _.toUpper('fooBar');
  15383. * // => 'FOOBAR'
  15384. *
  15385. * _.toUpper('__foo_bar__');
  15386. * // => '__FOO_BAR__'
  15387. */
  15388. function toUpper(value) {
  15389. return toString(value).toUpperCase();
  15390. }
  15391. /**
  15392. * Removes leading and trailing whitespace or specified characters from `string`.
  15393. *
  15394. * @static
  15395. * @memberOf _
  15396. * @since 3.0.0
  15397. * @category String
  15398. * @param {string} [string=''] The string to trim.
  15399. * @param {string} [chars=whitespace] The characters to trim.
  15400. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15401. * @returns {string} Returns the trimmed string.
  15402. * @example
  15403. *
  15404. * _.trim(' abc ');
  15405. * // => 'abc'
  15406. *
  15407. * _.trim('-_-abc-_-', '_-');
  15408. * // => 'abc'
  15409. *
  15410. * _.map([' foo ', ' bar '], _.trim);
  15411. * // => ['foo', 'bar']
  15412. */
  15413. function trim(string, chars, guard) {
  15414. string = toString(string);
  15415. if (string && (guard || chars === undefined)) {
  15416. return baseTrim(string);
  15417. }
  15418. if (!string || !(chars = baseToString(chars))) {
  15419. return string;
  15420. }
  15421. var strSymbols = stringToArray(string),
  15422. chrSymbols = stringToArray(chars),
  15423. start = charsStartIndex(strSymbols, chrSymbols),
  15424. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15425. return castSlice(strSymbols, start, end).join('');
  15426. }
  15427. /**
  15428. * Removes trailing whitespace or specified characters from `string`.
  15429. *
  15430. * @static
  15431. * @memberOf _
  15432. * @since 4.0.0
  15433. * @category String
  15434. * @param {string} [string=''] The string to trim.
  15435. * @param {string} [chars=whitespace] The characters to trim.
  15436. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15437. * @returns {string} Returns the trimmed string.
  15438. * @example
  15439. *
  15440. * _.trimEnd(' abc ');
  15441. * // => ' abc'
  15442. *
  15443. * _.trimEnd('-_-abc-_-', '_-');
  15444. * // => '-_-abc'
  15445. */
  15446. function trimEnd(string, chars, guard) {
  15447. string = toString(string);
  15448. if (string && (guard || chars === undefined)) {
  15449. return string.slice(0, trimmedEndIndex(string) + 1);
  15450. }
  15451. if (!string || !(chars = baseToString(chars))) {
  15452. return string;
  15453. }
  15454. var strSymbols = stringToArray(string),
  15455. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15456. return castSlice(strSymbols, 0, end).join('');
  15457. }
  15458. /**
  15459. * Removes leading whitespace or specified characters from `string`.
  15460. *
  15461. * @static
  15462. * @memberOf _
  15463. * @since 4.0.0
  15464. * @category String
  15465. * @param {string} [string=''] The string to trim.
  15466. * @param {string} [chars=whitespace] The characters to trim.
  15467. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15468. * @returns {string} Returns the trimmed string.
  15469. * @example
  15470. *
  15471. * _.trimStart(' abc ');
  15472. * // => 'abc '
  15473. *
  15474. * _.trimStart('-_-abc-_-', '_-');
  15475. * // => 'abc-_-'
  15476. */
  15477. function trimStart(string, chars, guard) {
  15478. string = toString(string);
  15479. if (string && (guard || chars === undefined)) {
  15480. return string.replace(reTrimStart, '');
  15481. }
  15482. if (!string || !(chars = baseToString(chars))) {
  15483. return string;
  15484. }
  15485. var strSymbols = stringToArray(string),
  15486. start = charsStartIndex(strSymbols, stringToArray(chars));
  15487. return castSlice(strSymbols, start).join('');
  15488. }
  15489. /**
  15490. * Truncates `string` if it's longer than the given maximum string length.
  15491. * The last characters of the truncated string are replaced with the omission
  15492. * string which defaults to "...".
  15493. *
  15494. * @static
  15495. * @memberOf _
  15496. * @since 4.0.0
  15497. * @category String
  15498. * @param {string} [string=''] The string to truncate.
  15499. * @param {Object} [options={}] The options object.
  15500. * @param {number} [options.length=30] The maximum string length.
  15501. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15502. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15503. * @returns {string} Returns the truncated string.
  15504. * @example
  15505. *
  15506. * _.truncate('hi-diddly-ho there, neighborino');
  15507. * // => 'hi-diddly-ho there, neighbo...'
  15508. *
  15509. * _.truncate('hi-diddly-ho there, neighborino', {
  15510. * 'length': 24,
  15511. * 'separator': ' '
  15512. * });
  15513. * // => 'hi-diddly-ho there,...'
  15514. *
  15515. * _.truncate('hi-diddly-ho there, neighborino', {
  15516. * 'length': 24,
  15517. * 'separator': /,? +/
  15518. * });
  15519. * // => 'hi-diddly-ho there...'
  15520. *
  15521. * _.truncate('hi-diddly-ho there, neighborino', {
  15522. * 'omission': ' [...]'
  15523. * });
  15524. * // => 'hi-diddly-ho there, neig [...]'
  15525. */
  15526. function truncate(string, options) {
  15527. var length = DEFAULT_TRUNC_LENGTH,
  15528. omission = DEFAULT_TRUNC_OMISSION;
  15529. if (isObject(options)) {
  15530. var separator = 'separator' in options ? options.separator : separator;
  15531. length = 'length' in options ? toInteger(options.length) : length;
  15532. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15533. }
  15534. string = toString(string);
  15535. var strLength = string.length;
  15536. if (hasUnicode(string)) {
  15537. var strSymbols = stringToArray(string);
  15538. strLength = strSymbols.length;
  15539. }
  15540. if (length >= strLength) {
  15541. return string;
  15542. }
  15543. var end = length - stringSize(omission);
  15544. if (end < 1) {
  15545. return omission;
  15546. }
  15547. var result = strSymbols
  15548. ? castSlice(strSymbols, 0, end).join('')
  15549. : string.slice(0, end);
  15550. if (separator === undefined) {
  15551. return result + omission;
  15552. }
  15553. if (strSymbols) {
  15554. end += (result.length - end);
  15555. }
  15556. if (isRegExp(separator)) {
  15557. if (string.slice(end).search(separator)) {
  15558. var match,
  15559. substring = result;
  15560. if (!separator.global) {
  15561. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15562. }
  15563. separator.lastIndex = 0;
  15564. while ((match = separator.exec(substring))) {
  15565. var newEnd = match.index;
  15566. }
  15567. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15568. }
  15569. } else if (string.indexOf(baseToString(separator), end) != end) {
  15570. var index = result.lastIndexOf(separator);
  15571. if (index > -1) {
  15572. result = result.slice(0, index);
  15573. }
  15574. }
  15575. return result + omission;
  15576. }
  15577. /**
  15578. * The inverse of `_.escape`; this method converts the HTML entities
  15579. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15580. * their corresponding characters.
  15581. *
  15582. * **Note:** No other HTML entities are unescaped. To unescape additional
  15583. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15584. *
  15585. * @static
  15586. * @memberOf _
  15587. * @since 0.6.0
  15588. * @category String
  15589. * @param {string} [string=''] The string to unescape.
  15590. * @returns {string} Returns the unescaped string.
  15591. * @example
  15592. *
  15593. * _.unescape('fred, barney, &amp; pebbles');
  15594. * // => 'fred, barney, & pebbles'
  15595. */
  15596. function unescape(string) {
  15597. string = toString(string);
  15598. return (string && reHasEscapedHtml.test(string))
  15599. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15600. : string;
  15601. }
  15602. /**
  15603. * Converts `string`, as space separated words, to upper case.
  15604. *
  15605. * @static
  15606. * @memberOf _
  15607. * @since 4.0.0
  15608. * @category String
  15609. * @param {string} [string=''] The string to convert.
  15610. * @returns {string} Returns the upper cased string.
  15611. * @example
  15612. *
  15613. * _.upperCase('--foo-bar');
  15614. * // => 'FOO BAR'
  15615. *
  15616. * _.upperCase('fooBar');
  15617. * // => 'FOO BAR'
  15618. *
  15619. * _.upperCase('__foo_bar__');
  15620. * // => 'FOO BAR'
  15621. */
  15622. var upperCase = createCompounder(function(result, word, index) {
  15623. return result + (index ? ' ' : '') + word.toUpperCase();
  15624. });
  15625. /**
  15626. * Converts the first character of `string` to upper case.
  15627. *
  15628. * @static
  15629. * @memberOf _
  15630. * @since 4.0.0
  15631. * @category String
  15632. * @param {string} [string=''] The string to convert.
  15633. * @returns {string} Returns the converted string.
  15634. * @example
  15635. *
  15636. * _.upperFirst('fred');
  15637. * // => 'Fred'
  15638. *
  15639. * _.upperFirst('FRED');
  15640. * // => 'FRED'
  15641. */
  15642. var upperFirst = createCaseFirst('toUpperCase');
  15643. /**
  15644. * Splits `string` into an array of its words.
  15645. *
  15646. * @static
  15647. * @memberOf _
  15648. * @since 3.0.0
  15649. * @category String
  15650. * @param {string} [string=''] The string to inspect.
  15651. * @param {RegExp|string} [pattern] The pattern to match words.
  15652. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15653. * @returns {Array} Returns the words of `string`.
  15654. * @example
  15655. *
  15656. * _.words('fred, barney, & pebbles');
  15657. * // => ['fred', 'barney', 'pebbles']
  15658. *
  15659. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15660. * // => ['fred', 'barney', '&', 'pebbles']
  15661. */
  15662. function words(string, pattern, guard) {
  15663. string = toString(string);
  15664. pattern = guard ? undefined : pattern;
  15665. if (pattern === undefined) {
  15666. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15667. }
  15668. return string.match(pattern) || [];
  15669. }
  15670. /*------------------------------------------------------------------------*/
  15671. /**
  15672. * Attempts to invoke `func`, returning either the result or the caught error
  15673. * object. Any additional arguments are provided to `func` when it's invoked.
  15674. *
  15675. * @static
  15676. * @memberOf _
  15677. * @since 3.0.0
  15678. * @category Util
  15679. * @param {Function} func The function to attempt.
  15680. * @param {...*} [args] The arguments to invoke `func` with.
  15681. * @returns {*} Returns the `func` result or error object.
  15682. * @example
  15683. *
  15684. * // Avoid throwing errors for invalid selectors.
  15685. * var elements = _.attempt(function(selector) {
  15686. * return document.querySelectorAll(selector);
  15687. * }, '>_>');
  15688. *
  15689. * if (_.isError(elements)) {
  15690. * elements = [];
  15691. * }
  15692. */
  15693. var attempt = baseRest(function(func, args) {
  15694. try {
  15695. return apply(func, undefined, args);
  15696. } catch (e) {
  15697. return isError(e) ? e : new Error(e);
  15698. }
  15699. });
  15700. /**
  15701. * Binds methods of an object to the object itself, overwriting the existing
  15702. * method.
  15703. *
  15704. * **Note:** This method doesn't set the "length" property of bound functions.
  15705. *
  15706. * @static
  15707. * @since 0.1.0
  15708. * @memberOf _
  15709. * @category Util
  15710. * @param {Object} object The object to bind and assign the bound methods to.
  15711. * @param {...(string|string[])} methodNames The object method names to bind.
  15712. * @returns {Object} Returns `object`.
  15713. * @example
  15714. *
  15715. * var view = {
  15716. * 'label': 'docs',
  15717. * 'click': function() {
  15718. * console.log('clicked ' + this.label);
  15719. * }
  15720. * };
  15721. *
  15722. * _.bindAll(view, ['click']);
  15723. * jQuery(element).on('click', view.click);
  15724. * // => Logs 'clicked docs' when clicked.
  15725. */
  15726. var bindAll = flatRest(function(object, methodNames) {
  15727. arrayEach(methodNames, function(key) {
  15728. key = toKey(key);
  15729. baseAssignValue(object, key, bind(object[key], object));
  15730. });
  15731. return object;
  15732. });
  15733. /**
  15734. * Creates a function that iterates over `pairs` and invokes the corresponding
  15735. * function of the first predicate to return truthy. The predicate-function
  15736. * pairs are invoked with the `this` binding and arguments of the created
  15737. * function.
  15738. *
  15739. * @static
  15740. * @memberOf _
  15741. * @since 4.0.0
  15742. * @category Util
  15743. * @param {Array} pairs The predicate-function pairs.
  15744. * @returns {Function} Returns the new composite function.
  15745. * @example
  15746. *
  15747. * var func = _.cond([
  15748. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15749. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15750. * [_.stubTrue, _.constant('no match')]
  15751. * ]);
  15752. *
  15753. * func({ 'a': 1, 'b': 2 });
  15754. * // => 'matches A'
  15755. *
  15756. * func({ 'a': 0, 'b': 1 });
  15757. * // => 'matches B'
  15758. *
  15759. * func({ 'a': '1', 'b': '2' });
  15760. * // => 'no match'
  15761. */
  15762. function cond(pairs) {
  15763. var length = pairs == null ? 0 : pairs.length,
  15764. toIteratee = getIteratee();
  15765. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15766. if (typeof pair[1] != 'function') {
  15767. throw new TypeError(FUNC_ERROR_TEXT);
  15768. }
  15769. return [toIteratee(pair[0]), pair[1]];
  15770. });
  15771. return baseRest(function(args) {
  15772. var index = -1;
  15773. while (++index < length) {
  15774. var pair = pairs[index];
  15775. if (apply(pair[0], this, args)) {
  15776. return apply(pair[1], this, args);
  15777. }
  15778. }
  15779. });
  15780. }
  15781. /**
  15782. * Creates a function that invokes the predicate properties of `source` with
  15783. * the corresponding property values of a given object, returning `true` if
  15784. * all predicates return truthy, else `false`.
  15785. *
  15786. * **Note:** The created function is equivalent to `_.conformsTo` with
  15787. * `source` partially applied.
  15788. *
  15789. * @static
  15790. * @memberOf _
  15791. * @since 4.0.0
  15792. * @category Util
  15793. * @param {Object} source The object of property predicates to conform to.
  15794. * @returns {Function} Returns the new spec function.
  15795. * @example
  15796. *
  15797. * var objects = [
  15798. * { 'a': 2, 'b': 1 },
  15799. * { 'a': 1, 'b': 2 }
  15800. * ];
  15801. *
  15802. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15803. * // => [{ 'a': 1, 'b': 2 }]
  15804. */
  15805. function conforms(source) {
  15806. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15807. }
  15808. /**
  15809. * Creates a function that returns `value`.
  15810. *
  15811. * @static
  15812. * @memberOf _
  15813. * @since 2.4.0
  15814. * @category Util
  15815. * @param {*} value The value to return from the new function.
  15816. * @returns {Function} Returns the new constant function.
  15817. * @example
  15818. *
  15819. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15820. *
  15821. * console.log(objects);
  15822. * // => [{ 'a': 1 }, { 'a': 1 }]
  15823. *
  15824. * console.log(objects[0] === objects[1]);
  15825. * // => true
  15826. */
  15827. function constant(value) {
  15828. return function() {
  15829. return value;
  15830. };
  15831. }
  15832. /**
  15833. * Checks `value` to determine whether a default value should be returned in
  15834. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15835. * or `undefined`.
  15836. *
  15837. * @static
  15838. * @memberOf _
  15839. * @since 4.14.0
  15840. * @category Util
  15841. * @param {*} value The value to check.
  15842. * @param {*} defaultValue The default value.
  15843. * @returns {*} Returns the resolved value.
  15844. * @example
  15845. *
  15846. * _.defaultTo(1, 10);
  15847. * // => 1
  15848. *
  15849. * _.defaultTo(undefined, 10);
  15850. * // => 10
  15851. */
  15852. function defaultTo(value, defaultValue) {
  15853. return (value == null || value !== value) ? defaultValue : value;
  15854. }
  15855. /**
  15856. * Creates a function that returns the result of invoking the given functions
  15857. * with the `this` binding of the created function, where each successive
  15858. * invocation is supplied the return value of the previous.
  15859. *
  15860. * @static
  15861. * @memberOf _
  15862. * @since 3.0.0
  15863. * @category Util
  15864. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15865. * @returns {Function} Returns the new composite function.
  15866. * @see _.flowRight
  15867. * @example
  15868. *
  15869. * function square(n) {
  15870. * return n * n;
  15871. * }
  15872. *
  15873. * var addSquare = _.flow([_.add, square]);
  15874. * addSquare(1, 2);
  15875. * // => 9
  15876. */
  15877. var flow = createFlow();
  15878. /**
  15879. * This method is like `_.flow` except that it creates a function that
  15880. * invokes the given functions from right to left.
  15881. *
  15882. * @static
  15883. * @since 3.0.0
  15884. * @memberOf _
  15885. * @category Util
  15886. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15887. * @returns {Function} Returns the new composite function.
  15888. * @see _.flow
  15889. * @example
  15890. *
  15891. * function square(n) {
  15892. * return n * n;
  15893. * }
  15894. *
  15895. * var addSquare = _.flowRight([square, _.add]);
  15896. * addSquare(1, 2);
  15897. * // => 9
  15898. */
  15899. var flowRight = createFlow(true);
  15900. /**
  15901. * This method returns the first argument it receives.
  15902. *
  15903. * @static
  15904. * @since 0.1.0
  15905. * @memberOf _
  15906. * @category Util
  15907. * @param {*} value Any value.
  15908. * @returns {*} Returns `value`.
  15909. * @example
  15910. *
  15911. * var object = { 'a': 1 };
  15912. *
  15913. * console.log(_.identity(object) === object);
  15914. * // => true
  15915. */
  15916. function identity(value) {
  15917. return value;
  15918. }
  15919. /**
  15920. * Creates a function that invokes `func` with the arguments of the created
  15921. * function. If `func` is a property name, the created function returns the
  15922. * property value for a given element. If `func` is an array or object, the
  15923. * created function returns `true` for elements that contain the equivalent
  15924. * source properties, otherwise it returns `false`.
  15925. *
  15926. * @static
  15927. * @since 4.0.0
  15928. * @memberOf _
  15929. * @category Util
  15930. * @param {*} [func=_.identity] The value to convert to a callback.
  15931. * @returns {Function} Returns the callback.
  15932. * @example
  15933. *
  15934. * var users = [
  15935. * { 'user': 'barney', 'age': 36, 'active': true },
  15936. * { 'user': 'fred', 'age': 40, 'active': false }
  15937. * ];
  15938. *
  15939. * // The `_.matches` iteratee shorthand.
  15940. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15941. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15942. *
  15943. * // The `_.matchesProperty` iteratee shorthand.
  15944. * _.filter(users, _.iteratee(['user', 'fred']));
  15945. * // => [{ 'user': 'fred', 'age': 40 }]
  15946. *
  15947. * // The `_.property` iteratee shorthand.
  15948. * _.map(users, _.iteratee('user'));
  15949. * // => ['barney', 'fred']
  15950. *
  15951. * // Create custom iteratee shorthands.
  15952. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15953. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15954. * return func.test(string);
  15955. * };
  15956. * });
  15957. *
  15958. * _.filter(['abc', 'def'], /ef/);
  15959. * // => ['def']
  15960. */
  15961. function iteratee(func) {
  15962. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15963. }
  15964. /**
  15965. * Creates a function that performs a partial deep comparison between a given
  15966. * object and `source`, returning `true` if the given object has equivalent
  15967. * property values, else `false`.
  15968. *
  15969. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15970. * partially applied.
  15971. *
  15972. * Partial comparisons will match empty array and empty object `source`
  15973. * values against any array or object value, respectively. See `_.isEqual`
  15974. * for a list of supported value comparisons.
  15975. *
  15976. * **Note:** Multiple values can be checked by combining several matchers
  15977. * using `_.overSome`
  15978. *
  15979. * @static
  15980. * @memberOf _
  15981. * @since 3.0.0
  15982. * @category Util
  15983. * @param {Object} source The object of property values to match.
  15984. * @returns {Function} Returns the new spec function.
  15985. * @example
  15986. *
  15987. * var objects = [
  15988. * { 'a': 1, 'b': 2, 'c': 3 },
  15989. * { 'a': 4, 'b': 5, 'c': 6 }
  15990. * ];
  15991. *
  15992. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15993. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15994. *
  15995. * // Checking for several possible values
  15996. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15997. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15998. */
  15999. function matches(source) {
  16000. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16001. }
  16002. /**
  16003. * Creates a function that performs a partial deep comparison between the
  16004. * value at `path` of a given object to `srcValue`, returning `true` if the
  16005. * object value is equivalent, else `false`.
  16006. *
  16007. * **Note:** Partial comparisons will match empty array and empty object
  16008. * `srcValue` values against any array or object value, respectively. See
  16009. * `_.isEqual` for a list of supported value comparisons.
  16010. *
  16011. * **Note:** Multiple values can be checked by combining several matchers
  16012. * using `_.overSome`
  16013. *
  16014. * @static
  16015. * @memberOf _
  16016. * @since 3.2.0
  16017. * @category Util
  16018. * @param {Array|string} path The path of the property to get.
  16019. * @param {*} srcValue The value to match.
  16020. * @returns {Function} Returns the new spec function.
  16021. * @example
  16022. *
  16023. * var objects = [
  16024. * { 'a': 1, 'b': 2, 'c': 3 },
  16025. * { 'a': 4, 'b': 5, 'c': 6 }
  16026. * ];
  16027. *
  16028. * _.find(objects, _.matchesProperty('a', 4));
  16029. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16030. *
  16031. * // Checking for several possible values
  16032. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16033. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16034. */
  16035. function matchesProperty(path, srcValue) {
  16036. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16037. }
  16038. /**
  16039. * Creates a function that invokes the method at `path` of a given object.
  16040. * Any additional arguments are provided to the invoked method.
  16041. *
  16042. * @static
  16043. * @memberOf _
  16044. * @since 3.7.0
  16045. * @category Util
  16046. * @param {Array|string} path The path of the method to invoke.
  16047. * @param {...*} [args] The arguments to invoke the method with.
  16048. * @returns {Function} Returns the new invoker function.
  16049. * @example
  16050. *
  16051. * var objects = [
  16052. * { 'a': { 'b': _.constant(2) } },
  16053. * { 'a': { 'b': _.constant(1) } }
  16054. * ];
  16055. *
  16056. * _.map(objects, _.method('a.b'));
  16057. * // => [2, 1]
  16058. *
  16059. * _.map(objects, _.method(['a', 'b']));
  16060. * // => [2, 1]
  16061. */
  16062. var method = baseRest(function(path, args) {
  16063. return function(object) {
  16064. return baseInvoke(object, path, args);
  16065. };
  16066. });
  16067. /**
  16068. * The opposite of `_.method`; this method creates a function that invokes
  16069. * the method at a given path of `object`. Any additional arguments are
  16070. * provided to the invoked method.
  16071. *
  16072. * @static
  16073. * @memberOf _
  16074. * @since 3.7.0
  16075. * @category Util
  16076. * @param {Object} object The object to query.
  16077. * @param {...*} [args] The arguments to invoke the method with.
  16078. * @returns {Function} Returns the new invoker function.
  16079. * @example
  16080. *
  16081. * var array = _.times(3, _.constant),
  16082. * object = { 'a': array, 'b': array, 'c': array };
  16083. *
  16084. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16085. * // => [2, 0]
  16086. *
  16087. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16088. * // => [2, 0]
  16089. */
  16090. var methodOf = baseRest(function(object, args) {
  16091. return function(path) {
  16092. return baseInvoke(object, path, args);
  16093. };
  16094. });
  16095. /**
  16096. * Adds all own enumerable string keyed function properties of a source
  16097. * object to the destination object. If `object` is a function, then methods
  16098. * are added to its prototype as well.
  16099. *
  16100. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16101. * avoid conflicts caused by modifying the original.
  16102. *
  16103. * @static
  16104. * @since 0.1.0
  16105. * @memberOf _
  16106. * @category Util
  16107. * @param {Function|Object} [object=lodash] The destination object.
  16108. * @param {Object} source The object of functions to add.
  16109. * @param {Object} [options={}] The options object.
  16110. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16111. * @returns {Function|Object} Returns `object`.
  16112. * @example
  16113. *
  16114. * function vowels(string) {
  16115. * return _.filter(string, function(v) {
  16116. * return /[aeiou]/i.test(v);
  16117. * });
  16118. * }
  16119. *
  16120. * _.mixin({ 'vowels': vowels });
  16121. * _.vowels('fred');
  16122. * // => ['e']
  16123. *
  16124. * _('fred').vowels().value();
  16125. * // => ['e']
  16126. *
  16127. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16128. * _('fred').vowels();
  16129. * // => ['e']
  16130. */
  16131. function mixin(object, source, options) {
  16132. var props = keys(source),
  16133. methodNames = baseFunctions(source, props);
  16134. if (options == null &&
  16135. !(isObject(source) && (methodNames.length || !props.length))) {
  16136. options = source;
  16137. source = object;
  16138. object = this;
  16139. methodNames = baseFunctions(source, keys(source));
  16140. }
  16141. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16142. isFunc = isFunction(object);
  16143. arrayEach(methodNames, function(methodName) {
  16144. var func = source[methodName];
  16145. object[methodName] = func;
  16146. if (isFunc) {
  16147. object.prototype[methodName] = function() {
  16148. var chainAll = this.__chain__;
  16149. if (chain || chainAll) {
  16150. var result = object(this.__wrapped__),
  16151. actions = result.__actions__ = copyArray(this.__actions__);
  16152. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16153. result.__chain__ = chainAll;
  16154. return result;
  16155. }
  16156. return func.apply(object, arrayPush([this.value()], arguments));
  16157. };
  16158. }
  16159. });
  16160. return object;
  16161. }
  16162. /**
  16163. * Reverts the `_` variable to its previous value and returns a reference to
  16164. * the `lodash` function.
  16165. *
  16166. * @static
  16167. * @since 0.1.0
  16168. * @memberOf _
  16169. * @category Util
  16170. * @returns {Function} Returns the `lodash` function.
  16171. * @example
  16172. *
  16173. * var lodash = _.noConflict();
  16174. */
  16175. function noConflict() {
  16176. if (root._ === this) {
  16177. root._ = oldDash;
  16178. }
  16179. return this;
  16180. }
  16181. /**
  16182. * This method returns `undefined`.
  16183. *
  16184. * @static
  16185. * @memberOf _
  16186. * @since 2.3.0
  16187. * @category Util
  16188. * @example
  16189. *
  16190. * _.times(2, _.noop);
  16191. * // => [undefined, undefined]
  16192. */
  16193. function noop() {
  16194. // No operation performed.
  16195. }
  16196. /**
  16197. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16198. * the nth argument from the end is returned.
  16199. *
  16200. * @static
  16201. * @memberOf _
  16202. * @since 4.0.0
  16203. * @category Util
  16204. * @param {number} [n=0] The index of the argument to return.
  16205. * @returns {Function} Returns the new pass-thru function.
  16206. * @example
  16207. *
  16208. * var func = _.nthArg(1);
  16209. * func('a', 'b', 'c', 'd');
  16210. * // => 'b'
  16211. *
  16212. * var func = _.nthArg(-2);
  16213. * func('a', 'b', 'c', 'd');
  16214. * // => 'c'
  16215. */
  16216. function nthArg(n) {
  16217. n = toInteger(n);
  16218. return baseRest(function(args) {
  16219. return baseNth(args, n);
  16220. });
  16221. }
  16222. /**
  16223. * Creates a function that invokes `iteratees` with the arguments it receives
  16224. * and returns their results.
  16225. *
  16226. * @static
  16227. * @memberOf _
  16228. * @since 4.0.0
  16229. * @category Util
  16230. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16231. * The iteratees to invoke.
  16232. * @returns {Function} Returns the new function.
  16233. * @example
  16234. *
  16235. * var func = _.over([Math.max, Math.min]);
  16236. *
  16237. * func(1, 2, 3, 4);
  16238. * // => [4, 1]
  16239. */
  16240. var over = createOver(arrayMap);
  16241. /**
  16242. * Creates a function that checks if **all** of the `predicates` return
  16243. * truthy when invoked with the arguments it receives.
  16244. *
  16245. * Following shorthands are possible for providing predicates.
  16246. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16247. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16248. *
  16249. * @static
  16250. * @memberOf _
  16251. * @since 4.0.0
  16252. * @category Util
  16253. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16254. * The predicates to check.
  16255. * @returns {Function} Returns the new function.
  16256. * @example
  16257. *
  16258. * var func = _.overEvery([Boolean, isFinite]);
  16259. *
  16260. * func('1');
  16261. * // => true
  16262. *
  16263. * func(null);
  16264. * // => false
  16265. *
  16266. * func(NaN);
  16267. * // => false
  16268. */
  16269. var overEvery = createOver(arrayEvery);
  16270. /**
  16271. * Creates a function that checks if **any** of the `predicates` return
  16272. * truthy when invoked with the arguments it receives.
  16273. *
  16274. * Following shorthands are possible for providing predicates.
  16275. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16276. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16277. *
  16278. * @static
  16279. * @memberOf _
  16280. * @since 4.0.0
  16281. * @category Util
  16282. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16283. * The predicates to check.
  16284. * @returns {Function} Returns the new function.
  16285. * @example
  16286. *
  16287. * var func = _.overSome([Boolean, isFinite]);
  16288. *
  16289. * func('1');
  16290. * // => true
  16291. *
  16292. * func(null);
  16293. * // => true
  16294. *
  16295. * func(NaN);
  16296. * // => false
  16297. *
  16298. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16299. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16300. */
  16301. var overSome = createOver(arraySome);
  16302. /**
  16303. * Creates a function that returns the value at `path` of a given object.
  16304. *
  16305. * @static
  16306. * @memberOf _
  16307. * @since 2.4.0
  16308. * @category Util
  16309. * @param {Array|string} path The path of the property to get.
  16310. * @returns {Function} Returns the new accessor function.
  16311. * @example
  16312. *
  16313. * var objects = [
  16314. * { 'a': { 'b': 2 } },
  16315. * { 'a': { 'b': 1 } }
  16316. * ];
  16317. *
  16318. * _.map(objects, _.property('a.b'));
  16319. * // => [2, 1]
  16320. *
  16321. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16322. * // => [1, 2]
  16323. */
  16324. function property(path) {
  16325. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16326. }
  16327. /**
  16328. * The opposite of `_.property`; this method creates a function that returns
  16329. * the value at a given path of `object`.
  16330. *
  16331. * @static
  16332. * @memberOf _
  16333. * @since 3.0.0
  16334. * @category Util
  16335. * @param {Object} object The object to query.
  16336. * @returns {Function} Returns the new accessor function.
  16337. * @example
  16338. *
  16339. * var array = [0, 1, 2],
  16340. * object = { 'a': array, 'b': array, 'c': array };
  16341. *
  16342. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16343. * // => [2, 0]
  16344. *
  16345. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16346. * // => [2, 0]
  16347. */
  16348. function propertyOf(object) {
  16349. return function(path) {
  16350. return object == null ? undefined : baseGet(object, path);
  16351. };
  16352. }
  16353. /**
  16354. * Creates an array of numbers (positive and/or negative) progressing from
  16355. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16356. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16357. * it's set to `start` with `start` then set to `0`.
  16358. *
  16359. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16360. * floating-point values which can produce unexpected results.
  16361. *
  16362. * @static
  16363. * @since 0.1.0
  16364. * @memberOf _
  16365. * @category Util
  16366. * @param {number} [start=0] The start of the range.
  16367. * @param {number} end The end of the range.
  16368. * @param {number} [step=1] The value to increment or decrement by.
  16369. * @returns {Array} Returns the range of numbers.
  16370. * @see _.inRange, _.rangeRight
  16371. * @example
  16372. *
  16373. * _.range(4);
  16374. * // => [0, 1, 2, 3]
  16375. *
  16376. * _.range(-4);
  16377. * // => [0, -1, -2, -3]
  16378. *
  16379. * _.range(1, 5);
  16380. * // => [1, 2, 3, 4]
  16381. *
  16382. * _.range(0, 20, 5);
  16383. * // => [0, 5, 10, 15]
  16384. *
  16385. * _.range(0, -4, -1);
  16386. * // => [0, -1, -2, -3]
  16387. *
  16388. * _.range(1, 4, 0);
  16389. * // => [1, 1, 1]
  16390. *
  16391. * _.range(0);
  16392. * // => []
  16393. */
  16394. var range = createRange();
  16395. /**
  16396. * This method is like `_.range` except that it populates values in
  16397. * descending order.
  16398. *
  16399. * @static
  16400. * @memberOf _
  16401. * @since 4.0.0
  16402. * @category Util
  16403. * @param {number} [start=0] The start of the range.
  16404. * @param {number} end The end of the range.
  16405. * @param {number} [step=1] The value to increment or decrement by.
  16406. * @returns {Array} Returns the range of numbers.
  16407. * @see _.inRange, _.range
  16408. * @example
  16409. *
  16410. * _.rangeRight(4);
  16411. * // => [3, 2, 1, 0]
  16412. *
  16413. * _.rangeRight(-4);
  16414. * // => [-3, -2, -1, 0]
  16415. *
  16416. * _.rangeRight(1, 5);
  16417. * // => [4, 3, 2, 1]
  16418. *
  16419. * _.rangeRight(0, 20, 5);
  16420. * // => [15, 10, 5, 0]
  16421. *
  16422. * _.rangeRight(0, -4, -1);
  16423. * // => [-3, -2, -1, 0]
  16424. *
  16425. * _.rangeRight(1, 4, 0);
  16426. * // => [1, 1, 1]
  16427. *
  16428. * _.rangeRight(0);
  16429. * // => []
  16430. */
  16431. var rangeRight = createRange(true);
  16432. /**
  16433. * This method returns a new empty array.
  16434. *
  16435. * @static
  16436. * @memberOf _
  16437. * @since 4.13.0
  16438. * @category Util
  16439. * @returns {Array} Returns the new empty array.
  16440. * @example
  16441. *
  16442. * var arrays = _.times(2, _.stubArray);
  16443. *
  16444. * console.log(arrays);
  16445. * // => [[], []]
  16446. *
  16447. * console.log(arrays[0] === arrays[1]);
  16448. * // => false
  16449. */
  16450. function stubArray() {
  16451. return [];
  16452. }
  16453. /**
  16454. * This method returns `false`.
  16455. *
  16456. * @static
  16457. * @memberOf _
  16458. * @since 4.13.0
  16459. * @category Util
  16460. * @returns {boolean} Returns `false`.
  16461. * @example
  16462. *
  16463. * _.times(2, _.stubFalse);
  16464. * // => [false, false]
  16465. */
  16466. function stubFalse() {
  16467. return false;
  16468. }
  16469. /**
  16470. * This method returns a new empty object.
  16471. *
  16472. * @static
  16473. * @memberOf _
  16474. * @since 4.13.0
  16475. * @category Util
  16476. * @returns {Object} Returns the new empty object.
  16477. * @example
  16478. *
  16479. * var objects = _.times(2, _.stubObject);
  16480. *
  16481. * console.log(objects);
  16482. * // => [{}, {}]
  16483. *
  16484. * console.log(objects[0] === objects[1]);
  16485. * // => false
  16486. */
  16487. function stubObject() {
  16488. return {};
  16489. }
  16490. /**
  16491. * This method returns an empty string.
  16492. *
  16493. * @static
  16494. * @memberOf _
  16495. * @since 4.13.0
  16496. * @category Util
  16497. * @returns {string} Returns the empty string.
  16498. * @example
  16499. *
  16500. * _.times(2, _.stubString);
  16501. * // => ['', '']
  16502. */
  16503. function stubString() {
  16504. return '';
  16505. }
  16506. /**
  16507. * This method returns `true`.
  16508. *
  16509. * @static
  16510. * @memberOf _
  16511. * @since 4.13.0
  16512. * @category Util
  16513. * @returns {boolean} Returns `true`.
  16514. * @example
  16515. *
  16516. * _.times(2, _.stubTrue);
  16517. * // => [true, true]
  16518. */
  16519. function stubTrue() {
  16520. return true;
  16521. }
  16522. /**
  16523. * Invokes the iteratee `n` times, returning an array of the results of
  16524. * each invocation. The iteratee is invoked with one argument; (index).
  16525. *
  16526. * @static
  16527. * @since 0.1.0
  16528. * @memberOf _
  16529. * @category Util
  16530. * @param {number} n The number of times to invoke `iteratee`.
  16531. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16532. * @returns {Array} Returns the array of results.
  16533. * @example
  16534. *
  16535. * _.times(3, String);
  16536. * // => ['0', '1', '2']
  16537. *
  16538. * _.times(4, _.constant(0));
  16539. * // => [0, 0, 0, 0]
  16540. */
  16541. function times(n, iteratee) {
  16542. n = toInteger(n);
  16543. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16544. return [];
  16545. }
  16546. var index = MAX_ARRAY_LENGTH,
  16547. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16548. iteratee = getIteratee(iteratee);
  16549. n -= MAX_ARRAY_LENGTH;
  16550. var result = baseTimes(length, iteratee);
  16551. while (++index < n) {
  16552. iteratee(index);
  16553. }
  16554. return result;
  16555. }
  16556. /**
  16557. * Converts `value` to a property path array.
  16558. *
  16559. * @static
  16560. * @memberOf _
  16561. * @since 4.0.0
  16562. * @category Util
  16563. * @param {*} value The value to convert.
  16564. * @returns {Array} Returns the new property path array.
  16565. * @example
  16566. *
  16567. * _.toPath('a.b.c');
  16568. * // => ['a', 'b', 'c']
  16569. *
  16570. * _.toPath('a[0].b.c');
  16571. * // => ['a', '0', 'b', 'c']
  16572. */
  16573. function toPath(value) {
  16574. if (isArray(value)) {
  16575. return arrayMap(value, toKey);
  16576. }
  16577. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16578. }
  16579. /**
  16580. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16581. *
  16582. * @static
  16583. * @since 0.1.0
  16584. * @memberOf _
  16585. * @category Util
  16586. * @param {string} [prefix=''] The value to prefix the ID with.
  16587. * @returns {string} Returns the unique ID.
  16588. * @example
  16589. *
  16590. * _.uniqueId('contact_');
  16591. * // => 'contact_104'
  16592. *
  16593. * _.uniqueId();
  16594. * // => '105'
  16595. */
  16596. function uniqueId(prefix) {
  16597. var id = ++idCounter;
  16598. return toString(prefix) + id;
  16599. }
  16600. /*------------------------------------------------------------------------*/
  16601. /**
  16602. * Adds two numbers.
  16603. *
  16604. * @static
  16605. * @memberOf _
  16606. * @since 3.4.0
  16607. * @category Math
  16608. * @param {number} augend The first number in an addition.
  16609. * @param {number} addend The second number in an addition.
  16610. * @returns {number} Returns the total.
  16611. * @example
  16612. *
  16613. * _.add(6, 4);
  16614. * // => 10
  16615. */
  16616. var add = createMathOperation(function(augend, addend) {
  16617. return augend + addend;
  16618. }, 0);
  16619. /**
  16620. * Computes `number` rounded up to `precision`.
  16621. *
  16622. * @static
  16623. * @memberOf _
  16624. * @since 3.10.0
  16625. * @category Math
  16626. * @param {number} number The number to round up.
  16627. * @param {number} [precision=0] The precision to round up to.
  16628. * @returns {number} Returns the rounded up number.
  16629. * @example
  16630. *
  16631. * _.ceil(4.006);
  16632. * // => 5
  16633. *
  16634. * _.ceil(6.004, 2);
  16635. * // => 6.01
  16636. *
  16637. * _.ceil(6040, -2);
  16638. * // => 6100
  16639. */
  16640. var ceil = createRound('ceil');
  16641. /**
  16642. * Divide two numbers.
  16643. *
  16644. * @static
  16645. * @memberOf _
  16646. * @since 4.7.0
  16647. * @category Math
  16648. * @param {number} dividend The first number in a division.
  16649. * @param {number} divisor The second number in a division.
  16650. * @returns {number} Returns the quotient.
  16651. * @example
  16652. *
  16653. * _.divide(6, 4);
  16654. * // => 1.5
  16655. */
  16656. var divide = createMathOperation(function(dividend, divisor) {
  16657. return dividend / divisor;
  16658. }, 1);
  16659. /**
  16660. * Computes `number` rounded down to `precision`.
  16661. *
  16662. * @static
  16663. * @memberOf _
  16664. * @since 3.10.0
  16665. * @category Math
  16666. * @param {number} number The number to round down.
  16667. * @param {number} [precision=0] The precision to round down to.
  16668. * @returns {number} Returns the rounded down number.
  16669. * @example
  16670. *
  16671. * _.floor(4.006);
  16672. * // => 4
  16673. *
  16674. * _.floor(0.046, 2);
  16675. * // => 0.04
  16676. *
  16677. * _.floor(4060, -2);
  16678. * // => 4000
  16679. */
  16680. var floor = createRound('floor');
  16681. /**
  16682. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16683. * `undefined` is returned.
  16684. *
  16685. * @static
  16686. * @since 0.1.0
  16687. * @memberOf _
  16688. * @category Math
  16689. * @param {Array} array The array to iterate over.
  16690. * @returns {*} Returns the maximum value.
  16691. * @example
  16692. *
  16693. * _.max([4, 2, 8, 6]);
  16694. * // => 8
  16695. *
  16696. * _.max([]);
  16697. * // => undefined
  16698. */
  16699. function max(array) {
  16700. return (array && array.length)
  16701. ? baseExtremum(array, identity, baseGt)
  16702. : undefined;
  16703. }
  16704. /**
  16705. * This method is like `_.max` except that it accepts `iteratee` which is
  16706. * invoked for each element in `array` to generate the criterion by which
  16707. * the value is ranked. The iteratee is invoked with one argument: (value).
  16708. *
  16709. * @static
  16710. * @memberOf _
  16711. * @since 4.0.0
  16712. * @category Math
  16713. * @param {Array} array The array to iterate over.
  16714. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16715. * @returns {*} Returns the maximum value.
  16716. * @example
  16717. *
  16718. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16719. *
  16720. * _.maxBy(objects, function(o) { return o.n; });
  16721. * // => { 'n': 2 }
  16722. *
  16723. * // The `_.property` iteratee shorthand.
  16724. * _.maxBy(objects, 'n');
  16725. * // => { 'n': 2 }
  16726. */
  16727. function maxBy(array, iteratee) {
  16728. return (array && array.length)
  16729. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16730. : undefined;
  16731. }
  16732. /**
  16733. * Computes the mean of the values in `array`.
  16734. *
  16735. * @static
  16736. * @memberOf _
  16737. * @since 4.0.0
  16738. * @category Math
  16739. * @param {Array} array The array to iterate over.
  16740. * @returns {number} Returns the mean.
  16741. * @example
  16742. *
  16743. * _.mean([4, 2, 8, 6]);
  16744. * // => 5
  16745. */
  16746. function mean(array) {
  16747. return baseMean(array, identity);
  16748. }
  16749. /**
  16750. * This method is like `_.mean` except that it accepts `iteratee` which is
  16751. * invoked for each element in `array` to generate the value to be averaged.
  16752. * The iteratee is invoked with one argument: (value).
  16753. *
  16754. * @static
  16755. * @memberOf _
  16756. * @since 4.7.0
  16757. * @category Math
  16758. * @param {Array} array The array to iterate over.
  16759. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16760. * @returns {number} Returns the mean.
  16761. * @example
  16762. *
  16763. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16764. *
  16765. * _.meanBy(objects, function(o) { return o.n; });
  16766. * // => 5
  16767. *
  16768. * // The `_.property` iteratee shorthand.
  16769. * _.meanBy(objects, 'n');
  16770. * // => 5
  16771. */
  16772. function meanBy(array, iteratee) {
  16773. return baseMean(array, getIteratee(iteratee, 2));
  16774. }
  16775. /**
  16776. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16777. * `undefined` is returned.
  16778. *
  16779. * @static
  16780. * @since 0.1.0
  16781. * @memberOf _
  16782. * @category Math
  16783. * @param {Array} array The array to iterate over.
  16784. * @returns {*} Returns the minimum value.
  16785. * @example
  16786. *
  16787. * _.min([4, 2, 8, 6]);
  16788. * // => 2
  16789. *
  16790. * _.min([]);
  16791. * // => undefined
  16792. */
  16793. function min(array) {
  16794. return (array && array.length)
  16795. ? baseExtremum(array, identity, baseLt)
  16796. : undefined;
  16797. }
  16798. /**
  16799. * This method is like `_.min` except that it accepts `iteratee` which is
  16800. * invoked for each element in `array` to generate the criterion by which
  16801. * the value is ranked. The iteratee is invoked with one argument: (value).
  16802. *
  16803. * @static
  16804. * @memberOf _
  16805. * @since 4.0.0
  16806. * @category Math
  16807. * @param {Array} array The array to iterate over.
  16808. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16809. * @returns {*} Returns the minimum value.
  16810. * @example
  16811. *
  16812. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16813. *
  16814. * _.minBy(objects, function(o) { return o.n; });
  16815. * // => { 'n': 1 }
  16816. *
  16817. * // The `_.property` iteratee shorthand.
  16818. * _.minBy(objects, 'n');
  16819. * // => { 'n': 1 }
  16820. */
  16821. function minBy(array, iteratee) {
  16822. return (array && array.length)
  16823. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16824. : undefined;
  16825. }
  16826. /**
  16827. * Multiply two numbers.
  16828. *
  16829. * @static
  16830. * @memberOf _
  16831. * @since 4.7.0
  16832. * @category Math
  16833. * @param {number} multiplier The first number in a multiplication.
  16834. * @param {number} multiplicand The second number in a multiplication.
  16835. * @returns {number} Returns the product.
  16836. * @example
  16837. *
  16838. * _.multiply(6, 4);
  16839. * // => 24
  16840. */
  16841. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16842. return multiplier * multiplicand;
  16843. }, 1);
  16844. /**
  16845. * Computes `number` rounded to `precision`.
  16846. *
  16847. * @static
  16848. * @memberOf _
  16849. * @since 3.10.0
  16850. * @category Math
  16851. * @param {number} number The number to round.
  16852. * @param {number} [precision=0] The precision to round to.
  16853. * @returns {number} Returns the rounded number.
  16854. * @example
  16855. *
  16856. * _.round(4.006);
  16857. * // => 4
  16858. *
  16859. * _.round(4.006, 2);
  16860. * // => 4.01
  16861. *
  16862. * _.round(4060, -2);
  16863. * // => 4100
  16864. */
  16865. var round = createRound('round');
  16866. /**
  16867. * Subtract two numbers.
  16868. *
  16869. * @static
  16870. * @memberOf _
  16871. * @since 4.0.0
  16872. * @category Math
  16873. * @param {number} minuend The first number in a subtraction.
  16874. * @param {number} subtrahend The second number in a subtraction.
  16875. * @returns {number} Returns the difference.
  16876. * @example
  16877. *
  16878. * _.subtract(6, 4);
  16879. * // => 2
  16880. */
  16881. var subtract = createMathOperation(function(minuend, subtrahend) {
  16882. return minuend - subtrahend;
  16883. }, 0);
  16884. /**
  16885. * Computes the sum of the values in `array`.
  16886. *
  16887. * @static
  16888. * @memberOf _
  16889. * @since 3.4.0
  16890. * @category Math
  16891. * @param {Array} array The array to iterate over.
  16892. * @returns {number} Returns the sum.
  16893. * @example
  16894. *
  16895. * _.sum([4, 2, 8, 6]);
  16896. * // => 20
  16897. */
  16898. function sum(array) {
  16899. return (array && array.length)
  16900. ? baseSum(array, identity)
  16901. : 0;
  16902. }
  16903. /**
  16904. * This method is like `_.sum` except that it accepts `iteratee` which is
  16905. * invoked for each element in `array` to generate the value to be summed.
  16906. * The iteratee is invoked with one argument: (value).
  16907. *
  16908. * @static
  16909. * @memberOf _
  16910. * @since 4.0.0
  16911. * @category Math
  16912. * @param {Array} array The array to iterate over.
  16913. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16914. * @returns {number} Returns the sum.
  16915. * @example
  16916. *
  16917. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16918. *
  16919. * _.sumBy(objects, function(o) { return o.n; });
  16920. * // => 20
  16921. *
  16922. * // The `_.property` iteratee shorthand.
  16923. * _.sumBy(objects, 'n');
  16924. * // => 20
  16925. */
  16926. function sumBy(array, iteratee) {
  16927. return (array && array.length)
  16928. ? baseSum(array, getIteratee(iteratee, 2))
  16929. : 0;
  16930. }
  16931. /*------------------------------------------------------------------------*/
  16932. // Add methods that return wrapped values in chain sequences.
  16933. lodash.after = after;
  16934. lodash.ary = ary;
  16935. lodash.assign = assign;
  16936. lodash.assignIn = assignIn;
  16937. lodash.assignInWith = assignInWith;
  16938. lodash.assignWith = assignWith;
  16939. lodash.at = at;
  16940. lodash.before = before;
  16941. lodash.bind = bind;
  16942. lodash.bindAll = bindAll;
  16943. lodash.bindKey = bindKey;
  16944. lodash.castArray = castArray;
  16945. lodash.chain = chain;
  16946. lodash.chunk = chunk;
  16947. lodash.compact = compact;
  16948. lodash.concat = concat;
  16949. lodash.cond = cond;
  16950. lodash.conforms = conforms;
  16951. lodash.constant = constant;
  16952. lodash.countBy = countBy;
  16953. lodash.create = create;
  16954. lodash.curry = curry;
  16955. lodash.curryRight = curryRight;
  16956. lodash.debounce = debounce;
  16957. lodash.defaults = defaults;
  16958. lodash.defaultsDeep = defaultsDeep;
  16959. lodash.defer = defer;
  16960. lodash.delay = delay;
  16961. lodash.difference = difference;
  16962. lodash.differenceBy = differenceBy;
  16963. lodash.differenceWith = differenceWith;
  16964. lodash.drop = drop;
  16965. lodash.dropRight = dropRight;
  16966. lodash.dropRightWhile = dropRightWhile;
  16967. lodash.dropWhile = dropWhile;
  16968. lodash.fill = fill;
  16969. lodash.filter = filter;
  16970. lodash.flatMap = flatMap;
  16971. lodash.flatMapDeep = flatMapDeep;
  16972. lodash.flatMapDepth = flatMapDepth;
  16973. lodash.flatten = flatten;
  16974. lodash.flattenDeep = flattenDeep;
  16975. lodash.flattenDepth = flattenDepth;
  16976. lodash.flip = flip;
  16977. lodash.flow = flow;
  16978. lodash.flowRight = flowRight;
  16979. lodash.fromPairs = fromPairs;
  16980. lodash.functions = functions;
  16981. lodash.functionsIn = functionsIn;
  16982. lodash.groupBy = groupBy;
  16983. lodash.initial = initial;
  16984. lodash.intersection = intersection;
  16985. lodash.intersectionBy = intersectionBy;
  16986. lodash.intersectionWith = intersectionWith;
  16987. lodash.invert = invert;
  16988. lodash.invertBy = invertBy;
  16989. lodash.invokeMap = invokeMap;
  16990. lodash.iteratee = iteratee;
  16991. lodash.keyBy = keyBy;
  16992. lodash.keys = keys;
  16993. lodash.keysIn = keysIn;
  16994. lodash.map = map;
  16995. lodash.mapKeys = mapKeys;
  16996. lodash.mapValues = mapValues;
  16997. lodash.matches = matches;
  16998. lodash.matchesProperty = matchesProperty;
  16999. lodash.memoize = memoize;
  17000. lodash.merge = merge;
  17001. lodash.mergeWith = mergeWith;
  17002. lodash.method = method;
  17003. lodash.methodOf = methodOf;
  17004. lodash.mixin = mixin;
  17005. lodash.negate = negate;
  17006. lodash.nthArg = nthArg;
  17007. lodash.omit = omit;
  17008. lodash.omitBy = omitBy;
  17009. lodash.once = once;
  17010. lodash.orderBy = orderBy;
  17011. lodash.over = over;
  17012. lodash.overArgs = overArgs;
  17013. lodash.overEvery = overEvery;
  17014. lodash.overSome = overSome;
  17015. lodash.partial = partial;
  17016. lodash.partialRight = partialRight;
  17017. lodash.partition = partition;
  17018. lodash.pick = pick;
  17019. lodash.pickBy = pickBy;
  17020. lodash.property = property;
  17021. lodash.propertyOf = propertyOf;
  17022. lodash.pull = pull;
  17023. lodash.pullAll = pullAll;
  17024. lodash.pullAllBy = pullAllBy;
  17025. lodash.pullAllWith = pullAllWith;
  17026. lodash.pullAt = pullAt;
  17027. lodash.range = range;
  17028. lodash.rangeRight = rangeRight;
  17029. lodash.rearg = rearg;
  17030. lodash.reject = reject;
  17031. lodash.remove = remove;
  17032. lodash.rest = rest;
  17033. lodash.reverse = reverse;
  17034. lodash.sampleSize = sampleSize;
  17035. lodash.set = set;
  17036. lodash.setWith = setWith;
  17037. lodash.shuffle = shuffle;
  17038. lodash.slice = slice;
  17039. lodash.sortBy = sortBy;
  17040. lodash.sortedUniq = sortedUniq;
  17041. lodash.sortedUniqBy = sortedUniqBy;
  17042. lodash.split = split;
  17043. lodash.spread = spread;
  17044. lodash.tail = tail;
  17045. lodash.take = take;
  17046. lodash.takeRight = takeRight;
  17047. lodash.takeRightWhile = takeRightWhile;
  17048. lodash.takeWhile = takeWhile;
  17049. lodash.tap = tap;
  17050. lodash.throttle = throttle;
  17051. lodash.thru = thru;
  17052. lodash.toArray = toArray;
  17053. lodash.toPairs = toPairs;
  17054. lodash.toPairsIn = toPairsIn;
  17055. lodash.toPath = toPath;
  17056. lodash.toPlainObject = toPlainObject;
  17057. lodash.transform = transform;
  17058. lodash.unary = unary;
  17059. lodash.union = union;
  17060. lodash.unionBy = unionBy;
  17061. lodash.unionWith = unionWith;
  17062. lodash.uniq = uniq;
  17063. lodash.uniqBy = uniqBy;
  17064. lodash.uniqWith = uniqWith;
  17065. lodash.unset = unset;
  17066. lodash.unzip = unzip;
  17067. lodash.unzipWith = unzipWith;
  17068. lodash.update = update;
  17069. lodash.updateWith = updateWith;
  17070. lodash.values = values;
  17071. lodash.valuesIn = valuesIn;
  17072. lodash.without = without;
  17073. lodash.words = words;
  17074. lodash.wrap = wrap;
  17075. lodash.xor = xor;
  17076. lodash.xorBy = xorBy;
  17077. lodash.xorWith = xorWith;
  17078. lodash.zip = zip;
  17079. lodash.zipObject = zipObject;
  17080. lodash.zipObjectDeep = zipObjectDeep;
  17081. lodash.zipWith = zipWith;
  17082. // Add aliases.
  17083. lodash.entries = toPairs;
  17084. lodash.entriesIn = toPairsIn;
  17085. lodash.extend = assignIn;
  17086. lodash.extendWith = assignInWith;
  17087. // Add methods to `lodash.prototype`.
  17088. mixin(lodash, lodash);
  17089. /*------------------------------------------------------------------------*/
  17090. // Add methods that return unwrapped values in chain sequences.
  17091. lodash.add = add;
  17092. lodash.attempt = attempt;
  17093. lodash.camelCase = camelCase;
  17094. lodash.capitalize = capitalize;
  17095. lodash.ceil = ceil;
  17096. lodash.clamp = clamp;
  17097. lodash.clone = clone;
  17098. lodash.cloneDeep = cloneDeep;
  17099. lodash.cloneDeepWith = cloneDeepWith;
  17100. lodash.cloneWith = cloneWith;
  17101. lodash.conformsTo = conformsTo;
  17102. lodash.deburr = deburr;
  17103. lodash.defaultTo = defaultTo;
  17104. lodash.divide = divide;
  17105. lodash.endsWith = endsWith;
  17106. lodash.eq = eq;
  17107. lodash.escape = escape;
  17108. lodash.escapeRegExp = escapeRegExp;
  17109. lodash.every = every;
  17110. lodash.find = find;
  17111. lodash.findIndex = findIndex;
  17112. lodash.findKey = findKey;
  17113. lodash.findLast = findLast;
  17114. lodash.findLastIndex = findLastIndex;
  17115. lodash.findLastKey = findLastKey;
  17116. lodash.floor = floor;
  17117. lodash.forEach = forEach;
  17118. lodash.forEachRight = forEachRight;
  17119. lodash.forIn = forIn;
  17120. lodash.forInRight = forInRight;
  17121. lodash.forOwn = forOwn;
  17122. lodash.forOwnRight = forOwnRight;
  17123. lodash.get = get;
  17124. lodash.gt = gt;
  17125. lodash.gte = gte;
  17126. lodash.has = has;
  17127. lodash.hasIn = hasIn;
  17128. lodash.head = head;
  17129. lodash.identity = identity;
  17130. lodash.includes = includes;
  17131. lodash.indexOf = indexOf;
  17132. lodash.inRange = inRange;
  17133. lodash.invoke = invoke;
  17134. lodash.isArguments = isArguments;
  17135. lodash.isArray = isArray;
  17136. lodash.isArrayBuffer = isArrayBuffer;
  17137. lodash.isArrayLike = isArrayLike;
  17138. lodash.isArrayLikeObject = isArrayLikeObject;
  17139. lodash.isBoolean = isBoolean;
  17140. lodash.isBuffer = isBuffer;
  17141. lodash.isDate = isDate;
  17142. lodash.isElement = isElement;
  17143. lodash.isEmpty = isEmpty;
  17144. lodash.isEqual = isEqual;
  17145. lodash.isEqualWith = isEqualWith;
  17146. lodash.isError = isError;
  17147. lodash.isFinite = isFinite;
  17148. lodash.isFunction = isFunction;
  17149. lodash.isInteger = isInteger;
  17150. lodash.isLength = isLength;
  17151. lodash.isMap = isMap;
  17152. lodash.isMatch = isMatch;
  17153. lodash.isMatchWith = isMatchWith;
  17154. lodash.isNaN = isNaN;
  17155. lodash.isNative = isNative;
  17156. lodash.isNil = isNil;
  17157. lodash.isNull = isNull;
  17158. lodash.isNumber = isNumber;
  17159. lodash.isObject = isObject;
  17160. lodash.isObjectLike = isObjectLike;
  17161. lodash.isPlainObject = isPlainObject;
  17162. lodash.isRegExp = isRegExp;
  17163. lodash.isSafeInteger = isSafeInteger;
  17164. lodash.isSet = isSet;
  17165. lodash.isString = isString;
  17166. lodash.isSymbol = isSymbol;
  17167. lodash.isTypedArray = isTypedArray;
  17168. lodash.isUndefined = isUndefined;
  17169. lodash.isWeakMap = isWeakMap;
  17170. lodash.isWeakSet = isWeakSet;
  17171. lodash.join = join;
  17172. lodash.kebabCase = kebabCase;
  17173. lodash.last = last;
  17174. lodash.lastIndexOf = lastIndexOf;
  17175. lodash.lowerCase = lowerCase;
  17176. lodash.lowerFirst = lowerFirst;
  17177. lodash.lt = lt;
  17178. lodash.lte = lte;
  17179. lodash.max = max;
  17180. lodash.maxBy = maxBy;
  17181. lodash.mean = mean;
  17182. lodash.meanBy = meanBy;
  17183. lodash.min = min;
  17184. lodash.minBy = minBy;
  17185. lodash.stubArray = stubArray;
  17186. lodash.stubFalse = stubFalse;
  17187. lodash.stubObject = stubObject;
  17188. lodash.stubString = stubString;
  17189. lodash.stubTrue = stubTrue;
  17190. lodash.multiply = multiply;
  17191. lodash.nth = nth;
  17192. lodash.noConflict = noConflict;
  17193. lodash.noop = noop;
  17194. lodash.now = now;
  17195. lodash.pad = pad;
  17196. lodash.padEnd = padEnd;
  17197. lodash.padStart = padStart;
  17198. lodash.parseInt = parseInt;
  17199. lodash.random = random;
  17200. lodash.reduce = reduce;
  17201. lodash.reduceRight = reduceRight;
  17202. lodash.repeat = repeat;
  17203. lodash.replace = replace;
  17204. lodash.result = result;
  17205. lodash.round = round;
  17206. lodash.runInContext = runInContext;
  17207. lodash.sample = sample;
  17208. lodash.size = size;
  17209. lodash.snakeCase = snakeCase;
  17210. lodash.some = some;
  17211. lodash.sortedIndex = sortedIndex;
  17212. lodash.sortedIndexBy = sortedIndexBy;
  17213. lodash.sortedIndexOf = sortedIndexOf;
  17214. lodash.sortedLastIndex = sortedLastIndex;
  17215. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17216. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17217. lodash.startCase = startCase;
  17218. lodash.startsWith = startsWith;
  17219. lodash.subtract = subtract;
  17220. lodash.sum = sum;
  17221. lodash.sumBy = sumBy;
  17222. lodash.template = template;
  17223. lodash.times = times;
  17224. lodash.toFinite = toFinite;
  17225. lodash.toInteger = toInteger;
  17226. lodash.toLength = toLength;
  17227. lodash.toLower = toLower;
  17228. lodash.toNumber = toNumber;
  17229. lodash.toSafeInteger = toSafeInteger;
  17230. lodash.toString = toString;
  17231. lodash.toUpper = toUpper;
  17232. lodash.trim = trim;
  17233. lodash.trimEnd = trimEnd;
  17234. lodash.trimStart = trimStart;
  17235. lodash.truncate = truncate;
  17236. lodash.unescape = unescape;
  17237. lodash.uniqueId = uniqueId;
  17238. lodash.upperCase = upperCase;
  17239. lodash.upperFirst = upperFirst;
  17240. // Add aliases.
  17241. lodash.each = forEach;
  17242. lodash.eachRight = forEachRight;
  17243. lodash.first = head;
  17244. mixin(lodash, (function() {
  17245. var source = {};
  17246. baseForOwn(lodash, function(func, methodName) {
  17247. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17248. source[methodName] = func;
  17249. }
  17250. });
  17251. return source;
  17252. }()), { 'chain': false });
  17253. /*------------------------------------------------------------------------*/
  17254. /**
  17255. * The semantic version number.
  17256. *
  17257. * @static
  17258. * @memberOf _
  17259. * @type {string}
  17260. */
  17261. lodash.VERSION = VERSION;
  17262. // Assign default placeholders.
  17263. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17264. lodash[methodName].placeholder = lodash;
  17265. });
  17266. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17267. arrayEach(['drop', 'take'], function(methodName, index) {
  17268. LazyWrapper.prototype[methodName] = function(n) {
  17269. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17270. var result = (this.__filtered__ && !index)
  17271. ? new LazyWrapper(this)
  17272. : this.clone();
  17273. if (result.__filtered__) {
  17274. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17275. } else {
  17276. result.__views__.push({
  17277. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17278. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17279. });
  17280. }
  17281. return result;
  17282. };
  17283. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17284. return this.reverse()[methodName](n).reverse();
  17285. };
  17286. });
  17287. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17288. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17289. var type = index + 1,
  17290. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17291. LazyWrapper.prototype[methodName] = function(iteratee) {
  17292. var result = this.clone();
  17293. result.__iteratees__.push({
  17294. 'iteratee': getIteratee(iteratee, 3),
  17295. 'type': type
  17296. });
  17297. result.__filtered__ = result.__filtered__ || isFilter;
  17298. return result;
  17299. };
  17300. });
  17301. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17302. arrayEach(['head', 'last'], function(methodName, index) {
  17303. var takeName = 'take' + (index ? 'Right' : '');
  17304. LazyWrapper.prototype[methodName] = function() {
  17305. return this[takeName](1).value()[0];
  17306. };
  17307. });
  17308. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17309. arrayEach(['initial', 'tail'], function(methodName, index) {
  17310. var dropName = 'drop' + (index ? '' : 'Right');
  17311. LazyWrapper.prototype[methodName] = function() {
  17312. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17313. };
  17314. });
  17315. LazyWrapper.prototype.compact = function() {
  17316. return this.filter(identity);
  17317. };
  17318. LazyWrapper.prototype.find = function(predicate) {
  17319. return this.filter(predicate).head();
  17320. };
  17321. LazyWrapper.prototype.findLast = function(predicate) {
  17322. return this.reverse().find(predicate);
  17323. };
  17324. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17325. if (typeof path == 'function') {
  17326. return new LazyWrapper(this);
  17327. }
  17328. return this.map(function(value) {
  17329. return baseInvoke(value, path, args);
  17330. });
  17331. });
  17332. LazyWrapper.prototype.reject = function(predicate) {
  17333. return this.filter(negate(getIteratee(predicate)));
  17334. };
  17335. LazyWrapper.prototype.slice = function(start, end) {
  17336. start = toInteger(start);
  17337. var result = this;
  17338. if (result.__filtered__ && (start > 0 || end < 0)) {
  17339. return new LazyWrapper(result);
  17340. }
  17341. if (start < 0) {
  17342. result = result.takeRight(-start);
  17343. } else if (start) {
  17344. result = result.drop(start);
  17345. }
  17346. if (end !== undefined) {
  17347. end = toInteger(end);
  17348. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17349. }
  17350. return result;
  17351. };
  17352. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17353. return this.reverse().takeWhile(predicate).reverse();
  17354. };
  17355. LazyWrapper.prototype.toArray = function() {
  17356. return this.take(MAX_ARRAY_LENGTH);
  17357. };
  17358. // Add `LazyWrapper` methods to `lodash.prototype`.
  17359. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17360. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17361. isTaker = /^(?:head|last)$/.test(methodName),
  17362. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17363. retUnwrapped = isTaker || /^find/.test(methodName);
  17364. if (!lodashFunc) {
  17365. return;
  17366. }
  17367. lodash.prototype[methodName] = function() {
  17368. var value = this.__wrapped__,
  17369. args = isTaker ? [1] : arguments,
  17370. isLazy = value instanceof LazyWrapper,
  17371. iteratee = args[0],
  17372. useLazy = isLazy || isArray(value);
  17373. var interceptor = function(value) {
  17374. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17375. return (isTaker && chainAll) ? result[0] : result;
  17376. };
  17377. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17378. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17379. isLazy = useLazy = false;
  17380. }
  17381. var chainAll = this.__chain__,
  17382. isHybrid = !!this.__actions__.length,
  17383. isUnwrapped = retUnwrapped && !chainAll,
  17384. onlyLazy = isLazy && !isHybrid;
  17385. if (!retUnwrapped && useLazy) {
  17386. value = onlyLazy ? value : new LazyWrapper(this);
  17387. var result = func.apply(value, args);
  17388. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17389. return new LodashWrapper(result, chainAll);
  17390. }
  17391. if (isUnwrapped && onlyLazy) {
  17392. return func.apply(this, args);
  17393. }
  17394. result = this.thru(interceptor);
  17395. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17396. };
  17397. });
  17398. // Add `Array` methods to `lodash.prototype`.
  17399. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17400. var func = arrayProto[methodName],
  17401. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17402. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17403. lodash.prototype[methodName] = function() {
  17404. var args = arguments;
  17405. if (retUnwrapped && !this.__chain__) {
  17406. var value = this.value();
  17407. return func.apply(isArray(value) ? value : [], args);
  17408. }
  17409. return this[chainName](function(value) {
  17410. return func.apply(isArray(value) ? value : [], args);
  17411. });
  17412. };
  17413. });
  17414. // Map minified method names to their real names.
  17415. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17416. var lodashFunc = lodash[methodName];
  17417. if (lodashFunc) {
  17418. var key = lodashFunc.name + '';
  17419. if (!hasOwnProperty.call(realNames, key)) {
  17420. realNames[key] = [];
  17421. }
  17422. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17423. }
  17424. });
  17425. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17426. 'name': 'wrapper',
  17427. 'func': undefined
  17428. }];
  17429. // Add methods to `LazyWrapper`.
  17430. LazyWrapper.prototype.clone = lazyClone;
  17431. LazyWrapper.prototype.reverse = lazyReverse;
  17432. LazyWrapper.prototype.value = lazyValue;
  17433. // Add chain sequence methods to the `lodash` wrapper.
  17434. lodash.prototype.at = wrapperAt;
  17435. lodash.prototype.chain = wrapperChain;
  17436. lodash.prototype.commit = wrapperCommit;
  17437. lodash.prototype.next = wrapperNext;
  17438. lodash.prototype.plant = wrapperPlant;
  17439. lodash.prototype.reverse = wrapperReverse;
  17440. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17441. // Add lazy aliases.
  17442. lodash.prototype.first = lodash.prototype.head;
  17443. if (symIterator) {
  17444. lodash.prototype[symIterator] = wrapperToIterator;
  17445. }
  17446. return lodash;
  17447. });
  17448. /*--------------------------------------------------------------------------*/
  17449. // Export lodash.
  17450. var _ = runInContext();
  17451. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17452. if (true) {
  17453. // Expose Lodash on the global object to prevent errors when Lodash is
  17454. // loaded by a script tag in the presence of an AMD loader.
  17455. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17456. // Use `_.noConflict` to remove Lodash from the global object.
  17457. root._ = _;
  17458. // Define as an anonymous module so, through path mapping, it can be
  17459. // referenced as the "underscore" module.
  17460. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17461. return _;
  17462. }).call(exports, __webpack_require__, exports, module),
  17463. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17464. }
  17465. // Check for `exports` after `define` in case a build optimizer adds it.
  17466. else {}
  17467. }.call(this));
  17468. /***/ }),
  17469. /***/ "./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":
  17470. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17471. !*** ./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 ***!
  17472. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17473. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17474. "use strict";
  17475. __webpack_require__.r(__webpack_exports__);
  17476. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17477. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17478. /* harmony export */ });
  17479. /* 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");
  17480. /* 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__);
  17481. /* 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");
  17482. var options = {};
  17483. options.insert = "head";
  17484. options.singleton = false;
  17485. 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);
  17486. /* 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 || {});
  17487. /***/ }),
  17488. /***/ "./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":
  17489. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17490. !*** ./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 ***!
  17491. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17492. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17493. "use strict";
  17494. __webpack_require__.r(__webpack_exports__);
  17495. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17496. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17497. /* harmony export */ });
  17498. /* 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");
  17499. /* 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__);
  17500. /* 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");
  17501. var options = {};
  17502. options.insert = "head";
  17503. options.singleton = false;
  17504. 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);
  17505. /* 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 || {});
  17506. /***/ }),
  17507. /***/ "./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":
  17508. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17509. !*** ./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 ***!
  17510. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17511. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17512. "use strict";
  17513. __webpack_require__.r(__webpack_exports__);
  17514. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17515. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17516. /* harmony export */ });
  17517. /* 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");
  17518. /* 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__);
  17519. /* 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");
  17520. var options = {};
  17521. options.insert = "head";
  17522. options.singleton = false;
  17523. 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);
  17524. /* 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 || {});
  17525. /***/ }),
  17526. /***/ "./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":
  17527. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17528. !*** ./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 ***!
  17529. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17530. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17531. "use strict";
  17532. __webpack_require__.r(__webpack_exports__);
  17533. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17534. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17535. /* harmony export */ });
  17536. /* 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");
  17537. /* 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__);
  17538. /* 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");
  17539. var options = {};
  17540. options.insert = "head";
  17541. options.singleton = false;
  17542. 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);
  17543. /* 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 || {});
  17544. /***/ }),
  17545. /***/ "./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":
  17546. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17547. !*** ./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 ***!
  17548. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17549. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17550. "use strict";
  17551. __webpack_require__.r(__webpack_exports__);
  17552. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17553. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17554. /* harmony export */ });
  17555. /* 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");
  17556. /* 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__);
  17557. /* 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");
  17558. var options = {};
  17559. options.insert = "head";
  17560. options.singleton = false;
  17561. 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);
  17562. /* 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 || {});
  17563. /***/ }),
  17564. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17565. /*!******************************************************!*\
  17566. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17567. \******************************************************/
  17568. /***/ ((__unused_webpack_module, exports) => {
  17569. "use strict";
  17570. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17571. // runtime helper for setting properties on components
  17572. // in a tree-shakable way
  17573. exports["default"] = (sfc, props) => {
  17574. const target = sfc.__vccOpts || sfc;
  17575. for (const [key, val] of props) {
  17576. target[key] = val;
  17577. }
  17578. return target;
  17579. };
  17580. /***/ }),
  17581. /***/ "./resources/js/components/AppButtonLink.vue":
  17582. /*!***************************************************!*\
  17583. !*** ./resources/js/components/AppButtonLink.vue ***!
  17584. \***************************************************/
  17585. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17586. "use strict";
  17587. __webpack_require__.r(__webpack_exports__);
  17588. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17589. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17590. /* harmony export */ });
  17591. /* harmony import */ var _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");
  17592. /* 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");
  17593. /* 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");
  17594. ;
  17595. 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"]])
  17596. /* hot reload */
  17597. if (false) {}
  17598. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17599. /***/ }),
  17600. /***/ "./resources/js/components/AppFooter.vue":
  17601. /*!***********************************************!*\
  17602. !*** ./resources/js/components/AppFooter.vue ***!
  17603. \***********************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17608. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17609. /* harmony export */ });
  17610. /* 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");
  17611. /* 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");
  17612. /* 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");
  17613. const script = {}
  17614. ;
  17615. 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"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/components/AppMessage.vue":
  17621. /*!************************************************!*\
  17622. !*** ./resources/js/components/AppMessage.vue ***!
  17623. \************************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17629. /* harmony export */ });
  17630. /* 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");
  17631. /* 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");
  17632. /* 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");
  17633. ;
  17634. 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"]])
  17635. /* hot reload */
  17636. if (false) {}
  17637. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17638. /***/ }),
  17639. /***/ "./resources/js/components/AppPagination.vue":
  17640. /*!***************************************************!*\
  17641. !*** ./resources/js/components/AppPagination.vue ***!
  17642. \***************************************************/
  17643. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17644. "use strict";
  17645. __webpack_require__.r(__webpack_exports__);
  17646. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17647. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17648. /* harmony export */ });
  17649. /* 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");
  17650. /* 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");
  17651. /* 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");
  17652. ;
  17653. 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"]])
  17654. /* hot reload */
  17655. if (false) {}
  17656. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17657. /***/ }),
  17658. /***/ "./resources/js/components/AppSidebar.vue":
  17659. /*!************************************************!*\
  17660. !*** ./resources/js/components/AppSidebar.vue ***!
  17661. \************************************************/
  17662. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17663. "use strict";
  17664. __webpack_require__.r(__webpack_exports__);
  17665. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17666. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17667. /* harmony export */ });
  17668. /* 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");
  17669. /* 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");
  17670. /* 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");
  17671. /* 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");
  17672. ;
  17673. 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"]])
  17674. /* hot reload */
  17675. if (false) {}
  17676. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17677. /***/ }),
  17678. /***/ "./resources/js/components/AppSubSidebar.vue":
  17679. /*!***************************************************!*\
  17680. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17681. \***************************************************/
  17682. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17683. "use strict";
  17684. __webpack_require__.r(__webpack_exports__);
  17685. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17686. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17687. /* harmony export */ });
  17688. /* 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");
  17689. /* 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");
  17690. /* 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");
  17691. /* 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");
  17692. ;
  17693. 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"]])
  17694. /* hot reload */
  17695. if (false) {}
  17696. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17697. /***/ }),
  17698. /***/ "./resources/js/components/AppTopBar.vue":
  17699. /*!***********************************************!*\
  17700. !*** ./resources/js/components/AppTopBar.vue ***!
  17701. \***********************************************/
  17702. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17703. "use strict";
  17704. __webpack_require__.r(__webpack_exports__);
  17705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17706. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17707. /* harmony export */ });
  17708. /* 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");
  17709. /* 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");
  17710. /* 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");
  17711. /* 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");
  17712. ;
  17713. 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"]])
  17714. /* hot reload */
  17715. if (false) {}
  17716. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17717. /***/ }),
  17718. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17719. /*!**************************************************!*\
  17720. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17721. \**************************************************/
  17722. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17723. "use strict";
  17724. __webpack_require__.r(__webpack_exports__);
  17725. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17726. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17727. /* harmony export */ });
  17728. /* 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");
  17729. /* 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");
  17730. /* 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");
  17731. /* 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");
  17732. ;
  17733. 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"]])
  17734. /* hot reload */
  17735. if (false) {}
  17736. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17737. /***/ }),
  17738. /***/ "./resources/js/pages/mutation/Report.vue":
  17739. /*!************************************************!*\
  17740. !*** ./resources/js/pages/mutation/Report.vue ***!
  17741. \************************************************/
  17742. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17743. "use strict";
  17744. __webpack_require__.r(__webpack_exports__);
  17745. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17746. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17747. /* harmony export */ });
  17748. /* 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");
  17749. /* 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");
  17750. /* 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");
  17751. ;
  17752. 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"]])
  17753. /* hot reload */
  17754. if (false) {}
  17755. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17756. /***/ }),
  17757. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17758. /*!**************************************************************************************!*\
  17759. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17760. \**************************************************************************************/
  17761. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17762. "use strict";
  17763. __webpack_require__.r(__webpack_exports__);
  17764. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17765. /* 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"])
  17766. /* harmony export */ });
  17767. /* 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");
  17768. /***/ }),
  17769. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17770. /*!***********************************************************************************!*\
  17771. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17772. \***********************************************************************************/
  17773. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17774. "use strict";
  17775. __webpack_require__.r(__webpack_exports__);
  17776. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17777. /* 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"])
  17778. /* harmony export */ });
  17779. /* 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");
  17780. /***/ }),
  17781. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17782. /*!**************************************************************************************!*\
  17783. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17784. \**************************************************************************************/
  17785. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17786. "use strict";
  17787. __webpack_require__.r(__webpack_exports__);
  17788. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17789. /* 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"])
  17790. /* harmony export */ });
  17791. /* 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");
  17792. /***/ }),
  17793. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17794. /*!***********************************************************************************!*\
  17795. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17796. \***********************************************************************************/
  17797. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17798. "use strict";
  17799. __webpack_require__.r(__webpack_exports__);
  17800. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17801. /* 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"])
  17802. /* harmony export */ });
  17803. /* 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");
  17804. /***/ }),
  17805. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17806. /*!**************************************************************************************!*\
  17807. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17808. \**************************************************************************************/
  17809. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17810. "use strict";
  17811. __webpack_require__.r(__webpack_exports__);
  17812. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17813. /* 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"])
  17814. /* harmony export */ });
  17815. /* 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");
  17816. /***/ }),
  17817. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17818. /*!**********************************************************************************!*\
  17819. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17820. \**********************************************************************************/
  17821. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17822. "use strict";
  17823. __webpack_require__.r(__webpack_exports__);
  17824. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17825. /* 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"])
  17826. /* harmony export */ });
  17827. /* 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");
  17828. /***/ }),
  17829. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17830. /*!*************************************************************************************!*\
  17831. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17832. \*************************************************************************************/
  17833. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17834. "use strict";
  17835. __webpack_require__.r(__webpack_exports__);
  17836. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17837. /* 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"])
  17838. /* harmony export */ });
  17839. /* 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");
  17840. /***/ }),
  17841. /***/ "./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js":
  17842. /*!***********************************************************************************!*\
  17843. !*** ./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js ***!
  17844. \***********************************************************************************/
  17845. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17846. "use strict";
  17847. __webpack_require__.r(__webpack_exports__);
  17848. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17849. /* 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"])
  17850. /* harmony export */ });
  17851. /* 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");
  17852. /***/ }),
  17853. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17854. /*!*********************************************************************************!*\
  17855. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17856. \*********************************************************************************/
  17857. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17858. "use strict";
  17859. __webpack_require__.r(__webpack_exports__);
  17860. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17861. /* 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)
  17862. /* harmony export */ });
  17863. /* 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");
  17864. /***/ }),
  17865. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17866. /*!*****************************************************************************************!*\
  17867. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17868. \*****************************************************************************************/
  17869. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17870. "use strict";
  17871. __webpack_require__.r(__webpack_exports__);
  17872. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17873. /* 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)
  17874. /* harmony export */ });
  17875. /* 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");
  17876. /***/ }),
  17877. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17878. /*!******************************************************************************!*\
  17879. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17880. \******************************************************************************/
  17881. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17882. "use strict";
  17883. __webpack_require__.r(__webpack_exports__);
  17884. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17885. /* 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)
  17886. /* harmony export */ });
  17887. /* 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");
  17888. /***/ }),
  17889. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17890. /*!*********************************************************************************!*\
  17891. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17892. \*********************************************************************************/
  17893. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17894. "use strict";
  17895. __webpack_require__.r(__webpack_exports__);
  17896. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17897. /* 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)
  17898. /* harmony export */ });
  17899. /* 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");
  17900. /***/ }),
  17901. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17902. /*!******************************************************************************************!*\
  17903. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17904. \******************************************************************************************/
  17905. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17906. "use strict";
  17907. __webpack_require__.r(__webpack_exports__);
  17908. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17909. /* 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)
  17910. /* harmony export */ });
  17911. /* 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");
  17912. /***/ }),
  17913. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17914. /*!*********************************************************************************************!*\
  17915. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17916. \*********************************************************************************************/
  17917. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17918. "use strict";
  17919. __webpack_require__.r(__webpack_exports__);
  17920. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17921. /* 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)
  17922. /* harmony export */ });
  17923. /* 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");
  17924. /***/ }),
  17925. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17926. /*!*****************************************************************************************!*\
  17927. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17928. \*****************************************************************************************/
  17929. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17930. "use strict";
  17931. __webpack_require__.r(__webpack_exports__);
  17932. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17933. /* 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)
  17934. /* harmony export */ });
  17935. /* 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");
  17936. /***/ }),
  17937. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17938. /*!********************************************************************************************!*\
  17939. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17940. \********************************************************************************************/
  17941. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17942. "use strict";
  17943. __webpack_require__.r(__webpack_exports__);
  17944. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17945. /* 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)
  17946. /* harmony export */ });
  17947. /* 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");
  17948. /***/ }),
  17949. /***/ "./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421":
  17950. /*!******************************************************************************!*\
  17951. !*** ./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421 ***!
  17952. \******************************************************************************/
  17953. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17954. "use strict";
  17955. __webpack_require__.r(__webpack_exports__);
  17956. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17957. /* 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)
  17958. /* harmony export */ });
  17959. /* 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");
  17960. /***/ }),
  17961. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17962. /*!********************************************************************************************************!*\
  17963. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17964. \********************************************************************************************************/
  17965. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17966. "use strict";
  17967. __webpack_require__.r(__webpack_exports__);
  17968. /* 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");
  17969. /***/ }),
  17970. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17971. /*!*********************************************************************************************************!*\
  17972. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17973. \*********************************************************************************************************/
  17974. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17975. "use strict";
  17976. __webpack_require__.r(__webpack_exports__);
  17977. /* 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");
  17978. /***/ }),
  17979. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17980. /*!************************************************************************************************************!*\
  17981. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17982. \************************************************************************************************************/
  17983. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17984. "use strict";
  17985. __webpack_require__.r(__webpack_exports__);
  17986. /* 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");
  17987. /***/ }),
  17988. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17989. /*!********************************************************************************************************!*\
  17990. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17991. \********************************************************************************************************/
  17992. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17993. "use strict";
  17994. __webpack_require__.r(__webpack_exports__);
  17995. /* 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");
  17996. /***/ }),
  17997. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17998. /*!***********************************************************************************************************!*\
  17999. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18000. \***********************************************************************************************************/
  18001. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18002. "use strict";
  18003. __webpack_require__.r(__webpack_exports__);
  18004. /* 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");
  18005. /***/ })
  18006. }]);