resources_js_pages_mutation_Report_vue.js 707KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_mutation_Report_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. props: {
  15. inertiaLink: {
  16. type: Boolean,
  17. "default": true
  18. },
  19. icon: String,
  20. label: String,
  21. classButton: String
  22. },
  23. setup: function setup(__props, _ref) {
  24. var expose = _ref.expose;
  25. expose();
  26. var __returned__ = {
  27. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  28. };
  29. Object.defineProperty(__returned__, '__isScriptSetup', {
  30. enumerable: false,
  31. value: true
  32. });
  33. return __returned__;
  34. }
  35. });
  36. /***/ }),
  37. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  38. /*!***************************************************************************************************************************************************************************************************************!*\
  39. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  40. \***************************************************************************************************************************************************************************************************************/
  41. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  42. "use strict";
  43. __webpack_require__.r(__webpack_exports__);
  44. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  45. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  46. /* harmony export */ });
  47. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  48. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var onClose = function onClose() {
  53. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  54. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  56. };
  57. var __returned__ = {
  58. onClose: onClose,
  59. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  60. };
  61. Object.defineProperty(__returned__, '__isScriptSetup', {
  62. enumerable: false,
  63. value: true
  64. });
  65. return __returned__;
  66. }
  67. });
  68. /***/ }),
  69. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  70. /*!******************************************************************************************************************************************************************************************************************!*\
  71. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  72. \******************************************************************************************************************************************************************************************************************/
  73. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  74. "use strict";
  75. __webpack_require__.r(__webpack_exports__);
  76. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  77. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  78. /* harmony export */ });
  79. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  80. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  81. props: {
  82. links: Array
  83. },
  84. setup: function setup(__props, _ref) {
  85. var expose = _ref.expose;
  86. expose();
  87. var __returned__ = {
  88. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  89. };
  90. Object.defineProperty(__returned__, '__isScriptSetup', {
  91. enumerable: false,
  92. value: true
  93. });
  94. return __returned__;
  95. }
  96. });
  97. /***/ }),
  98. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  99. /*!***************************************************************************************************************************************************************************************************************!*\
  100. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  101. \***************************************************************************************************************************************************************************************************************/
  102. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  103. "use strict";
  104. __webpack_require__.r(__webpack_exports__);
  105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  107. /* harmony export */ });
  108. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  109. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  110. props: {
  111. menu: Array
  112. },
  113. setup: function setup(__props, _ref) {
  114. var expose = _ref.expose;
  115. expose();
  116. var __returned__ = {
  117. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  118. };
  119. Object.defineProperty(__returned__, '__isScriptSetup', {
  120. enumerable: false,
  121. value: true
  122. });
  123. return __returned__;
  124. }
  125. });
  126. /***/ }),
  127. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  128. /*!******************************************************************************************************************************************************************************************************************!*\
  129. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  130. \******************************************************************************************************************************************************************************************************************/
  131. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  132. "use strict";
  133. __webpack_require__.r(__webpack_exports__);
  134. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  135. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  136. /* harmony export */ });
  137. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  138. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  139. props: {
  140. items: Array,
  141. root: {
  142. type: Boolean,
  143. "default": false
  144. }
  145. },
  146. setup: function setup(__props, _ref) {
  147. var expose = _ref.expose;
  148. expose();
  149. var __returned__ = {
  150. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  151. };
  152. Object.defineProperty(__returned__, '__isScriptSetup', {
  153. enumerable: false,
  154. value: true
  155. });
  156. return __returned__;
  157. }
  158. });
  159. /***/ }),
  160. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  161. /*!**************************************************************************************************************************************************************************************************************!*\
  162. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  163. \**************************************************************************************************************************************************************************************************************/
  164. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  165. "use strict";
  166. __webpack_require__.r(__webpack_exports__);
  167. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  168. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  169. /* harmony export */ });
  170. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  171. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  172. emits: ['menu-toggle'],
  173. setup: function setup(__props, _ref) {
  174. var expose = _ref.expose;
  175. expose();
  176. var __returned__ = {
  177. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  178. };
  179. Object.defineProperty(__returned__, '__isScriptSetup', {
  180. enumerable: false,
  181. value: true
  182. });
  183. return __returned__;
  184. }
  185. });
  186. /***/ }),
  187. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  188. /*!*****************************************************************************************************************************************************************************************************************!*\
  189. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  190. \*****************************************************************************************************************************************************************************************************************/
  191. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  192. "use strict";
  193. __webpack_require__.r(__webpack_exports__);
  194. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  195. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  196. /* harmony export */ });
  197. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  198. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  199. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  200. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  201. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  202. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  203. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  204. setup: function setup(__props, _ref) {
  205. var expose = _ref.expose;
  206. expose();
  207. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  208. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  209. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  210. var isDesktop = function isDesktop() {
  211. return window.innerWidth >= 992;
  212. };
  213. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  214. return ['layout-wrapper', {
  215. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  216. 'layout-mobile-sidebar-active': mobileMenuActive.value
  217. }];
  218. });
  219. var onWrapperClick = function onWrapperClick() {
  220. if (!menuClick.value) {
  221. mobileMenuActive.value = false;
  222. }
  223. menuClick.value = false;
  224. };
  225. var onMenuToggle = function onMenuToggle(event) {
  226. menuClick.value = true;
  227. if (isDesktop()) {
  228. staticMenuInactive.value = !staticMenuInactive.value;
  229. } else {
  230. mobileMenuActive.value = !mobileMenuActive.value;
  231. }
  232. event.preventDefault();
  233. };
  234. var __returned__ = {
  235. mobileMenuActive: mobileMenuActive,
  236. staticMenuInactive: staticMenuInactive,
  237. menuClick: menuClick,
  238. isDesktop: isDesktop,
  239. containerClass: containerClass,
  240. onWrapperClick: onWrapperClick,
  241. onMenuToggle: onMenuToggle,
  242. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  243. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  244. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  245. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  246. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  247. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  248. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  249. };
  250. Object.defineProperty(__returned__, '__isScriptSetup', {
  251. enumerable: false,
  252. value: true
  253. });
  254. return __returned__;
  255. }
  256. });
  257. /***/ }),
  258. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js":
  259. /*!***************************************************************************************************************************************************************************************************************!*\
  260. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js ***!
  261. \***************************************************************************************************************************************************************************************************************/
  262. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  263. "use strict";
  264. __webpack_require__.r(__webpack_exports__);
  265. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  266. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  267. /* harmony export */ });
  268. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  269. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  270. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  271. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  272. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  273. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/mutation/tableHeader.js");
  274. /* harmony import */ var _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useDateRangeFilter */ "./resources/js/components/useDateRangeFilter.js");
  275. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  276. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  277. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  278. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  279. props: {
  280. mutations: {
  281. type: Object,
  282. "default": {
  283. details: {
  284. data: [],
  285. links: [],
  286. total: 0
  287. }
  288. }
  289. },
  290. initialDateRange: Array
  291. },
  292. setup: function setup(__props, _ref) {
  293. var expose = _ref.expose;
  294. expose();
  295. var props = __props;
  296. var _useDateRangeFilter = (0,_components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter)(props),
  297. dates = _useDateRangeFilter.dates,
  298. startDate = _useDateRangeFilter.startDate,
  299. endDate = _useDateRangeFilter.endDate;
  300. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  301. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.reload({
  302. data: (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  303. startDate: startDate.value,
  304. endDate: endDate.value
  305. }),
  306. only: ['mutations']
  307. });
  308. var params = window.location.search;
  309. exportExcelLink.value = "/reports/mutations/export/excel".concat(params);
  310. });
  311. var filterReset = function filterReset() {
  312. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/reports/mutations');
  313. };
  314. var linkReference = function linkReference(data) {
  315. if (data.topUpId) {
  316. return route('top-ups.show', data.topUpId);
  317. } else if (data.expenseId) {
  318. return route('expenses.show', data.expenseId);
  319. } else {
  320. return route('out-transactions.show', data.outTransactionId);
  321. }
  322. };
  323. var exportExcelLink = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)('/reports/mutations/export/excel');
  324. var __returned__ = {
  325. props: props,
  326. dates: dates,
  327. startDate: startDate,
  328. endDate: endDate,
  329. filterReset: filterReset,
  330. linkReference: linkReference,
  331. exportExcelLink: exportExcelLink,
  332. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  333. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  334. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  335. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  336. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  337. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  338. useDateRangeFilter: _components_useDateRangeFilter__WEBPACK_IMPORTED_MODULE_5__.useDateRangeFilter,
  339. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  340. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  341. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  342. };
  343. Object.defineProperty(__returned__, '__isScriptSetup', {
  344. enumerable: false,
  345. value: true
  346. });
  347. return __returned__;
  348. }
  349. });
  350. /***/ }),
  351. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  352. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  353. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  354. \***********************************************************************************************************************************************************************************************************************************************************************************/
  355. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  356. "use strict";
  357. __webpack_require__.r(__webpack_exports__);
  358. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  359. /* harmony export */ "render": () => (/* binding */ render)
  360. /* harmony export */ });
  361. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  362. var _hoisted_1 = {
  363. key: 1,
  364. "class": "p-button-label"
  365. };
  366. var _hoisted_2 = {
  367. key: 1,
  368. "class": "p-button-label"
  369. };
  370. function render(_ctx, _cache, $props, $setup, $data, $options) {
  371. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  372. key: 0,
  373. "class": "p-button p-component",
  374. as: "button",
  375. type: "button"
  376. }, {
  377. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  378. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  379. key: 0,
  380. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  381. }, null, 2
  382. /* CLASS */
  383. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  384. /* TEXT */
  385. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  386. }),
  387. _: 1
  388. /* STABLE */
  389. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  390. key: 1,
  391. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  392. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  393. key: 0,
  394. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  395. }, null, 2
  396. /* CLASS */
  397. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  398. /* TEXT */
  399. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  400. /* CLASS */
  401. ));
  402. }
  403. /***/ }),
  404. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  405. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  406. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  407. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  408. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  409. "use strict";
  410. __webpack_require__.r(__webpack_exports__);
  411. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  412. /* harmony export */ "render": () => (/* binding */ render)
  413. /* harmony export */ });
  414. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  415. var _withScopeId = function _withScopeId(n) {
  416. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  417. };
  418. var _hoisted_1 = {
  419. "class": "layout-footer"
  420. };
  421. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  422. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  423. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  424. href: "https://dijitalcode.com",
  425. target: "_blank",
  426. "class": "font-medium ml-2"
  427. }, "DijitalCODE", -1
  428. /* HOISTED */
  429. );
  430. });
  431. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  432. function render(_ctx, _cache) {
  433. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  434. }
  435. /***/ }),
  436. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  437. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  438. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  439. \********************************************************************************************************************************************************************************************************************************************************************************/
  440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  441. "use strict";
  442. __webpack_require__.r(__webpack_exports__);
  443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  444. /* harmony export */ "render": () => (/* binding */ render)
  445. /* harmony export */ });
  446. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  447. var _hoisted_1 = {
  448. key: 0
  449. };
  450. var _hoisted_2 = {
  451. key: 1
  452. };
  453. function render(_ctx, _cache, $props, $setup, $data, $options) {
  454. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  455. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  456. key: 0,
  457. severity: "success",
  458. onClose: $setup.onClose
  459. }, {
  460. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  461. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  462. /* TEXT */
  463. )];
  464. }),
  465. _: 1
  466. /* STABLE */
  467. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  468. key: 1,
  469. severity: "error",
  470. onClose: $setup.onClose
  471. }, {
  472. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  473. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  474. /* TEXT */
  475. )];
  476. }),
  477. _: 1
  478. /* STABLE */
  479. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  480. key: 2,
  481. severity: "error",
  482. onClose: $setup.onClose
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  486. /* TEXT */
  487. ))];
  488. }),
  489. _: 1
  490. /* STABLE */
  491. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  492. /* STABLE_FRAGMENT */
  493. );
  494. }
  495. /***/ }),
  496. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  497. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  498. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  499. \***********************************************************************************************************************************************************************************************************************************************************************************/
  500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  501. "use strict";
  502. __webpack_require__.r(__webpack_exports__);
  503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  504. /* harmony export */ "render": () => (/* binding */ render)
  505. /* harmony export */ });
  506. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  507. var _hoisted_1 = {
  508. key: 0,
  509. "class": "p-paginator p-component flex justify-content-start"
  510. };
  511. var _hoisted_2 = {
  512. "class": "p-paginator-pages"
  513. };
  514. var _hoisted_3 = ["innerHTML"];
  515. function render(_ctx, _cache, $props, $setup, $data, $options) {
  516. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  517. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  518. key: "link-".concat(key),
  519. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  520. 'p-disabled': link
  521. }]),
  522. innerHTML: link.label
  523. }, null, 10
  524. /* CLASS, PROPS */
  525. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  526. key: "link-".concat(key),
  527. href: link.url,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'p-highlight': link.active
  530. }, "p-paginator-page p-paginator-element p-link"]),
  531. innerHTML: link.label
  532. }, null, 8
  533. /* PROPS */
  534. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  535. /* STABLE_FRAGMENT */
  536. );
  537. }), 256
  538. /* UNKEYED_FRAGMENT */
  539. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  540. }
  541. /***/ }),
  542. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  543. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  544. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  545. \********************************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. function render(_ctx, _cache, $props, $setup, $data, $options) {
  554. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  555. "class": "layout-menu",
  556. items: $props.menu,
  557. root: true
  558. }, null, 8
  559. /* PROPS */
  560. , ["items"])]);
  561. }
  562. /***/ }),
  563. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  564. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  565. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  566. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  567. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  568. "use strict";
  569. __webpack_require__.r(__webpack_exports__);
  570. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  571. /* harmony export */ "render": () => (/* binding */ render)
  572. /* harmony export */ });
  573. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  574. var _withScopeId = function _withScopeId(n) {
  575. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  576. };
  577. var _hoisted_1 = {
  578. key: 0
  579. };
  580. var _hoisted_2 = ["aria-label"];
  581. var _hoisted_3 = ["aria-label"];
  582. function render(_ctx, _cache, $props, $setup, $data, $options) {
  583. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  584. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  585. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  586. key: i,
  587. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  588. 'layout-menuitem-category': $props.root
  589. }]),
  590. role: "none"
  591. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  592. key: 0
  593. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  594. "class": "layout-menuitem-root-text",
  595. "aria-label": item.label
  596. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  597. /* TEXT, PROPS */
  598. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  599. items: item.items
  600. }, null, 8
  601. /* PROPS */
  602. , ["items"])], 64
  603. /* STABLE_FRAGMENT */
  604. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  605. key: 1
  606. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  607. key: 0,
  608. role: "menuitem",
  609. href: item.to,
  610. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  611. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  612. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  613. }]),
  614. "aria-label": item.label
  615. }, {
  616. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  617. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  618. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  619. }, null, 2
  620. /* CLASS */
  621. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  622. /* TEXT */
  623. )];
  624. }),
  625. _: 2
  626. /* DYNAMIC */
  627. }, 1032
  628. /* PROPS, DYNAMIC_SLOTS */
  629. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  630. key: 1,
  631. href: "#",
  632. role: "menuitem",
  633. "aria-label": item.label
  634. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  635. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  636. }, null, 2
  637. /* CLASS */
  638. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  639. /* TEXT */
  640. )], 8
  641. /* PROPS */
  642. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  643. items: item.items
  644. }, null, 8
  645. /* PROPS */
  646. , ["items"])], 64
  647. /* STABLE_FRAGMENT */
  648. ))], 2
  649. /* CLASS */
  650. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  651. /* STABLE_FRAGMENT */
  652. );
  653. }), 256
  654. /* UNKEYED_FRAGMENT */
  655. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  656. }
  657. /***/ }),
  658. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  659. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  660. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  661. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  662. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  663. "use strict";
  664. __webpack_require__.r(__webpack_exports__);
  665. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  666. /* harmony export */ "render": () => (/* binding */ render)
  667. /* harmony export */ });
  668. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  669. var _withScopeId = function _withScopeId(n) {
  670. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  671. };
  672. var _hoisted_1 = {
  673. "class": "layout-topbar"
  674. };
  675. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  676. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  677. alt: "Logo",
  678. src: "/images/logo.svg",
  679. "class": "md:mr-3"
  680. }, null, -1
  681. /* HOISTED */
  682. );
  683. });
  684. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  685. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  690. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  691. "class": "pi pi-bars"
  692. }, null, -1
  693. /* HOISTED */
  694. );
  695. });
  696. var _hoisted_5 = [_hoisted_4];
  697. var _hoisted_6 = {
  698. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  699. };
  700. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  701. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  702. "class": "pi pi-ellipsis-v"
  703. }, null, -1
  704. /* HOISTED */
  705. );
  706. });
  707. var _hoisted_8 = [_hoisted_7];
  708. var _hoisted_9 = {
  709. "class": "layout-topbar-menu hidden lg:flex origin-top"
  710. };
  711. var _hoisted_10 = {
  712. "class": "align-self-center"
  713. };
  714. var _hoisted_11 = {
  715. "class": "hidden lg:inline"
  716. };
  717. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  718. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  719. "class": "pi pi-user"
  720. }, null, -1
  721. /* HOISTED */
  722. );
  723. });
  724. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  725. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  726. /* HOISTED */
  727. );
  728. });
  729. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  730. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  731. "class": "pi pi-sign-out"
  732. }, null, -1
  733. /* HOISTED */
  734. );
  735. });
  736. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  737. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  738. /* HOISTED */
  739. );
  740. });
  741. function render(_ctx, _cache, $props, $setup, $data, $options) {
  742. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  743. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  744. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  745. href: "/",
  746. "class": "layout-topbar-logo"
  747. }, {
  748. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  749. return [_hoisted_2, _hoisted_3];
  750. }),
  751. _: 1
  752. /* STABLE */
  753. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  754. "class": "p-link layout-menu-button layout-topbar-button",
  755. onClick: _cache[0] || (_cache[0] = function ($event) {
  756. return _ctx.$emit('menu-toggle', $event);
  757. })
  758. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  759. selector: '@next',
  760. enterClass: 'hidden',
  761. enterActiveClass: 'scalein',
  762. leaveToClass: 'hidden',
  763. leaveActiveClass: 'fadeout',
  764. hideOnOutsideClick: true
  765. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  766. /* TEXT */
  767. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  768. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  769. "class": "p-link layout-topbar-button"
  770. }, {
  771. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  772. return [_hoisted_12, _hoisted_13];
  773. }),
  774. _: 1
  775. /* STABLE */
  776. }, 8
  777. /* PROPS */
  778. , ["href"])), [[_directive_tooltip, {
  779. value: 'Ubah Profil',
  780. "class": 'layout-topbar-menu-tooltip'
  781. }, void 0, {
  782. bottom: true
  783. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  784. href: _ctx.route('logout'),
  785. as: "button",
  786. method: "post",
  787. "class": "p-link layout-topbar-button"
  788. }, {
  789. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  790. return [_hoisted_14, _hoisted_15];
  791. }),
  792. _: 1
  793. /* STABLE */
  794. }, 8
  795. /* PROPS */
  796. , ["href"])), [[_directive_tooltip, {
  797. value: 'Keluar',
  798. "class": 'layout-topbar-menu-tooltip'
  799. }, void 0, {
  800. bottom: true
  801. }]])])])]);
  802. }
  803. /***/ }),
  804. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  805. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  806. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  807. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  808. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  809. "use strict";
  810. __webpack_require__.r(__webpack_exports__);
  811. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  812. /* harmony export */ "render": () => (/* binding */ render)
  813. /* harmony export */ });
  814. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  815. var _withScopeId = function _withScopeId(n) {
  816. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  817. };
  818. var _hoisted_1 = {
  819. "class": "layout-sidebar"
  820. };
  821. var _hoisted_2 = {
  822. "class": "layout-main-container"
  823. };
  824. var _hoisted_3 = {
  825. "class": "layout-main"
  826. };
  827. var _hoisted_4 = {
  828. key: 0,
  829. "class": "layout-mask p-component-overlay"
  830. };
  831. function render(_ctx, _cache, $props, $setup, $data, $options) {
  832. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  833. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  834. onClick: $setup.onWrapperClick
  835. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  836. onMenuToggle: $setup.onMenuToggle
  837. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  838. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  839. }, null, 8
  840. /* PROPS */
  841. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  842. name: "layout-mask"
  843. }, {
  844. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  845. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  846. }),
  847. _: 1
  848. /* STABLE */
  849. })], 2
  850. /* CLASS */
  851. );
  852. }
  853. /***/ }),
  854. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421":
  855. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  856. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421 ***!
  857. \********************************************************************************************************************************************************************************************************************************************************************************/
  858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  859. "use strict";
  860. __webpack_require__.r(__webpack_exports__);
  861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  862. /* harmony export */ "render": () => (/* binding */ render)
  863. /* harmony export */ });
  864. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  865. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Laporan Mutasi", -1
  866. /* HOISTED */
  867. );
  868. var _hoisted_2 = {
  869. "class": "grid"
  870. };
  871. var _hoisted_3 = {
  872. "class": "col-12 md:col-8"
  873. };
  874. var _hoisted_4 = {
  875. "class": "grid"
  876. };
  877. var _hoisted_5 = {
  878. "class": "col-12 md:col-4"
  879. };
  880. var _hoisted_6 = {
  881. "class": "col-auto mt-2 ml-2"
  882. };
  883. var _hoisted_7 = {
  884. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  885. };
  886. var _hoisted_8 = {
  887. key: 0,
  888. "class": "grid mt-5 ml-1"
  889. };
  890. var _hoisted_9 = {
  891. "class": "col-auto mr-7"
  892. };
  893. var _hoisted_10 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  894. "class": "text-base"
  895. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  896. "class": "pi pi-wallet"
  897. }), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Pendapatan")], -1
  898. /* HOISTED */
  899. );
  900. var _hoisted_11 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
  901. /* HOISTED */
  902. );
  903. var _hoisted_12 = {
  904. "class": "text-xl font-bold"
  905. };
  906. var _hoisted_13 = {
  907. "class": "col-auto mr-7"
  908. };
  909. var _hoisted_14 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  910. "class": "text-base"
  911. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  912. "class": "pi pi-wallet"
  913. }), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Pengeluaran")], -1
  914. /* HOISTED */
  915. );
  916. var _hoisted_15 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
  917. /* HOISTED */
  918. );
  919. var _hoisted_16 = {
  920. "class": "text-xl font-bold"
  921. };
  922. var _hoisted_17 = {
  923. "class": "col-auto"
  924. };
  925. var _hoisted_18 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", {
  926. "class": "text-base"
  927. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  928. "class": "pi pi-wallet"
  929. }), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Total ")], -1
  930. /* HOISTED */
  931. );
  932. var _hoisted_19 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("br", null, null, -1
  933. /* HOISTED */
  934. );
  935. var _hoisted_20 = {
  936. "class": "text-xl font-bold"
  937. };
  938. function render(_ctx, _cache, $props, $setup, $data, $options) {
  939. var _component_Calendar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Calendar");
  940. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  941. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  942. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  943. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  944. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  945. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  946. title: "Laporan Mutasi"
  947. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  948. "responsive-layout": "scroll",
  949. "column-resize-mode": "expand",
  950. value: $props.mutations.details.data,
  951. "row-hover": true,
  952. "striped-rows": true
  953. }, {
  954. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  955. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Calendar, {
  956. "touch-u-i": "",
  957. "class": "w-full",
  958. modelValue: $setup.dates,
  959. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  960. return $setup.dates = $event;
  961. }),
  962. "selection-mode": "range",
  963. placeholder: "filter waktu...",
  964. "date-format": "dd/mm/yy",
  965. "manual-input": false
  966. }, null, 8
  967. /* PROPS */
  968. , ["modelValue"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Button, {
  969. label: "reset",
  970. "class": "p-button-link",
  971. onClick: $setup.filterReset
  972. })])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_7, [$props.mutations.details.total ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["AppButtonLink"], {
  973. key: 0,
  974. label: "Export excel",
  975. "class-button": "p-button-outlined md:w-16rem",
  976. icon: "pi pi-file-excel",
  977. "inertia-link": false,
  978. href: $setup.exportExcelLink
  979. }, null, 8
  980. /* PROPS */
  981. , ["href"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]), $props.mutations.totalAmount ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_8, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_10, _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalIncome), 1
  982. /* TEXT */
  983. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_13, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_14, _hoisted_15, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_16, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalExpense), 1
  984. /* TEXT */
  985. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_17, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h2", null, [_hoisted_18, _hoisted_19, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_20, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.mutations.totalAmount), 1
  986. /* TEXT */
  987. )])])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  988. }),
  989. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  990. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  991. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  992. field: value.field,
  993. header: value.header,
  994. key: value.field
  995. }, null, 8
  996. /* PROPS */
  997. , ["field", "header"]);
  998. }), 128
  999. /* KEYED_FRAGMENT */
  1000. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  1001. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  1002. var data = _ref.data;
  1003. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  1004. icon: "pi pi-link",
  1005. "class": "p-button-text p-button-icon-only p-button-rounded p-button-text",
  1006. href: $setup.linkReference(data)
  1007. }, null, 8
  1008. /* PROPS */
  1009. , ["href"])];
  1010. }),
  1011. _: 1
  1012. /* STABLE */
  1013. })];
  1014. }),
  1015. _: 1
  1016. /* STABLE */
  1017. }, 8
  1018. /* PROPS */
  1019. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1020. links: $props.mutations.details.links
  1021. }, null, 8
  1022. /* PROPS */
  1023. , ["links"])];
  1024. }),
  1025. _: 1
  1026. /* STABLE */
  1027. });
  1028. }
  1029. /***/ }),
  1030. /***/ "./resources/js/components/useDateRangeFilter.js":
  1031. /*!*******************************************************!*\
  1032. !*** ./resources/js/components/useDateRangeFilter.js ***!
  1033. \*******************************************************/
  1034. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1035. "use strict";
  1036. __webpack_require__.r(__webpack_exports__);
  1037. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1038. /* harmony export */ "useDateRangeFilter": () => (/* binding */ useDateRangeFilter)
  1039. /* harmony export */ });
  1040. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  1041. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dayjs */ "./node_modules/dayjs/dayjs.min.js");
  1042. /* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_1__);
  1043. function useDateRangeFilter(props) {
  1044. var dates = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1045. var startDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1046. var endDate = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(null);
  1047. (0,vue__WEBPACK_IMPORTED_MODULE_0__.onMounted)(function () {
  1048. if (!props.initialDateRange) {
  1049. return;
  1050. }
  1051. if (props.initialDateRange[0] || props.initialDateRange[1]) {
  1052. if (props.initialDateRange[1]) {
  1053. dates.value = [new Date(props.initialDateRange[0]), new Date(props.initialDateRange[1])];
  1054. } else {
  1055. dates.value = [new Date(props.props.initialDateRange[1]), null];
  1056. }
  1057. }
  1058. });
  1059. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(dates, function () {
  1060. if (dates.value[1]) {
  1061. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1062. endDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[1]).format('YYYY-MM-DD');
  1063. } else if (dates.value[0]) {
  1064. startDate.value = dayjs__WEBPACK_IMPORTED_MODULE_1___default()(dates.value[0]).format('YYYY-MM-DD');
  1065. endDate.value = null;
  1066. }
  1067. });
  1068. return {
  1069. dates: dates,
  1070. startDate: startDate,
  1071. endDate: endDate
  1072. };
  1073. }
  1074. /***/ }),
  1075. /***/ "./resources/js/pages/mutation/tableHeader.js":
  1076. /*!****************************************************!*\
  1077. !*** ./resources/js/pages/mutation/tableHeader.js ***!
  1078. \****************************************************/
  1079. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1080. "use strict";
  1081. __webpack_require__.r(__webpack_exports__);
  1082. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1083. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1084. /* harmony export */ });
  1085. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  1086. field: 'createdAt',
  1087. header: 'Tanggal'
  1088. }, {
  1089. field: 'type',
  1090. header: 'Tipe'
  1091. }, {
  1092. field: 'amount',
  1093. header: 'Nilai'
  1094. }]);
  1095. /***/ }),
  1096. /***/ "./resources/js/utils/menu.js":
  1097. /*!************************************!*\
  1098. !*** ./resources/js/utils/menu.js ***!
  1099. \************************************/
  1100. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1101. "use strict";
  1102. __webpack_require__.r(__webpack_exports__);
  1103. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1104. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1105. /* harmony export */ });
  1106. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1107. // Admin
  1108. 1: [{
  1109. label: 'Home',
  1110. items: [{
  1111. label: 'Dashboard',
  1112. icon: 'pi pi-home',
  1113. to: '/dashboards',
  1114. component: 'home/Index'
  1115. }]
  1116. }, {
  1117. label: 'Master',
  1118. items: [{
  1119. label: 'User',
  1120. icon: 'pi pi-user',
  1121. to: '/users',
  1122. component: 'user/Index'
  1123. }]
  1124. }],
  1125. // Supervisor
  1126. 2: [{
  1127. label: 'Home',
  1128. items: [{
  1129. label: 'Dashboard',
  1130. icon: 'pi pi-home',
  1131. to: '/dashboards',
  1132. component: 'home/Index'
  1133. }]
  1134. }, {
  1135. label: 'Menu',
  1136. items: [{
  1137. label: 'Pengeluaran',
  1138. icon: 'pi pi-wallet',
  1139. to: '/expenses',
  1140. component: 'expense/Index'
  1141. }, {
  1142. label: 'Laporan',
  1143. icon: 'pi pi-book',
  1144. items: [{
  1145. label: 'Mutasi',
  1146. icon: 'pi pi-circle',
  1147. to: '/reports/mutations',
  1148. component: 'mutation/Report'
  1149. }]
  1150. }]
  1151. }, {
  1152. label: 'Master',
  1153. items: [{
  1154. label: 'Jenis Kendaraan',
  1155. icon: 'pi pi-car',
  1156. to: '/type-vehicles',
  1157. component: 'typevehicle/Index'
  1158. }, {
  1159. label: 'Jenis Member',
  1160. icon: 'pi pi-id-card',
  1161. to: '/type-members',
  1162. component: 'typemember/Index'
  1163. }]
  1164. }, {
  1165. label: 'Pengaturan',
  1166. items: [{
  1167. label: 'Tarif Parkir',
  1168. icon: 'pi pi-car',
  1169. to: '/parking-fees/create',
  1170. component: 'parkingfee/Create'
  1171. }]
  1172. }],
  1173. // Operator
  1174. 3: [{
  1175. label: 'Home',
  1176. items: [{
  1177. label: 'Dashboard',
  1178. icon: 'pi pi-home',
  1179. to: '/dashboards',
  1180. component: 'home/Index'
  1181. }]
  1182. }, {
  1183. label: 'Transaksi',
  1184. items: [{
  1185. label: 'Transaksi masuk dan keluar',
  1186. icon: 'pi pi-car',
  1187. to: '/transactions/create',
  1188. component: 'transaction/Create'
  1189. }]
  1190. }, {
  1191. label: 'Menu',
  1192. items: [{
  1193. label: 'Pengeluaran',
  1194. icon: 'pi pi-wallet',
  1195. to: '/expenses',
  1196. component: 'expense/Index'
  1197. }, {
  1198. label: 'Member',
  1199. icon: 'pi pi-id-card',
  1200. to: '/members',
  1201. component: 'member/Index'
  1202. }, {
  1203. label: 'Top Up',
  1204. icon: 'pi pi-car',
  1205. to: '/top-ups',
  1206. component: 'topup/Index'
  1207. }]
  1208. }, {
  1209. label: 'Not Production',
  1210. items: [{
  1211. label: 'Test Transactions',
  1212. icon: 'pi pi-car',
  1213. to: '/test-transactions/create',
  1214. component: 'test-transaction/Create'
  1215. }]
  1216. }]
  1217. });
  1218. /***/ }),
  1219. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1220. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1221. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1222. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1223. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1224. "use strict";
  1225. __webpack_require__.r(__webpack_exports__);
  1226. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1227. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1228. /* harmony export */ });
  1229. /* 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");
  1230. /* 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__);
  1231. // Imports
  1232. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1233. // Module
  1234. ___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}", ""]);
  1235. // Exports
  1236. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1237. /***/ }),
  1238. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1239. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1240. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1241. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1242. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1243. "use strict";
  1244. __webpack_require__.r(__webpack_exports__);
  1245. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1246. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1247. /* harmony export */ });
  1248. /* 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");
  1249. /* 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__);
  1250. // Imports
  1251. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1252. // Module
  1253. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1254. // Exports
  1255. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1256. /***/ }),
  1257. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1258. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1259. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1260. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1261. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1262. "use strict";
  1263. __webpack_require__.r(__webpack_exports__);
  1264. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1265. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1266. /* harmony export */ });
  1267. /* 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");
  1268. /* 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__);
  1269. // Imports
  1270. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1271. // Module
  1272. ___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}", ""]);
  1273. // Exports
  1274. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1275. /***/ }),
  1276. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1277. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1278. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1279. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1280. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1281. "use strict";
  1282. __webpack_require__.r(__webpack_exports__);
  1283. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1284. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1285. /* harmony export */ });
  1286. /* 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");
  1287. /* 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__);
  1288. // Imports
  1289. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1290. // Module
  1291. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1292. // Exports
  1293. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1294. /***/ }),
  1295. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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":
  1296. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1297. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.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 ***!
  1298. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1299. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1300. "use strict";
  1301. __webpack_require__.r(__webpack_exports__);
  1302. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1303. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1304. /* harmony export */ });
  1305. /* 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");
  1306. /* 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__);
  1307. // Imports
  1308. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1309. // Module
  1310. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1311. // Exports
  1312. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1313. /***/ }),
  1314. /***/ "./node_modules/dayjs/dayjs.min.js":
  1315. /*!*****************************************!*\
  1316. !*** ./node_modules/dayjs/dayjs.min.js ***!
  1317. \*****************************************/
  1318. /***/ (function(module) {
  1319. !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}));
  1320. /***/ }),
  1321. /***/ "./node_modules/lodash/lodash.js":
  1322. /*!***************************************!*\
  1323. !*** ./node_modules/lodash/lodash.js ***!
  1324. \***************************************/
  1325. /***/ (function(module, exports, __webpack_require__) {
  1326. /* module decorator */ module = __webpack_require__.nmd(module);
  1327. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1328. * @license
  1329. * Lodash <https://lodash.com/>
  1330. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1331. * Released under MIT license <https://lodash.com/license>
  1332. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1333. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1334. */
  1335. ;(function() {
  1336. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1337. var undefined;
  1338. /** Used as the semantic version number. */
  1339. var VERSION = '4.17.21';
  1340. /** Used as the size to enable large array optimizations. */
  1341. var LARGE_ARRAY_SIZE = 200;
  1342. /** Error message constants. */
  1343. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1344. FUNC_ERROR_TEXT = 'Expected a function',
  1345. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1346. /** Used to stand-in for `undefined` hash values. */
  1347. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1348. /** Used as the maximum memoize cache size. */
  1349. var MAX_MEMOIZE_SIZE = 500;
  1350. /** Used as the internal argument placeholder. */
  1351. var PLACEHOLDER = '__lodash_placeholder__';
  1352. /** Used to compose bitmasks for cloning. */
  1353. var CLONE_DEEP_FLAG = 1,
  1354. CLONE_FLAT_FLAG = 2,
  1355. CLONE_SYMBOLS_FLAG = 4;
  1356. /** Used to compose bitmasks for value comparisons. */
  1357. var COMPARE_PARTIAL_FLAG = 1,
  1358. COMPARE_UNORDERED_FLAG = 2;
  1359. /** Used to compose bitmasks for function metadata. */
  1360. var WRAP_BIND_FLAG = 1,
  1361. WRAP_BIND_KEY_FLAG = 2,
  1362. WRAP_CURRY_BOUND_FLAG = 4,
  1363. WRAP_CURRY_FLAG = 8,
  1364. WRAP_CURRY_RIGHT_FLAG = 16,
  1365. WRAP_PARTIAL_FLAG = 32,
  1366. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1367. WRAP_ARY_FLAG = 128,
  1368. WRAP_REARG_FLAG = 256,
  1369. WRAP_FLIP_FLAG = 512;
  1370. /** Used as default options for `_.truncate`. */
  1371. var DEFAULT_TRUNC_LENGTH = 30,
  1372. DEFAULT_TRUNC_OMISSION = '...';
  1373. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1374. var HOT_COUNT = 800,
  1375. HOT_SPAN = 16;
  1376. /** Used to indicate the type of lazy iteratees. */
  1377. var LAZY_FILTER_FLAG = 1,
  1378. LAZY_MAP_FLAG = 2,
  1379. LAZY_WHILE_FLAG = 3;
  1380. /** Used as references for various `Number` constants. */
  1381. var INFINITY = 1 / 0,
  1382. MAX_SAFE_INTEGER = 9007199254740991,
  1383. MAX_INTEGER = 1.7976931348623157e+308,
  1384. NAN = 0 / 0;
  1385. /** Used as references for the maximum length and index of an array. */
  1386. var MAX_ARRAY_LENGTH = 4294967295,
  1387. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1388. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1389. /** Used to associate wrap methods with their bit flags. */
  1390. var wrapFlags = [
  1391. ['ary', WRAP_ARY_FLAG],
  1392. ['bind', WRAP_BIND_FLAG],
  1393. ['bindKey', WRAP_BIND_KEY_FLAG],
  1394. ['curry', WRAP_CURRY_FLAG],
  1395. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1396. ['flip', WRAP_FLIP_FLAG],
  1397. ['partial', WRAP_PARTIAL_FLAG],
  1398. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1399. ['rearg', WRAP_REARG_FLAG]
  1400. ];
  1401. /** `Object#toString` result references. */
  1402. var argsTag = '[object Arguments]',
  1403. arrayTag = '[object Array]',
  1404. asyncTag = '[object AsyncFunction]',
  1405. boolTag = '[object Boolean]',
  1406. dateTag = '[object Date]',
  1407. domExcTag = '[object DOMException]',
  1408. errorTag = '[object Error]',
  1409. funcTag = '[object Function]',
  1410. genTag = '[object GeneratorFunction]',
  1411. mapTag = '[object Map]',
  1412. numberTag = '[object Number]',
  1413. nullTag = '[object Null]',
  1414. objectTag = '[object Object]',
  1415. promiseTag = '[object Promise]',
  1416. proxyTag = '[object Proxy]',
  1417. regexpTag = '[object RegExp]',
  1418. setTag = '[object Set]',
  1419. stringTag = '[object String]',
  1420. symbolTag = '[object Symbol]',
  1421. undefinedTag = '[object Undefined]',
  1422. weakMapTag = '[object WeakMap]',
  1423. weakSetTag = '[object WeakSet]';
  1424. var arrayBufferTag = '[object ArrayBuffer]',
  1425. dataViewTag = '[object DataView]',
  1426. float32Tag = '[object Float32Array]',
  1427. float64Tag = '[object Float64Array]',
  1428. int8Tag = '[object Int8Array]',
  1429. int16Tag = '[object Int16Array]',
  1430. int32Tag = '[object Int32Array]',
  1431. uint8Tag = '[object Uint8Array]',
  1432. uint8ClampedTag = '[object Uint8ClampedArray]',
  1433. uint16Tag = '[object Uint16Array]',
  1434. uint32Tag = '[object Uint32Array]';
  1435. /** Used to match empty string literals in compiled template source. */
  1436. var reEmptyStringLeading = /\b__p \+= '';/g,
  1437. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1438. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1439. /** Used to match HTML entities and HTML characters. */
  1440. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1441. reUnescapedHtml = /[&<>"']/g,
  1442. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1443. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1444. /** Used to match template delimiters. */
  1445. var reEscape = /<%-([\s\S]+?)%>/g,
  1446. reEvaluate = /<%([\s\S]+?)%>/g,
  1447. reInterpolate = /<%=([\s\S]+?)%>/g;
  1448. /** Used to match property names within property paths. */
  1449. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1450. reIsPlainProp = /^\w*$/,
  1451. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1452. /**
  1453. * Used to match `RegExp`
  1454. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1455. */
  1456. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1457. reHasRegExpChar = RegExp(reRegExpChar.source);
  1458. /** Used to match leading whitespace. */
  1459. var reTrimStart = /^\s+/;
  1460. /** Used to match a single whitespace character. */
  1461. var reWhitespace = /\s/;
  1462. /** Used to match wrap detail comments. */
  1463. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1464. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1465. reSplitDetails = /,? & /;
  1466. /** Used to match words composed of alphanumeric characters. */
  1467. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1468. /**
  1469. * Used to validate the `validate` option in `_.template` variable.
  1470. *
  1471. * Forbids characters which could potentially change the meaning of the function argument definition:
  1472. * - "()," (modification of function parameters)
  1473. * - "=" (default value)
  1474. * - "[]{}" (destructuring of function parameters)
  1475. * - "/" (beginning of a comment)
  1476. * - whitespace
  1477. */
  1478. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1479. /** Used to match backslashes in property paths. */
  1480. var reEscapeChar = /\\(\\)?/g;
  1481. /**
  1482. * Used to match
  1483. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1484. */
  1485. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1486. /** Used to match `RegExp` flags from their coerced string values. */
  1487. var reFlags = /\w*$/;
  1488. /** Used to detect bad signed hexadecimal string values. */
  1489. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1490. /** Used to detect binary string values. */
  1491. var reIsBinary = /^0b[01]+$/i;
  1492. /** Used to detect host constructors (Safari). */
  1493. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1494. /** Used to detect octal string values. */
  1495. var reIsOctal = /^0o[0-7]+$/i;
  1496. /** Used to detect unsigned integer values. */
  1497. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1498. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1499. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1500. /** Used to ensure capturing order of template delimiters. */
  1501. var reNoMatch = /($^)/;
  1502. /** Used to match unescaped characters in compiled string literals. */
  1503. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1504. /** Used to compose unicode character classes. */
  1505. var rsAstralRange = '\\ud800-\\udfff',
  1506. rsComboMarksRange = '\\u0300-\\u036f',
  1507. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1508. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1509. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1510. rsDingbatRange = '\\u2700-\\u27bf',
  1511. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1512. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1513. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1514. rsPunctuationRange = '\\u2000-\\u206f',
  1515. 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',
  1516. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1517. rsVarRange = '\\ufe0e\\ufe0f',
  1518. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1519. /** Used to compose unicode capture groups. */
  1520. var rsApos = "['\u2019]",
  1521. rsAstral = '[' + rsAstralRange + ']',
  1522. rsBreak = '[' + rsBreakRange + ']',
  1523. rsCombo = '[' + rsComboRange + ']',
  1524. rsDigits = '\\d+',
  1525. rsDingbat = '[' + rsDingbatRange + ']',
  1526. rsLower = '[' + rsLowerRange + ']',
  1527. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1528. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1529. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1530. rsNonAstral = '[^' + rsAstralRange + ']',
  1531. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1532. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1533. rsUpper = '[' + rsUpperRange + ']',
  1534. rsZWJ = '\\u200d';
  1535. /** Used to compose unicode regexes. */
  1536. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1537. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1538. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1539. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1540. reOptMod = rsModifier + '?',
  1541. rsOptVar = '[' + rsVarRange + ']?',
  1542. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1543. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1544. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1545. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1546. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1547. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1548. /** Used to match apostrophes. */
  1549. var reApos = RegExp(rsApos, 'g');
  1550. /**
  1551. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1552. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1553. */
  1554. var reComboMark = RegExp(rsCombo, 'g');
  1555. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1556. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1557. /** Used to match complex or compound words. */
  1558. var reUnicodeWord = RegExp([
  1559. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1560. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1561. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1562. rsUpper + '+' + rsOptContrUpper,
  1563. rsOrdUpper,
  1564. rsOrdLower,
  1565. rsDigits,
  1566. rsEmoji
  1567. ].join('|'), 'g');
  1568. /** 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/). */
  1569. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1570. /** Used to detect strings that need a more robust regexp to match words. */
  1571. 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 ]/;
  1572. /** Used to assign default `context` object properties. */
  1573. var contextProps = [
  1574. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1575. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1576. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1577. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1578. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1579. ];
  1580. /** Used to make template sourceURLs easier to identify. */
  1581. var templateCounter = -1;
  1582. /** Used to identify `toStringTag` values of typed arrays. */
  1583. var typedArrayTags = {};
  1584. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1585. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1586. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1587. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1588. typedArrayTags[uint32Tag] = true;
  1589. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1590. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1591. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1592. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1593. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1594. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1595. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1596. typedArrayTags[weakMapTag] = false;
  1597. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1598. var cloneableTags = {};
  1599. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1600. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1601. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1602. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1603. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1604. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1605. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1606. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1607. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1608. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1609. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1610. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1611. cloneableTags[weakMapTag] = false;
  1612. /** Used to map Latin Unicode letters to basic Latin letters. */
  1613. var deburredLetters = {
  1614. // Latin-1 Supplement block.
  1615. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1616. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1617. '\xc7': 'C', '\xe7': 'c',
  1618. '\xd0': 'D', '\xf0': 'd',
  1619. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1620. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1621. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1622. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1623. '\xd1': 'N', '\xf1': 'n',
  1624. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1625. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1626. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1627. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1628. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1629. '\xc6': 'Ae', '\xe6': 'ae',
  1630. '\xde': 'Th', '\xfe': 'th',
  1631. '\xdf': 'ss',
  1632. // Latin Extended-A block.
  1633. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1634. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1635. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1636. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1637. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1638. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1639. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1640. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1641. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1642. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1643. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1644. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1645. '\u0134': 'J', '\u0135': 'j',
  1646. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1647. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1648. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1649. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1650. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1651. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1652. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1653. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1654. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1655. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1656. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1657. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1658. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1659. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1660. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1661. '\u0174': 'W', '\u0175': 'w',
  1662. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1663. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1664. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1665. '\u0132': 'IJ', '\u0133': 'ij',
  1666. '\u0152': 'Oe', '\u0153': 'oe',
  1667. '\u0149': "'n", '\u017f': 's'
  1668. };
  1669. /** Used to map characters to HTML entities. */
  1670. var htmlEscapes = {
  1671. '&': '&amp;',
  1672. '<': '&lt;',
  1673. '>': '&gt;',
  1674. '"': '&quot;',
  1675. "'": '&#39;'
  1676. };
  1677. /** Used to map HTML entities to characters. */
  1678. var htmlUnescapes = {
  1679. '&amp;': '&',
  1680. '&lt;': '<',
  1681. '&gt;': '>',
  1682. '&quot;': '"',
  1683. '&#39;': "'"
  1684. };
  1685. /** Used to escape characters for inclusion in compiled string literals. */
  1686. var stringEscapes = {
  1687. '\\': '\\',
  1688. "'": "'",
  1689. '\n': 'n',
  1690. '\r': 'r',
  1691. '\u2028': 'u2028',
  1692. '\u2029': 'u2029'
  1693. };
  1694. /** Built-in method references without a dependency on `root`. */
  1695. var freeParseFloat = parseFloat,
  1696. freeParseInt = parseInt;
  1697. /** Detect free variable `global` from Node.js. */
  1698. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1699. /** Detect free variable `self`. */
  1700. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1701. /** Used as a reference to the global object. */
  1702. var root = freeGlobal || freeSelf || Function('return this')();
  1703. /** Detect free variable `exports`. */
  1704. var freeExports = true && exports && !exports.nodeType && exports;
  1705. /** Detect free variable `module`. */
  1706. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1707. /** Detect the popular CommonJS extension `module.exports`. */
  1708. var moduleExports = freeModule && freeModule.exports === freeExports;
  1709. /** Detect free variable `process` from Node.js. */
  1710. var freeProcess = moduleExports && freeGlobal.process;
  1711. /** Used to access faster Node.js helpers. */
  1712. var nodeUtil = (function() {
  1713. try {
  1714. // Use `util.types` for Node.js 10+.
  1715. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1716. if (types) {
  1717. return types;
  1718. }
  1719. // Legacy `process.binding('util')` for Node.js < 10.
  1720. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1721. } catch (e) {}
  1722. }());
  1723. /* Node.js helper references. */
  1724. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1725. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1726. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1727. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1728. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1729. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1730. /*--------------------------------------------------------------------------*/
  1731. /**
  1732. * A faster alternative to `Function#apply`, this function invokes `func`
  1733. * with the `this` binding of `thisArg` and the arguments of `args`.
  1734. *
  1735. * @private
  1736. * @param {Function} func The function to invoke.
  1737. * @param {*} thisArg The `this` binding of `func`.
  1738. * @param {Array} args The arguments to invoke `func` with.
  1739. * @returns {*} Returns the result of `func`.
  1740. */
  1741. function apply(func, thisArg, args) {
  1742. switch (args.length) {
  1743. case 0: return func.call(thisArg);
  1744. case 1: return func.call(thisArg, args[0]);
  1745. case 2: return func.call(thisArg, args[0], args[1]);
  1746. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1747. }
  1748. return func.apply(thisArg, args);
  1749. }
  1750. /**
  1751. * A specialized version of `baseAggregator` for arrays.
  1752. *
  1753. * @private
  1754. * @param {Array} [array] The array to iterate over.
  1755. * @param {Function} setter The function to set `accumulator` values.
  1756. * @param {Function} iteratee The iteratee to transform keys.
  1757. * @param {Object} accumulator The initial aggregated object.
  1758. * @returns {Function} Returns `accumulator`.
  1759. */
  1760. function arrayAggregator(array, setter, iteratee, accumulator) {
  1761. var index = -1,
  1762. length = array == null ? 0 : array.length;
  1763. while (++index < length) {
  1764. var value = array[index];
  1765. setter(accumulator, value, iteratee(value), array);
  1766. }
  1767. return accumulator;
  1768. }
  1769. /**
  1770. * A specialized version of `_.forEach` for arrays without support for
  1771. * iteratee shorthands.
  1772. *
  1773. * @private
  1774. * @param {Array} [array] The array to iterate over.
  1775. * @param {Function} iteratee The function invoked per iteration.
  1776. * @returns {Array} Returns `array`.
  1777. */
  1778. function arrayEach(array, iteratee) {
  1779. var index = -1,
  1780. length = array == null ? 0 : array.length;
  1781. while (++index < length) {
  1782. if (iteratee(array[index], index, array) === false) {
  1783. break;
  1784. }
  1785. }
  1786. return array;
  1787. }
  1788. /**
  1789. * A specialized version of `_.forEachRight` for arrays without support for
  1790. * iteratee shorthands.
  1791. *
  1792. * @private
  1793. * @param {Array} [array] The array to iterate over.
  1794. * @param {Function} iteratee The function invoked per iteration.
  1795. * @returns {Array} Returns `array`.
  1796. */
  1797. function arrayEachRight(array, iteratee) {
  1798. var length = array == null ? 0 : array.length;
  1799. while (length--) {
  1800. if (iteratee(array[length], length, array) === false) {
  1801. break;
  1802. }
  1803. }
  1804. return array;
  1805. }
  1806. /**
  1807. * A specialized version of `_.every` for arrays without support for
  1808. * iteratee shorthands.
  1809. *
  1810. * @private
  1811. * @param {Array} [array] The array to iterate over.
  1812. * @param {Function} predicate The function invoked per iteration.
  1813. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1814. * else `false`.
  1815. */
  1816. function arrayEvery(array, predicate) {
  1817. var index = -1,
  1818. length = array == null ? 0 : array.length;
  1819. while (++index < length) {
  1820. if (!predicate(array[index], index, array)) {
  1821. return false;
  1822. }
  1823. }
  1824. return true;
  1825. }
  1826. /**
  1827. * A specialized version of `_.filter` for arrays without support for
  1828. * iteratee shorthands.
  1829. *
  1830. * @private
  1831. * @param {Array} [array] The array to iterate over.
  1832. * @param {Function} predicate The function invoked per iteration.
  1833. * @returns {Array} Returns the new filtered array.
  1834. */
  1835. function arrayFilter(array, predicate) {
  1836. var index = -1,
  1837. length = array == null ? 0 : array.length,
  1838. resIndex = 0,
  1839. result = [];
  1840. while (++index < length) {
  1841. var value = array[index];
  1842. if (predicate(value, index, array)) {
  1843. result[resIndex++] = value;
  1844. }
  1845. }
  1846. return result;
  1847. }
  1848. /**
  1849. * A specialized version of `_.includes` for arrays without support for
  1850. * specifying an index to search from.
  1851. *
  1852. * @private
  1853. * @param {Array} [array] The array to inspect.
  1854. * @param {*} target The value to search for.
  1855. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1856. */
  1857. function arrayIncludes(array, value) {
  1858. var length = array == null ? 0 : array.length;
  1859. return !!length && baseIndexOf(array, value, 0) > -1;
  1860. }
  1861. /**
  1862. * This function is like `arrayIncludes` except that it accepts a comparator.
  1863. *
  1864. * @private
  1865. * @param {Array} [array] The array to inspect.
  1866. * @param {*} target The value to search for.
  1867. * @param {Function} comparator The comparator invoked per element.
  1868. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1869. */
  1870. function arrayIncludesWith(array, value, comparator) {
  1871. var index = -1,
  1872. length = array == null ? 0 : array.length;
  1873. while (++index < length) {
  1874. if (comparator(value, array[index])) {
  1875. return true;
  1876. }
  1877. }
  1878. return false;
  1879. }
  1880. /**
  1881. * A specialized version of `_.map` for arrays without support for iteratee
  1882. * shorthands.
  1883. *
  1884. * @private
  1885. * @param {Array} [array] The array to iterate over.
  1886. * @param {Function} iteratee The function invoked per iteration.
  1887. * @returns {Array} Returns the new mapped array.
  1888. */
  1889. function arrayMap(array, iteratee) {
  1890. var index = -1,
  1891. length = array == null ? 0 : array.length,
  1892. result = Array(length);
  1893. while (++index < length) {
  1894. result[index] = iteratee(array[index], index, array);
  1895. }
  1896. return result;
  1897. }
  1898. /**
  1899. * Appends the elements of `values` to `array`.
  1900. *
  1901. * @private
  1902. * @param {Array} array The array to modify.
  1903. * @param {Array} values The values to append.
  1904. * @returns {Array} Returns `array`.
  1905. */
  1906. function arrayPush(array, values) {
  1907. var index = -1,
  1908. length = values.length,
  1909. offset = array.length;
  1910. while (++index < length) {
  1911. array[offset + index] = values[index];
  1912. }
  1913. return array;
  1914. }
  1915. /**
  1916. * A specialized version of `_.reduce` for arrays without support for
  1917. * iteratee shorthands.
  1918. *
  1919. * @private
  1920. * @param {Array} [array] The array to iterate over.
  1921. * @param {Function} iteratee The function invoked per iteration.
  1922. * @param {*} [accumulator] The initial value.
  1923. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1924. * the initial value.
  1925. * @returns {*} Returns the accumulated value.
  1926. */
  1927. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1928. var index = -1,
  1929. length = array == null ? 0 : array.length;
  1930. if (initAccum && length) {
  1931. accumulator = array[++index];
  1932. }
  1933. while (++index < length) {
  1934. accumulator = iteratee(accumulator, array[index], index, array);
  1935. }
  1936. return accumulator;
  1937. }
  1938. /**
  1939. * A specialized version of `_.reduceRight` for arrays without support for
  1940. * iteratee shorthands.
  1941. *
  1942. * @private
  1943. * @param {Array} [array] The array to iterate over.
  1944. * @param {Function} iteratee The function invoked per iteration.
  1945. * @param {*} [accumulator] The initial value.
  1946. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1947. * the initial value.
  1948. * @returns {*} Returns the accumulated value.
  1949. */
  1950. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1951. var length = array == null ? 0 : array.length;
  1952. if (initAccum && length) {
  1953. accumulator = array[--length];
  1954. }
  1955. while (length--) {
  1956. accumulator = iteratee(accumulator, array[length], length, array);
  1957. }
  1958. return accumulator;
  1959. }
  1960. /**
  1961. * A specialized version of `_.some` for arrays without support for iteratee
  1962. * shorthands.
  1963. *
  1964. * @private
  1965. * @param {Array} [array] The array to iterate over.
  1966. * @param {Function} predicate The function invoked per iteration.
  1967. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1968. * else `false`.
  1969. */
  1970. function arraySome(array, predicate) {
  1971. var index = -1,
  1972. length = array == null ? 0 : array.length;
  1973. while (++index < length) {
  1974. if (predicate(array[index], index, array)) {
  1975. return true;
  1976. }
  1977. }
  1978. return false;
  1979. }
  1980. /**
  1981. * Gets the size of an ASCII `string`.
  1982. *
  1983. * @private
  1984. * @param {string} string The string inspect.
  1985. * @returns {number} Returns the string size.
  1986. */
  1987. var asciiSize = baseProperty('length');
  1988. /**
  1989. * Converts an ASCII `string` to an array.
  1990. *
  1991. * @private
  1992. * @param {string} string The string to convert.
  1993. * @returns {Array} Returns the converted array.
  1994. */
  1995. function asciiToArray(string) {
  1996. return string.split('');
  1997. }
  1998. /**
  1999. * Splits an ASCII `string` into an array of its words.
  2000. *
  2001. * @private
  2002. * @param {string} The string to inspect.
  2003. * @returns {Array} Returns the words of `string`.
  2004. */
  2005. function asciiWords(string) {
  2006. return string.match(reAsciiWord) || [];
  2007. }
  2008. /**
  2009. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  2010. * without support for iteratee shorthands, which iterates over `collection`
  2011. * using `eachFunc`.
  2012. *
  2013. * @private
  2014. * @param {Array|Object} collection The collection to inspect.
  2015. * @param {Function} predicate The function invoked per iteration.
  2016. * @param {Function} eachFunc The function to iterate over `collection`.
  2017. * @returns {*} Returns the found element or its key, else `undefined`.
  2018. */
  2019. function baseFindKey(collection, predicate, eachFunc) {
  2020. var result;
  2021. eachFunc(collection, function(value, key, collection) {
  2022. if (predicate(value, key, collection)) {
  2023. result = key;
  2024. return false;
  2025. }
  2026. });
  2027. return result;
  2028. }
  2029. /**
  2030. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  2031. * support for iteratee shorthands.
  2032. *
  2033. * @private
  2034. * @param {Array} array The array to inspect.
  2035. * @param {Function} predicate The function invoked per iteration.
  2036. * @param {number} fromIndex The index to search from.
  2037. * @param {boolean} [fromRight] Specify iterating from right to left.
  2038. * @returns {number} Returns the index of the matched value, else `-1`.
  2039. */
  2040. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  2041. var length = array.length,
  2042. index = fromIndex + (fromRight ? 1 : -1);
  2043. while ((fromRight ? index-- : ++index < length)) {
  2044. if (predicate(array[index], index, array)) {
  2045. return index;
  2046. }
  2047. }
  2048. return -1;
  2049. }
  2050. /**
  2051. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  2052. *
  2053. * @private
  2054. * @param {Array} array The array to inspect.
  2055. * @param {*} value The value to search for.
  2056. * @param {number} fromIndex The index to search from.
  2057. * @returns {number} Returns the index of the matched value, else `-1`.
  2058. */
  2059. function baseIndexOf(array, value, fromIndex) {
  2060. return value === value
  2061. ? strictIndexOf(array, value, fromIndex)
  2062. : baseFindIndex(array, baseIsNaN, fromIndex);
  2063. }
  2064. /**
  2065. * This function is like `baseIndexOf` except that it accepts a comparator.
  2066. *
  2067. * @private
  2068. * @param {Array} array The array to inspect.
  2069. * @param {*} value The value to search for.
  2070. * @param {number} fromIndex The index to search from.
  2071. * @param {Function} comparator The comparator invoked per element.
  2072. * @returns {number} Returns the index of the matched value, else `-1`.
  2073. */
  2074. function baseIndexOfWith(array, value, fromIndex, comparator) {
  2075. var index = fromIndex - 1,
  2076. length = array.length;
  2077. while (++index < length) {
  2078. if (comparator(array[index], value)) {
  2079. return index;
  2080. }
  2081. }
  2082. return -1;
  2083. }
  2084. /**
  2085. * The base implementation of `_.isNaN` without support for number objects.
  2086. *
  2087. * @private
  2088. * @param {*} value The value to check.
  2089. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2090. */
  2091. function baseIsNaN(value) {
  2092. return value !== value;
  2093. }
  2094. /**
  2095. * The base implementation of `_.mean` and `_.meanBy` without support for
  2096. * iteratee shorthands.
  2097. *
  2098. * @private
  2099. * @param {Array} array The array to iterate over.
  2100. * @param {Function} iteratee The function invoked per iteration.
  2101. * @returns {number} Returns the mean.
  2102. */
  2103. function baseMean(array, iteratee) {
  2104. var length = array == null ? 0 : array.length;
  2105. return length ? (baseSum(array, iteratee) / length) : NAN;
  2106. }
  2107. /**
  2108. * The base implementation of `_.property` without support for deep paths.
  2109. *
  2110. * @private
  2111. * @param {string} key The key of the property to get.
  2112. * @returns {Function} Returns the new accessor function.
  2113. */
  2114. function baseProperty(key) {
  2115. return function(object) {
  2116. return object == null ? undefined : object[key];
  2117. };
  2118. }
  2119. /**
  2120. * The base implementation of `_.propertyOf` without support for deep paths.
  2121. *
  2122. * @private
  2123. * @param {Object} object The object to query.
  2124. * @returns {Function} Returns the new accessor function.
  2125. */
  2126. function basePropertyOf(object) {
  2127. return function(key) {
  2128. return object == null ? undefined : object[key];
  2129. };
  2130. }
  2131. /**
  2132. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2133. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2134. *
  2135. * @private
  2136. * @param {Array|Object} collection The collection to iterate over.
  2137. * @param {Function} iteratee The function invoked per iteration.
  2138. * @param {*} accumulator The initial value.
  2139. * @param {boolean} initAccum Specify using the first or last element of
  2140. * `collection` as the initial value.
  2141. * @param {Function} eachFunc The function to iterate over `collection`.
  2142. * @returns {*} Returns the accumulated value.
  2143. */
  2144. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2145. eachFunc(collection, function(value, index, collection) {
  2146. accumulator = initAccum
  2147. ? (initAccum = false, value)
  2148. : iteratee(accumulator, value, index, collection);
  2149. });
  2150. return accumulator;
  2151. }
  2152. /**
  2153. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2154. * sort order of `array` and replaces criteria objects with their corresponding
  2155. * values.
  2156. *
  2157. * @private
  2158. * @param {Array} array The array to sort.
  2159. * @param {Function} comparer The function to define sort order.
  2160. * @returns {Array} Returns `array`.
  2161. */
  2162. function baseSortBy(array, comparer) {
  2163. var length = array.length;
  2164. array.sort(comparer);
  2165. while (length--) {
  2166. array[length] = array[length].value;
  2167. }
  2168. return array;
  2169. }
  2170. /**
  2171. * The base implementation of `_.sum` and `_.sumBy` without support for
  2172. * iteratee shorthands.
  2173. *
  2174. * @private
  2175. * @param {Array} array The array to iterate over.
  2176. * @param {Function} iteratee The function invoked per iteration.
  2177. * @returns {number} Returns the sum.
  2178. */
  2179. function baseSum(array, iteratee) {
  2180. var result,
  2181. index = -1,
  2182. length = array.length;
  2183. while (++index < length) {
  2184. var current = iteratee(array[index]);
  2185. if (current !== undefined) {
  2186. result = result === undefined ? current : (result + current);
  2187. }
  2188. }
  2189. return result;
  2190. }
  2191. /**
  2192. * The base implementation of `_.times` without support for iteratee shorthands
  2193. * or max array length checks.
  2194. *
  2195. * @private
  2196. * @param {number} n The number of times to invoke `iteratee`.
  2197. * @param {Function} iteratee The function invoked per iteration.
  2198. * @returns {Array} Returns the array of results.
  2199. */
  2200. function baseTimes(n, iteratee) {
  2201. var index = -1,
  2202. result = Array(n);
  2203. while (++index < n) {
  2204. result[index] = iteratee(index);
  2205. }
  2206. return result;
  2207. }
  2208. /**
  2209. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2210. * of key-value pairs for `object` corresponding to the property names of `props`.
  2211. *
  2212. * @private
  2213. * @param {Object} object The object to query.
  2214. * @param {Array} props The property names to get values for.
  2215. * @returns {Object} Returns the key-value pairs.
  2216. */
  2217. function baseToPairs(object, props) {
  2218. return arrayMap(props, function(key) {
  2219. return [key, object[key]];
  2220. });
  2221. }
  2222. /**
  2223. * The base implementation of `_.trim`.
  2224. *
  2225. * @private
  2226. * @param {string} string The string to trim.
  2227. * @returns {string} Returns the trimmed string.
  2228. */
  2229. function baseTrim(string) {
  2230. return string
  2231. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2232. : string;
  2233. }
  2234. /**
  2235. * The base implementation of `_.unary` without support for storing metadata.
  2236. *
  2237. * @private
  2238. * @param {Function} func The function to cap arguments for.
  2239. * @returns {Function} Returns the new capped function.
  2240. */
  2241. function baseUnary(func) {
  2242. return function(value) {
  2243. return func(value);
  2244. };
  2245. }
  2246. /**
  2247. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2248. * array of `object` property values corresponding to the property names
  2249. * of `props`.
  2250. *
  2251. * @private
  2252. * @param {Object} object The object to query.
  2253. * @param {Array} props The property names to get values for.
  2254. * @returns {Object} Returns the array of property values.
  2255. */
  2256. function baseValues(object, props) {
  2257. return arrayMap(props, function(key) {
  2258. return object[key];
  2259. });
  2260. }
  2261. /**
  2262. * Checks if a `cache` value for `key` exists.
  2263. *
  2264. * @private
  2265. * @param {Object} cache The cache to query.
  2266. * @param {string} key The key of the entry to check.
  2267. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2268. */
  2269. function cacheHas(cache, key) {
  2270. return cache.has(key);
  2271. }
  2272. /**
  2273. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2274. * that is not found in the character symbols.
  2275. *
  2276. * @private
  2277. * @param {Array} strSymbols The string symbols to inspect.
  2278. * @param {Array} chrSymbols The character symbols to find.
  2279. * @returns {number} Returns the index of the first unmatched string symbol.
  2280. */
  2281. function charsStartIndex(strSymbols, chrSymbols) {
  2282. var index = -1,
  2283. length = strSymbols.length;
  2284. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2285. return index;
  2286. }
  2287. /**
  2288. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2289. * that is not found in the character symbols.
  2290. *
  2291. * @private
  2292. * @param {Array} strSymbols The string symbols to inspect.
  2293. * @param {Array} chrSymbols The character symbols to find.
  2294. * @returns {number} Returns the index of the last unmatched string symbol.
  2295. */
  2296. function charsEndIndex(strSymbols, chrSymbols) {
  2297. var index = strSymbols.length;
  2298. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2299. return index;
  2300. }
  2301. /**
  2302. * Gets the number of `placeholder` occurrences in `array`.
  2303. *
  2304. * @private
  2305. * @param {Array} array The array to inspect.
  2306. * @param {*} placeholder The placeholder to search for.
  2307. * @returns {number} Returns the placeholder count.
  2308. */
  2309. function countHolders(array, placeholder) {
  2310. var length = array.length,
  2311. result = 0;
  2312. while (length--) {
  2313. if (array[length] === placeholder) {
  2314. ++result;
  2315. }
  2316. }
  2317. return result;
  2318. }
  2319. /**
  2320. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2321. * letters to basic Latin letters.
  2322. *
  2323. * @private
  2324. * @param {string} letter The matched letter to deburr.
  2325. * @returns {string} Returns the deburred letter.
  2326. */
  2327. var deburrLetter = basePropertyOf(deburredLetters);
  2328. /**
  2329. * Used by `_.escape` to convert characters to HTML entities.
  2330. *
  2331. * @private
  2332. * @param {string} chr The matched character to escape.
  2333. * @returns {string} Returns the escaped character.
  2334. */
  2335. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2336. /**
  2337. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2338. *
  2339. * @private
  2340. * @param {string} chr The matched character to escape.
  2341. * @returns {string} Returns the escaped character.
  2342. */
  2343. function escapeStringChar(chr) {
  2344. return '\\' + stringEscapes[chr];
  2345. }
  2346. /**
  2347. * Gets the value at `key` of `object`.
  2348. *
  2349. * @private
  2350. * @param {Object} [object] The object to query.
  2351. * @param {string} key The key of the property to get.
  2352. * @returns {*} Returns the property value.
  2353. */
  2354. function getValue(object, key) {
  2355. return object == null ? undefined : object[key];
  2356. }
  2357. /**
  2358. * Checks if `string` contains Unicode symbols.
  2359. *
  2360. * @private
  2361. * @param {string} string The string to inspect.
  2362. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2363. */
  2364. function hasUnicode(string) {
  2365. return reHasUnicode.test(string);
  2366. }
  2367. /**
  2368. * Checks if `string` contains a word composed of Unicode symbols.
  2369. *
  2370. * @private
  2371. * @param {string} string The string to inspect.
  2372. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2373. */
  2374. function hasUnicodeWord(string) {
  2375. return reHasUnicodeWord.test(string);
  2376. }
  2377. /**
  2378. * Converts `iterator` to an array.
  2379. *
  2380. * @private
  2381. * @param {Object} iterator The iterator to convert.
  2382. * @returns {Array} Returns the converted array.
  2383. */
  2384. function iteratorToArray(iterator) {
  2385. var data,
  2386. result = [];
  2387. while (!(data = iterator.next()).done) {
  2388. result.push(data.value);
  2389. }
  2390. return result;
  2391. }
  2392. /**
  2393. * Converts `map` to its key-value pairs.
  2394. *
  2395. * @private
  2396. * @param {Object} map The map to convert.
  2397. * @returns {Array} Returns the key-value pairs.
  2398. */
  2399. function mapToArray(map) {
  2400. var index = -1,
  2401. result = Array(map.size);
  2402. map.forEach(function(value, key) {
  2403. result[++index] = [key, value];
  2404. });
  2405. return result;
  2406. }
  2407. /**
  2408. * Creates a unary function that invokes `func` with its argument transformed.
  2409. *
  2410. * @private
  2411. * @param {Function} func The function to wrap.
  2412. * @param {Function} transform The argument transform.
  2413. * @returns {Function} Returns the new function.
  2414. */
  2415. function overArg(func, transform) {
  2416. return function(arg) {
  2417. return func(transform(arg));
  2418. };
  2419. }
  2420. /**
  2421. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2422. * and returns an array of their indexes.
  2423. *
  2424. * @private
  2425. * @param {Array} array The array to modify.
  2426. * @param {*} placeholder The placeholder to replace.
  2427. * @returns {Array} Returns the new array of placeholder indexes.
  2428. */
  2429. function replaceHolders(array, placeholder) {
  2430. var index = -1,
  2431. length = array.length,
  2432. resIndex = 0,
  2433. result = [];
  2434. while (++index < length) {
  2435. var value = array[index];
  2436. if (value === placeholder || value === PLACEHOLDER) {
  2437. array[index] = PLACEHOLDER;
  2438. result[resIndex++] = index;
  2439. }
  2440. }
  2441. return result;
  2442. }
  2443. /**
  2444. * Converts `set` to an array of its values.
  2445. *
  2446. * @private
  2447. * @param {Object} set The set to convert.
  2448. * @returns {Array} Returns the values.
  2449. */
  2450. function setToArray(set) {
  2451. var index = -1,
  2452. result = Array(set.size);
  2453. set.forEach(function(value) {
  2454. result[++index] = value;
  2455. });
  2456. return result;
  2457. }
  2458. /**
  2459. * Converts `set` to its value-value pairs.
  2460. *
  2461. * @private
  2462. * @param {Object} set The set to convert.
  2463. * @returns {Array} Returns the value-value pairs.
  2464. */
  2465. function setToPairs(set) {
  2466. var index = -1,
  2467. result = Array(set.size);
  2468. set.forEach(function(value) {
  2469. result[++index] = [value, value];
  2470. });
  2471. return result;
  2472. }
  2473. /**
  2474. * A specialized version of `_.indexOf` which performs strict equality
  2475. * comparisons of values, i.e. `===`.
  2476. *
  2477. * @private
  2478. * @param {Array} array The array to inspect.
  2479. * @param {*} value The value to search for.
  2480. * @param {number} fromIndex The index to search from.
  2481. * @returns {number} Returns the index of the matched value, else `-1`.
  2482. */
  2483. function strictIndexOf(array, value, fromIndex) {
  2484. var index = fromIndex - 1,
  2485. length = array.length;
  2486. while (++index < length) {
  2487. if (array[index] === value) {
  2488. return index;
  2489. }
  2490. }
  2491. return -1;
  2492. }
  2493. /**
  2494. * A specialized version of `_.lastIndexOf` which performs strict equality
  2495. * comparisons of values, i.e. `===`.
  2496. *
  2497. * @private
  2498. * @param {Array} array The array to inspect.
  2499. * @param {*} value The value to search for.
  2500. * @param {number} fromIndex The index to search from.
  2501. * @returns {number} Returns the index of the matched value, else `-1`.
  2502. */
  2503. function strictLastIndexOf(array, value, fromIndex) {
  2504. var index = fromIndex + 1;
  2505. while (index--) {
  2506. if (array[index] === value) {
  2507. return index;
  2508. }
  2509. }
  2510. return index;
  2511. }
  2512. /**
  2513. * Gets the number of symbols in `string`.
  2514. *
  2515. * @private
  2516. * @param {string} string The string to inspect.
  2517. * @returns {number} Returns the string size.
  2518. */
  2519. function stringSize(string) {
  2520. return hasUnicode(string)
  2521. ? unicodeSize(string)
  2522. : asciiSize(string);
  2523. }
  2524. /**
  2525. * Converts `string` to an array.
  2526. *
  2527. * @private
  2528. * @param {string} string The string to convert.
  2529. * @returns {Array} Returns the converted array.
  2530. */
  2531. function stringToArray(string) {
  2532. return hasUnicode(string)
  2533. ? unicodeToArray(string)
  2534. : asciiToArray(string);
  2535. }
  2536. /**
  2537. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2538. * character of `string`.
  2539. *
  2540. * @private
  2541. * @param {string} string The string to inspect.
  2542. * @returns {number} Returns the index of the last non-whitespace character.
  2543. */
  2544. function trimmedEndIndex(string) {
  2545. var index = string.length;
  2546. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2547. return index;
  2548. }
  2549. /**
  2550. * Used by `_.unescape` to convert HTML entities to characters.
  2551. *
  2552. * @private
  2553. * @param {string} chr The matched character to unescape.
  2554. * @returns {string} Returns the unescaped character.
  2555. */
  2556. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2557. /**
  2558. * Gets the size of a Unicode `string`.
  2559. *
  2560. * @private
  2561. * @param {string} string The string inspect.
  2562. * @returns {number} Returns the string size.
  2563. */
  2564. function unicodeSize(string) {
  2565. var result = reUnicode.lastIndex = 0;
  2566. while (reUnicode.test(string)) {
  2567. ++result;
  2568. }
  2569. return result;
  2570. }
  2571. /**
  2572. * Converts a Unicode `string` to an array.
  2573. *
  2574. * @private
  2575. * @param {string} string The string to convert.
  2576. * @returns {Array} Returns the converted array.
  2577. */
  2578. function unicodeToArray(string) {
  2579. return string.match(reUnicode) || [];
  2580. }
  2581. /**
  2582. * Splits a Unicode `string` into an array of its words.
  2583. *
  2584. * @private
  2585. * @param {string} The string to inspect.
  2586. * @returns {Array} Returns the words of `string`.
  2587. */
  2588. function unicodeWords(string) {
  2589. return string.match(reUnicodeWord) || [];
  2590. }
  2591. /*--------------------------------------------------------------------------*/
  2592. /**
  2593. * Create a new pristine `lodash` function using the `context` object.
  2594. *
  2595. * @static
  2596. * @memberOf _
  2597. * @since 1.1.0
  2598. * @category Util
  2599. * @param {Object} [context=root] The context object.
  2600. * @returns {Function} Returns a new `lodash` function.
  2601. * @example
  2602. *
  2603. * _.mixin({ 'foo': _.constant('foo') });
  2604. *
  2605. * var lodash = _.runInContext();
  2606. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2607. *
  2608. * _.isFunction(_.foo);
  2609. * // => true
  2610. * _.isFunction(_.bar);
  2611. * // => false
  2612. *
  2613. * lodash.isFunction(lodash.foo);
  2614. * // => false
  2615. * lodash.isFunction(lodash.bar);
  2616. * // => true
  2617. *
  2618. * // Create a suped-up `defer` in Node.js.
  2619. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2620. */
  2621. var runInContext = (function runInContext(context) {
  2622. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2623. /** Built-in constructor references. */
  2624. var Array = context.Array,
  2625. Date = context.Date,
  2626. Error = context.Error,
  2627. Function = context.Function,
  2628. Math = context.Math,
  2629. Object = context.Object,
  2630. RegExp = context.RegExp,
  2631. String = context.String,
  2632. TypeError = context.TypeError;
  2633. /** Used for built-in method references. */
  2634. var arrayProto = Array.prototype,
  2635. funcProto = Function.prototype,
  2636. objectProto = Object.prototype;
  2637. /** Used to detect overreaching core-js shims. */
  2638. var coreJsData = context['__core-js_shared__'];
  2639. /** Used to resolve the decompiled source of functions. */
  2640. var funcToString = funcProto.toString;
  2641. /** Used to check objects for own properties. */
  2642. var hasOwnProperty = objectProto.hasOwnProperty;
  2643. /** Used to generate unique IDs. */
  2644. var idCounter = 0;
  2645. /** Used to detect methods masquerading as native. */
  2646. var maskSrcKey = (function() {
  2647. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2648. return uid ? ('Symbol(src)_1.' + uid) : '';
  2649. }());
  2650. /**
  2651. * Used to resolve the
  2652. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2653. * of values.
  2654. */
  2655. var nativeObjectToString = objectProto.toString;
  2656. /** Used to infer the `Object` constructor. */
  2657. var objectCtorString = funcToString.call(Object);
  2658. /** Used to restore the original `_` reference in `_.noConflict`. */
  2659. var oldDash = root._;
  2660. /** Used to detect if a method is native. */
  2661. var reIsNative = RegExp('^' +
  2662. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2663. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2664. );
  2665. /** Built-in value references. */
  2666. var Buffer = moduleExports ? context.Buffer : undefined,
  2667. Symbol = context.Symbol,
  2668. Uint8Array = context.Uint8Array,
  2669. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2670. getPrototype = overArg(Object.getPrototypeOf, Object),
  2671. objectCreate = Object.create,
  2672. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2673. splice = arrayProto.splice,
  2674. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2675. symIterator = Symbol ? Symbol.iterator : undefined,
  2676. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2677. var defineProperty = (function() {
  2678. try {
  2679. var func = getNative(Object, 'defineProperty');
  2680. func({}, '', {});
  2681. return func;
  2682. } catch (e) {}
  2683. }());
  2684. /** Mocked built-ins. */
  2685. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2686. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2687. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2688. /* Built-in method references for those with the same name as other `lodash` methods. */
  2689. var nativeCeil = Math.ceil,
  2690. nativeFloor = Math.floor,
  2691. nativeGetSymbols = Object.getOwnPropertySymbols,
  2692. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2693. nativeIsFinite = context.isFinite,
  2694. nativeJoin = arrayProto.join,
  2695. nativeKeys = overArg(Object.keys, Object),
  2696. nativeMax = Math.max,
  2697. nativeMin = Math.min,
  2698. nativeNow = Date.now,
  2699. nativeParseInt = context.parseInt,
  2700. nativeRandom = Math.random,
  2701. nativeReverse = arrayProto.reverse;
  2702. /* Built-in method references that are verified to be native. */
  2703. var DataView = getNative(context, 'DataView'),
  2704. Map = getNative(context, 'Map'),
  2705. Promise = getNative(context, 'Promise'),
  2706. Set = getNative(context, 'Set'),
  2707. WeakMap = getNative(context, 'WeakMap'),
  2708. nativeCreate = getNative(Object, 'create');
  2709. /** Used to store function metadata. */
  2710. var metaMap = WeakMap && new WeakMap;
  2711. /** Used to lookup unminified function names. */
  2712. var realNames = {};
  2713. /** Used to detect maps, sets, and weakmaps. */
  2714. var dataViewCtorString = toSource(DataView),
  2715. mapCtorString = toSource(Map),
  2716. promiseCtorString = toSource(Promise),
  2717. setCtorString = toSource(Set),
  2718. weakMapCtorString = toSource(WeakMap);
  2719. /** Used to convert symbols to primitives and strings. */
  2720. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2721. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2722. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2723. /*------------------------------------------------------------------------*/
  2724. /**
  2725. * Creates a `lodash` object which wraps `value` to enable implicit method
  2726. * chain sequences. Methods that operate on and return arrays, collections,
  2727. * and functions can be chained together. Methods that retrieve a single value
  2728. * or may return a primitive value will automatically end the chain sequence
  2729. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2730. * with `_#value`.
  2731. *
  2732. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2733. * enabled using `_.chain`.
  2734. *
  2735. * The execution of chained methods is lazy, that is, it's deferred until
  2736. * `_#value` is implicitly or explicitly called.
  2737. *
  2738. * Lazy evaluation allows several methods to support shortcut fusion.
  2739. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2740. * the creation of intermediate arrays and can greatly reduce the number of
  2741. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2742. * fusion if the section is applied to an array and iteratees accept only
  2743. * one argument. The heuristic for whether a section qualifies for shortcut
  2744. * fusion is subject to change.
  2745. *
  2746. * Chaining is supported in custom builds as long as the `_#value` method is
  2747. * directly or indirectly included in the build.
  2748. *
  2749. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2750. *
  2751. * The wrapper `Array` methods are:
  2752. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2753. *
  2754. * The wrapper `String` methods are:
  2755. * `replace` and `split`
  2756. *
  2757. * The wrapper methods that support shortcut fusion are:
  2758. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2759. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2760. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2761. *
  2762. * The chainable wrapper methods are:
  2763. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2764. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2765. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2766. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2767. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2768. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2769. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2770. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2771. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2772. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2773. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2774. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2775. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2776. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2777. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2778. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2779. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2780. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2781. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2782. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2783. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2784. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2785. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2786. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2787. *
  2788. * The wrapper methods that are **not** chainable by default are:
  2789. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2790. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2791. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2792. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2793. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2794. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2795. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2796. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2797. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2798. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2799. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2800. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2801. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2802. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2803. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2804. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2805. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2806. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2807. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2808. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2809. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2810. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2811. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2812. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2813. * `upperFirst`, `value`, and `words`
  2814. *
  2815. * @name _
  2816. * @constructor
  2817. * @category Seq
  2818. * @param {*} value The value to wrap in a `lodash` instance.
  2819. * @returns {Object} Returns the new `lodash` wrapper instance.
  2820. * @example
  2821. *
  2822. * function square(n) {
  2823. * return n * n;
  2824. * }
  2825. *
  2826. * var wrapped = _([1, 2, 3]);
  2827. *
  2828. * // Returns an unwrapped value.
  2829. * wrapped.reduce(_.add);
  2830. * // => 6
  2831. *
  2832. * // Returns a wrapped value.
  2833. * var squares = wrapped.map(square);
  2834. *
  2835. * _.isArray(squares);
  2836. * // => false
  2837. *
  2838. * _.isArray(squares.value());
  2839. * // => true
  2840. */
  2841. function lodash(value) {
  2842. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2843. if (value instanceof LodashWrapper) {
  2844. return value;
  2845. }
  2846. if (hasOwnProperty.call(value, '__wrapped__')) {
  2847. return wrapperClone(value);
  2848. }
  2849. }
  2850. return new LodashWrapper(value);
  2851. }
  2852. /**
  2853. * The base implementation of `_.create` without support for assigning
  2854. * properties to the created object.
  2855. *
  2856. * @private
  2857. * @param {Object} proto The object to inherit from.
  2858. * @returns {Object} Returns the new object.
  2859. */
  2860. var baseCreate = (function() {
  2861. function object() {}
  2862. return function(proto) {
  2863. if (!isObject(proto)) {
  2864. return {};
  2865. }
  2866. if (objectCreate) {
  2867. return objectCreate(proto);
  2868. }
  2869. object.prototype = proto;
  2870. var result = new object;
  2871. object.prototype = undefined;
  2872. return result;
  2873. };
  2874. }());
  2875. /**
  2876. * The function whose prototype chain sequence wrappers inherit from.
  2877. *
  2878. * @private
  2879. */
  2880. function baseLodash() {
  2881. // No operation performed.
  2882. }
  2883. /**
  2884. * The base constructor for creating `lodash` wrapper objects.
  2885. *
  2886. * @private
  2887. * @param {*} value The value to wrap.
  2888. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2889. */
  2890. function LodashWrapper(value, chainAll) {
  2891. this.__wrapped__ = value;
  2892. this.__actions__ = [];
  2893. this.__chain__ = !!chainAll;
  2894. this.__index__ = 0;
  2895. this.__values__ = undefined;
  2896. }
  2897. /**
  2898. * By default, the template delimiters used by lodash are like those in
  2899. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2900. * following template settings to use alternative delimiters.
  2901. *
  2902. * @static
  2903. * @memberOf _
  2904. * @type {Object}
  2905. */
  2906. lodash.templateSettings = {
  2907. /**
  2908. * Used to detect `data` property values to be HTML-escaped.
  2909. *
  2910. * @memberOf _.templateSettings
  2911. * @type {RegExp}
  2912. */
  2913. 'escape': reEscape,
  2914. /**
  2915. * Used to detect code to be evaluated.
  2916. *
  2917. * @memberOf _.templateSettings
  2918. * @type {RegExp}
  2919. */
  2920. 'evaluate': reEvaluate,
  2921. /**
  2922. * Used to detect `data` property values to inject.
  2923. *
  2924. * @memberOf _.templateSettings
  2925. * @type {RegExp}
  2926. */
  2927. 'interpolate': reInterpolate,
  2928. /**
  2929. * Used to reference the data object in the template text.
  2930. *
  2931. * @memberOf _.templateSettings
  2932. * @type {string}
  2933. */
  2934. 'variable': '',
  2935. /**
  2936. * Used to import variables into the compiled template.
  2937. *
  2938. * @memberOf _.templateSettings
  2939. * @type {Object}
  2940. */
  2941. 'imports': {
  2942. /**
  2943. * A reference to the `lodash` function.
  2944. *
  2945. * @memberOf _.templateSettings.imports
  2946. * @type {Function}
  2947. */
  2948. '_': lodash
  2949. }
  2950. };
  2951. // Ensure wrappers are instances of `baseLodash`.
  2952. lodash.prototype = baseLodash.prototype;
  2953. lodash.prototype.constructor = lodash;
  2954. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2955. LodashWrapper.prototype.constructor = LodashWrapper;
  2956. /*------------------------------------------------------------------------*/
  2957. /**
  2958. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2959. *
  2960. * @private
  2961. * @constructor
  2962. * @param {*} value The value to wrap.
  2963. */
  2964. function LazyWrapper(value) {
  2965. this.__wrapped__ = value;
  2966. this.__actions__ = [];
  2967. this.__dir__ = 1;
  2968. this.__filtered__ = false;
  2969. this.__iteratees__ = [];
  2970. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2971. this.__views__ = [];
  2972. }
  2973. /**
  2974. * Creates a clone of the lazy wrapper object.
  2975. *
  2976. * @private
  2977. * @name clone
  2978. * @memberOf LazyWrapper
  2979. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2980. */
  2981. function lazyClone() {
  2982. var result = new LazyWrapper(this.__wrapped__);
  2983. result.__actions__ = copyArray(this.__actions__);
  2984. result.__dir__ = this.__dir__;
  2985. result.__filtered__ = this.__filtered__;
  2986. result.__iteratees__ = copyArray(this.__iteratees__);
  2987. result.__takeCount__ = this.__takeCount__;
  2988. result.__views__ = copyArray(this.__views__);
  2989. return result;
  2990. }
  2991. /**
  2992. * Reverses the direction of lazy iteration.
  2993. *
  2994. * @private
  2995. * @name reverse
  2996. * @memberOf LazyWrapper
  2997. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2998. */
  2999. function lazyReverse() {
  3000. if (this.__filtered__) {
  3001. var result = new LazyWrapper(this);
  3002. result.__dir__ = -1;
  3003. result.__filtered__ = true;
  3004. } else {
  3005. result = this.clone();
  3006. result.__dir__ *= -1;
  3007. }
  3008. return result;
  3009. }
  3010. /**
  3011. * Extracts the unwrapped value from its lazy wrapper.
  3012. *
  3013. * @private
  3014. * @name value
  3015. * @memberOf LazyWrapper
  3016. * @returns {*} Returns the unwrapped value.
  3017. */
  3018. function lazyValue() {
  3019. var array = this.__wrapped__.value(),
  3020. dir = this.__dir__,
  3021. isArr = isArray(array),
  3022. isRight = dir < 0,
  3023. arrLength = isArr ? array.length : 0,
  3024. view = getView(0, arrLength, this.__views__),
  3025. start = view.start,
  3026. end = view.end,
  3027. length = end - start,
  3028. index = isRight ? end : (start - 1),
  3029. iteratees = this.__iteratees__,
  3030. iterLength = iteratees.length,
  3031. resIndex = 0,
  3032. takeCount = nativeMin(length, this.__takeCount__);
  3033. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  3034. return baseWrapperValue(array, this.__actions__);
  3035. }
  3036. var result = [];
  3037. outer:
  3038. while (length-- && resIndex < takeCount) {
  3039. index += dir;
  3040. var iterIndex = -1,
  3041. value = array[index];
  3042. while (++iterIndex < iterLength) {
  3043. var data = iteratees[iterIndex],
  3044. iteratee = data.iteratee,
  3045. type = data.type,
  3046. computed = iteratee(value);
  3047. if (type == LAZY_MAP_FLAG) {
  3048. value = computed;
  3049. } else if (!computed) {
  3050. if (type == LAZY_FILTER_FLAG) {
  3051. continue outer;
  3052. } else {
  3053. break outer;
  3054. }
  3055. }
  3056. }
  3057. result[resIndex++] = value;
  3058. }
  3059. return result;
  3060. }
  3061. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  3062. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  3063. LazyWrapper.prototype.constructor = LazyWrapper;
  3064. /*------------------------------------------------------------------------*/
  3065. /**
  3066. * Creates a hash object.
  3067. *
  3068. * @private
  3069. * @constructor
  3070. * @param {Array} [entries] The key-value pairs to cache.
  3071. */
  3072. function Hash(entries) {
  3073. var index = -1,
  3074. length = entries == null ? 0 : entries.length;
  3075. this.clear();
  3076. while (++index < length) {
  3077. var entry = entries[index];
  3078. this.set(entry[0], entry[1]);
  3079. }
  3080. }
  3081. /**
  3082. * Removes all key-value entries from the hash.
  3083. *
  3084. * @private
  3085. * @name clear
  3086. * @memberOf Hash
  3087. */
  3088. function hashClear() {
  3089. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3090. this.size = 0;
  3091. }
  3092. /**
  3093. * Removes `key` and its value from the hash.
  3094. *
  3095. * @private
  3096. * @name delete
  3097. * @memberOf Hash
  3098. * @param {Object} hash The hash to modify.
  3099. * @param {string} key The key of the value to remove.
  3100. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3101. */
  3102. function hashDelete(key) {
  3103. var result = this.has(key) && delete this.__data__[key];
  3104. this.size -= result ? 1 : 0;
  3105. return result;
  3106. }
  3107. /**
  3108. * Gets the hash value for `key`.
  3109. *
  3110. * @private
  3111. * @name get
  3112. * @memberOf Hash
  3113. * @param {string} key The key of the value to get.
  3114. * @returns {*} Returns the entry value.
  3115. */
  3116. function hashGet(key) {
  3117. var data = this.__data__;
  3118. if (nativeCreate) {
  3119. var result = data[key];
  3120. return result === HASH_UNDEFINED ? undefined : result;
  3121. }
  3122. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3123. }
  3124. /**
  3125. * Checks if a hash value for `key` exists.
  3126. *
  3127. * @private
  3128. * @name has
  3129. * @memberOf Hash
  3130. * @param {string} key The key of the entry to check.
  3131. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3132. */
  3133. function hashHas(key) {
  3134. var data = this.__data__;
  3135. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3136. }
  3137. /**
  3138. * Sets the hash `key` to `value`.
  3139. *
  3140. * @private
  3141. * @name set
  3142. * @memberOf Hash
  3143. * @param {string} key The key of the value to set.
  3144. * @param {*} value The value to set.
  3145. * @returns {Object} Returns the hash instance.
  3146. */
  3147. function hashSet(key, value) {
  3148. var data = this.__data__;
  3149. this.size += this.has(key) ? 0 : 1;
  3150. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3151. return this;
  3152. }
  3153. // Add methods to `Hash`.
  3154. Hash.prototype.clear = hashClear;
  3155. Hash.prototype['delete'] = hashDelete;
  3156. Hash.prototype.get = hashGet;
  3157. Hash.prototype.has = hashHas;
  3158. Hash.prototype.set = hashSet;
  3159. /*------------------------------------------------------------------------*/
  3160. /**
  3161. * Creates an list cache object.
  3162. *
  3163. * @private
  3164. * @constructor
  3165. * @param {Array} [entries] The key-value pairs to cache.
  3166. */
  3167. function ListCache(entries) {
  3168. var index = -1,
  3169. length = entries == null ? 0 : entries.length;
  3170. this.clear();
  3171. while (++index < length) {
  3172. var entry = entries[index];
  3173. this.set(entry[0], entry[1]);
  3174. }
  3175. }
  3176. /**
  3177. * Removes all key-value entries from the list cache.
  3178. *
  3179. * @private
  3180. * @name clear
  3181. * @memberOf ListCache
  3182. */
  3183. function listCacheClear() {
  3184. this.__data__ = [];
  3185. this.size = 0;
  3186. }
  3187. /**
  3188. * Removes `key` and its value from the list cache.
  3189. *
  3190. * @private
  3191. * @name delete
  3192. * @memberOf ListCache
  3193. * @param {string} key The key of the value to remove.
  3194. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3195. */
  3196. function listCacheDelete(key) {
  3197. var data = this.__data__,
  3198. index = assocIndexOf(data, key);
  3199. if (index < 0) {
  3200. return false;
  3201. }
  3202. var lastIndex = data.length - 1;
  3203. if (index == lastIndex) {
  3204. data.pop();
  3205. } else {
  3206. splice.call(data, index, 1);
  3207. }
  3208. --this.size;
  3209. return true;
  3210. }
  3211. /**
  3212. * Gets the list cache value for `key`.
  3213. *
  3214. * @private
  3215. * @name get
  3216. * @memberOf ListCache
  3217. * @param {string} key The key of the value to get.
  3218. * @returns {*} Returns the entry value.
  3219. */
  3220. function listCacheGet(key) {
  3221. var data = this.__data__,
  3222. index = assocIndexOf(data, key);
  3223. return index < 0 ? undefined : data[index][1];
  3224. }
  3225. /**
  3226. * Checks if a list cache value for `key` exists.
  3227. *
  3228. * @private
  3229. * @name has
  3230. * @memberOf ListCache
  3231. * @param {string} key The key of the entry to check.
  3232. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3233. */
  3234. function listCacheHas(key) {
  3235. return assocIndexOf(this.__data__, key) > -1;
  3236. }
  3237. /**
  3238. * Sets the list cache `key` to `value`.
  3239. *
  3240. * @private
  3241. * @name set
  3242. * @memberOf ListCache
  3243. * @param {string} key The key of the value to set.
  3244. * @param {*} value The value to set.
  3245. * @returns {Object} Returns the list cache instance.
  3246. */
  3247. function listCacheSet(key, value) {
  3248. var data = this.__data__,
  3249. index = assocIndexOf(data, key);
  3250. if (index < 0) {
  3251. ++this.size;
  3252. data.push([key, value]);
  3253. } else {
  3254. data[index][1] = value;
  3255. }
  3256. return this;
  3257. }
  3258. // Add methods to `ListCache`.
  3259. ListCache.prototype.clear = listCacheClear;
  3260. ListCache.prototype['delete'] = listCacheDelete;
  3261. ListCache.prototype.get = listCacheGet;
  3262. ListCache.prototype.has = listCacheHas;
  3263. ListCache.prototype.set = listCacheSet;
  3264. /*------------------------------------------------------------------------*/
  3265. /**
  3266. * Creates a map cache object to store key-value pairs.
  3267. *
  3268. * @private
  3269. * @constructor
  3270. * @param {Array} [entries] The key-value pairs to cache.
  3271. */
  3272. function MapCache(entries) {
  3273. var index = -1,
  3274. length = entries == null ? 0 : entries.length;
  3275. this.clear();
  3276. while (++index < length) {
  3277. var entry = entries[index];
  3278. this.set(entry[0], entry[1]);
  3279. }
  3280. }
  3281. /**
  3282. * Removes all key-value entries from the map.
  3283. *
  3284. * @private
  3285. * @name clear
  3286. * @memberOf MapCache
  3287. */
  3288. function mapCacheClear() {
  3289. this.size = 0;
  3290. this.__data__ = {
  3291. 'hash': new Hash,
  3292. 'map': new (Map || ListCache),
  3293. 'string': new Hash
  3294. };
  3295. }
  3296. /**
  3297. * Removes `key` and its value from the map.
  3298. *
  3299. * @private
  3300. * @name delete
  3301. * @memberOf MapCache
  3302. * @param {string} key The key of the value to remove.
  3303. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3304. */
  3305. function mapCacheDelete(key) {
  3306. var result = getMapData(this, key)['delete'](key);
  3307. this.size -= result ? 1 : 0;
  3308. return result;
  3309. }
  3310. /**
  3311. * Gets the map value for `key`.
  3312. *
  3313. * @private
  3314. * @name get
  3315. * @memberOf MapCache
  3316. * @param {string} key The key of the value to get.
  3317. * @returns {*} Returns the entry value.
  3318. */
  3319. function mapCacheGet(key) {
  3320. return getMapData(this, key).get(key);
  3321. }
  3322. /**
  3323. * Checks if a map value for `key` exists.
  3324. *
  3325. * @private
  3326. * @name has
  3327. * @memberOf MapCache
  3328. * @param {string} key The key of the entry to check.
  3329. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3330. */
  3331. function mapCacheHas(key) {
  3332. return getMapData(this, key).has(key);
  3333. }
  3334. /**
  3335. * Sets the map `key` to `value`.
  3336. *
  3337. * @private
  3338. * @name set
  3339. * @memberOf MapCache
  3340. * @param {string} key The key of the value to set.
  3341. * @param {*} value The value to set.
  3342. * @returns {Object} Returns the map cache instance.
  3343. */
  3344. function mapCacheSet(key, value) {
  3345. var data = getMapData(this, key),
  3346. size = data.size;
  3347. data.set(key, value);
  3348. this.size += data.size == size ? 0 : 1;
  3349. return this;
  3350. }
  3351. // Add methods to `MapCache`.
  3352. MapCache.prototype.clear = mapCacheClear;
  3353. MapCache.prototype['delete'] = mapCacheDelete;
  3354. MapCache.prototype.get = mapCacheGet;
  3355. MapCache.prototype.has = mapCacheHas;
  3356. MapCache.prototype.set = mapCacheSet;
  3357. /*------------------------------------------------------------------------*/
  3358. /**
  3359. *
  3360. * Creates an array cache object to store unique values.
  3361. *
  3362. * @private
  3363. * @constructor
  3364. * @param {Array} [values] The values to cache.
  3365. */
  3366. function SetCache(values) {
  3367. var index = -1,
  3368. length = values == null ? 0 : values.length;
  3369. this.__data__ = new MapCache;
  3370. while (++index < length) {
  3371. this.add(values[index]);
  3372. }
  3373. }
  3374. /**
  3375. * Adds `value` to the array cache.
  3376. *
  3377. * @private
  3378. * @name add
  3379. * @memberOf SetCache
  3380. * @alias push
  3381. * @param {*} value The value to cache.
  3382. * @returns {Object} Returns the cache instance.
  3383. */
  3384. function setCacheAdd(value) {
  3385. this.__data__.set(value, HASH_UNDEFINED);
  3386. return this;
  3387. }
  3388. /**
  3389. * Checks if `value` is in the array cache.
  3390. *
  3391. * @private
  3392. * @name has
  3393. * @memberOf SetCache
  3394. * @param {*} value The value to search for.
  3395. * @returns {number} Returns `true` if `value` is found, else `false`.
  3396. */
  3397. function setCacheHas(value) {
  3398. return this.__data__.has(value);
  3399. }
  3400. // Add methods to `SetCache`.
  3401. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3402. SetCache.prototype.has = setCacheHas;
  3403. /*------------------------------------------------------------------------*/
  3404. /**
  3405. * Creates a stack cache object to store key-value pairs.
  3406. *
  3407. * @private
  3408. * @constructor
  3409. * @param {Array} [entries] The key-value pairs to cache.
  3410. */
  3411. function Stack(entries) {
  3412. var data = this.__data__ = new ListCache(entries);
  3413. this.size = data.size;
  3414. }
  3415. /**
  3416. * Removes all key-value entries from the stack.
  3417. *
  3418. * @private
  3419. * @name clear
  3420. * @memberOf Stack
  3421. */
  3422. function stackClear() {
  3423. this.__data__ = new ListCache;
  3424. this.size = 0;
  3425. }
  3426. /**
  3427. * Removes `key` and its value from the stack.
  3428. *
  3429. * @private
  3430. * @name delete
  3431. * @memberOf Stack
  3432. * @param {string} key The key of the value to remove.
  3433. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3434. */
  3435. function stackDelete(key) {
  3436. var data = this.__data__,
  3437. result = data['delete'](key);
  3438. this.size = data.size;
  3439. return result;
  3440. }
  3441. /**
  3442. * Gets the stack value for `key`.
  3443. *
  3444. * @private
  3445. * @name get
  3446. * @memberOf Stack
  3447. * @param {string} key The key of the value to get.
  3448. * @returns {*} Returns the entry value.
  3449. */
  3450. function stackGet(key) {
  3451. return this.__data__.get(key);
  3452. }
  3453. /**
  3454. * Checks if a stack value for `key` exists.
  3455. *
  3456. * @private
  3457. * @name has
  3458. * @memberOf Stack
  3459. * @param {string} key The key of the entry to check.
  3460. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3461. */
  3462. function stackHas(key) {
  3463. return this.__data__.has(key);
  3464. }
  3465. /**
  3466. * Sets the stack `key` to `value`.
  3467. *
  3468. * @private
  3469. * @name set
  3470. * @memberOf Stack
  3471. * @param {string} key The key of the value to set.
  3472. * @param {*} value The value to set.
  3473. * @returns {Object} Returns the stack cache instance.
  3474. */
  3475. function stackSet(key, value) {
  3476. var data = this.__data__;
  3477. if (data instanceof ListCache) {
  3478. var pairs = data.__data__;
  3479. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3480. pairs.push([key, value]);
  3481. this.size = ++data.size;
  3482. return this;
  3483. }
  3484. data = this.__data__ = new MapCache(pairs);
  3485. }
  3486. data.set(key, value);
  3487. this.size = data.size;
  3488. return this;
  3489. }
  3490. // Add methods to `Stack`.
  3491. Stack.prototype.clear = stackClear;
  3492. Stack.prototype['delete'] = stackDelete;
  3493. Stack.prototype.get = stackGet;
  3494. Stack.prototype.has = stackHas;
  3495. Stack.prototype.set = stackSet;
  3496. /*------------------------------------------------------------------------*/
  3497. /**
  3498. * Creates an array of the enumerable property names of the array-like `value`.
  3499. *
  3500. * @private
  3501. * @param {*} value The value to query.
  3502. * @param {boolean} inherited Specify returning inherited property names.
  3503. * @returns {Array} Returns the array of property names.
  3504. */
  3505. function arrayLikeKeys(value, inherited) {
  3506. var isArr = isArray(value),
  3507. isArg = !isArr && isArguments(value),
  3508. isBuff = !isArr && !isArg && isBuffer(value),
  3509. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3510. skipIndexes = isArr || isArg || isBuff || isType,
  3511. result = skipIndexes ? baseTimes(value.length, String) : [],
  3512. length = result.length;
  3513. for (var key in value) {
  3514. if ((inherited || hasOwnProperty.call(value, key)) &&
  3515. !(skipIndexes && (
  3516. // Safari 9 has enumerable `arguments.length` in strict mode.
  3517. key == 'length' ||
  3518. // Node.js 0.10 has enumerable non-index properties on buffers.
  3519. (isBuff && (key == 'offset' || key == 'parent')) ||
  3520. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3521. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3522. // Skip index properties.
  3523. isIndex(key, length)
  3524. ))) {
  3525. result.push(key);
  3526. }
  3527. }
  3528. return result;
  3529. }
  3530. /**
  3531. * A specialized version of `_.sample` for arrays.
  3532. *
  3533. * @private
  3534. * @param {Array} array The array to sample.
  3535. * @returns {*} Returns the random element.
  3536. */
  3537. function arraySample(array) {
  3538. var length = array.length;
  3539. return length ? array[baseRandom(0, length - 1)] : undefined;
  3540. }
  3541. /**
  3542. * A specialized version of `_.sampleSize` for arrays.
  3543. *
  3544. * @private
  3545. * @param {Array} array The array to sample.
  3546. * @param {number} n The number of elements to sample.
  3547. * @returns {Array} Returns the random elements.
  3548. */
  3549. function arraySampleSize(array, n) {
  3550. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3551. }
  3552. /**
  3553. * A specialized version of `_.shuffle` for arrays.
  3554. *
  3555. * @private
  3556. * @param {Array} array The array to shuffle.
  3557. * @returns {Array} Returns the new shuffled array.
  3558. */
  3559. function arrayShuffle(array) {
  3560. return shuffleSelf(copyArray(array));
  3561. }
  3562. /**
  3563. * This function is like `assignValue` except that it doesn't assign
  3564. * `undefined` values.
  3565. *
  3566. * @private
  3567. * @param {Object} object The object to modify.
  3568. * @param {string} key The key of the property to assign.
  3569. * @param {*} value The value to assign.
  3570. */
  3571. function assignMergeValue(object, key, value) {
  3572. if ((value !== undefined && !eq(object[key], value)) ||
  3573. (value === undefined && !(key in object))) {
  3574. baseAssignValue(object, key, value);
  3575. }
  3576. }
  3577. /**
  3578. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3579. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3580. * for equality comparisons.
  3581. *
  3582. * @private
  3583. * @param {Object} object The object to modify.
  3584. * @param {string} key The key of the property to assign.
  3585. * @param {*} value The value to assign.
  3586. */
  3587. function assignValue(object, key, value) {
  3588. var objValue = object[key];
  3589. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3590. (value === undefined && !(key in object))) {
  3591. baseAssignValue(object, key, value);
  3592. }
  3593. }
  3594. /**
  3595. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3596. *
  3597. * @private
  3598. * @param {Array} array The array to inspect.
  3599. * @param {*} key The key to search for.
  3600. * @returns {number} Returns the index of the matched value, else `-1`.
  3601. */
  3602. function assocIndexOf(array, key) {
  3603. var length = array.length;
  3604. while (length--) {
  3605. if (eq(array[length][0], key)) {
  3606. return length;
  3607. }
  3608. }
  3609. return -1;
  3610. }
  3611. /**
  3612. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3613. * by `iteratee` and values set by `setter`.
  3614. *
  3615. * @private
  3616. * @param {Array|Object} collection The collection to iterate over.
  3617. * @param {Function} setter The function to set `accumulator` values.
  3618. * @param {Function} iteratee The iteratee to transform keys.
  3619. * @param {Object} accumulator The initial aggregated object.
  3620. * @returns {Function} Returns `accumulator`.
  3621. */
  3622. function baseAggregator(collection, setter, iteratee, accumulator) {
  3623. baseEach(collection, function(value, key, collection) {
  3624. setter(accumulator, value, iteratee(value), collection);
  3625. });
  3626. return accumulator;
  3627. }
  3628. /**
  3629. * The base implementation of `_.assign` without support for multiple sources
  3630. * or `customizer` functions.
  3631. *
  3632. * @private
  3633. * @param {Object} object The destination object.
  3634. * @param {Object} source The source object.
  3635. * @returns {Object} Returns `object`.
  3636. */
  3637. function baseAssign(object, source) {
  3638. return object && copyObject(source, keys(source), object);
  3639. }
  3640. /**
  3641. * The base implementation of `_.assignIn` without support for multiple sources
  3642. * or `customizer` functions.
  3643. *
  3644. * @private
  3645. * @param {Object} object The destination object.
  3646. * @param {Object} source The source object.
  3647. * @returns {Object} Returns `object`.
  3648. */
  3649. function baseAssignIn(object, source) {
  3650. return object && copyObject(source, keysIn(source), object);
  3651. }
  3652. /**
  3653. * The base implementation of `assignValue` and `assignMergeValue` without
  3654. * value checks.
  3655. *
  3656. * @private
  3657. * @param {Object} object The object to modify.
  3658. * @param {string} key The key of the property to assign.
  3659. * @param {*} value The value to assign.
  3660. */
  3661. function baseAssignValue(object, key, value) {
  3662. if (key == '__proto__' && defineProperty) {
  3663. defineProperty(object, key, {
  3664. 'configurable': true,
  3665. 'enumerable': true,
  3666. 'value': value,
  3667. 'writable': true
  3668. });
  3669. } else {
  3670. object[key] = value;
  3671. }
  3672. }
  3673. /**
  3674. * The base implementation of `_.at` without support for individual paths.
  3675. *
  3676. * @private
  3677. * @param {Object} object The object to iterate over.
  3678. * @param {string[]} paths The property paths to pick.
  3679. * @returns {Array} Returns the picked elements.
  3680. */
  3681. function baseAt(object, paths) {
  3682. var index = -1,
  3683. length = paths.length,
  3684. result = Array(length),
  3685. skip = object == null;
  3686. while (++index < length) {
  3687. result[index] = skip ? undefined : get(object, paths[index]);
  3688. }
  3689. return result;
  3690. }
  3691. /**
  3692. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3693. *
  3694. * @private
  3695. * @param {number} number The number to clamp.
  3696. * @param {number} [lower] The lower bound.
  3697. * @param {number} upper The upper bound.
  3698. * @returns {number} Returns the clamped number.
  3699. */
  3700. function baseClamp(number, lower, upper) {
  3701. if (number === number) {
  3702. if (upper !== undefined) {
  3703. number = number <= upper ? number : upper;
  3704. }
  3705. if (lower !== undefined) {
  3706. number = number >= lower ? number : lower;
  3707. }
  3708. }
  3709. return number;
  3710. }
  3711. /**
  3712. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3713. * traversed objects.
  3714. *
  3715. * @private
  3716. * @param {*} value The value to clone.
  3717. * @param {boolean} bitmask The bitmask flags.
  3718. * 1 - Deep clone
  3719. * 2 - Flatten inherited properties
  3720. * 4 - Clone symbols
  3721. * @param {Function} [customizer] The function to customize cloning.
  3722. * @param {string} [key] The key of `value`.
  3723. * @param {Object} [object] The parent object of `value`.
  3724. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3725. * @returns {*} Returns the cloned value.
  3726. */
  3727. function baseClone(value, bitmask, customizer, key, object, stack) {
  3728. var result,
  3729. isDeep = bitmask & CLONE_DEEP_FLAG,
  3730. isFlat = bitmask & CLONE_FLAT_FLAG,
  3731. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3732. if (customizer) {
  3733. result = object ? customizer(value, key, object, stack) : customizer(value);
  3734. }
  3735. if (result !== undefined) {
  3736. return result;
  3737. }
  3738. if (!isObject(value)) {
  3739. return value;
  3740. }
  3741. var isArr = isArray(value);
  3742. if (isArr) {
  3743. result = initCloneArray(value);
  3744. if (!isDeep) {
  3745. return copyArray(value, result);
  3746. }
  3747. } else {
  3748. var tag = getTag(value),
  3749. isFunc = tag == funcTag || tag == genTag;
  3750. if (isBuffer(value)) {
  3751. return cloneBuffer(value, isDeep);
  3752. }
  3753. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3754. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3755. if (!isDeep) {
  3756. return isFlat
  3757. ? copySymbolsIn(value, baseAssignIn(result, value))
  3758. : copySymbols(value, baseAssign(result, value));
  3759. }
  3760. } else {
  3761. if (!cloneableTags[tag]) {
  3762. return object ? value : {};
  3763. }
  3764. result = initCloneByTag(value, tag, isDeep);
  3765. }
  3766. }
  3767. // Check for circular references and return its corresponding clone.
  3768. stack || (stack = new Stack);
  3769. var stacked = stack.get(value);
  3770. if (stacked) {
  3771. return stacked;
  3772. }
  3773. stack.set(value, result);
  3774. if (isSet(value)) {
  3775. value.forEach(function(subValue) {
  3776. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3777. });
  3778. } else if (isMap(value)) {
  3779. value.forEach(function(subValue, key) {
  3780. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3781. });
  3782. }
  3783. var keysFunc = isFull
  3784. ? (isFlat ? getAllKeysIn : getAllKeys)
  3785. : (isFlat ? keysIn : keys);
  3786. var props = isArr ? undefined : keysFunc(value);
  3787. arrayEach(props || value, function(subValue, key) {
  3788. if (props) {
  3789. key = subValue;
  3790. subValue = value[key];
  3791. }
  3792. // Recursively populate clone (susceptible to call stack limits).
  3793. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3794. });
  3795. return result;
  3796. }
  3797. /**
  3798. * The base implementation of `_.conforms` which doesn't clone `source`.
  3799. *
  3800. * @private
  3801. * @param {Object} source The object of property predicates to conform to.
  3802. * @returns {Function} Returns the new spec function.
  3803. */
  3804. function baseConforms(source) {
  3805. var props = keys(source);
  3806. return function(object) {
  3807. return baseConformsTo(object, source, props);
  3808. };
  3809. }
  3810. /**
  3811. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3812. *
  3813. * @private
  3814. * @param {Object} object The object to inspect.
  3815. * @param {Object} source The object of property predicates to conform to.
  3816. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3817. */
  3818. function baseConformsTo(object, source, props) {
  3819. var length = props.length;
  3820. if (object == null) {
  3821. return !length;
  3822. }
  3823. object = Object(object);
  3824. while (length--) {
  3825. var key = props[length],
  3826. predicate = source[key],
  3827. value = object[key];
  3828. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3829. return false;
  3830. }
  3831. }
  3832. return true;
  3833. }
  3834. /**
  3835. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3836. * to provide to `func`.
  3837. *
  3838. * @private
  3839. * @param {Function} func The function to delay.
  3840. * @param {number} wait The number of milliseconds to delay invocation.
  3841. * @param {Array} args The arguments to provide to `func`.
  3842. * @returns {number|Object} Returns the timer id or timeout object.
  3843. */
  3844. function baseDelay(func, wait, args) {
  3845. if (typeof func != 'function') {
  3846. throw new TypeError(FUNC_ERROR_TEXT);
  3847. }
  3848. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3849. }
  3850. /**
  3851. * The base implementation of methods like `_.difference` without support
  3852. * for excluding multiple arrays or iteratee shorthands.
  3853. *
  3854. * @private
  3855. * @param {Array} array The array to inspect.
  3856. * @param {Array} values The values to exclude.
  3857. * @param {Function} [iteratee] The iteratee invoked per element.
  3858. * @param {Function} [comparator] The comparator invoked per element.
  3859. * @returns {Array} Returns the new array of filtered values.
  3860. */
  3861. function baseDifference(array, values, iteratee, comparator) {
  3862. var index = -1,
  3863. includes = arrayIncludes,
  3864. isCommon = true,
  3865. length = array.length,
  3866. result = [],
  3867. valuesLength = values.length;
  3868. if (!length) {
  3869. return result;
  3870. }
  3871. if (iteratee) {
  3872. values = arrayMap(values, baseUnary(iteratee));
  3873. }
  3874. if (comparator) {
  3875. includes = arrayIncludesWith;
  3876. isCommon = false;
  3877. }
  3878. else if (values.length >= LARGE_ARRAY_SIZE) {
  3879. includes = cacheHas;
  3880. isCommon = false;
  3881. values = new SetCache(values);
  3882. }
  3883. outer:
  3884. while (++index < length) {
  3885. var value = array[index],
  3886. computed = iteratee == null ? value : iteratee(value);
  3887. value = (comparator || value !== 0) ? value : 0;
  3888. if (isCommon && computed === computed) {
  3889. var valuesIndex = valuesLength;
  3890. while (valuesIndex--) {
  3891. if (values[valuesIndex] === computed) {
  3892. continue outer;
  3893. }
  3894. }
  3895. result.push(value);
  3896. }
  3897. else if (!includes(values, computed, comparator)) {
  3898. result.push(value);
  3899. }
  3900. }
  3901. return result;
  3902. }
  3903. /**
  3904. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3905. *
  3906. * @private
  3907. * @param {Array|Object} collection The collection to iterate over.
  3908. * @param {Function} iteratee The function invoked per iteration.
  3909. * @returns {Array|Object} Returns `collection`.
  3910. */
  3911. var baseEach = createBaseEach(baseForOwn);
  3912. /**
  3913. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3914. *
  3915. * @private
  3916. * @param {Array|Object} collection The collection to iterate over.
  3917. * @param {Function} iteratee The function invoked per iteration.
  3918. * @returns {Array|Object} Returns `collection`.
  3919. */
  3920. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3921. /**
  3922. * The base implementation of `_.every` without support for iteratee shorthands.
  3923. *
  3924. * @private
  3925. * @param {Array|Object} collection The collection to iterate over.
  3926. * @param {Function} predicate The function invoked per iteration.
  3927. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3928. * else `false`
  3929. */
  3930. function baseEvery(collection, predicate) {
  3931. var result = true;
  3932. baseEach(collection, function(value, index, collection) {
  3933. result = !!predicate(value, index, collection);
  3934. return result;
  3935. });
  3936. return result;
  3937. }
  3938. /**
  3939. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3940. * `comparator` to determine the extremum value.
  3941. *
  3942. * @private
  3943. * @param {Array} array The array to iterate over.
  3944. * @param {Function} iteratee The iteratee invoked per iteration.
  3945. * @param {Function} comparator The comparator used to compare values.
  3946. * @returns {*} Returns the extremum value.
  3947. */
  3948. function baseExtremum(array, iteratee, comparator) {
  3949. var index = -1,
  3950. length = array.length;
  3951. while (++index < length) {
  3952. var value = array[index],
  3953. current = iteratee(value);
  3954. if (current != null && (computed === undefined
  3955. ? (current === current && !isSymbol(current))
  3956. : comparator(current, computed)
  3957. )) {
  3958. var computed = current,
  3959. result = value;
  3960. }
  3961. }
  3962. return result;
  3963. }
  3964. /**
  3965. * The base implementation of `_.fill` without an iteratee call guard.
  3966. *
  3967. * @private
  3968. * @param {Array} array The array to fill.
  3969. * @param {*} value The value to fill `array` with.
  3970. * @param {number} [start=0] The start position.
  3971. * @param {number} [end=array.length] The end position.
  3972. * @returns {Array} Returns `array`.
  3973. */
  3974. function baseFill(array, value, start, end) {
  3975. var length = array.length;
  3976. start = toInteger(start);
  3977. if (start < 0) {
  3978. start = -start > length ? 0 : (length + start);
  3979. }
  3980. end = (end === undefined || end > length) ? length : toInteger(end);
  3981. if (end < 0) {
  3982. end += length;
  3983. }
  3984. end = start > end ? 0 : toLength(end);
  3985. while (start < end) {
  3986. array[start++] = value;
  3987. }
  3988. return array;
  3989. }
  3990. /**
  3991. * The base implementation of `_.filter` without support for iteratee shorthands.
  3992. *
  3993. * @private
  3994. * @param {Array|Object} collection The collection to iterate over.
  3995. * @param {Function} predicate The function invoked per iteration.
  3996. * @returns {Array} Returns the new filtered array.
  3997. */
  3998. function baseFilter(collection, predicate) {
  3999. var result = [];
  4000. baseEach(collection, function(value, index, collection) {
  4001. if (predicate(value, index, collection)) {
  4002. result.push(value);
  4003. }
  4004. });
  4005. return result;
  4006. }
  4007. /**
  4008. * The base implementation of `_.flatten` with support for restricting flattening.
  4009. *
  4010. * @private
  4011. * @param {Array} array The array to flatten.
  4012. * @param {number} depth The maximum recursion depth.
  4013. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  4014. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  4015. * @param {Array} [result=[]] The initial result value.
  4016. * @returns {Array} Returns the new flattened array.
  4017. */
  4018. function baseFlatten(array, depth, predicate, isStrict, result) {
  4019. var index = -1,
  4020. length = array.length;
  4021. predicate || (predicate = isFlattenable);
  4022. result || (result = []);
  4023. while (++index < length) {
  4024. var value = array[index];
  4025. if (depth > 0 && predicate(value)) {
  4026. if (depth > 1) {
  4027. // Recursively flatten arrays (susceptible to call stack limits).
  4028. baseFlatten(value, depth - 1, predicate, isStrict, result);
  4029. } else {
  4030. arrayPush(result, value);
  4031. }
  4032. } else if (!isStrict) {
  4033. result[result.length] = value;
  4034. }
  4035. }
  4036. return result;
  4037. }
  4038. /**
  4039. * The base implementation of `baseForOwn` which iterates over `object`
  4040. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  4041. * Iteratee functions may exit iteration early by explicitly returning `false`.
  4042. *
  4043. * @private
  4044. * @param {Object} object The object to iterate over.
  4045. * @param {Function} iteratee The function invoked per iteration.
  4046. * @param {Function} keysFunc The function to get the keys of `object`.
  4047. * @returns {Object} Returns `object`.
  4048. */
  4049. var baseFor = createBaseFor();
  4050. /**
  4051. * This function is like `baseFor` except that it iterates over properties
  4052. * in the opposite order.
  4053. *
  4054. * @private
  4055. * @param {Object} object The object to iterate over.
  4056. * @param {Function} iteratee The function invoked per iteration.
  4057. * @param {Function} keysFunc The function to get the keys of `object`.
  4058. * @returns {Object} Returns `object`.
  4059. */
  4060. var baseForRight = createBaseFor(true);
  4061. /**
  4062. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  4063. *
  4064. * @private
  4065. * @param {Object} object The object to iterate over.
  4066. * @param {Function} iteratee The function invoked per iteration.
  4067. * @returns {Object} Returns `object`.
  4068. */
  4069. function baseForOwn(object, iteratee) {
  4070. return object && baseFor(object, iteratee, keys);
  4071. }
  4072. /**
  4073. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  4074. *
  4075. * @private
  4076. * @param {Object} object The object to iterate over.
  4077. * @param {Function} iteratee The function invoked per iteration.
  4078. * @returns {Object} Returns `object`.
  4079. */
  4080. function baseForOwnRight(object, iteratee) {
  4081. return object && baseForRight(object, iteratee, keys);
  4082. }
  4083. /**
  4084. * The base implementation of `_.functions` which creates an array of
  4085. * `object` function property names filtered from `props`.
  4086. *
  4087. * @private
  4088. * @param {Object} object The object to inspect.
  4089. * @param {Array} props The property names to filter.
  4090. * @returns {Array} Returns the function names.
  4091. */
  4092. function baseFunctions(object, props) {
  4093. return arrayFilter(props, function(key) {
  4094. return isFunction(object[key]);
  4095. });
  4096. }
  4097. /**
  4098. * The base implementation of `_.get` without support for default values.
  4099. *
  4100. * @private
  4101. * @param {Object} object The object to query.
  4102. * @param {Array|string} path The path of the property to get.
  4103. * @returns {*} Returns the resolved value.
  4104. */
  4105. function baseGet(object, path) {
  4106. path = castPath(path, object);
  4107. var index = 0,
  4108. length = path.length;
  4109. while (object != null && index < length) {
  4110. object = object[toKey(path[index++])];
  4111. }
  4112. return (index && index == length) ? object : undefined;
  4113. }
  4114. /**
  4115. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4116. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4117. * symbols of `object`.
  4118. *
  4119. * @private
  4120. * @param {Object} object The object to query.
  4121. * @param {Function} keysFunc The function to get the keys of `object`.
  4122. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4123. * @returns {Array} Returns the array of property names and symbols.
  4124. */
  4125. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4126. var result = keysFunc(object);
  4127. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4128. }
  4129. /**
  4130. * The base implementation of `getTag` without fallbacks for buggy environments.
  4131. *
  4132. * @private
  4133. * @param {*} value The value to query.
  4134. * @returns {string} Returns the `toStringTag`.
  4135. */
  4136. function baseGetTag(value) {
  4137. if (value == null) {
  4138. return value === undefined ? undefinedTag : nullTag;
  4139. }
  4140. return (symToStringTag && symToStringTag in Object(value))
  4141. ? getRawTag(value)
  4142. : objectToString(value);
  4143. }
  4144. /**
  4145. * The base implementation of `_.gt` which doesn't coerce arguments.
  4146. *
  4147. * @private
  4148. * @param {*} value The value to compare.
  4149. * @param {*} other The other value to compare.
  4150. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4151. * else `false`.
  4152. */
  4153. function baseGt(value, other) {
  4154. return value > other;
  4155. }
  4156. /**
  4157. * The base implementation of `_.has` without support for deep paths.
  4158. *
  4159. * @private
  4160. * @param {Object} [object] The object to query.
  4161. * @param {Array|string} key The key to check.
  4162. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4163. */
  4164. function baseHas(object, key) {
  4165. return object != null && hasOwnProperty.call(object, key);
  4166. }
  4167. /**
  4168. * The base implementation of `_.hasIn` without support for deep paths.
  4169. *
  4170. * @private
  4171. * @param {Object} [object] The object to query.
  4172. * @param {Array|string} key The key to check.
  4173. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4174. */
  4175. function baseHasIn(object, key) {
  4176. return object != null && key in Object(object);
  4177. }
  4178. /**
  4179. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4180. *
  4181. * @private
  4182. * @param {number} number The number to check.
  4183. * @param {number} start The start of the range.
  4184. * @param {number} end The end of the range.
  4185. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4186. */
  4187. function baseInRange(number, start, end) {
  4188. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4189. }
  4190. /**
  4191. * The base implementation of methods like `_.intersection`, without support
  4192. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4193. *
  4194. * @private
  4195. * @param {Array} arrays The arrays to inspect.
  4196. * @param {Function} [iteratee] The iteratee invoked per element.
  4197. * @param {Function} [comparator] The comparator invoked per element.
  4198. * @returns {Array} Returns the new array of shared values.
  4199. */
  4200. function baseIntersection(arrays, iteratee, comparator) {
  4201. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4202. length = arrays[0].length,
  4203. othLength = arrays.length,
  4204. othIndex = othLength,
  4205. caches = Array(othLength),
  4206. maxLength = Infinity,
  4207. result = [];
  4208. while (othIndex--) {
  4209. var array = arrays[othIndex];
  4210. if (othIndex && iteratee) {
  4211. array = arrayMap(array, baseUnary(iteratee));
  4212. }
  4213. maxLength = nativeMin(array.length, maxLength);
  4214. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4215. ? new SetCache(othIndex && array)
  4216. : undefined;
  4217. }
  4218. array = arrays[0];
  4219. var index = -1,
  4220. seen = caches[0];
  4221. outer:
  4222. while (++index < length && result.length < maxLength) {
  4223. var value = array[index],
  4224. computed = iteratee ? iteratee(value) : value;
  4225. value = (comparator || value !== 0) ? value : 0;
  4226. if (!(seen
  4227. ? cacheHas(seen, computed)
  4228. : includes(result, computed, comparator)
  4229. )) {
  4230. othIndex = othLength;
  4231. while (--othIndex) {
  4232. var cache = caches[othIndex];
  4233. if (!(cache
  4234. ? cacheHas(cache, computed)
  4235. : includes(arrays[othIndex], computed, comparator))
  4236. ) {
  4237. continue outer;
  4238. }
  4239. }
  4240. if (seen) {
  4241. seen.push(computed);
  4242. }
  4243. result.push(value);
  4244. }
  4245. }
  4246. return result;
  4247. }
  4248. /**
  4249. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4250. * `object` with values transformed by `iteratee` and set by `setter`.
  4251. *
  4252. * @private
  4253. * @param {Object} object The object to iterate over.
  4254. * @param {Function} setter The function to set `accumulator` values.
  4255. * @param {Function} iteratee The iteratee to transform values.
  4256. * @param {Object} accumulator The initial inverted object.
  4257. * @returns {Function} Returns `accumulator`.
  4258. */
  4259. function baseInverter(object, setter, iteratee, accumulator) {
  4260. baseForOwn(object, function(value, key, object) {
  4261. setter(accumulator, iteratee(value), key, object);
  4262. });
  4263. return accumulator;
  4264. }
  4265. /**
  4266. * The base implementation of `_.invoke` without support for individual
  4267. * method arguments.
  4268. *
  4269. * @private
  4270. * @param {Object} object The object to query.
  4271. * @param {Array|string} path The path of the method to invoke.
  4272. * @param {Array} args The arguments to invoke the method with.
  4273. * @returns {*} Returns the result of the invoked method.
  4274. */
  4275. function baseInvoke(object, path, args) {
  4276. path = castPath(path, object);
  4277. object = parent(object, path);
  4278. var func = object == null ? object : object[toKey(last(path))];
  4279. return func == null ? undefined : apply(func, object, args);
  4280. }
  4281. /**
  4282. * The base implementation of `_.isArguments`.
  4283. *
  4284. * @private
  4285. * @param {*} value The value to check.
  4286. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4287. */
  4288. function baseIsArguments(value) {
  4289. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4290. }
  4291. /**
  4292. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4293. *
  4294. * @private
  4295. * @param {*} value The value to check.
  4296. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4297. */
  4298. function baseIsArrayBuffer(value) {
  4299. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4300. }
  4301. /**
  4302. * The base implementation of `_.isDate` without Node.js optimizations.
  4303. *
  4304. * @private
  4305. * @param {*} value The value to check.
  4306. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4307. */
  4308. function baseIsDate(value) {
  4309. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4310. }
  4311. /**
  4312. * The base implementation of `_.isEqual` which supports partial comparisons
  4313. * and tracks traversed objects.
  4314. *
  4315. * @private
  4316. * @param {*} value The value to compare.
  4317. * @param {*} other The other value to compare.
  4318. * @param {boolean} bitmask The bitmask flags.
  4319. * 1 - Unordered comparison
  4320. * 2 - Partial comparison
  4321. * @param {Function} [customizer] The function to customize comparisons.
  4322. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4323. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4324. */
  4325. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4326. if (value === other) {
  4327. return true;
  4328. }
  4329. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4330. return value !== value && other !== other;
  4331. }
  4332. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4333. }
  4334. /**
  4335. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4336. * deep comparisons and tracks traversed objects enabling objects with circular
  4337. * references to be compared.
  4338. *
  4339. * @private
  4340. * @param {Object} object The object to compare.
  4341. * @param {Object} other The other object to compare.
  4342. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4343. * @param {Function} customizer The function to customize comparisons.
  4344. * @param {Function} equalFunc The function to determine equivalents of values.
  4345. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4346. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4347. */
  4348. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4349. var objIsArr = isArray(object),
  4350. othIsArr = isArray(other),
  4351. objTag = objIsArr ? arrayTag : getTag(object),
  4352. othTag = othIsArr ? arrayTag : getTag(other);
  4353. objTag = objTag == argsTag ? objectTag : objTag;
  4354. othTag = othTag == argsTag ? objectTag : othTag;
  4355. var objIsObj = objTag == objectTag,
  4356. othIsObj = othTag == objectTag,
  4357. isSameTag = objTag == othTag;
  4358. if (isSameTag && isBuffer(object)) {
  4359. if (!isBuffer(other)) {
  4360. return false;
  4361. }
  4362. objIsArr = true;
  4363. objIsObj = false;
  4364. }
  4365. if (isSameTag && !objIsObj) {
  4366. stack || (stack = new Stack);
  4367. return (objIsArr || isTypedArray(object))
  4368. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4369. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4370. }
  4371. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4372. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4373. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4374. if (objIsWrapped || othIsWrapped) {
  4375. var objUnwrapped = objIsWrapped ? object.value() : object,
  4376. othUnwrapped = othIsWrapped ? other.value() : other;
  4377. stack || (stack = new Stack);
  4378. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4379. }
  4380. }
  4381. if (!isSameTag) {
  4382. return false;
  4383. }
  4384. stack || (stack = new Stack);
  4385. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4386. }
  4387. /**
  4388. * The base implementation of `_.isMap` without Node.js optimizations.
  4389. *
  4390. * @private
  4391. * @param {*} value The value to check.
  4392. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4393. */
  4394. function baseIsMap(value) {
  4395. return isObjectLike(value) && getTag(value) == mapTag;
  4396. }
  4397. /**
  4398. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4399. *
  4400. * @private
  4401. * @param {Object} object The object to inspect.
  4402. * @param {Object} source The object of property values to match.
  4403. * @param {Array} matchData The property names, values, and compare flags to match.
  4404. * @param {Function} [customizer] The function to customize comparisons.
  4405. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4406. */
  4407. function baseIsMatch(object, source, matchData, customizer) {
  4408. var index = matchData.length,
  4409. length = index,
  4410. noCustomizer = !customizer;
  4411. if (object == null) {
  4412. return !length;
  4413. }
  4414. object = Object(object);
  4415. while (index--) {
  4416. var data = matchData[index];
  4417. if ((noCustomizer && data[2])
  4418. ? data[1] !== object[data[0]]
  4419. : !(data[0] in object)
  4420. ) {
  4421. return false;
  4422. }
  4423. }
  4424. while (++index < length) {
  4425. data = matchData[index];
  4426. var key = data[0],
  4427. objValue = object[key],
  4428. srcValue = data[1];
  4429. if (noCustomizer && data[2]) {
  4430. if (objValue === undefined && !(key in object)) {
  4431. return false;
  4432. }
  4433. } else {
  4434. var stack = new Stack;
  4435. if (customizer) {
  4436. var result = customizer(objValue, srcValue, key, object, source, stack);
  4437. }
  4438. if (!(result === undefined
  4439. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4440. : result
  4441. )) {
  4442. return false;
  4443. }
  4444. }
  4445. }
  4446. return true;
  4447. }
  4448. /**
  4449. * The base implementation of `_.isNative` without bad shim checks.
  4450. *
  4451. * @private
  4452. * @param {*} value The value to check.
  4453. * @returns {boolean} Returns `true` if `value` is a native function,
  4454. * else `false`.
  4455. */
  4456. function baseIsNative(value) {
  4457. if (!isObject(value) || isMasked(value)) {
  4458. return false;
  4459. }
  4460. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4461. return pattern.test(toSource(value));
  4462. }
  4463. /**
  4464. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4465. *
  4466. * @private
  4467. * @param {*} value The value to check.
  4468. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4469. */
  4470. function baseIsRegExp(value) {
  4471. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4472. }
  4473. /**
  4474. * The base implementation of `_.isSet` without Node.js optimizations.
  4475. *
  4476. * @private
  4477. * @param {*} value The value to check.
  4478. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4479. */
  4480. function baseIsSet(value) {
  4481. return isObjectLike(value) && getTag(value) == setTag;
  4482. }
  4483. /**
  4484. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4485. *
  4486. * @private
  4487. * @param {*} value The value to check.
  4488. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4489. */
  4490. function baseIsTypedArray(value) {
  4491. return isObjectLike(value) &&
  4492. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4493. }
  4494. /**
  4495. * The base implementation of `_.iteratee`.
  4496. *
  4497. * @private
  4498. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4499. * @returns {Function} Returns the iteratee.
  4500. */
  4501. function baseIteratee(value) {
  4502. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4503. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4504. if (typeof value == 'function') {
  4505. return value;
  4506. }
  4507. if (value == null) {
  4508. return identity;
  4509. }
  4510. if (typeof value == 'object') {
  4511. return isArray(value)
  4512. ? baseMatchesProperty(value[0], value[1])
  4513. : baseMatches(value);
  4514. }
  4515. return property(value);
  4516. }
  4517. /**
  4518. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4519. *
  4520. * @private
  4521. * @param {Object} object The object to query.
  4522. * @returns {Array} Returns the array of property names.
  4523. */
  4524. function baseKeys(object) {
  4525. if (!isPrototype(object)) {
  4526. return nativeKeys(object);
  4527. }
  4528. var result = [];
  4529. for (var key in Object(object)) {
  4530. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4531. result.push(key);
  4532. }
  4533. }
  4534. return result;
  4535. }
  4536. /**
  4537. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4538. *
  4539. * @private
  4540. * @param {Object} object The object to query.
  4541. * @returns {Array} Returns the array of property names.
  4542. */
  4543. function baseKeysIn(object) {
  4544. if (!isObject(object)) {
  4545. return nativeKeysIn(object);
  4546. }
  4547. var isProto = isPrototype(object),
  4548. result = [];
  4549. for (var key in object) {
  4550. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4551. result.push(key);
  4552. }
  4553. }
  4554. return result;
  4555. }
  4556. /**
  4557. * The base implementation of `_.lt` which doesn't coerce arguments.
  4558. *
  4559. * @private
  4560. * @param {*} value The value to compare.
  4561. * @param {*} other The other value to compare.
  4562. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4563. * else `false`.
  4564. */
  4565. function baseLt(value, other) {
  4566. return value < other;
  4567. }
  4568. /**
  4569. * The base implementation of `_.map` without support for iteratee shorthands.
  4570. *
  4571. * @private
  4572. * @param {Array|Object} collection The collection to iterate over.
  4573. * @param {Function} iteratee The function invoked per iteration.
  4574. * @returns {Array} Returns the new mapped array.
  4575. */
  4576. function baseMap(collection, iteratee) {
  4577. var index = -1,
  4578. result = isArrayLike(collection) ? Array(collection.length) : [];
  4579. baseEach(collection, function(value, key, collection) {
  4580. result[++index] = iteratee(value, key, collection);
  4581. });
  4582. return result;
  4583. }
  4584. /**
  4585. * The base implementation of `_.matches` which doesn't clone `source`.
  4586. *
  4587. * @private
  4588. * @param {Object} source The object of property values to match.
  4589. * @returns {Function} Returns the new spec function.
  4590. */
  4591. function baseMatches(source) {
  4592. var matchData = getMatchData(source);
  4593. if (matchData.length == 1 && matchData[0][2]) {
  4594. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4595. }
  4596. return function(object) {
  4597. return object === source || baseIsMatch(object, source, matchData);
  4598. };
  4599. }
  4600. /**
  4601. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4602. *
  4603. * @private
  4604. * @param {string} path The path of the property to get.
  4605. * @param {*} srcValue The value to match.
  4606. * @returns {Function} Returns the new spec function.
  4607. */
  4608. function baseMatchesProperty(path, srcValue) {
  4609. if (isKey(path) && isStrictComparable(srcValue)) {
  4610. return matchesStrictComparable(toKey(path), srcValue);
  4611. }
  4612. return function(object) {
  4613. var objValue = get(object, path);
  4614. return (objValue === undefined && objValue === srcValue)
  4615. ? hasIn(object, path)
  4616. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4617. };
  4618. }
  4619. /**
  4620. * The base implementation of `_.merge` without support for multiple sources.
  4621. *
  4622. * @private
  4623. * @param {Object} object The destination object.
  4624. * @param {Object} source The source object.
  4625. * @param {number} srcIndex The index of `source`.
  4626. * @param {Function} [customizer] The function to customize merged values.
  4627. * @param {Object} [stack] Tracks traversed source values and their merged
  4628. * counterparts.
  4629. */
  4630. function baseMerge(object, source, srcIndex, customizer, stack) {
  4631. if (object === source) {
  4632. return;
  4633. }
  4634. baseFor(source, function(srcValue, key) {
  4635. stack || (stack = new Stack);
  4636. if (isObject(srcValue)) {
  4637. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4638. }
  4639. else {
  4640. var newValue = customizer
  4641. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4642. : undefined;
  4643. if (newValue === undefined) {
  4644. newValue = srcValue;
  4645. }
  4646. assignMergeValue(object, key, newValue);
  4647. }
  4648. }, keysIn);
  4649. }
  4650. /**
  4651. * A specialized version of `baseMerge` for arrays and objects which performs
  4652. * deep merges and tracks traversed objects enabling objects with circular
  4653. * references to be merged.
  4654. *
  4655. * @private
  4656. * @param {Object} object The destination object.
  4657. * @param {Object} source The source object.
  4658. * @param {string} key The key of the value to merge.
  4659. * @param {number} srcIndex The index of `source`.
  4660. * @param {Function} mergeFunc The function to merge values.
  4661. * @param {Function} [customizer] The function to customize assigned values.
  4662. * @param {Object} [stack] Tracks traversed source values and their merged
  4663. * counterparts.
  4664. */
  4665. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4666. var objValue = safeGet(object, key),
  4667. srcValue = safeGet(source, key),
  4668. stacked = stack.get(srcValue);
  4669. if (stacked) {
  4670. assignMergeValue(object, key, stacked);
  4671. return;
  4672. }
  4673. var newValue = customizer
  4674. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4675. : undefined;
  4676. var isCommon = newValue === undefined;
  4677. if (isCommon) {
  4678. var isArr = isArray(srcValue),
  4679. isBuff = !isArr && isBuffer(srcValue),
  4680. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4681. newValue = srcValue;
  4682. if (isArr || isBuff || isTyped) {
  4683. if (isArray(objValue)) {
  4684. newValue = objValue;
  4685. }
  4686. else if (isArrayLikeObject(objValue)) {
  4687. newValue = copyArray(objValue);
  4688. }
  4689. else if (isBuff) {
  4690. isCommon = false;
  4691. newValue = cloneBuffer(srcValue, true);
  4692. }
  4693. else if (isTyped) {
  4694. isCommon = false;
  4695. newValue = cloneTypedArray(srcValue, true);
  4696. }
  4697. else {
  4698. newValue = [];
  4699. }
  4700. }
  4701. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4702. newValue = objValue;
  4703. if (isArguments(objValue)) {
  4704. newValue = toPlainObject(objValue);
  4705. }
  4706. else if (!isObject(objValue) || isFunction(objValue)) {
  4707. newValue = initCloneObject(srcValue);
  4708. }
  4709. }
  4710. else {
  4711. isCommon = false;
  4712. }
  4713. }
  4714. if (isCommon) {
  4715. // Recursively merge objects and arrays (susceptible to call stack limits).
  4716. stack.set(srcValue, newValue);
  4717. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4718. stack['delete'](srcValue);
  4719. }
  4720. assignMergeValue(object, key, newValue);
  4721. }
  4722. /**
  4723. * The base implementation of `_.nth` which doesn't coerce arguments.
  4724. *
  4725. * @private
  4726. * @param {Array} array The array to query.
  4727. * @param {number} n The index of the element to return.
  4728. * @returns {*} Returns the nth element of `array`.
  4729. */
  4730. function baseNth(array, n) {
  4731. var length = array.length;
  4732. if (!length) {
  4733. return;
  4734. }
  4735. n += n < 0 ? length : 0;
  4736. return isIndex(n, length) ? array[n] : undefined;
  4737. }
  4738. /**
  4739. * The base implementation of `_.orderBy` without param guards.
  4740. *
  4741. * @private
  4742. * @param {Array|Object} collection The collection to iterate over.
  4743. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4744. * @param {string[]} orders The sort orders of `iteratees`.
  4745. * @returns {Array} Returns the new sorted array.
  4746. */
  4747. function baseOrderBy(collection, iteratees, orders) {
  4748. if (iteratees.length) {
  4749. iteratees = arrayMap(iteratees, function(iteratee) {
  4750. if (isArray(iteratee)) {
  4751. return function(value) {
  4752. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4753. }
  4754. }
  4755. return iteratee;
  4756. });
  4757. } else {
  4758. iteratees = [identity];
  4759. }
  4760. var index = -1;
  4761. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4762. var result = baseMap(collection, function(value, key, collection) {
  4763. var criteria = arrayMap(iteratees, function(iteratee) {
  4764. return iteratee(value);
  4765. });
  4766. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4767. });
  4768. return baseSortBy(result, function(object, other) {
  4769. return compareMultiple(object, other, orders);
  4770. });
  4771. }
  4772. /**
  4773. * The base implementation of `_.pick` without support for individual
  4774. * property identifiers.
  4775. *
  4776. * @private
  4777. * @param {Object} object The source object.
  4778. * @param {string[]} paths The property paths to pick.
  4779. * @returns {Object} Returns the new object.
  4780. */
  4781. function basePick(object, paths) {
  4782. return basePickBy(object, paths, function(value, path) {
  4783. return hasIn(object, path);
  4784. });
  4785. }
  4786. /**
  4787. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4788. *
  4789. * @private
  4790. * @param {Object} object The source object.
  4791. * @param {string[]} paths The property paths to pick.
  4792. * @param {Function} predicate The function invoked per property.
  4793. * @returns {Object} Returns the new object.
  4794. */
  4795. function basePickBy(object, paths, predicate) {
  4796. var index = -1,
  4797. length = paths.length,
  4798. result = {};
  4799. while (++index < length) {
  4800. var path = paths[index],
  4801. value = baseGet(object, path);
  4802. if (predicate(value, path)) {
  4803. baseSet(result, castPath(path, object), value);
  4804. }
  4805. }
  4806. return result;
  4807. }
  4808. /**
  4809. * A specialized version of `baseProperty` which supports deep paths.
  4810. *
  4811. * @private
  4812. * @param {Array|string} path The path of the property to get.
  4813. * @returns {Function} Returns the new accessor function.
  4814. */
  4815. function basePropertyDeep(path) {
  4816. return function(object) {
  4817. return baseGet(object, path);
  4818. };
  4819. }
  4820. /**
  4821. * The base implementation of `_.pullAllBy` without support for iteratee
  4822. * shorthands.
  4823. *
  4824. * @private
  4825. * @param {Array} array The array to modify.
  4826. * @param {Array} values The values to remove.
  4827. * @param {Function} [iteratee] The iteratee invoked per element.
  4828. * @param {Function} [comparator] The comparator invoked per element.
  4829. * @returns {Array} Returns `array`.
  4830. */
  4831. function basePullAll(array, values, iteratee, comparator) {
  4832. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4833. index = -1,
  4834. length = values.length,
  4835. seen = array;
  4836. if (array === values) {
  4837. values = copyArray(values);
  4838. }
  4839. if (iteratee) {
  4840. seen = arrayMap(array, baseUnary(iteratee));
  4841. }
  4842. while (++index < length) {
  4843. var fromIndex = 0,
  4844. value = values[index],
  4845. computed = iteratee ? iteratee(value) : value;
  4846. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4847. if (seen !== array) {
  4848. splice.call(seen, fromIndex, 1);
  4849. }
  4850. splice.call(array, fromIndex, 1);
  4851. }
  4852. }
  4853. return array;
  4854. }
  4855. /**
  4856. * The base implementation of `_.pullAt` without support for individual
  4857. * indexes or capturing the removed elements.
  4858. *
  4859. * @private
  4860. * @param {Array} array The array to modify.
  4861. * @param {number[]} indexes The indexes of elements to remove.
  4862. * @returns {Array} Returns `array`.
  4863. */
  4864. function basePullAt(array, indexes) {
  4865. var length = array ? indexes.length : 0,
  4866. lastIndex = length - 1;
  4867. while (length--) {
  4868. var index = indexes[length];
  4869. if (length == lastIndex || index !== previous) {
  4870. var previous = index;
  4871. if (isIndex(index)) {
  4872. splice.call(array, index, 1);
  4873. } else {
  4874. baseUnset(array, index);
  4875. }
  4876. }
  4877. }
  4878. return array;
  4879. }
  4880. /**
  4881. * The base implementation of `_.random` without support for returning
  4882. * floating-point numbers.
  4883. *
  4884. * @private
  4885. * @param {number} lower The lower bound.
  4886. * @param {number} upper The upper bound.
  4887. * @returns {number} Returns the random number.
  4888. */
  4889. function baseRandom(lower, upper) {
  4890. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4891. }
  4892. /**
  4893. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4894. * coerce arguments.
  4895. *
  4896. * @private
  4897. * @param {number} start The start of the range.
  4898. * @param {number} end The end of the range.
  4899. * @param {number} step The value to increment or decrement by.
  4900. * @param {boolean} [fromRight] Specify iterating from right to left.
  4901. * @returns {Array} Returns the range of numbers.
  4902. */
  4903. function baseRange(start, end, step, fromRight) {
  4904. var index = -1,
  4905. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4906. result = Array(length);
  4907. while (length--) {
  4908. result[fromRight ? length : ++index] = start;
  4909. start += step;
  4910. }
  4911. return result;
  4912. }
  4913. /**
  4914. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4915. *
  4916. * @private
  4917. * @param {string} string The string to repeat.
  4918. * @param {number} n The number of times to repeat the string.
  4919. * @returns {string} Returns the repeated string.
  4920. */
  4921. function baseRepeat(string, n) {
  4922. var result = '';
  4923. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4924. return result;
  4925. }
  4926. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4927. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4928. do {
  4929. if (n % 2) {
  4930. result += string;
  4931. }
  4932. n = nativeFloor(n / 2);
  4933. if (n) {
  4934. string += string;
  4935. }
  4936. } while (n);
  4937. return result;
  4938. }
  4939. /**
  4940. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4941. *
  4942. * @private
  4943. * @param {Function} func The function to apply a rest parameter to.
  4944. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4945. * @returns {Function} Returns the new function.
  4946. */
  4947. function baseRest(func, start) {
  4948. return setToString(overRest(func, start, identity), func + '');
  4949. }
  4950. /**
  4951. * The base implementation of `_.sample`.
  4952. *
  4953. * @private
  4954. * @param {Array|Object} collection The collection to sample.
  4955. * @returns {*} Returns the random element.
  4956. */
  4957. function baseSample(collection) {
  4958. return arraySample(values(collection));
  4959. }
  4960. /**
  4961. * The base implementation of `_.sampleSize` without param guards.
  4962. *
  4963. * @private
  4964. * @param {Array|Object} collection The collection to sample.
  4965. * @param {number} n The number of elements to sample.
  4966. * @returns {Array} Returns the random elements.
  4967. */
  4968. function baseSampleSize(collection, n) {
  4969. var array = values(collection);
  4970. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4971. }
  4972. /**
  4973. * The base implementation of `_.set`.
  4974. *
  4975. * @private
  4976. * @param {Object} object The object to modify.
  4977. * @param {Array|string} path The path of the property to set.
  4978. * @param {*} value The value to set.
  4979. * @param {Function} [customizer] The function to customize path creation.
  4980. * @returns {Object} Returns `object`.
  4981. */
  4982. function baseSet(object, path, value, customizer) {
  4983. if (!isObject(object)) {
  4984. return object;
  4985. }
  4986. path = castPath(path, object);
  4987. var index = -1,
  4988. length = path.length,
  4989. lastIndex = length - 1,
  4990. nested = object;
  4991. while (nested != null && ++index < length) {
  4992. var key = toKey(path[index]),
  4993. newValue = value;
  4994. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4995. return object;
  4996. }
  4997. if (index != lastIndex) {
  4998. var objValue = nested[key];
  4999. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  5000. if (newValue === undefined) {
  5001. newValue = isObject(objValue)
  5002. ? objValue
  5003. : (isIndex(path[index + 1]) ? [] : {});
  5004. }
  5005. }
  5006. assignValue(nested, key, newValue);
  5007. nested = nested[key];
  5008. }
  5009. return object;
  5010. }
  5011. /**
  5012. * The base implementation of `setData` without support for hot loop shorting.
  5013. *
  5014. * @private
  5015. * @param {Function} func The function to associate metadata with.
  5016. * @param {*} data The metadata.
  5017. * @returns {Function} Returns `func`.
  5018. */
  5019. var baseSetData = !metaMap ? identity : function(func, data) {
  5020. metaMap.set(func, data);
  5021. return func;
  5022. };
  5023. /**
  5024. * The base implementation of `setToString` without support for hot loop shorting.
  5025. *
  5026. * @private
  5027. * @param {Function} func The function to modify.
  5028. * @param {Function} string The `toString` result.
  5029. * @returns {Function} Returns `func`.
  5030. */
  5031. var baseSetToString = !defineProperty ? identity : function(func, string) {
  5032. return defineProperty(func, 'toString', {
  5033. 'configurable': true,
  5034. 'enumerable': false,
  5035. 'value': constant(string),
  5036. 'writable': true
  5037. });
  5038. };
  5039. /**
  5040. * The base implementation of `_.shuffle`.
  5041. *
  5042. * @private
  5043. * @param {Array|Object} collection The collection to shuffle.
  5044. * @returns {Array} Returns the new shuffled array.
  5045. */
  5046. function baseShuffle(collection) {
  5047. return shuffleSelf(values(collection));
  5048. }
  5049. /**
  5050. * The base implementation of `_.slice` without an iteratee call guard.
  5051. *
  5052. * @private
  5053. * @param {Array} array The array to slice.
  5054. * @param {number} [start=0] The start position.
  5055. * @param {number} [end=array.length] The end position.
  5056. * @returns {Array} Returns the slice of `array`.
  5057. */
  5058. function baseSlice(array, start, end) {
  5059. var index = -1,
  5060. length = array.length;
  5061. if (start < 0) {
  5062. start = -start > length ? 0 : (length + start);
  5063. }
  5064. end = end > length ? length : end;
  5065. if (end < 0) {
  5066. end += length;
  5067. }
  5068. length = start > end ? 0 : ((end - start) >>> 0);
  5069. start >>>= 0;
  5070. var result = Array(length);
  5071. while (++index < length) {
  5072. result[index] = array[index + start];
  5073. }
  5074. return result;
  5075. }
  5076. /**
  5077. * The base implementation of `_.some` without support for iteratee shorthands.
  5078. *
  5079. * @private
  5080. * @param {Array|Object} collection The collection to iterate over.
  5081. * @param {Function} predicate The function invoked per iteration.
  5082. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5083. * else `false`.
  5084. */
  5085. function baseSome(collection, predicate) {
  5086. var result;
  5087. baseEach(collection, function(value, index, collection) {
  5088. result = predicate(value, index, collection);
  5089. return !result;
  5090. });
  5091. return !!result;
  5092. }
  5093. /**
  5094. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5095. * performs a binary search of `array` to determine the index at which `value`
  5096. * should be inserted into `array` in order to maintain its sort order.
  5097. *
  5098. * @private
  5099. * @param {Array} array The sorted array to inspect.
  5100. * @param {*} value The value to evaluate.
  5101. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5102. * @returns {number} Returns the index at which `value` should be inserted
  5103. * into `array`.
  5104. */
  5105. function baseSortedIndex(array, value, retHighest) {
  5106. var low = 0,
  5107. high = array == null ? low : array.length;
  5108. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5109. while (low < high) {
  5110. var mid = (low + high) >>> 1,
  5111. computed = array[mid];
  5112. if (computed !== null && !isSymbol(computed) &&
  5113. (retHighest ? (computed <= value) : (computed < value))) {
  5114. low = mid + 1;
  5115. } else {
  5116. high = mid;
  5117. }
  5118. }
  5119. return high;
  5120. }
  5121. return baseSortedIndexBy(array, value, identity, retHighest);
  5122. }
  5123. /**
  5124. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5125. * which invokes `iteratee` for `value` and each element of `array` to compute
  5126. * their sort ranking. The iteratee is invoked with one argument; (value).
  5127. *
  5128. * @private
  5129. * @param {Array} array The sorted array to inspect.
  5130. * @param {*} value The value to evaluate.
  5131. * @param {Function} iteratee The iteratee invoked per element.
  5132. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5133. * @returns {number} Returns the index at which `value` should be inserted
  5134. * into `array`.
  5135. */
  5136. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5137. var low = 0,
  5138. high = array == null ? 0 : array.length;
  5139. if (high === 0) {
  5140. return 0;
  5141. }
  5142. value = iteratee(value);
  5143. var valIsNaN = value !== value,
  5144. valIsNull = value === null,
  5145. valIsSymbol = isSymbol(value),
  5146. valIsUndefined = value === undefined;
  5147. while (low < high) {
  5148. var mid = nativeFloor((low + high) / 2),
  5149. computed = iteratee(array[mid]),
  5150. othIsDefined = computed !== undefined,
  5151. othIsNull = computed === null,
  5152. othIsReflexive = computed === computed,
  5153. othIsSymbol = isSymbol(computed);
  5154. if (valIsNaN) {
  5155. var setLow = retHighest || othIsReflexive;
  5156. } else if (valIsUndefined) {
  5157. setLow = othIsReflexive && (retHighest || othIsDefined);
  5158. } else if (valIsNull) {
  5159. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5160. } else if (valIsSymbol) {
  5161. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5162. } else if (othIsNull || othIsSymbol) {
  5163. setLow = false;
  5164. } else {
  5165. setLow = retHighest ? (computed <= value) : (computed < value);
  5166. }
  5167. if (setLow) {
  5168. low = mid + 1;
  5169. } else {
  5170. high = mid;
  5171. }
  5172. }
  5173. return nativeMin(high, MAX_ARRAY_INDEX);
  5174. }
  5175. /**
  5176. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5177. * support for iteratee shorthands.
  5178. *
  5179. * @private
  5180. * @param {Array} array The array to inspect.
  5181. * @param {Function} [iteratee] The iteratee invoked per element.
  5182. * @returns {Array} Returns the new duplicate free array.
  5183. */
  5184. function baseSortedUniq(array, iteratee) {
  5185. var index = -1,
  5186. length = array.length,
  5187. resIndex = 0,
  5188. result = [];
  5189. while (++index < length) {
  5190. var value = array[index],
  5191. computed = iteratee ? iteratee(value) : value;
  5192. if (!index || !eq(computed, seen)) {
  5193. var seen = computed;
  5194. result[resIndex++] = value === 0 ? 0 : value;
  5195. }
  5196. }
  5197. return result;
  5198. }
  5199. /**
  5200. * The base implementation of `_.toNumber` which doesn't ensure correct
  5201. * conversions of binary, hexadecimal, or octal string values.
  5202. *
  5203. * @private
  5204. * @param {*} value The value to process.
  5205. * @returns {number} Returns the number.
  5206. */
  5207. function baseToNumber(value) {
  5208. if (typeof value == 'number') {
  5209. return value;
  5210. }
  5211. if (isSymbol(value)) {
  5212. return NAN;
  5213. }
  5214. return +value;
  5215. }
  5216. /**
  5217. * The base implementation of `_.toString` which doesn't convert nullish
  5218. * values to empty strings.
  5219. *
  5220. * @private
  5221. * @param {*} value The value to process.
  5222. * @returns {string} Returns the string.
  5223. */
  5224. function baseToString(value) {
  5225. // Exit early for strings to avoid a performance hit in some environments.
  5226. if (typeof value == 'string') {
  5227. return value;
  5228. }
  5229. if (isArray(value)) {
  5230. // Recursively convert values (susceptible to call stack limits).
  5231. return arrayMap(value, baseToString) + '';
  5232. }
  5233. if (isSymbol(value)) {
  5234. return symbolToString ? symbolToString.call(value) : '';
  5235. }
  5236. var result = (value + '');
  5237. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5238. }
  5239. /**
  5240. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5241. *
  5242. * @private
  5243. * @param {Array} array The array to inspect.
  5244. * @param {Function} [iteratee] The iteratee invoked per element.
  5245. * @param {Function} [comparator] The comparator invoked per element.
  5246. * @returns {Array} Returns the new duplicate free array.
  5247. */
  5248. function baseUniq(array, iteratee, comparator) {
  5249. var index = -1,
  5250. includes = arrayIncludes,
  5251. length = array.length,
  5252. isCommon = true,
  5253. result = [],
  5254. seen = result;
  5255. if (comparator) {
  5256. isCommon = false;
  5257. includes = arrayIncludesWith;
  5258. }
  5259. else if (length >= LARGE_ARRAY_SIZE) {
  5260. var set = iteratee ? null : createSet(array);
  5261. if (set) {
  5262. return setToArray(set);
  5263. }
  5264. isCommon = false;
  5265. includes = cacheHas;
  5266. seen = new SetCache;
  5267. }
  5268. else {
  5269. seen = iteratee ? [] : result;
  5270. }
  5271. outer:
  5272. while (++index < length) {
  5273. var value = array[index],
  5274. computed = iteratee ? iteratee(value) : value;
  5275. value = (comparator || value !== 0) ? value : 0;
  5276. if (isCommon && computed === computed) {
  5277. var seenIndex = seen.length;
  5278. while (seenIndex--) {
  5279. if (seen[seenIndex] === computed) {
  5280. continue outer;
  5281. }
  5282. }
  5283. if (iteratee) {
  5284. seen.push(computed);
  5285. }
  5286. result.push(value);
  5287. }
  5288. else if (!includes(seen, computed, comparator)) {
  5289. if (seen !== result) {
  5290. seen.push(computed);
  5291. }
  5292. result.push(value);
  5293. }
  5294. }
  5295. return result;
  5296. }
  5297. /**
  5298. * The base implementation of `_.unset`.
  5299. *
  5300. * @private
  5301. * @param {Object} object The object to modify.
  5302. * @param {Array|string} path The property path to unset.
  5303. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5304. */
  5305. function baseUnset(object, path) {
  5306. path = castPath(path, object);
  5307. object = parent(object, path);
  5308. return object == null || delete object[toKey(last(path))];
  5309. }
  5310. /**
  5311. * The base implementation of `_.update`.
  5312. *
  5313. * @private
  5314. * @param {Object} object The object to modify.
  5315. * @param {Array|string} path The path of the property to update.
  5316. * @param {Function} updater The function to produce the updated value.
  5317. * @param {Function} [customizer] The function to customize path creation.
  5318. * @returns {Object} Returns `object`.
  5319. */
  5320. function baseUpdate(object, path, updater, customizer) {
  5321. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5322. }
  5323. /**
  5324. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5325. * without support for iteratee shorthands.
  5326. *
  5327. * @private
  5328. * @param {Array} array The array to query.
  5329. * @param {Function} predicate The function invoked per iteration.
  5330. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5331. * @param {boolean} [fromRight] Specify iterating from right to left.
  5332. * @returns {Array} Returns the slice of `array`.
  5333. */
  5334. function baseWhile(array, predicate, isDrop, fromRight) {
  5335. var length = array.length,
  5336. index = fromRight ? length : -1;
  5337. while ((fromRight ? index-- : ++index < length) &&
  5338. predicate(array[index], index, array)) {}
  5339. return isDrop
  5340. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5341. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5342. }
  5343. /**
  5344. * The base implementation of `wrapperValue` which returns the result of
  5345. * performing a sequence of actions on the unwrapped `value`, where each
  5346. * successive action is supplied the return value of the previous.
  5347. *
  5348. * @private
  5349. * @param {*} value The unwrapped value.
  5350. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5351. * @returns {*} Returns the resolved value.
  5352. */
  5353. function baseWrapperValue(value, actions) {
  5354. var result = value;
  5355. if (result instanceof LazyWrapper) {
  5356. result = result.value();
  5357. }
  5358. return arrayReduce(actions, function(result, action) {
  5359. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5360. }, result);
  5361. }
  5362. /**
  5363. * The base implementation of methods like `_.xor`, without support for
  5364. * iteratee shorthands, that accepts an array of arrays to inspect.
  5365. *
  5366. * @private
  5367. * @param {Array} arrays The arrays to inspect.
  5368. * @param {Function} [iteratee] The iteratee invoked per element.
  5369. * @param {Function} [comparator] The comparator invoked per element.
  5370. * @returns {Array} Returns the new array of values.
  5371. */
  5372. function baseXor(arrays, iteratee, comparator) {
  5373. var length = arrays.length;
  5374. if (length < 2) {
  5375. return length ? baseUniq(arrays[0]) : [];
  5376. }
  5377. var index = -1,
  5378. result = Array(length);
  5379. while (++index < length) {
  5380. var array = arrays[index],
  5381. othIndex = -1;
  5382. while (++othIndex < length) {
  5383. if (othIndex != index) {
  5384. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5385. }
  5386. }
  5387. }
  5388. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5389. }
  5390. /**
  5391. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5392. *
  5393. * @private
  5394. * @param {Array} props The property identifiers.
  5395. * @param {Array} values The property values.
  5396. * @param {Function} assignFunc The function to assign values.
  5397. * @returns {Object} Returns the new object.
  5398. */
  5399. function baseZipObject(props, values, assignFunc) {
  5400. var index = -1,
  5401. length = props.length,
  5402. valsLength = values.length,
  5403. result = {};
  5404. while (++index < length) {
  5405. var value = index < valsLength ? values[index] : undefined;
  5406. assignFunc(result, props[index], value);
  5407. }
  5408. return result;
  5409. }
  5410. /**
  5411. * Casts `value` to an empty array if it's not an array like object.
  5412. *
  5413. * @private
  5414. * @param {*} value The value to inspect.
  5415. * @returns {Array|Object} Returns the cast array-like object.
  5416. */
  5417. function castArrayLikeObject(value) {
  5418. return isArrayLikeObject(value) ? value : [];
  5419. }
  5420. /**
  5421. * Casts `value` to `identity` if it's not a function.
  5422. *
  5423. * @private
  5424. * @param {*} value The value to inspect.
  5425. * @returns {Function} Returns cast function.
  5426. */
  5427. function castFunction(value) {
  5428. return typeof value == 'function' ? value : identity;
  5429. }
  5430. /**
  5431. * Casts `value` to a path array if it's not one.
  5432. *
  5433. * @private
  5434. * @param {*} value The value to inspect.
  5435. * @param {Object} [object] The object to query keys on.
  5436. * @returns {Array} Returns the cast property path array.
  5437. */
  5438. function castPath(value, object) {
  5439. if (isArray(value)) {
  5440. return value;
  5441. }
  5442. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5443. }
  5444. /**
  5445. * A `baseRest` alias which can be replaced with `identity` by module
  5446. * replacement plugins.
  5447. *
  5448. * @private
  5449. * @type {Function}
  5450. * @param {Function} func The function to apply a rest parameter to.
  5451. * @returns {Function} Returns the new function.
  5452. */
  5453. var castRest = baseRest;
  5454. /**
  5455. * Casts `array` to a slice if it's needed.
  5456. *
  5457. * @private
  5458. * @param {Array} array The array to inspect.
  5459. * @param {number} start The start position.
  5460. * @param {number} [end=array.length] The end position.
  5461. * @returns {Array} Returns the cast slice.
  5462. */
  5463. function castSlice(array, start, end) {
  5464. var length = array.length;
  5465. end = end === undefined ? length : end;
  5466. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5467. }
  5468. /**
  5469. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5470. *
  5471. * @private
  5472. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5473. */
  5474. var clearTimeout = ctxClearTimeout || function(id) {
  5475. return root.clearTimeout(id);
  5476. };
  5477. /**
  5478. * Creates a clone of `buffer`.
  5479. *
  5480. * @private
  5481. * @param {Buffer} buffer The buffer to clone.
  5482. * @param {boolean} [isDeep] Specify a deep clone.
  5483. * @returns {Buffer} Returns the cloned buffer.
  5484. */
  5485. function cloneBuffer(buffer, isDeep) {
  5486. if (isDeep) {
  5487. return buffer.slice();
  5488. }
  5489. var length = buffer.length,
  5490. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5491. buffer.copy(result);
  5492. return result;
  5493. }
  5494. /**
  5495. * Creates a clone of `arrayBuffer`.
  5496. *
  5497. * @private
  5498. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5499. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5500. */
  5501. function cloneArrayBuffer(arrayBuffer) {
  5502. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5503. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5504. return result;
  5505. }
  5506. /**
  5507. * Creates a clone of `dataView`.
  5508. *
  5509. * @private
  5510. * @param {Object} dataView The data view to clone.
  5511. * @param {boolean} [isDeep] Specify a deep clone.
  5512. * @returns {Object} Returns the cloned data view.
  5513. */
  5514. function cloneDataView(dataView, isDeep) {
  5515. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5516. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5517. }
  5518. /**
  5519. * Creates a clone of `regexp`.
  5520. *
  5521. * @private
  5522. * @param {Object} regexp The regexp to clone.
  5523. * @returns {Object} Returns the cloned regexp.
  5524. */
  5525. function cloneRegExp(regexp) {
  5526. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5527. result.lastIndex = regexp.lastIndex;
  5528. return result;
  5529. }
  5530. /**
  5531. * Creates a clone of the `symbol` object.
  5532. *
  5533. * @private
  5534. * @param {Object} symbol The symbol object to clone.
  5535. * @returns {Object} Returns the cloned symbol object.
  5536. */
  5537. function cloneSymbol(symbol) {
  5538. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5539. }
  5540. /**
  5541. * Creates a clone of `typedArray`.
  5542. *
  5543. * @private
  5544. * @param {Object} typedArray The typed array to clone.
  5545. * @param {boolean} [isDeep] Specify a deep clone.
  5546. * @returns {Object} Returns the cloned typed array.
  5547. */
  5548. function cloneTypedArray(typedArray, isDeep) {
  5549. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5550. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5551. }
  5552. /**
  5553. * Compares values to sort them in ascending order.
  5554. *
  5555. * @private
  5556. * @param {*} value The value to compare.
  5557. * @param {*} other The other value to compare.
  5558. * @returns {number} Returns the sort order indicator for `value`.
  5559. */
  5560. function compareAscending(value, other) {
  5561. if (value !== other) {
  5562. var valIsDefined = value !== undefined,
  5563. valIsNull = value === null,
  5564. valIsReflexive = value === value,
  5565. valIsSymbol = isSymbol(value);
  5566. var othIsDefined = other !== undefined,
  5567. othIsNull = other === null,
  5568. othIsReflexive = other === other,
  5569. othIsSymbol = isSymbol(other);
  5570. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5571. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5572. (valIsNull && othIsDefined && othIsReflexive) ||
  5573. (!valIsDefined && othIsReflexive) ||
  5574. !valIsReflexive) {
  5575. return 1;
  5576. }
  5577. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5578. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5579. (othIsNull && valIsDefined && valIsReflexive) ||
  5580. (!othIsDefined && valIsReflexive) ||
  5581. !othIsReflexive) {
  5582. return -1;
  5583. }
  5584. }
  5585. return 0;
  5586. }
  5587. /**
  5588. * Used by `_.orderBy` to compare multiple properties of a value to another
  5589. * and stable sort them.
  5590. *
  5591. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5592. * specify an order of "desc" for descending or "asc" for ascending sort order
  5593. * of corresponding values.
  5594. *
  5595. * @private
  5596. * @param {Object} object The object to compare.
  5597. * @param {Object} other The other object to compare.
  5598. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5599. * @returns {number} Returns the sort order indicator for `object`.
  5600. */
  5601. function compareMultiple(object, other, orders) {
  5602. var index = -1,
  5603. objCriteria = object.criteria,
  5604. othCriteria = other.criteria,
  5605. length = objCriteria.length,
  5606. ordersLength = orders.length;
  5607. while (++index < length) {
  5608. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5609. if (result) {
  5610. if (index >= ordersLength) {
  5611. return result;
  5612. }
  5613. var order = orders[index];
  5614. return result * (order == 'desc' ? -1 : 1);
  5615. }
  5616. }
  5617. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5618. // that causes it, under certain circumstances, to provide the same value for
  5619. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5620. // for more details.
  5621. //
  5622. // This also ensures a stable sort in V8 and other engines.
  5623. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5624. return object.index - other.index;
  5625. }
  5626. /**
  5627. * Creates an array that is the composition of partially applied arguments,
  5628. * placeholders, and provided arguments into a single array of arguments.
  5629. *
  5630. * @private
  5631. * @param {Array} args The provided arguments.
  5632. * @param {Array} partials The arguments to prepend to those provided.
  5633. * @param {Array} holders The `partials` placeholder indexes.
  5634. * @params {boolean} [isCurried] Specify composing for a curried function.
  5635. * @returns {Array} Returns the new array of composed arguments.
  5636. */
  5637. function composeArgs(args, partials, holders, isCurried) {
  5638. var argsIndex = -1,
  5639. argsLength = args.length,
  5640. holdersLength = holders.length,
  5641. leftIndex = -1,
  5642. leftLength = partials.length,
  5643. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5644. result = Array(leftLength + rangeLength),
  5645. isUncurried = !isCurried;
  5646. while (++leftIndex < leftLength) {
  5647. result[leftIndex] = partials[leftIndex];
  5648. }
  5649. while (++argsIndex < holdersLength) {
  5650. if (isUncurried || argsIndex < argsLength) {
  5651. result[holders[argsIndex]] = args[argsIndex];
  5652. }
  5653. }
  5654. while (rangeLength--) {
  5655. result[leftIndex++] = args[argsIndex++];
  5656. }
  5657. return result;
  5658. }
  5659. /**
  5660. * This function is like `composeArgs` except that the arguments composition
  5661. * is tailored for `_.partialRight`.
  5662. *
  5663. * @private
  5664. * @param {Array} args The provided arguments.
  5665. * @param {Array} partials The arguments to append to those provided.
  5666. * @param {Array} holders The `partials` placeholder indexes.
  5667. * @params {boolean} [isCurried] Specify composing for a curried function.
  5668. * @returns {Array} Returns the new array of composed arguments.
  5669. */
  5670. function composeArgsRight(args, partials, holders, isCurried) {
  5671. var argsIndex = -1,
  5672. argsLength = args.length,
  5673. holdersIndex = -1,
  5674. holdersLength = holders.length,
  5675. rightIndex = -1,
  5676. rightLength = partials.length,
  5677. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5678. result = Array(rangeLength + rightLength),
  5679. isUncurried = !isCurried;
  5680. while (++argsIndex < rangeLength) {
  5681. result[argsIndex] = args[argsIndex];
  5682. }
  5683. var offset = argsIndex;
  5684. while (++rightIndex < rightLength) {
  5685. result[offset + rightIndex] = partials[rightIndex];
  5686. }
  5687. while (++holdersIndex < holdersLength) {
  5688. if (isUncurried || argsIndex < argsLength) {
  5689. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5690. }
  5691. }
  5692. return result;
  5693. }
  5694. /**
  5695. * Copies the values of `source` to `array`.
  5696. *
  5697. * @private
  5698. * @param {Array} source The array to copy values from.
  5699. * @param {Array} [array=[]] The array to copy values to.
  5700. * @returns {Array} Returns `array`.
  5701. */
  5702. function copyArray(source, array) {
  5703. var index = -1,
  5704. length = source.length;
  5705. array || (array = Array(length));
  5706. while (++index < length) {
  5707. array[index] = source[index];
  5708. }
  5709. return array;
  5710. }
  5711. /**
  5712. * Copies properties of `source` to `object`.
  5713. *
  5714. * @private
  5715. * @param {Object} source The object to copy properties from.
  5716. * @param {Array} props The property identifiers to copy.
  5717. * @param {Object} [object={}] The object to copy properties to.
  5718. * @param {Function} [customizer] The function to customize copied values.
  5719. * @returns {Object} Returns `object`.
  5720. */
  5721. function copyObject(source, props, object, customizer) {
  5722. var isNew = !object;
  5723. object || (object = {});
  5724. var index = -1,
  5725. length = props.length;
  5726. while (++index < length) {
  5727. var key = props[index];
  5728. var newValue = customizer
  5729. ? customizer(object[key], source[key], key, object, source)
  5730. : undefined;
  5731. if (newValue === undefined) {
  5732. newValue = source[key];
  5733. }
  5734. if (isNew) {
  5735. baseAssignValue(object, key, newValue);
  5736. } else {
  5737. assignValue(object, key, newValue);
  5738. }
  5739. }
  5740. return object;
  5741. }
  5742. /**
  5743. * Copies own symbols of `source` to `object`.
  5744. *
  5745. * @private
  5746. * @param {Object} source The object to copy symbols from.
  5747. * @param {Object} [object={}] The object to copy symbols to.
  5748. * @returns {Object} Returns `object`.
  5749. */
  5750. function copySymbols(source, object) {
  5751. return copyObject(source, getSymbols(source), object);
  5752. }
  5753. /**
  5754. * Copies own and inherited symbols of `source` to `object`.
  5755. *
  5756. * @private
  5757. * @param {Object} source The object to copy symbols from.
  5758. * @param {Object} [object={}] The object to copy symbols to.
  5759. * @returns {Object} Returns `object`.
  5760. */
  5761. function copySymbolsIn(source, object) {
  5762. return copyObject(source, getSymbolsIn(source), object);
  5763. }
  5764. /**
  5765. * Creates a function like `_.groupBy`.
  5766. *
  5767. * @private
  5768. * @param {Function} setter The function to set accumulator values.
  5769. * @param {Function} [initializer] The accumulator object initializer.
  5770. * @returns {Function} Returns the new aggregator function.
  5771. */
  5772. function createAggregator(setter, initializer) {
  5773. return function(collection, iteratee) {
  5774. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5775. accumulator = initializer ? initializer() : {};
  5776. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5777. };
  5778. }
  5779. /**
  5780. * Creates a function like `_.assign`.
  5781. *
  5782. * @private
  5783. * @param {Function} assigner The function to assign values.
  5784. * @returns {Function} Returns the new assigner function.
  5785. */
  5786. function createAssigner(assigner) {
  5787. return baseRest(function(object, sources) {
  5788. var index = -1,
  5789. length = sources.length,
  5790. customizer = length > 1 ? sources[length - 1] : undefined,
  5791. guard = length > 2 ? sources[2] : undefined;
  5792. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5793. ? (length--, customizer)
  5794. : undefined;
  5795. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5796. customizer = length < 3 ? undefined : customizer;
  5797. length = 1;
  5798. }
  5799. object = Object(object);
  5800. while (++index < length) {
  5801. var source = sources[index];
  5802. if (source) {
  5803. assigner(object, source, index, customizer);
  5804. }
  5805. }
  5806. return object;
  5807. });
  5808. }
  5809. /**
  5810. * Creates a `baseEach` or `baseEachRight` function.
  5811. *
  5812. * @private
  5813. * @param {Function} eachFunc The function to iterate over a collection.
  5814. * @param {boolean} [fromRight] Specify iterating from right to left.
  5815. * @returns {Function} Returns the new base function.
  5816. */
  5817. function createBaseEach(eachFunc, fromRight) {
  5818. return function(collection, iteratee) {
  5819. if (collection == null) {
  5820. return collection;
  5821. }
  5822. if (!isArrayLike(collection)) {
  5823. return eachFunc(collection, iteratee);
  5824. }
  5825. var length = collection.length,
  5826. index = fromRight ? length : -1,
  5827. iterable = Object(collection);
  5828. while ((fromRight ? index-- : ++index < length)) {
  5829. if (iteratee(iterable[index], index, iterable) === false) {
  5830. break;
  5831. }
  5832. }
  5833. return collection;
  5834. };
  5835. }
  5836. /**
  5837. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5838. *
  5839. * @private
  5840. * @param {boolean} [fromRight] Specify iterating from right to left.
  5841. * @returns {Function} Returns the new base function.
  5842. */
  5843. function createBaseFor(fromRight) {
  5844. return function(object, iteratee, keysFunc) {
  5845. var index = -1,
  5846. iterable = Object(object),
  5847. props = keysFunc(object),
  5848. length = props.length;
  5849. while (length--) {
  5850. var key = props[fromRight ? length : ++index];
  5851. if (iteratee(iterable[key], key, iterable) === false) {
  5852. break;
  5853. }
  5854. }
  5855. return object;
  5856. };
  5857. }
  5858. /**
  5859. * Creates a function that wraps `func` to invoke it with the optional `this`
  5860. * binding of `thisArg`.
  5861. *
  5862. * @private
  5863. * @param {Function} func The function to wrap.
  5864. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5865. * @param {*} [thisArg] The `this` binding of `func`.
  5866. * @returns {Function} Returns the new wrapped function.
  5867. */
  5868. function createBind(func, bitmask, thisArg) {
  5869. var isBind = bitmask & WRAP_BIND_FLAG,
  5870. Ctor = createCtor(func);
  5871. function wrapper() {
  5872. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5873. return fn.apply(isBind ? thisArg : this, arguments);
  5874. }
  5875. return wrapper;
  5876. }
  5877. /**
  5878. * Creates a function like `_.lowerFirst`.
  5879. *
  5880. * @private
  5881. * @param {string} methodName The name of the `String` case method to use.
  5882. * @returns {Function} Returns the new case function.
  5883. */
  5884. function createCaseFirst(methodName) {
  5885. return function(string) {
  5886. string = toString(string);
  5887. var strSymbols = hasUnicode(string)
  5888. ? stringToArray(string)
  5889. : undefined;
  5890. var chr = strSymbols
  5891. ? strSymbols[0]
  5892. : string.charAt(0);
  5893. var trailing = strSymbols
  5894. ? castSlice(strSymbols, 1).join('')
  5895. : string.slice(1);
  5896. return chr[methodName]() + trailing;
  5897. };
  5898. }
  5899. /**
  5900. * Creates a function like `_.camelCase`.
  5901. *
  5902. * @private
  5903. * @param {Function} callback The function to combine each word.
  5904. * @returns {Function} Returns the new compounder function.
  5905. */
  5906. function createCompounder(callback) {
  5907. return function(string) {
  5908. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5909. };
  5910. }
  5911. /**
  5912. * Creates a function that produces an instance of `Ctor` regardless of
  5913. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5914. *
  5915. * @private
  5916. * @param {Function} Ctor The constructor to wrap.
  5917. * @returns {Function} Returns the new wrapped function.
  5918. */
  5919. function createCtor(Ctor) {
  5920. return function() {
  5921. // Use a `switch` statement to work with class constructors. See
  5922. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5923. // for more details.
  5924. var args = arguments;
  5925. switch (args.length) {
  5926. case 0: return new Ctor;
  5927. case 1: return new Ctor(args[0]);
  5928. case 2: return new Ctor(args[0], args[1]);
  5929. case 3: return new Ctor(args[0], args[1], args[2]);
  5930. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5931. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5932. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5933. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5934. }
  5935. var thisBinding = baseCreate(Ctor.prototype),
  5936. result = Ctor.apply(thisBinding, args);
  5937. // Mimic the constructor's `return` behavior.
  5938. // See https://es5.github.io/#x13.2.2 for more details.
  5939. return isObject(result) ? result : thisBinding;
  5940. };
  5941. }
  5942. /**
  5943. * Creates a function that wraps `func` to enable currying.
  5944. *
  5945. * @private
  5946. * @param {Function} func The function to wrap.
  5947. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5948. * @param {number} arity The arity of `func`.
  5949. * @returns {Function} Returns the new wrapped function.
  5950. */
  5951. function createCurry(func, bitmask, arity) {
  5952. var Ctor = createCtor(func);
  5953. function wrapper() {
  5954. var length = arguments.length,
  5955. args = Array(length),
  5956. index = length,
  5957. placeholder = getHolder(wrapper);
  5958. while (index--) {
  5959. args[index] = arguments[index];
  5960. }
  5961. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5962. ? []
  5963. : replaceHolders(args, placeholder);
  5964. length -= holders.length;
  5965. if (length < arity) {
  5966. return createRecurry(
  5967. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5968. args, holders, undefined, undefined, arity - length);
  5969. }
  5970. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5971. return apply(fn, this, args);
  5972. }
  5973. return wrapper;
  5974. }
  5975. /**
  5976. * Creates a `_.find` or `_.findLast` function.
  5977. *
  5978. * @private
  5979. * @param {Function} findIndexFunc The function to find the collection index.
  5980. * @returns {Function} Returns the new find function.
  5981. */
  5982. function createFind(findIndexFunc) {
  5983. return function(collection, predicate, fromIndex) {
  5984. var iterable = Object(collection);
  5985. if (!isArrayLike(collection)) {
  5986. var iteratee = getIteratee(predicate, 3);
  5987. collection = keys(collection);
  5988. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5989. }
  5990. var index = findIndexFunc(collection, predicate, fromIndex);
  5991. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5992. };
  5993. }
  5994. /**
  5995. * Creates a `_.flow` or `_.flowRight` function.
  5996. *
  5997. * @private
  5998. * @param {boolean} [fromRight] Specify iterating from right to left.
  5999. * @returns {Function} Returns the new flow function.
  6000. */
  6001. function createFlow(fromRight) {
  6002. return flatRest(function(funcs) {
  6003. var length = funcs.length,
  6004. index = length,
  6005. prereq = LodashWrapper.prototype.thru;
  6006. if (fromRight) {
  6007. funcs.reverse();
  6008. }
  6009. while (index--) {
  6010. var func = funcs[index];
  6011. if (typeof func != 'function') {
  6012. throw new TypeError(FUNC_ERROR_TEXT);
  6013. }
  6014. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  6015. var wrapper = new LodashWrapper([], true);
  6016. }
  6017. }
  6018. index = wrapper ? index : length;
  6019. while (++index < length) {
  6020. func = funcs[index];
  6021. var funcName = getFuncName(func),
  6022. data = funcName == 'wrapper' ? getData(func) : undefined;
  6023. if (data && isLaziable(data[0]) &&
  6024. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  6025. !data[4].length && data[9] == 1
  6026. ) {
  6027. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  6028. } else {
  6029. wrapper = (func.length == 1 && isLaziable(func))
  6030. ? wrapper[funcName]()
  6031. : wrapper.thru(func);
  6032. }
  6033. }
  6034. return function() {
  6035. var args = arguments,
  6036. value = args[0];
  6037. if (wrapper && args.length == 1 && isArray(value)) {
  6038. return wrapper.plant(value).value();
  6039. }
  6040. var index = 0,
  6041. result = length ? funcs[index].apply(this, args) : value;
  6042. while (++index < length) {
  6043. result = funcs[index].call(this, result);
  6044. }
  6045. return result;
  6046. };
  6047. });
  6048. }
  6049. /**
  6050. * Creates a function that wraps `func` to invoke it with optional `this`
  6051. * binding of `thisArg`, partial application, and currying.
  6052. *
  6053. * @private
  6054. * @param {Function|string} func The function or method name to wrap.
  6055. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6056. * @param {*} [thisArg] The `this` binding of `func`.
  6057. * @param {Array} [partials] The arguments to prepend to those provided to
  6058. * the new function.
  6059. * @param {Array} [holders] The `partials` placeholder indexes.
  6060. * @param {Array} [partialsRight] The arguments to append to those provided
  6061. * to the new function.
  6062. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  6063. * @param {Array} [argPos] The argument positions of the new function.
  6064. * @param {number} [ary] The arity cap of `func`.
  6065. * @param {number} [arity] The arity of `func`.
  6066. * @returns {Function} Returns the new wrapped function.
  6067. */
  6068. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  6069. var isAry = bitmask & WRAP_ARY_FLAG,
  6070. isBind = bitmask & WRAP_BIND_FLAG,
  6071. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  6072. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  6073. isFlip = bitmask & WRAP_FLIP_FLAG,
  6074. Ctor = isBindKey ? undefined : createCtor(func);
  6075. function wrapper() {
  6076. var length = arguments.length,
  6077. args = Array(length),
  6078. index = length;
  6079. while (index--) {
  6080. args[index] = arguments[index];
  6081. }
  6082. if (isCurried) {
  6083. var placeholder = getHolder(wrapper),
  6084. holdersCount = countHolders(args, placeholder);
  6085. }
  6086. if (partials) {
  6087. args = composeArgs(args, partials, holders, isCurried);
  6088. }
  6089. if (partialsRight) {
  6090. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6091. }
  6092. length -= holdersCount;
  6093. if (isCurried && length < arity) {
  6094. var newHolders = replaceHolders(args, placeholder);
  6095. return createRecurry(
  6096. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6097. args, newHolders, argPos, ary, arity - length
  6098. );
  6099. }
  6100. var thisBinding = isBind ? thisArg : this,
  6101. fn = isBindKey ? thisBinding[func] : func;
  6102. length = args.length;
  6103. if (argPos) {
  6104. args = reorder(args, argPos);
  6105. } else if (isFlip && length > 1) {
  6106. args.reverse();
  6107. }
  6108. if (isAry && ary < length) {
  6109. args.length = ary;
  6110. }
  6111. if (this && this !== root && this instanceof wrapper) {
  6112. fn = Ctor || createCtor(fn);
  6113. }
  6114. return fn.apply(thisBinding, args);
  6115. }
  6116. return wrapper;
  6117. }
  6118. /**
  6119. * Creates a function like `_.invertBy`.
  6120. *
  6121. * @private
  6122. * @param {Function} setter The function to set accumulator values.
  6123. * @param {Function} toIteratee The function to resolve iteratees.
  6124. * @returns {Function} Returns the new inverter function.
  6125. */
  6126. function createInverter(setter, toIteratee) {
  6127. return function(object, iteratee) {
  6128. return baseInverter(object, setter, toIteratee(iteratee), {});
  6129. };
  6130. }
  6131. /**
  6132. * Creates a function that performs a mathematical operation on two values.
  6133. *
  6134. * @private
  6135. * @param {Function} operator The function to perform the operation.
  6136. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6137. * @returns {Function} Returns the new mathematical operation function.
  6138. */
  6139. function createMathOperation(operator, defaultValue) {
  6140. return function(value, other) {
  6141. var result;
  6142. if (value === undefined && other === undefined) {
  6143. return defaultValue;
  6144. }
  6145. if (value !== undefined) {
  6146. result = value;
  6147. }
  6148. if (other !== undefined) {
  6149. if (result === undefined) {
  6150. return other;
  6151. }
  6152. if (typeof value == 'string' || typeof other == 'string') {
  6153. value = baseToString(value);
  6154. other = baseToString(other);
  6155. } else {
  6156. value = baseToNumber(value);
  6157. other = baseToNumber(other);
  6158. }
  6159. result = operator(value, other);
  6160. }
  6161. return result;
  6162. };
  6163. }
  6164. /**
  6165. * Creates a function like `_.over`.
  6166. *
  6167. * @private
  6168. * @param {Function} arrayFunc The function to iterate over iteratees.
  6169. * @returns {Function} Returns the new over function.
  6170. */
  6171. function createOver(arrayFunc) {
  6172. return flatRest(function(iteratees) {
  6173. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6174. return baseRest(function(args) {
  6175. var thisArg = this;
  6176. return arrayFunc(iteratees, function(iteratee) {
  6177. return apply(iteratee, thisArg, args);
  6178. });
  6179. });
  6180. });
  6181. }
  6182. /**
  6183. * Creates the padding for `string` based on `length`. The `chars` string
  6184. * is truncated if the number of characters exceeds `length`.
  6185. *
  6186. * @private
  6187. * @param {number} length The padding length.
  6188. * @param {string} [chars=' '] The string used as padding.
  6189. * @returns {string} Returns the padding for `string`.
  6190. */
  6191. function createPadding(length, chars) {
  6192. chars = chars === undefined ? ' ' : baseToString(chars);
  6193. var charsLength = chars.length;
  6194. if (charsLength < 2) {
  6195. return charsLength ? baseRepeat(chars, length) : chars;
  6196. }
  6197. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6198. return hasUnicode(chars)
  6199. ? castSlice(stringToArray(result), 0, length).join('')
  6200. : result.slice(0, length);
  6201. }
  6202. /**
  6203. * Creates a function that wraps `func` to invoke it with the `this` binding
  6204. * of `thisArg` and `partials` prepended to the arguments it receives.
  6205. *
  6206. * @private
  6207. * @param {Function} func The function to wrap.
  6208. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6209. * @param {*} thisArg The `this` binding of `func`.
  6210. * @param {Array} partials The arguments to prepend to those provided to
  6211. * the new function.
  6212. * @returns {Function} Returns the new wrapped function.
  6213. */
  6214. function createPartial(func, bitmask, thisArg, partials) {
  6215. var isBind = bitmask & WRAP_BIND_FLAG,
  6216. Ctor = createCtor(func);
  6217. function wrapper() {
  6218. var argsIndex = -1,
  6219. argsLength = arguments.length,
  6220. leftIndex = -1,
  6221. leftLength = partials.length,
  6222. args = Array(leftLength + argsLength),
  6223. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6224. while (++leftIndex < leftLength) {
  6225. args[leftIndex] = partials[leftIndex];
  6226. }
  6227. while (argsLength--) {
  6228. args[leftIndex++] = arguments[++argsIndex];
  6229. }
  6230. return apply(fn, isBind ? thisArg : this, args);
  6231. }
  6232. return wrapper;
  6233. }
  6234. /**
  6235. * Creates a `_.range` or `_.rangeRight` function.
  6236. *
  6237. * @private
  6238. * @param {boolean} [fromRight] Specify iterating from right to left.
  6239. * @returns {Function} Returns the new range function.
  6240. */
  6241. function createRange(fromRight) {
  6242. return function(start, end, step) {
  6243. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6244. end = step = undefined;
  6245. }
  6246. // Ensure the sign of `-0` is preserved.
  6247. start = toFinite(start);
  6248. if (end === undefined) {
  6249. end = start;
  6250. start = 0;
  6251. } else {
  6252. end = toFinite(end);
  6253. }
  6254. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6255. return baseRange(start, end, step, fromRight);
  6256. };
  6257. }
  6258. /**
  6259. * Creates a function that performs a relational operation on two values.
  6260. *
  6261. * @private
  6262. * @param {Function} operator The function to perform the operation.
  6263. * @returns {Function} Returns the new relational operation function.
  6264. */
  6265. function createRelationalOperation(operator) {
  6266. return function(value, other) {
  6267. if (!(typeof value == 'string' && typeof other == 'string')) {
  6268. value = toNumber(value);
  6269. other = toNumber(other);
  6270. }
  6271. return operator(value, other);
  6272. };
  6273. }
  6274. /**
  6275. * Creates a function that wraps `func` to continue currying.
  6276. *
  6277. * @private
  6278. * @param {Function} func The function to wrap.
  6279. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6280. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6281. * @param {*} placeholder The placeholder value.
  6282. * @param {*} [thisArg] The `this` binding of `func`.
  6283. * @param {Array} [partials] The arguments to prepend to those provided to
  6284. * the new function.
  6285. * @param {Array} [holders] The `partials` placeholder indexes.
  6286. * @param {Array} [argPos] The argument positions of the new function.
  6287. * @param {number} [ary] The arity cap of `func`.
  6288. * @param {number} [arity] The arity of `func`.
  6289. * @returns {Function} Returns the new wrapped function.
  6290. */
  6291. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6292. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6293. newHolders = isCurry ? holders : undefined,
  6294. newHoldersRight = isCurry ? undefined : holders,
  6295. newPartials = isCurry ? partials : undefined,
  6296. newPartialsRight = isCurry ? undefined : partials;
  6297. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6298. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6299. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6300. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6301. }
  6302. var newData = [
  6303. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6304. newHoldersRight, argPos, ary, arity
  6305. ];
  6306. var result = wrapFunc.apply(undefined, newData);
  6307. if (isLaziable(func)) {
  6308. setData(result, newData);
  6309. }
  6310. result.placeholder = placeholder;
  6311. return setWrapToString(result, func, bitmask);
  6312. }
  6313. /**
  6314. * Creates a function like `_.round`.
  6315. *
  6316. * @private
  6317. * @param {string} methodName The name of the `Math` method to use when rounding.
  6318. * @returns {Function} Returns the new round function.
  6319. */
  6320. function createRound(methodName) {
  6321. var func = Math[methodName];
  6322. return function(number, precision) {
  6323. number = toNumber(number);
  6324. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6325. if (precision && nativeIsFinite(number)) {
  6326. // Shift with exponential notation to avoid floating-point issues.
  6327. // See [MDN](https://mdn.io/round#Examples) for more details.
  6328. var pair = (toString(number) + 'e').split('e'),
  6329. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6330. pair = (toString(value) + 'e').split('e');
  6331. return +(pair[0] + 'e' + (+pair[1] - precision));
  6332. }
  6333. return func(number);
  6334. };
  6335. }
  6336. /**
  6337. * Creates a set object of `values`.
  6338. *
  6339. * @private
  6340. * @param {Array} values The values to add to the set.
  6341. * @returns {Object} Returns the new set.
  6342. */
  6343. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6344. return new Set(values);
  6345. };
  6346. /**
  6347. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6348. *
  6349. * @private
  6350. * @param {Function} keysFunc The function to get the keys of a given object.
  6351. * @returns {Function} Returns the new pairs function.
  6352. */
  6353. function createToPairs(keysFunc) {
  6354. return function(object) {
  6355. var tag = getTag(object);
  6356. if (tag == mapTag) {
  6357. return mapToArray(object);
  6358. }
  6359. if (tag == setTag) {
  6360. return setToPairs(object);
  6361. }
  6362. return baseToPairs(object, keysFunc(object));
  6363. };
  6364. }
  6365. /**
  6366. * Creates a function that either curries or invokes `func` with optional
  6367. * `this` binding and partially applied arguments.
  6368. *
  6369. * @private
  6370. * @param {Function|string} func The function or method name to wrap.
  6371. * @param {number} bitmask The bitmask flags.
  6372. * 1 - `_.bind`
  6373. * 2 - `_.bindKey`
  6374. * 4 - `_.curry` or `_.curryRight` of a bound function
  6375. * 8 - `_.curry`
  6376. * 16 - `_.curryRight`
  6377. * 32 - `_.partial`
  6378. * 64 - `_.partialRight`
  6379. * 128 - `_.rearg`
  6380. * 256 - `_.ary`
  6381. * 512 - `_.flip`
  6382. * @param {*} [thisArg] The `this` binding of `func`.
  6383. * @param {Array} [partials] The arguments to be partially applied.
  6384. * @param {Array} [holders] The `partials` placeholder indexes.
  6385. * @param {Array} [argPos] The argument positions of the new function.
  6386. * @param {number} [ary] The arity cap of `func`.
  6387. * @param {number} [arity] The arity of `func`.
  6388. * @returns {Function} Returns the new wrapped function.
  6389. */
  6390. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6391. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6392. if (!isBindKey && typeof func != 'function') {
  6393. throw new TypeError(FUNC_ERROR_TEXT);
  6394. }
  6395. var length = partials ? partials.length : 0;
  6396. if (!length) {
  6397. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6398. partials = holders = undefined;
  6399. }
  6400. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6401. arity = arity === undefined ? arity : toInteger(arity);
  6402. length -= holders ? holders.length : 0;
  6403. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6404. var partialsRight = partials,
  6405. holdersRight = holders;
  6406. partials = holders = undefined;
  6407. }
  6408. var data = isBindKey ? undefined : getData(func);
  6409. var newData = [
  6410. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6411. argPos, ary, arity
  6412. ];
  6413. if (data) {
  6414. mergeData(newData, data);
  6415. }
  6416. func = newData[0];
  6417. bitmask = newData[1];
  6418. thisArg = newData[2];
  6419. partials = newData[3];
  6420. holders = newData[4];
  6421. arity = newData[9] = newData[9] === undefined
  6422. ? (isBindKey ? 0 : func.length)
  6423. : nativeMax(newData[9] - length, 0);
  6424. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6425. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6426. }
  6427. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6428. var result = createBind(func, bitmask, thisArg);
  6429. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6430. result = createCurry(func, bitmask, arity);
  6431. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6432. result = createPartial(func, bitmask, thisArg, partials);
  6433. } else {
  6434. result = createHybrid.apply(undefined, newData);
  6435. }
  6436. var setter = data ? baseSetData : setData;
  6437. return setWrapToString(setter(result, newData), func, bitmask);
  6438. }
  6439. /**
  6440. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6441. * of source objects to the destination object for all destination properties
  6442. * that resolve to `undefined`.
  6443. *
  6444. * @private
  6445. * @param {*} objValue The destination value.
  6446. * @param {*} srcValue The source value.
  6447. * @param {string} key The key of the property to assign.
  6448. * @param {Object} object The parent object of `objValue`.
  6449. * @returns {*} Returns the value to assign.
  6450. */
  6451. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6452. if (objValue === undefined ||
  6453. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6454. return srcValue;
  6455. }
  6456. return objValue;
  6457. }
  6458. /**
  6459. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6460. * objects into destination objects that are passed thru.
  6461. *
  6462. * @private
  6463. * @param {*} objValue The destination value.
  6464. * @param {*} srcValue The source value.
  6465. * @param {string} key The key of the property to merge.
  6466. * @param {Object} object The parent object of `objValue`.
  6467. * @param {Object} source The parent object of `srcValue`.
  6468. * @param {Object} [stack] Tracks traversed source values and their merged
  6469. * counterparts.
  6470. * @returns {*} Returns the value to assign.
  6471. */
  6472. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6473. if (isObject(objValue) && isObject(srcValue)) {
  6474. // Recursively merge objects and arrays (susceptible to call stack limits).
  6475. stack.set(srcValue, objValue);
  6476. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6477. stack['delete'](srcValue);
  6478. }
  6479. return objValue;
  6480. }
  6481. /**
  6482. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6483. * objects.
  6484. *
  6485. * @private
  6486. * @param {*} value The value to inspect.
  6487. * @param {string} key The key of the property to inspect.
  6488. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6489. */
  6490. function customOmitClone(value) {
  6491. return isPlainObject(value) ? undefined : value;
  6492. }
  6493. /**
  6494. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6495. * partial deep comparisons.
  6496. *
  6497. * @private
  6498. * @param {Array} array The array to compare.
  6499. * @param {Array} other The other array to compare.
  6500. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6501. * @param {Function} customizer The function to customize comparisons.
  6502. * @param {Function} equalFunc The function to determine equivalents of values.
  6503. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6504. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6505. */
  6506. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6507. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6508. arrLength = array.length,
  6509. othLength = other.length;
  6510. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6511. return false;
  6512. }
  6513. // Check that cyclic values are equal.
  6514. var arrStacked = stack.get(array);
  6515. var othStacked = stack.get(other);
  6516. if (arrStacked && othStacked) {
  6517. return arrStacked == other && othStacked == array;
  6518. }
  6519. var index = -1,
  6520. result = true,
  6521. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6522. stack.set(array, other);
  6523. stack.set(other, array);
  6524. // Ignore non-index properties.
  6525. while (++index < arrLength) {
  6526. var arrValue = array[index],
  6527. othValue = other[index];
  6528. if (customizer) {
  6529. var compared = isPartial
  6530. ? customizer(othValue, arrValue, index, other, array, stack)
  6531. : customizer(arrValue, othValue, index, array, other, stack);
  6532. }
  6533. if (compared !== undefined) {
  6534. if (compared) {
  6535. continue;
  6536. }
  6537. result = false;
  6538. break;
  6539. }
  6540. // Recursively compare arrays (susceptible to call stack limits).
  6541. if (seen) {
  6542. if (!arraySome(other, function(othValue, othIndex) {
  6543. if (!cacheHas(seen, othIndex) &&
  6544. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6545. return seen.push(othIndex);
  6546. }
  6547. })) {
  6548. result = false;
  6549. break;
  6550. }
  6551. } else if (!(
  6552. arrValue === othValue ||
  6553. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6554. )) {
  6555. result = false;
  6556. break;
  6557. }
  6558. }
  6559. stack['delete'](array);
  6560. stack['delete'](other);
  6561. return result;
  6562. }
  6563. /**
  6564. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6565. * the same `toStringTag`.
  6566. *
  6567. * **Note:** This function only supports comparing values with tags of
  6568. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6569. *
  6570. * @private
  6571. * @param {Object} object The object to compare.
  6572. * @param {Object} other The other object to compare.
  6573. * @param {string} tag The `toStringTag` of the objects to compare.
  6574. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6575. * @param {Function} customizer The function to customize comparisons.
  6576. * @param {Function} equalFunc The function to determine equivalents of values.
  6577. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6578. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6579. */
  6580. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6581. switch (tag) {
  6582. case dataViewTag:
  6583. if ((object.byteLength != other.byteLength) ||
  6584. (object.byteOffset != other.byteOffset)) {
  6585. return false;
  6586. }
  6587. object = object.buffer;
  6588. other = other.buffer;
  6589. case arrayBufferTag:
  6590. if ((object.byteLength != other.byteLength) ||
  6591. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6592. return false;
  6593. }
  6594. return true;
  6595. case boolTag:
  6596. case dateTag:
  6597. case numberTag:
  6598. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6599. // Invalid dates are coerced to `NaN`.
  6600. return eq(+object, +other);
  6601. case errorTag:
  6602. return object.name == other.name && object.message == other.message;
  6603. case regexpTag:
  6604. case stringTag:
  6605. // Coerce regexes to strings and treat strings, primitives and objects,
  6606. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6607. // for more details.
  6608. return object == (other + '');
  6609. case mapTag:
  6610. var convert = mapToArray;
  6611. case setTag:
  6612. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6613. convert || (convert = setToArray);
  6614. if (object.size != other.size && !isPartial) {
  6615. return false;
  6616. }
  6617. // Assume cyclic values are equal.
  6618. var stacked = stack.get(object);
  6619. if (stacked) {
  6620. return stacked == other;
  6621. }
  6622. bitmask |= COMPARE_UNORDERED_FLAG;
  6623. // Recursively compare objects (susceptible to call stack limits).
  6624. stack.set(object, other);
  6625. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6626. stack['delete'](object);
  6627. return result;
  6628. case symbolTag:
  6629. if (symbolValueOf) {
  6630. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6631. }
  6632. }
  6633. return false;
  6634. }
  6635. /**
  6636. * A specialized version of `baseIsEqualDeep` for objects with support for
  6637. * partial deep comparisons.
  6638. *
  6639. * @private
  6640. * @param {Object} object The object to compare.
  6641. * @param {Object} other The other object to compare.
  6642. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6643. * @param {Function} customizer The function to customize comparisons.
  6644. * @param {Function} equalFunc The function to determine equivalents of values.
  6645. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6646. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6647. */
  6648. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6649. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6650. objProps = getAllKeys(object),
  6651. objLength = objProps.length,
  6652. othProps = getAllKeys(other),
  6653. othLength = othProps.length;
  6654. if (objLength != othLength && !isPartial) {
  6655. return false;
  6656. }
  6657. var index = objLength;
  6658. while (index--) {
  6659. var key = objProps[index];
  6660. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6661. return false;
  6662. }
  6663. }
  6664. // Check that cyclic values are equal.
  6665. var objStacked = stack.get(object);
  6666. var othStacked = stack.get(other);
  6667. if (objStacked && othStacked) {
  6668. return objStacked == other && othStacked == object;
  6669. }
  6670. var result = true;
  6671. stack.set(object, other);
  6672. stack.set(other, object);
  6673. var skipCtor = isPartial;
  6674. while (++index < objLength) {
  6675. key = objProps[index];
  6676. var objValue = object[key],
  6677. othValue = other[key];
  6678. if (customizer) {
  6679. var compared = isPartial
  6680. ? customizer(othValue, objValue, key, other, object, stack)
  6681. : customizer(objValue, othValue, key, object, other, stack);
  6682. }
  6683. // Recursively compare objects (susceptible to call stack limits).
  6684. if (!(compared === undefined
  6685. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6686. : compared
  6687. )) {
  6688. result = false;
  6689. break;
  6690. }
  6691. skipCtor || (skipCtor = key == 'constructor');
  6692. }
  6693. if (result && !skipCtor) {
  6694. var objCtor = object.constructor,
  6695. othCtor = other.constructor;
  6696. // Non `Object` object instances with different constructors are not equal.
  6697. if (objCtor != othCtor &&
  6698. ('constructor' in object && 'constructor' in other) &&
  6699. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6700. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6701. result = false;
  6702. }
  6703. }
  6704. stack['delete'](object);
  6705. stack['delete'](other);
  6706. return result;
  6707. }
  6708. /**
  6709. * A specialized version of `baseRest` which flattens the rest array.
  6710. *
  6711. * @private
  6712. * @param {Function} func The function to apply a rest parameter to.
  6713. * @returns {Function} Returns the new function.
  6714. */
  6715. function flatRest(func) {
  6716. return setToString(overRest(func, undefined, flatten), func + '');
  6717. }
  6718. /**
  6719. * Creates an array of own enumerable property names and symbols of `object`.
  6720. *
  6721. * @private
  6722. * @param {Object} object The object to query.
  6723. * @returns {Array} Returns the array of property names and symbols.
  6724. */
  6725. function getAllKeys(object) {
  6726. return baseGetAllKeys(object, keys, getSymbols);
  6727. }
  6728. /**
  6729. * Creates an array of own and inherited enumerable property names and
  6730. * symbols of `object`.
  6731. *
  6732. * @private
  6733. * @param {Object} object The object to query.
  6734. * @returns {Array} Returns the array of property names and symbols.
  6735. */
  6736. function getAllKeysIn(object) {
  6737. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6738. }
  6739. /**
  6740. * Gets metadata for `func`.
  6741. *
  6742. * @private
  6743. * @param {Function} func The function to query.
  6744. * @returns {*} Returns the metadata for `func`.
  6745. */
  6746. var getData = !metaMap ? noop : function(func) {
  6747. return metaMap.get(func);
  6748. };
  6749. /**
  6750. * Gets the name of `func`.
  6751. *
  6752. * @private
  6753. * @param {Function} func The function to query.
  6754. * @returns {string} Returns the function name.
  6755. */
  6756. function getFuncName(func) {
  6757. var result = (func.name + ''),
  6758. array = realNames[result],
  6759. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6760. while (length--) {
  6761. var data = array[length],
  6762. otherFunc = data.func;
  6763. if (otherFunc == null || otherFunc == func) {
  6764. return data.name;
  6765. }
  6766. }
  6767. return result;
  6768. }
  6769. /**
  6770. * Gets the argument placeholder value for `func`.
  6771. *
  6772. * @private
  6773. * @param {Function} func The function to inspect.
  6774. * @returns {*} Returns the placeholder value.
  6775. */
  6776. function getHolder(func) {
  6777. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6778. return object.placeholder;
  6779. }
  6780. /**
  6781. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6782. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6783. * If arguments are provided, the chosen function is invoked with them and
  6784. * its result is returned.
  6785. *
  6786. * @private
  6787. * @param {*} [value] The value to convert to an iteratee.
  6788. * @param {number} [arity] The arity of the created iteratee.
  6789. * @returns {Function} Returns the chosen function or its result.
  6790. */
  6791. function getIteratee() {
  6792. var result = lodash.iteratee || iteratee;
  6793. result = result === iteratee ? baseIteratee : result;
  6794. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6795. }
  6796. /**
  6797. * Gets the data for `map`.
  6798. *
  6799. * @private
  6800. * @param {Object} map The map to query.
  6801. * @param {string} key The reference key.
  6802. * @returns {*} Returns the map data.
  6803. */
  6804. function getMapData(map, key) {
  6805. var data = map.__data__;
  6806. return isKeyable(key)
  6807. ? data[typeof key == 'string' ? 'string' : 'hash']
  6808. : data.map;
  6809. }
  6810. /**
  6811. * Gets the property names, values, and compare flags of `object`.
  6812. *
  6813. * @private
  6814. * @param {Object} object The object to query.
  6815. * @returns {Array} Returns the match data of `object`.
  6816. */
  6817. function getMatchData(object) {
  6818. var result = keys(object),
  6819. length = result.length;
  6820. while (length--) {
  6821. var key = result[length],
  6822. value = object[key];
  6823. result[length] = [key, value, isStrictComparable(value)];
  6824. }
  6825. return result;
  6826. }
  6827. /**
  6828. * Gets the native function at `key` of `object`.
  6829. *
  6830. * @private
  6831. * @param {Object} object The object to query.
  6832. * @param {string} key The key of the method to get.
  6833. * @returns {*} Returns the function if it's native, else `undefined`.
  6834. */
  6835. function getNative(object, key) {
  6836. var value = getValue(object, key);
  6837. return baseIsNative(value) ? value : undefined;
  6838. }
  6839. /**
  6840. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6841. *
  6842. * @private
  6843. * @param {*} value The value to query.
  6844. * @returns {string} Returns the raw `toStringTag`.
  6845. */
  6846. function getRawTag(value) {
  6847. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6848. tag = value[symToStringTag];
  6849. try {
  6850. value[symToStringTag] = undefined;
  6851. var unmasked = true;
  6852. } catch (e) {}
  6853. var result = nativeObjectToString.call(value);
  6854. if (unmasked) {
  6855. if (isOwn) {
  6856. value[symToStringTag] = tag;
  6857. } else {
  6858. delete value[symToStringTag];
  6859. }
  6860. }
  6861. return result;
  6862. }
  6863. /**
  6864. * Creates an array of the own enumerable symbols of `object`.
  6865. *
  6866. * @private
  6867. * @param {Object} object The object to query.
  6868. * @returns {Array} Returns the array of symbols.
  6869. */
  6870. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6871. if (object == null) {
  6872. return [];
  6873. }
  6874. object = Object(object);
  6875. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6876. return propertyIsEnumerable.call(object, symbol);
  6877. });
  6878. };
  6879. /**
  6880. * Creates an array of the own and inherited enumerable symbols of `object`.
  6881. *
  6882. * @private
  6883. * @param {Object} object The object to query.
  6884. * @returns {Array} Returns the array of symbols.
  6885. */
  6886. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6887. var result = [];
  6888. while (object) {
  6889. arrayPush(result, getSymbols(object));
  6890. object = getPrototype(object);
  6891. }
  6892. return result;
  6893. };
  6894. /**
  6895. * Gets the `toStringTag` of `value`.
  6896. *
  6897. * @private
  6898. * @param {*} value The value to query.
  6899. * @returns {string} Returns the `toStringTag`.
  6900. */
  6901. var getTag = baseGetTag;
  6902. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6903. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6904. (Map && getTag(new Map) != mapTag) ||
  6905. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6906. (Set && getTag(new Set) != setTag) ||
  6907. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6908. getTag = function(value) {
  6909. var result = baseGetTag(value),
  6910. Ctor = result == objectTag ? value.constructor : undefined,
  6911. ctorString = Ctor ? toSource(Ctor) : '';
  6912. if (ctorString) {
  6913. switch (ctorString) {
  6914. case dataViewCtorString: return dataViewTag;
  6915. case mapCtorString: return mapTag;
  6916. case promiseCtorString: return promiseTag;
  6917. case setCtorString: return setTag;
  6918. case weakMapCtorString: return weakMapTag;
  6919. }
  6920. }
  6921. return result;
  6922. };
  6923. }
  6924. /**
  6925. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6926. *
  6927. * @private
  6928. * @param {number} start The start of the view.
  6929. * @param {number} end The end of the view.
  6930. * @param {Array} transforms The transformations to apply to the view.
  6931. * @returns {Object} Returns an object containing the `start` and `end`
  6932. * positions of the view.
  6933. */
  6934. function getView(start, end, transforms) {
  6935. var index = -1,
  6936. length = transforms.length;
  6937. while (++index < length) {
  6938. var data = transforms[index],
  6939. size = data.size;
  6940. switch (data.type) {
  6941. case 'drop': start += size; break;
  6942. case 'dropRight': end -= size; break;
  6943. case 'take': end = nativeMin(end, start + size); break;
  6944. case 'takeRight': start = nativeMax(start, end - size); break;
  6945. }
  6946. }
  6947. return { 'start': start, 'end': end };
  6948. }
  6949. /**
  6950. * Extracts wrapper details from the `source` body comment.
  6951. *
  6952. * @private
  6953. * @param {string} source The source to inspect.
  6954. * @returns {Array} Returns the wrapper details.
  6955. */
  6956. function getWrapDetails(source) {
  6957. var match = source.match(reWrapDetails);
  6958. return match ? match[1].split(reSplitDetails) : [];
  6959. }
  6960. /**
  6961. * Checks if `path` exists on `object`.
  6962. *
  6963. * @private
  6964. * @param {Object} object The object to query.
  6965. * @param {Array|string} path The path to check.
  6966. * @param {Function} hasFunc The function to check properties.
  6967. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6968. */
  6969. function hasPath(object, path, hasFunc) {
  6970. path = castPath(path, object);
  6971. var index = -1,
  6972. length = path.length,
  6973. result = false;
  6974. while (++index < length) {
  6975. var key = toKey(path[index]);
  6976. if (!(result = object != null && hasFunc(object, key))) {
  6977. break;
  6978. }
  6979. object = object[key];
  6980. }
  6981. if (result || ++index != length) {
  6982. return result;
  6983. }
  6984. length = object == null ? 0 : object.length;
  6985. return !!length && isLength(length) && isIndex(key, length) &&
  6986. (isArray(object) || isArguments(object));
  6987. }
  6988. /**
  6989. * Initializes an array clone.
  6990. *
  6991. * @private
  6992. * @param {Array} array The array to clone.
  6993. * @returns {Array} Returns the initialized clone.
  6994. */
  6995. function initCloneArray(array) {
  6996. var length = array.length,
  6997. result = new array.constructor(length);
  6998. // Add properties assigned by `RegExp#exec`.
  6999. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  7000. result.index = array.index;
  7001. result.input = array.input;
  7002. }
  7003. return result;
  7004. }
  7005. /**
  7006. * Initializes an object clone.
  7007. *
  7008. * @private
  7009. * @param {Object} object The object to clone.
  7010. * @returns {Object} Returns the initialized clone.
  7011. */
  7012. function initCloneObject(object) {
  7013. return (typeof object.constructor == 'function' && !isPrototype(object))
  7014. ? baseCreate(getPrototype(object))
  7015. : {};
  7016. }
  7017. /**
  7018. * Initializes an object clone based on its `toStringTag`.
  7019. *
  7020. * **Note:** This function only supports cloning values with tags of
  7021. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  7022. *
  7023. * @private
  7024. * @param {Object} object The object to clone.
  7025. * @param {string} tag The `toStringTag` of the object to clone.
  7026. * @param {boolean} [isDeep] Specify a deep clone.
  7027. * @returns {Object} Returns the initialized clone.
  7028. */
  7029. function initCloneByTag(object, tag, isDeep) {
  7030. var Ctor = object.constructor;
  7031. switch (tag) {
  7032. case arrayBufferTag:
  7033. return cloneArrayBuffer(object);
  7034. case boolTag:
  7035. case dateTag:
  7036. return new Ctor(+object);
  7037. case dataViewTag:
  7038. return cloneDataView(object, isDeep);
  7039. case float32Tag: case float64Tag:
  7040. case int8Tag: case int16Tag: case int32Tag:
  7041. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  7042. return cloneTypedArray(object, isDeep);
  7043. case mapTag:
  7044. return new Ctor;
  7045. case numberTag:
  7046. case stringTag:
  7047. return new Ctor(object);
  7048. case regexpTag:
  7049. return cloneRegExp(object);
  7050. case setTag:
  7051. return new Ctor;
  7052. case symbolTag:
  7053. return cloneSymbol(object);
  7054. }
  7055. }
  7056. /**
  7057. * Inserts wrapper `details` in a comment at the top of the `source` body.
  7058. *
  7059. * @private
  7060. * @param {string} source The source to modify.
  7061. * @returns {Array} details The details to insert.
  7062. * @returns {string} Returns the modified source.
  7063. */
  7064. function insertWrapDetails(source, details) {
  7065. var length = details.length;
  7066. if (!length) {
  7067. return source;
  7068. }
  7069. var lastIndex = length - 1;
  7070. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  7071. details = details.join(length > 2 ? ', ' : ' ');
  7072. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  7073. }
  7074. /**
  7075. * Checks if `value` is a flattenable `arguments` object or array.
  7076. *
  7077. * @private
  7078. * @param {*} value The value to check.
  7079. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  7080. */
  7081. function isFlattenable(value) {
  7082. return isArray(value) || isArguments(value) ||
  7083. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7084. }
  7085. /**
  7086. * Checks if `value` is a valid array-like index.
  7087. *
  7088. * @private
  7089. * @param {*} value The value to check.
  7090. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7091. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7092. */
  7093. function isIndex(value, length) {
  7094. var type = typeof value;
  7095. length = length == null ? MAX_SAFE_INTEGER : length;
  7096. return !!length &&
  7097. (type == 'number' ||
  7098. (type != 'symbol' && reIsUint.test(value))) &&
  7099. (value > -1 && value % 1 == 0 && value < length);
  7100. }
  7101. /**
  7102. * Checks if the given arguments are from an iteratee call.
  7103. *
  7104. * @private
  7105. * @param {*} value The potential iteratee value argument.
  7106. * @param {*} index The potential iteratee index or key argument.
  7107. * @param {*} object The potential iteratee object argument.
  7108. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7109. * else `false`.
  7110. */
  7111. function isIterateeCall(value, index, object) {
  7112. if (!isObject(object)) {
  7113. return false;
  7114. }
  7115. var type = typeof index;
  7116. if (type == 'number'
  7117. ? (isArrayLike(object) && isIndex(index, object.length))
  7118. : (type == 'string' && index in object)
  7119. ) {
  7120. return eq(object[index], value);
  7121. }
  7122. return false;
  7123. }
  7124. /**
  7125. * Checks if `value` is a property name and not a property path.
  7126. *
  7127. * @private
  7128. * @param {*} value The value to check.
  7129. * @param {Object} [object] The object to query keys on.
  7130. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7131. */
  7132. function isKey(value, object) {
  7133. if (isArray(value)) {
  7134. return false;
  7135. }
  7136. var type = typeof value;
  7137. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7138. value == null || isSymbol(value)) {
  7139. return true;
  7140. }
  7141. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7142. (object != null && value in Object(object));
  7143. }
  7144. /**
  7145. * Checks if `value` is suitable for use as unique object key.
  7146. *
  7147. * @private
  7148. * @param {*} value The value to check.
  7149. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7150. */
  7151. function isKeyable(value) {
  7152. var type = typeof value;
  7153. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7154. ? (value !== '__proto__')
  7155. : (value === null);
  7156. }
  7157. /**
  7158. * Checks if `func` has a lazy counterpart.
  7159. *
  7160. * @private
  7161. * @param {Function} func The function to check.
  7162. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7163. * else `false`.
  7164. */
  7165. function isLaziable(func) {
  7166. var funcName = getFuncName(func),
  7167. other = lodash[funcName];
  7168. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7169. return false;
  7170. }
  7171. if (func === other) {
  7172. return true;
  7173. }
  7174. var data = getData(other);
  7175. return !!data && func === data[0];
  7176. }
  7177. /**
  7178. * Checks if `func` has its source masked.
  7179. *
  7180. * @private
  7181. * @param {Function} func The function to check.
  7182. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7183. */
  7184. function isMasked(func) {
  7185. return !!maskSrcKey && (maskSrcKey in func);
  7186. }
  7187. /**
  7188. * Checks if `func` is capable of being masked.
  7189. *
  7190. * @private
  7191. * @param {*} value The value to check.
  7192. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7193. */
  7194. var isMaskable = coreJsData ? isFunction : stubFalse;
  7195. /**
  7196. * Checks if `value` is likely a prototype object.
  7197. *
  7198. * @private
  7199. * @param {*} value The value to check.
  7200. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7201. */
  7202. function isPrototype(value) {
  7203. var Ctor = value && value.constructor,
  7204. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7205. return value === proto;
  7206. }
  7207. /**
  7208. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7209. *
  7210. * @private
  7211. * @param {*} value The value to check.
  7212. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7213. * equality comparisons, else `false`.
  7214. */
  7215. function isStrictComparable(value) {
  7216. return value === value && !isObject(value);
  7217. }
  7218. /**
  7219. * A specialized version of `matchesProperty` for source values suitable
  7220. * for strict equality comparisons, i.e. `===`.
  7221. *
  7222. * @private
  7223. * @param {string} key The key of the property to get.
  7224. * @param {*} srcValue The value to match.
  7225. * @returns {Function} Returns the new spec function.
  7226. */
  7227. function matchesStrictComparable(key, srcValue) {
  7228. return function(object) {
  7229. if (object == null) {
  7230. return false;
  7231. }
  7232. return object[key] === srcValue &&
  7233. (srcValue !== undefined || (key in Object(object)));
  7234. };
  7235. }
  7236. /**
  7237. * A specialized version of `_.memoize` which clears the memoized function's
  7238. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7239. *
  7240. * @private
  7241. * @param {Function} func The function to have its output memoized.
  7242. * @returns {Function} Returns the new memoized function.
  7243. */
  7244. function memoizeCapped(func) {
  7245. var result = memoize(func, function(key) {
  7246. if (cache.size === MAX_MEMOIZE_SIZE) {
  7247. cache.clear();
  7248. }
  7249. return key;
  7250. });
  7251. var cache = result.cache;
  7252. return result;
  7253. }
  7254. /**
  7255. * Merges the function metadata of `source` into `data`.
  7256. *
  7257. * Merging metadata reduces the number of wrappers used to invoke a function.
  7258. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7259. * may be applied regardless of execution order. Methods like `_.ary` and
  7260. * `_.rearg` modify function arguments, making the order in which they are
  7261. * executed important, preventing the merging of metadata. However, we make
  7262. * an exception for a safe combined case where curried functions have `_.ary`
  7263. * and or `_.rearg` applied.
  7264. *
  7265. * @private
  7266. * @param {Array} data The destination metadata.
  7267. * @param {Array} source The source metadata.
  7268. * @returns {Array} Returns `data`.
  7269. */
  7270. function mergeData(data, source) {
  7271. var bitmask = data[1],
  7272. srcBitmask = source[1],
  7273. newBitmask = bitmask | srcBitmask,
  7274. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7275. var isCombo =
  7276. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7277. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7278. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7279. // Exit early if metadata can't be merged.
  7280. if (!(isCommon || isCombo)) {
  7281. return data;
  7282. }
  7283. // Use source `thisArg` if available.
  7284. if (srcBitmask & WRAP_BIND_FLAG) {
  7285. data[2] = source[2];
  7286. // Set when currying a bound function.
  7287. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7288. }
  7289. // Compose partial arguments.
  7290. var value = source[3];
  7291. if (value) {
  7292. var partials = data[3];
  7293. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7294. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7295. }
  7296. // Compose partial right arguments.
  7297. value = source[5];
  7298. if (value) {
  7299. partials = data[5];
  7300. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7301. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7302. }
  7303. // Use source `argPos` if available.
  7304. value = source[7];
  7305. if (value) {
  7306. data[7] = value;
  7307. }
  7308. // Use source `ary` if it's smaller.
  7309. if (srcBitmask & WRAP_ARY_FLAG) {
  7310. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7311. }
  7312. // Use source `arity` if one is not provided.
  7313. if (data[9] == null) {
  7314. data[9] = source[9];
  7315. }
  7316. // Use source `func` and merge bitmasks.
  7317. data[0] = source[0];
  7318. data[1] = newBitmask;
  7319. return data;
  7320. }
  7321. /**
  7322. * This function is like
  7323. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7324. * except that it includes inherited enumerable properties.
  7325. *
  7326. * @private
  7327. * @param {Object} object The object to query.
  7328. * @returns {Array} Returns the array of property names.
  7329. */
  7330. function nativeKeysIn(object) {
  7331. var result = [];
  7332. if (object != null) {
  7333. for (var key in Object(object)) {
  7334. result.push(key);
  7335. }
  7336. }
  7337. return result;
  7338. }
  7339. /**
  7340. * Converts `value` to a string using `Object.prototype.toString`.
  7341. *
  7342. * @private
  7343. * @param {*} value The value to convert.
  7344. * @returns {string} Returns the converted string.
  7345. */
  7346. function objectToString(value) {
  7347. return nativeObjectToString.call(value);
  7348. }
  7349. /**
  7350. * A specialized version of `baseRest` which transforms the rest array.
  7351. *
  7352. * @private
  7353. * @param {Function} func The function to apply a rest parameter to.
  7354. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7355. * @param {Function} transform The rest array transform.
  7356. * @returns {Function} Returns the new function.
  7357. */
  7358. function overRest(func, start, transform) {
  7359. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7360. return function() {
  7361. var args = arguments,
  7362. index = -1,
  7363. length = nativeMax(args.length - start, 0),
  7364. array = Array(length);
  7365. while (++index < length) {
  7366. array[index] = args[start + index];
  7367. }
  7368. index = -1;
  7369. var otherArgs = Array(start + 1);
  7370. while (++index < start) {
  7371. otherArgs[index] = args[index];
  7372. }
  7373. otherArgs[start] = transform(array);
  7374. return apply(func, this, otherArgs);
  7375. };
  7376. }
  7377. /**
  7378. * Gets the parent value at `path` of `object`.
  7379. *
  7380. * @private
  7381. * @param {Object} object The object to query.
  7382. * @param {Array} path The path to get the parent value of.
  7383. * @returns {*} Returns the parent value.
  7384. */
  7385. function parent(object, path) {
  7386. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7387. }
  7388. /**
  7389. * Reorder `array` according to the specified indexes where the element at
  7390. * the first index is assigned as the first element, the element at
  7391. * the second index is assigned as the second element, and so on.
  7392. *
  7393. * @private
  7394. * @param {Array} array The array to reorder.
  7395. * @param {Array} indexes The arranged array indexes.
  7396. * @returns {Array} Returns `array`.
  7397. */
  7398. function reorder(array, indexes) {
  7399. var arrLength = array.length,
  7400. length = nativeMin(indexes.length, arrLength),
  7401. oldArray = copyArray(array);
  7402. while (length--) {
  7403. var index = indexes[length];
  7404. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7405. }
  7406. return array;
  7407. }
  7408. /**
  7409. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7410. *
  7411. * @private
  7412. * @param {Object} object The object to query.
  7413. * @param {string} key The key of the property to get.
  7414. * @returns {*} Returns the property value.
  7415. */
  7416. function safeGet(object, key) {
  7417. if (key === 'constructor' && typeof object[key] === 'function') {
  7418. return;
  7419. }
  7420. if (key == '__proto__') {
  7421. return;
  7422. }
  7423. return object[key];
  7424. }
  7425. /**
  7426. * Sets metadata for `func`.
  7427. *
  7428. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7429. * period of time, it will trip its breaker and transition to an identity
  7430. * function to avoid garbage collection pauses in V8. See
  7431. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7432. * for more details.
  7433. *
  7434. * @private
  7435. * @param {Function} func The function to associate metadata with.
  7436. * @param {*} data The metadata.
  7437. * @returns {Function} Returns `func`.
  7438. */
  7439. var setData = shortOut(baseSetData);
  7440. /**
  7441. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7442. *
  7443. * @private
  7444. * @param {Function} func The function to delay.
  7445. * @param {number} wait The number of milliseconds to delay invocation.
  7446. * @returns {number|Object} Returns the timer id or timeout object.
  7447. */
  7448. var setTimeout = ctxSetTimeout || function(func, wait) {
  7449. return root.setTimeout(func, wait);
  7450. };
  7451. /**
  7452. * Sets the `toString` method of `func` to return `string`.
  7453. *
  7454. * @private
  7455. * @param {Function} func The function to modify.
  7456. * @param {Function} string The `toString` result.
  7457. * @returns {Function} Returns `func`.
  7458. */
  7459. var setToString = shortOut(baseSetToString);
  7460. /**
  7461. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7462. * with wrapper details in a comment at the top of the source body.
  7463. *
  7464. * @private
  7465. * @param {Function} wrapper The function to modify.
  7466. * @param {Function} reference The reference function.
  7467. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7468. * @returns {Function} Returns `wrapper`.
  7469. */
  7470. function setWrapToString(wrapper, reference, bitmask) {
  7471. var source = (reference + '');
  7472. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7473. }
  7474. /**
  7475. * Creates a function that'll short out and invoke `identity` instead
  7476. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7477. * milliseconds.
  7478. *
  7479. * @private
  7480. * @param {Function} func The function to restrict.
  7481. * @returns {Function} Returns the new shortable function.
  7482. */
  7483. function shortOut(func) {
  7484. var count = 0,
  7485. lastCalled = 0;
  7486. return function() {
  7487. var stamp = nativeNow(),
  7488. remaining = HOT_SPAN - (stamp - lastCalled);
  7489. lastCalled = stamp;
  7490. if (remaining > 0) {
  7491. if (++count >= HOT_COUNT) {
  7492. return arguments[0];
  7493. }
  7494. } else {
  7495. count = 0;
  7496. }
  7497. return func.apply(undefined, arguments);
  7498. };
  7499. }
  7500. /**
  7501. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7502. *
  7503. * @private
  7504. * @param {Array} array The array to shuffle.
  7505. * @param {number} [size=array.length] The size of `array`.
  7506. * @returns {Array} Returns `array`.
  7507. */
  7508. function shuffleSelf(array, size) {
  7509. var index = -1,
  7510. length = array.length,
  7511. lastIndex = length - 1;
  7512. size = size === undefined ? length : size;
  7513. while (++index < size) {
  7514. var rand = baseRandom(index, lastIndex),
  7515. value = array[rand];
  7516. array[rand] = array[index];
  7517. array[index] = value;
  7518. }
  7519. array.length = size;
  7520. return array;
  7521. }
  7522. /**
  7523. * Converts `string` to a property path array.
  7524. *
  7525. * @private
  7526. * @param {string} string The string to convert.
  7527. * @returns {Array} Returns the property path array.
  7528. */
  7529. var stringToPath = memoizeCapped(function(string) {
  7530. var result = [];
  7531. if (string.charCodeAt(0) === 46 /* . */) {
  7532. result.push('');
  7533. }
  7534. string.replace(rePropName, function(match, number, quote, subString) {
  7535. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7536. });
  7537. return result;
  7538. });
  7539. /**
  7540. * Converts `value` to a string key if it's not a string or symbol.
  7541. *
  7542. * @private
  7543. * @param {*} value The value to inspect.
  7544. * @returns {string|symbol} Returns the key.
  7545. */
  7546. function toKey(value) {
  7547. if (typeof value == 'string' || isSymbol(value)) {
  7548. return value;
  7549. }
  7550. var result = (value + '');
  7551. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7552. }
  7553. /**
  7554. * Converts `func` to its source code.
  7555. *
  7556. * @private
  7557. * @param {Function} func The function to convert.
  7558. * @returns {string} Returns the source code.
  7559. */
  7560. function toSource(func) {
  7561. if (func != null) {
  7562. try {
  7563. return funcToString.call(func);
  7564. } catch (e) {}
  7565. try {
  7566. return (func + '');
  7567. } catch (e) {}
  7568. }
  7569. return '';
  7570. }
  7571. /**
  7572. * Updates wrapper `details` based on `bitmask` flags.
  7573. *
  7574. * @private
  7575. * @returns {Array} details The details to modify.
  7576. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7577. * @returns {Array} Returns `details`.
  7578. */
  7579. function updateWrapDetails(details, bitmask) {
  7580. arrayEach(wrapFlags, function(pair) {
  7581. var value = '_.' + pair[0];
  7582. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7583. details.push(value);
  7584. }
  7585. });
  7586. return details.sort();
  7587. }
  7588. /**
  7589. * Creates a clone of `wrapper`.
  7590. *
  7591. * @private
  7592. * @param {Object} wrapper The wrapper to clone.
  7593. * @returns {Object} Returns the cloned wrapper.
  7594. */
  7595. function wrapperClone(wrapper) {
  7596. if (wrapper instanceof LazyWrapper) {
  7597. return wrapper.clone();
  7598. }
  7599. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7600. result.__actions__ = copyArray(wrapper.__actions__);
  7601. result.__index__ = wrapper.__index__;
  7602. result.__values__ = wrapper.__values__;
  7603. return result;
  7604. }
  7605. /*------------------------------------------------------------------------*/
  7606. /**
  7607. * Creates an array of elements split into groups the length of `size`.
  7608. * If `array` can't be split evenly, the final chunk will be the remaining
  7609. * elements.
  7610. *
  7611. * @static
  7612. * @memberOf _
  7613. * @since 3.0.0
  7614. * @category Array
  7615. * @param {Array} array The array to process.
  7616. * @param {number} [size=1] The length of each chunk
  7617. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7618. * @returns {Array} Returns the new array of chunks.
  7619. * @example
  7620. *
  7621. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7622. * // => [['a', 'b'], ['c', 'd']]
  7623. *
  7624. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7625. * // => [['a', 'b', 'c'], ['d']]
  7626. */
  7627. function chunk(array, size, guard) {
  7628. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7629. size = 1;
  7630. } else {
  7631. size = nativeMax(toInteger(size), 0);
  7632. }
  7633. var length = array == null ? 0 : array.length;
  7634. if (!length || size < 1) {
  7635. return [];
  7636. }
  7637. var index = 0,
  7638. resIndex = 0,
  7639. result = Array(nativeCeil(length / size));
  7640. while (index < length) {
  7641. result[resIndex++] = baseSlice(array, index, (index += size));
  7642. }
  7643. return result;
  7644. }
  7645. /**
  7646. * Creates an array with all falsey values removed. The values `false`, `null`,
  7647. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7648. *
  7649. * @static
  7650. * @memberOf _
  7651. * @since 0.1.0
  7652. * @category Array
  7653. * @param {Array} array The array to compact.
  7654. * @returns {Array} Returns the new array of filtered values.
  7655. * @example
  7656. *
  7657. * _.compact([0, 1, false, 2, '', 3]);
  7658. * // => [1, 2, 3]
  7659. */
  7660. function compact(array) {
  7661. var index = -1,
  7662. length = array == null ? 0 : array.length,
  7663. resIndex = 0,
  7664. result = [];
  7665. while (++index < length) {
  7666. var value = array[index];
  7667. if (value) {
  7668. result[resIndex++] = value;
  7669. }
  7670. }
  7671. return result;
  7672. }
  7673. /**
  7674. * Creates a new array concatenating `array` with any additional arrays
  7675. * and/or values.
  7676. *
  7677. * @static
  7678. * @memberOf _
  7679. * @since 4.0.0
  7680. * @category Array
  7681. * @param {Array} array The array to concatenate.
  7682. * @param {...*} [values] The values to concatenate.
  7683. * @returns {Array} Returns the new concatenated array.
  7684. * @example
  7685. *
  7686. * var array = [1];
  7687. * var other = _.concat(array, 2, [3], [[4]]);
  7688. *
  7689. * console.log(other);
  7690. * // => [1, 2, 3, [4]]
  7691. *
  7692. * console.log(array);
  7693. * // => [1]
  7694. */
  7695. function concat() {
  7696. var length = arguments.length;
  7697. if (!length) {
  7698. return [];
  7699. }
  7700. var args = Array(length - 1),
  7701. array = arguments[0],
  7702. index = length;
  7703. while (index--) {
  7704. args[index - 1] = arguments[index];
  7705. }
  7706. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7707. }
  7708. /**
  7709. * Creates an array of `array` values not included in the other given arrays
  7710. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7711. * for equality comparisons. The order and references of result values are
  7712. * determined by the first array.
  7713. *
  7714. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7715. *
  7716. * @static
  7717. * @memberOf _
  7718. * @since 0.1.0
  7719. * @category Array
  7720. * @param {Array} array The array to inspect.
  7721. * @param {...Array} [values] The values to exclude.
  7722. * @returns {Array} Returns the new array of filtered values.
  7723. * @see _.without, _.xor
  7724. * @example
  7725. *
  7726. * _.difference([2, 1], [2, 3]);
  7727. * // => [1]
  7728. */
  7729. var difference = baseRest(function(array, values) {
  7730. return isArrayLikeObject(array)
  7731. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7732. : [];
  7733. });
  7734. /**
  7735. * This method is like `_.difference` except that it accepts `iteratee` which
  7736. * is invoked for each element of `array` and `values` to generate the criterion
  7737. * by which they're compared. The order and references of result values are
  7738. * determined by the first array. The iteratee is invoked with one argument:
  7739. * (value).
  7740. *
  7741. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7742. *
  7743. * @static
  7744. * @memberOf _
  7745. * @since 4.0.0
  7746. * @category Array
  7747. * @param {Array} array The array to inspect.
  7748. * @param {...Array} [values] The values to exclude.
  7749. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7750. * @returns {Array} Returns the new array of filtered values.
  7751. * @example
  7752. *
  7753. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7754. * // => [1.2]
  7755. *
  7756. * // The `_.property` iteratee shorthand.
  7757. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7758. * // => [{ 'x': 2 }]
  7759. */
  7760. var differenceBy = baseRest(function(array, values) {
  7761. var iteratee = last(values);
  7762. if (isArrayLikeObject(iteratee)) {
  7763. iteratee = undefined;
  7764. }
  7765. return isArrayLikeObject(array)
  7766. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7767. : [];
  7768. });
  7769. /**
  7770. * This method is like `_.difference` except that it accepts `comparator`
  7771. * which is invoked to compare elements of `array` to `values`. The order and
  7772. * references of result values are determined by the first array. The comparator
  7773. * is invoked with two arguments: (arrVal, othVal).
  7774. *
  7775. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7776. *
  7777. * @static
  7778. * @memberOf _
  7779. * @since 4.0.0
  7780. * @category Array
  7781. * @param {Array} array The array to inspect.
  7782. * @param {...Array} [values] The values to exclude.
  7783. * @param {Function} [comparator] The comparator invoked per element.
  7784. * @returns {Array} Returns the new array of filtered values.
  7785. * @example
  7786. *
  7787. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7788. *
  7789. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7790. * // => [{ 'x': 2, 'y': 1 }]
  7791. */
  7792. var differenceWith = baseRest(function(array, values) {
  7793. var comparator = last(values);
  7794. if (isArrayLikeObject(comparator)) {
  7795. comparator = undefined;
  7796. }
  7797. return isArrayLikeObject(array)
  7798. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7799. : [];
  7800. });
  7801. /**
  7802. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7803. *
  7804. * @static
  7805. * @memberOf _
  7806. * @since 0.5.0
  7807. * @category Array
  7808. * @param {Array} array The array to query.
  7809. * @param {number} [n=1] The number of elements to drop.
  7810. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7811. * @returns {Array} Returns the slice of `array`.
  7812. * @example
  7813. *
  7814. * _.drop([1, 2, 3]);
  7815. * // => [2, 3]
  7816. *
  7817. * _.drop([1, 2, 3], 2);
  7818. * // => [3]
  7819. *
  7820. * _.drop([1, 2, 3], 5);
  7821. * // => []
  7822. *
  7823. * _.drop([1, 2, 3], 0);
  7824. * // => [1, 2, 3]
  7825. */
  7826. function drop(array, n, guard) {
  7827. var length = array == null ? 0 : array.length;
  7828. if (!length) {
  7829. return [];
  7830. }
  7831. n = (guard || n === undefined) ? 1 : toInteger(n);
  7832. return baseSlice(array, n < 0 ? 0 : n, length);
  7833. }
  7834. /**
  7835. * Creates a slice of `array` with `n` elements dropped from the end.
  7836. *
  7837. * @static
  7838. * @memberOf _
  7839. * @since 3.0.0
  7840. * @category Array
  7841. * @param {Array} array The array to query.
  7842. * @param {number} [n=1] The number of elements to drop.
  7843. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7844. * @returns {Array} Returns the slice of `array`.
  7845. * @example
  7846. *
  7847. * _.dropRight([1, 2, 3]);
  7848. * // => [1, 2]
  7849. *
  7850. * _.dropRight([1, 2, 3], 2);
  7851. * // => [1]
  7852. *
  7853. * _.dropRight([1, 2, 3], 5);
  7854. * // => []
  7855. *
  7856. * _.dropRight([1, 2, 3], 0);
  7857. * // => [1, 2, 3]
  7858. */
  7859. function dropRight(array, n, guard) {
  7860. var length = array == null ? 0 : array.length;
  7861. if (!length) {
  7862. return [];
  7863. }
  7864. n = (guard || n === undefined) ? 1 : toInteger(n);
  7865. n = length - n;
  7866. return baseSlice(array, 0, n < 0 ? 0 : n);
  7867. }
  7868. /**
  7869. * Creates a slice of `array` excluding elements dropped from the end.
  7870. * Elements are dropped until `predicate` returns falsey. The predicate is
  7871. * invoked with three arguments: (value, index, array).
  7872. *
  7873. * @static
  7874. * @memberOf _
  7875. * @since 3.0.0
  7876. * @category Array
  7877. * @param {Array} array The array to query.
  7878. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7879. * @returns {Array} Returns the slice of `array`.
  7880. * @example
  7881. *
  7882. * var users = [
  7883. * { 'user': 'barney', 'active': true },
  7884. * { 'user': 'fred', 'active': false },
  7885. * { 'user': 'pebbles', 'active': false }
  7886. * ];
  7887. *
  7888. * _.dropRightWhile(users, function(o) { return !o.active; });
  7889. * // => objects for ['barney']
  7890. *
  7891. * // The `_.matches` iteratee shorthand.
  7892. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7893. * // => objects for ['barney', 'fred']
  7894. *
  7895. * // The `_.matchesProperty` iteratee shorthand.
  7896. * _.dropRightWhile(users, ['active', false]);
  7897. * // => objects for ['barney']
  7898. *
  7899. * // The `_.property` iteratee shorthand.
  7900. * _.dropRightWhile(users, 'active');
  7901. * // => objects for ['barney', 'fred', 'pebbles']
  7902. */
  7903. function dropRightWhile(array, predicate) {
  7904. return (array && array.length)
  7905. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7906. : [];
  7907. }
  7908. /**
  7909. * Creates a slice of `array` excluding elements dropped from the beginning.
  7910. * Elements are dropped until `predicate` returns falsey. The predicate is
  7911. * invoked with three arguments: (value, index, array).
  7912. *
  7913. * @static
  7914. * @memberOf _
  7915. * @since 3.0.0
  7916. * @category Array
  7917. * @param {Array} array The array to query.
  7918. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7919. * @returns {Array} Returns the slice of `array`.
  7920. * @example
  7921. *
  7922. * var users = [
  7923. * { 'user': 'barney', 'active': false },
  7924. * { 'user': 'fred', 'active': false },
  7925. * { 'user': 'pebbles', 'active': true }
  7926. * ];
  7927. *
  7928. * _.dropWhile(users, function(o) { return !o.active; });
  7929. * // => objects for ['pebbles']
  7930. *
  7931. * // The `_.matches` iteratee shorthand.
  7932. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7933. * // => objects for ['fred', 'pebbles']
  7934. *
  7935. * // The `_.matchesProperty` iteratee shorthand.
  7936. * _.dropWhile(users, ['active', false]);
  7937. * // => objects for ['pebbles']
  7938. *
  7939. * // The `_.property` iteratee shorthand.
  7940. * _.dropWhile(users, 'active');
  7941. * // => objects for ['barney', 'fred', 'pebbles']
  7942. */
  7943. function dropWhile(array, predicate) {
  7944. return (array && array.length)
  7945. ? baseWhile(array, getIteratee(predicate, 3), true)
  7946. : [];
  7947. }
  7948. /**
  7949. * Fills elements of `array` with `value` from `start` up to, but not
  7950. * including, `end`.
  7951. *
  7952. * **Note:** This method mutates `array`.
  7953. *
  7954. * @static
  7955. * @memberOf _
  7956. * @since 3.2.0
  7957. * @category Array
  7958. * @param {Array} array The array to fill.
  7959. * @param {*} value The value to fill `array` with.
  7960. * @param {number} [start=0] The start position.
  7961. * @param {number} [end=array.length] The end position.
  7962. * @returns {Array} Returns `array`.
  7963. * @example
  7964. *
  7965. * var array = [1, 2, 3];
  7966. *
  7967. * _.fill(array, 'a');
  7968. * console.log(array);
  7969. * // => ['a', 'a', 'a']
  7970. *
  7971. * _.fill(Array(3), 2);
  7972. * // => [2, 2, 2]
  7973. *
  7974. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7975. * // => [4, '*', '*', 10]
  7976. */
  7977. function fill(array, value, start, end) {
  7978. var length = array == null ? 0 : array.length;
  7979. if (!length) {
  7980. return [];
  7981. }
  7982. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7983. start = 0;
  7984. end = length;
  7985. }
  7986. return baseFill(array, value, start, end);
  7987. }
  7988. /**
  7989. * This method is like `_.find` except that it returns the index of the first
  7990. * element `predicate` returns truthy for instead of the element itself.
  7991. *
  7992. * @static
  7993. * @memberOf _
  7994. * @since 1.1.0
  7995. * @category Array
  7996. * @param {Array} array The array to inspect.
  7997. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7998. * @param {number} [fromIndex=0] The index to search from.
  7999. * @returns {number} Returns the index of the found element, else `-1`.
  8000. * @example
  8001. *
  8002. * var users = [
  8003. * { 'user': 'barney', 'active': false },
  8004. * { 'user': 'fred', 'active': false },
  8005. * { 'user': 'pebbles', 'active': true }
  8006. * ];
  8007. *
  8008. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  8009. * // => 0
  8010. *
  8011. * // The `_.matches` iteratee shorthand.
  8012. * _.findIndex(users, { 'user': 'fred', 'active': false });
  8013. * // => 1
  8014. *
  8015. * // The `_.matchesProperty` iteratee shorthand.
  8016. * _.findIndex(users, ['active', false]);
  8017. * // => 0
  8018. *
  8019. * // The `_.property` iteratee shorthand.
  8020. * _.findIndex(users, 'active');
  8021. * // => 2
  8022. */
  8023. function findIndex(array, predicate, fromIndex) {
  8024. var length = array == null ? 0 : array.length;
  8025. if (!length) {
  8026. return -1;
  8027. }
  8028. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8029. if (index < 0) {
  8030. index = nativeMax(length + index, 0);
  8031. }
  8032. return baseFindIndex(array, getIteratee(predicate, 3), index);
  8033. }
  8034. /**
  8035. * This method is like `_.findIndex` except that it iterates over elements
  8036. * of `collection` from right to left.
  8037. *
  8038. * @static
  8039. * @memberOf _
  8040. * @since 2.0.0
  8041. * @category Array
  8042. * @param {Array} array The array to inspect.
  8043. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8044. * @param {number} [fromIndex=array.length-1] The index to search from.
  8045. * @returns {number} Returns the index of the found element, else `-1`.
  8046. * @example
  8047. *
  8048. * var users = [
  8049. * { 'user': 'barney', 'active': true },
  8050. * { 'user': 'fred', 'active': false },
  8051. * { 'user': 'pebbles', 'active': false }
  8052. * ];
  8053. *
  8054. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  8055. * // => 2
  8056. *
  8057. * // The `_.matches` iteratee shorthand.
  8058. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  8059. * // => 0
  8060. *
  8061. * // The `_.matchesProperty` iteratee shorthand.
  8062. * _.findLastIndex(users, ['active', false]);
  8063. * // => 2
  8064. *
  8065. * // The `_.property` iteratee shorthand.
  8066. * _.findLastIndex(users, 'active');
  8067. * // => 0
  8068. */
  8069. function findLastIndex(array, predicate, fromIndex) {
  8070. var length = array == null ? 0 : array.length;
  8071. if (!length) {
  8072. return -1;
  8073. }
  8074. var index = length - 1;
  8075. if (fromIndex !== undefined) {
  8076. index = toInteger(fromIndex);
  8077. index = fromIndex < 0
  8078. ? nativeMax(length + index, 0)
  8079. : nativeMin(index, length - 1);
  8080. }
  8081. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8082. }
  8083. /**
  8084. * Flattens `array` a single level deep.
  8085. *
  8086. * @static
  8087. * @memberOf _
  8088. * @since 0.1.0
  8089. * @category Array
  8090. * @param {Array} array The array to flatten.
  8091. * @returns {Array} Returns the new flattened array.
  8092. * @example
  8093. *
  8094. * _.flatten([1, [2, [3, [4]], 5]]);
  8095. * // => [1, 2, [3, [4]], 5]
  8096. */
  8097. function flatten(array) {
  8098. var length = array == null ? 0 : array.length;
  8099. return length ? baseFlatten(array, 1) : [];
  8100. }
  8101. /**
  8102. * Recursively flattens `array`.
  8103. *
  8104. * @static
  8105. * @memberOf _
  8106. * @since 3.0.0
  8107. * @category Array
  8108. * @param {Array} array The array to flatten.
  8109. * @returns {Array} Returns the new flattened array.
  8110. * @example
  8111. *
  8112. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8113. * // => [1, 2, 3, 4, 5]
  8114. */
  8115. function flattenDeep(array) {
  8116. var length = array == null ? 0 : array.length;
  8117. return length ? baseFlatten(array, INFINITY) : [];
  8118. }
  8119. /**
  8120. * Recursively flatten `array` up to `depth` times.
  8121. *
  8122. * @static
  8123. * @memberOf _
  8124. * @since 4.4.0
  8125. * @category Array
  8126. * @param {Array} array The array to flatten.
  8127. * @param {number} [depth=1] The maximum recursion depth.
  8128. * @returns {Array} Returns the new flattened array.
  8129. * @example
  8130. *
  8131. * var array = [1, [2, [3, [4]], 5]];
  8132. *
  8133. * _.flattenDepth(array, 1);
  8134. * // => [1, 2, [3, [4]], 5]
  8135. *
  8136. * _.flattenDepth(array, 2);
  8137. * // => [1, 2, 3, [4], 5]
  8138. */
  8139. function flattenDepth(array, depth) {
  8140. var length = array == null ? 0 : array.length;
  8141. if (!length) {
  8142. return [];
  8143. }
  8144. depth = depth === undefined ? 1 : toInteger(depth);
  8145. return baseFlatten(array, depth);
  8146. }
  8147. /**
  8148. * The inverse of `_.toPairs`; this method returns an object composed
  8149. * from key-value `pairs`.
  8150. *
  8151. * @static
  8152. * @memberOf _
  8153. * @since 4.0.0
  8154. * @category Array
  8155. * @param {Array} pairs The key-value pairs.
  8156. * @returns {Object} Returns the new object.
  8157. * @example
  8158. *
  8159. * _.fromPairs([['a', 1], ['b', 2]]);
  8160. * // => { 'a': 1, 'b': 2 }
  8161. */
  8162. function fromPairs(pairs) {
  8163. var index = -1,
  8164. length = pairs == null ? 0 : pairs.length,
  8165. result = {};
  8166. while (++index < length) {
  8167. var pair = pairs[index];
  8168. result[pair[0]] = pair[1];
  8169. }
  8170. return result;
  8171. }
  8172. /**
  8173. * Gets the first element of `array`.
  8174. *
  8175. * @static
  8176. * @memberOf _
  8177. * @since 0.1.0
  8178. * @alias first
  8179. * @category Array
  8180. * @param {Array} array The array to query.
  8181. * @returns {*} Returns the first element of `array`.
  8182. * @example
  8183. *
  8184. * _.head([1, 2, 3]);
  8185. * // => 1
  8186. *
  8187. * _.head([]);
  8188. * // => undefined
  8189. */
  8190. function head(array) {
  8191. return (array && array.length) ? array[0] : undefined;
  8192. }
  8193. /**
  8194. * Gets the index at which the first occurrence of `value` is found in `array`
  8195. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8196. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8197. * offset from the end of `array`.
  8198. *
  8199. * @static
  8200. * @memberOf _
  8201. * @since 0.1.0
  8202. * @category Array
  8203. * @param {Array} array The array to inspect.
  8204. * @param {*} value The value to search for.
  8205. * @param {number} [fromIndex=0] The index to search from.
  8206. * @returns {number} Returns the index of the matched value, else `-1`.
  8207. * @example
  8208. *
  8209. * _.indexOf([1, 2, 1, 2], 2);
  8210. * // => 1
  8211. *
  8212. * // Search from the `fromIndex`.
  8213. * _.indexOf([1, 2, 1, 2], 2, 2);
  8214. * // => 3
  8215. */
  8216. function indexOf(array, value, fromIndex) {
  8217. var length = array == null ? 0 : array.length;
  8218. if (!length) {
  8219. return -1;
  8220. }
  8221. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8222. if (index < 0) {
  8223. index = nativeMax(length + index, 0);
  8224. }
  8225. return baseIndexOf(array, value, index);
  8226. }
  8227. /**
  8228. * Gets all but the last element of `array`.
  8229. *
  8230. * @static
  8231. * @memberOf _
  8232. * @since 0.1.0
  8233. * @category Array
  8234. * @param {Array} array The array to query.
  8235. * @returns {Array} Returns the slice of `array`.
  8236. * @example
  8237. *
  8238. * _.initial([1, 2, 3]);
  8239. * // => [1, 2]
  8240. */
  8241. function initial(array) {
  8242. var length = array == null ? 0 : array.length;
  8243. return length ? baseSlice(array, 0, -1) : [];
  8244. }
  8245. /**
  8246. * Creates an array of unique values that are included in all given arrays
  8247. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8248. * for equality comparisons. The order and references of result values are
  8249. * determined by the first array.
  8250. *
  8251. * @static
  8252. * @memberOf _
  8253. * @since 0.1.0
  8254. * @category Array
  8255. * @param {...Array} [arrays] The arrays to inspect.
  8256. * @returns {Array} Returns the new array of intersecting values.
  8257. * @example
  8258. *
  8259. * _.intersection([2, 1], [2, 3]);
  8260. * // => [2]
  8261. */
  8262. var intersection = baseRest(function(arrays) {
  8263. var mapped = arrayMap(arrays, castArrayLikeObject);
  8264. return (mapped.length && mapped[0] === arrays[0])
  8265. ? baseIntersection(mapped)
  8266. : [];
  8267. });
  8268. /**
  8269. * This method is like `_.intersection` except that it accepts `iteratee`
  8270. * which is invoked for each element of each `arrays` to generate the criterion
  8271. * by which they're compared. The order and references of result values are
  8272. * determined by the first array. The iteratee is invoked with one argument:
  8273. * (value).
  8274. *
  8275. * @static
  8276. * @memberOf _
  8277. * @since 4.0.0
  8278. * @category Array
  8279. * @param {...Array} [arrays] The arrays to inspect.
  8280. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8281. * @returns {Array} Returns the new array of intersecting values.
  8282. * @example
  8283. *
  8284. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8285. * // => [2.1]
  8286. *
  8287. * // The `_.property` iteratee shorthand.
  8288. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8289. * // => [{ 'x': 1 }]
  8290. */
  8291. var intersectionBy = baseRest(function(arrays) {
  8292. var iteratee = last(arrays),
  8293. mapped = arrayMap(arrays, castArrayLikeObject);
  8294. if (iteratee === last(mapped)) {
  8295. iteratee = undefined;
  8296. } else {
  8297. mapped.pop();
  8298. }
  8299. return (mapped.length && mapped[0] === arrays[0])
  8300. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8301. : [];
  8302. });
  8303. /**
  8304. * This method is like `_.intersection` except that it accepts `comparator`
  8305. * which is invoked to compare elements of `arrays`. The order and references
  8306. * of result values are determined by the first array. The comparator is
  8307. * invoked with two arguments: (arrVal, othVal).
  8308. *
  8309. * @static
  8310. * @memberOf _
  8311. * @since 4.0.0
  8312. * @category Array
  8313. * @param {...Array} [arrays] The arrays to inspect.
  8314. * @param {Function} [comparator] The comparator invoked per element.
  8315. * @returns {Array} Returns the new array of intersecting values.
  8316. * @example
  8317. *
  8318. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8319. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8320. *
  8321. * _.intersectionWith(objects, others, _.isEqual);
  8322. * // => [{ 'x': 1, 'y': 2 }]
  8323. */
  8324. var intersectionWith = baseRest(function(arrays) {
  8325. var comparator = last(arrays),
  8326. mapped = arrayMap(arrays, castArrayLikeObject);
  8327. comparator = typeof comparator == 'function' ? comparator : undefined;
  8328. if (comparator) {
  8329. mapped.pop();
  8330. }
  8331. return (mapped.length && mapped[0] === arrays[0])
  8332. ? baseIntersection(mapped, undefined, comparator)
  8333. : [];
  8334. });
  8335. /**
  8336. * Converts all elements in `array` into a string separated by `separator`.
  8337. *
  8338. * @static
  8339. * @memberOf _
  8340. * @since 4.0.0
  8341. * @category Array
  8342. * @param {Array} array The array to convert.
  8343. * @param {string} [separator=','] The element separator.
  8344. * @returns {string} Returns the joined string.
  8345. * @example
  8346. *
  8347. * _.join(['a', 'b', 'c'], '~');
  8348. * // => 'a~b~c'
  8349. */
  8350. function join(array, separator) {
  8351. return array == null ? '' : nativeJoin.call(array, separator);
  8352. }
  8353. /**
  8354. * Gets the last element of `array`.
  8355. *
  8356. * @static
  8357. * @memberOf _
  8358. * @since 0.1.0
  8359. * @category Array
  8360. * @param {Array} array The array to query.
  8361. * @returns {*} Returns the last element of `array`.
  8362. * @example
  8363. *
  8364. * _.last([1, 2, 3]);
  8365. * // => 3
  8366. */
  8367. function last(array) {
  8368. var length = array == null ? 0 : array.length;
  8369. return length ? array[length - 1] : undefined;
  8370. }
  8371. /**
  8372. * This method is like `_.indexOf` except that it iterates over elements of
  8373. * `array` from right to left.
  8374. *
  8375. * @static
  8376. * @memberOf _
  8377. * @since 0.1.0
  8378. * @category Array
  8379. * @param {Array} array The array to inspect.
  8380. * @param {*} value The value to search for.
  8381. * @param {number} [fromIndex=array.length-1] The index to search from.
  8382. * @returns {number} Returns the index of the matched value, else `-1`.
  8383. * @example
  8384. *
  8385. * _.lastIndexOf([1, 2, 1, 2], 2);
  8386. * // => 3
  8387. *
  8388. * // Search from the `fromIndex`.
  8389. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8390. * // => 1
  8391. */
  8392. function lastIndexOf(array, value, fromIndex) {
  8393. var length = array == null ? 0 : array.length;
  8394. if (!length) {
  8395. return -1;
  8396. }
  8397. var index = length;
  8398. if (fromIndex !== undefined) {
  8399. index = toInteger(fromIndex);
  8400. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8401. }
  8402. return value === value
  8403. ? strictLastIndexOf(array, value, index)
  8404. : baseFindIndex(array, baseIsNaN, index, true);
  8405. }
  8406. /**
  8407. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8408. * element from the end is returned.
  8409. *
  8410. * @static
  8411. * @memberOf _
  8412. * @since 4.11.0
  8413. * @category Array
  8414. * @param {Array} array The array to query.
  8415. * @param {number} [n=0] The index of the element to return.
  8416. * @returns {*} Returns the nth element of `array`.
  8417. * @example
  8418. *
  8419. * var array = ['a', 'b', 'c', 'd'];
  8420. *
  8421. * _.nth(array, 1);
  8422. * // => 'b'
  8423. *
  8424. * _.nth(array, -2);
  8425. * // => 'c';
  8426. */
  8427. function nth(array, n) {
  8428. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8429. }
  8430. /**
  8431. * Removes all given values from `array` using
  8432. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8433. * for equality comparisons.
  8434. *
  8435. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8436. * to remove elements from an array by predicate.
  8437. *
  8438. * @static
  8439. * @memberOf _
  8440. * @since 2.0.0
  8441. * @category Array
  8442. * @param {Array} array The array to modify.
  8443. * @param {...*} [values] The values to remove.
  8444. * @returns {Array} Returns `array`.
  8445. * @example
  8446. *
  8447. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8448. *
  8449. * _.pull(array, 'a', 'c');
  8450. * console.log(array);
  8451. * // => ['b', 'b']
  8452. */
  8453. var pull = baseRest(pullAll);
  8454. /**
  8455. * This method is like `_.pull` except that it accepts an array of values to remove.
  8456. *
  8457. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8458. *
  8459. * @static
  8460. * @memberOf _
  8461. * @since 4.0.0
  8462. * @category Array
  8463. * @param {Array} array The array to modify.
  8464. * @param {Array} values The values to remove.
  8465. * @returns {Array} Returns `array`.
  8466. * @example
  8467. *
  8468. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8469. *
  8470. * _.pullAll(array, ['a', 'c']);
  8471. * console.log(array);
  8472. * // => ['b', 'b']
  8473. */
  8474. function pullAll(array, values) {
  8475. return (array && array.length && values && values.length)
  8476. ? basePullAll(array, values)
  8477. : array;
  8478. }
  8479. /**
  8480. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8481. * invoked for each element of `array` and `values` to generate the criterion
  8482. * by which they're compared. The iteratee is invoked with one argument: (value).
  8483. *
  8484. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8485. *
  8486. * @static
  8487. * @memberOf _
  8488. * @since 4.0.0
  8489. * @category Array
  8490. * @param {Array} array The array to modify.
  8491. * @param {Array} values The values to remove.
  8492. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8493. * @returns {Array} Returns `array`.
  8494. * @example
  8495. *
  8496. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8497. *
  8498. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8499. * console.log(array);
  8500. * // => [{ 'x': 2 }]
  8501. */
  8502. function pullAllBy(array, values, iteratee) {
  8503. return (array && array.length && values && values.length)
  8504. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8505. : array;
  8506. }
  8507. /**
  8508. * This method is like `_.pullAll` except that it accepts `comparator` which
  8509. * is invoked to compare elements of `array` to `values`. The comparator is
  8510. * invoked with two arguments: (arrVal, othVal).
  8511. *
  8512. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8513. *
  8514. * @static
  8515. * @memberOf _
  8516. * @since 4.6.0
  8517. * @category Array
  8518. * @param {Array} array The array to modify.
  8519. * @param {Array} values The values to remove.
  8520. * @param {Function} [comparator] The comparator invoked per element.
  8521. * @returns {Array} Returns `array`.
  8522. * @example
  8523. *
  8524. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8525. *
  8526. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8527. * console.log(array);
  8528. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8529. */
  8530. function pullAllWith(array, values, comparator) {
  8531. return (array && array.length && values && values.length)
  8532. ? basePullAll(array, values, undefined, comparator)
  8533. : array;
  8534. }
  8535. /**
  8536. * Removes elements from `array` corresponding to `indexes` and returns an
  8537. * array of removed elements.
  8538. *
  8539. * **Note:** Unlike `_.at`, this method mutates `array`.
  8540. *
  8541. * @static
  8542. * @memberOf _
  8543. * @since 3.0.0
  8544. * @category Array
  8545. * @param {Array} array The array to modify.
  8546. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8547. * @returns {Array} Returns the new array of removed elements.
  8548. * @example
  8549. *
  8550. * var array = ['a', 'b', 'c', 'd'];
  8551. * var pulled = _.pullAt(array, [1, 3]);
  8552. *
  8553. * console.log(array);
  8554. * // => ['a', 'c']
  8555. *
  8556. * console.log(pulled);
  8557. * // => ['b', 'd']
  8558. */
  8559. var pullAt = flatRest(function(array, indexes) {
  8560. var length = array == null ? 0 : array.length,
  8561. result = baseAt(array, indexes);
  8562. basePullAt(array, arrayMap(indexes, function(index) {
  8563. return isIndex(index, length) ? +index : index;
  8564. }).sort(compareAscending));
  8565. return result;
  8566. });
  8567. /**
  8568. * Removes all elements from `array` that `predicate` returns truthy for
  8569. * and returns an array of the removed elements. The predicate is invoked
  8570. * with three arguments: (value, index, array).
  8571. *
  8572. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8573. * to pull elements from an array by value.
  8574. *
  8575. * @static
  8576. * @memberOf _
  8577. * @since 2.0.0
  8578. * @category Array
  8579. * @param {Array} array The array to modify.
  8580. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8581. * @returns {Array} Returns the new array of removed elements.
  8582. * @example
  8583. *
  8584. * var array = [1, 2, 3, 4];
  8585. * var evens = _.remove(array, function(n) {
  8586. * return n % 2 == 0;
  8587. * });
  8588. *
  8589. * console.log(array);
  8590. * // => [1, 3]
  8591. *
  8592. * console.log(evens);
  8593. * // => [2, 4]
  8594. */
  8595. function remove(array, predicate) {
  8596. var result = [];
  8597. if (!(array && array.length)) {
  8598. return result;
  8599. }
  8600. var index = -1,
  8601. indexes = [],
  8602. length = array.length;
  8603. predicate = getIteratee(predicate, 3);
  8604. while (++index < length) {
  8605. var value = array[index];
  8606. if (predicate(value, index, array)) {
  8607. result.push(value);
  8608. indexes.push(index);
  8609. }
  8610. }
  8611. basePullAt(array, indexes);
  8612. return result;
  8613. }
  8614. /**
  8615. * Reverses `array` so that the first element becomes the last, the second
  8616. * element becomes the second to last, and so on.
  8617. *
  8618. * **Note:** This method mutates `array` and is based on
  8619. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8620. *
  8621. * @static
  8622. * @memberOf _
  8623. * @since 4.0.0
  8624. * @category Array
  8625. * @param {Array} array The array to modify.
  8626. * @returns {Array} Returns `array`.
  8627. * @example
  8628. *
  8629. * var array = [1, 2, 3];
  8630. *
  8631. * _.reverse(array);
  8632. * // => [3, 2, 1]
  8633. *
  8634. * console.log(array);
  8635. * // => [3, 2, 1]
  8636. */
  8637. function reverse(array) {
  8638. return array == null ? array : nativeReverse.call(array);
  8639. }
  8640. /**
  8641. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8642. *
  8643. * **Note:** This method is used instead of
  8644. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8645. * returned.
  8646. *
  8647. * @static
  8648. * @memberOf _
  8649. * @since 3.0.0
  8650. * @category Array
  8651. * @param {Array} array The array to slice.
  8652. * @param {number} [start=0] The start position.
  8653. * @param {number} [end=array.length] The end position.
  8654. * @returns {Array} Returns the slice of `array`.
  8655. */
  8656. function slice(array, start, end) {
  8657. var length = array == null ? 0 : array.length;
  8658. if (!length) {
  8659. return [];
  8660. }
  8661. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8662. start = 0;
  8663. end = length;
  8664. }
  8665. else {
  8666. start = start == null ? 0 : toInteger(start);
  8667. end = end === undefined ? length : toInteger(end);
  8668. }
  8669. return baseSlice(array, start, end);
  8670. }
  8671. /**
  8672. * Uses a binary search to determine the lowest index at which `value`
  8673. * should be inserted into `array` in order to maintain its sort order.
  8674. *
  8675. * @static
  8676. * @memberOf _
  8677. * @since 0.1.0
  8678. * @category Array
  8679. * @param {Array} array The sorted array to inspect.
  8680. * @param {*} value The value to evaluate.
  8681. * @returns {number} Returns the index at which `value` should be inserted
  8682. * into `array`.
  8683. * @example
  8684. *
  8685. * _.sortedIndex([30, 50], 40);
  8686. * // => 1
  8687. */
  8688. function sortedIndex(array, value) {
  8689. return baseSortedIndex(array, value);
  8690. }
  8691. /**
  8692. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8693. * which is invoked for `value` and each element of `array` to compute their
  8694. * sort ranking. The iteratee is invoked with one argument: (value).
  8695. *
  8696. * @static
  8697. * @memberOf _
  8698. * @since 4.0.0
  8699. * @category Array
  8700. * @param {Array} array The sorted array to inspect.
  8701. * @param {*} value The value to evaluate.
  8702. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8703. * @returns {number} Returns the index at which `value` should be inserted
  8704. * into `array`.
  8705. * @example
  8706. *
  8707. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8708. *
  8709. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8710. * // => 0
  8711. *
  8712. * // The `_.property` iteratee shorthand.
  8713. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8714. * // => 0
  8715. */
  8716. function sortedIndexBy(array, value, iteratee) {
  8717. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8718. }
  8719. /**
  8720. * This method is like `_.indexOf` except that it performs a binary
  8721. * search on a sorted `array`.
  8722. *
  8723. * @static
  8724. * @memberOf _
  8725. * @since 4.0.0
  8726. * @category Array
  8727. * @param {Array} array The array to inspect.
  8728. * @param {*} value The value to search for.
  8729. * @returns {number} Returns the index of the matched value, else `-1`.
  8730. * @example
  8731. *
  8732. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8733. * // => 1
  8734. */
  8735. function sortedIndexOf(array, value) {
  8736. var length = array == null ? 0 : array.length;
  8737. if (length) {
  8738. var index = baseSortedIndex(array, value);
  8739. if (index < length && eq(array[index], value)) {
  8740. return index;
  8741. }
  8742. }
  8743. return -1;
  8744. }
  8745. /**
  8746. * This method is like `_.sortedIndex` except that it returns the highest
  8747. * index at which `value` should be inserted into `array` in order to
  8748. * maintain its sort order.
  8749. *
  8750. * @static
  8751. * @memberOf _
  8752. * @since 3.0.0
  8753. * @category Array
  8754. * @param {Array} array The sorted array to inspect.
  8755. * @param {*} value The value to evaluate.
  8756. * @returns {number} Returns the index at which `value` should be inserted
  8757. * into `array`.
  8758. * @example
  8759. *
  8760. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8761. * // => 4
  8762. */
  8763. function sortedLastIndex(array, value) {
  8764. return baseSortedIndex(array, value, true);
  8765. }
  8766. /**
  8767. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8768. * which is invoked for `value` and each element of `array` to compute their
  8769. * sort ranking. The iteratee is invoked with one argument: (value).
  8770. *
  8771. * @static
  8772. * @memberOf _
  8773. * @since 4.0.0
  8774. * @category Array
  8775. * @param {Array} array The sorted array to inspect.
  8776. * @param {*} value The value to evaluate.
  8777. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8778. * @returns {number} Returns the index at which `value` should be inserted
  8779. * into `array`.
  8780. * @example
  8781. *
  8782. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8783. *
  8784. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8785. * // => 1
  8786. *
  8787. * // The `_.property` iteratee shorthand.
  8788. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8789. * // => 1
  8790. */
  8791. function sortedLastIndexBy(array, value, iteratee) {
  8792. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8793. }
  8794. /**
  8795. * This method is like `_.lastIndexOf` except that it performs a binary
  8796. * search on a sorted `array`.
  8797. *
  8798. * @static
  8799. * @memberOf _
  8800. * @since 4.0.0
  8801. * @category Array
  8802. * @param {Array} array The array to inspect.
  8803. * @param {*} value The value to search for.
  8804. * @returns {number} Returns the index of the matched value, else `-1`.
  8805. * @example
  8806. *
  8807. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8808. * // => 3
  8809. */
  8810. function sortedLastIndexOf(array, value) {
  8811. var length = array == null ? 0 : array.length;
  8812. if (length) {
  8813. var index = baseSortedIndex(array, value, true) - 1;
  8814. if (eq(array[index], value)) {
  8815. return index;
  8816. }
  8817. }
  8818. return -1;
  8819. }
  8820. /**
  8821. * This method is like `_.uniq` except that it's designed and optimized
  8822. * for sorted arrays.
  8823. *
  8824. * @static
  8825. * @memberOf _
  8826. * @since 4.0.0
  8827. * @category Array
  8828. * @param {Array} array The array to inspect.
  8829. * @returns {Array} Returns the new duplicate free array.
  8830. * @example
  8831. *
  8832. * _.sortedUniq([1, 1, 2]);
  8833. * // => [1, 2]
  8834. */
  8835. function sortedUniq(array) {
  8836. return (array && array.length)
  8837. ? baseSortedUniq(array)
  8838. : [];
  8839. }
  8840. /**
  8841. * This method is like `_.uniqBy` except that it's designed and optimized
  8842. * for sorted arrays.
  8843. *
  8844. * @static
  8845. * @memberOf _
  8846. * @since 4.0.0
  8847. * @category Array
  8848. * @param {Array} array The array to inspect.
  8849. * @param {Function} [iteratee] The iteratee invoked per element.
  8850. * @returns {Array} Returns the new duplicate free array.
  8851. * @example
  8852. *
  8853. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8854. * // => [1.1, 2.3]
  8855. */
  8856. function sortedUniqBy(array, iteratee) {
  8857. return (array && array.length)
  8858. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8859. : [];
  8860. }
  8861. /**
  8862. * Gets all but the first element of `array`.
  8863. *
  8864. * @static
  8865. * @memberOf _
  8866. * @since 4.0.0
  8867. * @category Array
  8868. * @param {Array} array The array to query.
  8869. * @returns {Array} Returns the slice of `array`.
  8870. * @example
  8871. *
  8872. * _.tail([1, 2, 3]);
  8873. * // => [2, 3]
  8874. */
  8875. function tail(array) {
  8876. var length = array == null ? 0 : array.length;
  8877. return length ? baseSlice(array, 1, length) : [];
  8878. }
  8879. /**
  8880. * Creates a slice of `array` with `n` elements taken from the beginning.
  8881. *
  8882. * @static
  8883. * @memberOf _
  8884. * @since 0.1.0
  8885. * @category Array
  8886. * @param {Array} array The array to query.
  8887. * @param {number} [n=1] The number of elements to take.
  8888. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8889. * @returns {Array} Returns the slice of `array`.
  8890. * @example
  8891. *
  8892. * _.take([1, 2, 3]);
  8893. * // => [1]
  8894. *
  8895. * _.take([1, 2, 3], 2);
  8896. * // => [1, 2]
  8897. *
  8898. * _.take([1, 2, 3], 5);
  8899. * // => [1, 2, 3]
  8900. *
  8901. * _.take([1, 2, 3], 0);
  8902. * // => []
  8903. */
  8904. function take(array, n, guard) {
  8905. if (!(array && array.length)) {
  8906. return [];
  8907. }
  8908. n = (guard || n === undefined) ? 1 : toInteger(n);
  8909. return baseSlice(array, 0, n < 0 ? 0 : n);
  8910. }
  8911. /**
  8912. * Creates a slice of `array` with `n` elements taken from the end.
  8913. *
  8914. * @static
  8915. * @memberOf _
  8916. * @since 3.0.0
  8917. * @category Array
  8918. * @param {Array} array The array to query.
  8919. * @param {number} [n=1] The number of elements to take.
  8920. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8921. * @returns {Array} Returns the slice of `array`.
  8922. * @example
  8923. *
  8924. * _.takeRight([1, 2, 3]);
  8925. * // => [3]
  8926. *
  8927. * _.takeRight([1, 2, 3], 2);
  8928. * // => [2, 3]
  8929. *
  8930. * _.takeRight([1, 2, 3], 5);
  8931. * // => [1, 2, 3]
  8932. *
  8933. * _.takeRight([1, 2, 3], 0);
  8934. * // => []
  8935. */
  8936. function takeRight(array, n, guard) {
  8937. var length = array == null ? 0 : array.length;
  8938. if (!length) {
  8939. return [];
  8940. }
  8941. n = (guard || n === undefined) ? 1 : toInteger(n);
  8942. n = length - n;
  8943. return baseSlice(array, n < 0 ? 0 : n, length);
  8944. }
  8945. /**
  8946. * Creates a slice of `array` with elements taken from the end. Elements are
  8947. * taken until `predicate` returns falsey. The predicate is invoked with
  8948. * three arguments: (value, index, array).
  8949. *
  8950. * @static
  8951. * @memberOf _
  8952. * @since 3.0.0
  8953. * @category Array
  8954. * @param {Array} array The array to query.
  8955. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8956. * @returns {Array} Returns the slice of `array`.
  8957. * @example
  8958. *
  8959. * var users = [
  8960. * { 'user': 'barney', 'active': true },
  8961. * { 'user': 'fred', 'active': false },
  8962. * { 'user': 'pebbles', 'active': false }
  8963. * ];
  8964. *
  8965. * _.takeRightWhile(users, function(o) { return !o.active; });
  8966. * // => objects for ['fred', 'pebbles']
  8967. *
  8968. * // The `_.matches` iteratee shorthand.
  8969. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8970. * // => objects for ['pebbles']
  8971. *
  8972. * // The `_.matchesProperty` iteratee shorthand.
  8973. * _.takeRightWhile(users, ['active', false]);
  8974. * // => objects for ['fred', 'pebbles']
  8975. *
  8976. * // The `_.property` iteratee shorthand.
  8977. * _.takeRightWhile(users, 'active');
  8978. * // => []
  8979. */
  8980. function takeRightWhile(array, predicate) {
  8981. return (array && array.length)
  8982. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8983. : [];
  8984. }
  8985. /**
  8986. * Creates a slice of `array` with elements taken from the beginning. Elements
  8987. * are taken until `predicate` returns falsey. The predicate is invoked with
  8988. * three arguments: (value, index, array).
  8989. *
  8990. * @static
  8991. * @memberOf _
  8992. * @since 3.0.0
  8993. * @category Array
  8994. * @param {Array} array The array to query.
  8995. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8996. * @returns {Array} Returns the slice of `array`.
  8997. * @example
  8998. *
  8999. * var users = [
  9000. * { 'user': 'barney', 'active': false },
  9001. * { 'user': 'fred', 'active': false },
  9002. * { 'user': 'pebbles', 'active': true }
  9003. * ];
  9004. *
  9005. * _.takeWhile(users, function(o) { return !o.active; });
  9006. * // => objects for ['barney', 'fred']
  9007. *
  9008. * // The `_.matches` iteratee shorthand.
  9009. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  9010. * // => objects for ['barney']
  9011. *
  9012. * // The `_.matchesProperty` iteratee shorthand.
  9013. * _.takeWhile(users, ['active', false]);
  9014. * // => objects for ['barney', 'fred']
  9015. *
  9016. * // The `_.property` iteratee shorthand.
  9017. * _.takeWhile(users, 'active');
  9018. * // => []
  9019. */
  9020. function takeWhile(array, predicate) {
  9021. return (array && array.length)
  9022. ? baseWhile(array, getIteratee(predicate, 3))
  9023. : [];
  9024. }
  9025. /**
  9026. * Creates an array of unique values, in order, from all given arrays using
  9027. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9028. * for equality comparisons.
  9029. *
  9030. * @static
  9031. * @memberOf _
  9032. * @since 0.1.0
  9033. * @category Array
  9034. * @param {...Array} [arrays] The arrays to inspect.
  9035. * @returns {Array} Returns the new array of combined values.
  9036. * @example
  9037. *
  9038. * _.union([2], [1, 2]);
  9039. * // => [2, 1]
  9040. */
  9041. var union = baseRest(function(arrays) {
  9042. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  9043. });
  9044. /**
  9045. * This method is like `_.union` except that it accepts `iteratee` which is
  9046. * invoked for each element of each `arrays` to generate the criterion by
  9047. * which uniqueness is computed. Result values are chosen from the first
  9048. * array in which the value occurs. The iteratee is invoked with one argument:
  9049. * (value).
  9050. *
  9051. * @static
  9052. * @memberOf _
  9053. * @since 4.0.0
  9054. * @category Array
  9055. * @param {...Array} [arrays] The arrays to inspect.
  9056. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9057. * @returns {Array} Returns the new array of combined values.
  9058. * @example
  9059. *
  9060. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  9061. * // => [2.1, 1.2]
  9062. *
  9063. * // The `_.property` iteratee shorthand.
  9064. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9065. * // => [{ 'x': 1 }, { 'x': 2 }]
  9066. */
  9067. var unionBy = baseRest(function(arrays) {
  9068. var iteratee = last(arrays);
  9069. if (isArrayLikeObject(iteratee)) {
  9070. iteratee = undefined;
  9071. }
  9072. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  9073. });
  9074. /**
  9075. * This method is like `_.union` except that it accepts `comparator` which
  9076. * is invoked to compare elements of `arrays`. Result values are chosen from
  9077. * the first array in which the value occurs. The comparator is invoked
  9078. * with two arguments: (arrVal, othVal).
  9079. *
  9080. * @static
  9081. * @memberOf _
  9082. * @since 4.0.0
  9083. * @category Array
  9084. * @param {...Array} [arrays] The arrays to inspect.
  9085. * @param {Function} [comparator] The comparator invoked per element.
  9086. * @returns {Array} Returns the new array of combined values.
  9087. * @example
  9088. *
  9089. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9090. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9091. *
  9092. * _.unionWith(objects, others, _.isEqual);
  9093. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9094. */
  9095. var unionWith = baseRest(function(arrays) {
  9096. var comparator = last(arrays);
  9097. comparator = typeof comparator == 'function' ? comparator : undefined;
  9098. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9099. });
  9100. /**
  9101. * Creates a duplicate-free version of an array, using
  9102. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9103. * for equality comparisons, in which only the first occurrence of each element
  9104. * is kept. The order of result values is determined by the order they occur
  9105. * in the array.
  9106. *
  9107. * @static
  9108. * @memberOf _
  9109. * @since 0.1.0
  9110. * @category Array
  9111. * @param {Array} array The array to inspect.
  9112. * @returns {Array} Returns the new duplicate free array.
  9113. * @example
  9114. *
  9115. * _.uniq([2, 1, 2]);
  9116. * // => [2, 1]
  9117. */
  9118. function uniq(array) {
  9119. return (array && array.length) ? baseUniq(array) : [];
  9120. }
  9121. /**
  9122. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9123. * invoked for each element in `array` to generate the criterion by which
  9124. * uniqueness is computed. The order of result values is determined by the
  9125. * order they occur in the array. The iteratee is invoked with one argument:
  9126. * (value).
  9127. *
  9128. * @static
  9129. * @memberOf _
  9130. * @since 4.0.0
  9131. * @category Array
  9132. * @param {Array} array The array to inspect.
  9133. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9134. * @returns {Array} Returns the new duplicate free array.
  9135. * @example
  9136. *
  9137. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9138. * // => [2.1, 1.2]
  9139. *
  9140. * // The `_.property` iteratee shorthand.
  9141. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9142. * // => [{ 'x': 1 }, { 'x': 2 }]
  9143. */
  9144. function uniqBy(array, iteratee) {
  9145. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9146. }
  9147. /**
  9148. * This method is like `_.uniq` except that it accepts `comparator` which
  9149. * is invoked to compare elements of `array`. The order of result values is
  9150. * determined by the order they occur in the array.The comparator is invoked
  9151. * with two arguments: (arrVal, othVal).
  9152. *
  9153. * @static
  9154. * @memberOf _
  9155. * @since 4.0.0
  9156. * @category Array
  9157. * @param {Array} array The array to inspect.
  9158. * @param {Function} [comparator] The comparator invoked per element.
  9159. * @returns {Array} Returns the new duplicate free array.
  9160. * @example
  9161. *
  9162. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9163. *
  9164. * _.uniqWith(objects, _.isEqual);
  9165. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9166. */
  9167. function uniqWith(array, comparator) {
  9168. comparator = typeof comparator == 'function' ? comparator : undefined;
  9169. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9170. }
  9171. /**
  9172. * This method is like `_.zip` except that it accepts an array of grouped
  9173. * elements and creates an array regrouping the elements to their pre-zip
  9174. * configuration.
  9175. *
  9176. * @static
  9177. * @memberOf _
  9178. * @since 1.2.0
  9179. * @category Array
  9180. * @param {Array} array The array of grouped elements to process.
  9181. * @returns {Array} Returns the new array of regrouped elements.
  9182. * @example
  9183. *
  9184. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9185. * // => [['a', 1, true], ['b', 2, false]]
  9186. *
  9187. * _.unzip(zipped);
  9188. * // => [['a', 'b'], [1, 2], [true, false]]
  9189. */
  9190. function unzip(array) {
  9191. if (!(array && array.length)) {
  9192. return [];
  9193. }
  9194. var length = 0;
  9195. array = arrayFilter(array, function(group) {
  9196. if (isArrayLikeObject(group)) {
  9197. length = nativeMax(group.length, length);
  9198. return true;
  9199. }
  9200. });
  9201. return baseTimes(length, function(index) {
  9202. return arrayMap(array, baseProperty(index));
  9203. });
  9204. }
  9205. /**
  9206. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9207. * how regrouped values should be combined. The iteratee is invoked with the
  9208. * elements of each group: (...group).
  9209. *
  9210. * @static
  9211. * @memberOf _
  9212. * @since 3.8.0
  9213. * @category Array
  9214. * @param {Array} array The array of grouped elements to process.
  9215. * @param {Function} [iteratee=_.identity] The function to combine
  9216. * regrouped values.
  9217. * @returns {Array} Returns the new array of regrouped elements.
  9218. * @example
  9219. *
  9220. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9221. * // => [[1, 10, 100], [2, 20, 200]]
  9222. *
  9223. * _.unzipWith(zipped, _.add);
  9224. * // => [3, 30, 300]
  9225. */
  9226. function unzipWith(array, iteratee) {
  9227. if (!(array && array.length)) {
  9228. return [];
  9229. }
  9230. var result = unzip(array);
  9231. if (iteratee == null) {
  9232. return result;
  9233. }
  9234. return arrayMap(result, function(group) {
  9235. return apply(iteratee, undefined, group);
  9236. });
  9237. }
  9238. /**
  9239. * Creates an array excluding all given values using
  9240. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9241. * for equality comparisons.
  9242. *
  9243. * **Note:** Unlike `_.pull`, this method returns a new array.
  9244. *
  9245. * @static
  9246. * @memberOf _
  9247. * @since 0.1.0
  9248. * @category Array
  9249. * @param {Array} array The array to inspect.
  9250. * @param {...*} [values] The values to exclude.
  9251. * @returns {Array} Returns the new array of filtered values.
  9252. * @see _.difference, _.xor
  9253. * @example
  9254. *
  9255. * _.without([2, 1, 2, 3], 1, 2);
  9256. * // => [3]
  9257. */
  9258. var without = baseRest(function(array, values) {
  9259. return isArrayLikeObject(array)
  9260. ? baseDifference(array, values)
  9261. : [];
  9262. });
  9263. /**
  9264. * Creates an array of unique values that is the
  9265. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9266. * of the given arrays. The order of result values is determined by the order
  9267. * they occur in the arrays.
  9268. *
  9269. * @static
  9270. * @memberOf _
  9271. * @since 2.4.0
  9272. * @category Array
  9273. * @param {...Array} [arrays] The arrays to inspect.
  9274. * @returns {Array} Returns the new array of filtered values.
  9275. * @see _.difference, _.without
  9276. * @example
  9277. *
  9278. * _.xor([2, 1], [2, 3]);
  9279. * // => [1, 3]
  9280. */
  9281. var xor = baseRest(function(arrays) {
  9282. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9283. });
  9284. /**
  9285. * This method is like `_.xor` except that it accepts `iteratee` which is
  9286. * invoked for each element of each `arrays` to generate the criterion by
  9287. * which by which they're compared. The order of result values is determined
  9288. * by the order they occur in the arrays. The iteratee is invoked with one
  9289. * argument: (value).
  9290. *
  9291. * @static
  9292. * @memberOf _
  9293. * @since 4.0.0
  9294. * @category Array
  9295. * @param {...Array} [arrays] The arrays to inspect.
  9296. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9297. * @returns {Array} Returns the new array of filtered values.
  9298. * @example
  9299. *
  9300. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9301. * // => [1.2, 3.4]
  9302. *
  9303. * // The `_.property` iteratee shorthand.
  9304. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9305. * // => [{ 'x': 2 }]
  9306. */
  9307. var xorBy = baseRest(function(arrays) {
  9308. var iteratee = last(arrays);
  9309. if (isArrayLikeObject(iteratee)) {
  9310. iteratee = undefined;
  9311. }
  9312. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9313. });
  9314. /**
  9315. * This method is like `_.xor` except that it accepts `comparator` which is
  9316. * invoked to compare elements of `arrays`. The order of result values is
  9317. * determined by the order they occur in the arrays. The comparator is invoked
  9318. * with two arguments: (arrVal, othVal).
  9319. *
  9320. * @static
  9321. * @memberOf _
  9322. * @since 4.0.0
  9323. * @category Array
  9324. * @param {...Array} [arrays] The arrays to inspect.
  9325. * @param {Function} [comparator] The comparator invoked per element.
  9326. * @returns {Array} Returns the new array of filtered values.
  9327. * @example
  9328. *
  9329. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9330. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9331. *
  9332. * _.xorWith(objects, others, _.isEqual);
  9333. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9334. */
  9335. var xorWith = baseRest(function(arrays) {
  9336. var comparator = last(arrays);
  9337. comparator = typeof comparator == 'function' ? comparator : undefined;
  9338. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9339. });
  9340. /**
  9341. * Creates an array of grouped elements, the first of which contains the
  9342. * first elements of the given arrays, the second of which contains the
  9343. * second elements of the given arrays, and so on.
  9344. *
  9345. * @static
  9346. * @memberOf _
  9347. * @since 0.1.0
  9348. * @category Array
  9349. * @param {...Array} [arrays] The arrays to process.
  9350. * @returns {Array} Returns the new array of grouped elements.
  9351. * @example
  9352. *
  9353. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9354. * // => [['a', 1, true], ['b', 2, false]]
  9355. */
  9356. var zip = baseRest(unzip);
  9357. /**
  9358. * This method is like `_.fromPairs` except that it accepts two arrays,
  9359. * one of property identifiers and one of corresponding values.
  9360. *
  9361. * @static
  9362. * @memberOf _
  9363. * @since 0.4.0
  9364. * @category Array
  9365. * @param {Array} [props=[]] The property identifiers.
  9366. * @param {Array} [values=[]] The property values.
  9367. * @returns {Object} Returns the new object.
  9368. * @example
  9369. *
  9370. * _.zipObject(['a', 'b'], [1, 2]);
  9371. * // => { 'a': 1, 'b': 2 }
  9372. */
  9373. function zipObject(props, values) {
  9374. return baseZipObject(props || [], values || [], assignValue);
  9375. }
  9376. /**
  9377. * This method is like `_.zipObject` except that it supports property paths.
  9378. *
  9379. * @static
  9380. * @memberOf _
  9381. * @since 4.1.0
  9382. * @category Array
  9383. * @param {Array} [props=[]] The property identifiers.
  9384. * @param {Array} [values=[]] The property values.
  9385. * @returns {Object} Returns the new object.
  9386. * @example
  9387. *
  9388. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9389. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9390. */
  9391. function zipObjectDeep(props, values) {
  9392. return baseZipObject(props || [], values || [], baseSet);
  9393. }
  9394. /**
  9395. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9396. * how grouped values should be combined. The iteratee is invoked with the
  9397. * elements of each group: (...group).
  9398. *
  9399. * @static
  9400. * @memberOf _
  9401. * @since 3.8.0
  9402. * @category Array
  9403. * @param {...Array} [arrays] The arrays to process.
  9404. * @param {Function} [iteratee=_.identity] The function to combine
  9405. * grouped values.
  9406. * @returns {Array} Returns the new array of grouped elements.
  9407. * @example
  9408. *
  9409. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9410. * return a + b + c;
  9411. * });
  9412. * // => [111, 222]
  9413. */
  9414. var zipWith = baseRest(function(arrays) {
  9415. var length = arrays.length,
  9416. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9417. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9418. return unzipWith(arrays, iteratee);
  9419. });
  9420. /*------------------------------------------------------------------------*/
  9421. /**
  9422. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9423. * chain sequences enabled. The result of such sequences must be unwrapped
  9424. * with `_#value`.
  9425. *
  9426. * @static
  9427. * @memberOf _
  9428. * @since 1.3.0
  9429. * @category Seq
  9430. * @param {*} value The value to wrap.
  9431. * @returns {Object} Returns the new `lodash` wrapper instance.
  9432. * @example
  9433. *
  9434. * var users = [
  9435. * { 'user': 'barney', 'age': 36 },
  9436. * { 'user': 'fred', 'age': 40 },
  9437. * { 'user': 'pebbles', 'age': 1 }
  9438. * ];
  9439. *
  9440. * var youngest = _
  9441. * .chain(users)
  9442. * .sortBy('age')
  9443. * .map(function(o) {
  9444. * return o.user + ' is ' + o.age;
  9445. * })
  9446. * .head()
  9447. * .value();
  9448. * // => 'pebbles is 1'
  9449. */
  9450. function chain(value) {
  9451. var result = lodash(value);
  9452. result.__chain__ = true;
  9453. return result;
  9454. }
  9455. /**
  9456. * This method invokes `interceptor` and returns `value`. The interceptor
  9457. * is invoked with one argument; (value). The purpose of this method is to
  9458. * "tap into" a method chain sequence in order to modify intermediate results.
  9459. *
  9460. * @static
  9461. * @memberOf _
  9462. * @since 0.1.0
  9463. * @category Seq
  9464. * @param {*} value The value to provide to `interceptor`.
  9465. * @param {Function} interceptor The function to invoke.
  9466. * @returns {*} Returns `value`.
  9467. * @example
  9468. *
  9469. * _([1, 2, 3])
  9470. * .tap(function(array) {
  9471. * // Mutate input array.
  9472. * array.pop();
  9473. * })
  9474. * .reverse()
  9475. * .value();
  9476. * // => [2, 1]
  9477. */
  9478. function tap(value, interceptor) {
  9479. interceptor(value);
  9480. return value;
  9481. }
  9482. /**
  9483. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9484. * The purpose of this method is to "pass thru" values replacing intermediate
  9485. * results in a method chain sequence.
  9486. *
  9487. * @static
  9488. * @memberOf _
  9489. * @since 3.0.0
  9490. * @category Seq
  9491. * @param {*} value The value to provide to `interceptor`.
  9492. * @param {Function} interceptor The function to invoke.
  9493. * @returns {*} Returns the result of `interceptor`.
  9494. * @example
  9495. *
  9496. * _(' abc ')
  9497. * .chain()
  9498. * .trim()
  9499. * .thru(function(value) {
  9500. * return [value];
  9501. * })
  9502. * .value();
  9503. * // => ['abc']
  9504. */
  9505. function thru(value, interceptor) {
  9506. return interceptor(value);
  9507. }
  9508. /**
  9509. * This method is the wrapper version of `_.at`.
  9510. *
  9511. * @name at
  9512. * @memberOf _
  9513. * @since 1.0.0
  9514. * @category Seq
  9515. * @param {...(string|string[])} [paths] The property paths to pick.
  9516. * @returns {Object} Returns the new `lodash` wrapper instance.
  9517. * @example
  9518. *
  9519. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9520. *
  9521. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9522. * // => [3, 4]
  9523. */
  9524. var wrapperAt = flatRest(function(paths) {
  9525. var length = paths.length,
  9526. start = length ? paths[0] : 0,
  9527. value = this.__wrapped__,
  9528. interceptor = function(object) { return baseAt(object, paths); };
  9529. if (length > 1 || this.__actions__.length ||
  9530. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9531. return this.thru(interceptor);
  9532. }
  9533. value = value.slice(start, +start + (length ? 1 : 0));
  9534. value.__actions__.push({
  9535. 'func': thru,
  9536. 'args': [interceptor],
  9537. 'thisArg': undefined
  9538. });
  9539. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9540. if (length && !array.length) {
  9541. array.push(undefined);
  9542. }
  9543. return array;
  9544. });
  9545. });
  9546. /**
  9547. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9548. *
  9549. * @name chain
  9550. * @memberOf _
  9551. * @since 0.1.0
  9552. * @category Seq
  9553. * @returns {Object} Returns the new `lodash` wrapper instance.
  9554. * @example
  9555. *
  9556. * var users = [
  9557. * { 'user': 'barney', 'age': 36 },
  9558. * { 'user': 'fred', 'age': 40 }
  9559. * ];
  9560. *
  9561. * // A sequence without explicit chaining.
  9562. * _(users).head();
  9563. * // => { 'user': 'barney', 'age': 36 }
  9564. *
  9565. * // A sequence with explicit chaining.
  9566. * _(users)
  9567. * .chain()
  9568. * .head()
  9569. * .pick('user')
  9570. * .value();
  9571. * // => { 'user': 'barney' }
  9572. */
  9573. function wrapperChain() {
  9574. return chain(this);
  9575. }
  9576. /**
  9577. * Executes the chain sequence and returns the wrapped result.
  9578. *
  9579. * @name commit
  9580. * @memberOf _
  9581. * @since 3.2.0
  9582. * @category Seq
  9583. * @returns {Object} Returns the new `lodash` wrapper instance.
  9584. * @example
  9585. *
  9586. * var array = [1, 2];
  9587. * var wrapped = _(array).push(3);
  9588. *
  9589. * console.log(array);
  9590. * // => [1, 2]
  9591. *
  9592. * wrapped = wrapped.commit();
  9593. * console.log(array);
  9594. * // => [1, 2, 3]
  9595. *
  9596. * wrapped.last();
  9597. * // => 3
  9598. *
  9599. * console.log(array);
  9600. * // => [1, 2, 3]
  9601. */
  9602. function wrapperCommit() {
  9603. return new LodashWrapper(this.value(), this.__chain__);
  9604. }
  9605. /**
  9606. * Gets the next value on a wrapped object following the
  9607. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9608. *
  9609. * @name next
  9610. * @memberOf _
  9611. * @since 4.0.0
  9612. * @category Seq
  9613. * @returns {Object} Returns the next iterator value.
  9614. * @example
  9615. *
  9616. * var wrapped = _([1, 2]);
  9617. *
  9618. * wrapped.next();
  9619. * // => { 'done': false, 'value': 1 }
  9620. *
  9621. * wrapped.next();
  9622. * // => { 'done': false, 'value': 2 }
  9623. *
  9624. * wrapped.next();
  9625. * // => { 'done': true, 'value': undefined }
  9626. */
  9627. function wrapperNext() {
  9628. if (this.__values__ === undefined) {
  9629. this.__values__ = toArray(this.value());
  9630. }
  9631. var done = this.__index__ >= this.__values__.length,
  9632. value = done ? undefined : this.__values__[this.__index__++];
  9633. return { 'done': done, 'value': value };
  9634. }
  9635. /**
  9636. * Enables the wrapper to be iterable.
  9637. *
  9638. * @name Symbol.iterator
  9639. * @memberOf _
  9640. * @since 4.0.0
  9641. * @category Seq
  9642. * @returns {Object} Returns the wrapper object.
  9643. * @example
  9644. *
  9645. * var wrapped = _([1, 2]);
  9646. *
  9647. * wrapped[Symbol.iterator]() === wrapped;
  9648. * // => true
  9649. *
  9650. * Array.from(wrapped);
  9651. * // => [1, 2]
  9652. */
  9653. function wrapperToIterator() {
  9654. return this;
  9655. }
  9656. /**
  9657. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9658. *
  9659. * @name plant
  9660. * @memberOf _
  9661. * @since 3.2.0
  9662. * @category Seq
  9663. * @param {*} value The value to plant.
  9664. * @returns {Object} Returns the new `lodash` wrapper instance.
  9665. * @example
  9666. *
  9667. * function square(n) {
  9668. * return n * n;
  9669. * }
  9670. *
  9671. * var wrapped = _([1, 2]).map(square);
  9672. * var other = wrapped.plant([3, 4]);
  9673. *
  9674. * other.value();
  9675. * // => [9, 16]
  9676. *
  9677. * wrapped.value();
  9678. * // => [1, 4]
  9679. */
  9680. function wrapperPlant(value) {
  9681. var result,
  9682. parent = this;
  9683. while (parent instanceof baseLodash) {
  9684. var clone = wrapperClone(parent);
  9685. clone.__index__ = 0;
  9686. clone.__values__ = undefined;
  9687. if (result) {
  9688. previous.__wrapped__ = clone;
  9689. } else {
  9690. result = clone;
  9691. }
  9692. var previous = clone;
  9693. parent = parent.__wrapped__;
  9694. }
  9695. previous.__wrapped__ = value;
  9696. return result;
  9697. }
  9698. /**
  9699. * This method is the wrapper version of `_.reverse`.
  9700. *
  9701. * **Note:** This method mutates the wrapped array.
  9702. *
  9703. * @name reverse
  9704. * @memberOf _
  9705. * @since 0.1.0
  9706. * @category Seq
  9707. * @returns {Object} Returns the new `lodash` wrapper instance.
  9708. * @example
  9709. *
  9710. * var array = [1, 2, 3];
  9711. *
  9712. * _(array).reverse().value()
  9713. * // => [3, 2, 1]
  9714. *
  9715. * console.log(array);
  9716. * // => [3, 2, 1]
  9717. */
  9718. function wrapperReverse() {
  9719. var value = this.__wrapped__;
  9720. if (value instanceof LazyWrapper) {
  9721. var wrapped = value;
  9722. if (this.__actions__.length) {
  9723. wrapped = new LazyWrapper(this);
  9724. }
  9725. wrapped = wrapped.reverse();
  9726. wrapped.__actions__.push({
  9727. 'func': thru,
  9728. 'args': [reverse],
  9729. 'thisArg': undefined
  9730. });
  9731. return new LodashWrapper(wrapped, this.__chain__);
  9732. }
  9733. return this.thru(reverse);
  9734. }
  9735. /**
  9736. * Executes the chain sequence to resolve the unwrapped value.
  9737. *
  9738. * @name value
  9739. * @memberOf _
  9740. * @since 0.1.0
  9741. * @alias toJSON, valueOf
  9742. * @category Seq
  9743. * @returns {*} Returns the resolved unwrapped value.
  9744. * @example
  9745. *
  9746. * _([1, 2, 3]).value();
  9747. * // => [1, 2, 3]
  9748. */
  9749. function wrapperValue() {
  9750. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9751. }
  9752. /*------------------------------------------------------------------------*/
  9753. /**
  9754. * Creates an object composed of keys generated from the results of running
  9755. * each element of `collection` thru `iteratee`. The corresponding value of
  9756. * each key is the number of times the key was returned by `iteratee`. The
  9757. * iteratee is invoked with one argument: (value).
  9758. *
  9759. * @static
  9760. * @memberOf _
  9761. * @since 0.5.0
  9762. * @category Collection
  9763. * @param {Array|Object} collection The collection to iterate over.
  9764. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9765. * @returns {Object} Returns the composed aggregate object.
  9766. * @example
  9767. *
  9768. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9769. * // => { '4': 1, '6': 2 }
  9770. *
  9771. * // The `_.property` iteratee shorthand.
  9772. * _.countBy(['one', 'two', 'three'], 'length');
  9773. * // => { '3': 2, '5': 1 }
  9774. */
  9775. var countBy = createAggregator(function(result, value, key) {
  9776. if (hasOwnProperty.call(result, key)) {
  9777. ++result[key];
  9778. } else {
  9779. baseAssignValue(result, key, 1);
  9780. }
  9781. });
  9782. /**
  9783. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9784. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9785. * invoked with three arguments: (value, index|key, collection).
  9786. *
  9787. * **Note:** This method returns `true` for
  9788. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9789. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9790. * elements of empty collections.
  9791. *
  9792. * @static
  9793. * @memberOf _
  9794. * @since 0.1.0
  9795. * @category Collection
  9796. * @param {Array|Object} collection The collection to iterate over.
  9797. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9798. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9799. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9800. * else `false`.
  9801. * @example
  9802. *
  9803. * _.every([true, 1, null, 'yes'], Boolean);
  9804. * // => false
  9805. *
  9806. * var users = [
  9807. * { 'user': 'barney', 'age': 36, 'active': false },
  9808. * { 'user': 'fred', 'age': 40, 'active': false }
  9809. * ];
  9810. *
  9811. * // The `_.matches` iteratee shorthand.
  9812. * _.every(users, { 'user': 'barney', 'active': false });
  9813. * // => false
  9814. *
  9815. * // The `_.matchesProperty` iteratee shorthand.
  9816. * _.every(users, ['active', false]);
  9817. * // => true
  9818. *
  9819. * // The `_.property` iteratee shorthand.
  9820. * _.every(users, 'active');
  9821. * // => false
  9822. */
  9823. function every(collection, predicate, guard) {
  9824. var func = isArray(collection) ? arrayEvery : baseEvery;
  9825. if (guard && isIterateeCall(collection, predicate, guard)) {
  9826. predicate = undefined;
  9827. }
  9828. return func(collection, getIteratee(predicate, 3));
  9829. }
  9830. /**
  9831. * Iterates over elements of `collection`, returning an array of all elements
  9832. * `predicate` returns truthy for. The predicate is invoked with three
  9833. * arguments: (value, index|key, collection).
  9834. *
  9835. * **Note:** Unlike `_.remove`, this method returns a new array.
  9836. *
  9837. * @static
  9838. * @memberOf _
  9839. * @since 0.1.0
  9840. * @category Collection
  9841. * @param {Array|Object} collection The collection to iterate over.
  9842. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9843. * @returns {Array} Returns the new filtered array.
  9844. * @see _.reject
  9845. * @example
  9846. *
  9847. * var users = [
  9848. * { 'user': 'barney', 'age': 36, 'active': true },
  9849. * { 'user': 'fred', 'age': 40, 'active': false }
  9850. * ];
  9851. *
  9852. * _.filter(users, function(o) { return !o.active; });
  9853. * // => objects for ['fred']
  9854. *
  9855. * // The `_.matches` iteratee shorthand.
  9856. * _.filter(users, { 'age': 36, 'active': true });
  9857. * // => objects for ['barney']
  9858. *
  9859. * // The `_.matchesProperty` iteratee shorthand.
  9860. * _.filter(users, ['active', false]);
  9861. * // => objects for ['fred']
  9862. *
  9863. * // The `_.property` iteratee shorthand.
  9864. * _.filter(users, 'active');
  9865. * // => objects for ['barney']
  9866. *
  9867. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9868. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9869. * // => objects for ['fred', 'barney']
  9870. */
  9871. function filter(collection, predicate) {
  9872. var func = isArray(collection) ? arrayFilter : baseFilter;
  9873. return func(collection, getIteratee(predicate, 3));
  9874. }
  9875. /**
  9876. * Iterates over elements of `collection`, returning the first element
  9877. * `predicate` returns truthy for. The predicate is invoked with three
  9878. * arguments: (value, index|key, collection).
  9879. *
  9880. * @static
  9881. * @memberOf _
  9882. * @since 0.1.0
  9883. * @category Collection
  9884. * @param {Array|Object} collection The collection to inspect.
  9885. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9886. * @param {number} [fromIndex=0] The index to search from.
  9887. * @returns {*} Returns the matched element, else `undefined`.
  9888. * @example
  9889. *
  9890. * var users = [
  9891. * { 'user': 'barney', 'age': 36, 'active': true },
  9892. * { 'user': 'fred', 'age': 40, 'active': false },
  9893. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9894. * ];
  9895. *
  9896. * _.find(users, function(o) { return o.age < 40; });
  9897. * // => object for 'barney'
  9898. *
  9899. * // The `_.matches` iteratee shorthand.
  9900. * _.find(users, { 'age': 1, 'active': true });
  9901. * // => object for 'pebbles'
  9902. *
  9903. * // The `_.matchesProperty` iteratee shorthand.
  9904. * _.find(users, ['active', false]);
  9905. * // => object for 'fred'
  9906. *
  9907. * // The `_.property` iteratee shorthand.
  9908. * _.find(users, 'active');
  9909. * // => object for 'barney'
  9910. */
  9911. var find = createFind(findIndex);
  9912. /**
  9913. * This method is like `_.find` except that it iterates over elements of
  9914. * `collection` from right to left.
  9915. *
  9916. * @static
  9917. * @memberOf _
  9918. * @since 2.0.0
  9919. * @category Collection
  9920. * @param {Array|Object} collection The collection to inspect.
  9921. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9922. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9923. * @returns {*} Returns the matched element, else `undefined`.
  9924. * @example
  9925. *
  9926. * _.findLast([1, 2, 3, 4], function(n) {
  9927. * return n % 2 == 1;
  9928. * });
  9929. * // => 3
  9930. */
  9931. var findLast = createFind(findLastIndex);
  9932. /**
  9933. * Creates a flattened array of values by running each element in `collection`
  9934. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9935. * with three arguments: (value, index|key, collection).
  9936. *
  9937. * @static
  9938. * @memberOf _
  9939. * @since 4.0.0
  9940. * @category Collection
  9941. * @param {Array|Object} collection The collection to iterate over.
  9942. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9943. * @returns {Array} Returns the new flattened array.
  9944. * @example
  9945. *
  9946. * function duplicate(n) {
  9947. * return [n, n];
  9948. * }
  9949. *
  9950. * _.flatMap([1, 2], duplicate);
  9951. * // => [1, 1, 2, 2]
  9952. */
  9953. function flatMap(collection, iteratee) {
  9954. return baseFlatten(map(collection, iteratee), 1);
  9955. }
  9956. /**
  9957. * This method is like `_.flatMap` except that it recursively flattens the
  9958. * mapped results.
  9959. *
  9960. * @static
  9961. * @memberOf _
  9962. * @since 4.7.0
  9963. * @category Collection
  9964. * @param {Array|Object} collection The collection to iterate over.
  9965. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9966. * @returns {Array} Returns the new flattened array.
  9967. * @example
  9968. *
  9969. * function duplicate(n) {
  9970. * return [[[n, n]]];
  9971. * }
  9972. *
  9973. * _.flatMapDeep([1, 2], duplicate);
  9974. * // => [1, 1, 2, 2]
  9975. */
  9976. function flatMapDeep(collection, iteratee) {
  9977. return baseFlatten(map(collection, iteratee), INFINITY);
  9978. }
  9979. /**
  9980. * This method is like `_.flatMap` except that it recursively flattens the
  9981. * mapped results up to `depth` times.
  9982. *
  9983. * @static
  9984. * @memberOf _
  9985. * @since 4.7.0
  9986. * @category Collection
  9987. * @param {Array|Object} collection The collection to iterate over.
  9988. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9989. * @param {number} [depth=1] The maximum recursion depth.
  9990. * @returns {Array} Returns the new flattened array.
  9991. * @example
  9992. *
  9993. * function duplicate(n) {
  9994. * return [[[n, n]]];
  9995. * }
  9996. *
  9997. * _.flatMapDepth([1, 2], duplicate, 2);
  9998. * // => [[1, 1], [2, 2]]
  9999. */
  10000. function flatMapDepth(collection, iteratee, depth) {
  10001. depth = depth === undefined ? 1 : toInteger(depth);
  10002. return baseFlatten(map(collection, iteratee), depth);
  10003. }
  10004. /**
  10005. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  10006. * The iteratee is invoked with three arguments: (value, index|key, collection).
  10007. * Iteratee functions may exit iteration early by explicitly returning `false`.
  10008. *
  10009. * **Note:** As with other "Collections" methods, objects with a "length"
  10010. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  10011. * or `_.forOwn` for object iteration.
  10012. *
  10013. * @static
  10014. * @memberOf _
  10015. * @since 0.1.0
  10016. * @alias each
  10017. * @category Collection
  10018. * @param {Array|Object} collection The collection to iterate over.
  10019. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10020. * @returns {Array|Object} Returns `collection`.
  10021. * @see _.forEachRight
  10022. * @example
  10023. *
  10024. * _.forEach([1, 2], function(value) {
  10025. * console.log(value);
  10026. * });
  10027. * // => Logs `1` then `2`.
  10028. *
  10029. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  10030. * console.log(key);
  10031. * });
  10032. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  10033. */
  10034. function forEach(collection, iteratee) {
  10035. var func = isArray(collection) ? arrayEach : baseEach;
  10036. return func(collection, getIteratee(iteratee, 3));
  10037. }
  10038. /**
  10039. * This method is like `_.forEach` except that it iterates over elements of
  10040. * `collection` from right to left.
  10041. *
  10042. * @static
  10043. * @memberOf _
  10044. * @since 2.0.0
  10045. * @alias eachRight
  10046. * @category Collection
  10047. * @param {Array|Object} collection The collection to iterate over.
  10048. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10049. * @returns {Array|Object} Returns `collection`.
  10050. * @see _.forEach
  10051. * @example
  10052. *
  10053. * _.forEachRight([1, 2], function(value) {
  10054. * console.log(value);
  10055. * });
  10056. * // => Logs `2` then `1`.
  10057. */
  10058. function forEachRight(collection, iteratee) {
  10059. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  10060. return func(collection, getIteratee(iteratee, 3));
  10061. }
  10062. /**
  10063. * Creates an object composed of keys generated from the results of running
  10064. * each element of `collection` thru `iteratee`. The order of grouped values
  10065. * is determined by the order they occur in `collection`. The corresponding
  10066. * value of each key is an array of elements responsible for generating the
  10067. * key. The iteratee is invoked with one argument: (value).
  10068. *
  10069. * @static
  10070. * @memberOf _
  10071. * @since 0.1.0
  10072. * @category Collection
  10073. * @param {Array|Object} collection The collection to iterate over.
  10074. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10075. * @returns {Object} Returns the composed aggregate object.
  10076. * @example
  10077. *
  10078. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  10079. * // => { '4': [4.2], '6': [6.1, 6.3] }
  10080. *
  10081. * // The `_.property` iteratee shorthand.
  10082. * _.groupBy(['one', 'two', 'three'], 'length');
  10083. * // => { '3': ['one', 'two'], '5': ['three'] }
  10084. */
  10085. var groupBy = createAggregator(function(result, value, key) {
  10086. if (hasOwnProperty.call(result, key)) {
  10087. result[key].push(value);
  10088. } else {
  10089. baseAssignValue(result, key, [value]);
  10090. }
  10091. });
  10092. /**
  10093. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10094. * checked for a substring of `value`, otherwise
  10095. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10096. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10097. * the offset from the end of `collection`.
  10098. *
  10099. * @static
  10100. * @memberOf _
  10101. * @since 0.1.0
  10102. * @category Collection
  10103. * @param {Array|Object|string} collection The collection to inspect.
  10104. * @param {*} value The value to search for.
  10105. * @param {number} [fromIndex=0] The index to search from.
  10106. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10107. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10108. * @example
  10109. *
  10110. * _.includes([1, 2, 3], 1);
  10111. * // => true
  10112. *
  10113. * _.includes([1, 2, 3], 1, 2);
  10114. * // => false
  10115. *
  10116. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10117. * // => true
  10118. *
  10119. * _.includes('abcd', 'bc');
  10120. * // => true
  10121. */
  10122. function includes(collection, value, fromIndex, guard) {
  10123. collection = isArrayLike(collection) ? collection : values(collection);
  10124. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10125. var length = collection.length;
  10126. if (fromIndex < 0) {
  10127. fromIndex = nativeMax(length + fromIndex, 0);
  10128. }
  10129. return isString(collection)
  10130. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10131. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10132. }
  10133. /**
  10134. * Invokes the method at `path` of each element in `collection`, returning
  10135. * an array of the results of each invoked method. Any additional arguments
  10136. * are provided to each invoked method. If `path` is a function, it's invoked
  10137. * for, and `this` bound to, each element in `collection`.
  10138. *
  10139. * @static
  10140. * @memberOf _
  10141. * @since 4.0.0
  10142. * @category Collection
  10143. * @param {Array|Object} collection The collection to iterate over.
  10144. * @param {Array|Function|string} path The path of the method to invoke or
  10145. * the function invoked per iteration.
  10146. * @param {...*} [args] The arguments to invoke each method with.
  10147. * @returns {Array} Returns the array of results.
  10148. * @example
  10149. *
  10150. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10151. * // => [[1, 5, 7], [1, 2, 3]]
  10152. *
  10153. * _.invokeMap([123, 456], String.prototype.split, '');
  10154. * // => [['1', '2', '3'], ['4', '5', '6']]
  10155. */
  10156. var invokeMap = baseRest(function(collection, path, args) {
  10157. var index = -1,
  10158. isFunc = typeof path == 'function',
  10159. result = isArrayLike(collection) ? Array(collection.length) : [];
  10160. baseEach(collection, function(value) {
  10161. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10162. });
  10163. return result;
  10164. });
  10165. /**
  10166. * Creates an object composed of keys generated from the results of running
  10167. * each element of `collection` thru `iteratee`. The corresponding value of
  10168. * each key is the last element responsible for generating the key. The
  10169. * iteratee is invoked with one argument: (value).
  10170. *
  10171. * @static
  10172. * @memberOf _
  10173. * @since 4.0.0
  10174. * @category Collection
  10175. * @param {Array|Object} collection The collection to iterate over.
  10176. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10177. * @returns {Object} Returns the composed aggregate object.
  10178. * @example
  10179. *
  10180. * var array = [
  10181. * { 'dir': 'left', 'code': 97 },
  10182. * { 'dir': 'right', 'code': 100 }
  10183. * ];
  10184. *
  10185. * _.keyBy(array, function(o) {
  10186. * return String.fromCharCode(o.code);
  10187. * });
  10188. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10189. *
  10190. * _.keyBy(array, 'dir');
  10191. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10192. */
  10193. var keyBy = createAggregator(function(result, value, key) {
  10194. baseAssignValue(result, key, value);
  10195. });
  10196. /**
  10197. * Creates an array of values by running each element in `collection` thru
  10198. * `iteratee`. The iteratee is invoked with three arguments:
  10199. * (value, index|key, collection).
  10200. *
  10201. * Many lodash methods are guarded to work as iteratees for methods like
  10202. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10203. *
  10204. * The guarded methods are:
  10205. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10206. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10207. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10208. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10209. *
  10210. * @static
  10211. * @memberOf _
  10212. * @since 0.1.0
  10213. * @category Collection
  10214. * @param {Array|Object} collection The collection to iterate over.
  10215. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10216. * @returns {Array} Returns the new mapped array.
  10217. * @example
  10218. *
  10219. * function square(n) {
  10220. * return n * n;
  10221. * }
  10222. *
  10223. * _.map([4, 8], square);
  10224. * // => [16, 64]
  10225. *
  10226. * _.map({ 'a': 4, 'b': 8 }, square);
  10227. * // => [16, 64] (iteration order is not guaranteed)
  10228. *
  10229. * var users = [
  10230. * { 'user': 'barney' },
  10231. * { 'user': 'fred' }
  10232. * ];
  10233. *
  10234. * // The `_.property` iteratee shorthand.
  10235. * _.map(users, 'user');
  10236. * // => ['barney', 'fred']
  10237. */
  10238. function map(collection, iteratee) {
  10239. var func = isArray(collection) ? arrayMap : baseMap;
  10240. return func(collection, getIteratee(iteratee, 3));
  10241. }
  10242. /**
  10243. * This method is like `_.sortBy` except that it allows specifying the sort
  10244. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10245. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10246. * descending or "asc" for ascending sort order of corresponding values.
  10247. *
  10248. * @static
  10249. * @memberOf _
  10250. * @since 4.0.0
  10251. * @category Collection
  10252. * @param {Array|Object} collection The collection to iterate over.
  10253. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10254. * The iteratees to sort by.
  10255. * @param {string[]} [orders] The sort orders of `iteratees`.
  10256. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10257. * @returns {Array} Returns the new sorted array.
  10258. * @example
  10259. *
  10260. * var users = [
  10261. * { 'user': 'fred', 'age': 48 },
  10262. * { 'user': 'barney', 'age': 34 },
  10263. * { 'user': 'fred', 'age': 40 },
  10264. * { 'user': 'barney', 'age': 36 }
  10265. * ];
  10266. *
  10267. * // Sort by `user` in ascending order and by `age` in descending order.
  10268. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10269. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10270. */
  10271. function orderBy(collection, iteratees, orders, guard) {
  10272. if (collection == null) {
  10273. return [];
  10274. }
  10275. if (!isArray(iteratees)) {
  10276. iteratees = iteratees == null ? [] : [iteratees];
  10277. }
  10278. orders = guard ? undefined : orders;
  10279. if (!isArray(orders)) {
  10280. orders = orders == null ? [] : [orders];
  10281. }
  10282. return baseOrderBy(collection, iteratees, orders);
  10283. }
  10284. /**
  10285. * Creates an array of elements split into two groups, the first of which
  10286. * contains elements `predicate` returns truthy for, the second of which
  10287. * contains elements `predicate` returns falsey for. The predicate is
  10288. * invoked with one argument: (value).
  10289. *
  10290. * @static
  10291. * @memberOf _
  10292. * @since 3.0.0
  10293. * @category Collection
  10294. * @param {Array|Object} collection The collection to iterate over.
  10295. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10296. * @returns {Array} Returns the array of grouped elements.
  10297. * @example
  10298. *
  10299. * var users = [
  10300. * { 'user': 'barney', 'age': 36, 'active': false },
  10301. * { 'user': 'fred', 'age': 40, 'active': true },
  10302. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10303. * ];
  10304. *
  10305. * _.partition(users, function(o) { return o.active; });
  10306. * // => objects for [['fred'], ['barney', 'pebbles']]
  10307. *
  10308. * // The `_.matches` iteratee shorthand.
  10309. * _.partition(users, { 'age': 1, 'active': false });
  10310. * // => objects for [['pebbles'], ['barney', 'fred']]
  10311. *
  10312. * // The `_.matchesProperty` iteratee shorthand.
  10313. * _.partition(users, ['active', false]);
  10314. * // => objects for [['barney', 'pebbles'], ['fred']]
  10315. *
  10316. * // The `_.property` iteratee shorthand.
  10317. * _.partition(users, 'active');
  10318. * // => objects for [['fred'], ['barney', 'pebbles']]
  10319. */
  10320. var partition = createAggregator(function(result, value, key) {
  10321. result[key ? 0 : 1].push(value);
  10322. }, function() { return [[], []]; });
  10323. /**
  10324. * Reduces `collection` to a value which is the accumulated result of running
  10325. * each element in `collection` thru `iteratee`, where each successive
  10326. * invocation is supplied the return value of the previous. If `accumulator`
  10327. * is not given, the first element of `collection` is used as the initial
  10328. * value. The iteratee is invoked with four arguments:
  10329. * (accumulator, value, index|key, collection).
  10330. *
  10331. * Many lodash methods are guarded to work as iteratees for methods like
  10332. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10333. *
  10334. * The guarded methods are:
  10335. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10336. * and `sortBy`
  10337. *
  10338. * @static
  10339. * @memberOf _
  10340. * @since 0.1.0
  10341. * @category Collection
  10342. * @param {Array|Object} collection The collection to iterate over.
  10343. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10344. * @param {*} [accumulator] The initial value.
  10345. * @returns {*} Returns the accumulated value.
  10346. * @see _.reduceRight
  10347. * @example
  10348. *
  10349. * _.reduce([1, 2], function(sum, n) {
  10350. * return sum + n;
  10351. * }, 0);
  10352. * // => 3
  10353. *
  10354. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10355. * (result[value] || (result[value] = [])).push(key);
  10356. * return result;
  10357. * }, {});
  10358. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10359. */
  10360. function reduce(collection, iteratee, accumulator) {
  10361. var func = isArray(collection) ? arrayReduce : baseReduce,
  10362. initAccum = arguments.length < 3;
  10363. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10364. }
  10365. /**
  10366. * This method is like `_.reduce` except that it iterates over elements of
  10367. * `collection` from right to left.
  10368. *
  10369. * @static
  10370. * @memberOf _
  10371. * @since 0.1.0
  10372. * @category Collection
  10373. * @param {Array|Object} collection The collection to iterate over.
  10374. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10375. * @param {*} [accumulator] The initial value.
  10376. * @returns {*} Returns the accumulated value.
  10377. * @see _.reduce
  10378. * @example
  10379. *
  10380. * var array = [[0, 1], [2, 3], [4, 5]];
  10381. *
  10382. * _.reduceRight(array, function(flattened, other) {
  10383. * return flattened.concat(other);
  10384. * }, []);
  10385. * // => [4, 5, 2, 3, 0, 1]
  10386. */
  10387. function reduceRight(collection, iteratee, accumulator) {
  10388. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10389. initAccum = arguments.length < 3;
  10390. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10391. }
  10392. /**
  10393. * The opposite of `_.filter`; this method returns the elements of `collection`
  10394. * that `predicate` does **not** return truthy for.
  10395. *
  10396. * @static
  10397. * @memberOf _
  10398. * @since 0.1.0
  10399. * @category Collection
  10400. * @param {Array|Object} collection The collection to iterate over.
  10401. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10402. * @returns {Array} Returns the new filtered array.
  10403. * @see _.filter
  10404. * @example
  10405. *
  10406. * var users = [
  10407. * { 'user': 'barney', 'age': 36, 'active': false },
  10408. * { 'user': 'fred', 'age': 40, 'active': true }
  10409. * ];
  10410. *
  10411. * _.reject(users, function(o) { return !o.active; });
  10412. * // => objects for ['fred']
  10413. *
  10414. * // The `_.matches` iteratee shorthand.
  10415. * _.reject(users, { 'age': 40, 'active': true });
  10416. * // => objects for ['barney']
  10417. *
  10418. * // The `_.matchesProperty` iteratee shorthand.
  10419. * _.reject(users, ['active', false]);
  10420. * // => objects for ['fred']
  10421. *
  10422. * // The `_.property` iteratee shorthand.
  10423. * _.reject(users, 'active');
  10424. * // => objects for ['barney']
  10425. */
  10426. function reject(collection, predicate) {
  10427. var func = isArray(collection) ? arrayFilter : baseFilter;
  10428. return func(collection, negate(getIteratee(predicate, 3)));
  10429. }
  10430. /**
  10431. * Gets a random element from `collection`.
  10432. *
  10433. * @static
  10434. * @memberOf _
  10435. * @since 2.0.0
  10436. * @category Collection
  10437. * @param {Array|Object} collection The collection to sample.
  10438. * @returns {*} Returns the random element.
  10439. * @example
  10440. *
  10441. * _.sample([1, 2, 3, 4]);
  10442. * // => 2
  10443. */
  10444. function sample(collection) {
  10445. var func = isArray(collection) ? arraySample : baseSample;
  10446. return func(collection);
  10447. }
  10448. /**
  10449. * Gets `n` random elements at unique keys from `collection` up to the
  10450. * size of `collection`.
  10451. *
  10452. * @static
  10453. * @memberOf _
  10454. * @since 4.0.0
  10455. * @category Collection
  10456. * @param {Array|Object} collection The collection to sample.
  10457. * @param {number} [n=1] The number of elements to sample.
  10458. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10459. * @returns {Array} Returns the random elements.
  10460. * @example
  10461. *
  10462. * _.sampleSize([1, 2, 3], 2);
  10463. * // => [3, 1]
  10464. *
  10465. * _.sampleSize([1, 2, 3], 4);
  10466. * // => [2, 3, 1]
  10467. */
  10468. function sampleSize(collection, n, guard) {
  10469. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10470. n = 1;
  10471. } else {
  10472. n = toInteger(n);
  10473. }
  10474. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10475. return func(collection, n);
  10476. }
  10477. /**
  10478. * Creates an array of shuffled values, using a version of the
  10479. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10480. *
  10481. * @static
  10482. * @memberOf _
  10483. * @since 0.1.0
  10484. * @category Collection
  10485. * @param {Array|Object} collection The collection to shuffle.
  10486. * @returns {Array} Returns the new shuffled array.
  10487. * @example
  10488. *
  10489. * _.shuffle([1, 2, 3, 4]);
  10490. * // => [4, 1, 3, 2]
  10491. */
  10492. function shuffle(collection) {
  10493. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10494. return func(collection);
  10495. }
  10496. /**
  10497. * Gets the size of `collection` by returning its length for array-like
  10498. * values or the number of own enumerable string keyed properties for objects.
  10499. *
  10500. * @static
  10501. * @memberOf _
  10502. * @since 0.1.0
  10503. * @category Collection
  10504. * @param {Array|Object|string} collection The collection to inspect.
  10505. * @returns {number} Returns the collection size.
  10506. * @example
  10507. *
  10508. * _.size([1, 2, 3]);
  10509. * // => 3
  10510. *
  10511. * _.size({ 'a': 1, 'b': 2 });
  10512. * // => 2
  10513. *
  10514. * _.size('pebbles');
  10515. * // => 7
  10516. */
  10517. function size(collection) {
  10518. if (collection == null) {
  10519. return 0;
  10520. }
  10521. if (isArrayLike(collection)) {
  10522. return isString(collection) ? stringSize(collection) : collection.length;
  10523. }
  10524. var tag = getTag(collection);
  10525. if (tag == mapTag || tag == setTag) {
  10526. return collection.size;
  10527. }
  10528. return baseKeys(collection).length;
  10529. }
  10530. /**
  10531. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10532. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10533. * invoked with three arguments: (value, index|key, collection).
  10534. *
  10535. * @static
  10536. * @memberOf _
  10537. * @since 0.1.0
  10538. * @category Collection
  10539. * @param {Array|Object} collection The collection to iterate over.
  10540. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10541. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10542. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10543. * else `false`.
  10544. * @example
  10545. *
  10546. * _.some([null, 0, 'yes', false], Boolean);
  10547. * // => true
  10548. *
  10549. * var users = [
  10550. * { 'user': 'barney', 'active': true },
  10551. * { 'user': 'fred', 'active': false }
  10552. * ];
  10553. *
  10554. * // The `_.matches` iteratee shorthand.
  10555. * _.some(users, { 'user': 'barney', 'active': false });
  10556. * // => false
  10557. *
  10558. * // The `_.matchesProperty` iteratee shorthand.
  10559. * _.some(users, ['active', false]);
  10560. * // => true
  10561. *
  10562. * // The `_.property` iteratee shorthand.
  10563. * _.some(users, 'active');
  10564. * // => true
  10565. */
  10566. function some(collection, predicate, guard) {
  10567. var func = isArray(collection) ? arraySome : baseSome;
  10568. if (guard && isIterateeCall(collection, predicate, guard)) {
  10569. predicate = undefined;
  10570. }
  10571. return func(collection, getIteratee(predicate, 3));
  10572. }
  10573. /**
  10574. * Creates an array of elements, sorted in ascending order by the results of
  10575. * running each element in a collection thru each iteratee. This method
  10576. * performs a stable sort, that is, it preserves the original sort order of
  10577. * equal elements. The iteratees are invoked with one argument: (value).
  10578. *
  10579. * @static
  10580. * @memberOf _
  10581. * @since 0.1.0
  10582. * @category Collection
  10583. * @param {Array|Object} collection The collection to iterate over.
  10584. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10585. * The iteratees to sort by.
  10586. * @returns {Array} Returns the new sorted array.
  10587. * @example
  10588. *
  10589. * var users = [
  10590. * { 'user': 'fred', 'age': 48 },
  10591. * { 'user': 'barney', 'age': 36 },
  10592. * { 'user': 'fred', 'age': 30 },
  10593. * { 'user': 'barney', 'age': 34 }
  10594. * ];
  10595. *
  10596. * _.sortBy(users, [function(o) { return o.user; }]);
  10597. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10598. *
  10599. * _.sortBy(users, ['user', 'age']);
  10600. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10601. */
  10602. var sortBy = baseRest(function(collection, iteratees) {
  10603. if (collection == null) {
  10604. return [];
  10605. }
  10606. var length = iteratees.length;
  10607. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10608. iteratees = [];
  10609. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10610. iteratees = [iteratees[0]];
  10611. }
  10612. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10613. });
  10614. /*------------------------------------------------------------------------*/
  10615. /**
  10616. * Gets the timestamp of the number of milliseconds that have elapsed since
  10617. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10618. *
  10619. * @static
  10620. * @memberOf _
  10621. * @since 2.4.0
  10622. * @category Date
  10623. * @returns {number} Returns the timestamp.
  10624. * @example
  10625. *
  10626. * _.defer(function(stamp) {
  10627. * console.log(_.now() - stamp);
  10628. * }, _.now());
  10629. * // => Logs the number of milliseconds it took for the deferred invocation.
  10630. */
  10631. var now = ctxNow || function() {
  10632. return root.Date.now();
  10633. };
  10634. /*------------------------------------------------------------------------*/
  10635. /**
  10636. * The opposite of `_.before`; this method creates a function that invokes
  10637. * `func` once it's called `n` or more times.
  10638. *
  10639. * @static
  10640. * @memberOf _
  10641. * @since 0.1.0
  10642. * @category Function
  10643. * @param {number} n The number of calls before `func` is invoked.
  10644. * @param {Function} func The function to restrict.
  10645. * @returns {Function} Returns the new restricted function.
  10646. * @example
  10647. *
  10648. * var saves = ['profile', 'settings'];
  10649. *
  10650. * var done = _.after(saves.length, function() {
  10651. * console.log('done saving!');
  10652. * });
  10653. *
  10654. * _.forEach(saves, function(type) {
  10655. * asyncSave({ 'type': type, 'complete': done });
  10656. * });
  10657. * // => Logs 'done saving!' after the two async saves have completed.
  10658. */
  10659. function after(n, func) {
  10660. if (typeof func != 'function') {
  10661. throw new TypeError(FUNC_ERROR_TEXT);
  10662. }
  10663. n = toInteger(n);
  10664. return function() {
  10665. if (--n < 1) {
  10666. return func.apply(this, arguments);
  10667. }
  10668. };
  10669. }
  10670. /**
  10671. * Creates a function that invokes `func`, with up to `n` arguments,
  10672. * ignoring any additional arguments.
  10673. *
  10674. * @static
  10675. * @memberOf _
  10676. * @since 3.0.0
  10677. * @category Function
  10678. * @param {Function} func The function to cap arguments for.
  10679. * @param {number} [n=func.length] The arity cap.
  10680. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10681. * @returns {Function} Returns the new capped function.
  10682. * @example
  10683. *
  10684. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10685. * // => [6, 8, 10]
  10686. */
  10687. function ary(func, n, guard) {
  10688. n = guard ? undefined : n;
  10689. n = (func && n == null) ? func.length : n;
  10690. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10691. }
  10692. /**
  10693. * Creates a function that invokes `func`, with the `this` binding and arguments
  10694. * of the created function, while it's called less than `n` times. Subsequent
  10695. * calls to the created function return the result of the last `func` invocation.
  10696. *
  10697. * @static
  10698. * @memberOf _
  10699. * @since 3.0.0
  10700. * @category Function
  10701. * @param {number} n The number of calls at which `func` is no longer invoked.
  10702. * @param {Function} func The function to restrict.
  10703. * @returns {Function} Returns the new restricted function.
  10704. * @example
  10705. *
  10706. * jQuery(element).on('click', _.before(5, addContactToList));
  10707. * // => Allows adding up to 4 contacts to the list.
  10708. */
  10709. function before(n, func) {
  10710. var result;
  10711. if (typeof func != 'function') {
  10712. throw new TypeError(FUNC_ERROR_TEXT);
  10713. }
  10714. n = toInteger(n);
  10715. return function() {
  10716. if (--n > 0) {
  10717. result = func.apply(this, arguments);
  10718. }
  10719. if (n <= 1) {
  10720. func = undefined;
  10721. }
  10722. return result;
  10723. };
  10724. }
  10725. /**
  10726. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10727. * and `partials` prepended to the arguments it receives.
  10728. *
  10729. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10730. * may be used as a placeholder for partially applied arguments.
  10731. *
  10732. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10733. * property of bound functions.
  10734. *
  10735. * @static
  10736. * @memberOf _
  10737. * @since 0.1.0
  10738. * @category Function
  10739. * @param {Function} func The function to bind.
  10740. * @param {*} thisArg The `this` binding of `func`.
  10741. * @param {...*} [partials] The arguments to be partially applied.
  10742. * @returns {Function} Returns the new bound function.
  10743. * @example
  10744. *
  10745. * function greet(greeting, punctuation) {
  10746. * return greeting + ' ' + this.user + punctuation;
  10747. * }
  10748. *
  10749. * var object = { 'user': 'fred' };
  10750. *
  10751. * var bound = _.bind(greet, object, 'hi');
  10752. * bound('!');
  10753. * // => 'hi fred!'
  10754. *
  10755. * // Bound with placeholders.
  10756. * var bound = _.bind(greet, object, _, '!');
  10757. * bound('hi');
  10758. * // => 'hi fred!'
  10759. */
  10760. var bind = baseRest(function(func, thisArg, partials) {
  10761. var bitmask = WRAP_BIND_FLAG;
  10762. if (partials.length) {
  10763. var holders = replaceHolders(partials, getHolder(bind));
  10764. bitmask |= WRAP_PARTIAL_FLAG;
  10765. }
  10766. return createWrap(func, bitmask, thisArg, partials, holders);
  10767. });
  10768. /**
  10769. * Creates a function that invokes the method at `object[key]` with `partials`
  10770. * prepended to the arguments it receives.
  10771. *
  10772. * This method differs from `_.bind` by allowing bound functions to reference
  10773. * methods that may be redefined or don't yet exist. See
  10774. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10775. * for more details.
  10776. *
  10777. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10778. * builds, may be used as a placeholder for partially applied arguments.
  10779. *
  10780. * @static
  10781. * @memberOf _
  10782. * @since 0.10.0
  10783. * @category Function
  10784. * @param {Object} object The object to invoke the method on.
  10785. * @param {string} key The key of the method.
  10786. * @param {...*} [partials] The arguments to be partially applied.
  10787. * @returns {Function} Returns the new bound function.
  10788. * @example
  10789. *
  10790. * var object = {
  10791. * 'user': 'fred',
  10792. * 'greet': function(greeting, punctuation) {
  10793. * return greeting + ' ' + this.user + punctuation;
  10794. * }
  10795. * };
  10796. *
  10797. * var bound = _.bindKey(object, 'greet', 'hi');
  10798. * bound('!');
  10799. * // => 'hi fred!'
  10800. *
  10801. * object.greet = function(greeting, punctuation) {
  10802. * return greeting + 'ya ' + this.user + punctuation;
  10803. * };
  10804. *
  10805. * bound('!');
  10806. * // => 'hiya fred!'
  10807. *
  10808. * // Bound with placeholders.
  10809. * var bound = _.bindKey(object, 'greet', _, '!');
  10810. * bound('hi');
  10811. * // => 'hiya fred!'
  10812. */
  10813. var bindKey = baseRest(function(object, key, partials) {
  10814. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10815. if (partials.length) {
  10816. var holders = replaceHolders(partials, getHolder(bindKey));
  10817. bitmask |= WRAP_PARTIAL_FLAG;
  10818. }
  10819. return createWrap(key, bitmask, object, partials, holders);
  10820. });
  10821. /**
  10822. * Creates a function that accepts arguments of `func` and either invokes
  10823. * `func` returning its result, if at least `arity` number of arguments have
  10824. * been provided, or returns a function that accepts the remaining `func`
  10825. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10826. * is not sufficient.
  10827. *
  10828. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10829. * may be used as a placeholder for provided arguments.
  10830. *
  10831. * **Note:** This method doesn't set the "length" property of curried functions.
  10832. *
  10833. * @static
  10834. * @memberOf _
  10835. * @since 2.0.0
  10836. * @category Function
  10837. * @param {Function} func The function to curry.
  10838. * @param {number} [arity=func.length] The arity of `func`.
  10839. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10840. * @returns {Function} Returns the new curried function.
  10841. * @example
  10842. *
  10843. * var abc = function(a, b, c) {
  10844. * return [a, b, c];
  10845. * };
  10846. *
  10847. * var curried = _.curry(abc);
  10848. *
  10849. * curried(1)(2)(3);
  10850. * // => [1, 2, 3]
  10851. *
  10852. * curried(1, 2)(3);
  10853. * // => [1, 2, 3]
  10854. *
  10855. * curried(1, 2, 3);
  10856. * // => [1, 2, 3]
  10857. *
  10858. * // Curried with placeholders.
  10859. * curried(1)(_, 3)(2);
  10860. * // => [1, 2, 3]
  10861. */
  10862. function curry(func, arity, guard) {
  10863. arity = guard ? undefined : arity;
  10864. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10865. result.placeholder = curry.placeholder;
  10866. return result;
  10867. }
  10868. /**
  10869. * This method is like `_.curry` except that arguments are applied to `func`
  10870. * in the manner of `_.partialRight` instead of `_.partial`.
  10871. *
  10872. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10873. * builds, may be used as a placeholder for provided arguments.
  10874. *
  10875. * **Note:** This method doesn't set the "length" property of curried functions.
  10876. *
  10877. * @static
  10878. * @memberOf _
  10879. * @since 3.0.0
  10880. * @category Function
  10881. * @param {Function} func The function to curry.
  10882. * @param {number} [arity=func.length] The arity of `func`.
  10883. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10884. * @returns {Function} Returns the new curried function.
  10885. * @example
  10886. *
  10887. * var abc = function(a, b, c) {
  10888. * return [a, b, c];
  10889. * };
  10890. *
  10891. * var curried = _.curryRight(abc);
  10892. *
  10893. * curried(3)(2)(1);
  10894. * // => [1, 2, 3]
  10895. *
  10896. * curried(2, 3)(1);
  10897. * // => [1, 2, 3]
  10898. *
  10899. * curried(1, 2, 3);
  10900. * // => [1, 2, 3]
  10901. *
  10902. * // Curried with placeholders.
  10903. * curried(3)(1, _)(2);
  10904. * // => [1, 2, 3]
  10905. */
  10906. function curryRight(func, arity, guard) {
  10907. arity = guard ? undefined : arity;
  10908. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10909. result.placeholder = curryRight.placeholder;
  10910. return result;
  10911. }
  10912. /**
  10913. * Creates a debounced function that delays invoking `func` until after `wait`
  10914. * milliseconds have elapsed since the last time the debounced function was
  10915. * invoked. The debounced function comes with a `cancel` method to cancel
  10916. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10917. * Provide `options` to indicate whether `func` should be invoked on the
  10918. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10919. * with the last arguments provided to the debounced function. Subsequent
  10920. * calls to the debounced function return the result of the last `func`
  10921. * invocation.
  10922. *
  10923. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10924. * invoked on the trailing edge of the timeout only if the debounced function
  10925. * is invoked more than once during the `wait` timeout.
  10926. *
  10927. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10928. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10929. *
  10930. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10931. * for details over the differences between `_.debounce` and `_.throttle`.
  10932. *
  10933. * @static
  10934. * @memberOf _
  10935. * @since 0.1.0
  10936. * @category Function
  10937. * @param {Function} func The function to debounce.
  10938. * @param {number} [wait=0] The number of milliseconds to delay.
  10939. * @param {Object} [options={}] The options object.
  10940. * @param {boolean} [options.leading=false]
  10941. * Specify invoking on the leading edge of the timeout.
  10942. * @param {number} [options.maxWait]
  10943. * The maximum time `func` is allowed to be delayed before it's invoked.
  10944. * @param {boolean} [options.trailing=true]
  10945. * Specify invoking on the trailing edge of the timeout.
  10946. * @returns {Function} Returns the new debounced function.
  10947. * @example
  10948. *
  10949. * // Avoid costly calculations while the window size is in flux.
  10950. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10951. *
  10952. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10953. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10954. * 'leading': true,
  10955. * 'trailing': false
  10956. * }));
  10957. *
  10958. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10959. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10960. * var source = new EventSource('/stream');
  10961. * jQuery(source).on('message', debounced);
  10962. *
  10963. * // Cancel the trailing debounced invocation.
  10964. * jQuery(window).on('popstate', debounced.cancel);
  10965. */
  10966. function debounce(func, wait, options) {
  10967. var lastArgs,
  10968. lastThis,
  10969. maxWait,
  10970. result,
  10971. timerId,
  10972. lastCallTime,
  10973. lastInvokeTime = 0,
  10974. leading = false,
  10975. maxing = false,
  10976. trailing = true;
  10977. if (typeof func != 'function') {
  10978. throw new TypeError(FUNC_ERROR_TEXT);
  10979. }
  10980. wait = toNumber(wait) || 0;
  10981. if (isObject(options)) {
  10982. leading = !!options.leading;
  10983. maxing = 'maxWait' in options;
  10984. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10985. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10986. }
  10987. function invokeFunc(time) {
  10988. var args = lastArgs,
  10989. thisArg = lastThis;
  10990. lastArgs = lastThis = undefined;
  10991. lastInvokeTime = time;
  10992. result = func.apply(thisArg, args);
  10993. return result;
  10994. }
  10995. function leadingEdge(time) {
  10996. // Reset any `maxWait` timer.
  10997. lastInvokeTime = time;
  10998. // Start the timer for the trailing edge.
  10999. timerId = setTimeout(timerExpired, wait);
  11000. // Invoke the leading edge.
  11001. return leading ? invokeFunc(time) : result;
  11002. }
  11003. function remainingWait(time) {
  11004. var timeSinceLastCall = time - lastCallTime,
  11005. timeSinceLastInvoke = time - lastInvokeTime,
  11006. timeWaiting = wait - timeSinceLastCall;
  11007. return maxing
  11008. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  11009. : timeWaiting;
  11010. }
  11011. function shouldInvoke(time) {
  11012. var timeSinceLastCall = time - lastCallTime,
  11013. timeSinceLastInvoke = time - lastInvokeTime;
  11014. // Either this is the first call, activity has stopped and we're at the
  11015. // trailing edge, the system time has gone backwards and we're treating
  11016. // it as the trailing edge, or we've hit the `maxWait` limit.
  11017. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  11018. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  11019. }
  11020. function timerExpired() {
  11021. var time = now();
  11022. if (shouldInvoke(time)) {
  11023. return trailingEdge(time);
  11024. }
  11025. // Restart the timer.
  11026. timerId = setTimeout(timerExpired, remainingWait(time));
  11027. }
  11028. function trailingEdge(time) {
  11029. timerId = undefined;
  11030. // Only invoke if we have `lastArgs` which means `func` has been
  11031. // debounced at least once.
  11032. if (trailing && lastArgs) {
  11033. return invokeFunc(time);
  11034. }
  11035. lastArgs = lastThis = undefined;
  11036. return result;
  11037. }
  11038. function cancel() {
  11039. if (timerId !== undefined) {
  11040. clearTimeout(timerId);
  11041. }
  11042. lastInvokeTime = 0;
  11043. lastArgs = lastCallTime = lastThis = timerId = undefined;
  11044. }
  11045. function flush() {
  11046. return timerId === undefined ? result : trailingEdge(now());
  11047. }
  11048. function debounced() {
  11049. var time = now(),
  11050. isInvoking = shouldInvoke(time);
  11051. lastArgs = arguments;
  11052. lastThis = this;
  11053. lastCallTime = time;
  11054. if (isInvoking) {
  11055. if (timerId === undefined) {
  11056. return leadingEdge(lastCallTime);
  11057. }
  11058. if (maxing) {
  11059. // Handle invocations in a tight loop.
  11060. clearTimeout(timerId);
  11061. timerId = setTimeout(timerExpired, wait);
  11062. return invokeFunc(lastCallTime);
  11063. }
  11064. }
  11065. if (timerId === undefined) {
  11066. timerId = setTimeout(timerExpired, wait);
  11067. }
  11068. return result;
  11069. }
  11070. debounced.cancel = cancel;
  11071. debounced.flush = flush;
  11072. return debounced;
  11073. }
  11074. /**
  11075. * Defers invoking the `func` until the current call stack has cleared. Any
  11076. * additional arguments are provided to `func` when it's invoked.
  11077. *
  11078. * @static
  11079. * @memberOf _
  11080. * @since 0.1.0
  11081. * @category Function
  11082. * @param {Function} func The function to defer.
  11083. * @param {...*} [args] The arguments to invoke `func` with.
  11084. * @returns {number} Returns the timer id.
  11085. * @example
  11086. *
  11087. * _.defer(function(text) {
  11088. * console.log(text);
  11089. * }, 'deferred');
  11090. * // => Logs 'deferred' after one millisecond.
  11091. */
  11092. var defer = baseRest(function(func, args) {
  11093. return baseDelay(func, 1, args);
  11094. });
  11095. /**
  11096. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11097. * provided to `func` when it's invoked.
  11098. *
  11099. * @static
  11100. * @memberOf _
  11101. * @since 0.1.0
  11102. * @category Function
  11103. * @param {Function} func The function to delay.
  11104. * @param {number} wait The number of milliseconds to delay invocation.
  11105. * @param {...*} [args] The arguments to invoke `func` with.
  11106. * @returns {number} Returns the timer id.
  11107. * @example
  11108. *
  11109. * _.delay(function(text) {
  11110. * console.log(text);
  11111. * }, 1000, 'later');
  11112. * // => Logs 'later' after one second.
  11113. */
  11114. var delay = baseRest(function(func, wait, args) {
  11115. return baseDelay(func, toNumber(wait) || 0, args);
  11116. });
  11117. /**
  11118. * Creates a function that invokes `func` with arguments reversed.
  11119. *
  11120. * @static
  11121. * @memberOf _
  11122. * @since 4.0.0
  11123. * @category Function
  11124. * @param {Function} func The function to flip arguments for.
  11125. * @returns {Function} Returns the new flipped function.
  11126. * @example
  11127. *
  11128. * var flipped = _.flip(function() {
  11129. * return _.toArray(arguments);
  11130. * });
  11131. *
  11132. * flipped('a', 'b', 'c', 'd');
  11133. * // => ['d', 'c', 'b', 'a']
  11134. */
  11135. function flip(func) {
  11136. return createWrap(func, WRAP_FLIP_FLAG);
  11137. }
  11138. /**
  11139. * Creates a function that memoizes the result of `func`. If `resolver` is
  11140. * provided, it determines the cache key for storing the result based on the
  11141. * arguments provided to the memoized function. By default, the first argument
  11142. * provided to the memoized function is used as the map cache key. The `func`
  11143. * is invoked with the `this` binding of the memoized function.
  11144. *
  11145. * **Note:** The cache is exposed as the `cache` property on the memoized
  11146. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11147. * constructor with one whose instances implement the
  11148. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11149. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11150. *
  11151. * @static
  11152. * @memberOf _
  11153. * @since 0.1.0
  11154. * @category Function
  11155. * @param {Function} func The function to have its output memoized.
  11156. * @param {Function} [resolver] The function to resolve the cache key.
  11157. * @returns {Function} Returns the new memoized function.
  11158. * @example
  11159. *
  11160. * var object = { 'a': 1, 'b': 2 };
  11161. * var other = { 'c': 3, 'd': 4 };
  11162. *
  11163. * var values = _.memoize(_.values);
  11164. * values(object);
  11165. * // => [1, 2]
  11166. *
  11167. * values(other);
  11168. * // => [3, 4]
  11169. *
  11170. * object.a = 2;
  11171. * values(object);
  11172. * // => [1, 2]
  11173. *
  11174. * // Modify the result cache.
  11175. * values.cache.set(object, ['a', 'b']);
  11176. * values(object);
  11177. * // => ['a', 'b']
  11178. *
  11179. * // Replace `_.memoize.Cache`.
  11180. * _.memoize.Cache = WeakMap;
  11181. */
  11182. function memoize(func, resolver) {
  11183. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11184. throw new TypeError(FUNC_ERROR_TEXT);
  11185. }
  11186. var memoized = function() {
  11187. var args = arguments,
  11188. key = resolver ? resolver.apply(this, args) : args[0],
  11189. cache = memoized.cache;
  11190. if (cache.has(key)) {
  11191. return cache.get(key);
  11192. }
  11193. var result = func.apply(this, args);
  11194. memoized.cache = cache.set(key, result) || cache;
  11195. return result;
  11196. };
  11197. memoized.cache = new (memoize.Cache || MapCache);
  11198. return memoized;
  11199. }
  11200. // Expose `MapCache`.
  11201. memoize.Cache = MapCache;
  11202. /**
  11203. * Creates a function that negates the result of the predicate `func`. The
  11204. * `func` predicate is invoked with the `this` binding and arguments of the
  11205. * created function.
  11206. *
  11207. * @static
  11208. * @memberOf _
  11209. * @since 3.0.0
  11210. * @category Function
  11211. * @param {Function} predicate The predicate to negate.
  11212. * @returns {Function} Returns the new negated function.
  11213. * @example
  11214. *
  11215. * function isEven(n) {
  11216. * return n % 2 == 0;
  11217. * }
  11218. *
  11219. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11220. * // => [1, 3, 5]
  11221. */
  11222. function negate(predicate) {
  11223. if (typeof predicate != 'function') {
  11224. throw new TypeError(FUNC_ERROR_TEXT);
  11225. }
  11226. return function() {
  11227. var args = arguments;
  11228. switch (args.length) {
  11229. case 0: return !predicate.call(this);
  11230. case 1: return !predicate.call(this, args[0]);
  11231. case 2: return !predicate.call(this, args[0], args[1]);
  11232. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11233. }
  11234. return !predicate.apply(this, args);
  11235. };
  11236. }
  11237. /**
  11238. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11239. * to the function return the value of the first invocation. The `func` is
  11240. * invoked with the `this` binding and arguments of the created function.
  11241. *
  11242. * @static
  11243. * @memberOf _
  11244. * @since 0.1.0
  11245. * @category Function
  11246. * @param {Function} func The function to restrict.
  11247. * @returns {Function} Returns the new restricted function.
  11248. * @example
  11249. *
  11250. * var initialize = _.once(createApplication);
  11251. * initialize();
  11252. * initialize();
  11253. * // => `createApplication` is invoked once
  11254. */
  11255. function once(func) {
  11256. return before(2, func);
  11257. }
  11258. /**
  11259. * Creates a function that invokes `func` with its arguments transformed.
  11260. *
  11261. * @static
  11262. * @since 4.0.0
  11263. * @memberOf _
  11264. * @category Function
  11265. * @param {Function} func The function to wrap.
  11266. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11267. * The argument transforms.
  11268. * @returns {Function} Returns the new function.
  11269. * @example
  11270. *
  11271. * function doubled(n) {
  11272. * return n * 2;
  11273. * }
  11274. *
  11275. * function square(n) {
  11276. * return n * n;
  11277. * }
  11278. *
  11279. * var func = _.overArgs(function(x, y) {
  11280. * return [x, y];
  11281. * }, [square, doubled]);
  11282. *
  11283. * func(9, 3);
  11284. * // => [81, 6]
  11285. *
  11286. * func(10, 5);
  11287. * // => [100, 10]
  11288. */
  11289. var overArgs = castRest(function(func, transforms) {
  11290. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11291. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11292. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11293. var funcsLength = transforms.length;
  11294. return baseRest(function(args) {
  11295. var index = -1,
  11296. length = nativeMin(args.length, funcsLength);
  11297. while (++index < length) {
  11298. args[index] = transforms[index].call(this, args[index]);
  11299. }
  11300. return apply(func, this, args);
  11301. });
  11302. });
  11303. /**
  11304. * Creates a function that invokes `func` with `partials` prepended to the
  11305. * arguments it receives. This method is like `_.bind` except it does **not**
  11306. * alter the `this` binding.
  11307. *
  11308. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11309. * builds, may be used as a placeholder for partially applied arguments.
  11310. *
  11311. * **Note:** This method doesn't set the "length" property of partially
  11312. * applied functions.
  11313. *
  11314. * @static
  11315. * @memberOf _
  11316. * @since 0.2.0
  11317. * @category Function
  11318. * @param {Function} func The function to partially apply arguments to.
  11319. * @param {...*} [partials] The arguments to be partially applied.
  11320. * @returns {Function} Returns the new partially applied function.
  11321. * @example
  11322. *
  11323. * function greet(greeting, name) {
  11324. * return greeting + ' ' + name;
  11325. * }
  11326. *
  11327. * var sayHelloTo = _.partial(greet, 'hello');
  11328. * sayHelloTo('fred');
  11329. * // => 'hello fred'
  11330. *
  11331. * // Partially applied with placeholders.
  11332. * var greetFred = _.partial(greet, _, 'fred');
  11333. * greetFred('hi');
  11334. * // => 'hi fred'
  11335. */
  11336. var partial = baseRest(function(func, partials) {
  11337. var holders = replaceHolders(partials, getHolder(partial));
  11338. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11339. });
  11340. /**
  11341. * This method is like `_.partial` except that partially applied arguments
  11342. * are appended to the arguments it receives.
  11343. *
  11344. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11345. * builds, may be used as a placeholder for partially applied arguments.
  11346. *
  11347. * **Note:** This method doesn't set the "length" property of partially
  11348. * applied functions.
  11349. *
  11350. * @static
  11351. * @memberOf _
  11352. * @since 1.0.0
  11353. * @category Function
  11354. * @param {Function} func The function to partially apply arguments to.
  11355. * @param {...*} [partials] The arguments to be partially applied.
  11356. * @returns {Function} Returns the new partially applied function.
  11357. * @example
  11358. *
  11359. * function greet(greeting, name) {
  11360. * return greeting + ' ' + name;
  11361. * }
  11362. *
  11363. * var greetFred = _.partialRight(greet, 'fred');
  11364. * greetFred('hi');
  11365. * // => 'hi fred'
  11366. *
  11367. * // Partially applied with placeholders.
  11368. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11369. * sayHelloTo('fred');
  11370. * // => 'hello fred'
  11371. */
  11372. var partialRight = baseRest(function(func, partials) {
  11373. var holders = replaceHolders(partials, getHolder(partialRight));
  11374. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11375. });
  11376. /**
  11377. * Creates a function that invokes `func` with arguments arranged according
  11378. * to the specified `indexes` where the argument value at the first index is
  11379. * provided as the first argument, the argument value at the second index is
  11380. * provided as the second argument, and so on.
  11381. *
  11382. * @static
  11383. * @memberOf _
  11384. * @since 3.0.0
  11385. * @category Function
  11386. * @param {Function} func The function to rearrange arguments for.
  11387. * @param {...(number|number[])} indexes The arranged argument indexes.
  11388. * @returns {Function} Returns the new function.
  11389. * @example
  11390. *
  11391. * var rearged = _.rearg(function(a, b, c) {
  11392. * return [a, b, c];
  11393. * }, [2, 0, 1]);
  11394. *
  11395. * rearged('b', 'c', 'a')
  11396. * // => ['a', 'b', 'c']
  11397. */
  11398. var rearg = flatRest(function(func, indexes) {
  11399. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11400. });
  11401. /**
  11402. * Creates a function that invokes `func` with the `this` binding of the
  11403. * created function and arguments from `start` and beyond provided as
  11404. * an array.
  11405. *
  11406. * **Note:** This method is based on the
  11407. * [rest parameter](https://mdn.io/rest_parameters).
  11408. *
  11409. * @static
  11410. * @memberOf _
  11411. * @since 4.0.0
  11412. * @category Function
  11413. * @param {Function} func The function to apply a rest parameter to.
  11414. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11415. * @returns {Function} Returns the new function.
  11416. * @example
  11417. *
  11418. * var say = _.rest(function(what, names) {
  11419. * return what + ' ' + _.initial(names).join(', ') +
  11420. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11421. * });
  11422. *
  11423. * say('hello', 'fred', 'barney', 'pebbles');
  11424. * // => 'hello fred, barney, & pebbles'
  11425. */
  11426. function rest(func, start) {
  11427. if (typeof func != 'function') {
  11428. throw new TypeError(FUNC_ERROR_TEXT);
  11429. }
  11430. start = start === undefined ? start : toInteger(start);
  11431. return baseRest(func, start);
  11432. }
  11433. /**
  11434. * Creates a function that invokes `func` with the `this` binding of the
  11435. * create function and an array of arguments much like
  11436. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11437. *
  11438. * **Note:** This method is based on the
  11439. * [spread operator](https://mdn.io/spread_operator).
  11440. *
  11441. * @static
  11442. * @memberOf _
  11443. * @since 3.2.0
  11444. * @category Function
  11445. * @param {Function} func The function to spread arguments over.
  11446. * @param {number} [start=0] The start position of the spread.
  11447. * @returns {Function} Returns the new function.
  11448. * @example
  11449. *
  11450. * var say = _.spread(function(who, what) {
  11451. * return who + ' says ' + what;
  11452. * });
  11453. *
  11454. * say(['fred', 'hello']);
  11455. * // => 'fred says hello'
  11456. *
  11457. * var numbers = Promise.all([
  11458. * Promise.resolve(40),
  11459. * Promise.resolve(36)
  11460. * ]);
  11461. *
  11462. * numbers.then(_.spread(function(x, y) {
  11463. * return x + y;
  11464. * }));
  11465. * // => a Promise of 76
  11466. */
  11467. function spread(func, start) {
  11468. if (typeof func != 'function') {
  11469. throw new TypeError(FUNC_ERROR_TEXT);
  11470. }
  11471. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11472. return baseRest(function(args) {
  11473. var array = args[start],
  11474. otherArgs = castSlice(args, 0, start);
  11475. if (array) {
  11476. arrayPush(otherArgs, array);
  11477. }
  11478. return apply(func, this, otherArgs);
  11479. });
  11480. }
  11481. /**
  11482. * Creates a throttled function that only invokes `func` at most once per
  11483. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11484. * method to cancel delayed `func` invocations and a `flush` method to
  11485. * immediately invoke them. Provide `options` to indicate whether `func`
  11486. * should be invoked on the leading and/or trailing edge of the `wait`
  11487. * timeout. The `func` is invoked with the last arguments provided to the
  11488. * throttled function. Subsequent calls to the throttled function return the
  11489. * result of the last `func` invocation.
  11490. *
  11491. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11492. * invoked on the trailing edge of the timeout only if the throttled function
  11493. * is invoked more than once during the `wait` timeout.
  11494. *
  11495. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11496. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11497. *
  11498. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11499. * for details over the differences between `_.throttle` and `_.debounce`.
  11500. *
  11501. * @static
  11502. * @memberOf _
  11503. * @since 0.1.0
  11504. * @category Function
  11505. * @param {Function} func The function to throttle.
  11506. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11507. * @param {Object} [options={}] The options object.
  11508. * @param {boolean} [options.leading=true]
  11509. * Specify invoking on the leading edge of the timeout.
  11510. * @param {boolean} [options.trailing=true]
  11511. * Specify invoking on the trailing edge of the timeout.
  11512. * @returns {Function} Returns the new throttled function.
  11513. * @example
  11514. *
  11515. * // Avoid excessively updating the position while scrolling.
  11516. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11517. *
  11518. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11519. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11520. * jQuery(element).on('click', throttled);
  11521. *
  11522. * // Cancel the trailing throttled invocation.
  11523. * jQuery(window).on('popstate', throttled.cancel);
  11524. */
  11525. function throttle(func, wait, options) {
  11526. var leading = true,
  11527. trailing = true;
  11528. if (typeof func != 'function') {
  11529. throw new TypeError(FUNC_ERROR_TEXT);
  11530. }
  11531. if (isObject(options)) {
  11532. leading = 'leading' in options ? !!options.leading : leading;
  11533. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11534. }
  11535. return debounce(func, wait, {
  11536. 'leading': leading,
  11537. 'maxWait': wait,
  11538. 'trailing': trailing
  11539. });
  11540. }
  11541. /**
  11542. * Creates a function that accepts up to one argument, ignoring any
  11543. * additional arguments.
  11544. *
  11545. * @static
  11546. * @memberOf _
  11547. * @since 4.0.0
  11548. * @category Function
  11549. * @param {Function} func The function to cap arguments for.
  11550. * @returns {Function} Returns the new capped function.
  11551. * @example
  11552. *
  11553. * _.map(['6', '8', '10'], _.unary(parseInt));
  11554. * // => [6, 8, 10]
  11555. */
  11556. function unary(func) {
  11557. return ary(func, 1);
  11558. }
  11559. /**
  11560. * Creates a function that provides `value` to `wrapper` as its first
  11561. * argument. Any additional arguments provided to the function are appended
  11562. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11563. * binding of the created function.
  11564. *
  11565. * @static
  11566. * @memberOf _
  11567. * @since 0.1.0
  11568. * @category Function
  11569. * @param {*} value The value to wrap.
  11570. * @param {Function} [wrapper=identity] The wrapper function.
  11571. * @returns {Function} Returns the new function.
  11572. * @example
  11573. *
  11574. * var p = _.wrap(_.escape, function(func, text) {
  11575. * return '<p>' + func(text) + '</p>';
  11576. * });
  11577. *
  11578. * p('fred, barney, & pebbles');
  11579. * // => '<p>fred, barney, &amp; pebbles</p>'
  11580. */
  11581. function wrap(value, wrapper) {
  11582. return partial(castFunction(wrapper), value);
  11583. }
  11584. /*------------------------------------------------------------------------*/
  11585. /**
  11586. * Casts `value` as an array if it's not one.
  11587. *
  11588. * @static
  11589. * @memberOf _
  11590. * @since 4.4.0
  11591. * @category Lang
  11592. * @param {*} value The value to inspect.
  11593. * @returns {Array} Returns the cast array.
  11594. * @example
  11595. *
  11596. * _.castArray(1);
  11597. * // => [1]
  11598. *
  11599. * _.castArray({ 'a': 1 });
  11600. * // => [{ 'a': 1 }]
  11601. *
  11602. * _.castArray('abc');
  11603. * // => ['abc']
  11604. *
  11605. * _.castArray(null);
  11606. * // => [null]
  11607. *
  11608. * _.castArray(undefined);
  11609. * // => [undefined]
  11610. *
  11611. * _.castArray();
  11612. * // => []
  11613. *
  11614. * var array = [1, 2, 3];
  11615. * console.log(_.castArray(array) === array);
  11616. * // => true
  11617. */
  11618. function castArray() {
  11619. if (!arguments.length) {
  11620. return [];
  11621. }
  11622. var value = arguments[0];
  11623. return isArray(value) ? value : [value];
  11624. }
  11625. /**
  11626. * Creates a shallow clone of `value`.
  11627. *
  11628. * **Note:** This method is loosely based on the
  11629. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11630. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11631. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11632. * arrays. The own enumerable properties of `arguments` objects are cloned
  11633. * as plain objects. An empty object is returned for uncloneable values such
  11634. * as error objects, functions, DOM nodes, and WeakMaps.
  11635. *
  11636. * @static
  11637. * @memberOf _
  11638. * @since 0.1.0
  11639. * @category Lang
  11640. * @param {*} value The value to clone.
  11641. * @returns {*} Returns the cloned value.
  11642. * @see _.cloneDeep
  11643. * @example
  11644. *
  11645. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11646. *
  11647. * var shallow = _.clone(objects);
  11648. * console.log(shallow[0] === objects[0]);
  11649. * // => true
  11650. */
  11651. function clone(value) {
  11652. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11653. }
  11654. /**
  11655. * This method is like `_.clone` except that it accepts `customizer` which
  11656. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11657. * cloning is handled by the method instead. The `customizer` is invoked with
  11658. * up to four arguments; (value [, index|key, object, stack]).
  11659. *
  11660. * @static
  11661. * @memberOf _
  11662. * @since 4.0.0
  11663. * @category Lang
  11664. * @param {*} value The value to clone.
  11665. * @param {Function} [customizer] The function to customize cloning.
  11666. * @returns {*} Returns the cloned value.
  11667. * @see _.cloneDeepWith
  11668. * @example
  11669. *
  11670. * function customizer(value) {
  11671. * if (_.isElement(value)) {
  11672. * return value.cloneNode(false);
  11673. * }
  11674. * }
  11675. *
  11676. * var el = _.cloneWith(document.body, customizer);
  11677. *
  11678. * console.log(el === document.body);
  11679. * // => false
  11680. * console.log(el.nodeName);
  11681. * // => 'BODY'
  11682. * console.log(el.childNodes.length);
  11683. * // => 0
  11684. */
  11685. function cloneWith(value, customizer) {
  11686. customizer = typeof customizer == 'function' ? customizer : undefined;
  11687. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11688. }
  11689. /**
  11690. * This method is like `_.clone` except that it recursively clones `value`.
  11691. *
  11692. * @static
  11693. * @memberOf _
  11694. * @since 1.0.0
  11695. * @category Lang
  11696. * @param {*} value The value to recursively clone.
  11697. * @returns {*} Returns the deep cloned value.
  11698. * @see _.clone
  11699. * @example
  11700. *
  11701. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11702. *
  11703. * var deep = _.cloneDeep(objects);
  11704. * console.log(deep[0] === objects[0]);
  11705. * // => false
  11706. */
  11707. function cloneDeep(value) {
  11708. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11709. }
  11710. /**
  11711. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11712. *
  11713. * @static
  11714. * @memberOf _
  11715. * @since 4.0.0
  11716. * @category Lang
  11717. * @param {*} value The value to recursively clone.
  11718. * @param {Function} [customizer] The function to customize cloning.
  11719. * @returns {*} Returns the deep cloned value.
  11720. * @see _.cloneWith
  11721. * @example
  11722. *
  11723. * function customizer(value) {
  11724. * if (_.isElement(value)) {
  11725. * return value.cloneNode(true);
  11726. * }
  11727. * }
  11728. *
  11729. * var el = _.cloneDeepWith(document.body, customizer);
  11730. *
  11731. * console.log(el === document.body);
  11732. * // => false
  11733. * console.log(el.nodeName);
  11734. * // => 'BODY'
  11735. * console.log(el.childNodes.length);
  11736. * // => 20
  11737. */
  11738. function cloneDeepWith(value, customizer) {
  11739. customizer = typeof customizer == 'function' ? customizer : undefined;
  11740. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11741. }
  11742. /**
  11743. * Checks if `object` conforms to `source` by invoking the predicate
  11744. * properties of `source` with the corresponding property values of `object`.
  11745. *
  11746. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11747. * partially applied.
  11748. *
  11749. * @static
  11750. * @memberOf _
  11751. * @since 4.14.0
  11752. * @category Lang
  11753. * @param {Object} object The object to inspect.
  11754. * @param {Object} source The object of property predicates to conform to.
  11755. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11756. * @example
  11757. *
  11758. * var object = { 'a': 1, 'b': 2 };
  11759. *
  11760. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11761. * // => true
  11762. *
  11763. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11764. * // => false
  11765. */
  11766. function conformsTo(object, source) {
  11767. return source == null || baseConformsTo(object, source, keys(source));
  11768. }
  11769. /**
  11770. * Performs a
  11771. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11772. * comparison between two values to determine if they are equivalent.
  11773. *
  11774. * @static
  11775. * @memberOf _
  11776. * @since 4.0.0
  11777. * @category Lang
  11778. * @param {*} value The value to compare.
  11779. * @param {*} other The other value to compare.
  11780. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11781. * @example
  11782. *
  11783. * var object = { 'a': 1 };
  11784. * var other = { 'a': 1 };
  11785. *
  11786. * _.eq(object, object);
  11787. * // => true
  11788. *
  11789. * _.eq(object, other);
  11790. * // => false
  11791. *
  11792. * _.eq('a', 'a');
  11793. * // => true
  11794. *
  11795. * _.eq('a', Object('a'));
  11796. * // => false
  11797. *
  11798. * _.eq(NaN, NaN);
  11799. * // => true
  11800. */
  11801. function eq(value, other) {
  11802. return value === other || (value !== value && other !== other);
  11803. }
  11804. /**
  11805. * Checks if `value` is greater than `other`.
  11806. *
  11807. * @static
  11808. * @memberOf _
  11809. * @since 3.9.0
  11810. * @category Lang
  11811. * @param {*} value The value to compare.
  11812. * @param {*} other The other value to compare.
  11813. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11814. * else `false`.
  11815. * @see _.lt
  11816. * @example
  11817. *
  11818. * _.gt(3, 1);
  11819. * // => true
  11820. *
  11821. * _.gt(3, 3);
  11822. * // => false
  11823. *
  11824. * _.gt(1, 3);
  11825. * // => false
  11826. */
  11827. var gt = createRelationalOperation(baseGt);
  11828. /**
  11829. * Checks if `value` is greater than or equal to `other`.
  11830. *
  11831. * @static
  11832. * @memberOf _
  11833. * @since 3.9.0
  11834. * @category Lang
  11835. * @param {*} value The value to compare.
  11836. * @param {*} other The other value to compare.
  11837. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11838. * `other`, else `false`.
  11839. * @see _.lte
  11840. * @example
  11841. *
  11842. * _.gte(3, 1);
  11843. * // => true
  11844. *
  11845. * _.gte(3, 3);
  11846. * // => true
  11847. *
  11848. * _.gte(1, 3);
  11849. * // => false
  11850. */
  11851. var gte = createRelationalOperation(function(value, other) {
  11852. return value >= other;
  11853. });
  11854. /**
  11855. * Checks if `value` is likely an `arguments` object.
  11856. *
  11857. * @static
  11858. * @memberOf _
  11859. * @since 0.1.0
  11860. * @category Lang
  11861. * @param {*} value The value to check.
  11862. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11863. * else `false`.
  11864. * @example
  11865. *
  11866. * _.isArguments(function() { return arguments; }());
  11867. * // => true
  11868. *
  11869. * _.isArguments([1, 2, 3]);
  11870. * // => false
  11871. */
  11872. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11873. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11874. !propertyIsEnumerable.call(value, 'callee');
  11875. };
  11876. /**
  11877. * Checks if `value` is classified as an `Array` object.
  11878. *
  11879. * @static
  11880. * @memberOf _
  11881. * @since 0.1.0
  11882. * @category Lang
  11883. * @param {*} value The value to check.
  11884. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11885. * @example
  11886. *
  11887. * _.isArray([1, 2, 3]);
  11888. * // => true
  11889. *
  11890. * _.isArray(document.body.children);
  11891. * // => false
  11892. *
  11893. * _.isArray('abc');
  11894. * // => false
  11895. *
  11896. * _.isArray(_.noop);
  11897. * // => false
  11898. */
  11899. var isArray = Array.isArray;
  11900. /**
  11901. * Checks if `value` is classified as an `ArrayBuffer` object.
  11902. *
  11903. * @static
  11904. * @memberOf _
  11905. * @since 4.3.0
  11906. * @category Lang
  11907. * @param {*} value The value to check.
  11908. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11909. * @example
  11910. *
  11911. * _.isArrayBuffer(new ArrayBuffer(2));
  11912. * // => true
  11913. *
  11914. * _.isArrayBuffer(new Array(2));
  11915. * // => false
  11916. */
  11917. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11918. /**
  11919. * Checks if `value` is array-like. A value is considered array-like if it's
  11920. * not a function and has a `value.length` that's an integer greater than or
  11921. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11922. *
  11923. * @static
  11924. * @memberOf _
  11925. * @since 4.0.0
  11926. * @category Lang
  11927. * @param {*} value The value to check.
  11928. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11929. * @example
  11930. *
  11931. * _.isArrayLike([1, 2, 3]);
  11932. * // => true
  11933. *
  11934. * _.isArrayLike(document.body.children);
  11935. * // => true
  11936. *
  11937. * _.isArrayLike('abc');
  11938. * // => true
  11939. *
  11940. * _.isArrayLike(_.noop);
  11941. * // => false
  11942. */
  11943. function isArrayLike(value) {
  11944. return value != null && isLength(value.length) && !isFunction(value);
  11945. }
  11946. /**
  11947. * This method is like `_.isArrayLike` except that it also checks if `value`
  11948. * is an object.
  11949. *
  11950. * @static
  11951. * @memberOf _
  11952. * @since 4.0.0
  11953. * @category Lang
  11954. * @param {*} value The value to check.
  11955. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11956. * else `false`.
  11957. * @example
  11958. *
  11959. * _.isArrayLikeObject([1, 2, 3]);
  11960. * // => true
  11961. *
  11962. * _.isArrayLikeObject(document.body.children);
  11963. * // => true
  11964. *
  11965. * _.isArrayLikeObject('abc');
  11966. * // => false
  11967. *
  11968. * _.isArrayLikeObject(_.noop);
  11969. * // => false
  11970. */
  11971. function isArrayLikeObject(value) {
  11972. return isObjectLike(value) && isArrayLike(value);
  11973. }
  11974. /**
  11975. * Checks if `value` is classified as a boolean primitive or object.
  11976. *
  11977. * @static
  11978. * @memberOf _
  11979. * @since 0.1.0
  11980. * @category Lang
  11981. * @param {*} value The value to check.
  11982. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11983. * @example
  11984. *
  11985. * _.isBoolean(false);
  11986. * // => true
  11987. *
  11988. * _.isBoolean(null);
  11989. * // => false
  11990. */
  11991. function isBoolean(value) {
  11992. return value === true || value === false ||
  11993. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11994. }
  11995. /**
  11996. * Checks if `value` is a buffer.
  11997. *
  11998. * @static
  11999. * @memberOf _
  12000. * @since 4.3.0
  12001. * @category Lang
  12002. * @param {*} value The value to check.
  12003. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  12004. * @example
  12005. *
  12006. * _.isBuffer(new Buffer(2));
  12007. * // => true
  12008. *
  12009. * _.isBuffer(new Uint8Array(2));
  12010. * // => false
  12011. */
  12012. var isBuffer = nativeIsBuffer || stubFalse;
  12013. /**
  12014. * Checks if `value` is classified as a `Date` object.
  12015. *
  12016. * @static
  12017. * @memberOf _
  12018. * @since 0.1.0
  12019. * @category Lang
  12020. * @param {*} value The value to check.
  12021. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  12022. * @example
  12023. *
  12024. * _.isDate(new Date);
  12025. * // => true
  12026. *
  12027. * _.isDate('Mon April 23 2012');
  12028. * // => false
  12029. */
  12030. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  12031. /**
  12032. * Checks if `value` is likely a DOM element.
  12033. *
  12034. * @static
  12035. * @memberOf _
  12036. * @since 0.1.0
  12037. * @category Lang
  12038. * @param {*} value The value to check.
  12039. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  12040. * @example
  12041. *
  12042. * _.isElement(document.body);
  12043. * // => true
  12044. *
  12045. * _.isElement('<body>');
  12046. * // => false
  12047. */
  12048. function isElement(value) {
  12049. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  12050. }
  12051. /**
  12052. * Checks if `value` is an empty object, collection, map, or set.
  12053. *
  12054. * Objects are considered empty if they have no own enumerable string keyed
  12055. * properties.
  12056. *
  12057. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  12058. * jQuery-like collections are considered empty if they have a `length` of `0`.
  12059. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  12060. *
  12061. * @static
  12062. * @memberOf _
  12063. * @since 0.1.0
  12064. * @category Lang
  12065. * @param {*} value The value to check.
  12066. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  12067. * @example
  12068. *
  12069. * _.isEmpty(null);
  12070. * // => true
  12071. *
  12072. * _.isEmpty(true);
  12073. * // => true
  12074. *
  12075. * _.isEmpty(1);
  12076. * // => true
  12077. *
  12078. * _.isEmpty([1, 2, 3]);
  12079. * // => false
  12080. *
  12081. * _.isEmpty({ 'a': 1 });
  12082. * // => false
  12083. */
  12084. function isEmpty(value) {
  12085. if (value == null) {
  12086. return true;
  12087. }
  12088. if (isArrayLike(value) &&
  12089. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12090. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12091. return !value.length;
  12092. }
  12093. var tag = getTag(value);
  12094. if (tag == mapTag || tag == setTag) {
  12095. return !value.size;
  12096. }
  12097. if (isPrototype(value)) {
  12098. return !baseKeys(value).length;
  12099. }
  12100. for (var key in value) {
  12101. if (hasOwnProperty.call(value, key)) {
  12102. return false;
  12103. }
  12104. }
  12105. return true;
  12106. }
  12107. /**
  12108. * Performs a deep comparison between two values to determine if they are
  12109. * equivalent.
  12110. *
  12111. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12112. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12113. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12114. * by their own, not inherited, enumerable properties. Functions and DOM
  12115. * nodes are compared by strict equality, i.e. `===`.
  12116. *
  12117. * @static
  12118. * @memberOf _
  12119. * @since 0.1.0
  12120. * @category Lang
  12121. * @param {*} value The value to compare.
  12122. * @param {*} other The other value to compare.
  12123. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12124. * @example
  12125. *
  12126. * var object = { 'a': 1 };
  12127. * var other = { 'a': 1 };
  12128. *
  12129. * _.isEqual(object, other);
  12130. * // => true
  12131. *
  12132. * object === other;
  12133. * // => false
  12134. */
  12135. function isEqual(value, other) {
  12136. return baseIsEqual(value, other);
  12137. }
  12138. /**
  12139. * This method is like `_.isEqual` except that it accepts `customizer` which
  12140. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12141. * are handled by the method instead. The `customizer` is invoked with up to
  12142. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12143. *
  12144. * @static
  12145. * @memberOf _
  12146. * @since 4.0.0
  12147. * @category Lang
  12148. * @param {*} value The value to compare.
  12149. * @param {*} other The other value to compare.
  12150. * @param {Function} [customizer] The function to customize comparisons.
  12151. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12152. * @example
  12153. *
  12154. * function isGreeting(value) {
  12155. * return /^h(?:i|ello)$/.test(value);
  12156. * }
  12157. *
  12158. * function customizer(objValue, othValue) {
  12159. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12160. * return true;
  12161. * }
  12162. * }
  12163. *
  12164. * var array = ['hello', 'goodbye'];
  12165. * var other = ['hi', 'goodbye'];
  12166. *
  12167. * _.isEqualWith(array, other, customizer);
  12168. * // => true
  12169. */
  12170. function isEqualWith(value, other, customizer) {
  12171. customizer = typeof customizer == 'function' ? customizer : undefined;
  12172. var result = customizer ? customizer(value, other) : undefined;
  12173. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12174. }
  12175. /**
  12176. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12177. * `SyntaxError`, `TypeError`, or `URIError` object.
  12178. *
  12179. * @static
  12180. * @memberOf _
  12181. * @since 3.0.0
  12182. * @category Lang
  12183. * @param {*} value The value to check.
  12184. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12185. * @example
  12186. *
  12187. * _.isError(new Error);
  12188. * // => true
  12189. *
  12190. * _.isError(Error);
  12191. * // => false
  12192. */
  12193. function isError(value) {
  12194. if (!isObjectLike(value)) {
  12195. return false;
  12196. }
  12197. var tag = baseGetTag(value);
  12198. return tag == errorTag || tag == domExcTag ||
  12199. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12200. }
  12201. /**
  12202. * Checks if `value` is a finite primitive number.
  12203. *
  12204. * **Note:** This method is based on
  12205. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12206. *
  12207. * @static
  12208. * @memberOf _
  12209. * @since 0.1.0
  12210. * @category Lang
  12211. * @param {*} value The value to check.
  12212. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12213. * @example
  12214. *
  12215. * _.isFinite(3);
  12216. * // => true
  12217. *
  12218. * _.isFinite(Number.MIN_VALUE);
  12219. * // => true
  12220. *
  12221. * _.isFinite(Infinity);
  12222. * // => false
  12223. *
  12224. * _.isFinite('3');
  12225. * // => false
  12226. */
  12227. function isFinite(value) {
  12228. return typeof value == 'number' && nativeIsFinite(value);
  12229. }
  12230. /**
  12231. * Checks if `value` is classified as a `Function` object.
  12232. *
  12233. * @static
  12234. * @memberOf _
  12235. * @since 0.1.0
  12236. * @category Lang
  12237. * @param {*} value The value to check.
  12238. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12239. * @example
  12240. *
  12241. * _.isFunction(_);
  12242. * // => true
  12243. *
  12244. * _.isFunction(/abc/);
  12245. * // => false
  12246. */
  12247. function isFunction(value) {
  12248. if (!isObject(value)) {
  12249. return false;
  12250. }
  12251. // The use of `Object#toString` avoids issues with the `typeof` operator
  12252. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12253. var tag = baseGetTag(value);
  12254. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12255. }
  12256. /**
  12257. * Checks if `value` is an integer.
  12258. *
  12259. * **Note:** This method is based on
  12260. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12261. *
  12262. * @static
  12263. * @memberOf _
  12264. * @since 4.0.0
  12265. * @category Lang
  12266. * @param {*} value The value to check.
  12267. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12268. * @example
  12269. *
  12270. * _.isInteger(3);
  12271. * // => true
  12272. *
  12273. * _.isInteger(Number.MIN_VALUE);
  12274. * // => false
  12275. *
  12276. * _.isInteger(Infinity);
  12277. * // => false
  12278. *
  12279. * _.isInteger('3');
  12280. * // => false
  12281. */
  12282. function isInteger(value) {
  12283. return typeof value == 'number' && value == toInteger(value);
  12284. }
  12285. /**
  12286. * Checks if `value` is a valid array-like length.
  12287. *
  12288. * **Note:** This method is loosely based on
  12289. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12290. *
  12291. * @static
  12292. * @memberOf _
  12293. * @since 4.0.0
  12294. * @category Lang
  12295. * @param {*} value The value to check.
  12296. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12297. * @example
  12298. *
  12299. * _.isLength(3);
  12300. * // => true
  12301. *
  12302. * _.isLength(Number.MIN_VALUE);
  12303. * // => false
  12304. *
  12305. * _.isLength(Infinity);
  12306. * // => false
  12307. *
  12308. * _.isLength('3');
  12309. * // => false
  12310. */
  12311. function isLength(value) {
  12312. return typeof value == 'number' &&
  12313. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12314. }
  12315. /**
  12316. * Checks if `value` is the
  12317. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12318. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12319. *
  12320. * @static
  12321. * @memberOf _
  12322. * @since 0.1.0
  12323. * @category Lang
  12324. * @param {*} value The value to check.
  12325. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12326. * @example
  12327. *
  12328. * _.isObject({});
  12329. * // => true
  12330. *
  12331. * _.isObject([1, 2, 3]);
  12332. * // => true
  12333. *
  12334. * _.isObject(_.noop);
  12335. * // => true
  12336. *
  12337. * _.isObject(null);
  12338. * // => false
  12339. */
  12340. function isObject(value) {
  12341. var type = typeof value;
  12342. return value != null && (type == 'object' || type == 'function');
  12343. }
  12344. /**
  12345. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12346. * and has a `typeof` result of "object".
  12347. *
  12348. * @static
  12349. * @memberOf _
  12350. * @since 4.0.0
  12351. * @category Lang
  12352. * @param {*} value The value to check.
  12353. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12354. * @example
  12355. *
  12356. * _.isObjectLike({});
  12357. * // => true
  12358. *
  12359. * _.isObjectLike([1, 2, 3]);
  12360. * // => true
  12361. *
  12362. * _.isObjectLike(_.noop);
  12363. * // => false
  12364. *
  12365. * _.isObjectLike(null);
  12366. * // => false
  12367. */
  12368. function isObjectLike(value) {
  12369. return value != null && typeof value == 'object';
  12370. }
  12371. /**
  12372. * Checks if `value` is classified as a `Map` object.
  12373. *
  12374. * @static
  12375. * @memberOf _
  12376. * @since 4.3.0
  12377. * @category Lang
  12378. * @param {*} value The value to check.
  12379. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12380. * @example
  12381. *
  12382. * _.isMap(new Map);
  12383. * // => true
  12384. *
  12385. * _.isMap(new WeakMap);
  12386. * // => false
  12387. */
  12388. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12389. /**
  12390. * Performs a partial deep comparison between `object` and `source` to
  12391. * determine if `object` contains equivalent property values.
  12392. *
  12393. * **Note:** This method is equivalent to `_.matches` when `source` is
  12394. * partially applied.
  12395. *
  12396. * Partial comparisons will match empty array and empty object `source`
  12397. * values against any array or object value, respectively. See `_.isEqual`
  12398. * for a list of supported value comparisons.
  12399. *
  12400. * @static
  12401. * @memberOf _
  12402. * @since 3.0.0
  12403. * @category Lang
  12404. * @param {Object} object The object to inspect.
  12405. * @param {Object} source The object of property values to match.
  12406. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12407. * @example
  12408. *
  12409. * var object = { 'a': 1, 'b': 2 };
  12410. *
  12411. * _.isMatch(object, { 'b': 2 });
  12412. * // => true
  12413. *
  12414. * _.isMatch(object, { 'b': 1 });
  12415. * // => false
  12416. */
  12417. function isMatch(object, source) {
  12418. return object === source || baseIsMatch(object, source, getMatchData(source));
  12419. }
  12420. /**
  12421. * This method is like `_.isMatch` except that it accepts `customizer` which
  12422. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12423. * are handled by the method instead. The `customizer` is invoked with five
  12424. * arguments: (objValue, srcValue, index|key, object, source).
  12425. *
  12426. * @static
  12427. * @memberOf _
  12428. * @since 4.0.0
  12429. * @category Lang
  12430. * @param {Object} object The object to inspect.
  12431. * @param {Object} source The object of property values to match.
  12432. * @param {Function} [customizer] The function to customize comparisons.
  12433. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12434. * @example
  12435. *
  12436. * function isGreeting(value) {
  12437. * return /^h(?:i|ello)$/.test(value);
  12438. * }
  12439. *
  12440. * function customizer(objValue, srcValue) {
  12441. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12442. * return true;
  12443. * }
  12444. * }
  12445. *
  12446. * var object = { 'greeting': 'hello' };
  12447. * var source = { 'greeting': 'hi' };
  12448. *
  12449. * _.isMatchWith(object, source, customizer);
  12450. * // => true
  12451. */
  12452. function isMatchWith(object, source, customizer) {
  12453. customizer = typeof customizer == 'function' ? customizer : undefined;
  12454. return baseIsMatch(object, source, getMatchData(source), customizer);
  12455. }
  12456. /**
  12457. * Checks if `value` is `NaN`.
  12458. *
  12459. * **Note:** This method is based on
  12460. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12461. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12462. * `undefined` and other non-number values.
  12463. *
  12464. * @static
  12465. * @memberOf _
  12466. * @since 0.1.0
  12467. * @category Lang
  12468. * @param {*} value The value to check.
  12469. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12470. * @example
  12471. *
  12472. * _.isNaN(NaN);
  12473. * // => true
  12474. *
  12475. * _.isNaN(new Number(NaN));
  12476. * // => true
  12477. *
  12478. * isNaN(undefined);
  12479. * // => true
  12480. *
  12481. * _.isNaN(undefined);
  12482. * // => false
  12483. */
  12484. function isNaN(value) {
  12485. // An `NaN` primitive is the only value that is not equal to itself.
  12486. // Perform the `toStringTag` check first to avoid errors with some
  12487. // ActiveX objects in IE.
  12488. return isNumber(value) && value != +value;
  12489. }
  12490. /**
  12491. * Checks if `value` is a pristine native function.
  12492. *
  12493. * **Note:** This method can't reliably detect native functions in the presence
  12494. * of the core-js package because core-js circumvents this kind of detection.
  12495. * Despite multiple requests, the core-js maintainer has made it clear: any
  12496. * attempt to fix the detection will be obstructed. As a result, we're left
  12497. * with little choice but to throw an error. Unfortunately, this also affects
  12498. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12499. * which rely on core-js.
  12500. *
  12501. * @static
  12502. * @memberOf _
  12503. * @since 3.0.0
  12504. * @category Lang
  12505. * @param {*} value The value to check.
  12506. * @returns {boolean} Returns `true` if `value` is a native function,
  12507. * else `false`.
  12508. * @example
  12509. *
  12510. * _.isNative(Array.prototype.push);
  12511. * // => true
  12512. *
  12513. * _.isNative(_);
  12514. * // => false
  12515. */
  12516. function isNative(value) {
  12517. if (isMaskable(value)) {
  12518. throw new Error(CORE_ERROR_TEXT);
  12519. }
  12520. return baseIsNative(value);
  12521. }
  12522. /**
  12523. * Checks if `value` is `null`.
  12524. *
  12525. * @static
  12526. * @memberOf _
  12527. * @since 0.1.0
  12528. * @category Lang
  12529. * @param {*} value The value to check.
  12530. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12531. * @example
  12532. *
  12533. * _.isNull(null);
  12534. * // => true
  12535. *
  12536. * _.isNull(void 0);
  12537. * // => false
  12538. */
  12539. function isNull(value) {
  12540. return value === null;
  12541. }
  12542. /**
  12543. * Checks if `value` is `null` or `undefined`.
  12544. *
  12545. * @static
  12546. * @memberOf _
  12547. * @since 4.0.0
  12548. * @category Lang
  12549. * @param {*} value The value to check.
  12550. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12551. * @example
  12552. *
  12553. * _.isNil(null);
  12554. * // => true
  12555. *
  12556. * _.isNil(void 0);
  12557. * // => true
  12558. *
  12559. * _.isNil(NaN);
  12560. * // => false
  12561. */
  12562. function isNil(value) {
  12563. return value == null;
  12564. }
  12565. /**
  12566. * Checks if `value` is classified as a `Number` primitive or object.
  12567. *
  12568. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12569. * classified as numbers, use the `_.isFinite` method.
  12570. *
  12571. * @static
  12572. * @memberOf _
  12573. * @since 0.1.0
  12574. * @category Lang
  12575. * @param {*} value The value to check.
  12576. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12577. * @example
  12578. *
  12579. * _.isNumber(3);
  12580. * // => true
  12581. *
  12582. * _.isNumber(Number.MIN_VALUE);
  12583. * // => true
  12584. *
  12585. * _.isNumber(Infinity);
  12586. * // => true
  12587. *
  12588. * _.isNumber('3');
  12589. * // => false
  12590. */
  12591. function isNumber(value) {
  12592. return typeof value == 'number' ||
  12593. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12594. }
  12595. /**
  12596. * Checks if `value` is a plain object, that is, an object created by the
  12597. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12598. *
  12599. * @static
  12600. * @memberOf _
  12601. * @since 0.8.0
  12602. * @category Lang
  12603. * @param {*} value The value to check.
  12604. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12605. * @example
  12606. *
  12607. * function Foo() {
  12608. * this.a = 1;
  12609. * }
  12610. *
  12611. * _.isPlainObject(new Foo);
  12612. * // => false
  12613. *
  12614. * _.isPlainObject([1, 2, 3]);
  12615. * // => false
  12616. *
  12617. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12618. * // => true
  12619. *
  12620. * _.isPlainObject(Object.create(null));
  12621. * // => true
  12622. */
  12623. function isPlainObject(value) {
  12624. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12625. return false;
  12626. }
  12627. var proto = getPrototype(value);
  12628. if (proto === null) {
  12629. return true;
  12630. }
  12631. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12632. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12633. funcToString.call(Ctor) == objectCtorString;
  12634. }
  12635. /**
  12636. * Checks if `value` is classified as a `RegExp` object.
  12637. *
  12638. * @static
  12639. * @memberOf _
  12640. * @since 0.1.0
  12641. * @category Lang
  12642. * @param {*} value The value to check.
  12643. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12644. * @example
  12645. *
  12646. * _.isRegExp(/abc/);
  12647. * // => true
  12648. *
  12649. * _.isRegExp('/abc/');
  12650. * // => false
  12651. */
  12652. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12653. /**
  12654. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12655. * double precision number which isn't the result of a rounded unsafe integer.
  12656. *
  12657. * **Note:** This method is based on
  12658. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12659. *
  12660. * @static
  12661. * @memberOf _
  12662. * @since 4.0.0
  12663. * @category Lang
  12664. * @param {*} value The value to check.
  12665. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12666. * @example
  12667. *
  12668. * _.isSafeInteger(3);
  12669. * // => true
  12670. *
  12671. * _.isSafeInteger(Number.MIN_VALUE);
  12672. * // => false
  12673. *
  12674. * _.isSafeInteger(Infinity);
  12675. * // => false
  12676. *
  12677. * _.isSafeInteger('3');
  12678. * // => false
  12679. */
  12680. function isSafeInteger(value) {
  12681. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12682. }
  12683. /**
  12684. * Checks if `value` is classified as a `Set` object.
  12685. *
  12686. * @static
  12687. * @memberOf _
  12688. * @since 4.3.0
  12689. * @category Lang
  12690. * @param {*} value The value to check.
  12691. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12692. * @example
  12693. *
  12694. * _.isSet(new Set);
  12695. * // => true
  12696. *
  12697. * _.isSet(new WeakSet);
  12698. * // => false
  12699. */
  12700. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12701. /**
  12702. * Checks if `value` is classified as a `String` primitive or object.
  12703. *
  12704. * @static
  12705. * @since 0.1.0
  12706. * @memberOf _
  12707. * @category Lang
  12708. * @param {*} value The value to check.
  12709. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12710. * @example
  12711. *
  12712. * _.isString('abc');
  12713. * // => true
  12714. *
  12715. * _.isString(1);
  12716. * // => false
  12717. */
  12718. function isString(value) {
  12719. return typeof value == 'string' ||
  12720. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12721. }
  12722. /**
  12723. * Checks if `value` is classified as a `Symbol` primitive or object.
  12724. *
  12725. * @static
  12726. * @memberOf _
  12727. * @since 4.0.0
  12728. * @category Lang
  12729. * @param {*} value The value to check.
  12730. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12731. * @example
  12732. *
  12733. * _.isSymbol(Symbol.iterator);
  12734. * // => true
  12735. *
  12736. * _.isSymbol('abc');
  12737. * // => false
  12738. */
  12739. function isSymbol(value) {
  12740. return typeof value == 'symbol' ||
  12741. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12742. }
  12743. /**
  12744. * Checks if `value` is classified as a typed array.
  12745. *
  12746. * @static
  12747. * @memberOf _
  12748. * @since 3.0.0
  12749. * @category Lang
  12750. * @param {*} value The value to check.
  12751. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12752. * @example
  12753. *
  12754. * _.isTypedArray(new Uint8Array);
  12755. * // => true
  12756. *
  12757. * _.isTypedArray([]);
  12758. * // => false
  12759. */
  12760. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12761. /**
  12762. * Checks if `value` is `undefined`.
  12763. *
  12764. * @static
  12765. * @since 0.1.0
  12766. * @memberOf _
  12767. * @category Lang
  12768. * @param {*} value The value to check.
  12769. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12770. * @example
  12771. *
  12772. * _.isUndefined(void 0);
  12773. * // => true
  12774. *
  12775. * _.isUndefined(null);
  12776. * // => false
  12777. */
  12778. function isUndefined(value) {
  12779. return value === undefined;
  12780. }
  12781. /**
  12782. * Checks if `value` is classified as a `WeakMap` object.
  12783. *
  12784. * @static
  12785. * @memberOf _
  12786. * @since 4.3.0
  12787. * @category Lang
  12788. * @param {*} value The value to check.
  12789. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12790. * @example
  12791. *
  12792. * _.isWeakMap(new WeakMap);
  12793. * // => true
  12794. *
  12795. * _.isWeakMap(new Map);
  12796. * // => false
  12797. */
  12798. function isWeakMap(value) {
  12799. return isObjectLike(value) && getTag(value) == weakMapTag;
  12800. }
  12801. /**
  12802. * Checks if `value` is classified as a `WeakSet` object.
  12803. *
  12804. * @static
  12805. * @memberOf _
  12806. * @since 4.3.0
  12807. * @category Lang
  12808. * @param {*} value The value to check.
  12809. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12810. * @example
  12811. *
  12812. * _.isWeakSet(new WeakSet);
  12813. * // => true
  12814. *
  12815. * _.isWeakSet(new Set);
  12816. * // => false
  12817. */
  12818. function isWeakSet(value) {
  12819. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12820. }
  12821. /**
  12822. * Checks if `value` is less than `other`.
  12823. *
  12824. * @static
  12825. * @memberOf _
  12826. * @since 3.9.0
  12827. * @category Lang
  12828. * @param {*} value The value to compare.
  12829. * @param {*} other The other value to compare.
  12830. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12831. * else `false`.
  12832. * @see _.gt
  12833. * @example
  12834. *
  12835. * _.lt(1, 3);
  12836. * // => true
  12837. *
  12838. * _.lt(3, 3);
  12839. * // => false
  12840. *
  12841. * _.lt(3, 1);
  12842. * // => false
  12843. */
  12844. var lt = createRelationalOperation(baseLt);
  12845. /**
  12846. * Checks if `value` is less than or equal to `other`.
  12847. *
  12848. * @static
  12849. * @memberOf _
  12850. * @since 3.9.0
  12851. * @category Lang
  12852. * @param {*} value The value to compare.
  12853. * @param {*} other The other value to compare.
  12854. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12855. * `other`, else `false`.
  12856. * @see _.gte
  12857. * @example
  12858. *
  12859. * _.lte(1, 3);
  12860. * // => true
  12861. *
  12862. * _.lte(3, 3);
  12863. * // => true
  12864. *
  12865. * _.lte(3, 1);
  12866. * // => false
  12867. */
  12868. var lte = createRelationalOperation(function(value, other) {
  12869. return value <= other;
  12870. });
  12871. /**
  12872. * Converts `value` to an array.
  12873. *
  12874. * @static
  12875. * @since 0.1.0
  12876. * @memberOf _
  12877. * @category Lang
  12878. * @param {*} value The value to convert.
  12879. * @returns {Array} Returns the converted array.
  12880. * @example
  12881. *
  12882. * _.toArray({ 'a': 1, 'b': 2 });
  12883. * // => [1, 2]
  12884. *
  12885. * _.toArray('abc');
  12886. * // => ['a', 'b', 'c']
  12887. *
  12888. * _.toArray(1);
  12889. * // => []
  12890. *
  12891. * _.toArray(null);
  12892. * // => []
  12893. */
  12894. function toArray(value) {
  12895. if (!value) {
  12896. return [];
  12897. }
  12898. if (isArrayLike(value)) {
  12899. return isString(value) ? stringToArray(value) : copyArray(value);
  12900. }
  12901. if (symIterator && value[symIterator]) {
  12902. return iteratorToArray(value[symIterator]());
  12903. }
  12904. var tag = getTag(value),
  12905. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12906. return func(value);
  12907. }
  12908. /**
  12909. * Converts `value` to a finite number.
  12910. *
  12911. * @static
  12912. * @memberOf _
  12913. * @since 4.12.0
  12914. * @category Lang
  12915. * @param {*} value The value to convert.
  12916. * @returns {number} Returns the converted number.
  12917. * @example
  12918. *
  12919. * _.toFinite(3.2);
  12920. * // => 3.2
  12921. *
  12922. * _.toFinite(Number.MIN_VALUE);
  12923. * // => 5e-324
  12924. *
  12925. * _.toFinite(Infinity);
  12926. * // => 1.7976931348623157e+308
  12927. *
  12928. * _.toFinite('3.2');
  12929. * // => 3.2
  12930. */
  12931. function toFinite(value) {
  12932. if (!value) {
  12933. return value === 0 ? value : 0;
  12934. }
  12935. value = toNumber(value);
  12936. if (value === INFINITY || value === -INFINITY) {
  12937. var sign = (value < 0 ? -1 : 1);
  12938. return sign * MAX_INTEGER;
  12939. }
  12940. return value === value ? value : 0;
  12941. }
  12942. /**
  12943. * Converts `value` to an integer.
  12944. *
  12945. * **Note:** This method is loosely based on
  12946. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12947. *
  12948. * @static
  12949. * @memberOf _
  12950. * @since 4.0.0
  12951. * @category Lang
  12952. * @param {*} value The value to convert.
  12953. * @returns {number} Returns the converted integer.
  12954. * @example
  12955. *
  12956. * _.toInteger(3.2);
  12957. * // => 3
  12958. *
  12959. * _.toInteger(Number.MIN_VALUE);
  12960. * // => 0
  12961. *
  12962. * _.toInteger(Infinity);
  12963. * // => 1.7976931348623157e+308
  12964. *
  12965. * _.toInteger('3.2');
  12966. * // => 3
  12967. */
  12968. function toInteger(value) {
  12969. var result = toFinite(value),
  12970. remainder = result % 1;
  12971. return result === result ? (remainder ? result - remainder : result) : 0;
  12972. }
  12973. /**
  12974. * Converts `value` to an integer suitable for use as the length of an
  12975. * array-like object.
  12976. *
  12977. * **Note:** This method is based on
  12978. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12979. *
  12980. * @static
  12981. * @memberOf _
  12982. * @since 4.0.0
  12983. * @category Lang
  12984. * @param {*} value The value to convert.
  12985. * @returns {number} Returns the converted integer.
  12986. * @example
  12987. *
  12988. * _.toLength(3.2);
  12989. * // => 3
  12990. *
  12991. * _.toLength(Number.MIN_VALUE);
  12992. * // => 0
  12993. *
  12994. * _.toLength(Infinity);
  12995. * // => 4294967295
  12996. *
  12997. * _.toLength('3.2');
  12998. * // => 3
  12999. */
  13000. function toLength(value) {
  13001. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  13002. }
  13003. /**
  13004. * Converts `value` to a number.
  13005. *
  13006. * @static
  13007. * @memberOf _
  13008. * @since 4.0.0
  13009. * @category Lang
  13010. * @param {*} value The value to process.
  13011. * @returns {number} Returns the number.
  13012. * @example
  13013. *
  13014. * _.toNumber(3.2);
  13015. * // => 3.2
  13016. *
  13017. * _.toNumber(Number.MIN_VALUE);
  13018. * // => 5e-324
  13019. *
  13020. * _.toNumber(Infinity);
  13021. * // => Infinity
  13022. *
  13023. * _.toNumber('3.2');
  13024. * // => 3.2
  13025. */
  13026. function toNumber(value) {
  13027. if (typeof value == 'number') {
  13028. return value;
  13029. }
  13030. if (isSymbol(value)) {
  13031. return NAN;
  13032. }
  13033. if (isObject(value)) {
  13034. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  13035. value = isObject(other) ? (other + '') : other;
  13036. }
  13037. if (typeof value != 'string') {
  13038. return value === 0 ? value : +value;
  13039. }
  13040. value = baseTrim(value);
  13041. var isBinary = reIsBinary.test(value);
  13042. return (isBinary || reIsOctal.test(value))
  13043. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  13044. : (reIsBadHex.test(value) ? NAN : +value);
  13045. }
  13046. /**
  13047. * Converts `value` to a plain object flattening inherited enumerable string
  13048. * keyed properties of `value` to own properties of the plain object.
  13049. *
  13050. * @static
  13051. * @memberOf _
  13052. * @since 3.0.0
  13053. * @category Lang
  13054. * @param {*} value The value to convert.
  13055. * @returns {Object} Returns the converted plain object.
  13056. * @example
  13057. *
  13058. * function Foo() {
  13059. * this.b = 2;
  13060. * }
  13061. *
  13062. * Foo.prototype.c = 3;
  13063. *
  13064. * _.assign({ 'a': 1 }, new Foo);
  13065. * // => { 'a': 1, 'b': 2 }
  13066. *
  13067. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  13068. * // => { 'a': 1, 'b': 2, 'c': 3 }
  13069. */
  13070. function toPlainObject(value) {
  13071. return copyObject(value, keysIn(value));
  13072. }
  13073. /**
  13074. * Converts `value` to a safe integer. A safe integer can be compared and
  13075. * represented correctly.
  13076. *
  13077. * @static
  13078. * @memberOf _
  13079. * @since 4.0.0
  13080. * @category Lang
  13081. * @param {*} value The value to convert.
  13082. * @returns {number} Returns the converted integer.
  13083. * @example
  13084. *
  13085. * _.toSafeInteger(3.2);
  13086. * // => 3
  13087. *
  13088. * _.toSafeInteger(Number.MIN_VALUE);
  13089. * // => 0
  13090. *
  13091. * _.toSafeInteger(Infinity);
  13092. * // => 9007199254740991
  13093. *
  13094. * _.toSafeInteger('3.2');
  13095. * // => 3
  13096. */
  13097. function toSafeInteger(value) {
  13098. return value
  13099. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13100. : (value === 0 ? value : 0);
  13101. }
  13102. /**
  13103. * Converts `value` to a string. An empty string is returned for `null`
  13104. * and `undefined` values. The sign of `-0` is preserved.
  13105. *
  13106. * @static
  13107. * @memberOf _
  13108. * @since 4.0.0
  13109. * @category Lang
  13110. * @param {*} value The value to convert.
  13111. * @returns {string} Returns the converted string.
  13112. * @example
  13113. *
  13114. * _.toString(null);
  13115. * // => ''
  13116. *
  13117. * _.toString(-0);
  13118. * // => '-0'
  13119. *
  13120. * _.toString([1, 2, 3]);
  13121. * // => '1,2,3'
  13122. */
  13123. function toString(value) {
  13124. return value == null ? '' : baseToString(value);
  13125. }
  13126. /*------------------------------------------------------------------------*/
  13127. /**
  13128. * Assigns own enumerable string keyed properties of source objects to the
  13129. * destination object. Source objects are applied from left to right.
  13130. * Subsequent sources overwrite property assignments of previous sources.
  13131. *
  13132. * **Note:** This method mutates `object` and is loosely based on
  13133. * [`Object.assign`](https://mdn.io/Object/assign).
  13134. *
  13135. * @static
  13136. * @memberOf _
  13137. * @since 0.10.0
  13138. * @category Object
  13139. * @param {Object} object The destination object.
  13140. * @param {...Object} [sources] The source objects.
  13141. * @returns {Object} Returns `object`.
  13142. * @see _.assignIn
  13143. * @example
  13144. *
  13145. * function Foo() {
  13146. * this.a = 1;
  13147. * }
  13148. *
  13149. * function Bar() {
  13150. * this.c = 3;
  13151. * }
  13152. *
  13153. * Foo.prototype.b = 2;
  13154. * Bar.prototype.d = 4;
  13155. *
  13156. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13157. * // => { 'a': 1, 'c': 3 }
  13158. */
  13159. var assign = createAssigner(function(object, source) {
  13160. if (isPrototype(source) || isArrayLike(source)) {
  13161. copyObject(source, keys(source), object);
  13162. return;
  13163. }
  13164. for (var key in source) {
  13165. if (hasOwnProperty.call(source, key)) {
  13166. assignValue(object, key, source[key]);
  13167. }
  13168. }
  13169. });
  13170. /**
  13171. * This method is like `_.assign` except that it iterates over own and
  13172. * inherited source properties.
  13173. *
  13174. * **Note:** This method mutates `object`.
  13175. *
  13176. * @static
  13177. * @memberOf _
  13178. * @since 4.0.0
  13179. * @alias extend
  13180. * @category Object
  13181. * @param {Object} object The destination object.
  13182. * @param {...Object} [sources] The source objects.
  13183. * @returns {Object} Returns `object`.
  13184. * @see _.assign
  13185. * @example
  13186. *
  13187. * function Foo() {
  13188. * this.a = 1;
  13189. * }
  13190. *
  13191. * function Bar() {
  13192. * this.c = 3;
  13193. * }
  13194. *
  13195. * Foo.prototype.b = 2;
  13196. * Bar.prototype.d = 4;
  13197. *
  13198. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13199. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13200. */
  13201. var assignIn = createAssigner(function(object, source) {
  13202. copyObject(source, keysIn(source), object);
  13203. });
  13204. /**
  13205. * This method is like `_.assignIn` except that it accepts `customizer`
  13206. * which is invoked to produce the assigned values. If `customizer` returns
  13207. * `undefined`, assignment is handled by the method instead. The `customizer`
  13208. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13209. *
  13210. * **Note:** This method mutates `object`.
  13211. *
  13212. * @static
  13213. * @memberOf _
  13214. * @since 4.0.0
  13215. * @alias extendWith
  13216. * @category Object
  13217. * @param {Object} object The destination object.
  13218. * @param {...Object} sources The source objects.
  13219. * @param {Function} [customizer] The function to customize assigned values.
  13220. * @returns {Object} Returns `object`.
  13221. * @see _.assignWith
  13222. * @example
  13223. *
  13224. * function customizer(objValue, srcValue) {
  13225. * return _.isUndefined(objValue) ? srcValue : objValue;
  13226. * }
  13227. *
  13228. * var defaults = _.partialRight(_.assignInWith, customizer);
  13229. *
  13230. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13231. * // => { 'a': 1, 'b': 2 }
  13232. */
  13233. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13234. copyObject(source, keysIn(source), object, customizer);
  13235. });
  13236. /**
  13237. * This method is like `_.assign` except that it accepts `customizer`
  13238. * which is invoked to produce the assigned values. If `customizer` returns
  13239. * `undefined`, assignment is handled by the method instead. The `customizer`
  13240. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13241. *
  13242. * **Note:** This method mutates `object`.
  13243. *
  13244. * @static
  13245. * @memberOf _
  13246. * @since 4.0.0
  13247. * @category Object
  13248. * @param {Object} object The destination object.
  13249. * @param {...Object} sources The source objects.
  13250. * @param {Function} [customizer] The function to customize assigned values.
  13251. * @returns {Object} Returns `object`.
  13252. * @see _.assignInWith
  13253. * @example
  13254. *
  13255. * function customizer(objValue, srcValue) {
  13256. * return _.isUndefined(objValue) ? srcValue : objValue;
  13257. * }
  13258. *
  13259. * var defaults = _.partialRight(_.assignWith, customizer);
  13260. *
  13261. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13262. * // => { 'a': 1, 'b': 2 }
  13263. */
  13264. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13265. copyObject(source, keys(source), object, customizer);
  13266. });
  13267. /**
  13268. * Creates an array of values corresponding to `paths` of `object`.
  13269. *
  13270. * @static
  13271. * @memberOf _
  13272. * @since 1.0.0
  13273. * @category Object
  13274. * @param {Object} object The object to iterate over.
  13275. * @param {...(string|string[])} [paths] The property paths to pick.
  13276. * @returns {Array} Returns the picked values.
  13277. * @example
  13278. *
  13279. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13280. *
  13281. * _.at(object, ['a[0].b.c', 'a[1]']);
  13282. * // => [3, 4]
  13283. */
  13284. var at = flatRest(baseAt);
  13285. /**
  13286. * Creates an object that inherits from the `prototype` object. If a
  13287. * `properties` object is given, its own enumerable string keyed properties
  13288. * are assigned to the created object.
  13289. *
  13290. * @static
  13291. * @memberOf _
  13292. * @since 2.3.0
  13293. * @category Object
  13294. * @param {Object} prototype The object to inherit from.
  13295. * @param {Object} [properties] The properties to assign to the object.
  13296. * @returns {Object} Returns the new object.
  13297. * @example
  13298. *
  13299. * function Shape() {
  13300. * this.x = 0;
  13301. * this.y = 0;
  13302. * }
  13303. *
  13304. * function Circle() {
  13305. * Shape.call(this);
  13306. * }
  13307. *
  13308. * Circle.prototype = _.create(Shape.prototype, {
  13309. * 'constructor': Circle
  13310. * });
  13311. *
  13312. * var circle = new Circle;
  13313. * circle instanceof Circle;
  13314. * // => true
  13315. *
  13316. * circle instanceof Shape;
  13317. * // => true
  13318. */
  13319. function create(prototype, properties) {
  13320. var result = baseCreate(prototype);
  13321. return properties == null ? result : baseAssign(result, properties);
  13322. }
  13323. /**
  13324. * Assigns own and inherited enumerable string keyed properties of source
  13325. * objects to the destination object for all destination properties that
  13326. * resolve to `undefined`. Source objects are applied from left to right.
  13327. * Once a property is set, additional values of the same property are ignored.
  13328. *
  13329. * **Note:** This method mutates `object`.
  13330. *
  13331. * @static
  13332. * @since 0.1.0
  13333. * @memberOf _
  13334. * @category Object
  13335. * @param {Object} object The destination object.
  13336. * @param {...Object} [sources] The source objects.
  13337. * @returns {Object} Returns `object`.
  13338. * @see _.defaultsDeep
  13339. * @example
  13340. *
  13341. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13342. * // => { 'a': 1, 'b': 2 }
  13343. */
  13344. var defaults = baseRest(function(object, sources) {
  13345. object = Object(object);
  13346. var index = -1;
  13347. var length = sources.length;
  13348. var guard = length > 2 ? sources[2] : undefined;
  13349. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13350. length = 1;
  13351. }
  13352. while (++index < length) {
  13353. var source = sources[index];
  13354. var props = keysIn(source);
  13355. var propsIndex = -1;
  13356. var propsLength = props.length;
  13357. while (++propsIndex < propsLength) {
  13358. var key = props[propsIndex];
  13359. var value = object[key];
  13360. if (value === undefined ||
  13361. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13362. object[key] = source[key];
  13363. }
  13364. }
  13365. }
  13366. return object;
  13367. });
  13368. /**
  13369. * This method is like `_.defaults` except that it recursively assigns
  13370. * default properties.
  13371. *
  13372. * **Note:** This method mutates `object`.
  13373. *
  13374. * @static
  13375. * @memberOf _
  13376. * @since 3.10.0
  13377. * @category Object
  13378. * @param {Object} object The destination object.
  13379. * @param {...Object} [sources] The source objects.
  13380. * @returns {Object} Returns `object`.
  13381. * @see _.defaults
  13382. * @example
  13383. *
  13384. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13385. * // => { 'a': { 'b': 2, 'c': 3 } }
  13386. */
  13387. var defaultsDeep = baseRest(function(args) {
  13388. args.push(undefined, customDefaultsMerge);
  13389. return apply(mergeWith, undefined, args);
  13390. });
  13391. /**
  13392. * This method is like `_.find` except that it returns the key of the first
  13393. * element `predicate` returns truthy for instead of the element itself.
  13394. *
  13395. * @static
  13396. * @memberOf _
  13397. * @since 1.1.0
  13398. * @category Object
  13399. * @param {Object} object The object to inspect.
  13400. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13401. * @returns {string|undefined} Returns the key of the matched element,
  13402. * else `undefined`.
  13403. * @example
  13404. *
  13405. * var users = {
  13406. * 'barney': { 'age': 36, 'active': true },
  13407. * 'fred': { 'age': 40, 'active': false },
  13408. * 'pebbles': { 'age': 1, 'active': true }
  13409. * };
  13410. *
  13411. * _.findKey(users, function(o) { return o.age < 40; });
  13412. * // => 'barney' (iteration order is not guaranteed)
  13413. *
  13414. * // The `_.matches` iteratee shorthand.
  13415. * _.findKey(users, { 'age': 1, 'active': true });
  13416. * // => 'pebbles'
  13417. *
  13418. * // The `_.matchesProperty` iteratee shorthand.
  13419. * _.findKey(users, ['active', false]);
  13420. * // => 'fred'
  13421. *
  13422. * // The `_.property` iteratee shorthand.
  13423. * _.findKey(users, 'active');
  13424. * // => 'barney'
  13425. */
  13426. function findKey(object, predicate) {
  13427. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13428. }
  13429. /**
  13430. * This method is like `_.findKey` except that it iterates over elements of
  13431. * a collection in the opposite order.
  13432. *
  13433. * @static
  13434. * @memberOf _
  13435. * @since 2.0.0
  13436. * @category Object
  13437. * @param {Object} object The object to inspect.
  13438. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13439. * @returns {string|undefined} Returns the key of the matched element,
  13440. * else `undefined`.
  13441. * @example
  13442. *
  13443. * var users = {
  13444. * 'barney': { 'age': 36, 'active': true },
  13445. * 'fred': { 'age': 40, 'active': false },
  13446. * 'pebbles': { 'age': 1, 'active': true }
  13447. * };
  13448. *
  13449. * _.findLastKey(users, function(o) { return o.age < 40; });
  13450. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13451. *
  13452. * // The `_.matches` iteratee shorthand.
  13453. * _.findLastKey(users, { 'age': 36, 'active': true });
  13454. * // => 'barney'
  13455. *
  13456. * // The `_.matchesProperty` iteratee shorthand.
  13457. * _.findLastKey(users, ['active', false]);
  13458. * // => 'fred'
  13459. *
  13460. * // The `_.property` iteratee shorthand.
  13461. * _.findLastKey(users, 'active');
  13462. * // => 'pebbles'
  13463. */
  13464. function findLastKey(object, predicate) {
  13465. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13466. }
  13467. /**
  13468. * Iterates over own and inherited enumerable string keyed properties of an
  13469. * object and invokes `iteratee` for each property. The iteratee is invoked
  13470. * with three arguments: (value, key, object). Iteratee functions may exit
  13471. * iteration early by explicitly returning `false`.
  13472. *
  13473. * @static
  13474. * @memberOf _
  13475. * @since 0.3.0
  13476. * @category Object
  13477. * @param {Object} object The object to iterate over.
  13478. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13479. * @returns {Object} Returns `object`.
  13480. * @see _.forInRight
  13481. * @example
  13482. *
  13483. * function Foo() {
  13484. * this.a = 1;
  13485. * this.b = 2;
  13486. * }
  13487. *
  13488. * Foo.prototype.c = 3;
  13489. *
  13490. * _.forIn(new Foo, function(value, key) {
  13491. * console.log(key);
  13492. * });
  13493. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13494. */
  13495. function forIn(object, iteratee) {
  13496. return object == null
  13497. ? object
  13498. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13499. }
  13500. /**
  13501. * This method is like `_.forIn` except that it iterates over properties of
  13502. * `object` in the opposite order.
  13503. *
  13504. * @static
  13505. * @memberOf _
  13506. * @since 2.0.0
  13507. * @category Object
  13508. * @param {Object} object The object to iterate over.
  13509. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13510. * @returns {Object} Returns `object`.
  13511. * @see _.forIn
  13512. * @example
  13513. *
  13514. * function Foo() {
  13515. * this.a = 1;
  13516. * this.b = 2;
  13517. * }
  13518. *
  13519. * Foo.prototype.c = 3;
  13520. *
  13521. * _.forInRight(new Foo, function(value, key) {
  13522. * console.log(key);
  13523. * });
  13524. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13525. */
  13526. function forInRight(object, iteratee) {
  13527. return object == null
  13528. ? object
  13529. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13530. }
  13531. /**
  13532. * Iterates over own enumerable string keyed properties of an object and
  13533. * invokes `iteratee` for each property. The iteratee is invoked with three
  13534. * arguments: (value, key, object). Iteratee functions may exit iteration
  13535. * early by explicitly returning `false`.
  13536. *
  13537. * @static
  13538. * @memberOf _
  13539. * @since 0.3.0
  13540. * @category Object
  13541. * @param {Object} object The object to iterate over.
  13542. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13543. * @returns {Object} Returns `object`.
  13544. * @see _.forOwnRight
  13545. * @example
  13546. *
  13547. * function Foo() {
  13548. * this.a = 1;
  13549. * this.b = 2;
  13550. * }
  13551. *
  13552. * Foo.prototype.c = 3;
  13553. *
  13554. * _.forOwn(new Foo, function(value, key) {
  13555. * console.log(key);
  13556. * });
  13557. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13558. */
  13559. function forOwn(object, iteratee) {
  13560. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13561. }
  13562. /**
  13563. * This method is like `_.forOwn` except that it iterates over properties of
  13564. * `object` in the opposite order.
  13565. *
  13566. * @static
  13567. * @memberOf _
  13568. * @since 2.0.0
  13569. * @category Object
  13570. * @param {Object} object The object to iterate over.
  13571. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13572. * @returns {Object} Returns `object`.
  13573. * @see _.forOwn
  13574. * @example
  13575. *
  13576. * function Foo() {
  13577. * this.a = 1;
  13578. * this.b = 2;
  13579. * }
  13580. *
  13581. * Foo.prototype.c = 3;
  13582. *
  13583. * _.forOwnRight(new Foo, function(value, key) {
  13584. * console.log(key);
  13585. * });
  13586. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13587. */
  13588. function forOwnRight(object, iteratee) {
  13589. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13590. }
  13591. /**
  13592. * Creates an array of function property names from own enumerable properties
  13593. * of `object`.
  13594. *
  13595. * @static
  13596. * @since 0.1.0
  13597. * @memberOf _
  13598. * @category Object
  13599. * @param {Object} object The object to inspect.
  13600. * @returns {Array} Returns the function names.
  13601. * @see _.functionsIn
  13602. * @example
  13603. *
  13604. * function Foo() {
  13605. * this.a = _.constant('a');
  13606. * this.b = _.constant('b');
  13607. * }
  13608. *
  13609. * Foo.prototype.c = _.constant('c');
  13610. *
  13611. * _.functions(new Foo);
  13612. * // => ['a', 'b']
  13613. */
  13614. function functions(object) {
  13615. return object == null ? [] : baseFunctions(object, keys(object));
  13616. }
  13617. /**
  13618. * Creates an array of function property names from own and inherited
  13619. * enumerable properties of `object`.
  13620. *
  13621. * @static
  13622. * @memberOf _
  13623. * @since 4.0.0
  13624. * @category Object
  13625. * @param {Object} object The object to inspect.
  13626. * @returns {Array} Returns the function names.
  13627. * @see _.functions
  13628. * @example
  13629. *
  13630. * function Foo() {
  13631. * this.a = _.constant('a');
  13632. * this.b = _.constant('b');
  13633. * }
  13634. *
  13635. * Foo.prototype.c = _.constant('c');
  13636. *
  13637. * _.functionsIn(new Foo);
  13638. * // => ['a', 'b', 'c']
  13639. */
  13640. function functionsIn(object) {
  13641. return object == null ? [] : baseFunctions(object, keysIn(object));
  13642. }
  13643. /**
  13644. * Gets the value at `path` of `object`. If the resolved value is
  13645. * `undefined`, the `defaultValue` is returned in its place.
  13646. *
  13647. * @static
  13648. * @memberOf _
  13649. * @since 3.7.0
  13650. * @category Object
  13651. * @param {Object} object The object to query.
  13652. * @param {Array|string} path The path of the property to get.
  13653. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13654. * @returns {*} Returns the resolved value.
  13655. * @example
  13656. *
  13657. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13658. *
  13659. * _.get(object, 'a[0].b.c');
  13660. * // => 3
  13661. *
  13662. * _.get(object, ['a', '0', 'b', 'c']);
  13663. * // => 3
  13664. *
  13665. * _.get(object, 'a.b.c', 'default');
  13666. * // => 'default'
  13667. */
  13668. function get(object, path, defaultValue) {
  13669. var result = object == null ? undefined : baseGet(object, path);
  13670. return result === undefined ? defaultValue : result;
  13671. }
  13672. /**
  13673. * Checks if `path` is a direct property of `object`.
  13674. *
  13675. * @static
  13676. * @since 0.1.0
  13677. * @memberOf _
  13678. * @category Object
  13679. * @param {Object} object The object to query.
  13680. * @param {Array|string} path The path to check.
  13681. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13682. * @example
  13683. *
  13684. * var object = { 'a': { 'b': 2 } };
  13685. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13686. *
  13687. * _.has(object, 'a');
  13688. * // => true
  13689. *
  13690. * _.has(object, 'a.b');
  13691. * // => true
  13692. *
  13693. * _.has(object, ['a', 'b']);
  13694. * // => true
  13695. *
  13696. * _.has(other, 'a');
  13697. * // => false
  13698. */
  13699. function has(object, path) {
  13700. return object != null && hasPath(object, path, baseHas);
  13701. }
  13702. /**
  13703. * Checks if `path` is a direct or inherited property of `object`.
  13704. *
  13705. * @static
  13706. * @memberOf _
  13707. * @since 4.0.0
  13708. * @category Object
  13709. * @param {Object} object The object to query.
  13710. * @param {Array|string} path The path to check.
  13711. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13712. * @example
  13713. *
  13714. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13715. *
  13716. * _.hasIn(object, 'a');
  13717. * // => true
  13718. *
  13719. * _.hasIn(object, 'a.b');
  13720. * // => true
  13721. *
  13722. * _.hasIn(object, ['a', 'b']);
  13723. * // => true
  13724. *
  13725. * _.hasIn(object, 'b');
  13726. * // => false
  13727. */
  13728. function hasIn(object, path) {
  13729. return object != null && hasPath(object, path, baseHasIn);
  13730. }
  13731. /**
  13732. * Creates an object composed of the inverted keys and values of `object`.
  13733. * If `object` contains duplicate values, subsequent values overwrite
  13734. * property assignments of previous values.
  13735. *
  13736. * @static
  13737. * @memberOf _
  13738. * @since 0.7.0
  13739. * @category Object
  13740. * @param {Object} object The object to invert.
  13741. * @returns {Object} Returns the new inverted object.
  13742. * @example
  13743. *
  13744. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13745. *
  13746. * _.invert(object);
  13747. * // => { '1': 'c', '2': 'b' }
  13748. */
  13749. var invert = createInverter(function(result, value, key) {
  13750. if (value != null &&
  13751. typeof value.toString != 'function') {
  13752. value = nativeObjectToString.call(value);
  13753. }
  13754. result[value] = key;
  13755. }, constant(identity));
  13756. /**
  13757. * This method is like `_.invert` except that the inverted object is generated
  13758. * from the results of running each element of `object` thru `iteratee`. The
  13759. * corresponding inverted value of each inverted key is an array of keys
  13760. * responsible for generating the inverted value. The iteratee is invoked
  13761. * with one argument: (value).
  13762. *
  13763. * @static
  13764. * @memberOf _
  13765. * @since 4.1.0
  13766. * @category Object
  13767. * @param {Object} object The object to invert.
  13768. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13769. * @returns {Object} Returns the new inverted object.
  13770. * @example
  13771. *
  13772. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13773. *
  13774. * _.invertBy(object);
  13775. * // => { '1': ['a', 'c'], '2': ['b'] }
  13776. *
  13777. * _.invertBy(object, function(value) {
  13778. * return 'group' + value;
  13779. * });
  13780. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13781. */
  13782. var invertBy = createInverter(function(result, value, key) {
  13783. if (value != null &&
  13784. typeof value.toString != 'function') {
  13785. value = nativeObjectToString.call(value);
  13786. }
  13787. if (hasOwnProperty.call(result, value)) {
  13788. result[value].push(key);
  13789. } else {
  13790. result[value] = [key];
  13791. }
  13792. }, getIteratee);
  13793. /**
  13794. * Invokes the method at `path` of `object`.
  13795. *
  13796. * @static
  13797. * @memberOf _
  13798. * @since 4.0.0
  13799. * @category Object
  13800. * @param {Object} object The object to query.
  13801. * @param {Array|string} path The path of the method to invoke.
  13802. * @param {...*} [args] The arguments to invoke the method with.
  13803. * @returns {*} Returns the result of the invoked method.
  13804. * @example
  13805. *
  13806. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13807. *
  13808. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13809. * // => [2, 3]
  13810. */
  13811. var invoke = baseRest(baseInvoke);
  13812. /**
  13813. * Creates an array of the own enumerable property names of `object`.
  13814. *
  13815. * **Note:** Non-object values are coerced to objects. See the
  13816. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13817. * for more details.
  13818. *
  13819. * @static
  13820. * @since 0.1.0
  13821. * @memberOf _
  13822. * @category Object
  13823. * @param {Object} object The object to query.
  13824. * @returns {Array} Returns the array of property names.
  13825. * @example
  13826. *
  13827. * function Foo() {
  13828. * this.a = 1;
  13829. * this.b = 2;
  13830. * }
  13831. *
  13832. * Foo.prototype.c = 3;
  13833. *
  13834. * _.keys(new Foo);
  13835. * // => ['a', 'b'] (iteration order is not guaranteed)
  13836. *
  13837. * _.keys('hi');
  13838. * // => ['0', '1']
  13839. */
  13840. function keys(object) {
  13841. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13842. }
  13843. /**
  13844. * Creates an array of the own and inherited enumerable property names of `object`.
  13845. *
  13846. * **Note:** Non-object values are coerced to objects.
  13847. *
  13848. * @static
  13849. * @memberOf _
  13850. * @since 3.0.0
  13851. * @category Object
  13852. * @param {Object} object The object to query.
  13853. * @returns {Array} Returns the array of property names.
  13854. * @example
  13855. *
  13856. * function Foo() {
  13857. * this.a = 1;
  13858. * this.b = 2;
  13859. * }
  13860. *
  13861. * Foo.prototype.c = 3;
  13862. *
  13863. * _.keysIn(new Foo);
  13864. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13865. */
  13866. function keysIn(object) {
  13867. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13868. }
  13869. /**
  13870. * The opposite of `_.mapValues`; this method creates an object with the
  13871. * same values as `object` and keys generated by running each own enumerable
  13872. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13873. * with three arguments: (value, key, object).
  13874. *
  13875. * @static
  13876. * @memberOf _
  13877. * @since 3.8.0
  13878. * @category Object
  13879. * @param {Object} object The object to iterate over.
  13880. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13881. * @returns {Object} Returns the new mapped object.
  13882. * @see _.mapValues
  13883. * @example
  13884. *
  13885. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13886. * return key + value;
  13887. * });
  13888. * // => { 'a1': 1, 'b2': 2 }
  13889. */
  13890. function mapKeys(object, iteratee) {
  13891. var result = {};
  13892. iteratee = getIteratee(iteratee, 3);
  13893. baseForOwn(object, function(value, key, object) {
  13894. baseAssignValue(result, iteratee(value, key, object), value);
  13895. });
  13896. return result;
  13897. }
  13898. /**
  13899. * Creates an object with the same keys as `object` and values generated
  13900. * by running each own enumerable string keyed property of `object` thru
  13901. * `iteratee`. The iteratee is invoked with three arguments:
  13902. * (value, key, object).
  13903. *
  13904. * @static
  13905. * @memberOf _
  13906. * @since 2.4.0
  13907. * @category Object
  13908. * @param {Object} object The object to iterate over.
  13909. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13910. * @returns {Object} Returns the new mapped object.
  13911. * @see _.mapKeys
  13912. * @example
  13913. *
  13914. * var users = {
  13915. * 'fred': { 'user': 'fred', 'age': 40 },
  13916. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13917. * };
  13918. *
  13919. * _.mapValues(users, function(o) { return o.age; });
  13920. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13921. *
  13922. * // The `_.property` iteratee shorthand.
  13923. * _.mapValues(users, 'age');
  13924. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13925. */
  13926. function mapValues(object, iteratee) {
  13927. var result = {};
  13928. iteratee = getIteratee(iteratee, 3);
  13929. baseForOwn(object, function(value, key, object) {
  13930. baseAssignValue(result, key, iteratee(value, key, object));
  13931. });
  13932. return result;
  13933. }
  13934. /**
  13935. * This method is like `_.assign` except that it recursively merges own and
  13936. * inherited enumerable string keyed properties of source objects into the
  13937. * destination object. Source properties that resolve to `undefined` are
  13938. * skipped if a destination value exists. Array and plain object properties
  13939. * are merged recursively. Other objects and value types are overridden by
  13940. * assignment. Source objects are applied from left to right. Subsequent
  13941. * sources overwrite property assignments of previous sources.
  13942. *
  13943. * **Note:** This method mutates `object`.
  13944. *
  13945. * @static
  13946. * @memberOf _
  13947. * @since 0.5.0
  13948. * @category Object
  13949. * @param {Object} object The destination object.
  13950. * @param {...Object} [sources] The source objects.
  13951. * @returns {Object} Returns `object`.
  13952. * @example
  13953. *
  13954. * var object = {
  13955. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13956. * };
  13957. *
  13958. * var other = {
  13959. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13960. * };
  13961. *
  13962. * _.merge(object, other);
  13963. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13964. */
  13965. var merge = createAssigner(function(object, source, srcIndex) {
  13966. baseMerge(object, source, srcIndex);
  13967. });
  13968. /**
  13969. * This method is like `_.merge` except that it accepts `customizer` which
  13970. * is invoked to produce the merged values of the destination and source
  13971. * properties. If `customizer` returns `undefined`, merging is handled by the
  13972. * method instead. The `customizer` is invoked with six arguments:
  13973. * (objValue, srcValue, key, object, source, stack).
  13974. *
  13975. * **Note:** This method mutates `object`.
  13976. *
  13977. * @static
  13978. * @memberOf _
  13979. * @since 4.0.0
  13980. * @category Object
  13981. * @param {Object} object The destination object.
  13982. * @param {...Object} sources The source objects.
  13983. * @param {Function} customizer The function to customize assigned values.
  13984. * @returns {Object} Returns `object`.
  13985. * @example
  13986. *
  13987. * function customizer(objValue, srcValue) {
  13988. * if (_.isArray(objValue)) {
  13989. * return objValue.concat(srcValue);
  13990. * }
  13991. * }
  13992. *
  13993. * var object = { 'a': [1], 'b': [2] };
  13994. * var other = { 'a': [3], 'b': [4] };
  13995. *
  13996. * _.mergeWith(object, other, customizer);
  13997. * // => { 'a': [1, 3], 'b': [2, 4] }
  13998. */
  13999. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  14000. baseMerge(object, source, srcIndex, customizer);
  14001. });
  14002. /**
  14003. * The opposite of `_.pick`; this method creates an object composed of the
  14004. * own and inherited enumerable property paths of `object` that are not omitted.
  14005. *
  14006. * **Note:** This method is considerably slower than `_.pick`.
  14007. *
  14008. * @static
  14009. * @since 0.1.0
  14010. * @memberOf _
  14011. * @category Object
  14012. * @param {Object} object The source object.
  14013. * @param {...(string|string[])} [paths] The property paths to omit.
  14014. * @returns {Object} Returns the new object.
  14015. * @example
  14016. *
  14017. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14018. *
  14019. * _.omit(object, ['a', 'c']);
  14020. * // => { 'b': '2' }
  14021. */
  14022. var omit = flatRest(function(object, paths) {
  14023. var result = {};
  14024. if (object == null) {
  14025. return result;
  14026. }
  14027. var isDeep = false;
  14028. paths = arrayMap(paths, function(path) {
  14029. path = castPath(path, object);
  14030. isDeep || (isDeep = path.length > 1);
  14031. return path;
  14032. });
  14033. copyObject(object, getAllKeysIn(object), result);
  14034. if (isDeep) {
  14035. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  14036. }
  14037. var length = paths.length;
  14038. while (length--) {
  14039. baseUnset(result, paths[length]);
  14040. }
  14041. return result;
  14042. });
  14043. /**
  14044. * The opposite of `_.pickBy`; this method creates an object composed of
  14045. * the own and inherited enumerable string keyed properties of `object` that
  14046. * `predicate` doesn't return truthy for. The predicate is invoked with two
  14047. * arguments: (value, key).
  14048. *
  14049. * @static
  14050. * @memberOf _
  14051. * @since 4.0.0
  14052. * @category Object
  14053. * @param {Object} object The source object.
  14054. * @param {Function} [predicate=_.identity] The function invoked per property.
  14055. * @returns {Object} Returns the new object.
  14056. * @example
  14057. *
  14058. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14059. *
  14060. * _.omitBy(object, _.isNumber);
  14061. * // => { 'b': '2' }
  14062. */
  14063. function omitBy(object, predicate) {
  14064. return pickBy(object, negate(getIteratee(predicate)));
  14065. }
  14066. /**
  14067. * Creates an object composed of the picked `object` properties.
  14068. *
  14069. * @static
  14070. * @since 0.1.0
  14071. * @memberOf _
  14072. * @category Object
  14073. * @param {Object} object The source object.
  14074. * @param {...(string|string[])} [paths] The property paths to pick.
  14075. * @returns {Object} Returns the new object.
  14076. * @example
  14077. *
  14078. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14079. *
  14080. * _.pick(object, ['a', 'c']);
  14081. * // => { 'a': 1, 'c': 3 }
  14082. */
  14083. var pick = flatRest(function(object, paths) {
  14084. return object == null ? {} : basePick(object, paths);
  14085. });
  14086. /**
  14087. * Creates an object composed of the `object` properties `predicate` returns
  14088. * truthy for. The predicate is invoked with two arguments: (value, key).
  14089. *
  14090. * @static
  14091. * @memberOf _
  14092. * @since 4.0.0
  14093. * @category Object
  14094. * @param {Object} object The source object.
  14095. * @param {Function} [predicate=_.identity] The function invoked per property.
  14096. * @returns {Object} Returns the new object.
  14097. * @example
  14098. *
  14099. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14100. *
  14101. * _.pickBy(object, _.isNumber);
  14102. * // => { 'a': 1, 'c': 3 }
  14103. */
  14104. function pickBy(object, predicate) {
  14105. if (object == null) {
  14106. return {};
  14107. }
  14108. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14109. return [prop];
  14110. });
  14111. predicate = getIteratee(predicate);
  14112. return basePickBy(object, props, function(value, path) {
  14113. return predicate(value, path[0]);
  14114. });
  14115. }
  14116. /**
  14117. * This method is like `_.get` except that if the resolved value is a
  14118. * function it's invoked with the `this` binding of its parent object and
  14119. * its result is returned.
  14120. *
  14121. * @static
  14122. * @since 0.1.0
  14123. * @memberOf _
  14124. * @category Object
  14125. * @param {Object} object The object to query.
  14126. * @param {Array|string} path The path of the property to resolve.
  14127. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14128. * @returns {*} Returns the resolved value.
  14129. * @example
  14130. *
  14131. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14132. *
  14133. * _.result(object, 'a[0].b.c1');
  14134. * // => 3
  14135. *
  14136. * _.result(object, 'a[0].b.c2');
  14137. * // => 4
  14138. *
  14139. * _.result(object, 'a[0].b.c3', 'default');
  14140. * // => 'default'
  14141. *
  14142. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14143. * // => 'default'
  14144. */
  14145. function result(object, path, defaultValue) {
  14146. path = castPath(path, object);
  14147. var index = -1,
  14148. length = path.length;
  14149. // Ensure the loop is entered when path is empty.
  14150. if (!length) {
  14151. length = 1;
  14152. object = undefined;
  14153. }
  14154. while (++index < length) {
  14155. var value = object == null ? undefined : object[toKey(path[index])];
  14156. if (value === undefined) {
  14157. index = length;
  14158. value = defaultValue;
  14159. }
  14160. object = isFunction(value) ? value.call(object) : value;
  14161. }
  14162. return object;
  14163. }
  14164. /**
  14165. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14166. * it's created. Arrays are created for missing index properties while objects
  14167. * are created for all other missing properties. Use `_.setWith` to customize
  14168. * `path` creation.
  14169. *
  14170. * **Note:** This method mutates `object`.
  14171. *
  14172. * @static
  14173. * @memberOf _
  14174. * @since 3.7.0
  14175. * @category Object
  14176. * @param {Object} object The object to modify.
  14177. * @param {Array|string} path The path of the property to set.
  14178. * @param {*} value The value to set.
  14179. * @returns {Object} Returns `object`.
  14180. * @example
  14181. *
  14182. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14183. *
  14184. * _.set(object, 'a[0].b.c', 4);
  14185. * console.log(object.a[0].b.c);
  14186. * // => 4
  14187. *
  14188. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14189. * console.log(object.x[0].y.z);
  14190. * // => 5
  14191. */
  14192. function set(object, path, value) {
  14193. return object == null ? object : baseSet(object, path, value);
  14194. }
  14195. /**
  14196. * This method is like `_.set` except that it accepts `customizer` which is
  14197. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14198. * path creation is handled by the method instead. The `customizer` is invoked
  14199. * with three arguments: (nsValue, key, nsObject).
  14200. *
  14201. * **Note:** This method mutates `object`.
  14202. *
  14203. * @static
  14204. * @memberOf _
  14205. * @since 4.0.0
  14206. * @category Object
  14207. * @param {Object} object The object to modify.
  14208. * @param {Array|string} path The path of the property to set.
  14209. * @param {*} value The value to set.
  14210. * @param {Function} [customizer] The function to customize assigned values.
  14211. * @returns {Object} Returns `object`.
  14212. * @example
  14213. *
  14214. * var object = {};
  14215. *
  14216. * _.setWith(object, '[0][1]', 'a', Object);
  14217. * // => { '0': { '1': 'a' } }
  14218. */
  14219. function setWith(object, path, value, customizer) {
  14220. customizer = typeof customizer == 'function' ? customizer : undefined;
  14221. return object == null ? object : baseSet(object, path, value, customizer);
  14222. }
  14223. /**
  14224. * Creates an array of own enumerable string keyed-value pairs for `object`
  14225. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14226. * entries are returned.
  14227. *
  14228. * @static
  14229. * @memberOf _
  14230. * @since 4.0.0
  14231. * @alias entries
  14232. * @category Object
  14233. * @param {Object} object The object to query.
  14234. * @returns {Array} Returns the key-value pairs.
  14235. * @example
  14236. *
  14237. * function Foo() {
  14238. * this.a = 1;
  14239. * this.b = 2;
  14240. * }
  14241. *
  14242. * Foo.prototype.c = 3;
  14243. *
  14244. * _.toPairs(new Foo);
  14245. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14246. */
  14247. var toPairs = createToPairs(keys);
  14248. /**
  14249. * Creates an array of own and inherited enumerable string keyed-value pairs
  14250. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14251. * or set, its entries are returned.
  14252. *
  14253. * @static
  14254. * @memberOf _
  14255. * @since 4.0.0
  14256. * @alias entriesIn
  14257. * @category Object
  14258. * @param {Object} object The object to query.
  14259. * @returns {Array} Returns the key-value pairs.
  14260. * @example
  14261. *
  14262. * function Foo() {
  14263. * this.a = 1;
  14264. * this.b = 2;
  14265. * }
  14266. *
  14267. * Foo.prototype.c = 3;
  14268. *
  14269. * _.toPairsIn(new Foo);
  14270. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14271. */
  14272. var toPairsIn = createToPairs(keysIn);
  14273. /**
  14274. * An alternative to `_.reduce`; this method transforms `object` to a new
  14275. * `accumulator` object which is the result of running each of its own
  14276. * enumerable string keyed properties thru `iteratee`, with each invocation
  14277. * potentially mutating the `accumulator` object. If `accumulator` is not
  14278. * provided, a new object with the same `[[Prototype]]` will be used. The
  14279. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14280. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14281. *
  14282. * @static
  14283. * @memberOf _
  14284. * @since 1.3.0
  14285. * @category Object
  14286. * @param {Object} object The object to iterate over.
  14287. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14288. * @param {*} [accumulator] The custom accumulator value.
  14289. * @returns {*} Returns the accumulated value.
  14290. * @example
  14291. *
  14292. * _.transform([2, 3, 4], function(result, n) {
  14293. * result.push(n *= n);
  14294. * return n % 2 == 0;
  14295. * }, []);
  14296. * // => [4, 9]
  14297. *
  14298. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14299. * (result[value] || (result[value] = [])).push(key);
  14300. * }, {});
  14301. * // => { '1': ['a', 'c'], '2': ['b'] }
  14302. */
  14303. function transform(object, iteratee, accumulator) {
  14304. var isArr = isArray(object),
  14305. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14306. iteratee = getIteratee(iteratee, 4);
  14307. if (accumulator == null) {
  14308. var Ctor = object && object.constructor;
  14309. if (isArrLike) {
  14310. accumulator = isArr ? new Ctor : [];
  14311. }
  14312. else if (isObject(object)) {
  14313. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14314. }
  14315. else {
  14316. accumulator = {};
  14317. }
  14318. }
  14319. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14320. return iteratee(accumulator, value, index, object);
  14321. });
  14322. return accumulator;
  14323. }
  14324. /**
  14325. * Removes the property at `path` of `object`.
  14326. *
  14327. * **Note:** This method mutates `object`.
  14328. *
  14329. * @static
  14330. * @memberOf _
  14331. * @since 4.0.0
  14332. * @category Object
  14333. * @param {Object} object The object to modify.
  14334. * @param {Array|string} path The path of the property to unset.
  14335. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14336. * @example
  14337. *
  14338. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14339. * _.unset(object, 'a[0].b.c');
  14340. * // => true
  14341. *
  14342. * console.log(object);
  14343. * // => { 'a': [{ 'b': {} }] };
  14344. *
  14345. * _.unset(object, ['a', '0', 'b', 'c']);
  14346. * // => true
  14347. *
  14348. * console.log(object);
  14349. * // => { 'a': [{ 'b': {} }] };
  14350. */
  14351. function unset(object, path) {
  14352. return object == null ? true : baseUnset(object, path);
  14353. }
  14354. /**
  14355. * This method is like `_.set` except that accepts `updater` to produce the
  14356. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14357. * is invoked with one argument: (value).
  14358. *
  14359. * **Note:** This method mutates `object`.
  14360. *
  14361. * @static
  14362. * @memberOf _
  14363. * @since 4.6.0
  14364. * @category Object
  14365. * @param {Object} object The object to modify.
  14366. * @param {Array|string} path The path of the property to set.
  14367. * @param {Function} updater The function to produce the updated value.
  14368. * @returns {Object} Returns `object`.
  14369. * @example
  14370. *
  14371. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14372. *
  14373. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14374. * console.log(object.a[0].b.c);
  14375. * // => 9
  14376. *
  14377. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14378. * console.log(object.x[0].y.z);
  14379. * // => 0
  14380. */
  14381. function update(object, path, updater) {
  14382. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14383. }
  14384. /**
  14385. * This method is like `_.update` except that it accepts `customizer` which is
  14386. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14387. * path creation is handled by the method instead. The `customizer` is invoked
  14388. * with three arguments: (nsValue, key, nsObject).
  14389. *
  14390. * **Note:** This method mutates `object`.
  14391. *
  14392. * @static
  14393. * @memberOf _
  14394. * @since 4.6.0
  14395. * @category Object
  14396. * @param {Object} object The object to modify.
  14397. * @param {Array|string} path The path of the property to set.
  14398. * @param {Function} updater The function to produce the updated value.
  14399. * @param {Function} [customizer] The function to customize assigned values.
  14400. * @returns {Object} Returns `object`.
  14401. * @example
  14402. *
  14403. * var object = {};
  14404. *
  14405. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14406. * // => { '0': { '1': 'a' } }
  14407. */
  14408. function updateWith(object, path, updater, customizer) {
  14409. customizer = typeof customizer == 'function' ? customizer : undefined;
  14410. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14411. }
  14412. /**
  14413. * Creates an array of the own enumerable string keyed property values of `object`.
  14414. *
  14415. * **Note:** Non-object values are coerced to objects.
  14416. *
  14417. * @static
  14418. * @since 0.1.0
  14419. * @memberOf _
  14420. * @category Object
  14421. * @param {Object} object The object to query.
  14422. * @returns {Array} Returns the array of property values.
  14423. * @example
  14424. *
  14425. * function Foo() {
  14426. * this.a = 1;
  14427. * this.b = 2;
  14428. * }
  14429. *
  14430. * Foo.prototype.c = 3;
  14431. *
  14432. * _.values(new Foo);
  14433. * // => [1, 2] (iteration order is not guaranteed)
  14434. *
  14435. * _.values('hi');
  14436. * // => ['h', 'i']
  14437. */
  14438. function values(object) {
  14439. return object == null ? [] : baseValues(object, keys(object));
  14440. }
  14441. /**
  14442. * Creates an array of the own and inherited enumerable string keyed property
  14443. * values of `object`.
  14444. *
  14445. * **Note:** Non-object values are coerced to objects.
  14446. *
  14447. * @static
  14448. * @memberOf _
  14449. * @since 3.0.0
  14450. * @category Object
  14451. * @param {Object} object The object to query.
  14452. * @returns {Array} Returns the array of property values.
  14453. * @example
  14454. *
  14455. * function Foo() {
  14456. * this.a = 1;
  14457. * this.b = 2;
  14458. * }
  14459. *
  14460. * Foo.prototype.c = 3;
  14461. *
  14462. * _.valuesIn(new Foo);
  14463. * // => [1, 2, 3] (iteration order is not guaranteed)
  14464. */
  14465. function valuesIn(object) {
  14466. return object == null ? [] : baseValues(object, keysIn(object));
  14467. }
  14468. /*------------------------------------------------------------------------*/
  14469. /**
  14470. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14471. *
  14472. * @static
  14473. * @memberOf _
  14474. * @since 4.0.0
  14475. * @category Number
  14476. * @param {number} number The number to clamp.
  14477. * @param {number} [lower] The lower bound.
  14478. * @param {number} upper The upper bound.
  14479. * @returns {number} Returns the clamped number.
  14480. * @example
  14481. *
  14482. * _.clamp(-10, -5, 5);
  14483. * // => -5
  14484. *
  14485. * _.clamp(10, -5, 5);
  14486. * // => 5
  14487. */
  14488. function clamp(number, lower, upper) {
  14489. if (upper === undefined) {
  14490. upper = lower;
  14491. lower = undefined;
  14492. }
  14493. if (upper !== undefined) {
  14494. upper = toNumber(upper);
  14495. upper = upper === upper ? upper : 0;
  14496. }
  14497. if (lower !== undefined) {
  14498. lower = toNumber(lower);
  14499. lower = lower === lower ? lower : 0;
  14500. }
  14501. return baseClamp(toNumber(number), lower, upper);
  14502. }
  14503. /**
  14504. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14505. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14506. * If `start` is greater than `end` the params are swapped to support
  14507. * negative ranges.
  14508. *
  14509. * @static
  14510. * @memberOf _
  14511. * @since 3.3.0
  14512. * @category Number
  14513. * @param {number} number The number to check.
  14514. * @param {number} [start=0] The start of the range.
  14515. * @param {number} end The end of the range.
  14516. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14517. * @see _.range, _.rangeRight
  14518. * @example
  14519. *
  14520. * _.inRange(3, 2, 4);
  14521. * // => true
  14522. *
  14523. * _.inRange(4, 8);
  14524. * // => true
  14525. *
  14526. * _.inRange(4, 2);
  14527. * // => false
  14528. *
  14529. * _.inRange(2, 2);
  14530. * // => false
  14531. *
  14532. * _.inRange(1.2, 2);
  14533. * // => true
  14534. *
  14535. * _.inRange(5.2, 4);
  14536. * // => false
  14537. *
  14538. * _.inRange(-3, -2, -6);
  14539. * // => true
  14540. */
  14541. function inRange(number, start, end) {
  14542. start = toFinite(start);
  14543. if (end === undefined) {
  14544. end = start;
  14545. start = 0;
  14546. } else {
  14547. end = toFinite(end);
  14548. }
  14549. number = toNumber(number);
  14550. return baseInRange(number, start, end);
  14551. }
  14552. /**
  14553. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14554. * If only one argument is provided a number between `0` and the given number
  14555. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14556. * floats, a floating-point number is returned instead of an integer.
  14557. *
  14558. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14559. * floating-point values which can produce unexpected results.
  14560. *
  14561. * @static
  14562. * @memberOf _
  14563. * @since 0.7.0
  14564. * @category Number
  14565. * @param {number} [lower=0] The lower bound.
  14566. * @param {number} [upper=1] The upper bound.
  14567. * @param {boolean} [floating] Specify returning a floating-point number.
  14568. * @returns {number} Returns the random number.
  14569. * @example
  14570. *
  14571. * _.random(0, 5);
  14572. * // => an integer between 0 and 5
  14573. *
  14574. * _.random(5);
  14575. * // => also an integer between 0 and 5
  14576. *
  14577. * _.random(5, true);
  14578. * // => a floating-point number between 0 and 5
  14579. *
  14580. * _.random(1.2, 5.2);
  14581. * // => a floating-point number between 1.2 and 5.2
  14582. */
  14583. function random(lower, upper, floating) {
  14584. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14585. upper = floating = undefined;
  14586. }
  14587. if (floating === undefined) {
  14588. if (typeof upper == 'boolean') {
  14589. floating = upper;
  14590. upper = undefined;
  14591. }
  14592. else if (typeof lower == 'boolean') {
  14593. floating = lower;
  14594. lower = undefined;
  14595. }
  14596. }
  14597. if (lower === undefined && upper === undefined) {
  14598. lower = 0;
  14599. upper = 1;
  14600. }
  14601. else {
  14602. lower = toFinite(lower);
  14603. if (upper === undefined) {
  14604. upper = lower;
  14605. lower = 0;
  14606. } else {
  14607. upper = toFinite(upper);
  14608. }
  14609. }
  14610. if (lower > upper) {
  14611. var temp = lower;
  14612. lower = upper;
  14613. upper = temp;
  14614. }
  14615. if (floating || lower % 1 || upper % 1) {
  14616. var rand = nativeRandom();
  14617. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14618. }
  14619. return baseRandom(lower, upper);
  14620. }
  14621. /*------------------------------------------------------------------------*/
  14622. /**
  14623. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14624. *
  14625. * @static
  14626. * @memberOf _
  14627. * @since 3.0.0
  14628. * @category String
  14629. * @param {string} [string=''] The string to convert.
  14630. * @returns {string} Returns the camel cased string.
  14631. * @example
  14632. *
  14633. * _.camelCase('Foo Bar');
  14634. * // => 'fooBar'
  14635. *
  14636. * _.camelCase('--foo-bar--');
  14637. * // => 'fooBar'
  14638. *
  14639. * _.camelCase('__FOO_BAR__');
  14640. * // => 'fooBar'
  14641. */
  14642. var camelCase = createCompounder(function(result, word, index) {
  14643. word = word.toLowerCase();
  14644. return result + (index ? capitalize(word) : word);
  14645. });
  14646. /**
  14647. * Converts the first character of `string` to upper case and the remaining
  14648. * to lower case.
  14649. *
  14650. * @static
  14651. * @memberOf _
  14652. * @since 3.0.0
  14653. * @category String
  14654. * @param {string} [string=''] The string to capitalize.
  14655. * @returns {string} Returns the capitalized string.
  14656. * @example
  14657. *
  14658. * _.capitalize('FRED');
  14659. * // => 'Fred'
  14660. */
  14661. function capitalize(string) {
  14662. return upperFirst(toString(string).toLowerCase());
  14663. }
  14664. /**
  14665. * Deburrs `string` by converting
  14666. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14667. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14668. * letters to basic Latin letters and removing
  14669. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14670. *
  14671. * @static
  14672. * @memberOf _
  14673. * @since 3.0.0
  14674. * @category String
  14675. * @param {string} [string=''] The string to deburr.
  14676. * @returns {string} Returns the deburred string.
  14677. * @example
  14678. *
  14679. * _.deburr('déjà vu');
  14680. * // => 'deja vu'
  14681. */
  14682. function deburr(string) {
  14683. string = toString(string);
  14684. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14685. }
  14686. /**
  14687. * Checks if `string` ends with the given target string.
  14688. *
  14689. * @static
  14690. * @memberOf _
  14691. * @since 3.0.0
  14692. * @category String
  14693. * @param {string} [string=''] The string to inspect.
  14694. * @param {string} [target] The string to search for.
  14695. * @param {number} [position=string.length] The position to search up to.
  14696. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14697. * else `false`.
  14698. * @example
  14699. *
  14700. * _.endsWith('abc', 'c');
  14701. * // => true
  14702. *
  14703. * _.endsWith('abc', 'b');
  14704. * // => false
  14705. *
  14706. * _.endsWith('abc', 'b', 2);
  14707. * // => true
  14708. */
  14709. function endsWith(string, target, position) {
  14710. string = toString(string);
  14711. target = baseToString(target);
  14712. var length = string.length;
  14713. position = position === undefined
  14714. ? length
  14715. : baseClamp(toInteger(position), 0, length);
  14716. var end = position;
  14717. position -= target.length;
  14718. return position >= 0 && string.slice(position, end) == target;
  14719. }
  14720. /**
  14721. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14722. * corresponding HTML entities.
  14723. *
  14724. * **Note:** No other characters are escaped. To escape additional
  14725. * characters use a third-party library like [_he_](https://mths.be/he).
  14726. *
  14727. * Though the ">" character is escaped for symmetry, characters like
  14728. * ">" and "/" don't need escaping in HTML and have no special meaning
  14729. * unless they're part of a tag or unquoted attribute value. See
  14730. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14731. * (under "semi-related fun fact") for more details.
  14732. *
  14733. * When working with HTML you should always
  14734. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14735. * XSS vectors.
  14736. *
  14737. * @static
  14738. * @since 0.1.0
  14739. * @memberOf _
  14740. * @category String
  14741. * @param {string} [string=''] The string to escape.
  14742. * @returns {string} Returns the escaped string.
  14743. * @example
  14744. *
  14745. * _.escape('fred, barney, & pebbles');
  14746. * // => 'fred, barney, &amp; pebbles'
  14747. */
  14748. function escape(string) {
  14749. string = toString(string);
  14750. return (string && reHasUnescapedHtml.test(string))
  14751. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14752. : string;
  14753. }
  14754. /**
  14755. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14756. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14757. *
  14758. * @static
  14759. * @memberOf _
  14760. * @since 3.0.0
  14761. * @category String
  14762. * @param {string} [string=''] The string to escape.
  14763. * @returns {string} Returns the escaped string.
  14764. * @example
  14765. *
  14766. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14767. * // => '\[lodash\]\(https://lodash\.com/\)'
  14768. */
  14769. function escapeRegExp(string) {
  14770. string = toString(string);
  14771. return (string && reHasRegExpChar.test(string))
  14772. ? string.replace(reRegExpChar, '\\$&')
  14773. : string;
  14774. }
  14775. /**
  14776. * Converts `string` to
  14777. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14778. *
  14779. * @static
  14780. * @memberOf _
  14781. * @since 3.0.0
  14782. * @category String
  14783. * @param {string} [string=''] The string to convert.
  14784. * @returns {string} Returns the kebab cased string.
  14785. * @example
  14786. *
  14787. * _.kebabCase('Foo Bar');
  14788. * // => 'foo-bar'
  14789. *
  14790. * _.kebabCase('fooBar');
  14791. * // => 'foo-bar'
  14792. *
  14793. * _.kebabCase('__FOO_BAR__');
  14794. * // => 'foo-bar'
  14795. */
  14796. var kebabCase = createCompounder(function(result, word, index) {
  14797. return result + (index ? '-' : '') + word.toLowerCase();
  14798. });
  14799. /**
  14800. * Converts `string`, as space separated words, to lower case.
  14801. *
  14802. * @static
  14803. * @memberOf _
  14804. * @since 4.0.0
  14805. * @category String
  14806. * @param {string} [string=''] The string to convert.
  14807. * @returns {string} Returns the lower cased string.
  14808. * @example
  14809. *
  14810. * _.lowerCase('--Foo-Bar--');
  14811. * // => 'foo bar'
  14812. *
  14813. * _.lowerCase('fooBar');
  14814. * // => 'foo bar'
  14815. *
  14816. * _.lowerCase('__FOO_BAR__');
  14817. * // => 'foo bar'
  14818. */
  14819. var lowerCase = createCompounder(function(result, word, index) {
  14820. return result + (index ? ' ' : '') + word.toLowerCase();
  14821. });
  14822. /**
  14823. * Converts the first character of `string` to lower case.
  14824. *
  14825. * @static
  14826. * @memberOf _
  14827. * @since 4.0.0
  14828. * @category String
  14829. * @param {string} [string=''] The string to convert.
  14830. * @returns {string} Returns the converted string.
  14831. * @example
  14832. *
  14833. * _.lowerFirst('Fred');
  14834. * // => 'fred'
  14835. *
  14836. * _.lowerFirst('FRED');
  14837. * // => 'fRED'
  14838. */
  14839. var lowerFirst = createCaseFirst('toLowerCase');
  14840. /**
  14841. * Pads `string` on the left and right sides if it's shorter than `length`.
  14842. * Padding characters are truncated if they can't be evenly divided by `length`.
  14843. *
  14844. * @static
  14845. * @memberOf _
  14846. * @since 3.0.0
  14847. * @category String
  14848. * @param {string} [string=''] The string to pad.
  14849. * @param {number} [length=0] The padding length.
  14850. * @param {string} [chars=' '] The string used as padding.
  14851. * @returns {string} Returns the padded string.
  14852. * @example
  14853. *
  14854. * _.pad('abc', 8);
  14855. * // => ' abc '
  14856. *
  14857. * _.pad('abc', 8, '_-');
  14858. * // => '_-abc_-_'
  14859. *
  14860. * _.pad('abc', 3);
  14861. * // => 'abc'
  14862. */
  14863. function pad(string, length, chars) {
  14864. string = toString(string);
  14865. length = toInteger(length);
  14866. var strLength = length ? stringSize(string) : 0;
  14867. if (!length || strLength >= length) {
  14868. return string;
  14869. }
  14870. var mid = (length - strLength) / 2;
  14871. return (
  14872. createPadding(nativeFloor(mid), chars) +
  14873. string +
  14874. createPadding(nativeCeil(mid), chars)
  14875. );
  14876. }
  14877. /**
  14878. * Pads `string` on the right side if it's shorter than `length`. Padding
  14879. * characters are truncated if they exceed `length`.
  14880. *
  14881. * @static
  14882. * @memberOf _
  14883. * @since 4.0.0
  14884. * @category String
  14885. * @param {string} [string=''] The string to pad.
  14886. * @param {number} [length=0] The padding length.
  14887. * @param {string} [chars=' '] The string used as padding.
  14888. * @returns {string} Returns the padded string.
  14889. * @example
  14890. *
  14891. * _.padEnd('abc', 6);
  14892. * // => 'abc '
  14893. *
  14894. * _.padEnd('abc', 6, '_-');
  14895. * // => 'abc_-_'
  14896. *
  14897. * _.padEnd('abc', 3);
  14898. * // => 'abc'
  14899. */
  14900. function padEnd(string, length, chars) {
  14901. string = toString(string);
  14902. length = toInteger(length);
  14903. var strLength = length ? stringSize(string) : 0;
  14904. return (length && strLength < length)
  14905. ? (string + createPadding(length - strLength, chars))
  14906. : string;
  14907. }
  14908. /**
  14909. * Pads `string` on the left side if it's shorter than `length`. Padding
  14910. * characters are truncated if they exceed `length`.
  14911. *
  14912. * @static
  14913. * @memberOf _
  14914. * @since 4.0.0
  14915. * @category String
  14916. * @param {string} [string=''] The string to pad.
  14917. * @param {number} [length=0] The padding length.
  14918. * @param {string} [chars=' '] The string used as padding.
  14919. * @returns {string} Returns the padded string.
  14920. * @example
  14921. *
  14922. * _.padStart('abc', 6);
  14923. * // => ' abc'
  14924. *
  14925. * _.padStart('abc', 6, '_-');
  14926. * // => '_-_abc'
  14927. *
  14928. * _.padStart('abc', 3);
  14929. * // => 'abc'
  14930. */
  14931. function padStart(string, length, chars) {
  14932. string = toString(string);
  14933. length = toInteger(length);
  14934. var strLength = length ? stringSize(string) : 0;
  14935. return (length && strLength < length)
  14936. ? (createPadding(length - strLength, chars) + string)
  14937. : string;
  14938. }
  14939. /**
  14940. * Converts `string` to an integer of the specified radix. If `radix` is
  14941. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14942. * hexadecimal, in which case a `radix` of `16` is used.
  14943. *
  14944. * **Note:** This method aligns with the
  14945. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14946. *
  14947. * @static
  14948. * @memberOf _
  14949. * @since 1.1.0
  14950. * @category String
  14951. * @param {string} string The string to convert.
  14952. * @param {number} [radix=10] The radix to interpret `value` by.
  14953. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14954. * @returns {number} Returns the converted integer.
  14955. * @example
  14956. *
  14957. * _.parseInt('08');
  14958. * // => 8
  14959. *
  14960. * _.map(['6', '08', '10'], _.parseInt);
  14961. * // => [6, 8, 10]
  14962. */
  14963. function parseInt(string, radix, guard) {
  14964. if (guard || radix == null) {
  14965. radix = 0;
  14966. } else if (radix) {
  14967. radix = +radix;
  14968. }
  14969. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14970. }
  14971. /**
  14972. * Repeats the given string `n` times.
  14973. *
  14974. * @static
  14975. * @memberOf _
  14976. * @since 3.0.0
  14977. * @category String
  14978. * @param {string} [string=''] The string to repeat.
  14979. * @param {number} [n=1] The number of times to repeat the string.
  14980. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14981. * @returns {string} Returns the repeated string.
  14982. * @example
  14983. *
  14984. * _.repeat('*', 3);
  14985. * // => '***'
  14986. *
  14987. * _.repeat('abc', 2);
  14988. * // => 'abcabc'
  14989. *
  14990. * _.repeat('abc', 0);
  14991. * // => ''
  14992. */
  14993. function repeat(string, n, guard) {
  14994. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14995. n = 1;
  14996. } else {
  14997. n = toInteger(n);
  14998. }
  14999. return baseRepeat(toString(string), n);
  15000. }
  15001. /**
  15002. * Replaces matches for `pattern` in `string` with `replacement`.
  15003. *
  15004. * **Note:** This method is based on
  15005. * [`String#replace`](https://mdn.io/String/replace).
  15006. *
  15007. * @static
  15008. * @memberOf _
  15009. * @since 4.0.0
  15010. * @category String
  15011. * @param {string} [string=''] The string to modify.
  15012. * @param {RegExp|string} pattern The pattern to replace.
  15013. * @param {Function|string} replacement The match replacement.
  15014. * @returns {string} Returns the modified string.
  15015. * @example
  15016. *
  15017. * _.replace('Hi Fred', 'Fred', 'Barney');
  15018. * // => 'Hi Barney'
  15019. */
  15020. function replace() {
  15021. var args = arguments,
  15022. string = toString(args[0]);
  15023. return args.length < 3 ? string : string.replace(args[1], args[2]);
  15024. }
  15025. /**
  15026. * Converts `string` to
  15027. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  15028. *
  15029. * @static
  15030. * @memberOf _
  15031. * @since 3.0.0
  15032. * @category String
  15033. * @param {string} [string=''] The string to convert.
  15034. * @returns {string} Returns the snake cased string.
  15035. * @example
  15036. *
  15037. * _.snakeCase('Foo Bar');
  15038. * // => 'foo_bar'
  15039. *
  15040. * _.snakeCase('fooBar');
  15041. * // => 'foo_bar'
  15042. *
  15043. * _.snakeCase('--FOO-BAR--');
  15044. * // => 'foo_bar'
  15045. */
  15046. var snakeCase = createCompounder(function(result, word, index) {
  15047. return result + (index ? '_' : '') + word.toLowerCase();
  15048. });
  15049. /**
  15050. * Splits `string` by `separator`.
  15051. *
  15052. * **Note:** This method is based on
  15053. * [`String#split`](https://mdn.io/String/split).
  15054. *
  15055. * @static
  15056. * @memberOf _
  15057. * @since 4.0.0
  15058. * @category String
  15059. * @param {string} [string=''] The string to split.
  15060. * @param {RegExp|string} separator The separator pattern to split by.
  15061. * @param {number} [limit] The length to truncate results to.
  15062. * @returns {Array} Returns the string segments.
  15063. * @example
  15064. *
  15065. * _.split('a-b-c', '-', 2);
  15066. * // => ['a', 'b']
  15067. */
  15068. function split(string, separator, limit) {
  15069. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  15070. separator = limit = undefined;
  15071. }
  15072. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  15073. if (!limit) {
  15074. return [];
  15075. }
  15076. string = toString(string);
  15077. if (string && (
  15078. typeof separator == 'string' ||
  15079. (separator != null && !isRegExp(separator))
  15080. )) {
  15081. separator = baseToString(separator);
  15082. if (!separator && hasUnicode(string)) {
  15083. return castSlice(stringToArray(string), 0, limit);
  15084. }
  15085. }
  15086. return string.split(separator, limit);
  15087. }
  15088. /**
  15089. * Converts `string` to
  15090. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15091. *
  15092. * @static
  15093. * @memberOf _
  15094. * @since 3.1.0
  15095. * @category String
  15096. * @param {string} [string=''] The string to convert.
  15097. * @returns {string} Returns the start cased string.
  15098. * @example
  15099. *
  15100. * _.startCase('--foo-bar--');
  15101. * // => 'Foo Bar'
  15102. *
  15103. * _.startCase('fooBar');
  15104. * // => 'Foo Bar'
  15105. *
  15106. * _.startCase('__FOO_BAR__');
  15107. * // => 'FOO BAR'
  15108. */
  15109. var startCase = createCompounder(function(result, word, index) {
  15110. return result + (index ? ' ' : '') + upperFirst(word);
  15111. });
  15112. /**
  15113. * Checks if `string` starts with the given target string.
  15114. *
  15115. * @static
  15116. * @memberOf _
  15117. * @since 3.0.0
  15118. * @category String
  15119. * @param {string} [string=''] The string to inspect.
  15120. * @param {string} [target] The string to search for.
  15121. * @param {number} [position=0] The position to search from.
  15122. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15123. * else `false`.
  15124. * @example
  15125. *
  15126. * _.startsWith('abc', 'a');
  15127. * // => true
  15128. *
  15129. * _.startsWith('abc', 'b');
  15130. * // => false
  15131. *
  15132. * _.startsWith('abc', 'b', 1);
  15133. * // => true
  15134. */
  15135. function startsWith(string, target, position) {
  15136. string = toString(string);
  15137. position = position == null
  15138. ? 0
  15139. : baseClamp(toInteger(position), 0, string.length);
  15140. target = baseToString(target);
  15141. return string.slice(position, position + target.length) == target;
  15142. }
  15143. /**
  15144. * Creates a compiled template function that can interpolate data properties
  15145. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15146. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15147. * properties may be accessed as free variables in the template. If a setting
  15148. * object is given, it takes precedence over `_.templateSettings` values.
  15149. *
  15150. * **Note:** In the development build `_.template` utilizes
  15151. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15152. * for easier debugging.
  15153. *
  15154. * For more information on precompiling templates see
  15155. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15156. *
  15157. * For more information on Chrome extension sandboxes see
  15158. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15159. *
  15160. * @static
  15161. * @since 0.1.0
  15162. * @memberOf _
  15163. * @category String
  15164. * @param {string} [string=''] The template string.
  15165. * @param {Object} [options={}] The options object.
  15166. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15167. * The HTML "escape" delimiter.
  15168. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15169. * The "evaluate" delimiter.
  15170. * @param {Object} [options.imports=_.templateSettings.imports]
  15171. * An object to import into the template as free variables.
  15172. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15173. * The "interpolate" delimiter.
  15174. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15175. * The sourceURL of the compiled template.
  15176. * @param {string} [options.variable='obj']
  15177. * The data object variable name.
  15178. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15179. * @returns {Function} Returns the compiled template function.
  15180. * @example
  15181. *
  15182. * // Use the "interpolate" delimiter to create a compiled template.
  15183. * var compiled = _.template('hello <%= user %>!');
  15184. * compiled({ 'user': 'fred' });
  15185. * // => 'hello fred!'
  15186. *
  15187. * // Use the HTML "escape" delimiter to escape data property values.
  15188. * var compiled = _.template('<b><%- value %></b>');
  15189. * compiled({ 'value': '<script>' });
  15190. * // => '<b>&lt;script&gt;</b>'
  15191. *
  15192. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15193. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15194. * compiled({ 'users': ['fred', 'barney'] });
  15195. * // => '<li>fred</li><li>barney</li>'
  15196. *
  15197. * // Use the internal `print` function in "evaluate" delimiters.
  15198. * var compiled = _.template('<% print("hello " + user); %>!');
  15199. * compiled({ 'user': 'barney' });
  15200. * // => 'hello barney!'
  15201. *
  15202. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15203. * // Disable support by replacing the "interpolate" delimiter.
  15204. * var compiled = _.template('hello ${ user }!');
  15205. * compiled({ 'user': 'pebbles' });
  15206. * // => 'hello pebbles!'
  15207. *
  15208. * // Use backslashes to treat delimiters as plain text.
  15209. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15210. * compiled({ 'value': 'ignored' });
  15211. * // => '<%- value %>'
  15212. *
  15213. * // Use the `imports` option to import `jQuery` as `jq`.
  15214. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15215. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15216. * compiled({ 'users': ['fred', 'barney'] });
  15217. * // => '<li>fred</li><li>barney</li>'
  15218. *
  15219. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15220. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15221. * compiled(data);
  15222. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15223. *
  15224. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15225. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15226. * compiled.source;
  15227. * // => function(data) {
  15228. * // var __t, __p = '';
  15229. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15230. * // return __p;
  15231. * // }
  15232. *
  15233. * // Use custom template delimiters.
  15234. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15235. * var compiled = _.template('hello {{ user }}!');
  15236. * compiled({ 'user': 'mustache' });
  15237. * // => 'hello mustache!'
  15238. *
  15239. * // Use the `source` property to inline compiled templates for meaningful
  15240. * // line numbers in error messages and stack traces.
  15241. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15242. * var JST = {\
  15243. * "main": ' + _.template(mainText).source + '\
  15244. * };\
  15245. * ');
  15246. */
  15247. function template(string, options, guard) {
  15248. // Based on John Resig's `tmpl` implementation
  15249. // (http://ejohn.org/blog/javascript-micro-templating/)
  15250. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15251. var settings = lodash.templateSettings;
  15252. if (guard && isIterateeCall(string, options, guard)) {
  15253. options = undefined;
  15254. }
  15255. string = toString(string);
  15256. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15257. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15258. importsKeys = keys(imports),
  15259. importsValues = baseValues(imports, importsKeys);
  15260. var isEscaping,
  15261. isEvaluating,
  15262. index = 0,
  15263. interpolate = options.interpolate || reNoMatch,
  15264. source = "__p += '";
  15265. // Compile the regexp to match each delimiter.
  15266. var reDelimiters = RegExp(
  15267. (options.escape || reNoMatch).source + '|' +
  15268. interpolate.source + '|' +
  15269. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15270. (options.evaluate || reNoMatch).source + '|$'
  15271. , 'g');
  15272. // Use a sourceURL for easier debugging.
  15273. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15274. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15275. // and escape the comment, thus injecting code that gets evaled.
  15276. var sourceURL = '//# sourceURL=' +
  15277. (hasOwnProperty.call(options, 'sourceURL')
  15278. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15279. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15280. ) + '\n';
  15281. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15282. interpolateValue || (interpolateValue = esTemplateValue);
  15283. // Escape characters that can't be included in string literals.
  15284. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15285. // Replace delimiters with snippets.
  15286. if (escapeValue) {
  15287. isEscaping = true;
  15288. source += "' +\n__e(" + escapeValue + ") +\n'";
  15289. }
  15290. if (evaluateValue) {
  15291. isEvaluating = true;
  15292. source += "';\n" + evaluateValue + ";\n__p += '";
  15293. }
  15294. if (interpolateValue) {
  15295. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15296. }
  15297. index = offset + match.length;
  15298. // The JS engine embedded in Adobe products needs `match` returned in
  15299. // order to produce the correct `offset` value.
  15300. return match;
  15301. });
  15302. source += "';\n";
  15303. // If `variable` is not specified wrap a with-statement around the generated
  15304. // code to add the data object to the top of the scope chain.
  15305. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15306. if (!variable) {
  15307. source = 'with (obj) {\n' + source + '\n}\n';
  15308. }
  15309. // Throw an error if a forbidden character was found in `variable`, to prevent
  15310. // potential command injection attacks.
  15311. else if (reForbiddenIdentifierChars.test(variable)) {
  15312. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15313. }
  15314. // Cleanup code by stripping empty strings.
  15315. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15316. .replace(reEmptyStringMiddle, '$1')
  15317. .replace(reEmptyStringTrailing, '$1;');
  15318. // Frame code as the function body.
  15319. source = 'function(' + (variable || 'obj') + ') {\n' +
  15320. (variable
  15321. ? ''
  15322. : 'obj || (obj = {});\n'
  15323. ) +
  15324. "var __t, __p = ''" +
  15325. (isEscaping
  15326. ? ', __e = _.escape'
  15327. : ''
  15328. ) +
  15329. (isEvaluating
  15330. ? ', __j = Array.prototype.join;\n' +
  15331. "function print() { __p += __j.call(arguments, '') }\n"
  15332. : ';\n'
  15333. ) +
  15334. source +
  15335. 'return __p\n}';
  15336. var result = attempt(function() {
  15337. return Function(importsKeys, sourceURL + 'return ' + source)
  15338. .apply(undefined, importsValues);
  15339. });
  15340. // Provide the compiled function's source by its `toString` method or
  15341. // the `source` property as a convenience for inlining compiled templates.
  15342. result.source = source;
  15343. if (isError(result)) {
  15344. throw result;
  15345. }
  15346. return result;
  15347. }
  15348. /**
  15349. * Converts `string`, as a whole, to lower case just like
  15350. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15351. *
  15352. * @static
  15353. * @memberOf _
  15354. * @since 4.0.0
  15355. * @category String
  15356. * @param {string} [string=''] The string to convert.
  15357. * @returns {string} Returns the lower cased string.
  15358. * @example
  15359. *
  15360. * _.toLower('--Foo-Bar--');
  15361. * // => '--foo-bar--'
  15362. *
  15363. * _.toLower('fooBar');
  15364. * // => 'foobar'
  15365. *
  15366. * _.toLower('__FOO_BAR__');
  15367. * // => '__foo_bar__'
  15368. */
  15369. function toLower(value) {
  15370. return toString(value).toLowerCase();
  15371. }
  15372. /**
  15373. * Converts `string`, as a whole, to upper case just like
  15374. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15375. *
  15376. * @static
  15377. * @memberOf _
  15378. * @since 4.0.0
  15379. * @category String
  15380. * @param {string} [string=''] The string to convert.
  15381. * @returns {string} Returns the upper cased string.
  15382. * @example
  15383. *
  15384. * _.toUpper('--foo-bar--');
  15385. * // => '--FOO-BAR--'
  15386. *
  15387. * _.toUpper('fooBar');
  15388. * // => 'FOOBAR'
  15389. *
  15390. * _.toUpper('__foo_bar__');
  15391. * // => '__FOO_BAR__'
  15392. */
  15393. function toUpper(value) {
  15394. return toString(value).toUpperCase();
  15395. }
  15396. /**
  15397. * Removes leading and trailing whitespace or specified characters from `string`.
  15398. *
  15399. * @static
  15400. * @memberOf _
  15401. * @since 3.0.0
  15402. * @category String
  15403. * @param {string} [string=''] The string to trim.
  15404. * @param {string} [chars=whitespace] The characters to trim.
  15405. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15406. * @returns {string} Returns the trimmed string.
  15407. * @example
  15408. *
  15409. * _.trim(' abc ');
  15410. * // => 'abc'
  15411. *
  15412. * _.trim('-_-abc-_-', '_-');
  15413. * // => 'abc'
  15414. *
  15415. * _.map([' foo ', ' bar '], _.trim);
  15416. * // => ['foo', 'bar']
  15417. */
  15418. function trim(string, chars, guard) {
  15419. string = toString(string);
  15420. if (string && (guard || chars === undefined)) {
  15421. return baseTrim(string);
  15422. }
  15423. if (!string || !(chars = baseToString(chars))) {
  15424. return string;
  15425. }
  15426. var strSymbols = stringToArray(string),
  15427. chrSymbols = stringToArray(chars),
  15428. start = charsStartIndex(strSymbols, chrSymbols),
  15429. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15430. return castSlice(strSymbols, start, end).join('');
  15431. }
  15432. /**
  15433. * Removes trailing whitespace or specified characters from `string`.
  15434. *
  15435. * @static
  15436. * @memberOf _
  15437. * @since 4.0.0
  15438. * @category String
  15439. * @param {string} [string=''] The string to trim.
  15440. * @param {string} [chars=whitespace] The characters to trim.
  15441. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15442. * @returns {string} Returns the trimmed string.
  15443. * @example
  15444. *
  15445. * _.trimEnd(' abc ');
  15446. * // => ' abc'
  15447. *
  15448. * _.trimEnd('-_-abc-_-', '_-');
  15449. * // => '-_-abc'
  15450. */
  15451. function trimEnd(string, chars, guard) {
  15452. string = toString(string);
  15453. if (string && (guard || chars === undefined)) {
  15454. return string.slice(0, trimmedEndIndex(string) + 1);
  15455. }
  15456. if (!string || !(chars = baseToString(chars))) {
  15457. return string;
  15458. }
  15459. var strSymbols = stringToArray(string),
  15460. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15461. return castSlice(strSymbols, 0, end).join('');
  15462. }
  15463. /**
  15464. * Removes leading whitespace or specified characters from `string`.
  15465. *
  15466. * @static
  15467. * @memberOf _
  15468. * @since 4.0.0
  15469. * @category String
  15470. * @param {string} [string=''] The string to trim.
  15471. * @param {string} [chars=whitespace] The characters to trim.
  15472. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15473. * @returns {string} Returns the trimmed string.
  15474. * @example
  15475. *
  15476. * _.trimStart(' abc ');
  15477. * // => 'abc '
  15478. *
  15479. * _.trimStart('-_-abc-_-', '_-');
  15480. * // => 'abc-_-'
  15481. */
  15482. function trimStart(string, chars, guard) {
  15483. string = toString(string);
  15484. if (string && (guard || chars === undefined)) {
  15485. return string.replace(reTrimStart, '');
  15486. }
  15487. if (!string || !(chars = baseToString(chars))) {
  15488. return string;
  15489. }
  15490. var strSymbols = stringToArray(string),
  15491. start = charsStartIndex(strSymbols, stringToArray(chars));
  15492. return castSlice(strSymbols, start).join('');
  15493. }
  15494. /**
  15495. * Truncates `string` if it's longer than the given maximum string length.
  15496. * The last characters of the truncated string are replaced with the omission
  15497. * string which defaults to "...".
  15498. *
  15499. * @static
  15500. * @memberOf _
  15501. * @since 4.0.0
  15502. * @category String
  15503. * @param {string} [string=''] The string to truncate.
  15504. * @param {Object} [options={}] The options object.
  15505. * @param {number} [options.length=30] The maximum string length.
  15506. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15507. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15508. * @returns {string} Returns the truncated string.
  15509. * @example
  15510. *
  15511. * _.truncate('hi-diddly-ho there, neighborino');
  15512. * // => 'hi-diddly-ho there, neighbo...'
  15513. *
  15514. * _.truncate('hi-diddly-ho there, neighborino', {
  15515. * 'length': 24,
  15516. * 'separator': ' '
  15517. * });
  15518. * // => 'hi-diddly-ho there,...'
  15519. *
  15520. * _.truncate('hi-diddly-ho there, neighborino', {
  15521. * 'length': 24,
  15522. * 'separator': /,? +/
  15523. * });
  15524. * // => 'hi-diddly-ho there...'
  15525. *
  15526. * _.truncate('hi-diddly-ho there, neighborino', {
  15527. * 'omission': ' [...]'
  15528. * });
  15529. * // => 'hi-diddly-ho there, neig [...]'
  15530. */
  15531. function truncate(string, options) {
  15532. var length = DEFAULT_TRUNC_LENGTH,
  15533. omission = DEFAULT_TRUNC_OMISSION;
  15534. if (isObject(options)) {
  15535. var separator = 'separator' in options ? options.separator : separator;
  15536. length = 'length' in options ? toInteger(options.length) : length;
  15537. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15538. }
  15539. string = toString(string);
  15540. var strLength = string.length;
  15541. if (hasUnicode(string)) {
  15542. var strSymbols = stringToArray(string);
  15543. strLength = strSymbols.length;
  15544. }
  15545. if (length >= strLength) {
  15546. return string;
  15547. }
  15548. var end = length - stringSize(omission);
  15549. if (end < 1) {
  15550. return omission;
  15551. }
  15552. var result = strSymbols
  15553. ? castSlice(strSymbols, 0, end).join('')
  15554. : string.slice(0, end);
  15555. if (separator === undefined) {
  15556. return result + omission;
  15557. }
  15558. if (strSymbols) {
  15559. end += (result.length - end);
  15560. }
  15561. if (isRegExp(separator)) {
  15562. if (string.slice(end).search(separator)) {
  15563. var match,
  15564. substring = result;
  15565. if (!separator.global) {
  15566. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15567. }
  15568. separator.lastIndex = 0;
  15569. while ((match = separator.exec(substring))) {
  15570. var newEnd = match.index;
  15571. }
  15572. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15573. }
  15574. } else if (string.indexOf(baseToString(separator), end) != end) {
  15575. var index = result.lastIndexOf(separator);
  15576. if (index > -1) {
  15577. result = result.slice(0, index);
  15578. }
  15579. }
  15580. return result + omission;
  15581. }
  15582. /**
  15583. * The inverse of `_.escape`; this method converts the HTML entities
  15584. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15585. * their corresponding characters.
  15586. *
  15587. * **Note:** No other HTML entities are unescaped. To unescape additional
  15588. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15589. *
  15590. * @static
  15591. * @memberOf _
  15592. * @since 0.6.0
  15593. * @category String
  15594. * @param {string} [string=''] The string to unescape.
  15595. * @returns {string} Returns the unescaped string.
  15596. * @example
  15597. *
  15598. * _.unescape('fred, barney, &amp; pebbles');
  15599. * // => 'fred, barney, & pebbles'
  15600. */
  15601. function unescape(string) {
  15602. string = toString(string);
  15603. return (string && reHasEscapedHtml.test(string))
  15604. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15605. : string;
  15606. }
  15607. /**
  15608. * Converts `string`, as space separated words, to upper case.
  15609. *
  15610. * @static
  15611. * @memberOf _
  15612. * @since 4.0.0
  15613. * @category String
  15614. * @param {string} [string=''] The string to convert.
  15615. * @returns {string} Returns the upper cased string.
  15616. * @example
  15617. *
  15618. * _.upperCase('--foo-bar');
  15619. * // => 'FOO BAR'
  15620. *
  15621. * _.upperCase('fooBar');
  15622. * // => 'FOO BAR'
  15623. *
  15624. * _.upperCase('__foo_bar__');
  15625. * // => 'FOO BAR'
  15626. */
  15627. var upperCase = createCompounder(function(result, word, index) {
  15628. return result + (index ? ' ' : '') + word.toUpperCase();
  15629. });
  15630. /**
  15631. * Converts the first character of `string` to upper case.
  15632. *
  15633. * @static
  15634. * @memberOf _
  15635. * @since 4.0.0
  15636. * @category String
  15637. * @param {string} [string=''] The string to convert.
  15638. * @returns {string} Returns the converted string.
  15639. * @example
  15640. *
  15641. * _.upperFirst('fred');
  15642. * // => 'Fred'
  15643. *
  15644. * _.upperFirst('FRED');
  15645. * // => 'FRED'
  15646. */
  15647. var upperFirst = createCaseFirst('toUpperCase');
  15648. /**
  15649. * Splits `string` into an array of its words.
  15650. *
  15651. * @static
  15652. * @memberOf _
  15653. * @since 3.0.0
  15654. * @category String
  15655. * @param {string} [string=''] The string to inspect.
  15656. * @param {RegExp|string} [pattern] The pattern to match words.
  15657. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15658. * @returns {Array} Returns the words of `string`.
  15659. * @example
  15660. *
  15661. * _.words('fred, barney, & pebbles');
  15662. * // => ['fred', 'barney', 'pebbles']
  15663. *
  15664. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15665. * // => ['fred', 'barney', '&', 'pebbles']
  15666. */
  15667. function words(string, pattern, guard) {
  15668. string = toString(string);
  15669. pattern = guard ? undefined : pattern;
  15670. if (pattern === undefined) {
  15671. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15672. }
  15673. return string.match(pattern) || [];
  15674. }
  15675. /*------------------------------------------------------------------------*/
  15676. /**
  15677. * Attempts to invoke `func`, returning either the result or the caught error
  15678. * object. Any additional arguments are provided to `func` when it's invoked.
  15679. *
  15680. * @static
  15681. * @memberOf _
  15682. * @since 3.0.0
  15683. * @category Util
  15684. * @param {Function} func The function to attempt.
  15685. * @param {...*} [args] The arguments to invoke `func` with.
  15686. * @returns {*} Returns the `func` result or error object.
  15687. * @example
  15688. *
  15689. * // Avoid throwing errors for invalid selectors.
  15690. * var elements = _.attempt(function(selector) {
  15691. * return document.querySelectorAll(selector);
  15692. * }, '>_>');
  15693. *
  15694. * if (_.isError(elements)) {
  15695. * elements = [];
  15696. * }
  15697. */
  15698. var attempt = baseRest(function(func, args) {
  15699. try {
  15700. return apply(func, undefined, args);
  15701. } catch (e) {
  15702. return isError(e) ? e : new Error(e);
  15703. }
  15704. });
  15705. /**
  15706. * Binds methods of an object to the object itself, overwriting the existing
  15707. * method.
  15708. *
  15709. * **Note:** This method doesn't set the "length" property of bound functions.
  15710. *
  15711. * @static
  15712. * @since 0.1.0
  15713. * @memberOf _
  15714. * @category Util
  15715. * @param {Object} object The object to bind and assign the bound methods to.
  15716. * @param {...(string|string[])} methodNames The object method names to bind.
  15717. * @returns {Object} Returns `object`.
  15718. * @example
  15719. *
  15720. * var view = {
  15721. * 'label': 'docs',
  15722. * 'click': function() {
  15723. * console.log('clicked ' + this.label);
  15724. * }
  15725. * };
  15726. *
  15727. * _.bindAll(view, ['click']);
  15728. * jQuery(element).on('click', view.click);
  15729. * // => Logs 'clicked docs' when clicked.
  15730. */
  15731. var bindAll = flatRest(function(object, methodNames) {
  15732. arrayEach(methodNames, function(key) {
  15733. key = toKey(key);
  15734. baseAssignValue(object, key, bind(object[key], object));
  15735. });
  15736. return object;
  15737. });
  15738. /**
  15739. * Creates a function that iterates over `pairs` and invokes the corresponding
  15740. * function of the first predicate to return truthy. The predicate-function
  15741. * pairs are invoked with the `this` binding and arguments of the created
  15742. * function.
  15743. *
  15744. * @static
  15745. * @memberOf _
  15746. * @since 4.0.0
  15747. * @category Util
  15748. * @param {Array} pairs The predicate-function pairs.
  15749. * @returns {Function} Returns the new composite function.
  15750. * @example
  15751. *
  15752. * var func = _.cond([
  15753. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15754. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15755. * [_.stubTrue, _.constant('no match')]
  15756. * ]);
  15757. *
  15758. * func({ 'a': 1, 'b': 2 });
  15759. * // => 'matches A'
  15760. *
  15761. * func({ 'a': 0, 'b': 1 });
  15762. * // => 'matches B'
  15763. *
  15764. * func({ 'a': '1', 'b': '2' });
  15765. * // => 'no match'
  15766. */
  15767. function cond(pairs) {
  15768. var length = pairs == null ? 0 : pairs.length,
  15769. toIteratee = getIteratee();
  15770. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15771. if (typeof pair[1] != 'function') {
  15772. throw new TypeError(FUNC_ERROR_TEXT);
  15773. }
  15774. return [toIteratee(pair[0]), pair[1]];
  15775. });
  15776. return baseRest(function(args) {
  15777. var index = -1;
  15778. while (++index < length) {
  15779. var pair = pairs[index];
  15780. if (apply(pair[0], this, args)) {
  15781. return apply(pair[1], this, args);
  15782. }
  15783. }
  15784. });
  15785. }
  15786. /**
  15787. * Creates a function that invokes the predicate properties of `source` with
  15788. * the corresponding property values of a given object, returning `true` if
  15789. * all predicates return truthy, else `false`.
  15790. *
  15791. * **Note:** The created function is equivalent to `_.conformsTo` with
  15792. * `source` partially applied.
  15793. *
  15794. * @static
  15795. * @memberOf _
  15796. * @since 4.0.0
  15797. * @category Util
  15798. * @param {Object} source The object of property predicates to conform to.
  15799. * @returns {Function} Returns the new spec function.
  15800. * @example
  15801. *
  15802. * var objects = [
  15803. * { 'a': 2, 'b': 1 },
  15804. * { 'a': 1, 'b': 2 }
  15805. * ];
  15806. *
  15807. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15808. * // => [{ 'a': 1, 'b': 2 }]
  15809. */
  15810. function conforms(source) {
  15811. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15812. }
  15813. /**
  15814. * Creates a function that returns `value`.
  15815. *
  15816. * @static
  15817. * @memberOf _
  15818. * @since 2.4.0
  15819. * @category Util
  15820. * @param {*} value The value to return from the new function.
  15821. * @returns {Function} Returns the new constant function.
  15822. * @example
  15823. *
  15824. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15825. *
  15826. * console.log(objects);
  15827. * // => [{ 'a': 1 }, { 'a': 1 }]
  15828. *
  15829. * console.log(objects[0] === objects[1]);
  15830. * // => true
  15831. */
  15832. function constant(value) {
  15833. return function() {
  15834. return value;
  15835. };
  15836. }
  15837. /**
  15838. * Checks `value` to determine whether a default value should be returned in
  15839. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15840. * or `undefined`.
  15841. *
  15842. * @static
  15843. * @memberOf _
  15844. * @since 4.14.0
  15845. * @category Util
  15846. * @param {*} value The value to check.
  15847. * @param {*} defaultValue The default value.
  15848. * @returns {*} Returns the resolved value.
  15849. * @example
  15850. *
  15851. * _.defaultTo(1, 10);
  15852. * // => 1
  15853. *
  15854. * _.defaultTo(undefined, 10);
  15855. * // => 10
  15856. */
  15857. function defaultTo(value, defaultValue) {
  15858. return (value == null || value !== value) ? defaultValue : value;
  15859. }
  15860. /**
  15861. * Creates a function that returns the result of invoking the given functions
  15862. * with the `this` binding of the created function, where each successive
  15863. * invocation is supplied the return value of the previous.
  15864. *
  15865. * @static
  15866. * @memberOf _
  15867. * @since 3.0.0
  15868. * @category Util
  15869. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15870. * @returns {Function} Returns the new composite function.
  15871. * @see _.flowRight
  15872. * @example
  15873. *
  15874. * function square(n) {
  15875. * return n * n;
  15876. * }
  15877. *
  15878. * var addSquare = _.flow([_.add, square]);
  15879. * addSquare(1, 2);
  15880. * // => 9
  15881. */
  15882. var flow = createFlow();
  15883. /**
  15884. * This method is like `_.flow` except that it creates a function that
  15885. * invokes the given functions from right to left.
  15886. *
  15887. * @static
  15888. * @since 3.0.0
  15889. * @memberOf _
  15890. * @category Util
  15891. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15892. * @returns {Function} Returns the new composite function.
  15893. * @see _.flow
  15894. * @example
  15895. *
  15896. * function square(n) {
  15897. * return n * n;
  15898. * }
  15899. *
  15900. * var addSquare = _.flowRight([square, _.add]);
  15901. * addSquare(1, 2);
  15902. * // => 9
  15903. */
  15904. var flowRight = createFlow(true);
  15905. /**
  15906. * This method returns the first argument it receives.
  15907. *
  15908. * @static
  15909. * @since 0.1.0
  15910. * @memberOf _
  15911. * @category Util
  15912. * @param {*} value Any value.
  15913. * @returns {*} Returns `value`.
  15914. * @example
  15915. *
  15916. * var object = { 'a': 1 };
  15917. *
  15918. * console.log(_.identity(object) === object);
  15919. * // => true
  15920. */
  15921. function identity(value) {
  15922. return value;
  15923. }
  15924. /**
  15925. * Creates a function that invokes `func` with the arguments of the created
  15926. * function. If `func` is a property name, the created function returns the
  15927. * property value for a given element. If `func` is an array or object, the
  15928. * created function returns `true` for elements that contain the equivalent
  15929. * source properties, otherwise it returns `false`.
  15930. *
  15931. * @static
  15932. * @since 4.0.0
  15933. * @memberOf _
  15934. * @category Util
  15935. * @param {*} [func=_.identity] The value to convert to a callback.
  15936. * @returns {Function} Returns the callback.
  15937. * @example
  15938. *
  15939. * var users = [
  15940. * { 'user': 'barney', 'age': 36, 'active': true },
  15941. * { 'user': 'fred', 'age': 40, 'active': false }
  15942. * ];
  15943. *
  15944. * // The `_.matches` iteratee shorthand.
  15945. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15946. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15947. *
  15948. * // The `_.matchesProperty` iteratee shorthand.
  15949. * _.filter(users, _.iteratee(['user', 'fred']));
  15950. * // => [{ 'user': 'fred', 'age': 40 }]
  15951. *
  15952. * // The `_.property` iteratee shorthand.
  15953. * _.map(users, _.iteratee('user'));
  15954. * // => ['barney', 'fred']
  15955. *
  15956. * // Create custom iteratee shorthands.
  15957. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15958. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15959. * return func.test(string);
  15960. * };
  15961. * });
  15962. *
  15963. * _.filter(['abc', 'def'], /ef/);
  15964. * // => ['def']
  15965. */
  15966. function iteratee(func) {
  15967. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15968. }
  15969. /**
  15970. * Creates a function that performs a partial deep comparison between a given
  15971. * object and `source`, returning `true` if the given object has equivalent
  15972. * property values, else `false`.
  15973. *
  15974. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15975. * partially applied.
  15976. *
  15977. * Partial comparisons will match empty array and empty object `source`
  15978. * values against any array or object value, respectively. See `_.isEqual`
  15979. * for a list of supported value comparisons.
  15980. *
  15981. * **Note:** Multiple values can be checked by combining several matchers
  15982. * using `_.overSome`
  15983. *
  15984. * @static
  15985. * @memberOf _
  15986. * @since 3.0.0
  15987. * @category Util
  15988. * @param {Object} source The object of property values to match.
  15989. * @returns {Function} Returns the new spec function.
  15990. * @example
  15991. *
  15992. * var objects = [
  15993. * { 'a': 1, 'b': 2, 'c': 3 },
  15994. * { 'a': 4, 'b': 5, 'c': 6 }
  15995. * ];
  15996. *
  15997. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15998. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15999. *
  16000. * // Checking for several possible values
  16001. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  16002. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16003. */
  16004. function matches(source) {
  16005. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  16006. }
  16007. /**
  16008. * Creates a function that performs a partial deep comparison between the
  16009. * value at `path` of a given object to `srcValue`, returning `true` if the
  16010. * object value is equivalent, else `false`.
  16011. *
  16012. * **Note:** Partial comparisons will match empty array and empty object
  16013. * `srcValue` values against any array or object value, respectively. See
  16014. * `_.isEqual` for a list of supported value comparisons.
  16015. *
  16016. * **Note:** Multiple values can be checked by combining several matchers
  16017. * using `_.overSome`
  16018. *
  16019. * @static
  16020. * @memberOf _
  16021. * @since 3.2.0
  16022. * @category Util
  16023. * @param {Array|string} path The path of the property to get.
  16024. * @param {*} srcValue The value to match.
  16025. * @returns {Function} Returns the new spec function.
  16026. * @example
  16027. *
  16028. * var objects = [
  16029. * { 'a': 1, 'b': 2, 'c': 3 },
  16030. * { 'a': 4, 'b': 5, 'c': 6 }
  16031. * ];
  16032. *
  16033. * _.find(objects, _.matchesProperty('a', 4));
  16034. * // => { 'a': 4, 'b': 5, 'c': 6 }
  16035. *
  16036. * // Checking for several possible values
  16037. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  16038. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  16039. */
  16040. function matchesProperty(path, srcValue) {
  16041. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  16042. }
  16043. /**
  16044. * Creates a function that invokes the method at `path` of a given object.
  16045. * Any additional arguments are provided to the invoked method.
  16046. *
  16047. * @static
  16048. * @memberOf _
  16049. * @since 3.7.0
  16050. * @category Util
  16051. * @param {Array|string} path The path of the method to invoke.
  16052. * @param {...*} [args] The arguments to invoke the method with.
  16053. * @returns {Function} Returns the new invoker function.
  16054. * @example
  16055. *
  16056. * var objects = [
  16057. * { 'a': { 'b': _.constant(2) } },
  16058. * { 'a': { 'b': _.constant(1) } }
  16059. * ];
  16060. *
  16061. * _.map(objects, _.method('a.b'));
  16062. * // => [2, 1]
  16063. *
  16064. * _.map(objects, _.method(['a', 'b']));
  16065. * // => [2, 1]
  16066. */
  16067. var method = baseRest(function(path, args) {
  16068. return function(object) {
  16069. return baseInvoke(object, path, args);
  16070. };
  16071. });
  16072. /**
  16073. * The opposite of `_.method`; this method creates a function that invokes
  16074. * the method at a given path of `object`. Any additional arguments are
  16075. * provided to the invoked method.
  16076. *
  16077. * @static
  16078. * @memberOf _
  16079. * @since 3.7.0
  16080. * @category Util
  16081. * @param {Object} object The object to query.
  16082. * @param {...*} [args] The arguments to invoke the method with.
  16083. * @returns {Function} Returns the new invoker function.
  16084. * @example
  16085. *
  16086. * var array = _.times(3, _.constant),
  16087. * object = { 'a': array, 'b': array, 'c': array };
  16088. *
  16089. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16090. * // => [2, 0]
  16091. *
  16092. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16093. * // => [2, 0]
  16094. */
  16095. var methodOf = baseRest(function(object, args) {
  16096. return function(path) {
  16097. return baseInvoke(object, path, args);
  16098. };
  16099. });
  16100. /**
  16101. * Adds all own enumerable string keyed function properties of a source
  16102. * object to the destination object. If `object` is a function, then methods
  16103. * are added to its prototype as well.
  16104. *
  16105. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16106. * avoid conflicts caused by modifying the original.
  16107. *
  16108. * @static
  16109. * @since 0.1.0
  16110. * @memberOf _
  16111. * @category Util
  16112. * @param {Function|Object} [object=lodash] The destination object.
  16113. * @param {Object} source The object of functions to add.
  16114. * @param {Object} [options={}] The options object.
  16115. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16116. * @returns {Function|Object} Returns `object`.
  16117. * @example
  16118. *
  16119. * function vowels(string) {
  16120. * return _.filter(string, function(v) {
  16121. * return /[aeiou]/i.test(v);
  16122. * });
  16123. * }
  16124. *
  16125. * _.mixin({ 'vowels': vowels });
  16126. * _.vowels('fred');
  16127. * // => ['e']
  16128. *
  16129. * _('fred').vowels().value();
  16130. * // => ['e']
  16131. *
  16132. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16133. * _('fred').vowels();
  16134. * // => ['e']
  16135. */
  16136. function mixin(object, source, options) {
  16137. var props = keys(source),
  16138. methodNames = baseFunctions(source, props);
  16139. if (options == null &&
  16140. !(isObject(source) && (methodNames.length || !props.length))) {
  16141. options = source;
  16142. source = object;
  16143. object = this;
  16144. methodNames = baseFunctions(source, keys(source));
  16145. }
  16146. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16147. isFunc = isFunction(object);
  16148. arrayEach(methodNames, function(methodName) {
  16149. var func = source[methodName];
  16150. object[methodName] = func;
  16151. if (isFunc) {
  16152. object.prototype[methodName] = function() {
  16153. var chainAll = this.__chain__;
  16154. if (chain || chainAll) {
  16155. var result = object(this.__wrapped__),
  16156. actions = result.__actions__ = copyArray(this.__actions__);
  16157. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16158. result.__chain__ = chainAll;
  16159. return result;
  16160. }
  16161. return func.apply(object, arrayPush([this.value()], arguments));
  16162. };
  16163. }
  16164. });
  16165. return object;
  16166. }
  16167. /**
  16168. * Reverts the `_` variable to its previous value and returns a reference to
  16169. * the `lodash` function.
  16170. *
  16171. * @static
  16172. * @since 0.1.0
  16173. * @memberOf _
  16174. * @category Util
  16175. * @returns {Function} Returns the `lodash` function.
  16176. * @example
  16177. *
  16178. * var lodash = _.noConflict();
  16179. */
  16180. function noConflict() {
  16181. if (root._ === this) {
  16182. root._ = oldDash;
  16183. }
  16184. return this;
  16185. }
  16186. /**
  16187. * This method returns `undefined`.
  16188. *
  16189. * @static
  16190. * @memberOf _
  16191. * @since 2.3.0
  16192. * @category Util
  16193. * @example
  16194. *
  16195. * _.times(2, _.noop);
  16196. * // => [undefined, undefined]
  16197. */
  16198. function noop() {
  16199. // No operation performed.
  16200. }
  16201. /**
  16202. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16203. * the nth argument from the end is returned.
  16204. *
  16205. * @static
  16206. * @memberOf _
  16207. * @since 4.0.0
  16208. * @category Util
  16209. * @param {number} [n=0] The index of the argument to return.
  16210. * @returns {Function} Returns the new pass-thru function.
  16211. * @example
  16212. *
  16213. * var func = _.nthArg(1);
  16214. * func('a', 'b', 'c', 'd');
  16215. * // => 'b'
  16216. *
  16217. * var func = _.nthArg(-2);
  16218. * func('a', 'b', 'c', 'd');
  16219. * // => 'c'
  16220. */
  16221. function nthArg(n) {
  16222. n = toInteger(n);
  16223. return baseRest(function(args) {
  16224. return baseNth(args, n);
  16225. });
  16226. }
  16227. /**
  16228. * Creates a function that invokes `iteratees` with the arguments it receives
  16229. * and returns their results.
  16230. *
  16231. * @static
  16232. * @memberOf _
  16233. * @since 4.0.0
  16234. * @category Util
  16235. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16236. * The iteratees to invoke.
  16237. * @returns {Function} Returns the new function.
  16238. * @example
  16239. *
  16240. * var func = _.over([Math.max, Math.min]);
  16241. *
  16242. * func(1, 2, 3, 4);
  16243. * // => [4, 1]
  16244. */
  16245. var over = createOver(arrayMap);
  16246. /**
  16247. * Creates a function that checks if **all** of the `predicates` return
  16248. * truthy when invoked with the arguments it receives.
  16249. *
  16250. * Following shorthands are possible for providing predicates.
  16251. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16252. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16253. *
  16254. * @static
  16255. * @memberOf _
  16256. * @since 4.0.0
  16257. * @category Util
  16258. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16259. * The predicates to check.
  16260. * @returns {Function} Returns the new function.
  16261. * @example
  16262. *
  16263. * var func = _.overEvery([Boolean, isFinite]);
  16264. *
  16265. * func('1');
  16266. * // => true
  16267. *
  16268. * func(null);
  16269. * // => false
  16270. *
  16271. * func(NaN);
  16272. * // => false
  16273. */
  16274. var overEvery = createOver(arrayEvery);
  16275. /**
  16276. * Creates a function that checks if **any** of the `predicates` return
  16277. * truthy when invoked with the arguments it receives.
  16278. *
  16279. * Following shorthands are possible for providing predicates.
  16280. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16281. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16282. *
  16283. * @static
  16284. * @memberOf _
  16285. * @since 4.0.0
  16286. * @category Util
  16287. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16288. * The predicates to check.
  16289. * @returns {Function} Returns the new function.
  16290. * @example
  16291. *
  16292. * var func = _.overSome([Boolean, isFinite]);
  16293. *
  16294. * func('1');
  16295. * // => true
  16296. *
  16297. * func(null);
  16298. * // => true
  16299. *
  16300. * func(NaN);
  16301. * // => false
  16302. *
  16303. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16304. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16305. */
  16306. var overSome = createOver(arraySome);
  16307. /**
  16308. * Creates a function that returns the value at `path` of a given object.
  16309. *
  16310. * @static
  16311. * @memberOf _
  16312. * @since 2.4.0
  16313. * @category Util
  16314. * @param {Array|string} path The path of the property to get.
  16315. * @returns {Function} Returns the new accessor function.
  16316. * @example
  16317. *
  16318. * var objects = [
  16319. * { 'a': { 'b': 2 } },
  16320. * { 'a': { 'b': 1 } }
  16321. * ];
  16322. *
  16323. * _.map(objects, _.property('a.b'));
  16324. * // => [2, 1]
  16325. *
  16326. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16327. * // => [1, 2]
  16328. */
  16329. function property(path) {
  16330. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16331. }
  16332. /**
  16333. * The opposite of `_.property`; this method creates a function that returns
  16334. * the value at a given path of `object`.
  16335. *
  16336. * @static
  16337. * @memberOf _
  16338. * @since 3.0.0
  16339. * @category Util
  16340. * @param {Object} object The object to query.
  16341. * @returns {Function} Returns the new accessor function.
  16342. * @example
  16343. *
  16344. * var array = [0, 1, 2],
  16345. * object = { 'a': array, 'b': array, 'c': array };
  16346. *
  16347. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16348. * // => [2, 0]
  16349. *
  16350. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16351. * // => [2, 0]
  16352. */
  16353. function propertyOf(object) {
  16354. return function(path) {
  16355. return object == null ? undefined : baseGet(object, path);
  16356. };
  16357. }
  16358. /**
  16359. * Creates an array of numbers (positive and/or negative) progressing from
  16360. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16361. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16362. * it's set to `start` with `start` then set to `0`.
  16363. *
  16364. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16365. * floating-point values which can produce unexpected results.
  16366. *
  16367. * @static
  16368. * @since 0.1.0
  16369. * @memberOf _
  16370. * @category Util
  16371. * @param {number} [start=0] The start of the range.
  16372. * @param {number} end The end of the range.
  16373. * @param {number} [step=1] The value to increment or decrement by.
  16374. * @returns {Array} Returns the range of numbers.
  16375. * @see _.inRange, _.rangeRight
  16376. * @example
  16377. *
  16378. * _.range(4);
  16379. * // => [0, 1, 2, 3]
  16380. *
  16381. * _.range(-4);
  16382. * // => [0, -1, -2, -3]
  16383. *
  16384. * _.range(1, 5);
  16385. * // => [1, 2, 3, 4]
  16386. *
  16387. * _.range(0, 20, 5);
  16388. * // => [0, 5, 10, 15]
  16389. *
  16390. * _.range(0, -4, -1);
  16391. * // => [0, -1, -2, -3]
  16392. *
  16393. * _.range(1, 4, 0);
  16394. * // => [1, 1, 1]
  16395. *
  16396. * _.range(0);
  16397. * // => []
  16398. */
  16399. var range = createRange();
  16400. /**
  16401. * This method is like `_.range` except that it populates values in
  16402. * descending order.
  16403. *
  16404. * @static
  16405. * @memberOf _
  16406. * @since 4.0.0
  16407. * @category Util
  16408. * @param {number} [start=0] The start of the range.
  16409. * @param {number} end The end of the range.
  16410. * @param {number} [step=1] The value to increment or decrement by.
  16411. * @returns {Array} Returns the range of numbers.
  16412. * @see _.inRange, _.range
  16413. * @example
  16414. *
  16415. * _.rangeRight(4);
  16416. * // => [3, 2, 1, 0]
  16417. *
  16418. * _.rangeRight(-4);
  16419. * // => [-3, -2, -1, 0]
  16420. *
  16421. * _.rangeRight(1, 5);
  16422. * // => [4, 3, 2, 1]
  16423. *
  16424. * _.rangeRight(0, 20, 5);
  16425. * // => [15, 10, 5, 0]
  16426. *
  16427. * _.rangeRight(0, -4, -1);
  16428. * // => [-3, -2, -1, 0]
  16429. *
  16430. * _.rangeRight(1, 4, 0);
  16431. * // => [1, 1, 1]
  16432. *
  16433. * _.rangeRight(0);
  16434. * // => []
  16435. */
  16436. var rangeRight = createRange(true);
  16437. /**
  16438. * This method returns a new empty array.
  16439. *
  16440. * @static
  16441. * @memberOf _
  16442. * @since 4.13.0
  16443. * @category Util
  16444. * @returns {Array} Returns the new empty array.
  16445. * @example
  16446. *
  16447. * var arrays = _.times(2, _.stubArray);
  16448. *
  16449. * console.log(arrays);
  16450. * // => [[], []]
  16451. *
  16452. * console.log(arrays[0] === arrays[1]);
  16453. * // => false
  16454. */
  16455. function stubArray() {
  16456. return [];
  16457. }
  16458. /**
  16459. * This method returns `false`.
  16460. *
  16461. * @static
  16462. * @memberOf _
  16463. * @since 4.13.0
  16464. * @category Util
  16465. * @returns {boolean} Returns `false`.
  16466. * @example
  16467. *
  16468. * _.times(2, _.stubFalse);
  16469. * // => [false, false]
  16470. */
  16471. function stubFalse() {
  16472. return false;
  16473. }
  16474. /**
  16475. * This method returns a new empty object.
  16476. *
  16477. * @static
  16478. * @memberOf _
  16479. * @since 4.13.0
  16480. * @category Util
  16481. * @returns {Object} Returns the new empty object.
  16482. * @example
  16483. *
  16484. * var objects = _.times(2, _.stubObject);
  16485. *
  16486. * console.log(objects);
  16487. * // => [{}, {}]
  16488. *
  16489. * console.log(objects[0] === objects[1]);
  16490. * // => false
  16491. */
  16492. function stubObject() {
  16493. return {};
  16494. }
  16495. /**
  16496. * This method returns an empty string.
  16497. *
  16498. * @static
  16499. * @memberOf _
  16500. * @since 4.13.0
  16501. * @category Util
  16502. * @returns {string} Returns the empty string.
  16503. * @example
  16504. *
  16505. * _.times(2, _.stubString);
  16506. * // => ['', '']
  16507. */
  16508. function stubString() {
  16509. return '';
  16510. }
  16511. /**
  16512. * This method returns `true`.
  16513. *
  16514. * @static
  16515. * @memberOf _
  16516. * @since 4.13.0
  16517. * @category Util
  16518. * @returns {boolean} Returns `true`.
  16519. * @example
  16520. *
  16521. * _.times(2, _.stubTrue);
  16522. * // => [true, true]
  16523. */
  16524. function stubTrue() {
  16525. return true;
  16526. }
  16527. /**
  16528. * Invokes the iteratee `n` times, returning an array of the results of
  16529. * each invocation. The iteratee is invoked with one argument; (index).
  16530. *
  16531. * @static
  16532. * @since 0.1.0
  16533. * @memberOf _
  16534. * @category Util
  16535. * @param {number} n The number of times to invoke `iteratee`.
  16536. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16537. * @returns {Array} Returns the array of results.
  16538. * @example
  16539. *
  16540. * _.times(3, String);
  16541. * // => ['0', '1', '2']
  16542. *
  16543. * _.times(4, _.constant(0));
  16544. * // => [0, 0, 0, 0]
  16545. */
  16546. function times(n, iteratee) {
  16547. n = toInteger(n);
  16548. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16549. return [];
  16550. }
  16551. var index = MAX_ARRAY_LENGTH,
  16552. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16553. iteratee = getIteratee(iteratee);
  16554. n -= MAX_ARRAY_LENGTH;
  16555. var result = baseTimes(length, iteratee);
  16556. while (++index < n) {
  16557. iteratee(index);
  16558. }
  16559. return result;
  16560. }
  16561. /**
  16562. * Converts `value` to a property path array.
  16563. *
  16564. * @static
  16565. * @memberOf _
  16566. * @since 4.0.0
  16567. * @category Util
  16568. * @param {*} value The value to convert.
  16569. * @returns {Array} Returns the new property path array.
  16570. * @example
  16571. *
  16572. * _.toPath('a.b.c');
  16573. * // => ['a', 'b', 'c']
  16574. *
  16575. * _.toPath('a[0].b.c');
  16576. * // => ['a', '0', 'b', 'c']
  16577. */
  16578. function toPath(value) {
  16579. if (isArray(value)) {
  16580. return arrayMap(value, toKey);
  16581. }
  16582. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16583. }
  16584. /**
  16585. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16586. *
  16587. * @static
  16588. * @since 0.1.0
  16589. * @memberOf _
  16590. * @category Util
  16591. * @param {string} [prefix=''] The value to prefix the ID with.
  16592. * @returns {string} Returns the unique ID.
  16593. * @example
  16594. *
  16595. * _.uniqueId('contact_');
  16596. * // => 'contact_104'
  16597. *
  16598. * _.uniqueId();
  16599. * // => '105'
  16600. */
  16601. function uniqueId(prefix) {
  16602. var id = ++idCounter;
  16603. return toString(prefix) + id;
  16604. }
  16605. /*------------------------------------------------------------------------*/
  16606. /**
  16607. * Adds two numbers.
  16608. *
  16609. * @static
  16610. * @memberOf _
  16611. * @since 3.4.0
  16612. * @category Math
  16613. * @param {number} augend The first number in an addition.
  16614. * @param {number} addend The second number in an addition.
  16615. * @returns {number} Returns the total.
  16616. * @example
  16617. *
  16618. * _.add(6, 4);
  16619. * // => 10
  16620. */
  16621. var add = createMathOperation(function(augend, addend) {
  16622. return augend + addend;
  16623. }, 0);
  16624. /**
  16625. * Computes `number` rounded up to `precision`.
  16626. *
  16627. * @static
  16628. * @memberOf _
  16629. * @since 3.10.0
  16630. * @category Math
  16631. * @param {number} number The number to round up.
  16632. * @param {number} [precision=0] The precision to round up to.
  16633. * @returns {number} Returns the rounded up number.
  16634. * @example
  16635. *
  16636. * _.ceil(4.006);
  16637. * // => 5
  16638. *
  16639. * _.ceil(6.004, 2);
  16640. * // => 6.01
  16641. *
  16642. * _.ceil(6040, -2);
  16643. * // => 6100
  16644. */
  16645. var ceil = createRound('ceil');
  16646. /**
  16647. * Divide two numbers.
  16648. *
  16649. * @static
  16650. * @memberOf _
  16651. * @since 4.7.0
  16652. * @category Math
  16653. * @param {number} dividend The first number in a division.
  16654. * @param {number} divisor The second number in a division.
  16655. * @returns {number} Returns the quotient.
  16656. * @example
  16657. *
  16658. * _.divide(6, 4);
  16659. * // => 1.5
  16660. */
  16661. var divide = createMathOperation(function(dividend, divisor) {
  16662. return dividend / divisor;
  16663. }, 1);
  16664. /**
  16665. * Computes `number` rounded down to `precision`.
  16666. *
  16667. * @static
  16668. * @memberOf _
  16669. * @since 3.10.0
  16670. * @category Math
  16671. * @param {number} number The number to round down.
  16672. * @param {number} [precision=0] The precision to round down to.
  16673. * @returns {number} Returns the rounded down number.
  16674. * @example
  16675. *
  16676. * _.floor(4.006);
  16677. * // => 4
  16678. *
  16679. * _.floor(0.046, 2);
  16680. * // => 0.04
  16681. *
  16682. * _.floor(4060, -2);
  16683. * // => 4000
  16684. */
  16685. var floor = createRound('floor');
  16686. /**
  16687. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16688. * `undefined` is returned.
  16689. *
  16690. * @static
  16691. * @since 0.1.0
  16692. * @memberOf _
  16693. * @category Math
  16694. * @param {Array} array The array to iterate over.
  16695. * @returns {*} Returns the maximum value.
  16696. * @example
  16697. *
  16698. * _.max([4, 2, 8, 6]);
  16699. * // => 8
  16700. *
  16701. * _.max([]);
  16702. * // => undefined
  16703. */
  16704. function max(array) {
  16705. return (array && array.length)
  16706. ? baseExtremum(array, identity, baseGt)
  16707. : undefined;
  16708. }
  16709. /**
  16710. * This method is like `_.max` except that it accepts `iteratee` which is
  16711. * invoked for each element in `array` to generate the criterion by which
  16712. * the value is ranked. The iteratee is invoked with one argument: (value).
  16713. *
  16714. * @static
  16715. * @memberOf _
  16716. * @since 4.0.0
  16717. * @category Math
  16718. * @param {Array} array The array to iterate over.
  16719. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16720. * @returns {*} Returns the maximum value.
  16721. * @example
  16722. *
  16723. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16724. *
  16725. * _.maxBy(objects, function(o) { return o.n; });
  16726. * // => { 'n': 2 }
  16727. *
  16728. * // The `_.property` iteratee shorthand.
  16729. * _.maxBy(objects, 'n');
  16730. * // => { 'n': 2 }
  16731. */
  16732. function maxBy(array, iteratee) {
  16733. return (array && array.length)
  16734. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16735. : undefined;
  16736. }
  16737. /**
  16738. * Computes the mean of the values in `array`.
  16739. *
  16740. * @static
  16741. * @memberOf _
  16742. * @since 4.0.0
  16743. * @category Math
  16744. * @param {Array} array The array to iterate over.
  16745. * @returns {number} Returns the mean.
  16746. * @example
  16747. *
  16748. * _.mean([4, 2, 8, 6]);
  16749. * // => 5
  16750. */
  16751. function mean(array) {
  16752. return baseMean(array, identity);
  16753. }
  16754. /**
  16755. * This method is like `_.mean` except that it accepts `iteratee` which is
  16756. * invoked for each element in `array` to generate the value to be averaged.
  16757. * The iteratee is invoked with one argument: (value).
  16758. *
  16759. * @static
  16760. * @memberOf _
  16761. * @since 4.7.0
  16762. * @category Math
  16763. * @param {Array} array The array to iterate over.
  16764. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16765. * @returns {number} Returns the mean.
  16766. * @example
  16767. *
  16768. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16769. *
  16770. * _.meanBy(objects, function(o) { return o.n; });
  16771. * // => 5
  16772. *
  16773. * // The `_.property` iteratee shorthand.
  16774. * _.meanBy(objects, 'n');
  16775. * // => 5
  16776. */
  16777. function meanBy(array, iteratee) {
  16778. return baseMean(array, getIteratee(iteratee, 2));
  16779. }
  16780. /**
  16781. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16782. * `undefined` is returned.
  16783. *
  16784. * @static
  16785. * @since 0.1.0
  16786. * @memberOf _
  16787. * @category Math
  16788. * @param {Array} array The array to iterate over.
  16789. * @returns {*} Returns the minimum value.
  16790. * @example
  16791. *
  16792. * _.min([4, 2, 8, 6]);
  16793. * // => 2
  16794. *
  16795. * _.min([]);
  16796. * // => undefined
  16797. */
  16798. function min(array) {
  16799. return (array && array.length)
  16800. ? baseExtremum(array, identity, baseLt)
  16801. : undefined;
  16802. }
  16803. /**
  16804. * This method is like `_.min` except that it accepts `iteratee` which is
  16805. * invoked for each element in `array` to generate the criterion by which
  16806. * the value is ranked. The iteratee is invoked with one argument: (value).
  16807. *
  16808. * @static
  16809. * @memberOf _
  16810. * @since 4.0.0
  16811. * @category Math
  16812. * @param {Array} array The array to iterate over.
  16813. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16814. * @returns {*} Returns the minimum value.
  16815. * @example
  16816. *
  16817. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16818. *
  16819. * _.minBy(objects, function(o) { return o.n; });
  16820. * // => { 'n': 1 }
  16821. *
  16822. * // The `_.property` iteratee shorthand.
  16823. * _.minBy(objects, 'n');
  16824. * // => { 'n': 1 }
  16825. */
  16826. function minBy(array, iteratee) {
  16827. return (array && array.length)
  16828. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16829. : undefined;
  16830. }
  16831. /**
  16832. * Multiply two numbers.
  16833. *
  16834. * @static
  16835. * @memberOf _
  16836. * @since 4.7.0
  16837. * @category Math
  16838. * @param {number} multiplier The first number in a multiplication.
  16839. * @param {number} multiplicand The second number in a multiplication.
  16840. * @returns {number} Returns the product.
  16841. * @example
  16842. *
  16843. * _.multiply(6, 4);
  16844. * // => 24
  16845. */
  16846. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16847. return multiplier * multiplicand;
  16848. }, 1);
  16849. /**
  16850. * Computes `number` rounded to `precision`.
  16851. *
  16852. * @static
  16853. * @memberOf _
  16854. * @since 3.10.0
  16855. * @category Math
  16856. * @param {number} number The number to round.
  16857. * @param {number} [precision=0] The precision to round to.
  16858. * @returns {number} Returns the rounded number.
  16859. * @example
  16860. *
  16861. * _.round(4.006);
  16862. * // => 4
  16863. *
  16864. * _.round(4.006, 2);
  16865. * // => 4.01
  16866. *
  16867. * _.round(4060, -2);
  16868. * // => 4100
  16869. */
  16870. var round = createRound('round');
  16871. /**
  16872. * Subtract two numbers.
  16873. *
  16874. * @static
  16875. * @memberOf _
  16876. * @since 4.0.0
  16877. * @category Math
  16878. * @param {number} minuend The first number in a subtraction.
  16879. * @param {number} subtrahend The second number in a subtraction.
  16880. * @returns {number} Returns the difference.
  16881. * @example
  16882. *
  16883. * _.subtract(6, 4);
  16884. * // => 2
  16885. */
  16886. var subtract = createMathOperation(function(minuend, subtrahend) {
  16887. return minuend - subtrahend;
  16888. }, 0);
  16889. /**
  16890. * Computes the sum of the values in `array`.
  16891. *
  16892. * @static
  16893. * @memberOf _
  16894. * @since 3.4.0
  16895. * @category Math
  16896. * @param {Array} array The array to iterate over.
  16897. * @returns {number} Returns the sum.
  16898. * @example
  16899. *
  16900. * _.sum([4, 2, 8, 6]);
  16901. * // => 20
  16902. */
  16903. function sum(array) {
  16904. return (array && array.length)
  16905. ? baseSum(array, identity)
  16906. : 0;
  16907. }
  16908. /**
  16909. * This method is like `_.sum` except that it accepts `iteratee` which is
  16910. * invoked for each element in `array` to generate the value to be summed.
  16911. * The iteratee is invoked with one argument: (value).
  16912. *
  16913. * @static
  16914. * @memberOf _
  16915. * @since 4.0.0
  16916. * @category Math
  16917. * @param {Array} array The array to iterate over.
  16918. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16919. * @returns {number} Returns the sum.
  16920. * @example
  16921. *
  16922. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16923. *
  16924. * _.sumBy(objects, function(o) { return o.n; });
  16925. * // => 20
  16926. *
  16927. * // The `_.property` iteratee shorthand.
  16928. * _.sumBy(objects, 'n');
  16929. * // => 20
  16930. */
  16931. function sumBy(array, iteratee) {
  16932. return (array && array.length)
  16933. ? baseSum(array, getIteratee(iteratee, 2))
  16934. : 0;
  16935. }
  16936. /*------------------------------------------------------------------------*/
  16937. // Add methods that return wrapped values in chain sequences.
  16938. lodash.after = after;
  16939. lodash.ary = ary;
  16940. lodash.assign = assign;
  16941. lodash.assignIn = assignIn;
  16942. lodash.assignInWith = assignInWith;
  16943. lodash.assignWith = assignWith;
  16944. lodash.at = at;
  16945. lodash.before = before;
  16946. lodash.bind = bind;
  16947. lodash.bindAll = bindAll;
  16948. lodash.bindKey = bindKey;
  16949. lodash.castArray = castArray;
  16950. lodash.chain = chain;
  16951. lodash.chunk = chunk;
  16952. lodash.compact = compact;
  16953. lodash.concat = concat;
  16954. lodash.cond = cond;
  16955. lodash.conforms = conforms;
  16956. lodash.constant = constant;
  16957. lodash.countBy = countBy;
  16958. lodash.create = create;
  16959. lodash.curry = curry;
  16960. lodash.curryRight = curryRight;
  16961. lodash.debounce = debounce;
  16962. lodash.defaults = defaults;
  16963. lodash.defaultsDeep = defaultsDeep;
  16964. lodash.defer = defer;
  16965. lodash.delay = delay;
  16966. lodash.difference = difference;
  16967. lodash.differenceBy = differenceBy;
  16968. lodash.differenceWith = differenceWith;
  16969. lodash.drop = drop;
  16970. lodash.dropRight = dropRight;
  16971. lodash.dropRightWhile = dropRightWhile;
  16972. lodash.dropWhile = dropWhile;
  16973. lodash.fill = fill;
  16974. lodash.filter = filter;
  16975. lodash.flatMap = flatMap;
  16976. lodash.flatMapDeep = flatMapDeep;
  16977. lodash.flatMapDepth = flatMapDepth;
  16978. lodash.flatten = flatten;
  16979. lodash.flattenDeep = flattenDeep;
  16980. lodash.flattenDepth = flattenDepth;
  16981. lodash.flip = flip;
  16982. lodash.flow = flow;
  16983. lodash.flowRight = flowRight;
  16984. lodash.fromPairs = fromPairs;
  16985. lodash.functions = functions;
  16986. lodash.functionsIn = functionsIn;
  16987. lodash.groupBy = groupBy;
  16988. lodash.initial = initial;
  16989. lodash.intersection = intersection;
  16990. lodash.intersectionBy = intersectionBy;
  16991. lodash.intersectionWith = intersectionWith;
  16992. lodash.invert = invert;
  16993. lodash.invertBy = invertBy;
  16994. lodash.invokeMap = invokeMap;
  16995. lodash.iteratee = iteratee;
  16996. lodash.keyBy = keyBy;
  16997. lodash.keys = keys;
  16998. lodash.keysIn = keysIn;
  16999. lodash.map = map;
  17000. lodash.mapKeys = mapKeys;
  17001. lodash.mapValues = mapValues;
  17002. lodash.matches = matches;
  17003. lodash.matchesProperty = matchesProperty;
  17004. lodash.memoize = memoize;
  17005. lodash.merge = merge;
  17006. lodash.mergeWith = mergeWith;
  17007. lodash.method = method;
  17008. lodash.methodOf = methodOf;
  17009. lodash.mixin = mixin;
  17010. lodash.negate = negate;
  17011. lodash.nthArg = nthArg;
  17012. lodash.omit = omit;
  17013. lodash.omitBy = omitBy;
  17014. lodash.once = once;
  17015. lodash.orderBy = orderBy;
  17016. lodash.over = over;
  17017. lodash.overArgs = overArgs;
  17018. lodash.overEvery = overEvery;
  17019. lodash.overSome = overSome;
  17020. lodash.partial = partial;
  17021. lodash.partialRight = partialRight;
  17022. lodash.partition = partition;
  17023. lodash.pick = pick;
  17024. lodash.pickBy = pickBy;
  17025. lodash.property = property;
  17026. lodash.propertyOf = propertyOf;
  17027. lodash.pull = pull;
  17028. lodash.pullAll = pullAll;
  17029. lodash.pullAllBy = pullAllBy;
  17030. lodash.pullAllWith = pullAllWith;
  17031. lodash.pullAt = pullAt;
  17032. lodash.range = range;
  17033. lodash.rangeRight = rangeRight;
  17034. lodash.rearg = rearg;
  17035. lodash.reject = reject;
  17036. lodash.remove = remove;
  17037. lodash.rest = rest;
  17038. lodash.reverse = reverse;
  17039. lodash.sampleSize = sampleSize;
  17040. lodash.set = set;
  17041. lodash.setWith = setWith;
  17042. lodash.shuffle = shuffle;
  17043. lodash.slice = slice;
  17044. lodash.sortBy = sortBy;
  17045. lodash.sortedUniq = sortedUniq;
  17046. lodash.sortedUniqBy = sortedUniqBy;
  17047. lodash.split = split;
  17048. lodash.spread = spread;
  17049. lodash.tail = tail;
  17050. lodash.take = take;
  17051. lodash.takeRight = takeRight;
  17052. lodash.takeRightWhile = takeRightWhile;
  17053. lodash.takeWhile = takeWhile;
  17054. lodash.tap = tap;
  17055. lodash.throttle = throttle;
  17056. lodash.thru = thru;
  17057. lodash.toArray = toArray;
  17058. lodash.toPairs = toPairs;
  17059. lodash.toPairsIn = toPairsIn;
  17060. lodash.toPath = toPath;
  17061. lodash.toPlainObject = toPlainObject;
  17062. lodash.transform = transform;
  17063. lodash.unary = unary;
  17064. lodash.union = union;
  17065. lodash.unionBy = unionBy;
  17066. lodash.unionWith = unionWith;
  17067. lodash.uniq = uniq;
  17068. lodash.uniqBy = uniqBy;
  17069. lodash.uniqWith = uniqWith;
  17070. lodash.unset = unset;
  17071. lodash.unzip = unzip;
  17072. lodash.unzipWith = unzipWith;
  17073. lodash.update = update;
  17074. lodash.updateWith = updateWith;
  17075. lodash.values = values;
  17076. lodash.valuesIn = valuesIn;
  17077. lodash.without = without;
  17078. lodash.words = words;
  17079. lodash.wrap = wrap;
  17080. lodash.xor = xor;
  17081. lodash.xorBy = xorBy;
  17082. lodash.xorWith = xorWith;
  17083. lodash.zip = zip;
  17084. lodash.zipObject = zipObject;
  17085. lodash.zipObjectDeep = zipObjectDeep;
  17086. lodash.zipWith = zipWith;
  17087. // Add aliases.
  17088. lodash.entries = toPairs;
  17089. lodash.entriesIn = toPairsIn;
  17090. lodash.extend = assignIn;
  17091. lodash.extendWith = assignInWith;
  17092. // Add methods to `lodash.prototype`.
  17093. mixin(lodash, lodash);
  17094. /*------------------------------------------------------------------------*/
  17095. // Add methods that return unwrapped values in chain sequences.
  17096. lodash.add = add;
  17097. lodash.attempt = attempt;
  17098. lodash.camelCase = camelCase;
  17099. lodash.capitalize = capitalize;
  17100. lodash.ceil = ceil;
  17101. lodash.clamp = clamp;
  17102. lodash.clone = clone;
  17103. lodash.cloneDeep = cloneDeep;
  17104. lodash.cloneDeepWith = cloneDeepWith;
  17105. lodash.cloneWith = cloneWith;
  17106. lodash.conformsTo = conformsTo;
  17107. lodash.deburr = deburr;
  17108. lodash.defaultTo = defaultTo;
  17109. lodash.divide = divide;
  17110. lodash.endsWith = endsWith;
  17111. lodash.eq = eq;
  17112. lodash.escape = escape;
  17113. lodash.escapeRegExp = escapeRegExp;
  17114. lodash.every = every;
  17115. lodash.find = find;
  17116. lodash.findIndex = findIndex;
  17117. lodash.findKey = findKey;
  17118. lodash.findLast = findLast;
  17119. lodash.findLastIndex = findLastIndex;
  17120. lodash.findLastKey = findLastKey;
  17121. lodash.floor = floor;
  17122. lodash.forEach = forEach;
  17123. lodash.forEachRight = forEachRight;
  17124. lodash.forIn = forIn;
  17125. lodash.forInRight = forInRight;
  17126. lodash.forOwn = forOwn;
  17127. lodash.forOwnRight = forOwnRight;
  17128. lodash.get = get;
  17129. lodash.gt = gt;
  17130. lodash.gte = gte;
  17131. lodash.has = has;
  17132. lodash.hasIn = hasIn;
  17133. lodash.head = head;
  17134. lodash.identity = identity;
  17135. lodash.includes = includes;
  17136. lodash.indexOf = indexOf;
  17137. lodash.inRange = inRange;
  17138. lodash.invoke = invoke;
  17139. lodash.isArguments = isArguments;
  17140. lodash.isArray = isArray;
  17141. lodash.isArrayBuffer = isArrayBuffer;
  17142. lodash.isArrayLike = isArrayLike;
  17143. lodash.isArrayLikeObject = isArrayLikeObject;
  17144. lodash.isBoolean = isBoolean;
  17145. lodash.isBuffer = isBuffer;
  17146. lodash.isDate = isDate;
  17147. lodash.isElement = isElement;
  17148. lodash.isEmpty = isEmpty;
  17149. lodash.isEqual = isEqual;
  17150. lodash.isEqualWith = isEqualWith;
  17151. lodash.isError = isError;
  17152. lodash.isFinite = isFinite;
  17153. lodash.isFunction = isFunction;
  17154. lodash.isInteger = isInteger;
  17155. lodash.isLength = isLength;
  17156. lodash.isMap = isMap;
  17157. lodash.isMatch = isMatch;
  17158. lodash.isMatchWith = isMatchWith;
  17159. lodash.isNaN = isNaN;
  17160. lodash.isNative = isNative;
  17161. lodash.isNil = isNil;
  17162. lodash.isNull = isNull;
  17163. lodash.isNumber = isNumber;
  17164. lodash.isObject = isObject;
  17165. lodash.isObjectLike = isObjectLike;
  17166. lodash.isPlainObject = isPlainObject;
  17167. lodash.isRegExp = isRegExp;
  17168. lodash.isSafeInteger = isSafeInteger;
  17169. lodash.isSet = isSet;
  17170. lodash.isString = isString;
  17171. lodash.isSymbol = isSymbol;
  17172. lodash.isTypedArray = isTypedArray;
  17173. lodash.isUndefined = isUndefined;
  17174. lodash.isWeakMap = isWeakMap;
  17175. lodash.isWeakSet = isWeakSet;
  17176. lodash.join = join;
  17177. lodash.kebabCase = kebabCase;
  17178. lodash.last = last;
  17179. lodash.lastIndexOf = lastIndexOf;
  17180. lodash.lowerCase = lowerCase;
  17181. lodash.lowerFirst = lowerFirst;
  17182. lodash.lt = lt;
  17183. lodash.lte = lte;
  17184. lodash.max = max;
  17185. lodash.maxBy = maxBy;
  17186. lodash.mean = mean;
  17187. lodash.meanBy = meanBy;
  17188. lodash.min = min;
  17189. lodash.minBy = minBy;
  17190. lodash.stubArray = stubArray;
  17191. lodash.stubFalse = stubFalse;
  17192. lodash.stubObject = stubObject;
  17193. lodash.stubString = stubString;
  17194. lodash.stubTrue = stubTrue;
  17195. lodash.multiply = multiply;
  17196. lodash.nth = nth;
  17197. lodash.noConflict = noConflict;
  17198. lodash.noop = noop;
  17199. lodash.now = now;
  17200. lodash.pad = pad;
  17201. lodash.padEnd = padEnd;
  17202. lodash.padStart = padStart;
  17203. lodash.parseInt = parseInt;
  17204. lodash.random = random;
  17205. lodash.reduce = reduce;
  17206. lodash.reduceRight = reduceRight;
  17207. lodash.repeat = repeat;
  17208. lodash.replace = replace;
  17209. lodash.result = result;
  17210. lodash.round = round;
  17211. lodash.runInContext = runInContext;
  17212. lodash.sample = sample;
  17213. lodash.size = size;
  17214. lodash.snakeCase = snakeCase;
  17215. lodash.some = some;
  17216. lodash.sortedIndex = sortedIndex;
  17217. lodash.sortedIndexBy = sortedIndexBy;
  17218. lodash.sortedIndexOf = sortedIndexOf;
  17219. lodash.sortedLastIndex = sortedLastIndex;
  17220. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17221. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17222. lodash.startCase = startCase;
  17223. lodash.startsWith = startsWith;
  17224. lodash.subtract = subtract;
  17225. lodash.sum = sum;
  17226. lodash.sumBy = sumBy;
  17227. lodash.template = template;
  17228. lodash.times = times;
  17229. lodash.toFinite = toFinite;
  17230. lodash.toInteger = toInteger;
  17231. lodash.toLength = toLength;
  17232. lodash.toLower = toLower;
  17233. lodash.toNumber = toNumber;
  17234. lodash.toSafeInteger = toSafeInteger;
  17235. lodash.toString = toString;
  17236. lodash.toUpper = toUpper;
  17237. lodash.trim = trim;
  17238. lodash.trimEnd = trimEnd;
  17239. lodash.trimStart = trimStart;
  17240. lodash.truncate = truncate;
  17241. lodash.unescape = unescape;
  17242. lodash.uniqueId = uniqueId;
  17243. lodash.upperCase = upperCase;
  17244. lodash.upperFirst = upperFirst;
  17245. // Add aliases.
  17246. lodash.each = forEach;
  17247. lodash.eachRight = forEachRight;
  17248. lodash.first = head;
  17249. mixin(lodash, (function() {
  17250. var source = {};
  17251. baseForOwn(lodash, function(func, methodName) {
  17252. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17253. source[methodName] = func;
  17254. }
  17255. });
  17256. return source;
  17257. }()), { 'chain': false });
  17258. /*------------------------------------------------------------------------*/
  17259. /**
  17260. * The semantic version number.
  17261. *
  17262. * @static
  17263. * @memberOf _
  17264. * @type {string}
  17265. */
  17266. lodash.VERSION = VERSION;
  17267. // Assign default placeholders.
  17268. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17269. lodash[methodName].placeholder = lodash;
  17270. });
  17271. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17272. arrayEach(['drop', 'take'], function(methodName, index) {
  17273. LazyWrapper.prototype[methodName] = function(n) {
  17274. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17275. var result = (this.__filtered__ && !index)
  17276. ? new LazyWrapper(this)
  17277. : this.clone();
  17278. if (result.__filtered__) {
  17279. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17280. } else {
  17281. result.__views__.push({
  17282. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17283. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17284. });
  17285. }
  17286. return result;
  17287. };
  17288. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17289. return this.reverse()[methodName](n).reverse();
  17290. };
  17291. });
  17292. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17293. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17294. var type = index + 1,
  17295. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17296. LazyWrapper.prototype[methodName] = function(iteratee) {
  17297. var result = this.clone();
  17298. result.__iteratees__.push({
  17299. 'iteratee': getIteratee(iteratee, 3),
  17300. 'type': type
  17301. });
  17302. result.__filtered__ = result.__filtered__ || isFilter;
  17303. return result;
  17304. };
  17305. });
  17306. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17307. arrayEach(['head', 'last'], function(methodName, index) {
  17308. var takeName = 'take' + (index ? 'Right' : '');
  17309. LazyWrapper.prototype[methodName] = function() {
  17310. return this[takeName](1).value()[0];
  17311. };
  17312. });
  17313. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17314. arrayEach(['initial', 'tail'], function(methodName, index) {
  17315. var dropName = 'drop' + (index ? '' : 'Right');
  17316. LazyWrapper.prototype[methodName] = function() {
  17317. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17318. };
  17319. });
  17320. LazyWrapper.prototype.compact = function() {
  17321. return this.filter(identity);
  17322. };
  17323. LazyWrapper.prototype.find = function(predicate) {
  17324. return this.filter(predicate).head();
  17325. };
  17326. LazyWrapper.prototype.findLast = function(predicate) {
  17327. return this.reverse().find(predicate);
  17328. };
  17329. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17330. if (typeof path == 'function') {
  17331. return new LazyWrapper(this);
  17332. }
  17333. return this.map(function(value) {
  17334. return baseInvoke(value, path, args);
  17335. });
  17336. });
  17337. LazyWrapper.prototype.reject = function(predicate) {
  17338. return this.filter(negate(getIteratee(predicate)));
  17339. };
  17340. LazyWrapper.prototype.slice = function(start, end) {
  17341. start = toInteger(start);
  17342. var result = this;
  17343. if (result.__filtered__ && (start > 0 || end < 0)) {
  17344. return new LazyWrapper(result);
  17345. }
  17346. if (start < 0) {
  17347. result = result.takeRight(-start);
  17348. } else if (start) {
  17349. result = result.drop(start);
  17350. }
  17351. if (end !== undefined) {
  17352. end = toInteger(end);
  17353. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17354. }
  17355. return result;
  17356. };
  17357. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17358. return this.reverse().takeWhile(predicate).reverse();
  17359. };
  17360. LazyWrapper.prototype.toArray = function() {
  17361. return this.take(MAX_ARRAY_LENGTH);
  17362. };
  17363. // Add `LazyWrapper` methods to `lodash.prototype`.
  17364. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17365. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17366. isTaker = /^(?:head|last)$/.test(methodName),
  17367. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17368. retUnwrapped = isTaker || /^find/.test(methodName);
  17369. if (!lodashFunc) {
  17370. return;
  17371. }
  17372. lodash.prototype[methodName] = function() {
  17373. var value = this.__wrapped__,
  17374. args = isTaker ? [1] : arguments,
  17375. isLazy = value instanceof LazyWrapper,
  17376. iteratee = args[0],
  17377. useLazy = isLazy || isArray(value);
  17378. var interceptor = function(value) {
  17379. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17380. return (isTaker && chainAll) ? result[0] : result;
  17381. };
  17382. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17383. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17384. isLazy = useLazy = false;
  17385. }
  17386. var chainAll = this.__chain__,
  17387. isHybrid = !!this.__actions__.length,
  17388. isUnwrapped = retUnwrapped && !chainAll,
  17389. onlyLazy = isLazy && !isHybrid;
  17390. if (!retUnwrapped && useLazy) {
  17391. value = onlyLazy ? value : new LazyWrapper(this);
  17392. var result = func.apply(value, args);
  17393. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17394. return new LodashWrapper(result, chainAll);
  17395. }
  17396. if (isUnwrapped && onlyLazy) {
  17397. return func.apply(this, args);
  17398. }
  17399. result = this.thru(interceptor);
  17400. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17401. };
  17402. });
  17403. // Add `Array` methods to `lodash.prototype`.
  17404. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17405. var func = arrayProto[methodName],
  17406. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17407. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17408. lodash.prototype[methodName] = function() {
  17409. var args = arguments;
  17410. if (retUnwrapped && !this.__chain__) {
  17411. var value = this.value();
  17412. return func.apply(isArray(value) ? value : [], args);
  17413. }
  17414. return this[chainName](function(value) {
  17415. return func.apply(isArray(value) ? value : [], args);
  17416. });
  17417. };
  17418. });
  17419. // Map minified method names to their real names.
  17420. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17421. var lodashFunc = lodash[methodName];
  17422. if (lodashFunc) {
  17423. var key = lodashFunc.name + '';
  17424. if (!hasOwnProperty.call(realNames, key)) {
  17425. realNames[key] = [];
  17426. }
  17427. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17428. }
  17429. });
  17430. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17431. 'name': 'wrapper',
  17432. 'func': undefined
  17433. }];
  17434. // Add methods to `LazyWrapper`.
  17435. LazyWrapper.prototype.clone = lazyClone;
  17436. LazyWrapper.prototype.reverse = lazyReverse;
  17437. LazyWrapper.prototype.value = lazyValue;
  17438. // Add chain sequence methods to the `lodash` wrapper.
  17439. lodash.prototype.at = wrapperAt;
  17440. lodash.prototype.chain = wrapperChain;
  17441. lodash.prototype.commit = wrapperCommit;
  17442. lodash.prototype.next = wrapperNext;
  17443. lodash.prototype.plant = wrapperPlant;
  17444. lodash.prototype.reverse = wrapperReverse;
  17445. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17446. // Add lazy aliases.
  17447. lodash.prototype.first = lodash.prototype.head;
  17448. if (symIterator) {
  17449. lodash.prototype[symIterator] = wrapperToIterator;
  17450. }
  17451. return lodash;
  17452. });
  17453. /*--------------------------------------------------------------------------*/
  17454. // Export lodash.
  17455. var _ = runInContext();
  17456. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17457. if (true) {
  17458. // Expose Lodash on the global object to prevent errors when Lodash is
  17459. // loaded by a script tag in the presence of an AMD loader.
  17460. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17461. // Use `_.noConflict` to remove Lodash from the global object.
  17462. root._ = _;
  17463. // Define as an anonymous module so, through path mapping, it can be
  17464. // referenced as the "underscore" module.
  17465. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17466. return _;
  17467. }).call(exports, __webpack_require__, exports, module),
  17468. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17469. }
  17470. // Check for `exports` after `define` in case a build optimizer adds it.
  17471. else {}
  17472. }.call(this));
  17473. /***/ }),
  17474. /***/ "./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":
  17475. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17476. !*** ./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 ***!
  17477. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17478. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17479. "use strict";
  17480. __webpack_require__.r(__webpack_exports__);
  17481. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17482. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17483. /* harmony export */ });
  17484. /* 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");
  17485. /* 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__);
  17486. /* 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");
  17487. var options = {};
  17488. options.insert = "head";
  17489. options.singleton = false;
  17490. 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);
  17491. /* 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 || {});
  17492. /***/ }),
  17493. /***/ "./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":
  17494. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17495. !*** ./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 ***!
  17496. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17497. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17498. "use strict";
  17499. __webpack_require__.r(__webpack_exports__);
  17500. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17501. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17502. /* harmony export */ });
  17503. /* 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");
  17504. /* 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__);
  17505. /* 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");
  17506. var options = {};
  17507. options.insert = "head";
  17508. options.singleton = false;
  17509. 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);
  17510. /* 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 || {});
  17511. /***/ }),
  17512. /***/ "./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":
  17513. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17514. !*** ./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 ***!
  17515. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17516. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17517. "use strict";
  17518. __webpack_require__.r(__webpack_exports__);
  17519. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17520. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17521. /* harmony export */ });
  17522. /* 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");
  17523. /* 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__);
  17524. /* 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");
  17525. var options = {};
  17526. options.insert = "head";
  17527. options.singleton = false;
  17528. 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);
  17529. /* 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 || {});
  17530. /***/ }),
  17531. /***/ "./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":
  17532. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17533. !*** ./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 ***!
  17534. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17535. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17536. "use strict";
  17537. __webpack_require__.r(__webpack_exports__);
  17538. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17539. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17540. /* harmony export */ });
  17541. /* 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");
  17542. /* 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__);
  17543. /* 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");
  17544. var options = {};
  17545. options.insert = "head";
  17546. options.singleton = false;
  17547. 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);
  17548. /* 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 || {});
  17549. /***/ }),
  17550. /***/ "./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":
  17551. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17552. !*** ./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 ***!
  17553. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17554. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17555. "use strict";
  17556. __webpack_require__.r(__webpack_exports__);
  17557. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17558. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17559. /* harmony export */ });
  17560. /* 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");
  17561. /* 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__);
  17562. /* 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");
  17563. var options = {};
  17564. options.insert = "head";
  17565. options.singleton = false;
  17566. 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);
  17567. /* 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 || {});
  17568. /***/ }),
  17569. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17570. /*!******************************************************!*\
  17571. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17572. \******************************************************/
  17573. /***/ ((__unused_webpack_module, exports) => {
  17574. "use strict";
  17575. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17576. // runtime helper for setting properties on components
  17577. // in a tree-shakable way
  17578. exports["default"] = (sfc, props) => {
  17579. const target = sfc.__vccOpts || sfc;
  17580. for (const [key, val] of props) {
  17581. target[key] = val;
  17582. }
  17583. return target;
  17584. };
  17585. /***/ }),
  17586. /***/ "./resources/js/components/AppButtonLink.vue":
  17587. /*!***************************************************!*\
  17588. !*** ./resources/js/components/AppButtonLink.vue ***!
  17589. \***************************************************/
  17590. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17591. "use strict";
  17592. __webpack_require__.r(__webpack_exports__);
  17593. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17594. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17595. /* harmony export */ });
  17596. /* 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");
  17597. /* 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");
  17598. /* 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");
  17599. ;
  17600. 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"]])
  17601. /* hot reload */
  17602. if (false) {}
  17603. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17604. /***/ }),
  17605. /***/ "./resources/js/components/AppFooter.vue":
  17606. /*!***********************************************!*\
  17607. !*** ./resources/js/components/AppFooter.vue ***!
  17608. \***********************************************/
  17609. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17610. "use strict";
  17611. __webpack_require__.r(__webpack_exports__);
  17612. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17613. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17614. /* harmony export */ });
  17615. /* 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");
  17616. /* 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");
  17617. /* 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");
  17618. const script = {}
  17619. ;
  17620. 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"]])
  17621. /* hot reload */
  17622. if (false) {}
  17623. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17624. /***/ }),
  17625. /***/ "./resources/js/components/AppMessage.vue":
  17626. /*!************************************************!*\
  17627. !*** ./resources/js/components/AppMessage.vue ***!
  17628. \************************************************/
  17629. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17630. "use strict";
  17631. __webpack_require__.r(__webpack_exports__);
  17632. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17633. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17634. /* harmony export */ });
  17635. /* 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");
  17636. /* 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");
  17637. /* 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");
  17638. ;
  17639. 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"]])
  17640. /* hot reload */
  17641. if (false) {}
  17642. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17643. /***/ }),
  17644. /***/ "./resources/js/components/AppPagination.vue":
  17645. /*!***************************************************!*\
  17646. !*** ./resources/js/components/AppPagination.vue ***!
  17647. \***************************************************/
  17648. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17649. "use strict";
  17650. __webpack_require__.r(__webpack_exports__);
  17651. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17652. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17653. /* harmony export */ });
  17654. /* 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");
  17655. /* 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");
  17656. /* 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");
  17657. ;
  17658. 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"]])
  17659. /* hot reload */
  17660. if (false) {}
  17661. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17662. /***/ }),
  17663. /***/ "./resources/js/components/AppSidebar.vue":
  17664. /*!************************************************!*\
  17665. !*** ./resources/js/components/AppSidebar.vue ***!
  17666. \************************************************/
  17667. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17668. "use strict";
  17669. __webpack_require__.r(__webpack_exports__);
  17670. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17671. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17672. /* harmony export */ });
  17673. /* 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");
  17674. /* 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");
  17675. /* 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");
  17676. /* 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");
  17677. ;
  17678. 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"]])
  17679. /* hot reload */
  17680. if (false) {}
  17681. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17682. /***/ }),
  17683. /***/ "./resources/js/components/AppSubSidebar.vue":
  17684. /*!***************************************************!*\
  17685. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17686. \***************************************************/
  17687. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17688. "use strict";
  17689. __webpack_require__.r(__webpack_exports__);
  17690. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17691. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17692. /* harmony export */ });
  17693. /* 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");
  17694. /* 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");
  17695. /* 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");
  17696. /* 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");
  17697. ;
  17698. 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"]])
  17699. /* hot reload */
  17700. if (false) {}
  17701. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17702. /***/ }),
  17703. /***/ "./resources/js/components/AppTopBar.vue":
  17704. /*!***********************************************!*\
  17705. !*** ./resources/js/components/AppTopBar.vue ***!
  17706. \***********************************************/
  17707. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17708. "use strict";
  17709. __webpack_require__.r(__webpack_exports__);
  17710. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17711. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17712. /* harmony export */ });
  17713. /* 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");
  17714. /* 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");
  17715. /* 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");
  17716. /* 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");
  17717. ;
  17718. 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"]])
  17719. /* hot reload */
  17720. if (false) {}
  17721. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17722. /***/ }),
  17723. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17724. /*!**************************************************!*\
  17725. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17726. \**************************************************/
  17727. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17728. "use strict";
  17729. __webpack_require__.r(__webpack_exports__);
  17730. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17731. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17732. /* harmony export */ });
  17733. /* 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");
  17734. /* 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");
  17735. /* 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");
  17736. /* 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");
  17737. ;
  17738. 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"]])
  17739. /* hot reload */
  17740. if (false) {}
  17741. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17742. /***/ }),
  17743. /***/ "./resources/js/pages/mutation/Report.vue":
  17744. /*!************************************************!*\
  17745. !*** ./resources/js/pages/mutation/Report.vue ***!
  17746. \************************************************/
  17747. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17748. "use strict";
  17749. __webpack_require__.r(__webpack_exports__);
  17750. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17751. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17752. /* harmony export */ });
  17753. /* 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");
  17754. /* 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");
  17755. /* 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");
  17756. ;
  17757. 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"]])
  17758. /* hot reload */
  17759. if (false) {}
  17760. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17761. /***/ }),
  17762. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17763. /*!**************************************************************************************!*\
  17764. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17765. \**************************************************************************************/
  17766. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17767. "use strict";
  17768. __webpack_require__.r(__webpack_exports__);
  17769. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17770. /* 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"])
  17771. /* harmony export */ });
  17772. /* 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");
  17773. /***/ }),
  17774. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17775. /*!***********************************************************************************!*\
  17776. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17777. \***********************************************************************************/
  17778. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17779. "use strict";
  17780. __webpack_require__.r(__webpack_exports__);
  17781. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17782. /* 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"])
  17783. /* harmony export */ });
  17784. /* 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");
  17785. /***/ }),
  17786. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17787. /*!**************************************************************************************!*\
  17788. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17789. \**************************************************************************************/
  17790. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17791. "use strict";
  17792. __webpack_require__.r(__webpack_exports__);
  17793. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17794. /* 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"])
  17795. /* harmony export */ });
  17796. /* 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");
  17797. /***/ }),
  17798. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17799. /*!***********************************************************************************!*\
  17800. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17801. \***********************************************************************************/
  17802. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17803. "use strict";
  17804. __webpack_require__.r(__webpack_exports__);
  17805. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17806. /* 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"])
  17807. /* harmony export */ });
  17808. /* 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");
  17809. /***/ }),
  17810. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17811. /*!**************************************************************************************!*\
  17812. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17813. \**************************************************************************************/
  17814. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17815. "use strict";
  17816. __webpack_require__.r(__webpack_exports__);
  17817. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17818. /* 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"])
  17819. /* harmony export */ });
  17820. /* 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");
  17821. /***/ }),
  17822. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17823. /*!**********************************************************************************!*\
  17824. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17825. \**********************************************************************************/
  17826. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17827. "use strict";
  17828. __webpack_require__.r(__webpack_exports__);
  17829. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17830. /* 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"])
  17831. /* harmony export */ });
  17832. /* 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");
  17833. /***/ }),
  17834. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17835. /*!*************************************************************************************!*\
  17836. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17837. \*************************************************************************************/
  17838. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17839. "use strict";
  17840. __webpack_require__.r(__webpack_exports__);
  17841. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17842. /* 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"])
  17843. /* harmony export */ });
  17844. /* 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");
  17845. /***/ }),
  17846. /***/ "./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js":
  17847. /*!***********************************************************************************!*\
  17848. !*** ./resources/js/pages/mutation/Report.vue?vue&type=script&setup=true&lang=js ***!
  17849. \***********************************************************************************/
  17850. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17851. "use strict";
  17852. __webpack_require__.r(__webpack_exports__);
  17853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17854. /* 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"])
  17855. /* harmony export */ });
  17856. /* 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");
  17857. /***/ }),
  17858. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17859. /*!*********************************************************************************!*\
  17860. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17861. \*********************************************************************************/
  17862. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17863. "use strict";
  17864. __webpack_require__.r(__webpack_exports__);
  17865. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17866. /* 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)
  17867. /* harmony export */ });
  17868. /* 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");
  17869. /***/ }),
  17870. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17871. /*!*****************************************************************************************!*\
  17872. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17873. \*****************************************************************************************/
  17874. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17875. "use strict";
  17876. __webpack_require__.r(__webpack_exports__);
  17877. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17878. /* 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)
  17879. /* harmony export */ });
  17880. /* 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");
  17881. /***/ }),
  17882. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17883. /*!******************************************************************************!*\
  17884. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17885. \******************************************************************************/
  17886. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17887. "use strict";
  17888. __webpack_require__.r(__webpack_exports__);
  17889. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17890. /* 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)
  17891. /* harmony export */ });
  17892. /* 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");
  17893. /***/ }),
  17894. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17895. /*!*********************************************************************************!*\
  17896. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17897. \*********************************************************************************/
  17898. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17899. "use strict";
  17900. __webpack_require__.r(__webpack_exports__);
  17901. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17902. /* 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)
  17903. /* harmony export */ });
  17904. /* 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");
  17905. /***/ }),
  17906. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17907. /*!******************************************************************************************!*\
  17908. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17909. \******************************************************************************************/
  17910. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17911. "use strict";
  17912. __webpack_require__.r(__webpack_exports__);
  17913. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17914. /* 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)
  17915. /* harmony export */ });
  17916. /* 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");
  17917. /***/ }),
  17918. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17919. /*!*********************************************************************************************!*\
  17920. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17921. \*********************************************************************************************/
  17922. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17923. "use strict";
  17924. __webpack_require__.r(__webpack_exports__);
  17925. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17926. /* 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)
  17927. /* harmony export */ });
  17928. /* 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");
  17929. /***/ }),
  17930. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17931. /*!*****************************************************************************************!*\
  17932. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17933. \*****************************************************************************************/
  17934. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17935. "use strict";
  17936. __webpack_require__.r(__webpack_exports__);
  17937. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17938. /* 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)
  17939. /* harmony export */ });
  17940. /* 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");
  17941. /***/ }),
  17942. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17943. /*!********************************************************************************************!*\
  17944. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17945. \********************************************************************************************/
  17946. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17947. "use strict";
  17948. __webpack_require__.r(__webpack_exports__);
  17949. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17950. /* 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)
  17951. /* harmony export */ });
  17952. /* 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");
  17953. /***/ }),
  17954. /***/ "./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421":
  17955. /*!******************************************************************************!*\
  17956. !*** ./resources/js/pages/mutation/Report.vue?vue&type=template&id=289c9421 ***!
  17957. \******************************************************************************/
  17958. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17959. "use strict";
  17960. __webpack_require__.r(__webpack_exports__);
  17961. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17962. /* 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)
  17963. /* harmony export */ });
  17964. /* 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");
  17965. /***/ }),
  17966. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17967. /*!********************************************************************************************************!*\
  17968. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17969. \********************************************************************************************************/
  17970. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17971. "use strict";
  17972. __webpack_require__.r(__webpack_exports__);
  17973. /* 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");
  17974. /***/ }),
  17975. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17976. /*!*********************************************************************************************************!*\
  17977. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17978. \*********************************************************************************************************/
  17979. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17980. "use strict";
  17981. __webpack_require__.r(__webpack_exports__);
  17982. /* 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");
  17983. /***/ }),
  17984. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17985. /*!************************************************************************************************************!*\
  17986. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17987. \************************************************************************************************************/
  17988. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17989. "use strict";
  17990. __webpack_require__.r(__webpack_exports__);
  17991. /* 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");
  17992. /***/ }),
  17993. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17994. /*!********************************************************************************************************!*\
  17995. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17996. \********************************************************************************************************/
  17997. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17998. "use strict";
  17999. __webpack_require__.r(__webpack_exports__);
  18000. /* 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");
  18001. /***/ }),
  18002. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  18003. /*!***********************************************************************************************************!*\
  18004. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  18005. \***********************************************************************************************************/
  18006. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  18007. "use strict";
  18008. __webpack_require__.r(__webpack_exports__);
  18009. /* 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");
  18010. /***/ })
  18011. }]);