resources_js_pages_Suppliers_Index_vue.js 697KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Suppliers_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***************************************************************************************************************************************************************************************************************!*\
  326. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***************************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  335. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  336. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Suppliers/config.js");
  337. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  338. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  339. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  340. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  341. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  342. __name: 'Index',
  343. props: {
  344. suppliers: Object,
  345. initialSearch: String
  346. },
  347. setup: function setup(__props, _ref) {
  348. var expose = _ref.expose;
  349. expose();
  350. var deleteConfirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm)();
  351. var onDelete = function onDelete(data) {
  352. deleteConfirm.require({
  353. message: "Yakin akan menghapus data (".concat(data.name, ") ?"),
  354. header: 'Hapus Supplier',
  355. acceptLabel: 'Iya',
  356. rejectLabel: 'Tidak',
  357. accept: function accept() {
  358. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia["delete"](route('suppliers.destroy', data.id));
  359. },
  360. reject: function reject() {
  361. deleteConfirm.close();
  362. }
  363. });
  364. };
  365. var __returned__ = {
  366. deleteConfirm: deleteConfirm,
  367. onDelete: onDelete,
  368. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  369. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm,
  370. indexTable: _config__WEBPACK_IMPORTED_MODULE_2__.indexTable,
  371. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  372. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  373. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  374. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  375. };
  376. Object.defineProperty(__returned__, '__isScriptSetup', {
  377. enumerable: false,
  378. value: true
  379. });
  380. return __returned__;
  381. }
  382. });
  383. /***/ }),
  384. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  385. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  386. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  387. \***********************************************************************************************************************************************************************************************************************************************************************************/
  388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  389. "use strict";
  390. __webpack_require__.r(__webpack_exports__);
  391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  392. /* harmony export */ "render": () => (/* binding */ render)
  393. /* harmony export */ });
  394. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  395. var _hoisted_1 = {
  396. key: 1,
  397. "class": "p-button-label"
  398. };
  399. var _hoisted_2 = {
  400. key: 1,
  401. "class": "p-button p-component"
  402. };
  403. var _hoisted_3 = {
  404. key: 1,
  405. "class": "p-button-label"
  406. };
  407. function render(_ctx, _cache, $props, $setup, $data, $options) {
  408. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  409. key: 0,
  410. "class": "p-button p-component",
  411. as: "button",
  412. type: "button"
  413. }, {
  414. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  415. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  416. key: 0,
  417. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  418. }, null, 2
  419. /* CLASS */
  420. )) : (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
  421. /* TEXT */
  422. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  423. }),
  424. _: 1
  425. /* STABLE */
  426. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  427. key: 0,
  428. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  429. }, null, 2
  430. /* CLASS */
  431. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  432. /* TEXT */
  433. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  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/AppSearch.vue?vue&type=template&id=5b9fdcce":
  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/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  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. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  555. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  556. modelValue: $setup.search,
  557. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  558. return $setup.search = $event;
  559. })
  560. }, null, 8
  561. /* PROPS */
  562. , ["modelValue"]);
  563. }
  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/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  566. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  567. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  568. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  570. "use strict";
  571. __webpack_require__.r(__webpack_exports__);
  572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  573. /* harmony export */ "render": () => (/* binding */ render)
  574. /* harmony export */ });
  575. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  576. var _hoisted_1 = {
  577. "class": "layout-footer"
  578. };
  579. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  580. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  581. href: "https://dijitalcode.com",
  582. target: "_blank",
  583. "class": "font-medium ml-2"
  584. }, " DijitalCODE ", -1
  585. /* HOISTED */
  586. );
  587. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  588. function render(_ctx, _cache) {
  589. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  593. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  595. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. function render(_ctx, _cache, $props, $setup, $data, $options) {
  604. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["SubSidebar"], {
  605. "class": "layout-menu",
  606. items: $props.menu,
  607. root: true
  608. }, null, 8
  609. /* PROPS */
  610. , ["items"])]);
  611. }
  612. /***/ }),
  613. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  614. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  615. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  616. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  618. "use strict";
  619. __webpack_require__.r(__webpack_exports__);
  620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  621. /* harmony export */ "render": () => (/* binding */ render)
  622. /* harmony export */ });
  623. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  624. var _withScopeId = function _withScopeId(n) {
  625. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  626. };
  627. var _hoisted_1 = {
  628. key: 0
  629. };
  630. var _hoisted_2 = ["aria-label"];
  631. var _hoisted_3 = ["aria-label"];
  632. function render(_ctx, _cache, $props, $setup, $data, $options) {
  633. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  634. 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) {
  635. 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", {
  636. key: i,
  637. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  638. 'layout-menuitem-category': $props.root
  639. }]),
  640. role: "none"
  641. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  642. key: 0
  643. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  644. "class": "layout-menuitem-root-text",
  645. "aria-label": item.label
  646. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  647. /* TEXT, PROPS */
  648. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  649. items: item.items
  650. }, null, 8
  651. /* PROPS */
  652. , ["items"])], 64
  653. /* STABLE_FRAGMENT */
  654. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  655. key: 1
  656. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  657. key: 0,
  658. role: "menuitem",
  659. href: item.to,
  660. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  661. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  662. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  663. }]),
  664. "aria-label": item.label
  665. }, {
  666. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  667. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  669. }, null, 2
  670. /* CLASS */
  671. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  672. /* TEXT */
  673. )];
  674. }),
  675. _: 2
  676. /* DYNAMIC */
  677. }, 1032
  678. /* PROPS, DYNAMIC_SLOTS */
  679. , ["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", {
  680. key: 1,
  681. href: "#",
  682. role: "menuitem",
  683. "aria-label": item.label
  684. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  686. }, null, 2
  687. /* CLASS */
  688. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  689. /* TEXT */
  690. )], 8
  691. /* PROPS */
  692. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  693. items: item.items
  694. }, null, 8
  695. /* PROPS */
  696. , ["items"])], 64
  697. /* STABLE_FRAGMENT */
  698. ))], 2
  699. /* CLASS */
  700. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  701. /* STABLE_FRAGMENT */
  702. );
  703. }), 256
  704. /* UNKEYED_FRAGMENT */
  705. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  706. }
  707. /***/ }),
  708. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  709. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  710. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  711. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  713. "use strict";
  714. __webpack_require__.r(__webpack_exports__);
  715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  716. /* harmony export */ "render": () => (/* binding */ render)
  717. /* harmony export */ });
  718. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  719. var _withScopeId = function _withScopeId(n) {
  720. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  721. };
  722. var _hoisted_1 = {
  723. "class": "layout-topbar"
  724. };
  725. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  726. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  727. alt: "Brand Logo",
  728. src: "/images/logo.svg",
  729. "class": "md:mr-3"
  730. }, null, -1
  731. /* HOISTED */
  732. );
  733. });
  734. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  735. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  736. /* HOISTED */
  737. );
  738. });
  739. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  740. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  741. "class": "pi pi-bars"
  742. }, null, -1
  743. /* HOISTED */
  744. );
  745. });
  746. var _hoisted_5 = [_hoisted_4];
  747. var _hoisted_6 = {
  748. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  749. };
  750. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  751. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  752. "class": "pi pi-ellipsis-v"
  753. }, null, -1
  754. /* HOISTED */
  755. );
  756. });
  757. var _hoisted_8 = [_hoisted_7];
  758. var _hoisted_9 = {
  759. "class": "layout-topbar-menu hidden lg:flex origin-top"
  760. };
  761. var _hoisted_10 = {
  762. "class": "align-self-center"
  763. };
  764. var _hoisted_11 = {
  765. "class": "hidden lg:inline"
  766. };
  767. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  768. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  769. "class": "pi pi-user"
  770. }, null, -1
  771. /* HOISTED */
  772. );
  773. });
  774. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  775. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  780. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  781. "class": "pi pi-sign-out"
  782. }, null, -1
  783. /* HOISTED */
  784. );
  785. });
  786. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  787. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  788. /* HOISTED */
  789. );
  790. });
  791. function render(_ctx, _cache, $props, $setup, $data, $options) {
  792. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  793. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  794. 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"], {
  795. href: "/",
  796. "class": "layout-topbar-logo"
  797. }, {
  798. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  799. return [_hoisted_2, _hoisted_3];
  800. }),
  801. _: 1
  802. /* STABLE */
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  804. "class": "p-link layout-menu-button layout-topbar-button",
  805. onClick: _cache[0] || (_cache[0] = function ($event) {
  806. return _ctx.$emit('menu-toggle', $event);
  807. })
  808. }, _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, {
  809. selector: '@next',
  810. enterClass: 'hidden',
  811. enterActiveClass: 'scalein',
  812. leaveToClass: 'hidden',
  813. leaveActiveClass: 'fadeout',
  814. hideOnOutsideClick: true
  815. }]]), (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
  816. /* TEXT */
  817. )]), (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"], {
  818. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  819. "class": "p-link layout-topbar-button"
  820. }, {
  821. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [_hoisted_12, _hoisted_13];
  823. }),
  824. _: 1
  825. /* STABLE */
  826. }, 8
  827. /* PROPS */
  828. , ["href"])), [[_directive_tooltip, {
  829. value: 'Ubah Profil',
  830. "class": 'layout-topbar-menu-tooltip'
  831. }, void 0, {
  832. bottom: true
  833. }]])]), (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"], {
  834. href: _ctx.route('logout'),
  835. as: "button",
  836. method: "post",
  837. "class": "p-link layout-topbar-button"
  838. }, {
  839. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  840. return [_hoisted_14, _hoisted_15];
  841. }),
  842. _: 1
  843. /* STABLE */
  844. }, 8
  845. /* PROPS */
  846. , ["href"])), [[_directive_tooltip, {
  847. value: 'Keluar',
  848. "class": 'layout-topbar-menu-tooltip'
  849. }, void 0, {
  850. bottom: true
  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/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  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/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  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 _withScopeId = function _withScopeId(n) {
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  867. };
  868. var _hoisted_1 = {
  869. "class": "layout-sidebar"
  870. };
  871. var _hoisted_2 = {
  872. "class": "layout-main-container"
  873. };
  874. var _hoisted_3 = {
  875. "class": "layout-main"
  876. };
  877. var _hoisted_4 = {
  878. key: 0,
  879. "class": "layout-mask p-component-overlay"
  880. };
  881. function render(_ctx, _cache, $props, $setup, $data, $options) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  883. title: $props.title
  884. }, null, 8
  885. /* PROPS */
  886. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  887. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  888. onClick: $setup.onWrapperClick
  889. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  890. onMenuToggle: $setup.onMenuToggle
  891. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  892. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  893. }, null, 8
  894. /* PROPS */
  895. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  896. name: "layout-mask"
  897. }, {
  898. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  899. 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)];
  900. }),
  901. _: 1
  902. /* STABLE */
  903. })], 2
  904. /* CLASS */
  905. )], 64
  906. /* STABLE_FRAGMENT */
  907. );
  908. }
  909. /***/ }),
  910. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  911. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  912. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  913. \********************************************************************************************************************************************************************************************************************************************************************************/
  914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  915. "use strict";
  916. __webpack_require__.r(__webpack_exports__);
  917. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  918. /* harmony export */ "render": () => (/* binding */ render)
  919. /* harmony export */ });
  920. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  921. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Supplier", -1
  922. /* HOISTED */
  923. );
  924. var _hoisted_2 = {
  925. "class": "grid"
  926. };
  927. var _hoisted_3 = {
  928. "class": "col-12 md:col-8"
  929. };
  930. var _hoisted_4 = {
  931. "class": "flex align-items-center"
  932. };
  933. var _hoisted_5 = {
  934. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  935. };
  936. function render(_ctx, _cache, $props, $setup, $data, $options) {
  937. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  938. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  939. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  940. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  941. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  942. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], {
  943. title: "Daftar Supplier"
  944. }, {
  945. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  946. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  947. responsiveLayout: "scroll",
  948. columnResizeMode: "expand",
  949. value: $props.suppliers.data,
  950. rowHover: true,
  951. stripedRows: true
  952. }, {
  953. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  954. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSearch"], {
  955. "class": "w-full md:w-27rem",
  956. placeholder: "cari, contoh: tina, 08xx, 0x",
  957. url: "/suppliers",
  958. "initial-search": $props.initialSearch
  959. }, null, 8
  960. /* PROPS */
  961. , ["initial-search"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. label: "Tambah Supplier",
  963. icon: "pi pi-pencil",
  964. "class": "p-button-outlined",
  965. href: _ctx.route('suppliers.create')
  966. }, null, 8
  967. /* PROPS */
  968. , ["href"])])])];
  969. }),
  970. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  971. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  972. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  973. field: value.field,
  974. header: value.header,
  975. key: value.field
  976. }, null, 8
  977. /* PROPS */
  978. , ["field", "header"]);
  979. }), 128
  980. /* KEYED_FRAGMENT */
  981. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  982. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  983. var data = _ref.data;
  984. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  985. icon: "pi pi-pencil",
  986. "class": "p-button-icon-only p-button-rounded p-button-text",
  987. href: _ctx.route('suppliers.edit', data.id)
  988. }, null, 8
  989. /* PROPS */
  990. , ["href"]), [[_directive_tooltip, 'Ubah Supplier', void 0, {
  991. bottom: true
  992. }]])];
  993. }),
  994. _: 1
  995. /* STABLE */
  996. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  997. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  998. var data = _ref2.data;
  999. return [!data.isUsed ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Button, {
  1000. key: 0,
  1001. icon: "pi pi-trash",
  1002. "class": "p-button-icon-only p-button-rounded p-button-text",
  1003. onClick: function onClick($event) {
  1004. return $setup.onDelete(data);
  1005. }
  1006. }, null, 8
  1007. /* PROPS */
  1008. , ["onClick"])), [[_directive_tooltip, 'Hapus Supplier', void 0, {
  1009. bottom: true
  1010. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1011. }),
  1012. _: 1
  1013. /* STABLE */
  1014. })];
  1015. }),
  1016. _: 1
  1017. /* STABLE */
  1018. }, 8
  1019. /* PROPS */
  1020. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1021. links: $props.suppliers.links
  1022. }, null, 8
  1023. /* PROPS */
  1024. , ["links"])];
  1025. }),
  1026. _: 1
  1027. /* STABLE */
  1028. })], 64
  1029. /* STABLE_FRAGMENT */
  1030. );
  1031. }
  1032. /***/ }),
  1033. /***/ "./resources/js/pages/Suppliers/config.js":
  1034. /*!************************************************!*\
  1035. !*** ./resources/js/pages/Suppliers/config.js ***!
  1036. \************************************************/
  1037. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1038. "use strict";
  1039. __webpack_require__.r(__webpack_exports__);
  1040. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1041. /* harmony export */ "indexTable": () => (/* binding */ indexTable)
  1042. /* harmony export */ });
  1043. var indexTable = [{
  1044. field: 'name',
  1045. header: 'Nama'
  1046. }, {
  1047. field: 'address',
  1048. header: 'Alamat'
  1049. }, {
  1050. field: 'email',
  1051. header: 'Surel'
  1052. }, {
  1053. field: 'phone',
  1054. header: 'No HP'
  1055. }, {
  1056. field: 'npwp',
  1057. header: 'NPWP'
  1058. }];
  1059. /***/ }),
  1060. /***/ "./resources/js/utils/menu.js":
  1061. /*!************************************!*\
  1062. !*** ./resources/js/utils/menu.js ***!
  1063. \************************************/
  1064. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1065. "use strict";
  1066. __webpack_require__.r(__webpack_exports__);
  1067. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1068. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1069. /* harmony export */ });
  1070. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1071. // Admin
  1072. 1: [{
  1073. label: 'Home',
  1074. items: [{
  1075. label: 'Dashboard',
  1076. icon: 'pi pi-chart-bar',
  1077. to: '/dashboards',
  1078. component: 'Dashboards/Index'
  1079. }]
  1080. }, {
  1081. label: 'Laporan',
  1082. items: []
  1083. }, {
  1084. label: 'Master',
  1085. items: [{
  1086. label: 'User',
  1087. icon: 'pi pi-user',
  1088. to: '/users',
  1089. component: 'Users/Index'
  1090. }]
  1091. }, {
  1092. label: 'Pengaturan',
  1093. items: [{
  1094. label: 'PPN',
  1095. icon: 'pi pi-percentage',
  1096. to: '/ppn',
  1097. component: 'PPN/Index'
  1098. }]
  1099. }],
  1100. // Supervisor
  1101. 2: [{
  1102. label: 'Home',
  1103. items: [{
  1104. label: 'Dashboard',
  1105. icon: 'pi pi-chart-bar',
  1106. to: '/dashboards',
  1107. component: 'Dashboards/Index'
  1108. }]
  1109. }, {
  1110. label: 'Master',
  1111. items: [{
  1112. label: 'Pelanggan',
  1113. icon: 'pi pi-users',
  1114. to: '/customers',
  1115. component: 'Customers/Index'
  1116. }, {
  1117. label: 'Pembelian',
  1118. icon: 'pi pi-shopping-cart',
  1119. to: '/purchases',
  1120. component: 'Purchases/Index'
  1121. }, {
  1122. label: 'Penjualan',
  1123. icon: 'pi pi-tag',
  1124. to: '/sales',
  1125. component: 'Sales/Index'
  1126. }, {
  1127. label: 'Produk',
  1128. icon: 'pi pi-th-large',
  1129. to: '/products',
  1130. component: 'Products/Index'
  1131. }]
  1132. }],
  1133. // Operator
  1134. 3: [{
  1135. label: 'Home',
  1136. items: [{
  1137. label: 'Dashboard',
  1138. icon: 'pi pi-chart-bar',
  1139. to: '/dashboards',
  1140. component: 'Dashboards/Index'
  1141. }]
  1142. }, {
  1143. label: 'Master',
  1144. items: [{
  1145. label: 'Supplier',
  1146. icon: 'pi pi-shopping-cart',
  1147. to: '/suppliers',
  1148. component: 'Suppliers/Index'
  1149. }, {
  1150. label: 'Stok Barang',
  1151. icon: 'pi pi-box',
  1152. to: '/stock-products',
  1153. component: 'StockProducts/Index'
  1154. }]
  1155. }]
  1156. });
  1157. /***/ }),
  1158. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1159. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1160. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1161. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1162. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1163. "use strict";
  1164. __webpack_require__.r(__webpack_exports__);
  1165. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1166. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1167. /* harmony export */ });
  1168. /* 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");
  1169. /* 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__);
  1170. // Imports
  1171. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1172. // Module
  1173. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1174. // Exports
  1175. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1176. /***/ }),
  1177. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1178. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1179. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1180. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1181. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1182. "use strict";
  1183. __webpack_require__.r(__webpack_exports__);
  1184. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1185. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1186. /* harmony export */ });
  1187. /* 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");
  1188. /* 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__);
  1189. // Imports
  1190. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1191. // Module
  1192. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-b1b23eb4] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1193. // Exports
  1194. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1195. /***/ }),
  1196. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1197. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1198. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1199. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1200. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1201. "use strict";
  1202. __webpack_require__.r(__webpack_exports__);
  1203. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1204. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1205. /* harmony export */ });
  1206. /* 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");
  1207. /* 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__);
  1208. // Imports
  1209. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1210. // Module
  1211. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1212. // Exports
  1213. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1214. /***/ }),
  1215. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  1216. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1217. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  1218. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1219. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1220. "use strict";
  1221. __webpack_require__.r(__webpack_exports__);
  1222. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1223. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1224. /* harmony export */ });
  1225. /* 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");
  1226. /* 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__);
  1227. // Imports
  1228. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1229. // Module
  1230. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-1d279fe2] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-1d279fe2] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1231. // Exports
  1232. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1233. /***/ }),
  1234. /***/ "./node_modules/lodash/lodash.js":
  1235. /*!***************************************!*\
  1236. !*** ./node_modules/lodash/lodash.js ***!
  1237. \***************************************/
  1238. /***/ (function(module, exports, __webpack_require__) {
  1239. /* module decorator */ module = __webpack_require__.nmd(module);
  1240. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1241. * @license
  1242. * Lodash <https://lodash.com/>
  1243. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1244. * Released under MIT license <https://lodash.com/license>
  1245. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1246. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1247. */
  1248. ;(function() {
  1249. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1250. var undefined;
  1251. /** Used as the semantic version number. */
  1252. var VERSION = '4.17.21';
  1253. /** Used as the size to enable large array optimizations. */
  1254. var LARGE_ARRAY_SIZE = 200;
  1255. /** Error message constants. */
  1256. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1257. FUNC_ERROR_TEXT = 'Expected a function',
  1258. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1259. /** Used to stand-in for `undefined` hash values. */
  1260. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1261. /** Used as the maximum memoize cache size. */
  1262. var MAX_MEMOIZE_SIZE = 500;
  1263. /** Used as the internal argument placeholder. */
  1264. var PLACEHOLDER = '__lodash_placeholder__';
  1265. /** Used to compose bitmasks for cloning. */
  1266. var CLONE_DEEP_FLAG = 1,
  1267. CLONE_FLAT_FLAG = 2,
  1268. CLONE_SYMBOLS_FLAG = 4;
  1269. /** Used to compose bitmasks for value comparisons. */
  1270. var COMPARE_PARTIAL_FLAG = 1,
  1271. COMPARE_UNORDERED_FLAG = 2;
  1272. /** Used to compose bitmasks for function metadata. */
  1273. var WRAP_BIND_FLAG = 1,
  1274. WRAP_BIND_KEY_FLAG = 2,
  1275. WRAP_CURRY_BOUND_FLAG = 4,
  1276. WRAP_CURRY_FLAG = 8,
  1277. WRAP_CURRY_RIGHT_FLAG = 16,
  1278. WRAP_PARTIAL_FLAG = 32,
  1279. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1280. WRAP_ARY_FLAG = 128,
  1281. WRAP_REARG_FLAG = 256,
  1282. WRAP_FLIP_FLAG = 512;
  1283. /** Used as default options for `_.truncate`. */
  1284. var DEFAULT_TRUNC_LENGTH = 30,
  1285. DEFAULT_TRUNC_OMISSION = '...';
  1286. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1287. var HOT_COUNT = 800,
  1288. HOT_SPAN = 16;
  1289. /** Used to indicate the type of lazy iteratees. */
  1290. var LAZY_FILTER_FLAG = 1,
  1291. LAZY_MAP_FLAG = 2,
  1292. LAZY_WHILE_FLAG = 3;
  1293. /** Used as references for various `Number` constants. */
  1294. var INFINITY = 1 / 0,
  1295. MAX_SAFE_INTEGER = 9007199254740991,
  1296. MAX_INTEGER = 1.7976931348623157e+308,
  1297. NAN = 0 / 0;
  1298. /** Used as references for the maximum length and index of an array. */
  1299. var MAX_ARRAY_LENGTH = 4294967295,
  1300. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1301. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1302. /** Used to associate wrap methods with their bit flags. */
  1303. var wrapFlags = [
  1304. ['ary', WRAP_ARY_FLAG],
  1305. ['bind', WRAP_BIND_FLAG],
  1306. ['bindKey', WRAP_BIND_KEY_FLAG],
  1307. ['curry', WRAP_CURRY_FLAG],
  1308. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1309. ['flip', WRAP_FLIP_FLAG],
  1310. ['partial', WRAP_PARTIAL_FLAG],
  1311. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1312. ['rearg', WRAP_REARG_FLAG]
  1313. ];
  1314. /** `Object#toString` result references. */
  1315. var argsTag = '[object Arguments]',
  1316. arrayTag = '[object Array]',
  1317. asyncTag = '[object AsyncFunction]',
  1318. boolTag = '[object Boolean]',
  1319. dateTag = '[object Date]',
  1320. domExcTag = '[object DOMException]',
  1321. errorTag = '[object Error]',
  1322. funcTag = '[object Function]',
  1323. genTag = '[object GeneratorFunction]',
  1324. mapTag = '[object Map]',
  1325. numberTag = '[object Number]',
  1326. nullTag = '[object Null]',
  1327. objectTag = '[object Object]',
  1328. promiseTag = '[object Promise]',
  1329. proxyTag = '[object Proxy]',
  1330. regexpTag = '[object RegExp]',
  1331. setTag = '[object Set]',
  1332. stringTag = '[object String]',
  1333. symbolTag = '[object Symbol]',
  1334. undefinedTag = '[object Undefined]',
  1335. weakMapTag = '[object WeakMap]',
  1336. weakSetTag = '[object WeakSet]';
  1337. var arrayBufferTag = '[object ArrayBuffer]',
  1338. dataViewTag = '[object DataView]',
  1339. float32Tag = '[object Float32Array]',
  1340. float64Tag = '[object Float64Array]',
  1341. int8Tag = '[object Int8Array]',
  1342. int16Tag = '[object Int16Array]',
  1343. int32Tag = '[object Int32Array]',
  1344. uint8Tag = '[object Uint8Array]',
  1345. uint8ClampedTag = '[object Uint8ClampedArray]',
  1346. uint16Tag = '[object Uint16Array]',
  1347. uint32Tag = '[object Uint32Array]';
  1348. /** Used to match empty string literals in compiled template source. */
  1349. var reEmptyStringLeading = /\b__p \+= '';/g,
  1350. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1351. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1352. /** Used to match HTML entities and HTML characters. */
  1353. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1354. reUnescapedHtml = /[&<>"']/g,
  1355. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1356. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1357. /** Used to match template delimiters. */
  1358. var reEscape = /<%-([\s\S]+?)%>/g,
  1359. reEvaluate = /<%([\s\S]+?)%>/g,
  1360. reInterpolate = /<%=([\s\S]+?)%>/g;
  1361. /** Used to match property names within property paths. */
  1362. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1363. reIsPlainProp = /^\w*$/,
  1364. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1365. /**
  1366. * Used to match `RegExp`
  1367. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1368. */
  1369. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1370. reHasRegExpChar = RegExp(reRegExpChar.source);
  1371. /** Used to match leading whitespace. */
  1372. var reTrimStart = /^\s+/;
  1373. /** Used to match a single whitespace character. */
  1374. var reWhitespace = /\s/;
  1375. /** Used to match wrap detail comments. */
  1376. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1377. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1378. reSplitDetails = /,? & /;
  1379. /** Used to match words composed of alphanumeric characters. */
  1380. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1381. /**
  1382. * Used to validate the `validate` option in `_.template` variable.
  1383. *
  1384. * Forbids characters which could potentially change the meaning of the function argument definition:
  1385. * - "()," (modification of function parameters)
  1386. * - "=" (default value)
  1387. * - "[]{}" (destructuring of function parameters)
  1388. * - "/" (beginning of a comment)
  1389. * - whitespace
  1390. */
  1391. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1392. /** Used to match backslashes in property paths. */
  1393. var reEscapeChar = /\\(\\)?/g;
  1394. /**
  1395. * Used to match
  1396. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1397. */
  1398. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1399. /** Used to match `RegExp` flags from their coerced string values. */
  1400. var reFlags = /\w*$/;
  1401. /** Used to detect bad signed hexadecimal string values. */
  1402. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1403. /** Used to detect binary string values. */
  1404. var reIsBinary = /^0b[01]+$/i;
  1405. /** Used to detect host constructors (Safari). */
  1406. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1407. /** Used to detect octal string values. */
  1408. var reIsOctal = /^0o[0-7]+$/i;
  1409. /** Used to detect unsigned integer values. */
  1410. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1411. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1412. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1413. /** Used to ensure capturing order of template delimiters. */
  1414. var reNoMatch = /($^)/;
  1415. /** Used to match unescaped characters in compiled string literals. */
  1416. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1417. /** Used to compose unicode character classes. */
  1418. var rsAstralRange = '\\ud800-\\udfff',
  1419. rsComboMarksRange = '\\u0300-\\u036f',
  1420. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1421. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1422. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1423. rsDingbatRange = '\\u2700-\\u27bf',
  1424. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1425. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1426. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1427. rsPunctuationRange = '\\u2000-\\u206f',
  1428. 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',
  1429. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1430. rsVarRange = '\\ufe0e\\ufe0f',
  1431. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1432. /** Used to compose unicode capture groups. */
  1433. var rsApos = "['\u2019]",
  1434. rsAstral = '[' + rsAstralRange + ']',
  1435. rsBreak = '[' + rsBreakRange + ']',
  1436. rsCombo = '[' + rsComboRange + ']',
  1437. rsDigits = '\\d+',
  1438. rsDingbat = '[' + rsDingbatRange + ']',
  1439. rsLower = '[' + rsLowerRange + ']',
  1440. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1441. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1442. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1443. rsNonAstral = '[^' + rsAstralRange + ']',
  1444. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1445. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1446. rsUpper = '[' + rsUpperRange + ']',
  1447. rsZWJ = '\\u200d';
  1448. /** Used to compose unicode regexes. */
  1449. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1450. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1451. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1452. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1453. reOptMod = rsModifier + '?',
  1454. rsOptVar = '[' + rsVarRange + ']?',
  1455. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1456. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1457. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1458. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1459. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1460. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1461. /** Used to match apostrophes. */
  1462. var reApos = RegExp(rsApos, 'g');
  1463. /**
  1464. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1465. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1466. */
  1467. var reComboMark = RegExp(rsCombo, 'g');
  1468. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1469. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1470. /** Used to match complex or compound words. */
  1471. var reUnicodeWord = RegExp([
  1472. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1473. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1474. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1475. rsUpper + '+' + rsOptContrUpper,
  1476. rsOrdUpper,
  1477. rsOrdLower,
  1478. rsDigits,
  1479. rsEmoji
  1480. ].join('|'), 'g');
  1481. /** 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/). */
  1482. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1483. /** Used to detect strings that need a more robust regexp to match words. */
  1484. 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 ]/;
  1485. /** Used to assign default `context` object properties. */
  1486. var contextProps = [
  1487. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1488. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1489. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1490. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1491. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1492. ];
  1493. /** Used to make template sourceURLs easier to identify. */
  1494. var templateCounter = -1;
  1495. /** Used to identify `toStringTag` values of typed arrays. */
  1496. var typedArrayTags = {};
  1497. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1498. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1499. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1500. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1501. typedArrayTags[uint32Tag] = true;
  1502. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1503. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1504. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1505. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1506. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1507. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1508. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1509. typedArrayTags[weakMapTag] = false;
  1510. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1511. var cloneableTags = {};
  1512. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1513. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1514. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1515. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1516. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1517. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1518. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1519. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1520. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1521. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1522. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1523. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1524. cloneableTags[weakMapTag] = false;
  1525. /** Used to map Latin Unicode letters to basic Latin letters. */
  1526. var deburredLetters = {
  1527. // Latin-1 Supplement block.
  1528. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1529. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1530. '\xc7': 'C', '\xe7': 'c',
  1531. '\xd0': 'D', '\xf0': 'd',
  1532. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1533. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1534. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1535. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1536. '\xd1': 'N', '\xf1': 'n',
  1537. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1538. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1539. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1540. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1541. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1542. '\xc6': 'Ae', '\xe6': 'ae',
  1543. '\xde': 'Th', '\xfe': 'th',
  1544. '\xdf': 'ss',
  1545. // Latin Extended-A block.
  1546. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1547. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1548. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1549. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1550. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1551. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1552. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1553. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1554. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1555. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1556. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1557. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1558. '\u0134': 'J', '\u0135': 'j',
  1559. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1560. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1561. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1562. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1563. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1564. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1565. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1566. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1567. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1568. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1569. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1570. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1571. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1572. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1573. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1574. '\u0174': 'W', '\u0175': 'w',
  1575. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1576. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1577. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1578. '\u0132': 'IJ', '\u0133': 'ij',
  1579. '\u0152': 'Oe', '\u0153': 'oe',
  1580. '\u0149': "'n", '\u017f': 's'
  1581. };
  1582. /** Used to map characters to HTML entities. */
  1583. var htmlEscapes = {
  1584. '&': '&amp;',
  1585. '<': '&lt;',
  1586. '>': '&gt;',
  1587. '"': '&quot;',
  1588. "'": '&#39;'
  1589. };
  1590. /** Used to map HTML entities to characters. */
  1591. var htmlUnescapes = {
  1592. '&amp;': '&',
  1593. '&lt;': '<',
  1594. '&gt;': '>',
  1595. '&quot;': '"',
  1596. '&#39;': "'"
  1597. };
  1598. /** Used to escape characters for inclusion in compiled string literals. */
  1599. var stringEscapes = {
  1600. '\\': '\\',
  1601. "'": "'",
  1602. '\n': 'n',
  1603. '\r': 'r',
  1604. '\u2028': 'u2028',
  1605. '\u2029': 'u2029'
  1606. };
  1607. /** Built-in method references without a dependency on `root`. */
  1608. var freeParseFloat = parseFloat,
  1609. freeParseInt = parseInt;
  1610. /** Detect free variable `global` from Node.js. */
  1611. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1612. /** Detect free variable `self`. */
  1613. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1614. /** Used as a reference to the global object. */
  1615. var root = freeGlobal || freeSelf || Function('return this')();
  1616. /** Detect free variable `exports`. */
  1617. var freeExports = true && exports && !exports.nodeType && exports;
  1618. /** Detect free variable `module`. */
  1619. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1620. /** Detect the popular CommonJS extension `module.exports`. */
  1621. var moduleExports = freeModule && freeModule.exports === freeExports;
  1622. /** Detect free variable `process` from Node.js. */
  1623. var freeProcess = moduleExports && freeGlobal.process;
  1624. /** Used to access faster Node.js helpers. */
  1625. var nodeUtil = (function() {
  1626. try {
  1627. // Use `util.types` for Node.js 10+.
  1628. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1629. if (types) {
  1630. return types;
  1631. }
  1632. // Legacy `process.binding('util')` for Node.js < 10.
  1633. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1634. } catch (e) {}
  1635. }());
  1636. /* Node.js helper references. */
  1637. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1638. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1639. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1640. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1641. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1642. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1643. /*--------------------------------------------------------------------------*/
  1644. /**
  1645. * A faster alternative to `Function#apply`, this function invokes `func`
  1646. * with the `this` binding of `thisArg` and the arguments of `args`.
  1647. *
  1648. * @private
  1649. * @param {Function} func The function to invoke.
  1650. * @param {*} thisArg The `this` binding of `func`.
  1651. * @param {Array} args The arguments to invoke `func` with.
  1652. * @returns {*} Returns the result of `func`.
  1653. */
  1654. function apply(func, thisArg, args) {
  1655. switch (args.length) {
  1656. case 0: return func.call(thisArg);
  1657. case 1: return func.call(thisArg, args[0]);
  1658. case 2: return func.call(thisArg, args[0], args[1]);
  1659. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1660. }
  1661. return func.apply(thisArg, args);
  1662. }
  1663. /**
  1664. * A specialized version of `baseAggregator` for arrays.
  1665. *
  1666. * @private
  1667. * @param {Array} [array] The array to iterate over.
  1668. * @param {Function} setter The function to set `accumulator` values.
  1669. * @param {Function} iteratee The iteratee to transform keys.
  1670. * @param {Object} accumulator The initial aggregated object.
  1671. * @returns {Function} Returns `accumulator`.
  1672. */
  1673. function arrayAggregator(array, setter, iteratee, accumulator) {
  1674. var index = -1,
  1675. length = array == null ? 0 : array.length;
  1676. while (++index < length) {
  1677. var value = array[index];
  1678. setter(accumulator, value, iteratee(value), array);
  1679. }
  1680. return accumulator;
  1681. }
  1682. /**
  1683. * A specialized version of `_.forEach` for arrays without support for
  1684. * iteratee shorthands.
  1685. *
  1686. * @private
  1687. * @param {Array} [array] The array to iterate over.
  1688. * @param {Function} iteratee The function invoked per iteration.
  1689. * @returns {Array} Returns `array`.
  1690. */
  1691. function arrayEach(array, iteratee) {
  1692. var index = -1,
  1693. length = array == null ? 0 : array.length;
  1694. while (++index < length) {
  1695. if (iteratee(array[index], index, array) === false) {
  1696. break;
  1697. }
  1698. }
  1699. return array;
  1700. }
  1701. /**
  1702. * A specialized version of `_.forEachRight` for arrays without support for
  1703. * iteratee shorthands.
  1704. *
  1705. * @private
  1706. * @param {Array} [array] The array to iterate over.
  1707. * @param {Function} iteratee The function invoked per iteration.
  1708. * @returns {Array} Returns `array`.
  1709. */
  1710. function arrayEachRight(array, iteratee) {
  1711. var length = array == null ? 0 : array.length;
  1712. while (length--) {
  1713. if (iteratee(array[length], length, array) === false) {
  1714. break;
  1715. }
  1716. }
  1717. return array;
  1718. }
  1719. /**
  1720. * A specialized version of `_.every` for arrays without support for
  1721. * iteratee shorthands.
  1722. *
  1723. * @private
  1724. * @param {Array} [array] The array to iterate over.
  1725. * @param {Function} predicate The function invoked per iteration.
  1726. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1727. * else `false`.
  1728. */
  1729. function arrayEvery(array, predicate) {
  1730. var index = -1,
  1731. length = array == null ? 0 : array.length;
  1732. while (++index < length) {
  1733. if (!predicate(array[index], index, array)) {
  1734. return false;
  1735. }
  1736. }
  1737. return true;
  1738. }
  1739. /**
  1740. * A specialized version of `_.filter` for arrays without support for
  1741. * iteratee shorthands.
  1742. *
  1743. * @private
  1744. * @param {Array} [array] The array to iterate over.
  1745. * @param {Function} predicate The function invoked per iteration.
  1746. * @returns {Array} Returns the new filtered array.
  1747. */
  1748. function arrayFilter(array, predicate) {
  1749. var index = -1,
  1750. length = array == null ? 0 : array.length,
  1751. resIndex = 0,
  1752. result = [];
  1753. while (++index < length) {
  1754. var value = array[index];
  1755. if (predicate(value, index, array)) {
  1756. result[resIndex++] = value;
  1757. }
  1758. }
  1759. return result;
  1760. }
  1761. /**
  1762. * A specialized version of `_.includes` for arrays without support for
  1763. * specifying an index to search from.
  1764. *
  1765. * @private
  1766. * @param {Array} [array] The array to inspect.
  1767. * @param {*} target The value to search for.
  1768. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1769. */
  1770. function arrayIncludes(array, value) {
  1771. var length = array == null ? 0 : array.length;
  1772. return !!length && baseIndexOf(array, value, 0) > -1;
  1773. }
  1774. /**
  1775. * This function is like `arrayIncludes` except that it accepts a comparator.
  1776. *
  1777. * @private
  1778. * @param {Array} [array] The array to inspect.
  1779. * @param {*} target The value to search for.
  1780. * @param {Function} comparator The comparator invoked per element.
  1781. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1782. */
  1783. function arrayIncludesWith(array, value, comparator) {
  1784. var index = -1,
  1785. length = array == null ? 0 : array.length;
  1786. while (++index < length) {
  1787. if (comparator(value, array[index])) {
  1788. return true;
  1789. }
  1790. }
  1791. return false;
  1792. }
  1793. /**
  1794. * A specialized version of `_.map` for arrays without support for iteratee
  1795. * shorthands.
  1796. *
  1797. * @private
  1798. * @param {Array} [array] The array to iterate over.
  1799. * @param {Function} iteratee The function invoked per iteration.
  1800. * @returns {Array} Returns the new mapped array.
  1801. */
  1802. function arrayMap(array, iteratee) {
  1803. var index = -1,
  1804. length = array == null ? 0 : array.length,
  1805. result = Array(length);
  1806. while (++index < length) {
  1807. result[index] = iteratee(array[index], index, array);
  1808. }
  1809. return result;
  1810. }
  1811. /**
  1812. * Appends the elements of `values` to `array`.
  1813. *
  1814. * @private
  1815. * @param {Array} array The array to modify.
  1816. * @param {Array} values The values to append.
  1817. * @returns {Array} Returns `array`.
  1818. */
  1819. function arrayPush(array, values) {
  1820. var index = -1,
  1821. length = values.length,
  1822. offset = array.length;
  1823. while (++index < length) {
  1824. array[offset + index] = values[index];
  1825. }
  1826. return array;
  1827. }
  1828. /**
  1829. * A specialized version of `_.reduce` for arrays without support for
  1830. * iteratee shorthands.
  1831. *
  1832. * @private
  1833. * @param {Array} [array] The array to iterate over.
  1834. * @param {Function} iteratee The function invoked per iteration.
  1835. * @param {*} [accumulator] The initial value.
  1836. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1837. * the initial value.
  1838. * @returns {*} Returns the accumulated value.
  1839. */
  1840. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1841. var index = -1,
  1842. length = array == null ? 0 : array.length;
  1843. if (initAccum && length) {
  1844. accumulator = array[++index];
  1845. }
  1846. while (++index < length) {
  1847. accumulator = iteratee(accumulator, array[index], index, array);
  1848. }
  1849. return accumulator;
  1850. }
  1851. /**
  1852. * A specialized version of `_.reduceRight` for arrays without support for
  1853. * iteratee shorthands.
  1854. *
  1855. * @private
  1856. * @param {Array} [array] The array to iterate over.
  1857. * @param {Function} iteratee The function invoked per iteration.
  1858. * @param {*} [accumulator] The initial value.
  1859. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1860. * the initial value.
  1861. * @returns {*} Returns the accumulated value.
  1862. */
  1863. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1864. var length = array == null ? 0 : array.length;
  1865. if (initAccum && length) {
  1866. accumulator = array[--length];
  1867. }
  1868. while (length--) {
  1869. accumulator = iteratee(accumulator, array[length], length, array);
  1870. }
  1871. return accumulator;
  1872. }
  1873. /**
  1874. * A specialized version of `_.some` for arrays without support for iteratee
  1875. * shorthands.
  1876. *
  1877. * @private
  1878. * @param {Array} [array] The array to iterate over.
  1879. * @param {Function} predicate The function invoked per iteration.
  1880. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1881. * else `false`.
  1882. */
  1883. function arraySome(array, predicate) {
  1884. var index = -1,
  1885. length = array == null ? 0 : array.length;
  1886. while (++index < length) {
  1887. if (predicate(array[index], index, array)) {
  1888. return true;
  1889. }
  1890. }
  1891. return false;
  1892. }
  1893. /**
  1894. * Gets the size of an ASCII `string`.
  1895. *
  1896. * @private
  1897. * @param {string} string The string inspect.
  1898. * @returns {number} Returns the string size.
  1899. */
  1900. var asciiSize = baseProperty('length');
  1901. /**
  1902. * Converts an ASCII `string` to an array.
  1903. *
  1904. * @private
  1905. * @param {string} string The string to convert.
  1906. * @returns {Array} Returns the converted array.
  1907. */
  1908. function asciiToArray(string) {
  1909. return string.split('');
  1910. }
  1911. /**
  1912. * Splits an ASCII `string` into an array of its words.
  1913. *
  1914. * @private
  1915. * @param {string} The string to inspect.
  1916. * @returns {Array} Returns the words of `string`.
  1917. */
  1918. function asciiWords(string) {
  1919. return string.match(reAsciiWord) || [];
  1920. }
  1921. /**
  1922. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1923. * without support for iteratee shorthands, which iterates over `collection`
  1924. * using `eachFunc`.
  1925. *
  1926. * @private
  1927. * @param {Array|Object} collection The collection to inspect.
  1928. * @param {Function} predicate The function invoked per iteration.
  1929. * @param {Function} eachFunc The function to iterate over `collection`.
  1930. * @returns {*} Returns the found element or its key, else `undefined`.
  1931. */
  1932. function baseFindKey(collection, predicate, eachFunc) {
  1933. var result;
  1934. eachFunc(collection, function(value, key, collection) {
  1935. if (predicate(value, key, collection)) {
  1936. result = key;
  1937. return false;
  1938. }
  1939. });
  1940. return result;
  1941. }
  1942. /**
  1943. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1944. * support for iteratee shorthands.
  1945. *
  1946. * @private
  1947. * @param {Array} array The array to inspect.
  1948. * @param {Function} predicate The function invoked per iteration.
  1949. * @param {number} fromIndex The index to search from.
  1950. * @param {boolean} [fromRight] Specify iterating from right to left.
  1951. * @returns {number} Returns the index of the matched value, else `-1`.
  1952. */
  1953. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1954. var length = array.length,
  1955. index = fromIndex + (fromRight ? 1 : -1);
  1956. while ((fromRight ? index-- : ++index < length)) {
  1957. if (predicate(array[index], index, array)) {
  1958. return index;
  1959. }
  1960. }
  1961. return -1;
  1962. }
  1963. /**
  1964. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1965. *
  1966. * @private
  1967. * @param {Array} array The array to inspect.
  1968. * @param {*} value The value to search for.
  1969. * @param {number} fromIndex The index to search from.
  1970. * @returns {number} Returns the index of the matched value, else `-1`.
  1971. */
  1972. function baseIndexOf(array, value, fromIndex) {
  1973. return value === value
  1974. ? strictIndexOf(array, value, fromIndex)
  1975. : baseFindIndex(array, baseIsNaN, fromIndex);
  1976. }
  1977. /**
  1978. * This function is like `baseIndexOf` except that it accepts a comparator.
  1979. *
  1980. * @private
  1981. * @param {Array} array The array to inspect.
  1982. * @param {*} value The value to search for.
  1983. * @param {number} fromIndex The index to search from.
  1984. * @param {Function} comparator The comparator invoked per element.
  1985. * @returns {number} Returns the index of the matched value, else `-1`.
  1986. */
  1987. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1988. var index = fromIndex - 1,
  1989. length = array.length;
  1990. while (++index < length) {
  1991. if (comparator(array[index], value)) {
  1992. return index;
  1993. }
  1994. }
  1995. return -1;
  1996. }
  1997. /**
  1998. * The base implementation of `_.isNaN` without support for number objects.
  1999. *
  2000. * @private
  2001. * @param {*} value The value to check.
  2002. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2003. */
  2004. function baseIsNaN(value) {
  2005. return value !== value;
  2006. }
  2007. /**
  2008. * The base implementation of `_.mean` and `_.meanBy` without support for
  2009. * iteratee shorthands.
  2010. *
  2011. * @private
  2012. * @param {Array} array The array to iterate over.
  2013. * @param {Function} iteratee The function invoked per iteration.
  2014. * @returns {number} Returns the mean.
  2015. */
  2016. function baseMean(array, iteratee) {
  2017. var length = array == null ? 0 : array.length;
  2018. return length ? (baseSum(array, iteratee) / length) : NAN;
  2019. }
  2020. /**
  2021. * The base implementation of `_.property` without support for deep paths.
  2022. *
  2023. * @private
  2024. * @param {string} key The key of the property to get.
  2025. * @returns {Function} Returns the new accessor function.
  2026. */
  2027. function baseProperty(key) {
  2028. return function(object) {
  2029. return object == null ? undefined : object[key];
  2030. };
  2031. }
  2032. /**
  2033. * The base implementation of `_.propertyOf` without support for deep paths.
  2034. *
  2035. * @private
  2036. * @param {Object} object The object to query.
  2037. * @returns {Function} Returns the new accessor function.
  2038. */
  2039. function basePropertyOf(object) {
  2040. return function(key) {
  2041. return object == null ? undefined : object[key];
  2042. };
  2043. }
  2044. /**
  2045. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2046. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2047. *
  2048. * @private
  2049. * @param {Array|Object} collection The collection to iterate over.
  2050. * @param {Function} iteratee The function invoked per iteration.
  2051. * @param {*} accumulator The initial value.
  2052. * @param {boolean} initAccum Specify using the first or last element of
  2053. * `collection` as the initial value.
  2054. * @param {Function} eachFunc The function to iterate over `collection`.
  2055. * @returns {*} Returns the accumulated value.
  2056. */
  2057. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2058. eachFunc(collection, function(value, index, collection) {
  2059. accumulator = initAccum
  2060. ? (initAccum = false, value)
  2061. : iteratee(accumulator, value, index, collection);
  2062. });
  2063. return accumulator;
  2064. }
  2065. /**
  2066. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2067. * sort order of `array` and replaces criteria objects with their corresponding
  2068. * values.
  2069. *
  2070. * @private
  2071. * @param {Array} array The array to sort.
  2072. * @param {Function} comparer The function to define sort order.
  2073. * @returns {Array} Returns `array`.
  2074. */
  2075. function baseSortBy(array, comparer) {
  2076. var length = array.length;
  2077. array.sort(comparer);
  2078. while (length--) {
  2079. array[length] = array[length].value;
  2080. }
  2081. return array;
  2082. }
  2083. /**
  2084. * The base implementation of `_.sum` and `_.sumBy` without support for
  2085. * iteratee shorthands.
  2086. *
  2087. * @private
  2088. * @param {Array} array The array to iterate over.
  2089. * @param {Function} iteratee The function invoked per iteration.
  2090. * @returns {number} Returns the sum.
  2091. */
  2092. function baseSum(array, iteratee) {
  2093. var result,
  2094. index = -1,
  2095. length = array.length;
  2096. while (++index < length) {
  2097. var current = iteratee(array[index]);
  2098. if (current !== undefined) {
  2099. result = result === undefined ? current : (result + current);
  2100. }
  2101. }
  2102. return result;
  2103. }
  2104. /**
  2105. * The base implementation of `_.times` without support for iteratee shorthands
  2106. * or max array length checks.
  2107. *
  2108. * @private
  2109. * @param {number} n The number of times to invoke `iteratee`.
  2110. * @param {Function} iteratee The function invoked per iteration.
  2111. * @returns {Array} Returns the array of results.
  2112. */
  2113. function baseTimes(n, iteratee) {
  2114. var index = -1,
  2115. result = Array(n);
  2116. while (++index < n) {
  2117. result[index] = iteratee(index);
  2118. }
  2119. return result;
  2120. }
  2121. /**
  2122. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2123. * of key-value pairs for `object` corresponding to the property names of `props`.
  2124. *
  2125. * @private
  2126. * @param {Object} object The object to query.
  2127. * @param {Array} props The property names to get values for.
  2128. * @returns {Object} Returns the key-value pairs.
  2129. */
  2130. function baseToPairs(object, props) {
  2131. return arrayMap(props, function(key) {
  2132. return [key, object[key]];
  2133. });
  2134. }
  2135. /**
  2136. * The base implementation of `_.trim`.
  2137. *
  2138. * @private
  2139. * @param {string} string The string to trim.
  2140. * @returns {string} Returns the trimmed string.
  2141. */
  2142. function baseTrim(string) {
  2143. return string
  2144. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2145. : string;
  2146. }
  2147. /**
  2148. * The base implementation of `_.unary` without support for storing metadata.
  2149. *
  2150. * @private
  2151. * @param {Function} func The function to cap arguments for.
  2152. * @returns {Function} Returns the new capped function.
  2153. */
  2154. function baseUnary(func) {
  2155. return function(value) {
  2156. return func(value);
  2157. };
  2158. }
  2159. /**
  2160. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2161. * array of `object` property values corresponding to the property names
  2162. * of `props`.
  2163. *
  2164. * @private
  2165. * @param {Object} object The object to query.
  2166. * @param {Array} props The property names to get values for.
  2167. * @returns {Object} Returns the array of property values.
  2168. */
  2169. function baseValues(object, props) {
  2170. return arrayMap(props, function(key) {
  2171. return object[key];
  2172. });
  2173. }
  2174. /**
  2175. * Checks if a `cache` value for `key` exists.
  2176. *
  2177. * @private
  2178. * @param {Object} cache The cache to query.
  2179. * @param {string} key The key of the entry to check.
  2180. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2181. */
  2182. function cacheHas(cache, key) {
  2183. return cache.has(key);
  2184. }
  2185. /**
  2186. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2187. * that is not found in the character symbols.
  2188. *
  2189. * @private
  2190. * @param {Array} strSymbols The string symbols to inspect.
  2191. * @param {Array} chrSymbols The character symbols to find.
  2192. * @returns {number} Returns the index of the first unmatched string symbol.
  2193. */
  2194. function charsStartIndex(strSymbols, chrSymbols) {
  2195. var index = -1,
  2196. length = strSymbols.length;
  2197. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2198. return index;
  2199. }
  2200. /**
  2201. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2202. * that is not found in the character symbols.
  2203. *
  2204. * @private
  2205. * @param {Array} strSymbols The string symbols to inspect.
  2206. * @param {Array} chrSymbols The character symbols to find.
  2207. * @returns {number} Returns the index of the last unmatched string symbol.
  2208. */
  2209. function charsEndIndex(strSymbols, chrSymbols) {
  2210. var index = strSymbols.length;
  2211. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2212. return index;
  2213. }
  2214. /**
  2215. * Gets the number of `placeholder` occurrences in `array`.
  2216. *
  2217. * @private
  2218. * @param {Array} array The array to inspect.
  2219. * @param {*} placeholder The placeholder to search for.
  2220. * @returns {number} Returns the placeholder count.
  2221. */
  2222. function countHolders(array, placeholder) {
  2223. var length = array.length,
  2224. result = 0;
  2225. while (length--) {
  2226. if (array[length] === placeholder) {
  2227. ++result;
  2228. }
  2229. }
  2230. return result;
  2231. }
  2232. /**
  2233. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2234. * letters to basic Latin letters.
  2235. *
  2236. * @private
  2237. * @param {string} letter The matched letter to deburr.
  2238. * @returns {string} Returns the deburred letter.
  2239. */
  2240. var deburrLetter = basePropertyOf(deburredLetters);
  2241. /**
  2242. * Used by `_.escape` to convert characters to HTML entities.
  2243. *
  2244. * @private
  2245. * @param {string} chr The matched character to escape.
  2246. * @returns {string} Returns the escaped character.
  2247. */
  2248. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2249. /**
  2250. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2251. *
  2252. * @private
  2253. * @param {string} chr The matched character to escape.
  2254. * @returns {string} Returns the escaped character.
  2255. */
  2256. function escapeStringChar(chr) {
  2257. return '\\' + stringEscapes[chr];
  2258. }
  2259. /**
  2260. * Gets the value at `key` of `object`.
  2261. *
  2262. * @private
  2263. * @param {Object} [object] The object to query.
  2264. * @param {string} key The key of the property to get.
  2265. * @returns {*} Returns the property value.
  2266. */
  2267. function getValue(object, key) {
  2268. return object == null ? undefined : object[key];
  2269. }
  2270. /**
  2271. * Checks if `string` contains Unicode symbols.
  2272. *
  2273. * @private
  2274. * @param {string} string The string to inspect.
  2275. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2276. */
  2277. function hasUnicode(string) {
  2278. return reHasUnicode.test(string);
  2279. }
  2280. /**
  2281. * Checks if `string` contains a word composed of Unicode symbols.
  2282. *
  2283. * @private
  2284. * @param {string} string The string to inspect.
  2285. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2286. */
  2287. function hasUnicodeWord(string) {
  2288. return reHasUnicodeWord.test(string);
  2289. }
  2290. /**
  2291. * Converts `iterator` to an array.
  2292. *
  2293. * @private
  2294. * @param {Object} iterator The iterator to convert.
  2295. * @returns {Array} Returns the converted array.
  2296. */
  2297. function iteratorToArray(iterator) {
  2298. var data,
  2299. result = [];
  2300. while (!(data = iterator.next()).done) {
  2301. result.push(data.value);
  2302. }
  2303. return result;
  2304. }
  2305. /**
  2306. * Converts `map` to its key-value pairs.
  2307. *
  2308. * @private
  2309. * @param {Object} map The map to convert.
  2310. * @returns {Array} Returns the key-value pairs.
  2311. */
  2312. function mapToArray(map) {
  2313. var index = -1,
  2314. result = Array(map.size);
  2315. map.forEach(function(value, key) {
  2316. result[++index] = [key, value];
  2317. });
  2318. return result;
  2319. }
  2320. /**
  2321. * Creates a unary function that invokes `func` with its argument transformed.
  2322. *
  2323. * @private
  2324. * @param {Function} func The function to wrap.
  2325. * @param {Function} transform The argument transform.
  2326. * @returns {Function} Returns the new function.
  2327. */
  2328. function overArg(func, transform) {
  2329. return function(arg) {
  2330. return func(transform(arg));
  2331. };
  2332. }
  2333. /**
  2334. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2335. * and returns an array of their indexes.
  2336. *
  2337. * @private
  2338. * @param {Array} array The array to modify.
  2339. * @param {*} placeholder The placeholder to replace.
  2340. * @returns {Array} Returns the new array of placeholder indexes.
  2341. */
  2342. function replaceHolders(array, placeholder) {
  2343. var index = -1,
  2344. length = array.length,
  2345. resIndex = 0,
  2346. result = [];
  2347. while (++index < length) {
  2348. var value = array[index];
  2349. if (value === placeholder || value === PLACEHOLDER) {
  2350. array[index] = PLACEHOLDER;
  2351. result[resIndex++] = index;
  2352. }
  2353. }
  2354. return result;
  2355. }
  2356. /**
  2357. * Converts `set` to an array of its values.
  2358. *
  2359. * @private
  2360. * @param {Object} set The set to convert.
  2361. * @returns {Array} Returns the values.
  2362. */
  2363. function setToArray(set) {
  2364. var index = -1,
  2365. result = Array(set.size);
  2366. set.forEach(function(value) {
  2367. result[++index] = value;
  2368. });
  2369. return result;
  2370. }
  2371. /**
  2372. * Converts `set` to its value-value pairs.
  2373. *
  2374. * @private
  2375. * @param {Object} set The set to convert.
  2376. * @returns {Array} Returns the value-value pairs.
  2377. */
  2378. function setToPairs(set) {
  2379. var index = -1,
  2380. result = Array(set.size);
  2381. set.forEach(function(value) {
  2382. result[++index] = [value, value];
  2383. });
  2384. return result;
  2385. }
  2386. /**
  2387. * A specialized version of `_.indexOf` which performs strict equality
  2388. * comparisons of values, i.e. `===`.
  2389. *
  2390. * @private
  2391. * @param {Array} array The array to inspect.
  2392. * @param {*} value The value to search for.
  2393. * @param {number} fromIndex The index to search from.
  2394. * @returns {number} Returns the index of the matched value, else `-1`.
  2395. */
  2396. function strictIndexOf(array, value, fromIndex) {
  2397. var index = fromIndex - 1,
  2398. length = array.length;
  2399. while (++index < length) {
  2400. if (array[index] === value) {
  2401. return index;
  2402. }
  2403. }
  2404. return -1;
  2405. }
  2406. /**
  2407. * A specialized version of `_.lastIndexOf` which performs strict equality
  2408. * comparisons of values, i.e. `===`.
  2409. *
  2410. * @private
  2411. * @param {Array} array The array to inspect.
  2412. * @param {*} value The value to search for.
  2413. * @param {number} fromIndex The index to search from.
  2414. * @returns {number} Returns the index of the matched value, else `-1`.
  2415. */
  2416. function strictLastIndexOf(array, value, fromIndex) {
  2417. var index = fromIndex + 1;
  2418. while (index--) {
  2419. if (array[index] === value) {
  2420. return index;
  2421. }
  2422. }
  2423. return index;
  2424. }
  2425. /**
  2426. * Gets the number of symbols in `string`.
  2427. *
  2428. * @private
  2429. * @param {string} string The string to inspect.
  2430. * @returns {number} Returns the string size.
  2431. */
  2432. function stringSize(string) {
  2433. return hasUnicode(string)
  2434. ? unicodeSize(string)
  2435. : asciiSize(string);
  2436. }
  2437. /**
  2438. * Converts `string` to an array.
  2439. *
  2440. * @private
  2441. * @param {string} string The string to convert.
  2442. * @returns {Array} Returns the converted array.
  2443. */
  2444. function stringToArray(string) {
  2445. return hasUnicode(string)
  2446. ? unicodeToArray(string)
  2447. : asciiToArray(string);
  2448. }
  2449. /**
  2450. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2451. * character of `string`.
  2452. *
  2453. * @private
  2454. * @param {string} string The string to inspect.
  2455. * @returns {number} Returns the index of the last non-whitespace character.
  2456. */
  2457. function trimmedEndIndex(string) {
  2458. var index = string.length;
  2459. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2460. return index;
  2461. }
  2462. /**
  2463. * Used by `_.unescape` to convert HTML entities to characters.
  2464. *
  2465. * @private
  2466. * @param {string} chr The matched character to unescape.
  2467. * @returns {string} Returns the unescaped character.
  2468. */
  2469. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2470. /**
  2471. * Gets the size of a Unicode `string`.
  2472. *
  2473. * @private
  2474. * @param {string} string The string inspect.
  2475. * @returns {number} Returns the string size.
  2476. */
  2477. function unicodeSize(string) {
  2478. var result = reUnicode.lastIndex = 0;
  2479. while (reUnicode.test(string)) {
  2480. ++result;
  2481. }
  2482. return result;
  2483. }
  2484. /**
  2485. * Converts a Unicode `string` to an array.
  2486. *
  2487. * @private
  2488. * @param {string} string The string to convert.
  2489. * @returns {Array} Returns the converted array.
  2490. */
  2491. function unicodeToArray(string) {
  2492. return string.match(reUnicode) || [];
  2493. }
  2494. /**
  2495. * Splits a Unicode `string` into an array of its words.
  2496. *
  2497. * @private
  2498. * @param {string} The string to inspect.
  2499. * @returns {Array} Returns the words of `string`.
  2500. */
  2501. function unicodeWords(string) {
  2502. return string.match(reUnicodeWord) || [];
  2503. }
  2504. /*--------------------------------------------------------------------------*/
  2505. /**
  2506. * Create a new pristine `lodash` function using the `context` object.
  2507. *
  2508. * @static
  2509. * @memberOf _
  2510. * @since 1.1.0
  2511. * @category Util
  2512. * @param {Object} [context=root] The context object.
  2513. * @returns {Function} Returns a new `lodash` function.
  2514. * @example
  2515. *
  2516. * _.mixin({ 'foo': _.constant('foo') });
  2517. *
  2518. * var lodash = _.runInContext();
  2519. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2520. *
  2521. * _.isFunction(_.foo);
  2522. * // => true
  2523. * _.isFunction(_.bar);
  2524. * // => false
  2525. *
  2526. * lodash.isFunction(lodash.foo);
  2527. * // => false
  2528. * lodash.isFunction(lodash.bar);
  2529. * // => true
  2530. *
  2531. * // Create a suped-up `defer` in Node.js.
  2532. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2533. */
  2534. var runInContext = (function runInContext(context) {
  2535. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2536. /** Built-in constructor references. */
  2537. var Array = context.Array,
  2538. Date = context.Date,
  2539. Error = context.Error,
  2540. Function = context.Function,
  2541. Math = context.Math,
  2542. Object = context.Object,
  2543. RegExp = context.RegExp,
  2544. String = context.String,
  2545. TypeError = context.TypeError;
  2546. /** Used for built-in method references. */
  2547. var arrayProto = Array.prototype,
  2548. funcProto = Function.prototype,
  2549. objectProto = Object.prototype;
  2550. /** Used to detect overreaching core-js shims. */
  2551. var coreJsData = context['__core-js_shared__'];
  2552. /** Used to resolve the decompiled source of functions. */
  2553. var funcToString = funcProto.toString;
  2554. /** Used to check objects for own properties. */
  2555. var hasOwnProperty = objectProto.hasOwnProperty;
  2556. /** Used to generate unique IDs. */
  2557. var idCounter = 0;
  2558. /** Used to detect methods masquerading as native. */
  2559. var maskSrcKey = (function() {
  2560. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2561. return uid ? ('Symbol(src)_1.' + uid) : '';
  2562. }());
  2563. /**
  2564. * Used to resolve the
  2565. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2566. * of values.
  2567. */
  2568. var nativeObjectToString = objectProto.toString;
  2569. /** Used to infer the `Object` constructor. */
  2570. var objectCtorString = funcToString.call(Object);
  2571. /** Used to restore the original `_` reference in `_.noConflict`. */
  2572. var oldDash = root._;
  2573. /** Used to detect if a method is native. */
  2574. var reIsNative = RegExp('^' +
  2575. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2576. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2577. );
  2578. /** Built-in value references. */
  2579. var Buffer = moduleExports ? context.Buffer : undefined,
  2580. Symbol = context.Symbol,
  2581. Uint8Array = context.Uint8Array,
  2582. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2583. getPrototype = overArg(Object.getPrototypeOf, Object),
  2584. objectCreate = Object.create,
  2585. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2586. splice = arrayProto.splice,
  2587. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2588. symIterator = Symbol ? Symbol.iterator : undefined,
  2589. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2590. var defineProperty = (function() {
  2591. try {
  2592. var func = getNative(Object, 'defineProperty');
  2593. func({}, '', {});
  2594. return func;
  2595. } catch (e) {}
  2596. }());
  2597. /** Mocked built-ins. */
  2598. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2599. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2600. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2601. /* Built-in method references for those with the same name as other `lodash` methods. */
  2602. var nativeCeil = Math.ceil,
  2603. nativeFloor = Math.floor,
  2604. nativeGetSymbols = Object.getOwnPropertySymbols,
  2605. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2606. nativeIsFinite = context.isFinite,
  2607. nativeJoin = arrayProto.join,
  2608. nativeKeys = overArg(Object.keys, Object),
  2609. nativeMax = Math.max,
  2610. nativeMin = Math.min,
  2611. nativeNow = Date.now,
  2612. nativeParseInt = context.parseInt,
  2613. nativeRandom = Math.random,
  2614. nativeReverse = arrayProto.reverse;
  2615. /* Built-in method references that are verified to be native. */
  2616. var DataView = getNative(context, 'DataView'),
  2617. Map = getNative(context, 'Map'),
  2618. Promise = getNative(context, 'Promise'),
  2619. Set = getNative(context, 'Set'),
  2620. WeakMap = getNative(context, 'WeakMap'),
  2621. nativeCreate = getNative(Object, 'create');
  2622. /** Used to store function metadata. */
  2623. var metaMap = WeakMap && new WeakMap;
  2624. /** Used to lookup unminified function names. */
  2625. var realNames = {};
  2626. /** Used to detect maps, sets, and weakmaps. */
  2627. var dataViewCtorString = toSource(DataView),
  2628. mapCtorString = toSource(Map),
  2629. promiseCtorString = toSource(Promise),
  2630. setCtorString = toSource(Set),
  2631. weakMapCtorString = toSource(WeakMap);
  2632. /** Used to convert symbols to primitives and strings. */
  2633. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2634. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2635. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2636. /*------------------------------------------------------------------------*/
  2637. /**
  2638. * Creates a `lodash` object which wraps `value` to enable implicit method
  2639. * chain sequences. Methods that operate on and return arrays, collections,
  2640. * and functions can be chained together. Methods that retrieve a single value
  2641. * or may return a primitive value will automatically end the chain sequence
  2642. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2643. * with `_#value`.
  2644. *
  2645. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2646. * enabled using `_.chain`.
  2647. *
  2648. * The execution of chained methods is lazy, that is, it's deferred until
  2649. * `_#value` is implicitly or explicitly called.
  2650. *
  2651. * Lazy evaluation allows several methods to support shortcut fusion.
  2652. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2653. * the creation of intermediate arrays and can greatly reduce the number of
  2654. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2655. * fusion if the section is applied to an array and iteratees accept only
  2656. * one argument. The heuristic for whether a section qualifies for shortcut
  2657. * fusion is subject to change.
  2658. *
  2659. * Chaining is supported in custom builds as long as the `_#value` method is
  2660. * directly or indirectly included in the build.
  2661. *
  2662. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2663. *
  2664. * The wrapper `Array` methods are:
  2665. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2666. *
  2667. * The wrapper `String` methods are:
  2668. * `replace` and `split`
  2669. *
  2670. * The wrapper methods that support shortcut fusion are:
  2671. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2672. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2673. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2674. *
  2675. * The chainable wrapper methods are:
  2676. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2677. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2678. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2679. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2680. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2681. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2682. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2683. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2684. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2685. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2686. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2687. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2688. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2689. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2690. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2691. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2692. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2693. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2694. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2695. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2696. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2697. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2698. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2699. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2700. *
  2701. * The wrapper methods that are **not** chainable by default are:
  2702. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2703. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2704. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2705. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2706. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2707. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2708. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2709. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2710. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2711. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2712. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2713. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2714. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2715. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2716. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2717. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2718. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2719. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2720. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2721. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2722. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2723. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2724. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2725. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2726. * `upperFirst`, `value`, and `words`
  2727. *
  2728. * @name _
  2729. * @constructor
  2730. * @category Seq
  2731. * @param {*} value The value to wrap in a `lodash` instance.
  2732. * @returns {Object} Returns the new `lodash` wrapper instance.
  2733. * @example
  2734. *
  2735. * function square(n) {
  2736. * return n * n;
  2737. * }
  2738. *
  2739. * var wrapped = _([1, 2, 3]);
  2740. *
  2741. * // Returns an unwrapped value.
  2742. * wrapped.reduce(_.add);
  2743. * // => 6
  2744. *
  2745. * // Returns a wrapped value.
  2746. * var squares = wrapped.map(square);
  2747. *
  2748. * _.isArray(squares);
  2749. * // => false
  2750. *
  2751. * _.isArray(squares.value());
  2752. * // => true
  2753. */
  2754. function lodash(value) {
  2755. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2756. if (value instanceof LodashWrapper) {
  2757. return value;
  2758. }
  2759. if (hasOwnProperty.call(value, '__wrapped__')) {
  2760. return wrapperClone(value);
  2761. }
  2762. }
  2763. return new LodashWrapper(value);
  2764. }
  2765. /**
  2766. * The base implementation of `_.create` without support for assigning
  2767. * properties to the created object.
  2768. *
  2769. * @private
  2770. * @param {Object} proto The object to inherit from.
  2771. * @returns {Object} Returns the new object.
  2772. */
  2773. var baseCreate = (function() {
  2774. function object() {}
  2775. return function(proto) {
  2776. if (!isObject(proto)) {
  2777. return {};
  2778. }
  2779. if (objectCreate) {
  2780. return objectCreate(proto);
  2781. }
  2782. object.prototype = proto;
  2783. var result = new object;
  2784. object.prototype = undefined;
  2785. return result;
  2786. };
  2787. }());
  2788. /**
  2789. * The function whose prototype chain sequence wrappers inherit from.
  2790. *
  2791. * @private
  2792. */
  2793. function baseLodash() {
  2794. // No operation performed.
  2795. }
  2796. /**
  2797. * The base constructor for creating `lodash` wrapper objects.
  2798. *
  2799. * @private
  2800. * @param {*} value The value to wrap.
  2801. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2802. */
  2803. function LodashWrapper(value, chainAll) {
  2804. this.__wrapped__ = value;
  2805. this.__actions__ = [];
  2806. this.__chain__ = !!chainAll;
  2807. this.__index__ = 0;
  2808. this.__values__ = undefined;
  2809. }
  2810. /**
  2811. * By default, the template delimiters used by lodash are like those in
  2812. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2813. * following template settings to use alternative delimiters.
  2814. *
  2815. * @static
  2816. * @memberOf _
  2817. * @type {Object}
  2818. */
  2819. lodash.templateSettings = {
  2820. /**
  2821. * Used to detect `data` property values to be HTML-escaped.
  2822. *
  2823. * @memberOf _.templateSettings
  2824. * @type {RegExp}
  2825. */
  2826. 'escape': reEscape,
  2827. /**
  2828. * Used to detect code to be evaluated.
  2829. *
  2830. * @memberOf _.templateSettings
  2831. * @type {RegExp}
  2832. */
  2833. 'evaluate': reEvaluate,
  2834. /**
  2835. * Used to detect `data` property values to inject.
  2836. *
  2837. * @memberOf _.templateSettings
  2838. * @type {RegExp}
  2839. */
  2840. 'interpolate': reInterpolate,
  2841. /**
  2842. * Used to reference the data object in the template text.
  2843. *
  2844. * @memberOf _.templateSettings
  2845. * @type {string}
  2846. */
  2847. 'variable': '',
  2848. /**
  2849. * Used to import variables into the compiled template.
  2850. *
  2851. * @memberOf _.templateSettings
  2852. * @type {Object}
  2853. */
  2854. 'imports': {
  2855. /**
  2856. * A reference to the `lodash` function.
  2857. *
  2858. * @memberOf _.templateSettings.imports
  2859. * @type {Function}
  2860. */
  2861. '_': lodash
  2862. }
  2863. };
  2864. // Ensure wrappers are instances of `baseLodash`.
  2865. lodash.prototype = baseLodash.prototype;
  2866. lodash.prototype.constructor = lodash;
  2867. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2868. LodashWrapper.prototype.constructor = LodashWrapper;
  2869. /*------------------------------------------------------------------------*/
  2870. /**
  2871. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2872. *
  2873. * @private
  2874. * @constructor
  2875. * @param {*} value The value to wrap.
  2876. */
  2877. function LazyWrapper(value) {
  2878. this.__wrapped__ = value;
  2879. this.__actions__ = [];
  2880. this.__dir__ = 1;
  2881. this.__filtered__ = false;
  2882. this.__iteratees__ = [];
  2883. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2884. this.__views__ = [];
  2885. }
  2886. /**
  2887. * Creates a clone of the lazy wrapper object.
  2888. *
  2889. * @private
  2890. * @name clone
  2891. * @memberOf LazyWrapper
  2892. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2893. */
  2894. function lazyClone() {
  2895. var result = new LazyWrapper(this.__wrapped__);
  2896. result.__actions__ = copyArray(this.__actions__);
  2897. result.__dir__ = this.__dir__;
  2898. result.__filtered__ = this.__filtered__;
  2899. result.__iteratees__ = copyArray(this.__iteratees__);
  2900. result.__takeCount__ = this.__takeCount__;
  2901. result.__views__ = copyArray(this.__views__);
  2902. return result;
  2903. }
  2904. /**
  2905. * Reverses the direction of lazy iteration.
  2906. *
  2907. * @private
  2908. * @name reverse
  2909. * @memberOf LazyWrapper
  2910. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2911. */
  2912. function lazyReverse() {
  2913. if (this.__filtered__) {
  2914. var result = new LazyWrapper(this);
  2915. result.__dir__ = -1;
  2916. result.__filtered__ = true;
  2917. } else {
  2918. result = this.clone();
  2919. result.__dir__ *= -1;
  2920. }
  2921. return result;
  2922. }
  2923. /**
  2924. * Extracts the unwrapped value from its lazy wrapper.
  2925. *
  2926. * @private
  2927. * @name value
  2928. * @memberOf LazyWrapper
  2929. * @returns {*} Returns the unwrapped value.
  2930. */
  2931. function lazyValue() {
  2932. var array = this.__wrapped__.value(),
  2933. dir = this.__dir__,
  2934. isArr = isArray(array),
  2935. isRight = dir < 0,
  2936. arrLength = isArr ? array.length : 0,
  2937. view = getView(0, arrLength, this.__views__),
  2938. start = view.start,
  2939. end = view.end,
  2940. length = end - start,
  2941. index = isRight ? end : (start - 1),
  2942. iteratees = this.__iteratees__,
  2943. iterLength = iteratees.length,
  2944. resIndex = 0,
  2945. takeCount = nativeMin(length, this.__takeCount__);
  2946. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2947. return baseWrapperValue(array, this.__actions__);
  2948. }
  2949. var result = [];
  2950. outer:
  2951. while (length-- && resIndex < takeCount) {
  2952. index += dir;
  2953. var iterIndex = -1,
  2954. value = array[index];
  2955. while (++iterIndex < iterLength) {
  2956. var data = iteratees[iterIndex],
  2957. iteratee = data.iteratee,
  2958. type = data.type,
  2959. computed = iteratee(value);
  2960. if (type == LAZY_MAP_FLAG) {
  2961. value = computed;
  2962. } else if (!computed) {
  2963. if (type == LAZY_FILTER_FLAG) {
  2964. continue outer;
  2965. } else {
  2966. break outer;
  2967. }
  2968. }
  2969. }
  2970. result[resIndex++] = value;
  2971. }
  2972. return result;
  2973. }
  2974. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2975. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2976. LazyWrapper.prototype.constructor = LazyWrapper;
  2977. /*------------------------------------------------------------------------*/
  2978. /**
  2979. * Creates a hash object.
  2980. *
  2981. * @private
  2982. * @constructor
  2983. * @param {Array} [entries] The key-value pairs to cache.
  2984. */
  2985. function Hash(entries) {
  2986. var index = -1,
  2987. length = entries == null ? 0 : entries.length;
  2988. this.clear();
  2989. while (++index < length) {
  2990. var entry = entries[index];
  2991. this.set(entry[0], entry[1]);
  2992. }
  2993. }
  2994. /**
  2995. * Removes all key-value entries from the hash.
  2996. *
  2997. * @private
  2998. * @name clear
  2999. * @memberOf Hash
  3000. */
  3001. function hashClear() {
  3002. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3003. this.size = 0;
  3004. }
  3005. /**
  3006. * Removes `key` and its value from the hash.
  3007. *
  3008. * @private
  3009. * @name delete
  3010. * @memberOf Hash
  3011. * @param {Object} hash The hash to modify.
  3012. * @param {string} key The key of the value to remove.
  3013. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3014. */
  3015. function hashDelete(key) {
  3016. var result = this.has(key) && delete this.__data__[key];
  3017. this.size -= result ? 1 : 0;
  3018. return result;
  3019. }
  3020. /**
  3021. * Gets the hash value for `key`.
  3022. *
  3023. * @private
  3024. * @name get
  3025. * @memberOf Hash
  3026. * @param {string} key The key of the value to get.
  3027. * @returns {*} Returns the entry value.
  3028. */
  3029. function hashGet(key) {
  3030. var data = this.__data__;
  3031. if (nativeCreate) {
  3032. var result = data[key];
  3033. return result === HASH_UNDEFINED ? undefined : result;
  3034. }
  3035. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3036. }
  3037. /**
  3038. * Checks if a hash value for `key` exists.
  3039. *
  3040. * @private
  3041. * @name has
  3042. * @memberOf Hash
  3043. * @param {string} key The key of the entry to check.
  3044. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3045. */
  3046. function hashHas(key) {
  3047. var data = this.__data__;
  3048. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3049. }
  3050. /**
  3051. * Sets the hash `key` to `value`.
  3052. *
  3053. * @private
  3054. * @name set
  3055. * @memberOf Hash
  3056. * @param {string} key The key of the value to set.
  3057. * @param {*} value The value to set.
  3058. * @returns {Object} Returns the hash instance.
  3059. */
  3060. function hashSet(key, value) {
  3061. var data = this.__data__;
  3062. this.size += this.has(key) ? 0 : 1;
  3063. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3064. return this;
  3065. }
  3066. // Add methods to `Hash`.
  3067. Hash.prototype.clear = hashClear;
  3068. Hash.prototype['delete'] = hashDelete;
  3069. Hash.prototype.get = hashGet;
  3070. Hash.prototype.has = hashHas;
  3071. Hash.prototype.set = hashSet;
  3072. /*------------------------------------------------------------------------*/
  3073. /**
  3074. * Creates an list cache object.
  3075. *
  3076. * @private
  3077. * @constructor
  3078. * @param {Array} [entries] The key-value pairs to cache.
  3079. */
  3080. function ListCache(entries) {
  3081. var index = -1,
  3082. length = entries == null ? 0 : entries.length;
  3083. this.clear();
  3084. while (++index < length) {
  3085. var entry = entries[index];
  3086. this.set(entry[0], entry[1]);
  3087. }
  3088. }
  3089. /**
  3090. * Removes all key-value entries from the list cache.
  3091. *
  3092. * @private
  3093. * @name clear
  3094. * @memberOf ListCache
  3095. */
  3096. function listCacheClear() {
  3097. this.__data__ = [];
  3098. this.size = 0;
  3099. }
  3100. /**
  3101. * Removes `key` and its value from the list cache.
  3102. *
  3103. * @private
  3104. * @name delete
  3105. * @memberOf ListCache
  3106. * @param {string} key The key of the value to remove.
  3107. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3108. */
  3109. function listCacheDelete(key) {
  3110. var data = this.__data__,
  3111. index = assocIndexOf(data, key);
  3112. if (index < 0) {
  3113. return false;
  3114. }
  3115. var lastIndex = data.length - 1;
  3116. if (index == lastIndex) {
  3117. data.pop();
  3118. } else {
  3119. splice.call(data, index, 1);
  3120. }
  3121. --this.size;
  3122. return true;
  3123. }
  3124. /**
  3125. * Gets the list cache value for `key`.
  3126. *
  3127. * @private
  3128. * @name get
  3129. * @memberOf ListCache
  3130. * @param {string} key The key of the value to get.
  3131. * @returns {*} Returns the entry value.
  3132. */
  3133. function listCacheGet(key) {
  3134. var data = this.__data__,
  3135. index = assocIndexOf(data, key);
  3136. return index < 0 ? undefined : data[index][1];
  3137. }
  3138. /**
  3139. * Checks if a list cache value for `key` exists.
  3140. *
  3141. * @private
  3142. * @name has
  3143. * @memberOf ListCache
  3144. * @param {string} key The key of the entry to check.
  3145. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3146. */
  3147. function listCacheHas(key) {
  3148. return assocIndexOf(this.__data__, key) > -1;
  3149. }
  3150. /**
  3151. * Sets the list cache `key` to `value`.
  3152. *
  3153. * @private
  3154. * @name set
  3155. * @memberOf ListCache
  3156. * @param {string} key The key of the value to set.
  3157. * @param {*} value The value to set.
  3158. * @returns {Object} Returns the list cache instance.
  3159. */
  3160. function listCacheSet(key, value) {
  3161. var data = this.__data__,
  3162. index = assocIndexOf(data, key);
  3163. if (index < 0) {
  3164. ++this.size;
  3165. data.push([key, value]);
  3166. } else {
  3167. data[index][1] = value;
  3168. }
  3169. return this;
  3170. }
  3171. // Add methods to `ListCache`.
  3172. ListCache.prototype.clear = listCacheClear;
  3173. ListCache.prototype['delete'] = listCacheDelete;
  3174. ListCache.prototype.get = listCacheGet;
  3175. ListCache.prototype.has = listCacheHas;
  3176. ListCache.prototype.set = listCacheSet;
  3177. /*------------------------------------------------------------------------*/
  3178. /**
  3179. * Creates a map cache object to store key-value pairs.
  3180. *
  3181. * @private
  3182. * @constructor
  3183. * @param {Array} [entries] The key-value pairs to cache.
  3184. */
  3185. function MapCache(entries) {
  3186. var index = -1,
  3187. length = entries == null ? 0 : entries.length;
  3188. this.clear();
  3189. while (++index < length) {
  3190. var entry = entries[index];
  3191. this.set(entry[0], entry[1]);
  3192. }
  3193. }
  3194. /**
  3195. * Removes all key-value entries from the map.
  3196. *
  3197. * @private
  3198. * @name clear
  3199. * @memberOf MapCache
  3200. */
  3201. function mapCacheClear() {
  3202. this.size = 0;
  3203. this.__data__ = {
  3204. 'hash': new Hash,
  3205. 'map': new (Map || ListCache),
  3206. 'string': new Hash
  3207. };
  3208. }
  3209. /**
  3210. * Removes `key` and its value from the map.
  3211. *
  3212. * @private
  3213. * @name delete
  3214. * @memberOf MapCache
  3215. * @param {string} key The key of the value to remove.
  3216. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3217. */
  3218. function mapCacheDelete(key) {
  3219. var result = getMapData(this, key)['delete'](key);
  3220. this.size -= result ? 1 : 0;
  3221. return result;
  3222. }
  3223. /**
  3224. * Gets the map value for `key`.
  3225. *
  3226. * @private
  3227. * @name get
  3228. * @memberOf MapCache
  3229. * @param {string} key The key of the value to get.
  3230. * @returns {*} Returns the entry value.
  3231. */
  3232. function mapCacheGet(key) {
  3233. return getMapData(this, key).get(key);
  3234. }
  3235. /**
  3236. * Checks if a map value for `key` exists.
  3237. *
  3238. * @private
  3239. * @name has
  3240. * @memberOf MapCache
  3241. * @param {string} key The key of the entry to check.
  3242. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3243. */
  3244. function mapCacheHas(key) {
  3245. return getMapData(this, key).has(key);
  3246. }
  3247. /**
  3248. * Sets the map `key` to `value`.
  3249. *
  3250. * @private
  3251. * @name set
  3252. * @memberOf MapCache
  3253. * @param {string} key The key of the value to set.
  3254. * @param {*} value The value to set.
  3255. * @returns {Object} Returns the map cache instance.
  3256. */
  3257. function mapCacheSet(key, value) {
  3258. var data = getMapData(this, key),
  3259. size = data.size;
  3260. data.set(key, value);
  3261. this.size += data.size == size ? 0 : 1;
  3262. return this;
  3263. }
  3264. // Add methods to `MapCache`.
  3265. MapCache.prototype.clear = mapCacheClear;
  3266. MapCache.prototype['delete'] = mapCacheDelete;
  3267. MapCache.prototype.get = mapCacheGet;
  3268. MapCache.prototype.has = mapCacheHas;
  3269. MapCache.prototype.set = mapCacheSet;
  3270. /*------------------------------------------------------------------------*/
  3271. /**
  3272. *
  3273. * Creates an array cache object to store unique values.
  3274. *
  3275. * @private
  3276. * @constructor
  3277. * @param {Array} [values] The values to cache.
  3278. */
  3279. function SetCache(values) {
  3280. var index = -1,
  3281. length = values == null ? 0 : values.length;
  3282. this.__data__ = new MapCache;
  3283. while (++index < length) {
  3284. this.add(values[index]);
  3285. }
  3286. }
  3287. /**
  3288. * Adds `value` to the array cache.
  3289. *
  3290. * @private
  3291. * @name add
  3292. * @memberOf SetCache
  3293. * @alias push
  3294. * @param {*} value The value to cache.
  3295. * @returns {Object} Returns the cache instance.
  3296. */
  3297. function setCacheAdd(value) {
  3298. this.__data__.set(value, HASH_UNDEFINED);
  3299. return this;
  3300. }
  3301. /**
  3302. * Checks if `value` is in the array cache.
  3303. *
  3304. * @private
  3305. * @name has
  3306. * @memberOf SetCache
  3307. * @param {*} value The value to search for.
  3308. * @returns {number} Returns `true` if `value` is found, else `false`.
  3309. */
  3310. function setCacheHas(value) {
  3311. return this.__data__.has(value);
  3312. }
  3313. // Add methods to `SetCache`.
  3314. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3315. SetCache.prototype.has = setCacheHas;
  3316. /*------------------------------------------------------------------------*/
  3317. /**
  3318. * Creates a stack cache object to store key-value pairs.
  3319. *
  3320. * @private
  3321. * @constructor
  3322. * @param {Array} [entries] The key-value pairs to cache.
  3323. */
  3324. function Stack(entries) {
  3325. var data = this.__data__ = new ListCache(entries);
  3326. this.size = data.size;
  3327. }
  3328. /**
  3329. * Removes all key-value entries from the stack.
  3330. *
  3331. * @private
  3332. * @name clear
  3333. * @memberOf Stack
  3334. */
  3335. function stackClear() {
  3336. this.__data__ = new ListCache;
  3337. this.size = 0;
  3338. }
  3339. /**
  3340. * Removes `key` and its value from the stack.
  3341. *
  3342. * @private
  3343. * @name delete
  3344. * @memberOf Stack
  3345. * @param {string} key The key of the value to remove.
  3346. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3347. */
  3348. function stackDelete(key) {
  3349. var data = this.__data__,
  3350. result = data['delete'](key);
  3351. this.size = data.size;
  3352. return result;
  3353. }
  3354. /**
  3355. * Gets the stack value for `key`.
  3356. *
  3357. * @private
  3358. * @name get
  3359. * @memberOf Stack
  3360. * @param {string} key The key of the value to get.
  3361. * @returns {*} Returns the entry value.
  3362. */
  3363. function stackGet(key) {
  3364. return this.__data__.get(key);
  3365. }
  3366. /**
  3367. * Checks if a stack value for `key` exists.
  3368. *
  3369. * @private
  3370. * @name has
  3371. * @memberOf Stack
  3372. * @param {string} key The key of the entry to check.
  3373. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3374. */
  3375. function stackHas(key) {
  3376. return this.__data__.has(key);
  3377. }
  3378. /**
  3379. * Sets the stack `key` to `value`.
  3380. *
  3381. * @private
  3382. * @name set
  3383. * @memberOf Stack
  3384. * @param {string} key The key of the value to set.
  3385. * @param {*} value The value to set.
  3386. * @returns {Object} Returns the stack cache instance.
  3387. */
  3388. function stackSet(key, value) {
  3389. var data = this.__data__;
  3390. if (data instanceof ListCache) {
  3391. var pairs = data.__data__;
  3392. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3393. pairs.push([key, value]);
  3394. this.size = ++data.size;
  3395. return this;
  3396. }
  3397. data = this.__data__ = new MapCache(pairs);
  3398. }
  3399. data.set(key, value);
  3400. this.size = data.size;
  3401. return this;
  3402. }
  3403. // Add methods to `Stack`.
  3404. Stack.prototype.clear = stackClear;
  3405. Stack.prototype['delete'] = stackDelete;
  3406. Stack.prototype.get = stackGet;
  3407. Stack.prototype.has = stackHas;
  3408. Stack.prototype.set = stackSet;
  3409. /*------------------------------------------------------------------------*/
  3410. /**
  3411. * Creates an array of the enumerable property names of the array-like `value`.
  3412. *
  3413. * @private
  3414. * @param {*} value The value to query.
  3415. * @param {boolean} inherited Specify returning inherited property names.
  3416. * @returns {Array} Returns the array of property names.
  3417. */
  3418. function arrayLikeKeys(value, inherited) {
  3419. var isArr = isArray(value),
  3420. isArg = !isArr && isArguments(value),
  3421. isBuff = !isArr && !isArg && isBuffer(value),
  3422. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3423. skipIndexes = isArr || isArg || isBuff || isType,
  3424. result = skipIndexes ? baseTimes(value.length, String) : [],
  3425. length = result.length;
  3426. for (var key in value) {
  3427. if ((inherited || hasOwnProperty.call(value, key)) &&
  3428. !(skipIndexes && (
  3429. // Safari 9 has enumerable `arguments.length` in strict mode.
  3430. key == 'length' ||
  3431. // Node.js 0.10 has enumerable non-index properties on buffers.
  3432. (isBuff && (key == 'offset' || key == 'parent')) ||
  3433. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3434. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3435. // Skip index properties.
  3436. isIndex(key, length)
  3437. ))) {
  3438. result.push(key);
  3439. }
  3440. }
  3441. return result;
  3442. }
  3443. /**
  3444. * A specialized version of `_.sample` for arrays.
  3445. *
  3446. * @private
  3447. * @param {Array} array The array to sample.
  3448. * @returns {*} Returns the random element.
  3449. */
  3450. function arraySample(array) {
  3451. var length = array.length;
  3452. return length ? array[baseRandom(0, length - 1)] : undefined;
  3453. }
  3454. /**
  3455. * A specialized version of `_.sampleSize` for arrays.
  3456. *
  3457. * @private
  3458. * @param {Array} array The array to sample.
  3459. * @param {number} n The number of elements to sample.
  3460. * @returns {Array} Returns the random elements.
  3461. */
  3462. function arraySampleSize(array, n) {
  3463. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3464. }
  3465. /**
  3466. * A specialized version of `_.shuffle` for arrays.
  3467. *
  3468. * @private
  3469. * @param {Array} array The array to shuffle.
  3470. * @returns {Array} Returns the new shuffled array.
  3471. */
  3472. function arrayShuffle(array) {
  3473. return shuffleSelf(copyArray(array));
  3474. }
  3475. /**
  3476. * This function is like `assignValue` except that it doesn't assign
  3477. * `undefined` values.
  3478. *
  3479. * @private
  3480. * @param {Object} object The object to modify.
  3481. * @param {string} key The key of the property to assign.
  3482. * @param {*} value The value to assign.
  3483. */
  3484. function assignMergeValue(object, key, value) {
  3485. if ((value !== undefined && !eq(object[key], value)) ||
  3486. (value === undefined && !(key in object))) {
  3487. baseAssignValue(object, key, value);
  3488. }
  3489. }
  3490. /**
  3491. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3492. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3493. * for equality comparisons.
  3494. *
  3495. * @private
  3496. * @param {Object} object The object to modify.
  3497. * @param {string} key The key of the property to assign.
  3498. * @param {*} value The value to assign.
  3499. */
  3500. function assignValue(object, key, value) {
  3501. var objValue = object[key];
  3502. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3503. (value === undefined && !(key in object))) {
  3504. baseAssignValue(object, key, value);
  3505. }
  3506. }
  3507. /**
  3508. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3509. *
  3510. * @private
  3511. * @param {Array} array The array to inspect.
  3512. * @param {*} key The key to search for.
  3513. * @returns {number} Returns the index of the matched value, else `-1`.
  3514. */
  3515. function assocIndexOf(array, key) {
  3516. var length = array.length;
  3517. while (length--) {
  3518. if (eq(array[length][0], key)) {
  3519. return length;
  3520. }
  3521. }
  3522. return -1;
  3523. }
  3524. /**
  3525. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3526. * by `iteratee` and values set by `setter`.
  3527. *
  3528. * @private
  3529. * @param {Array|Object} collection The collection to iterate over.
  3530. * @param {Function} setter The function to set `accumulator` values.
  3531. * @param {Function} iteratee The iteratee to transform keys.
  3532. * @param {Object} accumulator The initial aggregated object.
  3533. * @returns {Function} Returns `accumulator`.
  3534. */
  3535. function baseAggregator(collection, setter, iteratee, accumulator) {
  3536. baseEach(collection, function(value, key, collection) {
  3537. setter(accumulator, value, iteratee(value), collection);
  3538. });
  3539. return accumulator;
  3540. }
  3541. /**
  3542. * The base implementation of `_.assign` without support for multiple sources
  3543. * or `customizer` functions.
  3544. *
  3545. * @private
  3546. * @param {Object} object The destination object.
  3547. * @param {Object} source The source object.
  3548. * @returns {Object} Returns `object`.
  3549. */
  3550. function baseAssign(object, source) {
  3551. return object && copyObject(source, keys(source), object);
  3552. }
  3553. /**
  3554. * The base implementation of `_.assignIn` without support for multiple sources
  3555. * or `customizer` functions.
  3556. *
  3557. * @private
  3558. * @param {Object} object The destination object.
  3559. * @param {Object} source The source object.
  3560. * @returns {Object} Returns `object`.
  3561. */
  3562. function baseAssignIn(object, source) {
  3563. return object && copyObject(source, keysIn(source), object);
  3564. }
  3565. /**
  3566. * The base implementation of `assignValue` and `assignMergeValue` without
  3567. * value checks.
  3568. *
  3569. * @private
  3570. * @param {Object} object The object to modify.
  3571. * @param {string} key The key of the property to assign.
  3572. * @param {*} value The value to assign.
  3573. */
  3574. function baseAssignValue(object, key, value) {
  3575. if (key == '__proto__' && defineProperty) {
  3576. defineProperty(object, key, {
  3577. 'configurable': true,
  3578. 'enumerable': true,
  3579. 'value': value,
  3580. 'writable': true
  3581. });
  3582. } else {
  3583. object[key] = value;
  3584. }
  3585. }
  3586. /**
  3587. * The base implementation of `_.at` without support for individual paths.
  3588. *
  3589. * @private
  3590. * @param {Object} object The object to iterate over.
  3591. * @param {string[]} paths The property paths to pick.
  3592. * @returns {Array} Returns the picked elements.
  3593. */
  3594. function baseAt(object, paths) {
  3595. var index = -1,
  3596. length = paths.length,
  3597. result = Array(length),
  3598. skip = object == null;
  3599. while (++index < length) {
  3600. result[index] = skip ? undefined : get(object, paths[index]);
  3601. }
  3602. return result;
  3603. }
  3604. /**
  3605. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3606. *
  3607. * @private
  3608. * @param {number} number The number to clamp.
  3609. * @param {number} [lower] The lower bound.
  3610. * @param {number} upper The upper bound.
  3611. * @returns {number} Returns the clamped number.
  3612. */
  3613. function baseClamp(number, lower, upper) {
  3614. if (number === number) {
  3615. if (upper !== undefined) {
  3616. number = number <= upper ? number : upper;
  3617. }
  3618. if (lower !== undefined) {
  3619. number = number >= lower ? number : lower;
  3620. }
  3621. }
  3622. return number;
  3623. }
  3624. /**
  3625. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3626. * traversed objects.
  3627. *
  3628. * @private
  3629. * @param {*} value The value to clone.
  3630. * @param {boolean} bitmask The bitmask flags.
  3631. * 1 - Deep clone
  3632. * 2 - Flatten inherited properties
  3633. * 4 - Clone symbols
  3634. * @param {Function} [customizer] The function to customize cloning.
  3635. * @param {string} [key] The key of `value`.
  3636. * @param {Object} [object] The parent object of `value`.
  3637. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3638. * @returns {*} Returns the cloned value.
  3639. */
  3640. function baseClone(value, bitmask, customizer, key, object, stack) {
  3641. var result,
  3642. isDeep = bitmask & CLONE_DEEP_FLAG,
  3643. isFlat = bitmask & CLONE_FLAT_FLAG,
  3644. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3645. if (customizer) {
  3646. result = object ? customizer(value, key, object, stack) : customizer(value);
  3647. }
  3648. if (result !== undefined) {
  3649. return result;
  3650. }
  3651. if (!isObject(value)) {
  3652. return value;
  3653. }
  3654. var isArr = isArray(value);
  3655. if (isArr) {
  3656. result = initCloneArray(value);
  3657. if (!isDeep) {
  3658. return copyArray(value, result);
  3659. }
  3660. } else {
  3661. var tag = getTag(value),
  3662. isFunc = tag == funcTag || tag == genTag;
  3663. if (isBuffer(value)) {
  3664. return cloneBuffer(value, isDeep);
  3665. }
  3666. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3667. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3668. if (!isDeep) {
  3669. return isFlat
  3670. ? copySymbolsIn(value, baseAssignIn(result, value))
  3671. : copySymbols(value, baseAssign(result, value));
  3672. }
  3673. } else {
  3674. if (!cloneableTags[tag]) {
  3675. return object ? value : {};
  3676. }
  3677. result = initCloneByTag(value, tag, isDeep);
  3678. }
  3679. }
  3680. // Check for circular references and return its corresponding clone.
  3681. stack || (stack = new Stack);
  3682. var stacked = stack.get(value);
  3683. if (stacked) {
  3684. return stacked;
  3685. }
  3686. stack.set(value, result);
  3687. if (isSet(value)) {
  3688. value.forEach(function(subValue) {
  3689. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3690. });
  3691. } else if (isMap(value)) {
  3692. value.forEach(function(subValue, key) {
  3693. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3694. });
  3695. }
  3696. var keysFunc = isFull
  3697. ? (isFlat ? getAllKeysIn : getAllKeys)
  3698. : (isFlat ? keysIn : keys);
  3699. var props = isArr ? undefined : keysFunc(value);
  3700. arrayEach(props || value, function(subValue, key) {
  3701. if (props) {
  3702. key = subValue;
  3703. subValue = value[key];
  3704. }
  3705. // Recursively populate clone (susceptible to call stack limits).
  3706. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3707. });
  3708. return result;
  3709. }
  3710. /**
  3711. * The base implementation of `_.conforms` which doesn't clone `source`.
  3712. *
  3713. * @private
  3714. * @param {Object} source The object of property predicates to conform to.
  3715. * @returns {Function} Returns the new spec function.
  3716. */
  3717. function baseConforms(source) {
  3718. var props = keys(source);
  3719. return function(object) {
  3720. return baseConformsTo(object, source, props);
  3721. };
  3722. }
  3723. /**
  3724. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3725. *
  3726. * @private
  3727. * @param {Object} object The object to inspect.
  3728. * @param {Object} source The object of property predicates to conform to.
  3729. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3730. */
  3731. function baseConformsTo(object, source, props) {
  3732. var length = props.length;
  3733. if (object == null) {
  3734. return !length;
  3735. }
  3736. object = Object(object);
  3737. while (length--) {
  3738. var key = props[length],
  3739. predicate = source[key],
  3740. value = object[key];
  3741. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3742. return false;
  3743. }
  3744. }
  3745. return true;
  3746. }
  3747. /**
  3748. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3749. * to provide to `func`.
  3750. *
  3751. * @private
  3752. * @param {Function} func The function to delay.
  3753. * @param {number} wait The number of milliseconds to delay invocation.
  3754. * @param {Array} args The arguments to provide to `func`.
  3755. * @returns {number|Object} Returns the timer id or timeout object.
  3756. */
  3757. function baseDelay(func, wait, args) {
  3758. if (typeof func != 'function') {
  3759. throw new TypeError(FUNC_ERROR_TEXT);
  3760. }
  3761. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3762. }
  3763. /**
  3764. * The base implementation of methods like `_.difference` without support
  3765. * for excluding multiple arrays or iteratee shorthands.
  3766. *
  3767. * @private
  3768. * @param {Array} array The array to inspect.
  3769. * @param {Array} values The values to exclude.
  3770. * @param {Function} [iteratee] The iteratee invoked per element.
  3771. * @param {Function} [comparator] The comparator invoked per element.
  3772. * @returns {Array} Returns the new array of filtered values.
  3773. */
  3774. function baseDifference(array, values, iteratee, comparator) {
  3775. var index = -1,
  3776. includes = arrayIncludes,
  3777. isCommon = true,
  3778. length = array.length,
  3779. result = [],
  3780. valuesLength = values.length;
  3781. if (!length) {
  3782. return result;
  3783. }
  3784. if (iteratee) {
  3785. values = arrayMap(values, baseUnary(iteratee));
  3786. }
  3787. if (comparator) {
  3788. includes = arrayIncludesWith;
  3789. isCommon = false;
  3790. }
  3791. else if (values.length >= LARGE_ARRAY_SIZE) {
  3792. includes = cacheHas;
  3793. isCommon = false;
  3794. values = new SetCache(values);
  3795. }
  3796. outer:
  3797. while (++index < length) {
  3798. var value = array[index],
  3799. computed = iteratee == null ? value : iteratee(value);
  3800. value = (comparator || value !== 0) ? value : 0;
  3801. if (isCommon && computed === computed) {
  3802. var valuesIndex = valuesLength;
  3803. while (valuesIndex--) {
  3804. if (values[valuesIndex] === computed) {
  3805. continue outer;
  3806. }
  3807. }
  3808. result.push(value);
  3809. }
  3810. else if (!includes(values, computed, comparator)) {
  3811. result.push(value);
  3812. }
  3813. }
  3814. return result;
  3815. }
  3816. /**
  3817. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3818. *
  3819. * @private
  3820. * @param {Array|Object} collection The collection to iterate over.
  3821. * @param {Function} iteratee The function invoked per iteration.
  3822. * @returns {Array|Object} Returns `collection`.
  3823. */
  3824. var baseEach = createBaseEach(baseForOwn);
  3825. /**
  3826. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3827. *
  3828. * @private
  3829. * @param {Array|Object} collection The collection to iterate over.
  3830. * @param {Function} iteratee The function invoked per iteration.
  3831. * @returns {Array|Object} Returns `collection`.
  3832. */
  3833. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3834. /**
  3835. * The base implementation of `_.every` without support for iteratee shorthands.
  3836. *
  3837. * @private
  3838. * @param {Array|Object} collection The collection to iterate over.
  3839. * @param {Function} predicate The function invoked per iteration.
  3840. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3841. * else `false`
  3842. */
  3843. function baseEvery(collection, predicate) {
  3844. var result = true;
  3845. baseEach(collection, function(value, index, collection) {
  3846. result = !!predicate(value, index, collection);
  3847. return result;
  3848. });
  3849. return result;
  3850. }
  3851. /**
  3852. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3853. * `comparator` to determine the extremum value.
  3854. *
  3855. * @private
  3856. * @param {Array} array The array to iterate over.
  3857. * @param {Function} iteratee The iteratee invoked per iteration.
  3858. * @param {Function} comparator The comparator used to compare values.
  3859. * @returns {*} Returns the extremum value.
  3860. */
  3861. function baseExtremum(array, iteratee, comparator) {
  3862. var index = -1,
  3863. length = array.length;
  3864. while (++index < length) {
  3865. var value = array[index],
  3866. current = iteratee(value);
  3867. if (current != null && (computed === undefined
  3868. ? (current === current && !isSymbol(current))
  3869. : comparator(current, computed)
  3870. )) {
  3871. var computed = current,
  3872. result = value;
  3873. }
  3874. }
  3875. return result;
  3876. }
  3877. /**
  3878. * The base implementation of `_.fill` without an iteratee call guard.
  3879. *
  3880. * @private
  3881. * @param {Array} array The array to fill.
  3882. * @param {*} value The value to fill `array` with.
  3883. * @param {number} [start=0] The start position.
  3884. * @param {number} [end=array.length] The end position.
  3885. * @returns {Array} Returns `array`.
  3886. */
  3887. function baseFill(array, value, start, end) {
  3888. var length = array.length;
  3889. start = toInteger(start);
  3890. if (start < 0) {
  3891. start = -start > length ? 0 : (length + start);
  3892. }
  3893. end = (end === undefined || end > length) ? length : toInteger(end);
  3894. if (end < 0) {
  3895. end += length;
  3896. }
  3897. end = start > end ? 0 : toLength(end);
  3898. while (start < end) {
  3899. array[start++] = value;
  3900. }
  3901. return array;
  3902. }
  3903. /**
  3904. * The base implementation of `_.filter` without support for iteratee shorthands.
  3905. *
  3906. * @private
  3907. * @param {Array|Object} collection The collection to iterate over.
  3908. * @param {Function} predicate The function invoked per iteration.
  3909. * @returns {Array} Returns the new filtered array.
  3910. */
  3911. function baseFilter(collection, predicate) {
  3912. var result = [];
  3913. baseEach(collection, function(value, index, collection) {
  3914. if (predicate(value, index, collection)) {
  3915. result.push(value);
  3916. }
  3917. });
  3918. return result;
  3919. }
  3920. /**
  3921. * The base implementation of `_.flatten` with support for restricting flattening.
  3922. *
  3923. * @private
  3924. * @param {Array} array The array to flatten.
  3925. * @param {number} depth The maximum recursion depth.
  3926. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3927. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3928. * @param {Array} [result=[]] The initial result value.
  3929. * @returns {Array} Returns the new flattened array.
  3930. */
  3931. function baseFlatten(array, depth, predicate, isStrict, result) {
  3932. var index = -1,
  3933. length = array.length;
  3934. predicate || (predicate = isFlattenable);
  3935. result || (result = []);
  3936. while (++index < length) {
  3937. var value = array[index];
  3938. if (depth > 0 && predicate(value)) {
  3939. if (depth > 1) {
  3940. // Recursively flatten arrays (susceptible to call stack limits).
  3941. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3942. } else {
  3943. arrayPush(result, value);
  3944. }
  3945. } else if (!isStrict) {
  3946. result[result.length] = value;
  3947. }
  3948. }
  3949. return result;
  3950. }
  3951. /**
  3952. * The base implementation of `baseForOwn` which iterates over `object`
  3953. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3954. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3955. *
  3956. * @private
  3957. * @param {Object} object The object to iterate over.
  3958. * @param {Function} iteratee The function invoked per iteration.
  3959. * @param {Function} keysFunc The function to get the keys of `object`.
  3960. * @returns {Object} Returns `object`.
  3961. */
  3962. var baseFor = createBaseFor();
  3963. /**
  3964. * This function is like `baseFor` except that it iterates over properties
  3965. * in the opposite order.
  3966. *
  3967. * @private
  3968. * @param {Object} object The object to iterate over.
  3969. * @param {Function} iteratee The function invoked per iteration.
  3970. * @param {Function} keysFunc The function to get the keys of `object`.
  3971. * @returns {Object} Returns `object`.
  3972. */
  3973. var baseForRight = createBaseFor(true);
  3974. /**
  3975. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3976. *
  3977. * @private
  3978. * @param {Object} object The object to iterate over.
  3979. * @param {Function} iteratee The function invoked per iteration.
  3980. * @returns {Object} Returns `object`.
  3981. */
  3982. function baseForOwn(object, iteratee) {
  3983. return object && baseFor(object, iteratee, keys);
  3984. }
  3985. /**
  3986. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3987. *
  3988. * @private
  3989. * @param {Object} object The object to iterate over.
  3990. * @param {Function} iteratee The function invoked per iteration.
  3991. * @returns {Object} Returns `object`.
  3992. */
  3993. function baseForOwnRight(object, iteratee) {
  3994. return object && baseForRight(object, iteratee, keys);
  3995. }
  3996. /**
  3997. * The base implementation of `_.functions` which creates an array of
  3998. * `object` function property names filtered from `props`.
  3999. *
  4000. * @private
  4001. * @param {Object} object The object to inspect.
  4002. * @param {Array} props The property names to filter.
  4003. * @returns {Array} Returns the function names.
  4004. */
  4005. function baseFunctions(object, props) {
  4006. return arrayFilter(props, function(key) {
  4007. return isFunction(object[key]);
  4008. });
  4009. }
  4010. /**
  4011. * The base implementation of `_.get` without support for default values.
  4012. *
  4013. * @private
  4014. * @param {Object} object The object to query.
  4015. * @param {Array|string} path The path of the property to get.
  4016. * @returns {*} Returns the resolved value.
  4017. */
  4018. function baseGet(object, path) {
  4019. path = castPath(path, object);
  4020. var index = 0,
  4021. length = path.length;
  4022. while (object != null && index < length) {
  4023. object = object[toKey(path[index++])];
  4024. }
  4025. return (index && index == length) ? object : undefined;
  4026. }
  4027. /**
  4028. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4029. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4030. * symbols of `object`.
  4031. *
  4032. * @private
  4033. * @param {Object} object The object to query.
  4034. * @param {Function} keysFunc The function to get the keys of `object`.
  4035. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4036. * @returns {Array} Returns the array of property names and symbols.
  4037. */
  4038. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4039. var result = keysFunc(object);
  4040. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4041. }
  4042. /**
  4043. * The base implementation of `getTag` without fallbacks for buggy environments.
  4044. *
  4045. * @private
  4046. * @param {*} value The value to query.
  4047. * @returns {string} Returns the `toStringTag`.
  4048. */
  4049. function baseGetTag(value) {
  4050. if (value == null) {
  4051. return value === undefined ? undefinedTag : nullTag;
  4052. }
  4053. return (symToStringTag && symToStringTag in Object(value))
  4054. ? getRawTag(value)
  4055. : objectToString(value);
  4056. }
  4057. /**
  4058. * The base implementation of `_.gt` which doesn't coerce arguments.
  4059. *
  4060. * @private
  4061. * @param {*} value The value to compare.
  4062. * @param {*} other The other value to compare.
  4063. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4064. * else `false`.
  4065. */
  4066. function baseGt(value, other) {
  4067. return value > other;
  4068. }
  4069. /**
  4070. * The base implementation of `_.has` without support for deep paths.
  4071. *
  4072. * @private
  4073. * @param {Object} [object] The object to query.
  4074. * @param {Array|string} key The key to check.
  4075. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4076. */
  4077. function baseHas(object, key) {
  4078. return object != null && hasOwnProperty.call(object, key);
  4079. }
  4080. /**
  4081. * The base implementation of `_.hasIn` without support for deep paths.
  4082. *
  4083. * @private
  4084. * @param {Object} [object] The object to query.
  4085. * @param {Array|string} key The key to check.
  4086. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4087. */
  4088. function baseHasIn(object, key) {
  4089. return object != null && key in Object(object);
  4090. }
  4091. /**
  4092. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4093. *
  4094. * @private
  4095. * @param {number} number The number to check.
  4096. * @param {number} start The start of the range.
  4097. * @param {number} end The end of the range.
  4098. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4099. */
  4100. function baseInRange(number, start, end) {
  4101. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4102. }
  4103. /**
  4104. * The base implementation of methods like `_.intersection`, without support
  4105. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4106. *
  4107. * @private
  4108. * @param {Array} arrays The arrays to inspect.
  4109. * @param {Function} [iteratee] The iteratee invoked per element.
  4110. * @param {Function} [comparator] The comparator invoked per element.
  4111. * @returns {Array} Returns the new array of shared values.
  4112. */
  4113. function baseIntersection(arrays, iteratee, comparator) {
  4114. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4115. length = arrays[0].length,
  4116. othLength = arrays.length,
  4117. othIndex = othLength,
  4118. caches = Array(othLength),
  4119. maxLength = Infinity,
  4120. result = [];
  4121. while (othIndex--) {
  4122. var array = arrays[othIndex];
  4123. if (othIndex && iteratee) {
  4124. array = arrayMap(array, baseUnary(iteratee));
  4125. }
  4126. maxLength = nativeMin(array.length, maxLength);
  4127. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4128. ? new SetCache(othIndex && array)
  4129. : undefined;
  4130. }
  4131. array = arrays[0];
  4132. var index = -1,
  4133. seen = caches[0];
  4134. outer:
  4135. while (++index < length && result.length < maxLength) {
  4136. var value = array[index],
  4137. computed = iteratee ? iteratee(value) : value;
  4138. value = (comparator || value !== 0) ? value : 0;
  4139. if (!(seen
  4140. ? cacheHas(seen, computed)
  4141. : includes(result, computed, comparator)
  4142. )) {
  4143. othIndex = othLength;
  4144. while (--othIndex) {
  4145. var cache = caches[othIndex];
  4146. if (!(cache
  4147. ? cacheHas(cache, computed)
  4148. : includes(arrays[othIndex], computed, comparator))
  4149. ) {
  4150. continue outer;
  4151. }
  4152. }
  4153. if (seen) {
  4154. seen.push(computed);
  4155. }
  4156. result.push(value);
  4157. }
  4158. }
  4159. return result;
  4160. }
  4161. /**
  4162. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4163. * `object` with values transformed by `iteratee` and set by `setter`.
  4164. *
  4165. * @private
  4166. * @param {Object} object The object to iterate over.
  4167. * @param {Function} setter The function to set `accumulator` values.
  4168. * @param {Function} iteratee The iteratee to transform values.
  4169. * @param {Object} accumulator The initial inverted object.
  4170. * @returns {Function} Returns `accumulator`.
  4171. */
  4172. function baseInverter(object, setter, iteratee, accumulator) {
  4173. baseForOwn(object, function(value, key, object) {
  4174. setter(accumulator, iteratee(value), key, object);
  4175. });
  4176. return accumulator;
  4177. }
  4178. /**
  4179. * The base implementation of `_.invoke` without support for individual
  4180. * method arguments.
  4181. *
  4182. * @private
  4183. * @param {Object} object The object to query.
  4184. * @param {Array|string} path The path of the method to invoke.
  4185. * @param {Array} args The arguments to invoke the method with.
  4186. * @returns {*} Returns the result of the invoked method.
  4187. */
  4188. function baseInvoke(object, path, args) {
  4189. path = castPath(path, object);
  4190. object = parent(object, path);
  4191. var func = object == null ? object : object[toKey(last(path))];
  4192. return func == null ? undefined : apply(func, object, args);
  4193. }
  4194. /**
  4195. * The base implementation of `_.isArguments`.
  4196. *
  4197. * @private
  4198. * @param {*} value The value to check.
  4199. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4200. */
  4201. function baseIsArguments(value) {
  4202. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4203. }
  4204. /**
  4205. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4206. *
  4207. * @private
  4208. * @param {*} value The value to check.
  4209. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4210. */
  4211. function baseIsArrayBuffer(value) {
  4212. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4213. }
  4214. /**
  4215. * The base implementation of `_.isDate` without Node.js optimizations.
  4216. *
  4217. * @private
  4218. * @param {*} value The value to check.
  4219. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4220. */
  4221. function baseIsDate(value) {
  4222. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4223. }
  4224. /**
  4225. * The base implementation of `_.isEqual` which supports partial comparisons
  4226. * and tracks traversed objects.
  4227. *
  4228. * @private
  4229. * @param {*} value The value to compare.
  4230. * @param {*} other The other value to compare.
  4231. * @param {boolean} bitmask The bitmask flags.
  4232. * 1 - Unordered comparison
  4233. * 2 - Partial comparison
  4234. * @param {Function} [customizer] The function to customize comparisons.
  4235. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4236. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4237. */
  4238. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4239. if (value === other) {
  4240. return true;
  4241. }
  4242. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4243. return value !== value && other !== other;
  4244. }
  4245. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4246. }
  4247. /**
  4248. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4249. * deep comparisons and tracks traversed objects enabling objects with circular
  4250. * references to be compared.
  4251. *
  4252. * @private
  4253. * @param {Object} object The object to compare.
  4254. * @param {Object} other The other object to compare.
  4255. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4256. * @param {Function} customizer The function to customize comparisons.
  4257. * @param {Function} equalFunc The function to determine equivalents of values.
  4258. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4259. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4260. */
  4261. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4262. var objIsArr = isArray(object),
  4263. othIsArr = isArray(other),
  4264. objTag = objIsArr ? arrayTag : getTag(object),
  4265. othTag = othIsArr ? arrayTag : getTag(other);
  4266. objTag = objTag == argsTag ? objectTag : objTag;
  4267. othTag = othTag == argsTag ? objectTag : othTag;
  4268. var objIsObj = objTag == objectTag,
  4269. othIsObj = othTag == objectTag,
  4270. isSameTag = objTag == othTag;
  4271. if (isSameTag && isBuffer(object)) {
  4272. if (!isBuffer(other)) {
  4273. return false;
  4274. }
  4275. objIsArr = true;
  4276. objIsObj = false;
  4277. }
  4278. if (isSameTag && !objIsObj) {
  4279. stack || (stack = new Stack);
  4280. return (objIsArr || isTypedArray(object))
  4281. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4282. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4283. }
  4284. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4285. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4286. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4287. if (objIsWrapped || othIsWrapped) {
  4288. var objUnwrapped = objIsWrapped ? object.value() : object,
  4289. othUnwrapped = othIsWrapped ? other.value() : other;
  4290. stack || (stack = new Stack);
  4291. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4292. }
  4293. }
  4294. if (!isSameTag) {
  4295. return false;
  4296. }
  4297. stack || (stack = new Stack);
  4298. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4299. }
  4300. /**
  4301. * The base implementation of `_.isMap` without Node.js optimizations.
  4302. *
  4303. * @private
  4304. * @param {*} value The value to check.
  4305. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4306. */
  4307. function baseIsMap(value) {
  4308. return isObjectLike(value) && getTag(value) == mapTag;
  4309. }
  4310. /**
  4311. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4312. *
  4313. * @private
  4314. * @param {Object} object The object to inspect.
  4315. * @param {Object} source The object of property values to match.
  4316. * @param {Array} matchData The property names, values, and compare flags to match.
  4317. * @param {Function} [customizer] The function to customize comparisons.
  4318. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4319. */
  4320. function baseIsMatch(object, source, matchData, customizer) {
  4321. var index = matchData.length,
  4322. length = index,
  4323. noCustomizer = !customizer;
  4324. if (object == null) {
  4325. return !length;
  4326. }
  4327. object = Object(object);
  4328. while (index--) {
  4329. var data = matchData[index];
  4330. if ((noCustomizer && data[2])
  4331. ? data[1] !== object[data[0]]
  4332. : !(data[0] in object)
  4333. ) {
  4334. return false;
  4335. }
  4336. }
  4337. while (++index < length) {
  4338. data = matchData[index];
  4339. var key = data[0],
  4340. objValue = object[key],
  4341. srcValue = data[1];
  4342. if (noCustomizer && data[2]) {
  4343. if (objValue === undefined && !(key in object)) {
  4344. return false;
  4345. }
  4346. } else {
  4347. var stack = new Stack;
  4348. if (customizer) {
  4349. var result = customizer(objValue, srcValue, key, object, source, stack);
  4350. }
  4351. if (!(result === undefined
  4352. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4353. : result
  4354. )) {
  4355. return false;
  4356. }
  4357. }
  4358. }
  4359. return true;
  4360. }
  4361. /**
  4362. * The base implementation of `_.isNative` without bad shim checks.
  4363. *
  4364. * @private
  4365. * @param {*} value The value to check.
  4366. * @returns {boolean} Returns `true` if `value` is a native function,
  4367. * else `false`.
  4368. */
  4369. function baseIsNative(value) {
  4370. if (!isObject(value) || isMasked(value)) {
  4371. return false;
  4372. }
  4373. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4374. return pattern.test(toSource(value));
  4375. }
  4376. /**
  4377. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4378. *
  4379. * @private
  4380. * @param {*} value The value to check.
  4381. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4382. */
  4383. function baseIsRegExp(value) {
  4384. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4385. }
  4386. /**
  4387. * The base implementation of `_.isSet` without Node.js optimizations.
  4388. *
  4389. * @private
  4390. * @param {*} value The value to check.
  4391. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4392. */
  4393. function baseIsSet(value) {
  4394. return isObjectLike(value) && getTag(value) == setTag;
  4395. }
  4396. /**
  4397. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4398. *
  4399. * @private
  4400. * @param {*} value The value to check.
  4401. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4402. */
  4403. function baseIsTypedArray(value) {
  4404. return isObjectLike(value) &&
  4405. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4406. }
  4407. /**
  4408. * The base implementation of `_.iteratee`.
  4409. *
  4410. * @private
  4411. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4412. * @returns {Function} Returns the iteratee.
  4413. */
  4414. function baseIteratee(value) {
  4415. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4416. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4417. if (typeof value == 'function') {
  4418. return value;
  4419. }
  4420. if (value == null) {
  4421. return identity;
  4422. }
  4423. if (typeof value == 'object') {
  4424. return isArray(value)
  4425. ? baseMatchesProperty(value[0], value[1])
  4426. : baseMatches(value);
  4427. }
  4428. return property(value);
  4429. }
  4430. /**
  4431. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4432. *
  4433. * @private
  4434. * @param {Object} object The object to query.
  4435. * @returns {Array} Returns the array of property names.
  4436. */
  4437. function baseKeys(object) {
  4438. if (!isPrototype(object)) {
  4439. return nativeKeys(object);
  4440. }
  4441. var result = [];
  4442. for (var key in Object(object)) {
  4443. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4444. result.push(key);
  4445. }
  4446. }
  4447. return result;
  4448. }
  4449. /**
  4450. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4451. *
  4452. * @private
  4453. * @param {Object} object The object to query.
  4454. * @returns {Array} Returns the array of property names.
  4455. */
  4456. function baseKeysIn(object) {
  4457. if (!isObject(object)) {
  4458. return nativeKeysIn(object);
  4459. }
  4460. var isProto = isPrototype(object),
  4461. result = [];
  4462. for (var key in object) {
  4463. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4464. result.push(key);
  4465. }
  4466. }
  4467. return result;
  4468. }
  4469. /**
  4470. * The base implementation of `_.lt` which doesn't coerce arguments.
  4471. *
  4472. * @private
  4473. * @param {*} value The value to compare.
  4474. * @param {*} other The other value to compare.
  4475. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4476. * else `false`.
  4477. */
  4478. function baseLt(value, other) {
  4479. return value < other;
  4480. }
  4481. /**
  4482. * The base implementation of `_.map` without support for iteratee shorthands.
  4483. *
  4484. * @private
  4485. * @param {Array|Object} collection The collection to iterate over.
  4486. * @param {Function} iteratee The function invoked per iteration.
  4487. * @returns {Array} Returns the new mapped array.
  4488. */
  4489. function baseMap(collection, iteratee) {
  4490. var index = -1,
  4491. result = isArrayLike(collection) ? Array(collection.length) : [];
  4492. baseEach(collection, function(value, key, collection) {
  4493. result[++index] = iteratee(value, key, collection);
  4494. });
  4495. return result;
  4496. }
  4497. /**
  4498. * The base implementation of `_.matches` which doesn't clone `source`.
  4499. *
  4500. * @private
  4501. * @param {Object} source The object of property values to match.
  4502. * @returns {Function} Returns the new spec function.
  4503. */
  4504. function baseMatches(source) {
  4505. var matchData = getMatchData(source);
  4506. if (matchData.length == 1 && matchData[0][2]) {
  4507. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4508. }
  4509. return function(object) {
  4510. return object === source || baseIsMatch(object, source, matchData);
  4511. };
  4512. }
  4513. /**
  4514. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4515. *
  4516. * @private
  4517. * @param {string} path The path of the property to get.
  4518. * @param {*} srcValue The value to match.
  4519. * @returns {Function} Returns the new spec function.
  4520. */
  4521. function baseMatchesProperty(path, srcValue) {
  4522. if (isKey(path) && isStrictComparable(srcValue)) {
  4523. return matchesStrictComparable(toKey(path), srcValue);
  4524. }
  4525. return function(object) {
  4526. var objValue = get(object, path);
  4527. return (objValue === undefined && objValue === srcValue)
  4528. ? hasIn(object, path)
  4529. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4530. };
  4531. }
  4532. /**
  4533. * The base implementation of `_.merge` without support for multiple sources.
  4534. *
  4535. * @private
  4536. * @param {Object} object The destination object.
  4537. * @param {Object} source The source object.
  4538. * @param {number} srcIndex The index of `source`.
  4539. * @param {Function} [customizer] The function to customize merged values.
  4540. * @param {Object} [stack] Tracks traversed source values and their merged
  4541. * counterparts.
  4542. */
  4543. function baseMerge(object, source, srcIndex, customizer, stack) {
  4544. if (object === source) {
  4545. return;
  4546. }
  4547. baseFor(source, function(srcValue, key) {
  4548. stack || (stack = new Stack);
  4549. if (isObject(srcValue)) {
  4550. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4551. }
  4552. else {
  4553. var newValue = customizer
  4554. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4555. : undefined;
  4556. if (newValue === undefined) {
  4557. newValue = srcValue;
  4558. }
  4559. assignMergeValue(object, key, newValue);
  4560. }
  4561. }, keysIn);
  4562. }
  4563. /**
  4564. * A specialized version of `baseMerge` for arrays and objects which performs
  4565. * deep merges and tracks traversed objects enabling objects with circular
  4566. * references to be merged.
  4567. *
  4568. * @private
  4569. * @param {Object} object The destination object.
  4570. * @param {Object} source The source object.
  4571. * @param {string} key The key of the value to merge.
  4572. * @param {number} srcIndex The index of `source`.
  4573. * @param {Function} mergeFunc The function to merge values.
  4574. * @param {Function} [customizer] The function to customize assigned values.
  4575. * @param {Object} [stack] Tracks traversed source values and their merged
  4576. * counterparts.
  4577. */
  4578. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4579. var objValue = safeGet(object, key),
  4580. srcValue = safeGet(source, key),
  4581. stacked = stack.get(srcValue);
  4582. if (stacked) {
  4583. assignMergeValue(object, key, stacked);
  4584. return;
  4585. }
  4586. var newValue = customizer
  4587. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4588. : undefined;
  4589. var isCommon = newValue === undefined;
  4590. if (isCommon) {
  4591. var isArr = isArray(srcValue),
  4592. isBuff = !isArr && isBuffer(srcValue),
  4593. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4594. newValue = srcValue;
  4595. if (isArr || isBuff || isTyped) {
  4596. if (isArray(objValue)) {
  4597. newValue = objValue;
  4598. }
  4599. else if (isArrayLikeObject(objValue)) {
  4600. newValue = copyArray(objValue);
  4601. }
  4602. else if (isBuff) {
  4603. isCommon = false;
  4604. newValue = cloneBuffer(srcValue, true);
  4605. }
  4606. else if (isTyped) {
  4607. isCommon = false;
  4608. newValue = cloneTypedArray(srcValue, true);
  4609. }
  4610. else {
  4611. newValue = [];
  4612. }
  4613. }
  4614. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4615. newValue = objValue;
  4616. if (isArguments(objValue)) {
  4617. newValue = toPlainObject(objValue);
  4618. }
  4619. else if (!isObject(objValue) || isFunction(objValue)) {
  4620. newValue = initCloneObject(srcValue);
  4621. }
  4622. }
  4623. else {
  4624. isCommon = false;
  4625. }
  4626. }
  4627. if (isCommon) {
  4628. // Recursively merge objects and arrays (susceptible to call stack limits).
  4629. stack.set(srcValue, newValue);
  4630. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4631. stack['delete'](srcValue);
  4632. }
  4633. assignMergeValue(object, key, newValue);
  4634. }
  4635. /**
  4636. * The base implementation of `_.nth` which doesn't coerce arguments.
  4637. *
  4638. * @private
  4639. * @param {Array} array The array to query.
  4640. * @param {number} n The index of the element to return.
  4641. * @returns {*} Returns the nth element of `array`.
  4642. */
  4643. function baseNth(array, n) {
  4644. var length = array.length;
  4645. if (!length) {
  4646. return;
  4647. }
  4648. n += n < 0 ? length : 0;
  4649. return isIndex(n, length) ? array[n] : undefined;
  4650. }
  4651. /**
  4652. * The base implementation of `_.orderBy` without param guards.
  4653. *
  4654. * @private
  4655. * @param {Array|Object} collection The collection to iterate over.
  4656. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4657. * @param {string[]} orders The sort orders of `iteratees`.
  4658. * @returns {Array} Returns the new sorted array.
  4659. */
  4660. function baseOrderBy(collection, iteratees, orders) {
  4661. if (iteratees.length) {
  4662. iteratees = arrayMap(iteratees, function(iteratee) {
  4663. if (isArray(iteratee)) {
  4664. return function(value) {
  4665. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4666. }
  4667. }
  4668. return iteratee;
  4669. });
  4670. } else {
  4671. iteratees = [identity];
  4672. }
  4673. var index = -1;
  4674. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4675. var result = baseMap(collection, function(value, key, collection) {
  4676. var criteria = arrayMap(iteratees, function(iteratee) {
  4677. return iteratee(value);
  4678. });
  4679. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4680. });
  4681. return baseSortBy(result, function(object, other) {
  4682. return compareMultiple(object, other, orders);
  4683. });
  4684. }
  4685. /**
  4686. * The base implementation of `_.pick` without support for individual
  4687. * property identifiers.
  4688. *
  4689. * @private
  4690. * @param {Object} object The source object.
  4691. * @param {string[]} paths The property paths to pick.
  4692. * @returns {Object} Returns the new object.
  4693. */
  4694. function basePick(object, paths) {
  4695. return basePickBy(object, paths, function(value, path) {
  4696. return hasIn(object, path);
  4697. });
  4698. }
  4699. /**
  4700. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4701. *
  4702. * @private
  4703. * @param {Object} object The source object.
  4704. * @param {string[]} paths The property paths to pick.
  4705. * @param {Function} predicate The function invoked per property.
  4706. * @returns {Object} Returns the new object.
  4707. */
  4708. function basePickBy(object, paths, predicate) {
  4709. var index = -1,
  4710. length = paths.length,
  4711. result = {};
  4712. while (++index < length) {
  4713. var path = paths[index],
  4714. value = baseGet(object, path);
  4715. if (predicate(value, path)) {
  4716. baseSet(result, castPath(path, object), value);
  4717. }
  4718. }
  4719. return result;
  4720. }
  4721. /**
  4722. * A specialized version of `baseProperty` which supports deep paths.
  4723. *
  4724. * @private
  4725. * @param {Array|string} path The path of the property to get.
  4726. * @returns {Function} Returns the new accessor function.
  4727. */
  4728. function basePropertyDeep(path) {
  4729. return function(object) {
  4730. return baseGet(object, path);
  4731. };
  4732. }
  4733. /**
  4734. * The base implementation of `_.pullAllBy` without support for iteratee
  4735. * shorthands.
  4736. *
  4737. * @private
  4738. * @param {Array} array The array to modify.
  4739. * @param {Array} values The values to remove.
  4740. * @param {Function} [iteratee] The iteratee invoked per element.
  4741. * @param {Function} [comparator] The comparator invoked per element.
  4742. * @returns {Array} Returns `array`.
  4743. */
  4744. function basePullAll(array, values, iteratee, comparator) {
  4745. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4746. index = -1,
  4747. length = values.length,
  4748. seen = array;
  4749. if (array === values) {
  4750. values = copyArray(values);
  4751. }
  4752. if (iteratee) {
  4753. seen = arrayMap(array, baseUnary(iteratee));
  4754. }
  4755. while (++index < length) {
  4756. var fromIndex = 0,
  4757. value = values[index],
  4758. computed = iteratee ? iteratee(value) : value;
  4759. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4760. if (seen !== array) {
  4761. splice.call(seen, fromIndex, 1);
  4762. }
  4763. splice.call(array, fromIndex, 1);
  4764. }
  4765. }
  4766. return array;
  4767. }
  4768. /**
  4769. * The base implementation of `_.pullAt` without support for individual
  4770. * indexes or capturing the removed elements.
  4771. *
  4772. * @private
  4773. * @param {Array} array The array to modify.
  4774. * @param {number[]} indexes The indexes of elements to remove.
  4775. * @returns {Array} Returns `array`.
  4776. */
  4777. function basePullAt(array, indexes) {
  4778. var length = array ? indexes.length : 0,
  4779. lastIndex = length - 1;
  4780. while (length--) {
  4781. var index = indexes[length];
  4782. if (length == lastIndex || index !== previous) {
  4783. var previous = index;
  4784. if (isIndex(index)) {
  4785. splice.call(array, index, 1);
  4786. } else {
  4787. baseUnset(array, index);
  4788. }
  4789. }
  4790. }
  4791. return array;
  4792. }
  4793. /**
  4794. * The base implementation of `_.random` without support for returning
  4795. * floating-point numbers.
  4796. *
  4797. * @private
  4798. * @param {number} lower The lower bound.
  4799. * @param {number} upper The upper bound.
  4800. * @returns {number} Returns the random number.
  4801. */
  4802. function baseRandom(lower, upper) {
  4803. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4804. }
  4805. /**
  4806. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4807. * coerce arguments.
  4808. *
  4809. * @private
  4810. * @param {number} start The start of the range.
  4811. * @param {number} end The end of the range.
  4812. * @param {number} step The value to increment or decrement by.
  4813. * @param {boolean} [fromRight] Specify iterating from right to left.
  4814. * @returns {Array} Returns the range of numbers.
  4815. */
  4816. function baseRange(start, end, step, fromRight) {
  4817. var index = -1,
  4818. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4819. result = Array(length);
  4820. while (length--) {
  4821. result[fromRight ? length : ++index] = start;
  4822. start += step;
  4823. }
  4824. return result;
  4825. }
  4826. /**
  4827. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4828. *
  4829. * @private
  4830. * @param {string} string The string to repeat.
  4831. * @param {number} n The number of times to repeat the string.
  4832. * @returns {string} Returns the repeated string.
  4833. */
  4834. function baseRepeat(string, n) {
  4835. var result = '';
  4836. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4837. return result;
  4838. }
  4839. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4840. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4841. do {
  4842. if (n % 2) {
  4843. result += string;
  4844. }
  4845. n = nativeFloor(n / 2);
  4846. if (n) {
  4847. string += string;
  4848. }
  4849. } while (n);
  4850. return result;
  4851. }
  4852. /**
  4853. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4854. *
  4855. * @private
  4856. * @param {Function} func The function to apply a rest parameter to.
  4857. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4858. * @returns {Function} Returns the new function.
  4859. */
  4860. function baseRest(func, start) {
  4861. return setToString(overRest(func, start, identity), func + '');
  4862. }
  4863. /**
  4864. * The base implementation of `_.sample`.
  4865. *
  4866. * @private
  4867. * @param {Array|Object} collection The collection to sample.
  4868. * @returns {*} Returns the random element.
  4869. */
  4870. function baseSample(collection) {
  4871. return arraySample(values(collection));
  4872. }
  4873. /**
  4874. * The base implementation of `_.sampleSize` without param guards.
  4875. *
  4876. * @private
  4877. * @param {Array|Object} collection The collection to sample.
  4878. * @param {number} n The number of elements to sample.
  4879. * @returns {Array} Returns the random elements.
  4880. */
  4881. function baseSampleSize(collection, n) {
  4882. var array = values(collection);
  4883. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4884. }
  4885. /**
  4886. * The base implementation of `_.set`.
  4887. *
  4888. * @private
  4889. * @param {Object} object The object to modify.
  4890. * @param {Array|string} path The path of the property to set.
  4891. * @param {*} value The value to set.
  4892. * @param {Function} [customizer] The function to customize path creation.
  4893. * @returns {Object} Returns `object`.
  4894. */
  4895. function baseSet(object, path, value, customizer) {
  4896. if (!isObject(object)) {
  4897. return object;
  4898. }
  4899. path = castPath(path, object);
  4900. var index = -1,
  4901. length = path.length,
  4902. lastIndex = length - 1,
  4903. nested = object;
  4904. while (nested != null && ++index < length) {
  4905. var key = toKey(path[index]),
  4906. newValue = value;
  4907. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4908. return object;
  4909. }
  4910. if (index != lastIndex) {
  4911. var objValue = nested[key];
  4912. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4913. if (newValue === undefined) {
  4914. newValue = isObject(objValue)
  4915. ? objValue
  4916. : (isIndex(path[index + 1]) ? [] : {});
  4917. }
  4918. }
  4919. assignValue(nested, key, newValue);
  4920. nested = nested[key];
  4921. }
  4922. return object;
  4923. }
  4924. /**
  4925. * The base implementation of `setData` without support for hot loop shorting.
  4926. *
  4927. * @private
  4928. * @param {Function} func The function to associate metadata with.
  4929. * @param {*} data The metadata.
  4930. * @returns {Function} Returns `func`.
  4931. */
  4932. var baseSetData = !metaMap ? identity : function(func, data) {
  4933. metaMap.set(func, data);
  4934. return func;
  4935. };
  4936. /**
  4937. * The base implementation of `setToString` without support for hot loop shorting.
  4938. *
  4939. * @private
  4940. * @param {Function} func The function to modify.
  4941. * @param {Function} string The `toString` result.
  4942. * @returns {Function} Returns `func`.
  4943. */
  4944. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4945. return defineProperty(func, 'toString', {
  4946. 'configurable': true,
  4947. 'enumerable': false,
  4948. 'value': constant(string),
  4949. 'writable': true
  4950. });
  4951. };
  4952. /**
  4953. * The base implementation of `_.shuffle`.
  4954. *
  4955. * @private
  4956. * @param {Array|Object} collection The collection to shuffle.
  4957. * @returns {Array} Returns the new shuffled array.
  4958. */
  4959. function baseShuffle(collection) {
  4960. return shuffleSelf(values(collection));
  4961. }
  4962. /**
  4963. * The base implementation of `_.slice` without an iteratee call guard.
  4964. *
  4965. * @private
  4966. * @param {Array} array The array to slice.
  4967. * @param {number} [start=0] The start position.
  4968. * @param {number} [end=array.length] The end position.
  4969. * @returns {Array} Returns the slice of `array`.
  4970. */
  4971. function baseSlice(array, start, end) {
  4972. var index = -1,
  4973. length = array.length;
  4974. if (start < 0) {
  4975. start = -start > length ? 0 : (length + start);
  4976. }
  4977. end = end > length ? length : end;
  4978. if (end < 0) {
  4979. end += length;
  4980. }
  4981. length = start > end ? 0 : ((end - start) >>> 0);
  4982. start >>>= 0;
  4983. var result = Array(length);
  4984. while (++index < length) {
  4985. result[index] = array[index + start];
  4986. }
  4987. return result;
  4988. }
  4989. /**
  4990. * The base implementation of `_.some` without support for iteratee shorthands.
  4991. *
  4992. * @private
  4993. * @param {Array|Object} collection The collection to iterate over.
  4994. * @param {Function} predicate The function invoked per iteration.
  4995. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4996. * else `false`.
  4997. */
  4998. function baseSome(collection, predicate) {
  4999. var result;
  5000. baseEach(collection, function(value, index, collection) {
  5001. result = predicate(value, index, collection);
  5002. return !result;
  5003. });
  5004. return !!result;
  5005. }
  5006. /**
  5007. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5008. * performs a binary search of `array` to determine the index at which `value`
  5009. * should be inserted into `array` in order to maintain its sort order.
  5010. *
  5011. * @private
  5012. * @param {Array} array The sorted array to inspect.
  5013. * @param {*} value The value to evaluate.
  5014. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5015. * @returns {number} Returns the index at which `value` should be inserted
  5016. * into `array`.
  5017. */
  5018. function baseSortedIndex(array, value, retHighest) {
  5019. var low = 0,
  5020. high = array == null ? low : array.length;
  5021. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5022. while (low < high) {
  5023. var mid = (low + high) >>> 1,
  5024. computed = array[mid];
  5025. if (computed !== null && !isSymbol(computed) &&
  5026. (retHighest ? (computed <= value) : (computed < value))) {
  5027. low = mid + 1;
  5028. } else {
  5029. high = mid;
  5030. }
  5031. }
  5032. return high;
  5033. }
  5034. return baseSortedIndexBy(array, value, identity, retHighest);
  5035. }
  5036. /**
  5037. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5038. * which invokes `iteratee` for `value` and each element of `array` to compute
  5039. * their sort ranking. The iteratee is invoked with one argument; (value).
  5040. *
  5041. * @private
  5042. * @param {Array} array The sorted array to inspect.
  5043. * @param {*} value The value to evaluate.
  5044. * @param {Function} iteratee The iteratee invoked per element.
  5045. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5046. * @returns {number} Returns the index at which `value` should be inserted
  5047. * into `array`.
  5048. */
  5049. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5050. var low = 0,
  5051. high = array == null ? 0 : array.length;
  5052. if (high === 0) {
  5053. return 0;
  5054. }
  5055. value = iteratee(value);
  5056. var valIsNaN = value !== value,
  5057. valIsNull = value === null,
  5058. valIsSymbol = isSymbol(value),
  5059. valIsUndefined = value === undefined;
  5060. while (low < high) {
  5061. var mid = nativeFloor((low + high) / 2),
  5062. computed = iteratee(array[mid]),
  5063. othIsDefined = computed !== undefined,
  5064. othIsNull = computed === null,
  5065. othIsReflexive = computed === computed,
  5066. othIsSymbol = isSymbol(computed);
  5067. if (valIsNaN) {
  5068. var setLow = retHighest || othIsReflexive;
  5069. } else if (valIsUndefined) {
  5070. setLow = othIsReflexive && (retHighest || othIsDefined);
  5071. } else if (valIsNull) {
  5072. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5073. } else if (valIsSymbol) {
  5074. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5075. } else if (othIsNull || othIsSymbol) {
  5076. setLow = false;
  5077. } else {
  5078. setLow = retHighest ? (computed <= value) : (computed < value);
  5079. }
  5080. if (setLow) {
  5081. low = mid + 1;
  5082. } else {
  5083. high = mid;
  5084. }
  5085. }
  5086. return nativeMin(high, MAX_ARRAY_INDEX);
  5087. }
  5088. /**
  5089. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5090. * support for iteratee shorthands.
  5091. *
  5092. * @private
  5093. * @param {Array} array The array to inspect.
  5094. * @param {Function} [iteratee] The iteratee invoked per element.
  5095. * @returns {Array} Returns the new duplicate free array.
  5096. */
  5097. function baseSortedUniq(array, iteratee) {
  5098. var index = -1,
  5099. length = array.length,
  5100. resIndex = 0,
  5101. result = [];
  5102. while (++index < length) {
  5103. var value = array[index],
  5104. computed = iteratee ? iteratee(value) : value;
  5105. if (!index || !eq(computed, seen)) {
  5106. var seen = computed;
  5107. result[resIndex++] = value === 0 ? 0 : value;
  5108. }
  5109. }
  5110. return result;
  5111. }
  5112. /**
  5113. * The base implementation of `_.toNumber` which doesn't ensure correct
  5114. * conversions of binary, hexadecimal, or octal string values.
  5115. *
  5116. * @private
  5117. * @param {*} value The value to process.
  5118. * @returns {number} Returns the number.
  5119. */
  5120. function baseToNumber(value) {
  5121. if (typeof value == 'number') {
  5122. return value;
  5123. }
  5124. if (isSymbol(value)) {
  5125. return NAN;
  5126. }
  5127. return +value;
  5128. }
  5129. /**
  5130. * The base implementation of `_.toString` which doesn't convert nullish
  5131. * values to empty strings.
  5132. *
  5133. * @private
  5134. * @param {*} value The value to process.
  5135. * @returns {string} Returns the string.
  5136. */
  5137. function baseToString(value) {
  5138. // Exit early for strings to avoid a performance hit in some environments.
  5139. if (typeof value == 'string') {
  5140. return value;
  5141. }
  5142. if (isArray(value)) {
  5143. // Recursively convert values (susceptible to call stack limits).
  5144. return arrayMap(value, baseToString) + '';
  5145. }
  5146. if (isSymbol(value)) {
  5147. return symbolToString ? symbolToString.call(value) : '';
  5148. }
  5149. var result = (value + '');
  5150. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5151. }
  5152. /**
  5153. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5154. *
  5155. * @private
  5156. * @param {Array} array The array to inspect.
  5157. * @param {Function} [iteratee] The iteratee invoked per element.
  5158. * @param {Function} [comparator] The comparator invoked per element.
  5159. * @returns {Array} Returns the new duplicate free array.
  5160. */
  5161. function baseUniq(array, iteratee, comparator) {
  5162. var index = -1,
  5163. includes = arrayIncludes,
  5164. length = array.length,
  5165. isCommon = true,
  5166. result = [],
  5167. seen = result;
  5168. if (comparator) {
  5169. isCommon = false;
  5170. includes = arrayIncludesWith;
  5171. }
  5172. else if (length >= LARGE_ARRAY_SIZE) {
  5173. var set = iteratee ? null : createSet(array);
  5174. if (set) {
  5175. return setToArray(set);
  5176. }
  5177. isCommon = false;
  5178. includes = cacheHas;
  5179. seen = new SetCache;
  5180. }
  5181. else {
  5182. seen = iteratee ? [] : result;
  5183. }
  5184. outer:
  5185. while (++index < length) {
  5186. var value = array[index],
  5187. computed = iteratee ? iteratee(value) : value;
  5188. value = (comparator || value !== 0) ? value : 0;
  5189. if (isCommon && computed === computed) {
  5190. var seenIndex = seen.length;
  5191. while (seenIndex--) {
  5192. if (seen[seenIndex] === computed) {
  5193. continue outer;
  5194. }
  5195. }
  5196. if (iteratee) {
  5197. seen.push(computed);
  5198. }
  5199. result.push(value);
  5200. }
  5201. else if (!includes(seen, computed, comparator)) {
  5202. if (seen !== result) {
  5203. seen.push(computed);
  5204. }
  5205. result.push(value);
  5206. }
  5207. }
  5208. return result;
  5209. }
  5210. /**
  5211. * The base implementation of `_.unset`.
  5212. *
  5213. * @private
  5214. * @param {Object} object The object to modify.
  5215. * @param {Array|string} path The property path to unset.
  5216. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5217. */
  5218. function baseUnset(object, path) {
  5219. path = castPath(path, object);
  5220. object = parent(object, path);
  5221. return object == null || delete object[toKey(last(path))];
  5222. }
  5223. /**
  5224. * The base implementation of `_.update`.
  5225. *
  5226. * @private
  5227. * @param {Object} object The object to modify.
  5228. * @param {Array|string} path The path of the property to update.
  5229. * @param {Function} updater The function to produce the updated value.
  5230. * @param {Function} [customizer] The function to customize path creation.
  5231. * @returns {Object} Returns `object`.
  5232. */
  5233. function baseUpdate(object, path, updater, customizer) {
  5234. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5235. }
  5236. /**
  5237. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5238. * without support for iteratee shorthands.
  5239. *
  5240. * @private
  5241. * @param {Array} array The array to query.
  5242. * @param {Function} predicate The function invoked per iteration.
  5243. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5244. * @param {boolean} [fromRight] Specify iterating from right to left.
  5245. * @returns {Array} Returns the slice of `array`.
  5246. */
  5247. function baseWhile(array, predicate, isDrop, fromRight) {
  5248. var length = array.length,
  5249. index = fromRight ? length : -1;
  5250. while ((fromRight ? index-- : ++index < length) &&
  5251. predicate(array[index], index, array)) {}
  5252. return isDrop
  5253. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5254. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5255. }
  5256. /**
  5257. * The base implementation of `wrapperValue` which returns the result of
  5258. * performing a sequence of actions on the unwrapped `value`, where each
  5259. * successive action is supplied the return value of the previous.
  5260. *
  5261. * @private
  5262. * @param {*} value The unwrapped value.
  5263. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5264. * @returns {*} Returns the resolved value.
  5265. */
  5266. function baseWrapperValue(value, actions) {
  5267. var result = value;
  5268. if (result instanceof LazyWrapper) {
  5269. result = result.value();
  5270. }
  5271. return arrayReduce(actions, function(result, action) {
  5272. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5273. }, result);
  5274. }
  5275. /**
  5276. * The base implementation of methods like `_.xor`, without support for
  5277. * iteratee shorthands, that accepts an array of arrays to inspect.
  5278. *
  5279. * @private
  5280. * @param {Array} arrays The arrays to inspect.
  5281. * @param {Function} [iteratee] The iteratee invoked per element.
  5282. * @param {Function} [comparator] The comparator invoked per element.
  5283. * @returns {Array} Returns the new array of values.
  5284. */
  5285. function baseXor(arrays, iteratee, comparator) {
  5286. var length = arrays.length;
  5287. if (length < 2) {
  5288. return length ? baseUniq(arrays[0]) : [];
  5289. }
  5290. var index = -1,
  5291. result = Array(length);
  5292. while (++index < length) {
  5293. var array = arrays[index],
  5294. othIndex = -1;
  5295. while (++othIndex < length) {
  5296. if (othIndex != index) {
  5297. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5298. }
  5299. }
  5300. }
  5301. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5302. }
  5303. /**
  5304. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5305. *
  5306. * @private
  5307. * @param {Array} props The property identifiers.
  5308. * @param {Array} values The property values.
  5309. * @param {Function} assignFunc The function to assign values.
  5310. * @returns {Object} Returns the new object.
  5311. */
  5312. function baseZipObject(props, values, assignFunc) {
  5313. var index = -1,
  5314. length = props.length,
  5315. valsLength = values.length,
  5316. result = {};
  5317. while (++index < length) {
  5318. var value = index < valsLength ? values[index] : undefined;
  5319. assignFunc(result, props[index], value);
  5320. }
  5321. return result;
  5322. }
  5323. /**
  5324. * Casts `value` to an empty array if it's not an array like object.
  5325. *
  5326. * @private
  5327. * @param {*} value The value to inspect.
  5328. * @returns {Array|Object} Returns the cast array-like object.
  5329. */
  5330. function castArrayLikeObject(value) {
  5331. return isArrayLikeObject(value) ? value : [];
  5332. }
  5333. /**
  5334. * Casts `value` to `identity` if it's not a function.
  5335. *
  5336. * @private
  5337. * @param {*} value The value to inspect.
  5338. * @returns {Function} Returns cast function.
  5339. */
  5340. function castFunction(value) {
  5341. return typeof value == 'function' ? value : identity;
  5342. }
  5343. /**
  5344. * Casts `value` to a path array if it's not one.
  5345. *
  5346. * @private
  5347. * @param {*} value The value to inspect.
  5348. * @param {Object} [object] The object to query keys on.
  5349. * @returns {Array} Returns the cast property path array.
  5350. */
  5351. function castPath(value, object) {
  5352. if (isArray(value)) {
  5353. return value;
  5354. }
  5355. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5356. }
  5357. /**
  5358. * A `baseRest` alias which can be replaced with `identity` by module
  5359. * replacement plugins.
  5360. *
  5361. * @private
  5362. * @type {Function}
  5363. * @param {Function} func The function to apply a rest parameter to.
  5364. * @returns {Function} Returns the new function.
  5365. */
  5366. var castRest = baseRest;
  5367. /**
  5368. * Casts `array` to a slice if it's needed.
  5369. *
  5370. * @private
  5371. * @param {Array} array The array to inspect.
  5372. * @param {number} start The start position.
  5373. * @param {number} [end=array.length] The end position.
  5374. * @returns {Array} Returns the cast slice.
  5375. */
  5376. function castSlice(array, start, end) {
  5377. var length = array.length;
  5378. end = end === undefined ? length : end;
  5379. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5380. }
  5381. /**
  5382. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5383. *
  5384. * @private
  5385. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5386. */
  5387. var clearTimeout = ctxClearTimeout || function(id) {
  5388. return root.clearTimeout(id);
  5389. };
  5390. /**
  5391. * Creates a clone of `buffer`.
  5392. *
  5393. * @private
  5394. * @param {Buffer} buffer The buffer to clone.
  5395. * @param {boolean} [isDeep] Specify a deep clone.
  5396. * @returns {Buffer} Returns the cloned buffer.
  5397. */
  5398. function cloneBuffer(buffer, isDeep) {
  5399. if (isDeep) {
  5400. return buffer.slice();
  5401. }
  5402. var length = buffer.length,
  5403. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5404. buffer.copy(result);
  5405. return result;
  5406. }
  5407. /**
  5408. * Creates a clone of `arrayBuffer`.
  5409. *
  5410. * @private
  5411. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5412. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5413. */
  5414. function cloneArrayBuffer(arrayBuffer) {
  5415. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5416. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5417. return result;
  5418. }
  5419. /**
  5420. * Creates a clone of `dataView`.
  5421. *
  5422. * @private
  5423. * @param {Object} dataView The data view to clone.
  5424. * @param {boolean} [isDeep] Specify a deep clone.
  5425. * @returns {Object} Returns the cloned data view.
  5426. */
  5427. function cloneDataView(dataView, isDeep) {
  5428. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5429. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5430. }
  5431. /**
  5432. * Creates a clone of `regexp`.
  5433. *
  5434. * @private
  5435. * @param {Object} regexp The regexp to clone.
  5436. * @returns {Object} Returns the cloned regexp.
  5437. */
  5438. function cloneRegExp(regexp) {
  5439. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5440. result.lastIndex = regexp.lastIndex;
  5441. return result;
  5442. }
  5443. /**
  5444. * Creates a clone of the `symbol` object.
  5445. *
  5446. * @private
  5447. * @param {Object} symbol The symbol object to clone.
  5448. * @returns {Object} Returns the cloned symbol object.
  5449. */
  5450. function cloneSymbol(symbol) {
  5451. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5452. }
  5453. /**
  5454. * Creates a clone of `typedArray`.
  5455. *
  5456. * @private
  5457. * @param {Object} typedArray The typed array to clone.
  5458. * @param {boolean} [isDeep] Specify a deep clone.
  5459. * @returns {Object} Returns the cloned typed array.
  5460. */
  5461. function cloneTypedArray(typedArray, isDeep) {
  5462. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5463. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5464. }
  5465. /**
  5466. * Compares values to sort them in ascending order.
  5467. *
  5468. * @private
  5469. * @param {*} value The value to compare.
  5470. * @param {*} other The other value to compare.
  5471. * @returns {number} Returns the sort order indicator for `value`.
  5472. */
  5473. function compareAscending(value, other) {
  5474. if (value !== other) {
  5475. var valIsDefined = value !== undefined,
  5476. valIsNull = value === null,
  5477. valIsReflexive = value === value,
  5478. valIsSymbol = isSymbol(value);
  5479. var othIsDefined = other !== undefined,
  5480. othIsNull = other === null,
  5481. othIsReflexive = other === other,
  5482. othIsSymbol = isSymbol(other);
  5483. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5484. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5485. (valIsNull && othIsDefined && othIsReflexive) ||
  5486. (!valIsDefined && othIsReflexive) ||
  5487. !valIsReflexive) {
  5488. return 1;
  5489. }
  5490. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5491. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5492. (othIsNull && valIsDefined && valIsReflexive) ||
  5493. (!othIsDefined && valIsReflexive) ||
  5494. !othIsReflexive) {
  5495. return -1;
  5496. }
  5497. }
  5498. return 0;
  5499. }
  5500. /**
  5501. * Used by `_.orderBy` to compare multiple properties of a value to another
  5502. * and stable sort them.
  5503. *
  5504. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5505. * specify an order of "desc" for descending or "asc" for ascending sort order
  5506. * of corresponding values.
  5507. *
  5508. * @private
  5509. * @param {Object} object The object to compare.
  5510. * @param {Object} other The other object to compare.
  5511. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5512. * @returns {number} Returns the sort order indicator for `object`.
  5513. */
  5514. function compareMultiple(object, other, orders) {
  5515. var index = -1,
  5516. objCriteria = object.criteria,
  5517. othCriteria = other.criteria,
  5518. length = objCriteria.length,
  5519. ordersLength = orders.length;
  5520. while (++index < length) {
  5521. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5522. if (result) {
  5523. if (index >= ordersLength) {
  5524. return result;
  5525. }
  5526. var order = orders[index];
  5527. return result * (order == 'desc' ? -1 : 1);
  5528. }
  5529. }
  5530. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5531. // that causes it, under certain circumstances, to provide the same value for
  5532. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5533. // for more details.
  5534. //
  5535. // This also ensures a stable sort in V8 and other engines.
  5536. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5537. return object.index - other.index;
  5538. }
  5539. /**
  5540. * Creates an array that is the composition of partially applied arguments,
  5541. * placeholders, and provided arguments into a single array of arguments.
  5542. *
  5543. * @private
  5544. * @param {Array} args The provided arguments.
  5545. * @param {Array} partials The arguments to prepend to those provided.
  5546. * @param {Array} holders The `partials` placeholder indexes.
  5547. * @params {boolean} [isCurried] Specify composing for a curried function.
  5548. * @returns {Array} Returns the new array of composed arguments.
  5549. */
  5550. function composeArgs(args, partials, holders, isCurried) {
  5551. var argsIndex = -1,
  5552. argsLength = args.length,
  5553. holdersLength = holders.length,
  5554. leftIndex = -1,
  5555. leftLength = partials.length,
  5556. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5557. result = Array(leftLength + rangeLength),
  5558. isUncurried = !isCurried;
  5559. while (++leftIndex < leftLength) {
  5560. result[leftIndex] = partials[leftIndex];
  5561. }
  5562. while (++argsIndex < holdersLength) {
  5563. if (isUncurried || argsIndex < argsLength) {
  5564. result[holders[argsIndex]] = args[argsIndex];
  5565. }
  5566. }
  5567. while (rangeLength--) {
  5568. result[leftIndex++] = args[argsIndex++];
  5569. }
  5570. return result;
  5571. }
  5572. /**
  5573. * This function is like `composeArgs` except that the arguments composition
  5574. * is tailored for `_.partialRight`.
  5575. *
  5576. * @private
  5577. * @param {Array} args The provided arguments.
  5578. * @param {Array} partials The arguments to append to those provided.
  5579. * @param {Array} holders The `partials` placeholder indexes.
  5580. * @params {boolean} [isCurried] Specify composing for a curried function.
  5581. * @returns {Array} Returns the new array of composed arguments.
  5582. */
  5583. function composeArgsRight(args, partials, holders, isCurried) {
  5584. var argsIndex = -1,
  5585. argsLength = args.length,
  5586. holdersIndex = -1,
  5587. holdersLength = holders.length,
  5588. rightIndex = -1,
  5589. rightLength = partials.length,
  5590. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5591. result = Array(rangeLength + rightLength),
  5592. isUncurried = !isCurried;
  5593. while (++argsIndex < rangeLength) {
  5594. result[argsIndex] = args[argsIndex];
  5595. }
  5596. var offset = argsIndex;
  5597. while (++rightIndex < rightLength) {
  5598. result[offset + rightIndex] = partials[rightIndex];
  5599. }
  5600. while (++holdersIndex < holdersLength) {
  5601. if (isUncurried || argsIndex < argsLength) {
  5602. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5603. }
  5604. }
  5605. return result;
  5606. }
  5607. /**
  5608. * Copies the values of `source` to `array`.
  5609. *
  5610. * @private
  5611. * @param {Array} source The array to copy values from.
  5612. * @param {Array} [array=[]] The array to copy values to.
  5613. * @returns {Array} Returns `array`.
  5614. */
  5615. function copyArray(source, array) {
  5616. var index = -1,
  5617. length = source.length;
  5618. array || (array = Array(length));
  5619. while (++index < length) {
  5620. array[index] = source[index];
  5621. }
  5622. return array;
  5623. }
  5624. /**
  5625. * Copies properties of `source` to `object`.
  5626. *
  5627. * @private
  5628. * @param {Object} source The object to copy properties from.
  5629. * @param {Array} props The property identifiers to copy.
  5630. * @param {Object} [object={}] The object to copy properties to.
  5631. * @param {Function} [customizer] The function to customize copied values.
  5632. * @returns {Object} Returns `object`.
  5633. */
  5634. function copyObject(source, props, object, customizer) {
  5635. var isNew = !object;
  5636. object || (object = {});
  5637. var index = -1,
  5638. length = props.length;
  5639. while (++index < length) {
  5640. var key = props[index];
  5641. var newValue = customizer
  5642. ? customizer(object[key], source[key], key, object, source)
  5643. : undefined;
  5644. if (newValue === undefined) {
  5645. newValue = source[key];
  5646. }
  5647. if (isNew) {
  5648. baseAssignValue(object, key, newValue);
  5649. } else {
  5650. assignValue(object, key, newValue);
  5651. }
  5652. }
  5653. return object;
  5654. }
  5655. /**
  5656. * Copies own symbols of `source` to `object`.
  5657. *
  5658. * @private
  5659. * @param {Object} source The object to copy symbols from.
  5660. * @param {Object} [object={}] The object to copy symbols to.
  5661. * @returns {Object} Returns `object`.
  5662. */
  5663. function copySymbols(source, object) {
  5664. return copyObject(source, getSymbols(source), object);
  5665. }
  5666. /**
  5667. * Copies own and inherited symbols of `source` to `object`.
  5668. *
  5669. * @private
  5670. * @param {Object} source The object to copy symbols from.
  5671. * @param {Object} [object={}] The object to copy symbols to.
  5672. * @returns {Object} Returns `object`.
  5673. */
  5674. function copySymbolsIn(source, object) {
  5675. return copyObject(source, getSymbolsIn(source), object);
  5676. }
  5677. /**
  5678. * Creates a function like `_.groupBy`.
  5679. *
  5680. * @private
  5681. * @param {Function} setter The function to set accumulator values.
  5682. * @param {Function} [initializer] The accumulator object initializer.
  5683. * @returns {Function} Returns the new aggregator function.
  5684. */
  5685. function createAggregator(setter, initializer) {
  5686. return function(collection, iteratee) {
  5687. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5688. accumulator = initializer ? initializer() : {};
  5689. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5690. };
  5691. }
  5692. /**
  5693. * Creates a function like `_.assign`.
  5694. *
  5695. * @private
  5696. * @param {Function} assigner The function to assign values.
  5697. * @returns {Function} Returns the new assigner function.
  5698. */
  5699. function createAssigner(assigner) {
  5700. return baseRest(function(object, sources) {
  5701. var index = -1,
  5702. length = sources.length,
  5703. customizer = length > 1 ? sources[length - 1] : undefined,
  5704. guard = length > 2 ? sources[2] : undefined;
  5705. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5706. ? (length--, customizer)
  5707. : undefined;
  5708. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5709. customizer = length < 3 ? undefined : customizer;
  5710. length = 1;
  5711. }
  5712. object = Object(object);
  5713. while (++index < length) {
  5714. var source = sources[index];
  5715. if (source) {
  5716. assigner(object, source, index, customizer);
  5717. }
  5718. }
  5719. return object;
  5720. });
  5721. }
  5722. /**
  5723. * Creates a `baseEach` or `baseEachRight` function.
  5724. *
  5725. * @private
  5726. * @param {Function} eachFunc The function to iterate over a collection.
  5727. * @param {boolean} [fromRight] Specify iterating from right to left.
  5728. * @returns {Function} Returns the new base function.
  5729. */
  5730. function createBaseEach(eachFunc, fromRight) {
  5731. return function(collection, iteratee) {
  5732. if (collection == null) {
  5733. return collection;
  5734. }
  5735. if (!isArrayLike(collection)) {
  5736. return eachFunc(collection, iteratee);
  5737. }
  5738. var length = collection.length,
  5739. index = fromRight ? length : -1,
  5740. iterable = Object(collection);
  5741. while ((fromRight ? index-- : ++index < length)) {
  5742. if (iteratee(iterable[index], index, iterable) === false) {
  5743. break;
  5744. }
  5745. }
  5746. return collection;
  5747. };
  5748. }
  5749. /**
  5750. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5751. *
  5752. * @private
  5753. * @param {boolean} [fromRight] Specify iterating from right to left.
  5754. * @returns {Function} Returns the new base function.
  5755. */
  5756. function createBaseFor(fromRight) {
  5757. return function(object, iteratee, keysFunc) {
  5758. var index = -1,
  5759. iterable = Object(object),
  5760. props = keysFunc(object),
  5761. length = props.length;
  5762. while (length--) {
  5763. var key = props[fromRight ? length : ++index];
  5764. if (iteratee(iterable[key], key, iterable) === false) {
  5765. break;
  5766. }
  5767. }
  5768. return object;
  5769. };
  5770. }
  5771. /**
  5772. * Creates a function that wraps `func` to invoke it with the optional `this`
  5773. * binding of `thisArg`.
  5774. *
  5775. * @private
  5776. * @param {Function} func The function to wrap.
  5777. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5778. * @param {*} [thisArg] The `this` binding of `func`.
  5779. * @returns {Function} Returns the new wrapped function.
  5780. */
  5781. function createBind(func, bitmask, thisArg) {
  5782. var isBind = bitmask & WRAP_BIND_FLAG,
  5783. Ctor = createCtor(func);
  5784. function wrapper() {
  5785. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5786. return fn.apply(isBind ? thisArg : this, arguments);
  5787. }
  5788. return wrapper;
  5789. }
  5790. /**
  5791. * Creates a function like `_.lowerFirst`.
  5792. *
  5793. * @private
  5794. * @param {string} methodName The name of the `String` case method to use.
  5795. * @returns {Function} Returns the new case function.
  5796. */
  5797. function createCaseFirst(methodName) {
  5798. return function(string) {
  5799. string = toString(string);
  5800. var strSymbols = hasUnicode(string)
  5801. ? stringToArray(string)
  5802. : undefined;
  5803. var chr = strSymbols
  5804. ? strSymbols[0]
  5805. : string.charAt(0);
  5806. var trailing = strSymbols
  5807. ? castSlice(strSymbols, 1).join('')
  5808. : string.slice(1);
  5809. return chr[methodName]() + trailing;
  5810. };
  5811. }
  5812. /**
  5813. * Creates a function like `_.camelCase`.
  5814. *
  5815. * @private
  5816. * @param {Function} callback The function to combine each word.
  5817. * @returns {Function} Returns the new compounder function.
  5818. */
  5819. function createCompounder(callback) {
  5820. return function(string) {
  5821. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5822. };
  5823. }
  5824. /**
  5825. * Creates a function that produces an instance of `Ctor` regardless of
  5826. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5827. *
  5828. * @private
  5829. * @param {Function} Ctor The constructor to wrap.
  5830. * @returns {Function} Returns the new wrapped function.
  5831. */
  5832. function createCtor(Ctor) {
  5833. return function() {
  5834. // Use a `switch` statement to work with class constructors. See
  5835. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5836. // for more details.
  5837. var args = arguments;
  5838. switch (args.length) {
  5839. case 0: return new Ctor;
  5840. case 1: return new Ctor(args[0]);
  5841. case 2: return new Ctor(args[0], args[1]);
  5842. case 3: return new Ctor(args[0], args[1], args[2]);
  5843. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5844. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5845. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5846. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5847. }
  5848. var thisBinding = baseCreate(Ctor.prototype),
  5849. result = Ctor.apply(thisBinding, args);
  5850. // Mimic the constructor's `return` behavior.
  5851. // See https://es5.github.io/#x13.2.2 for more details.
  5852. return isObject(result) ? result : thisBinding;
  5853. };
  5854. }
  5855. /**
  5856. * Creates a function that wraps `func` to enable currying.
  5857. *
  5858. * @private
  5859. * @param {Function} func The function to wrap.
  5860. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5861. * @param {number} arity The arity of `func`.
  5862. * @returns {Function} Returns the new wrapped function.
  5863. */
  5864. function createCurry(func, bitmask, arity) {
  5865. var Ctor = createCtor(func);
  5866. function wrapper() {
  5867. var length = arguments.length,
  5868. args = Array(length),
  5869. index = length,
  5870. placeholder = getHolder(wrapper);
  5871. while (index--) {
  5872. args[index] = arguments[index];
  5873. }
  5874. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5875. ? []
  5876. : replaceHolders(args, placeholder);
  5877. length -= holders.length;
  5878. if (length < arity) {
  5879. return createRecurry(
  5880. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5881. args, holders, undefined, undefined, arity - length);
  5882. }
  5883. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5884. return apply(fn, this, args);
  5885. }
  5886. return wrapper;
  5887. }
  5888. /**
  5889. * Creates a `_.find` or `_.findLast` function.
  5890. *
  5891. * @private
  5892. * @param {Function} findIndexFunc The function to find the collection index.
  5893. * @returns {Function} Returns the new find function.
  5894. */
  5895. function createFind(findIndexFunc) {
  5896. return function(collection, predicate, fromIndex) {
  5897. var iterable = Object(collection);
  5898. if (!isArrayLike(collection)) {
  5899. var iteratee = getIteratee(predicate, 3);
  5900. collection = keys(collection);
  5901. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5902. }
  5903. var index = findIndexFunc(collection, predicate, fromIndex);
  5904. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5905. };
  5906. }
  5907. /**
  5908. * Creates a `_.flow` or `_.flowRight` function.
  5909. *
  5910. * @private
  5911. * @param {boolean} [fromRight] Specify iterating from right to left.
  5912. * @returns {Function} Returns the new flow function.
  5913. */
  5914. function createFlow(fromRight) {
  5915. return flatRest(function(funcs) {
  5916. var length = funcs.length,
  5917. index = length,
  5918. prereq = LodashWrapper.prototype.thru;
  5919. if (fromRight) {
  5920. funcs.reverse();
  5921. }
  5922. while (index--) {
  5923. var func = funcs[index];
  5924. if (typeof func != 'function') {
  5925. throw new TypeError(FUNC_ERROR_TEXT);
  5926. }
  5927. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5928. var wrapper = new LodashWrapper([], true);
  5929. }
  5930. }
  5931. index = wrapper ? index : length;
  5932. while (++index < length) {
  5933. func = funcs[index];
  5934. var funcName = getFuncName(func),
  5935. data = funcName == 'wrapper' ? getData(func) : undefined;
  5936. if (data && isLaziable(data[0]) &&
  5937. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5938. !data[4].length && data[9] == 1
  5939. ) {
  5940. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5941. } else {
  5942. wrapper = (func.length == 1 && isLaziable(func))
  5943. ? wrapper[funcName]()
  5944. : wrapper.thru(func);
  5945. }
  5946. }
  5947. return function() {
  5948. var args = arguments,
  5949. value = args[0];
  5950. if (wrapper && args.length == 1 && isArray(value)) {
  5951. return wrapper.plant(value).value();
  5952. }
  5953. var index = 0,
  5954. result = length ? funcs[index].apply(this, args) : value;
  5955. while (++index < length) {
  5956. result = funcs[index].call(this, result);
  5957. }
  5958. return result;
  5959. };
  5960. });
  5961. }
  5962. /**
  5963. * Creates a function that wraps `func` to invoke it with optional `this`
  5964. * binding of `thisArg`, partial application, and currying.
  5965. *
  5966. * @private
  5967. * @param {Function|string} func The function or method name to wrap.
  5968. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5969. * @param {*} [thisArg] The `this` binding of `func`.
  5970. * @param {Array} [partials] The arguments to prepend to those provided to
  5971. * the new function.
  5972. * @param {Array} [holders] The `partials` placeholder indexes.
  5973. * @param {Array} [partialsRight] The arguments to append to those provided
  5974. * to the new function.
  5975. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5976. * @param {Array} [argPos] The argument positions of the new function.
  5977. * @param {number} [ary] The arity cap of `func`.
  5978. * @param {number} [arity] The arity of `func`.
  5979. * @returns {Function} Returns the new wrapped function.
  5980. */
  5981. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5982. var isAry = bitmask & WRAP_ARY_FLAG,
  5983. isBind = bitmask & WRAP_BIND_FLAG,
  5984. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5985. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5986. isFlip = bitmask & WRAP_FLIP_FLAG,
  5987. Ctor = isBindKey ? undefined : createCtor(func);
  5988. function wrapper() {
  5989. var length = arguments.length,
  5990. args = Array(length),
  5991. index = length;
  5992. while (index--) {
  5993. args[index] = arguments[index];
  5994. }
  5995. if (isCurried) {
  5996. var placeholder = getHolder(wrapper),
  5997. holdersCount = countHolders(args, placeholder);
  5998. }
  5999. if (partials) {
  6000. args = composeArgs(args, partials, holders, isCurried);
  6001. }
  6002. if (partialsRight) {
  6003. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6004. }
  6005. length -= holdersCount;
  6006. if (isCurried && length < arity) {
  6007. var newHolders = replaceHolders(args, placeholder);
  6008. return createRecurry(
  6009. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6010. args, newHolders, argPos, ary, arity - length
  6011. );
  6012. }
  6013. var thisBinding = isBind ? thisArg : this,
  6014. fn = isBindKey ? thisBinding[func] : func;
  6015. length = args.length;
  6016. if (argPos) {
  6017. args = reorder(args, argPos);
  6018. } else if (isFlip && length > 1) {
  6019. args.reverse();
  6020. }
  6021. if (isAry && ary < length) {
  6022. args.length = ary;
  6023. }
  6024. if (this && this !== root && this instanceof wrapper) {
  6025. fn = Ctor || createCtor(fn);
  6026. }
  6027. return fn.apply(thisBinding, args);
  6028. }
  6029. return wrapper;
  6030. }
  6031. /**
  6032. * Creates a function like `_.invertBy`.
  6033. *
  6034. * @private
  6035. * @param {Function} setter The function to set accumulator values.
  6036. * @param {Function} toIteratee The function to resolve iteratees.
  6037. * @returns {Function} Returns the new inverter function.
  6038. */
  6039. function createInverter(setter, toIteratee) {
  6040. return function(object, iteratee) {
  6041. return baseInverter(object, setter, toIteratee(iteratee), {});
  6042. };
  6043. }
  6044. /**
  6045. * Creates a function that performs a mathematical operation on two values.
  6046. *
  6047. * @private
  6048. * @param {Function} operator The function to perform the operation.
  6049. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6050. * @returns {Function} Returns the new mathematical operation function.
  6051. */
  6052. function createMathOperation(operator, defaultValue) {
  6053. return function(value, other) {
  6054. var result;
  6055. if (value === undefined && other === undefined) {
  6056. return defaultValue;
  6057. }
  6058. if (value !== undefined) {
  6059. result = value;
  6060. }
  6061. if (other !== undefined) {
  6062. if (result === undefined) {
  6063. return other;
  6064. }
  6065. if (typeof value == 'string' || typeof other == 'string') {
  6066. value = baseToString(value);
  6067. other = baseToString(other);
  6068. } else {
  6069. value = baseToNumber(value);
  6070. other = baseToNumber(other);
  6071. }
  6072. result = operator(value, other);
  6073. }
  6074. return result;
  6075. };
  6076. }
  6077. /**
  6078. * Creates a function like `_.over`.
  6079. *
  6080. * @private
  6081. * @param {Function} arrayFunc The function to iterate over iteratees.
  6082. * @returns {Function} Returns the new over function.
  6083. */
  6084. function createOver(arrayFunc) {
  6085. return flatRest(function(iteratees) {
  6086. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6087. return baseRest(function(args) {
  6088. var thisArg = this;
  6089. return arrayFunc(iteratees, function(iteratee) {
  6090. return apply(iteratee, thisArg, args);
  6091. });
  6092. });
  6093. });
  6094. }
  6095. /**
  6096. * Creates the padding for `string` based on `length`. The `chars` string
  6097. * is truncated if the number of characters exceeds `length`.
  6098. *
  6099. * @private
  6100. * @param {number} length The padding length.
  6101. * @param {string} [chars=' '] The string used as padding.
  6102. * @returns {string} Returns the padding for `string`.
  6103. */
  6104. function createPadding(length, chars) {
  6105. chars = chars === undefined ? ' ' : baseToString(chars);
  6106. var charsLength = chars.length;
  6107. if (charsLength < 2) {
  6108. return charsLength ? baseRepeat(chars, length) : chars;
  6109. }
  6110. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6111. return hasUnicode(chars)
  6112. ? castSlice(stringToArray(result), 0, length).join('')
  6113. : result.slice(0, length);
  6114. }
  6115. /**
  6116. * Creates a function that wraps `func` to invoke it with the `this` binding
  6117. * of `thisArg` and `partials` prepended to the arguments it receives.
  6118. *
  6119. * @private
  6120. * @param {Function} func The function to wrap.
  6121. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6122. * @param {*} thisArg The `this` binding of `func`.
  6123. * @param {Array} partials The arguments to prepend to those provided to
  6124. * the new function.
  6125. * @returns {Function} Returns the new wrapped function.
  6126. */
  6127. function createPartial(func, bitmask, thisArg, partials) {
  6128. var isBind = bitmask & WRAP_BIND_FLAG,
  6129. Ctor = createCtor(func);
  6130. function wrapper() {
  6131. var argsIndex = -1,
  6132. argsLength = arguments.length,
  6133. leftIndex = -1,
  6134. leftLength = partials.length,
  6135. args = Array(leftLength + argsLength),
  6136. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6137. while (++leftIndex < leftLength) {
  6138. args[leftIndex] = partials[leftIndex];
  6139. }
  6140. while (argsLength--) {
  6141. args[leftIndex++] = arguments[++argsIndex];
  6142. }
  6143. return apply(fn, isBind ? thisArg : this, args);
  6144. }
  6145. return wrapper;
  6146. }
  6147. /**
  6148. * Creates a `_.range` or `_.rangeRight` function.
  6149. *
  6150. * @private
  6151. * @param {boolean} [fromRight] Specify iterating from right to left.
  6152. * @returns {Function} Returns the new range function.
  6153. */
  6154. function createRange(fromRight) {
  6155. return function(start, end, step) {
  6156. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6157. end = step = undefined;
  6158. }
  6159. // Ensure the sign of `-0` is preserved.
  6160. start = toFinite(start);
  6161. if (end === undefined) {
  6162. end = start;
  6163. start = 0;
  6164. } else {
  6165. end = toFinite(end);
  6166. }
  6167. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6168. return baseRange(start, end, step, fromRight);
  6169. };
  6170. }
  6171. /**
  6172. * Creates a function that performs a relational operation on two values.
  6173. *
  6174. * @private
  6175. * @param {Function} operator The function to perform the operation.
  6176. * @returns {Function} Returns the new relational operation function.
  6177. */
  6178. function createRelationalOperation(operator) {
  6179. return function(value, other) {
  6180. if (!(typeof value == 'string' && typeof other == 'string')) {
  6181. value = toNumber(value);
  6182. other = toNumber(other);
  6183. }
  6184. return operator(value, other);
  6185. };
  6186. }
  6187. /**
  6188. * Creates a function that wraps `func` to continue currying.
  6189. *
  6190. * @private
  6191. * @param {Function} func The function to wrap.
  6192. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6193. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6194. * @param {*} placeholder The placeholder value.
  6195. * @param {*} [thisArg] The `this` binding of `func`.
  6196. * @param {Array} [partials] The arguments to prepend to those provided to
  6197. * the new function.
  6198. * @param {Array} [holders] The `partials` placeholder indexes.
  6199. * @param {Array} [argPos] The argument positions of the new function.
  6200. * @param {number} [ary] The arity cap of `func`.
  6201. * @param {number} [arity] The arity of `func`.
  6202. * @returns {Function} Returns the new wrapped function.
  6203. */
  6204. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6205. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6206. newHolders = isCurry ? holders : undefined,
  6207. newHoldersRight = isCurry ? undefined : holders,
  6208. newPartials = isCurry ? partials : undefined,
  6209. newPartialsRight = isCurry ? undefined : partials;
  6210. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6211. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6212. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6213. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6214. }
  6215. var newData = [
  6216. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6217. newHoldersRight, argPos, ary, arity
  6218. ];
  6219. var result = wrapFunc.apply(undefined, newData);
  6220. if (isLaziable(func)) {
  6221. setData(result, newData);
  6222. }
  6223. result.placeholder = placeholder;
  6224. return setWrapToString(result, func, bitmask);
  6225. }
  6226. /**
  6227. * Creates a function like `_.round`.
  6228. *
  6229. * @private
  6230. * @param {string} methodName The name of the `Math` method to use when rounding.
  6231. * @returns {Function} Returns the new round function.
  6232. */
  6233. function createRound(methodName) {
  6234. var func = Math[methodName];
  6235. return function(number, precision) {
  6236. number = toNumber(number);
  6237. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6238. if (precision && nativeIsFinite(number)) {
  6239. // Shift with exponential notation to avoid floating-point issues.
  6240. // See [MDN](https://mdn.io/round#Examples) for more details.
  6241. var pair = (toString(number) + 'e').split('e'),
  6242. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6243. pair = (toString(value) + 'e').split('e');
  6244. return +(pair[0] + 'e' + (+pair[1] - precision));
  6245. }
  6246. return func(number);
  6247. };
  6248. }
  6249. /**
  6250. * Creates a set object of `values`.
  6251. *
  6252. * @private
  6253. * @param {Array} values The values to add to the set.
  6254. * @returns {Object} Returns the new set.
  6255. */
  6256. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6257. return new Set(values);
  6258. };
  6259. /**
  6260. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6261. *
  6262. * @private
  6263. * @param {Function} keysFunc The function to get the keys of a given object.
  6264. * @returns {Function} Returns the new pairs function.
  6265. */
  6266. function createToPairs(keysFunc) {
  6267. return function(object) {
  6268. var tag = getTag(object);
  6269. if (tag == mapTag) {
  6270. return mapToArray(object);
  6271. }
  6272. if (tag == setTag) {
  6273. return setToPairs(object);
  6274. }
  6275. return baseToPairs(object, keysFunc(object));
  6276. };
  6277. }
  6278. /**
  6279. * Creates a function that either curries or invokes `func` with optional
  6280. * `this` binding and partially applied arguments.
  6281. *
  6282. * @private
  6283. * @param {Function|string} func The function or method name to wrap.
  6284. * @param {number} bitmask The bitmask flags.
  6285. * 1 - `_.bind`
  6286. * 2 - `_.bindKey`
  6287. * 4 - `_.curry` or `_.curryRight` of a bound function
  6288. * 8 - `_.curry`
  6289. * 16 - `_.curryRight`
  6290. * 32 - `_.partial`
  6291. * 64 - `_.partialRight`
  6292. * 128 - `_.rearg`
  6293. * 256 - `_.ary`
  6294. * 512 - `_.flip`
  6295. * @param {*} [thisArg] The `this` binding of `func`.
  6296. * @param {Array} [partials] The arguments to be partially applied.
  6297. * @param {Array} [holders] The `partials` placeholder indexes.
  6298. * @param {Array} [argPos] The argument positions of the new function.
  6299. * @param {number} [ary] The arity cap of `func`.
  6300. * @param {number} [arity] The arity of `func`.
  6301. * @returns {Function} Returns the new wrapped function.
  6302. */
  6303. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6304. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6305. if (!isBindKey && typeof func != 'function') {
  6306. throw new TypeError(FUNC_ERROR_TEXT);
  6307. }
  6308. var length = partials ? partials.length : 0;
  6309. if (!length) {
  6310. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6311. partials = holders = undefined;
  6312. }
  6313. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6314. arity = arity === undefined ? arity : toInteger(arity);
  6315. length -= holders ? holders.length : 0;
  6316. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6317. var partialsRight = partials,
  6318. holdersRight = holders;
  6319. partials = holders = undefined;
  6320. }
  6321. var data = isBindKey ? undefined : getData(func);
  6322. var newData = [
  6323. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6324. argPos, ary, arity
  6325. ];
  6326. if (data) {
  6327. mergeData(newData, data);
  6328. }
  6329. func = newData[0];
  6330. bitmask = newData[1];
  6331. thisArg = newData[2];
  6332. partials = newData[3];
  6333. holders = newData[4];
  6334. arity = newData[9] = newData[9] === undefined
  6335. ? (isBindKey ? 0 : func.length)
  6336. : nativeMax(newData[9] - length, 0);
  6337. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6338. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6339. }
  6340. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6341. var result = createBind(func, bitmask, thisArg);
  6342. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6343. result = createCurry(func, bitmask, arity);
  6344. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6345. result = createPartial(func, bitmask, thisArg, partials);
  6346. } else {
  6347. result = createHybrid.apply(undefined, newData);
  6348. }
  6349. var setter = data ? baseSetData : setData;
  6350. return setWrapToString(setter(result, newData), func, bitmask);
  6351. }
  6352. /**
  6353. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6354. * of source objects to the destination object for all destination properties
  6355. * that resolve to `undefined`.
  6356. *
  6357. * @private
  6358. * @param {*} objValue The destination value.
  6359. * @param {*} srcValue The source value.
  6360. * @param {string} key The key of the property to assign.
  6361. * @param {Object} object The parent object of `objValue`.
  6362. * @returns {*} Returns the value to assign.
  6363. */
  6364. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6365. if (objValue === undefined ||
  6366. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6367. return srcValue;
  6368. }
  6369. return objValue;
  6370. }
  6371. /**
  6372. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6373. * objects into destination objects that are passed thru.
  6374. *
  6375. * @private
  6376. * @param {*} objValue The destination value.
  6377. * @param {*} srcValue The source value.
  6378. * @param {string} key The key of the property to merge.
  6379. * @param {Object} object The parent object of `objValue`.
  6380. * @param {Object} source The parent object of `srcValue`.
  6381. * @param {Object} [stack] Tracks traversed source values and their merged
  6382. * counterparts.
  6383. * @returns {*} Returns the value to assign.
  6384. */
  6385. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6386. if (isObject(objValue) && isObject(srcValue)) {
  6387. // Recursively merge objects and arrays (susceptible to call stack limits).
  6388. stack.set(srcValue, objValue);
  6389. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6390. stack['delete'](srcValue);
  6391. }
  6392. return objValue;
  6393. }
  6394. /**
  6395. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6396. * objects.
  6397. *
  6398. * @private
  6399. * @param {*} value The value to inspect.
  6400. * @param {string} key The key of the property to inspect.
  6401. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6402. */
  6403. function customOmitClone(value) {
  6404. return isPlainObject(value) ? undefined : value;
  6405. }
  6406. /**
  6407. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6408. * partial deep comparisons.
  6409. *
  6410. * @private
  6411. * @param {Array} array The array to compare.
  6412. * @param {Array} other The other array to compare.
  6413. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6414. * @param {Function} customizer The function to customize comparisons.
  6415. * @param {Function} equalFunc The function to determine equivalents of values.
  6416. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6417. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6418. */
  6419. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6420. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6421. arrLength = array.length,
  6422. othLength = other.length;
  6423. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6424. return false;
  6425. }
  6426. // Check that cyclic values are equal.
  6427. var arrStacked = stack.get(array);
  6428. var othStacked = stack.get(other);
  6429. if (arrStacked && othStacked) {
  6430. return arrStacked == other && othStacked == array;
  6431. }
  6432. var index = -1,
  6433. result = true,
  6434. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6435. stack.set(array, other);
  6436. stack.set(other, array);
  6437. // Ignore non-index properties.
  6438. while (++index < arrLength) {
  6439. var arrValue = array[index],
  6440. othValue = other[index];
  6441. if (customizer) {
  6442. var compared = isPartial
  6443. ? customizer(othValue, arrValue, index, other, array, stack)
  6444. : customizer(arrValue, othValue, index, array, other, stack);
  6445. }
  6446. if (compared !== undefined) {
  6447. if (compared) {
  6448. continue;
  6449. }
  6450. result = false;
  6451. break;
  6452. }
  6453. // Recursively compare arrays (susceptible to call stack limits).
  6454. if (seen) {
  6455. if (!arraySome(other, function(othValue, othIndex) {
  6456. if (!cacheHas(seen, othIndex) &&
  6457. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6458. return seen.push(othIndex);
  6459. }
  6460. })) {
  6461. result = false;
  6462. break;
  6463. }
  6464. } else if (!(
  6465. arrValue === othValue ||
  6466. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6467. )) {
  6468. result = false;
  6469. break;
  6470. }
  6471. }
  6472. stack['delete'](array);
  6473. stack['delete'](other);
  6474. return result;
  6475. }
  6476. /**
  6477. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6478. * the same `toStringTag`.
  6479. *
  6480. * **Note:** This function only supports comparing values with tags of
  6481. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6482. *
  6483. * @private
  6484. * @param {Object} object The object to compare.
  6485. * @param {Object} other The other object to compare.
  6486. * @param {string} tag The `toStringTag` of the objects to compare.
  6487. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6488. * @param {Function} customizer The function to customize comparisons.
  6489. * @param {Function} equalFunc The function to determine equivalents of values.
  6490. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6491. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6492. */
  6493. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6494. switch (tag) {
  6495. case dataViewTag:
  6496. if ((object.byteLength != other.byteLength) ||
  6497. (object.byteOffset != other.byteOffset)) {
  6498. return false;
  6499. }
  6500. object = object.buffer;
  6501. other = other.buffer;
  6502. case arrayBufferTag:
  6503. if ((object.byteLength != other.byteLength) ||
  6504. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6505. return false;
  6506. }
  6507. return true;
  6508. case boolTag:
  6509. case dateTag:
  6510. case numberTag:
  6511. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6512. // Invalid dates are coerced to `NaN`.
  6513. return eq(+object, +other);
  6514. case errorTag:
  6515. return object.name == other.name && object.message == other.message;
  6516. case regexpTag:
  6517. case stringTag:
  6518. // Coerce regexes to strings and treat strings, primitives and objects,
  6519. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6520. // for more details.
  6521. return object == (other + '');
  6522. case mapTag:
  6523. var convert = mapToArray;
  6524. case setTag:
  6525. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6526. convert || (convert = setToArray);
  6527. if (object.size != other.size && !isPartial) {
  6528. return false;
  6529. }
  6530. // Assume cyclic values are equal.
  6531. var stacked = stack.get(object);
  6532. if (stacked) {
  6533. return stacked == other;
  6534. }
  6535. bitmask |= COMPARE_UNORDERED_FLAG;
  6536. // Recursively compare objects (susceptible to call stack limits).
  6537. stack.set(object, other);
  6538. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6539. stack['delete'](object);
  6540. return result;
  6541. case symbolTag:
  6542. if (symbolValueOf) {
  6543. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6544. }
  6545. }
  6546. return false;
  6547. }
  6548. /**
  6549. * A specialized version of `baseIsEqualDeep` for objects with support for
  6550. * partial deep comparisons.
  6551. *
  6552. * @private
  6553. * @param {Object} object The object to compare.
  6554. * @param {Object} other The other object to compare.
  6555. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6556. * @param {Function} customizer The function to customize comparisons.
  6557. * @param {Function} equalFunc The function to determine equivalents of values.
  6558. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6559. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6560. */
  6561. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6562. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6563. objProps = getAllKeys(object),
  6564. objLength = objProps.length,
  6565. othProps = getAllKeys(other),
  6566. othLength = othProps.length;
  6567. if (objLength != othLength && !isPartial) {
  6568. return false;
  6569. }
  6570. var index = objLength;
  6571. while (index--) {
  6572. var key = objProps[index];
  6573. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6574. return false;
  6575. }
  6576. }
  6577. // Check that cyclic values are equal.
  6578. var objStacked = stack.get(object);
  6579. var othStacked = stack.get(other);
  6580. if (objStacked && othStacked) {
  6581. return objStacked == other && othStacked == object;
  6582. }
  6583. var result = true;
  6584. stack.set(object, other);
  6585. stack.set(other, object);
  6586. var skipCtor = isPartial;
  6587. while (++index < objLength) {
  6588. key = objProps[index];
  6589. var objValue = object[key],
  6590. othValue = other[key];
  6591. if (customizer) {
  6592. var compared = isPartial
  6593. ? customizer(othValue, objValue, key, other, object, stack)
  6594. : customizer(objValue, othValue, key, object, other, stack);
  6595. }
  6596. // Recursively compare objects (susceptible to call stack limits).
  6597. if (!(compared === undefined
  6598. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6599. : compared
  6600. )) {
  6601. result = false;
  6602. break;
  6603. }
  6604. skipCtor || (skipCtor = key == 'constructor');
  6605. }
  6606. if (result && !skipCtor) {
  6607. var objCtor = object.constructor,
  6608. othCtor = other.constructor;
  6609. // Non `Object` object instances with different constructors are not equal.
  6610. if (objCtor != othCtor &&
  6611. ('constructor' in object && 'constructor' in other) &&
  6612. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6613. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6614. result = false;
  6615. }
  6616. }
  6617. stack['delete'](object);
  6618. stack['delete'](other);
  6619. return result;
  6620. }
  6621. /**
  6622. * A specialized version of `baseRest` which flattens the rest array.
  6623. *
  6624. * @private
  6625. * @param {Function} func The function to apply a rest parameter to.
  6626. * @returns {Function} Returns the new function.
  6627. */
  6628. function flatRest(func) {
  6629. return setToString(overRest(func, undefined, flatten), func + '');
  6630. }
  6631. /**
  6632. * Creates an array of own enumerable property names and symbols of `object`.
  6633. *
  6634. * @private
  6635. * @param {Object} object The object to query.
  6636. * @returns {Array} Returns the array of property names and symbols.
  6637. */
  6638. function getAllKeys(object) {
  6639. return baseGetAllKeys(object, keys, getSymbols);
  6640. }
  6641. /**
  6642. * Creates an array of own and inherited enumerable property names and
  6643. * symbols of `object`.
  6644. *
  6645. * @private
  6646. * @param {Object} object The object to query.
  6647. * @returns {Array} Returns the array of property names and symbols.
  6648. */
  6649. function getAllKeysIn(object) {
  6650. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6651. }
  6652. /**
  6653. * Gets metadata for `func`.
  6654. *
  6655. * @private
  6656. * @param {Function} func The function to query.
  6657. * @returns {*} Returns the metadata for `func`.
  6658. */
  6659. var getData = !metaMap ? noop : function(func) {
  6660. return metaMap.get(func);
  6661. };
  6662. /**
  6663. * Gets the name of `func`.
  6664. *
  6665. * @private
  6666. * @param {Function} func The function to query.
  6667. * @returns {string} Returns the function name.
  6668. */
  6669. function getFuncName(func) {
  6670. var result = (func.name + ''),
  6671. array = realNames[result],
  6672. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6673. while (length--) {
  6674. var data = array[length],
  6675. otherFunc = data.func;
  6676. if (otherFunc == null || otherFunc == func) {
  6677. return data.name;
  6678. }
  6679. }
  6680. return result;
  6681. }
  6682. /**
  6683. * Gets the argument placeholder value for `func`.
  6684. *
  6685. * @private
  6686. * @param {Function} func The function to inspect.
  6687. * @returns {*} Returns the placeholder value.
  6688. */
  6689. function getHolder(func) {
  6690. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6691. return object.placeholder;
  6692. }
  6693. /**
  6694. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6695. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6696. * If arguments are provided, the chosen function is invoked with them and
  6697. * its result is returned.
  6698. *
  6699. * @private
  6700. * @param {*} [value] The value to convert to an iteratee.
  6701. * @param {number} [arity] The arity of the created iteratee.
  6702. * @returns {Function} Returns the chosen function or its result.
  6703. */
  6704. function getIteratee() {
  6705. var result = lodash.iteratee || iteratee;
  6706. result = result === iteratee ? baseIteratee : result;
  6707. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6708. }
  6709. /**
  6710. * Gets the data for `map`.
  6711. *
  6712. * @private
  6713. * @param {Object} map The map to query.
  6714. * @param {string} key The reference key.
  6715. * @returns {*} Returns the map data.
  6716. */
  6717. function getMapData(map, key) {
  6718. var data = map.__data__;
  6719. return isKeyable(key)
  6720. ? data[typeof key == 'string' ? 'string' : 'hash']
  6721. : data.map;
  6722. }
  6723. /**
  6724. * Gets the property names, values, and compare flags of `object`.
  6725. *
  6726. * @private
  6727. * @param {Object} object The object to query.
  6728. * @returns {Array} Returns the match data of `object`.
  6729. */
  6730. function getMatchData(object) {
  6731. var result = keys(object),
  6732. length = result.length;
  6733. while (length--) {
  6734. var key = result[length],
  6735. value = object[key];
  6736. result[length] = [key, value, isStrictComparable(value)];
  6737. }
  6738. return result;
  6739. }
  6740. /**
  6741. * Gets the native function at `key` of `object`.
  6742. *
  6743. * @private
  6744. * @param {Object} object The object to query.
  6745. * @param {string} key The key of the method to get.
  6746. * @returns {*} Returns the function if it's native, else `undefined`.
  6747. */
  6748. function getNative(object, key) {
  6749. var value = getValue(object, key);
  6750. return baseIsNative(value) ? value : undefined;
  6751. }
  6752. /**
  6753. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6754. *
  6755. * @private
  6756. * @param {*} value The value to query.
  6757. * @returns {string} Returns the raw `toStringTag`.
  6758. */
  6759. function getRawTag(value) {
  6760. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6761. tag = value[symToStringTag];
  6762. try {
  6763. value[symToStringTag] = undefined;
  6764. var unmasked = true;
  6765. } catch (e) {}
  6766. var result = nativeObjectToString.call(value);
  6767. if (unmasked) {
  6768. if (isOwn) {
  6769. value[symToStringTag] = tag;
  6770. } else {
  6771. delete value[symToStringTag];
  6772. }
  6773. }
  6774. return result;
  6775. }
  6776. /**
  6777. * Creates an array of the own enumerable symbols of `object`.
  6778. *
  6779. * @private
  6780. * @param {Object} object The object to query.
  6781. * @returns {Array} Returns the array of symbols.
  6782. */
  6783. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6784. if (object == null) {
  6785. return [];
  6786. }
  6787. object = Object(object);
  6788. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6789. return propertyIsEnumerable.call(object, symbol);
  6790. });
  6791. };
  6792. /**
  6793. * Creates an array of the own and inherited enumerable symbols of `object`.
  6794. *
  6795. * @private
  6796. * @param {Object} object The object to query.
  6797. * @returns {Array} Returns the array of symbols.
  6798. */
  6799. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6800. var result = [];
  6801. while (object) {
  6802. arrayPush(result, getSymbols(object));
  6803. object = getPrototype(object);
  6804. }
  6805. return result;
  6806. };
  6807. /**
  6808. * Gets the `toStringTag` of `value`.
  6809. *
  6810. * @private
  6811. * @param {*} value The value to query.
  6812. * @returns {string} Returns the `toStringTag`.
  6813. */
  6814. var getTag = baseGetTag;
  6815. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6816. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6817. (Map && getTag(new Map) != mapTag) ||
  6818. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6819. (Set && getTag(new Set) != setTag) ||
  6820. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6821. getTag = function(value) {
  6822. var result = baseGetTag(value),
  6823. Ctor = result == objectTag ? value.constructor : undefined,
  6824. ctorString = Ctor ? toSource(Ctor) : '';
  6825. if (ctorString) {
  6826. switch (ctorString) {
  6827. case dataViewCtorString: return dataViewTag;
  6828. case mapCtorString: return mapTag;
  6829. case promiseCtorString: return promiseTag;
  6830. case setCtorString: return setTag;
  6831. case weakMapCtorString: return weakMapTag;
  6832. }
  6833. }
  6834. return result;
  6835. };
  6836. }
  6837. /**
  6838. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6839. *
  6840. * @private
  6841. * @param {number} start The start of the view.
  6842. * @param {number} end The end of the view.
  6843. * @param {Array} transforms The transformations to apply to the view.
  6844. * @returns {Object} Returns an object containing the `start` and `end`
  6845. * positions of the view.
  6846. */
  6847. function getView(start, end, transforms) {
  6848. var index = -1,
  6849. length = transforms.length;
  6850. while (++index < length) {
  6851. var data = transforms[index],
  6852. size = data.size;
  6853. switch (data.type) {
  6854. case 'drop': start += size; break;
  6855. case 'dropRight': end -= size; break;
  6856. case 'take': end = nativeMin(end, start + size); break;
  6857. case 'takeRight': start = nativeMax(start, end - size); break;
  6858. }
  6859. }
  6860. return { 'start': start, 'end': end };
  6861. }
  6862. /**
  6863. * Extracts wrapper details from the `source` body comment.
  6864. *
  6865. * @private
  6866. * @param {string} source The source to inspect.
  6867. * @returns {Array} Returns the wrapper details.
  6868. */
  6869. function getWrapDetails(source) {
  6870. var match = source.match(reWrapDetails);
  6871. return match ? match[1].split(reSplitDetails) : [];
  6872. }
  6873. /**
  6874. * Checks if `path` exists on `object`.
  6875. *
  6876. * @private
  6877. * @param {Object} object The object to query.
  6878. * @param {Array|string} path The path to check.
  6879. * @param {Function} hasFunc The function to check properties.
  6880. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6881. */
  6882. function hasPath(object, path, hasFunc) {
  6883. path = castPath(path, object);
  6884. var index = -1,
  6885. length = path.length,
  6886. result = false;
  6887. while (++index < length) {
  6888. var key = toKey(path[index]);
  6889. if (!(result = object != null && hasFunc(object, key))) {
  6890. break;
  6891. }
  6892. object = object[key];
  6893. }
  6894. if (result || ++index != length) {
  6895. return result;
  6896. }
  6897. length = object == null ? 0 : object.length;
  6898. return !!length && isLength(length) && isIndex(key, length) &&
  6899. (isArray(object) || isArguments(object));
  6900. }
  6901. /**
  6902. * Initializes an array clone.
  6903. *
  6904. * @private
  6905. * @param {Array} array The array to clone.
  6906. * @returns {Array} Returns the initialized clone.
  6907. */
  6908. function initCloneArray(array) {
  6909. var length = array.length,
  6910. result = new array.constructor(length);
  6911. // Add properties assigned by `RegExp#exec`.
  6912. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6913. result.index = array.index;
  6914. result.input = array.input;
  6915. }
  6916. return result;
  6917. }
  6918. /**
  6919. * Initializes an object clone.
  6920. *
  6921. * @private
  6922. * @param {Object} object The object to clone.
  6923. * @returns {Object} Returns the initialized clone.
  6924. */
  6925. function initCloneObject(object) {
  6926. return (typeof object.constructor == 'function' && !isPrototype(object))
  6927. ? baseCreate(getPrototype(object))
  6928. : {};
  6929. }
  6930. /**
  6931. * Initializes an object clone based on its `toStringTag`.
  6932. *
  6933. * **Note:** This function only supports cloning values with tags of
  6934. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6935. *
  6936. * @private
  6937. * @param {Object} object The object to clone.
  6938. * @param {string} tag The `toStringTag` of the object to clone.
  6939. * @param {boolean} [isDeep] Specify a deep clone.
  6940. * @returns {Object} Returns the initialized clone.
  6941. */
  6942. function initCloneByTag(object, tag, isDeep) {
  6943. var Ctor = object.constructor;
  6944. switch (tag) {
  6945. case arrayBufferTag:
  6946. return cloneArrayBuffer(object);
  6947. case boolTag:
  6948. case dateTag:
  6949. return new Ctor(+object);
  6950. case dataViewTag:
  6951. return cloneDataView(object, isDeep);
  6952. case float32Tag: case float64Tag:
  6953. case int8Tag: case int16Tag: case int32Tag:
  6954. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6955. return cloneTypedArray(object, isDeep);
  6956. case mapTag:
  6957. return new Ctor;
  6958. case numberTag:
  6959. case stringTag:
  6960. return new Ctor(object);
  6961. case regexpTag:
  6962. return cloneRegExp(object);
  6963. case setTag:
  6964. return new Ctor;
  6965. case symbolTag:
  6966. return cloneSymbol(object);
  6967. }
  6968. }
  6969. /**
  6970. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6971. *
  6972. * @private
  6973. * @param {string} source The source to modify.
  6974. * @returns {Array} details The details to insert.
  6975. * @returns {string} Returns the modified source.
  6976. */
  6977. function insertWrapDetails(source, details) {
  6978. var length = details.length;
  6979. if (!length) {
  6980. return source;
  6981. }
  6982. var lastIndex = length - 1;
  6983. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6984. details = details.join(length > 2 ? ', ' : ' ');
  6985. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6986. }
  6987. /**
  6988. * Checks if `value` is a flattenable `arguments` object or array.
  6989. *
  6990. * @private
  6991. * @param {*} value The value to check.
  6992. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6993. */
  6994. function isFlattenable(value) {
  6995. return isArray(value) || isArguments(value) ||
  6996. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6997. }
  6998. /**
  6999. * Checks if `value` is a valid array-like index.
  7000. *
  7001. * @private
  7002. * @param {*} value The value to check.
  7003. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7004. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7005. */
  7006. function isIndex(value, length) {
  7007. var type = typeof value;
  7008. length = length == null ? MAX_SAFE_INTEGER : length;
  7009. return !!length &&
  7010. (type == 'number' ||
  7011. (type != 'symbol' && reIsUint.test(value))) &&
  7012. (value > -1 && value % 1 == 0 && value < length);
  7013. }
  7014. /**
  7015. * Checks if the given arguments are from an iteratee call.
  7016. *
  7017. * @private
  7018. * @param {*} value The potential iteratee value argument.
  7019. * @param {*} index The potential iteratee index or key argument.
  7020. * @param {*} object The potential iteratee object argument.
  7021. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7022. * else `false`.
  7023. */
  7024. function isIterateeCall(value, index, object) {
  7025. if (!isObject(object)) {
  7026. return false;
  7027. }
  7028. var type = typeof index;
  7029. if (type == 'number'
  7030. ? (isArrayLike(object) && isIndex(index, object.length))
  7031. : (type == 'string' && index in object)
  7032. ) {
  7033. return eq(object[index], value);
  7034. }
  7035. return false;
  7036. }
  7037. /**
  7038. * Checks if `value` is a property name and not a property path.
  7039. *
  7040. * @private
  7041. * @param {*} value The value to check.
  7042. * @param {Object} [object] The object to query keys on.
  7043. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7044. */
  7045. function isKey(value, object) {
  7046. if (isArray(value)) {
  7047. return false;
  7048. }
  7049. var type = typeof value;
  7050. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7051. value == null || isSymbol(value)) {
  7052. return true;
  7053. }
  7054. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7055. (object != null && value in Object(object));
  7056. }
  7057. /**
  7058. * Checks if `value` is suitable for use as unique object key.
  7059. *
  7060. * @private
  7061. * @param {*} value The value to check.
  7062. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7063. */
  7064. function isKeyable(value) {
  7065. var type = typeof value;
  7066. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7067. ? (value !== '__proto__')
  7068. : (value === null);
  7069. }
  7070. /**
  7071. * Checks if `func` has a lazy counterpart.
  7072. *
  7073. * @private
  7074. * @param {Function} func The function to check.
  7075. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7076. * else `false`.
  7077. */
  7078. function isLaziable(func) {
  7079. var funcName = getFuncName(func),
  7080. other = lodash[funcName];
  7081. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7082. return false;
  7083. }
  7084. if (func === other) {
  7085. return true;
  7086. }
  7087. var data = getData(other);
  7088. return !!data && func === data[0];
  7089. }
  7090. /**
  7091. * Checks if `func` has its source masked.
  7092. *
  7093. * @private
  7094. * @param {Function} func The function to check.
  7095. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7096. */
  7097. function isMasked(func) {
  7098. return !!maskSrcKey && (maskSrcKey in func);
  7099. }
  7100. /**
  7101. * Checks if `func` is capable of being masked.
  7102. *
  7103. * @private
  7104. * @param {*} value The value to check.
  7105. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7106. */
  7107. var isMaskable = coreJsData ? isFunction : stubFalse;
  7108. /**
  7109. * Checks if `value` is likely a prototype object.
  7110. *
  7111. * @private
  7112. * @param {*} value The value to check.
  7113. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7114. */
  7115. function isPrototype(value) {
  7116. var Ctor = value && value.constructor,
  7117. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7118. return value === proto;
  7119. }
  7120. /**
  7121. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7122. *
  7123. * @private
  7124. * @param {*} value The value to check.
  7125. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7126. * equality comparisons, else `false`.
  7127. */
  7128. function isStrictComparable(value) {
  7129. return value === value && !isObject(value);
  7130. }
  7131. /**
  7132. * A specialized version of `matchesProperty` for source values suitable
  7133. * for strict equality comparisons, i.e. `===`.
  7134. *
  7135. * @private
  7136. * @param {string} key The key of the property to get.
  7137. * @param {*} srcValue The value to match.
  7138. * @returns {Function} Returns the new spec function.
  7139. */
  7140. function matchesStrictComparable(key, srcValue) {
  7141. return function(object) {
  7142. if (object == null) {
  7143. return false;
  7144. }
  7145. return object[key] === srcValue &&
  7146. (srcValue !== undefined || (key in Object(object)));
  7147. };
  7148. }
  7149. /**
  7150. * A specialized version of `_.memoize` which clears the memoized function's
  7151. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7152. *
  7153. * @private
  7154. * @param {Function} func The function to have its output memoized.
  7155. * @returns {Function} Returns the new memoized function.
  7156. */
  7157. function memoizeCapped(func) {
  7158. var result = memoize(func, function(key) {
  7159. if (cache.size === MAX_MEMOIZE_SIZE) {
  7160. cache.clear();
  7161. }
  7162. return key;
  7163. });
  7164. var cache = result.cache;
  7165. return result;
  7166. }
  7167. /**
  7168. * Merges the function metadata of `source` into `data`.
  7169. *
  7170. * Merging metadata reduces the number of wrappers used to invoke a function.
  7171. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7172. * may be applied regardless of execution order. Methods like `_.ary` and
  7173. * `_.rearg` modify function arguments, making the order in which they are
  7174. * executed important, preventing the merging of metadata. However, we make
  7175. * an exception for a safe combined case where curried functions have `_.ary`
  7176. * and or `_.rearg` applied.
  7177. *
  7178. * @private
  7179. * @param {Array} data The destination metadata.
  7180. * @param {Array} source The source metadata.
  7181. * @returns {Array} Returns `data`.
  7182. */
  7183. function mergeData(data, source) {
  7184. var bitmask = data[1],
  7185. srcBitmask = source[1],
  7186. newBitmask = bitmask | srcBitmask,
  7187. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7188. var isCombo =
  7189. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7190. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7191. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7192. // Exit early if metadata can't be merged.
  7193. if (!(isCommon || isCombo)) {
  7194. return data;
  7195. }
  7196. // Use source `thisArg` if available.
  7197. if (srcBitmask & WRAP_BIND_FLAG) {
  7198. data[2] = source[2];
  7199. // Set when currying a bound function.
  7200. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7201. }
  7202. // Compose partial arguments.
  7203. var value = source[3];
  7204. if (value) {
  7205. var partials = data[3];
  7206. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7207. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7208. }
  7209. // Compose partial right arguments.
  7210. value = source[5];
  7211. if (value) {
  7212. partials = data[5];
  7213. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7214. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7215. }
  7216. // Use source `argPos` if available.
  7217. value = source[7];
  7218. if (value) {
  7219. data[7] = value;
  7220. }
  7221. // Use source `ary` if it's smaller.
  7222. if (srcBitmask & WRAP_ARY_FLAG) {
  7223. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7224. }
  7225. // Use source `arity` if one is not provided.
  7226. if (data[9] == null) {
  7227. data[9] = source[9];
  7228. }
  7229. // Use source `func` and merge bitmasks.
  7230. data[0] = source[0];
  7231. data[1] = newBitmask;
  7232. return data;
  7233. }
  7234. /**
  7235. * This function is like
  7236. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7237. * except that it includes inherited enumerable properties.
  7238. *
  7239. * @private
  7240. * @param {Object} object The object to query.
  7241. * @returns {Array} Returns the array of property names.
  7242. */
  7243. function nativeKeysIn(object) {
  7244. var result = [];
  7245. if (object != null) {
  7246. for (var key in Object(object)) {
  7247. result.push(key);
  7248. }
  7249. }
  7250. return result;
  7251. }
  7252. /**
  7253. * Converts `value` to a string using `Object.prototype.toString`.
  7254. *
  7255. * @private
  7256. * @param {*} value The value to convert.
  7257. * @returns {string} Returns the converted string.
  7258. */
  7259. function objectToString(value) {
  7260. return nativeObjectToString.call(value);
  7261. }
  7262. /**
  7263. * A specialized version of `baseRest` which transforms the rest array.
  7264. *
  7265. * @private
  7266. * @param {Function} func The function to apply a rest parameter to.
  7267. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7268. * @param {Function} transform The rest array transform.
  7269. * @returns {Function} Returns the new function.
  7270. */
  7271. function overRest(func, start, transform) {
  7272. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7273. return function() {
  7274. var args = arguments,
  7275. index = -1,
  7276. length = nativeMax(args.length - start, 0),
  7277. array = Array(length);
  7278. while (++index < length) {
  7279. array[index] = args[start + index];
  7280. }
  7281. index = -1;
  7282. var otherArgs = Array(start + 1);
  7283. while (++index < start) {
  7284. otherArgs[index] = args[index];
  7285. }
  7286. otherArgs[start] = transform(array);
  7287. return apply(func, this, otherArgs);
  7288. };
  7289. }
  7290. /**
  7291. * Gets the parent value at `path` of `object`.
  7292. *
  7293. * @private
  7294. * @param {Object} object The object to query.
  7295. * @param {Array} path The path to get the parent value of.
  7296. * @returns {*} Returns the parent value.
  7297. */
  7298. function parent(object, path) {
  7299. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7300. }
  7301. /**
  7302. * Reorder `array` according to the specified indexes where the element at
  7303. * the first index is assigned as the first element, the element at
  7304. * the second index is assigned as the second element, and so on.
  7305. *
  7306. * @private
  7307. * @param {Array} array The array to reorder.
  7308. * @param {Array} indexes The arranged array indexes.
  7309. * @returns {Array} Returns `array`.
  7310. */
  7311. function reorder(array, indexes) {
  7312. var arrLength = array.length,
  7313. length = nativeMin(indexes.length, arrLength),
  7314. oldArray = copyArray(array);
  7315. while (length--) {
  7316. var index = indexes[length];
  7317. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7318. }
  7319. return array;
  7320. }
  7321. /**
  7322. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7323. *
  7324. * @private
  7325. * @param {Object} object The object to query.
  7326. * @param {string} key The key of the property to get.
  7327. * @returns {*} Returns the property value.
  7328. */
  7329. function safeGet(object, key) {
  7330. if (key === 'constructor' && typeof object[key] === 'function') {
  7331. return;
  7332. }
  7333. if (key == '__proto__') {
  7334. return;
  7335. }
  7336. return object[key];
  7337. }
  7338. /**
  7339. * Sets metadata for `func`.
  7340. *
  7341. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7342. * period of time, it will trip its breaker and transition to an identity
  7343. * function to avoid garbage collection pauses in V8. See
  7344. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7345. * for more details.
  7346. *
  7347. * @private
  7348. * @param {Function} func The function to associate metadata with.
  7349. * @param {*} data The metadata.
  7350. * @returns {Function} Returns `func`.
  7351. */
  7352. var setData = shortOut(baseSetData);
  7353. /**
  7354. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7355. *
  7356. * @private
  7357. * @param {Function} func The function to delay.
  7358. * @param {number} wait The number of milliseconds to delay invocation.
  7359. * @returns {number|Object} Returns the timer id or timeout object.
  7360. */
  7361. var setTimeout = ctxSetTimeout || function(func, wait) {
  7362. return root.setTimeout(func, wait);
  7363. };
  7364. /**
  7365. * Sets the `toString` method of `func` to return `string`.
  7366. *
  7367. * @private
  7368. * @param {Function} func The function to modify.
  7369. * @param {Function} string The `toString` result.
  7370. * @returns {Function} Returns `func`.
  7371. */
  7372. var setToString = shortOut(baseSetToString);
  7373. /**
  7374. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7375. * with wrapper details in a comment at the top of the source body.
  7376. *
  7377. * @private
  7378. * @param {Function} wrapper The function to modify.
  7379. * @param {Function} reference The reference function.
  7380. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7381. * @returns {Function} Returns `wrapper`.
  7382. */
  7383. function setWrapToString(wrapper, reference, bitmask) {
  7384. var source = (reference + '');
  7385. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7386. }
  7387. /**
  7388. * Creates a function that'll short out and invoke `identity` instead
  7389. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7390. * milliseconds.
  7391. *
  7392. * @private
  7393. * @param {Function} func The function to restrict.
  7394. * @returns {Function} Returns the new shortable function.
  7395. */
  7396. function shortOut(func) {
  7397. var count = 0,
  7398. lastCalled = 0;
  7399. return function() {
  7400. var stamp = nativeNow(),
  7401. remaining = HOT_SPAN - (stamp - lastCalled);
  7402. lastCalled = stamp;
  7403. if (remaining > 0) {
  7404. if (++count >= HOT_COUNT) {
  7405. return arguments[0];
  7406. }
  7407. } else {
  7408. count = 0;
  7409. }
  7410. return func.apply(undefined, arguments);
  7411. };
  7412. }
  7413. /**
  7414. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7415. *
  7416. * @private
  7417. * @param {Array} array The array to shuffle.
  7418. * @param {number} [size=array.length] The size of `array`.
  7419. * @returns {Array} Returns `array`.
  7420. */
  7421. function shuffleSelf(array, size) {
  7422. var index = -1,
  7423. length = array.length,
  7424. lastIndex = length - 1;
  7425. size = size === undefined ? length : size;
  7426. while (++index < size) {
  7427. var rand = baseRandom(index, lastIndex),
  7428. value = array[rand];
  7429. array[rand] = array[index];
  7430. array[index] = value;
  7431. }
  7432. array.length = size;
  7433. return array;
  7434. }
  7435. /**
  7436. * Converts `string` to a property path array.
  7437. *
  7438. * @private
  7439. * @param {string} string The string to convert.
  7440. * @returns {Array} Returns the property path array.
  7441. */
  7442. var stringToPath = memoizeCapped(function(string) {
  7443. var result = [];
  7444. if (string.charCodeAt(0) === 46 /* . */) {
  7445. result.push('');
  7446. }
  7447. string.replace(rePropName, function(match, number, quote, subString) {
  7448. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7449. });
  7450. return result;
  7451. });
  7452. /**
  7453. * Converts `value` to a string key if it's not a string or symbol.
  7454. *
  7455. * @private
  7456. * @param {*} value The value to inspect.
  7457. * @returns {string|symbol} Returns the key.
  7458. */
  7459. function toKey(value) {
  7460. if (typeof value == 'string' || isSymbol(value)) {
  7461. return value;
  7462. }
  7463. var result = (value + '');
  7464. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7465. }
  7466. /**
  7467. * Converts `func` to its source code.
  7468. *
  7469. * @private
  7470. * @param {Function} func The function to convert.
  7471. * @returns {string} Returns the source code.
  7472. */
  7473. function toSource(func) {
  7474. if (func != null) {
  7475. try {
  7476. return funcToString.call(func);
  7477. } catch (e) {}
  7478. try {
  7479. return (func + '');
  7480. } catch (e) {}
  7481. }
  7482. return '';
  7483. }
  7484. /**
  7485. * Updates wrapper `details` based on `bitmask` flags.
  7486. *
  7487. * @private
  7488. * @returns {Array} details The details to modify.
  7489. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7490. * @returns {Array} Returns `details`.
  7491. */
  7492. function updateWrapDetails(details, bitmask) {
  7493. arrayEach(wrapFlags, function(pair) {
  7494. var value = '_.' + pair[0];
  7495. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7496. details.push(value);
  7497. }
  7498. });
  7499. return details.sort();
  7500. }
  7501. /**
  7502. * Creates a clone of `wrapper`.
  7503. *
  7504. * @private
  7505. * @param {Object} wrapper The wrapper to clone.
  7506. * @returns {Object} Returns the cloned wrapper.
  7507. */
  7508. function wrapperClone(wrapper) {
  7509. if (wrapper instanceof LazyWrapper) {
  7510. return wrapper.clone();
  7511. }
  7512. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7513. result.__actions__ = copyArray(wrapper.__actions__);
  7514. result.__index__ = wrapper.__index__;
  7515. result.__values__ = wrapper.__values__;
  7516. return result;
  7517. }
  7518. /*------------------------------------------------------------------------*/
  7519. /**
  7520. * Creates an array of elements split into groups the length of `size`.
  7521. * If `array` can't be split evenly, the final chunk will be the remaining
  7522. * elements.
  7523. *
  7524. * @static
  7525. * @memberOf _
  7526. * @since 3.0.0
  7527. * @category Array
  7528. * @param {Array} array The array to process.
  7529. * @param {number} [size=1] The length of each chunk
  7530. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7531. * @returns {Array} Returns the new array of chunks.
  7532. * @example
  7533. *
  7534. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7535. * // => [['a', 'b'], ['c', 'd']]
  7536. *
  7537. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7538. * // => [['a', 'b', 'c'], ['d']]
  7539. */
  7540. function chunk(array, size, guard) {
  7541. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7542. size = 1;
  7543. } else {
  7544. size = nativeMax(toInteger(size), 0);
  7545. }
  7546. var length = array == null ? 0 : array.length;
  7547. if (!length || size < 1) {
  7548. return [];
  7549. }
  7550. var index = 0,
  7551. resIndex = 0,
  7552. result = Array(nativeCeil(length / size));
  7553. while (index < length) {
  7554. result[resIndex++] = baseSlice(array, index, (index += size));
  7555. }
  7556. return result;
  7557. }
  7558. /**
  7559. * Creates an array with all falsey values removed. The values `false`, `null`,
  7560. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7561. *
  7562. * @static
  7563. * @memberOf _
  7564. * @since 0.1.0
  7565. * @category Array
  7566. * @param {Array} array The array to compact.
  7567. * @returns {Array} Returns the new array of filtered values.
  7568. * @example
  7569. *
  7570. * _.compact([0, 1, false, 2, '', 3]);
  7571. * // => [1, 2, 3]
  7572. */
  7573. function compact(array) {
  7574. var index = -1,
  7575. length = array == null ? 0 : array.length,
  7576. resIndex = 0,
  7577. result = [];
  7578. while (++index < length) {
  7579. var value = array[index];
  7580. if (value) {
  7581. result[resIndex++] = value;
  7582. }
  7583. }
  7584. return result;
  7585. }
  7586. /**
  7587. * Creates a new array concatenating `array` with any additional arrays
  7588. * and/or values.
  7589. *
  7590. * @static
  7591. * @memberOf _
  7592. * @since 4.0.0
  7593. * @category Array
  7594. * @param {Array} array The array to concatenate.
  7595. * @param {...*} [values] The values to concatenate.
  7596. * @returns {Array} Returns the new concatenated array.
  7597. * @example
  7598. *
  7599. * var array = [1];
  7600. * var other = _.concat(array, 2, [3], [[4]]);
  7601. *
  7602. * console.log(other);
  7603. * // => [1, 2, 3, [4]]
  7604. *
  7605. * console.log(array);
  7606. * // => [1]
  7607. */
  7608. function concat() {
  7609. var length = arguments.length;
  7610. if (!length) {
  7611. return [];
  7612. }
  7613. var args = Array(length - 1),
  7614. array = arguments[0],
  7615. index = length;
  7616. while (index--) {
  7617. args[index - 1] = arguments[index];
  7618. }
  7619. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7620. }
  7621. /**
  7622. * Creates an array of `array` values not included in the other given arrays
  7623. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7624. * for equality comparisons. The order and references of result values are
  7625. * determined by the first array.
  7626. *
  7627. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7628. *
  7629. * @static
  7630. * @memberOf _
  7631. * @since 0.1.0
  7632. * @category Array
  7633. * @param {Array} array The array to inspect.
  7634. * @param {...Array} [values] The values to exclude.
  7635. * @returns {Array} Returns the new array of filtered values.
  7636. * @see _.without, _.xor
  7637. * @example
  7638. *
  7639. * _.difference([2, 1], [2, 3]);
  7640. * // => [1]
  7641. */
  7642. var difference = baseRest(function(array, values) {
  7643. return isArrayLikeObject(array)
  7644. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7645. : [];
  7646. });
  7647. /**
  7648. * This method is like `_.difference` except that it accepts `iteratee` which
  7649. * is invoked for each element of `array` and `values` to generate the criterion
  7650. * by which they're compared. The order and references of result values are
  7651. * determined by the first array. The iteratee is invoked with one argument:
  7652. * (value).
  7653. *
  7654. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7655. *
  7656. * @static
  7657. * @memberOf _
  7658. * @since 4.0.0
  7659. * @category Array
  7660. * @param {Array} array The array to inspect.
  7661. * @param {...Array} [values] The values to exclude.
  7662. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7663. * @returns {Array} Returns the new array of filtered values.
  7664. * @example
  7665. *
  7666. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7667. * // => [1.2]
  7668. *
  7669. * // The `_.property` iteratee shorthand.
  7670. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7671. * // => [{ 'x': 2 }]
  7672. */
  7673. var differenceBy = baseRest(function(array, values) {
  7674. var iteratee = last(values);
  7675. if (isArrayLikeObject(iteratee)) {
  7676. iteratee = undefined;
  7677. }
  7678. return isArrayLikeObject(array)
  7679. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7680. : [];
  7681. });
  7682. /**
  7683. * This method is like `_.difference` except that it accepts `comparator`
  7684. * which is invoked to compare elements of `array` to `values`. The order and
  7685. * references of result values are determined by the first array. The comparator
  7686. * is invoked with two arguments: (arrVal, othVal).
  7687. *
  7688. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7689. *
  7690. * @static
  7691. * @memberOf _
  7692. * @since 4.0.0
  7693. * @category Array
  7694. * @param {Array} array The array to inspect.
  7695. * @param {...Array} [values] The values to exclude.
  7696. * @param {Function} [comparator] The comparator invoked per element.
  7697. * @returns {Array} Returns the new array of filtered values.
  7698. * @example
  7699. *
  7700. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7701. *
  7702. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7703. * // => [{ 'x': 2, 'y': 1 }]
  7704. */
  7705. var differenceWith = baseRest(function(array, values) {
  7706. var comparator = last(values);
  7707. if (isArrayLikeObject(comparator)) {
  7708. comparator = undefined;
  7709. }
  7710. return isArrayLikeObject(array)
  7711. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7712. : [];
  7713. });
  7714. /**
  7715. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7716. *
  7717. * @static
  7718. * @memberOf _
  7719. * @since 0.5.0
  7720. * @category Array
  7721. * @param {Array} array The array to query.
  7722. * @param {number} [n=1] The number of elements to drop.
  7723. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7724. * @returns {Array} Returns the slice of `array`.
  7725. * @example
  7726. *
  7727. * _.drop([1, 2, 3]);
  7728. * // => [2, 3]
  7729. *
  7730. * _.drop([1, 2, 3], 2);
  7731. * // => [3]
  7732. *
  7733. * _.drop([1, 2, 3], 5);
  7734. * // => []
  7735. *
  7736. * _.drop([1, 2, 3], 0);
  7737. * // => [1, 2, 3]
  7738. */
  7739. function drop(array, n, guard) {
  7740. var length = array == null ? 0 : array.length;
  7741. if (!length) {
  7742. return [];
  7743. }
  7744. n = (guard || n === undefined) ? 1 : toInteger(n);
  7745. return baseSlice(array, n < 0 ? 0 : n, length);
  7746. }
  7747. /**
  7748. * Creates a slice of `array` with `n` elements dropped from the end.
  7749. *
  7750. * @static
  7751. * @memberOf _
  7752. * @since 3.0.0
  7753. * @category Array
  7754. * @param {Array} array The array to query.
  7755. * @param {number} [n=1] The number of elements to drop.
  7756. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7757. * @returns {Array} Returns the slice of `array`.
  7758. * @example
  7759. *
  7760. * _.dropRight([1, 2, 3]);
  7761. * // => [1, 2]
  7762. *
  7763. * _.dropRight([1, 2, 3], 2);
  7764. * // => [1]
  7765. *
  7766. * _.dropRight([1, 2, 3], 5);
  7767. * // => []
  7768. *
  7769. * _.dropRight([1, 2, 3], 0);
  7770. * // => [1, 2, 3]
  7771. */
  7772. function dropRight(array, n, guard) {
  7773. var length = array == null ? 0 : array.length;
  7774. if (!length) {
  7775. return [];
  7776. }
  7777. n = (guard || n === undefined) ? 1 : toInteger(n);
  7778. n = length - n;
  7779. return baseSlice(array, 0, n < 0 ? 0 : n);
  7780. }
  7781. /**
  7782. * Creates a slice of `array` excluding elements dropped from the end.
  7783. * Elements are dropped until `predicate` returns falsey. The predicate is
  7784. * invoked with three arguments: (value, index, array).
  7785. *
  7786. * @static
  7787. * @memberOf _
  7788. * @since 3.0.0
  7789. * @category Array
  7790. * @param {Array} array The array to query.
  7791. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7792. * @returns {Array} Returns the slice of `array`.
  7793. * @example
  7794. *
  7795. * var users = [
  7796. * { 'user': 'barney', 'active': true },
  7797. * { 'user': 'fred', 'active': false },
  7798. * { 'user': 'pebbles', 'active': false }
  7799. * ];
  7800. *
  7801. * _.dropRightWhile(users, function(o) { return !o.active; });
  7802. * // => objects for ['barney']
  7803. *
  7804. * // The `_.matches` iteratee shorthand.
  7805. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7806. * // => objects for ['barney', 'fred']
  7807. *
  7808. * // The `_.matchesProperty` iteratee shorthand.
  7809. * _.dropRightWhile(users, ['active', false]);
  7810. * // => objects for ['barney']
  7811. *
  7812. * // The `_.property` iteratee shorthand.
  7813. * _.dropRightWhile(users, 'active');
  7814. * // => objects for ['barney', 'fred', 'pebbles']
  7815. */
  7816. function dropRightWhile(array, predicate) {
  7817. return (array && array.length)
  7818. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7819. : [];
  7820. }
  7821. /**
  7822. * Creates a slice of `array` excluding elements dropped from the beginning.
  7823. * Elements are dropped until `predicate` returns falsey. The predicate is
  7824. * invoked with three arguments: (value, index, array).
  7825. *
  7826. * @static
  7827. * @memberOf _
  7828. * @since 3.0.0
  7829. * @category Array
  7830. * @param {Array} array The array to query.
  7831. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7832. * @returns {Array} Returns the slice of `array`.
  7833. * @example
  7834. *
  7835. * var users = [
  7836. * { 'user': 'barney', 'active': false },
  7837. * { 'user': 'fred', 'active': false },
  7838. * { 'user': 'pebbles', 'active': true }
  7839. * ];
  7840. *
  7841. * _.dropWhile(users, function(o) { return !o.active; });
  7842. * // => objects for ['pebbles']
  7843. *
  7844. * // The `_.matches` iteratee shorthand.
  7845. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7846. * // => objects for ['fred', 'pebbles']
  7847. *
  7848. * // The `_.matchesProperty` iteratee shorthand.
  7849. * _.dropWhile(users, ['active', false]);
  7850. * // => objects for ['pebbles']
  7851. *
  7852. * // The `_.property` iteratee shorthand.
  7853. * _.dropWhile(users, 'active');
  7854. * // => objects for ['barney', 'fred', 'pebbles']
  7855. */
  7856. function dropWhile(array, predicate) {
  7857. return (array && array.length)
  7858. ? baseWhile(array, getIteratee(predicate, 3), true)
  7859. : [];
  7860. }
  7861. /**
  7862. * Fills elements of `array` with `value` from `start` up to, but not
  7863. * including, `end`.
  7864. *
  7865. * **Note:** This method mutates `array`.
  7866. *
  7867. * @static
  7868. * @memberOf _
  7869. * @since 3.2.0
  7870. * @category Array
  7871. * @param {Array} array The array to fill.
  7872. * @param {*} value The value to fill `array` with.
  7873. * @param {number} [start=0] The start position.
  7874. * @param {number} [end=array.length] The end position.
  7875. * @returns {Array} Returns `array`.
  7876. * @example
  7877. *
  7878. * var array = [1, 2, 3];
  7879. *
  7880. * _.fill(array, 'a');
  7881. * console.log(array);
  7882. * // => ['a', 'a', 'a']
  7883. *
  7884. * _.fill(Array(3), 2);
  7885. * // => [2, 2, 2]
  7886. *
  7887. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7888. * // => [4, '*', '*', 10]
  7889. */
  7890. function fill(array, value, start, end) {
  7891. var length = array == null ? 0 : array.length;
  7892. if (!length) {
  7893. return [];
  7894. }
  7895. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7896. start = 0;
  7897. end = length;
  7898. }
  7899. return baseFill(array, value, start, end);
  7900. }
  7901. /**
  7902. * This method is like `_.find` except that it returns the index of the first
  7903. * element `predicate` returns truthy for instead of the element itself.
  7904. *
  7905. * @static
  7906. * @memberOf _
  7907. * @since 1.1.0
  7908. * @category Array
  7909. * @param {Array} array The array to inspect.
  7910. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7911. * @param {number} [fromIndex=0] The index to search from.
  7912. * @returns {number} Returns the index of the found element, else `-1`.
  7913. * @example
  7914. *
  7915. * var users = [
  7916. * { 'user': 'barney', 'active': false },
  7917. * { 'user': 'fred', 'active': false },
  7918. * { 'user': 'pebbles', 'active': true }
  7919. * ];
  7920. *
  7921. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7922. * // => 0
  7923. *
  7924. * // The `_.matches` iteratee shorthand.
  7925. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7926. * // => 1
  7927. *
  7928. * // The `_.matchesProperty` iteratee shorthand.
  7929. * _.findIndex(users, ['active', false]);
  7930. * // => 0
  7931. *
  7932. * // The `_.property` iteratee shorthand.
  7933. * _.findIndex(users, 'active');
  7934. * // => 2
  7935. */
  7936. function findIndex(array, predicate, fromIndex) {
  7937. var length = array == null ? 0 : array.length;
  7938. if (!length) {
  7939. return -1;
  7940. }
  7941. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7942. if (index < 0) {
  7943. index = nativeMax(length + index, 0);
  7944. }
  7945. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7946. }
  7947. /**
  7948. * This method is like `_.findIndex` except that it iterates over elements
  7949. * of `collection` from right to left.
  7950. *
  7951. * @static
  7952. * @memberOf _
  7953. * @since 2.0.0
  7954. * @category Array
  7955. * @param {Array} array The array to inspect.
  7956. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7957. * @param {number} [fromIndex=array.length-1] The index to search from.
  7958. * @returns {number} Returns the index of the found element, else `-1`.
  7959. * @example
  7960. *
  7961. * var users = [
  7962. * { 'user': 'barney', 'active': true },
  7963. * { 'user': 'fred', 'active': false },
  7964. * { 'user': 'pebbles', 'active': false }
  7965. * ];
  7966. *
  7967. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7968. * // => 2
  7969. *
  7970. * // The `_.matches` iteratee shorthand.
  7971. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7972. * // => 0
  7973. *
  7974. * // The `_.matchesProperty` iteratee shorthand.
  7975. * _.findLastIndex(users, ['active', false]);
  7976. * // => 2
  7977. *
  7978. * // The `_.property` iteratee shorthand.
  7979. * _.findLastIndex(users, 'active');
  7980. * // => 0
  7981. */
  7982. function findLastIndex(array, predicate, fromIndex) {
  7983. var length = array == null ? 0 : array.length;
  7984. if (!length) {
  7985. return -1;
  7986. }
  7987. var index = length - 1;
  7988. if (fromIndex !== undefined) {
  7989. index = toInteger(fromIndex);
  7990. index = fromIndex < 0
  7991. ? nativeMax(length + index, 0)
  7992. : nativeMin(index, length - 1);
  7993. }
  7994. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7995. }
  7996. /**
  7997. * Flattens `array` a single level deep.
  7998. *
  7999. * @static
  8000. * @memberOf _
  8001. * @since 0.1.0
  8002. * @category Array
  8003. * @param {Array} array The array to flatten.
  8004. * @returns {Array} Returns the new flattened array.
  8005. * @example
  8006. *
  8007. * _.flatten([1, [2, [3, [4]], 5]]);
  8008. * // => [1, 2, [3, [4]], 5]
  8009. */
  8010. function flatten(array) {
  8011. var length = array == null ? 0 : array.length;
  8012. return length ? baseFlatten(array, 1) : [];
  8013. }
  8014. /**
  8015. * Recursively flattens `array`.
  8016. *
  8017. * @static
  8018. * @memberOf _
  8019. * @since 3.0.0
  8020. * @category Array
  8021. * @param {Array} array The array to flatten.
  8022. * @returns {Array} Returns the new flattened array.
  8023. * @example
  8024. *
  8025. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8026. * // => [1, 2, 3, 4, 5]
  8027. */
  8028. function flattenDeep(array) {
  8029. var length = array == null ? 0 : array.length;
  8030. return length ? baseFlatten(array, INFINITY) : [];
  8031. }
  8032. /**
  8033. * Recursively flatten `array` up to `depth` times.
  8034. *
  8035. * @static
  8036. * @memberOf _
  8037. * @since 4.4.0
  8038. * @category Array
  8039. * @param {Array} array The array to flatten.
  8040. * @param {number} [depth=1] The maximum recursion depth.
  8041. * @returns {Array} Returns the new flattened array.
  8042. * @example
  8043. *
  8044. * var array = [1, [2, [3, [4]], 5]];
  8045. *
  8046. * _.flattenDepth(array, 1);
  8047. * // => [1, 2, [3, [4]], 5]
  8048. *
  8049. * _.flattenDepth(array, 2);
  8050. * // => [1, 2, 3, [4], 5]
  8051. */
  8052. function flattenDepth(array, depth) {
  8053. var length = array == null ? 0 : array.length;
  8054. if (!length) {
  8055. return [];
  8056. }
  8057. depth = depth === undefined ? 1 : toInteger(depth);
  8058. return baseFlatten(array, depth);
  8059. }
  8060. /**
  8061. * The inverse of `_.toPairs`; this method returns an object composed
  8062. * from key-value `pairs`.
  8063. *
  8064. * @static
  8065. * @memberOf _
  8066. * @since 4.0.0
  8067. * @category Array
  8068. * @param {Array} pairs The key-value pairs.
  8069. * @returns {Object} Returns the new object.
  8070. * @example
  8071. *
  8072. * _.fromPairs([['a', 1], ['b', 2]]);
  8073. * // => { 'a': 1, 'b': 2 }
  8074. */
  8075. function fromPairs(pairs) {
  8076. var index = -1,
  8077. length = pairs == null ? 0 : pairs.length,
  8078. result = {};
  8079. while (++index < length) {
  8080. var pair = pairs[index];
  8081. result[pair[0]] = pair[1];
  8082. }
  8083. return result;
  8084. }
  8085. /**
  8086. * Gets the first element of `array`.
  8087. *
  8088. * @static
  8089. * @memberOf _
  8090. * @since 0.1.0
  8091. * @alias first
  8092. * @category Array
  8093. * @param {Array} array The array to query.
  8094. * @returns {*} Returns the first element of `array`.
  8095. * @example
  8096. *
  8097. * _.head([1, 2, 3]);
  8098. * // => 1
  8099. *
  8100. * _.head([]);
  8101. * // => undefined
  8102. */
  8103. function head(array) {
  8104. return (array && array.length) ? array[0] : undefined;
  8105. }
  8106. /**
  8107. * Gets the index at which the first occurrence of `value` is found in `array`
  8108. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8109. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8110. * offset from the end of `array`.
  8111. *
  8112. * @static
  8113. * @memberOf _
  8114. * @since 0.1.0
  8115. * @category Array
  8116. * @param {Array} array The array to inspect.
  8117. * @param {*} value The value to search for.
  8118. * @param {number} [fromIndex=0] The index to search from.
  8119. * @returns {number} Returns the index of the matched value, else `-1`.
  8120. * @example
  8121. *
  8122. * _.indexOf([1, 2, 1, 2], 2);
  8123. * // => 1
  8124. *
  8125. * // Search from the `fromIndex`.
  8126. * _.indexOf([1, 2, 1, 2], 2, 2);
  8127. * // => 3
  8128. */
  8129. function indexOf(array, value, fromIndex) {
  8130. var length = array == null ? 0 : array.length;
  8131. if (!length) {
  8132. return -1;
  8133. }
  8134. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8135. if (index < 0) {
  8136. index = nativeMax(length + index, 0);
  8137. }
  8138. return baseIndexOf(array, value, index);
  8139. }
  8140. /**
  8141. * Gets all but the last element of `array`.
  8142. *
  8143. * @static
  8144. * @memberOf _
  8145. * @since 0.1.0
  8146. * @category Array
  8147. * @param {Array} array The array to query.
  8148. * @returns {Array} Returns the slice of `array`.
  8149. * @example
  8150. *
  8151. * _.initial([1, 2, 3]);
  8152. * // => [1, 2]
  8153. */
  8154. function initial(array) {
  8155. var length = array == null ? 0 : array.length;
  8156. return length ? baseSlice(array, 0, -1) : [];
  8157. }
  8158. /**
  8159. * Creates an array of unique values that are included in all given arrays
  8160. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8161. * for equality comparisons. The order and references of result values are
  8162. * determined by the first array.
  8163. *
  8164. * @static
  8165. * @memberOf _
  8166. * @since 0.1.0
  8167. * @category Array
  8168. * @param {...Array} [arrays] The arrays to inspect.
  8169. * @returns {Array} Returns the new array of intersecting values.
  8170. * @example
  8171. *
  8172. * _.intersection([2, 1], [2, 3]);
  8173. * // => [2]
  8174. */
  8175. var intersection = baseRest(function(arrays) {
  8176. var mapped = arrayMap(arrays, castArrayLikeObject);
  8177. return (mapped.length && mapped[0] === arrays[0])
  8178. ? baseIntersection(mapped)
  8179. : [];
  8180. });
  8181. /**
  8182. * This method is like `_.intersection` except that it accepts `iteratee`
  8183. * which is invoked for each element of each `arrays` to generate the criterion
  8184. * by which they're compared. The order and references of result values are
  8185. * determined by the first array. The iteratee is invoked with one argument:
  8186. * (value).
  8187. *
  8188. * @static
  8189. * @memberOf _
  8190. * @since 4.0.0
  8191. * @category Array
  8192. * @param {...Array} [arrays] The arrays to inspect.
  8193. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8194. * @returns {Array} Returns the new array of intersecting values.
  8195. * @example
  8196. *
  8197. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8198. * // => [2.1]
  8199. *
  8200. * // The `_.property` iteratee shorthand.
  8201. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8202. * // => [{ 'x': 1 }]
  8203. */
  8204. var intersectionBy = baseRest(function(arrays) {
  8205. var iteratee = last(arrays),
  8206. mapped = arrayMap(arrays, castArrayLikeObject);
  8207. if (iteratee === last(mapped)) {
  8208. iteratee = undefined;
  8209. } else {
  8210. mapped.pop();
  8211. }
  8212. return (mapped.length && mapped[0] === arrays[0])
  8213. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8214. : [];
  8215. });
  8216. /**
  8217. * This method is like `_.intersection` except that it accepts `comparator`
  8218. * which is invoked to compare elements of `arrays`. The order and references
  8219. * of result values are determined by the first array. The comparator is
  8220. * invoked with two arguments: (arrVal, othVal).
  8221. *
  8222. * @static
  8223. * @memberOf _
  8224. * @since 4.0.0
  8225. * @category Array
  8226. * @param {...Array} [arrays] The arrays to inspect.
  8227. * @param {Function} [comparator] The comparator invoked per element.
  8228. * @returns {Array} Returns the new array of intersecting values.
  8229. * @example
  8230. *
  8231. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8232. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8233. *
  8234. * _.intersectionWith(objects, others, _.isEqual);
  8235. * // => [{ 'x': 1, 'y': 2 }]
  8236. */
  8237. var intersectionWith = baseRest(function(arrays) {
  8238. var comparator = last(arrays),
  8239. mapped = arrayMap(arrays, castArrayLikeObject);
  8240. comparator = typeof comparator == 'function' ? comparator : undefined;
  8241. if (comparator) {
  8242. mapped.pop();
  8243. }
  8244. return (mapped.length && mapped[0] === arrays[0])
  8245. ? baseIntersection(mapped, undefined, comparator)
  8246. : [];
  8247. });
  8248. /**
  8249. * Converts all elements in `array` into a string separated by `separator`.
  8250. *
  8251. * @static
  8252. * @memberOf _
  8253. * @since 4.0.0
  8254. * @category Array
  8255. * @param {Array} array The array to convert.
  8256. * @param {string} [separator=','] The element separator.
  8257. * @returns {string} Returns the joined string.
  8258. * @example
  8259. *
  8260. * _.join(['a', 'b', 'c'], '~');
  8261. * // => 'a~b~c'
  8262. */
  8263. function join(array, separator) {
  8264. return array == null ? '' : nativeJoin.call(array, separator);
  8265. }
  8266. /**
  8267. * Gets the last element of `array`.
  8268. *
  8269. * @static
  8270. * @memberOf _
  8271. * @since 0.1.0
  8272. * @category Array
  8273. * @param {Array} array The array to query.
  8274. * @returns {*} Returns the last element of `array`.
  8275. * @example
  8276. *
  8277. * _.last([1, 2, 3]);
  8278. * // => 3
  8279. */
  8280. function last(array) {
  8281. var length = array == null ? 0 : array.length;
  8282. return length ? array[length - 1] : undefined;
  8283. }
  8284. /**
  8285. * This method is like `_.indexOf` except that it iterates over elements of
  8286. * `array` from right to left.
  8287. *
  8288. * @static
  8289. * @memberOf _
  8290. * @since 0.1.0
  8291. * @category Array
  8292. * @param {Array} array The array to inspect.
  8293. * @param {*} value The value to search for.
  8294. * @param {number} [fromIndex=array.length-1] The index to search from.
  8295. * @returns {number} Returns the index of the matched value, else `-1`.
  8296. * @example
  8297. *
  8298. * _.lastIndexOf([1, 2, 1, 2], 2);
  8299. * // => 3
  8300. *
  8301. * // Search from the `fromIndex`.
  8302. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8303. * // => 1
  8304. */
  8305. function lastIndexOf(array, value, fromIndex) {
  8306. var length = array == null ? 0 : array.length;
  8307. if (!length) {
  8308. return -1;
  8309. }
  8310. var index = length;
  8311. if (fromIndex !== undefined) {
  8312. index = toInteger(fromIndex);
  8313. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8314. }
  8315. return value === value
  8316. ? strictLastIndexOf(array, value, index)
  8317. : baseFindIndex(array, baseIsNaN, index, true);
  8318. }
  8319. /**
  8320. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8321. * element from the end is returned.
  8322. *
  8323. * @static
  8324. * @memberOf _
  8325. * @since 4.11.0
  8326. * @category Array
  8327. * @param {Array} array The array to query.
  8328. * @param {number} [n=0] The index of the element to return.
  8329. * @returns {*} Returns the nth element of `array`.
  8330. * @example
  8331. *
  8332. * var array = ['a', 'b', 'c', 'd'];
  8333. *
  8334. * _.nth(array, 1);
  8335. * // => 'b'
  8336. *
  8337. * _.nth(array, -2);
  8338. * // => 'c';
  8339. */
  8340. function nth(array, n) {
  8341. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8342. }
  8343. /**
  8344. * Removes all given values from `array` using
  8345. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8346. * for equality comparisons.
  8347. *
  8348. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8349. * to remove elements from an array by predicate.
  8350. *
  8351. * @static
  8352. * @memberOf _
  8353. * @since 2.0.0
  8354. * @category Array
  8355. * @param {Array} array The array to modify.
  8356. * @param {...*} [values] The values to remove.
  8357. * @returns {Array} Returns `array`.
  8358. * @example
  8359. *
  8360. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8361. *
  8362. * _.pull(array, 'a', 'c');
  8363. * console.log(array);
  8364. * // => ['b', 'b']
  8365. */
  8366. var pull = baseRest(pullAll);
  8367. /**
  8368. * This method is like `_.pull` except that it accepts an array of values to remove.
  8369. *
  8370. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8371. *
  8372. * @static
  8373. * @memberOf _
  8374. * @since 4.0.0
  8375. * @category Array
  8376. * @param {Array} array The array to modify.
  8377. * @param {Array} values The values to remove.
  8378. * @returns {Array} Returns `array`.
  8379. * @example
  8380. *
  8381. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8382. *
  8383. * _.pullAll(array, ['a', 'c']);
  8384. * console.log(array);
  8385. * // => ['b', 'b']
  8386. */
  8387. function pullAll(array, values) {
  8388. return (array && array.length && values && values.length)
  8389. ? basePullAll(array, values)
  8390. : array;
  8391. }
  8392. /**
  8393. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8394. * invoked for each element of `array` and `values` to generate the criterion
  8395. * by which they're compared. The iteratee is invoked with one argument: (value).
  8396. *
  8397. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8398. *
  8399. * @static
  8400. * @memberOf _
  8401. * @since 4.0.0
  8402. * @category Array
  8403. * @param {Array} array The array to modify.
  8404. * @param {Array} values The values to remove.
  8405. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8406. * @returns {Array} Returns `array`.
  8407. * @example
  8408. *
  8409. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8410. *
  8411. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8412. * console.log(array);
  8413. * // => [{ 'x': 2 }]
  8414. */
  8415. function pullAllBy(array, values, iteratee) {
  8416. return (array && array.length && values && values.length)
  8417. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8418. : array;
  8419. }
  8420. /**
  8421. * This method is like `_.pullAll` except that it accepts `comparator` which
  8422. * is invoked to compare elements of `array` to `values`. The comparator is
  8423. * invoked with two arguments: (arrVal, othVal).
  8424. *
  8425. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8426. *
  8427. * @static
  8428. * @memberOf _
  8429. * @since 4.6.0
  8430. * @category Array
  8431. * @param {Array} array The array to modify.
  8432. * @param {Array} values The values to remove.
  8433. * @param {Function} [comparator] The comparator invoked per element.
  8434. * @returns {Array} Returns `array`.
  8435. * @example
  8436. *
  8437. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8438. *
  8439. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8440. * console.log(array);
  8441. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8442. */
  8443. function pullAllWith(array, values, comparator) {
  8444. return (array && array.length && values && values.length)
  8445. ? basePullAll(array, values, undefined, comparator)
  8446. : array;
  8447. }
  8448. /**
  8449. * Removes elements from `array` corresponding to `indexes` and returns an
  8450. * array of removed elements.
  8451. *
  8452. * **Note:** Unlike `_.at`, this method mutates `array`.
  8453. *
  8454. * @static
  8455. * @memberOf _
  8456. * @since 3.0.0
  8457. * @category Array
  8458. * @param {Array} array The array to modify.
  8459. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8460. * @returns {Array} Returns the new array of removed elements.
  8461. * @example
  8462. *
  8463. * var array = ['a', 'b', 'c', 'd'];
  8464. * var pulled = _.pullAt(array, [1, 3]);
  8465. *
  8466. * console.log(array);
  8467. * // => ['a', 'c']
  8468. *
  8469. * console.log(pulled);
  8470. * // => ['b', 'd']
  8471. */
  8472. var pullAt = flatRest(function(array, indexes) {
  8473. var length = array == null ? 0 : array.length,
  8474. result = baseAt(array, indexes);
  8475. basePullAt(array, arrayMap(indexes, function(index) {
  8476. return isIndex(index, length) ? +index : index;
  8477. }).sort(compareAscending));
  8478. return result;
  8479. });
  8480. /**
  8481. * Removes all elements from `array` that `predicate` returns truthy for
  8482. * and returns an array of the removed elements. The predicate is invoked
  8483. * with three arguments: (value, index, array).
  8484. *
  8485. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8486. * to pull elements from an array by value.
  8487. *
  8488. * @static
  8489. * @memberOf _
  8490. * @since 2.0.0
  8491. * @category Array
  8492. * @param {Array} array The array to modify.
  8493. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8494. * @returns {Array} Returns the new array of removed elements.
  8495. * @example
  8496. *
  8497. * var array = [1, 2, 3, 4];
  8498. * var evens = _.remove(array, function(n) {
  8499. * return n % 2 == 0;
  8500. * });
  8501. *
  8502. * console.log(array);
  8503. * // => [1, 3]
  8504. *
  8505. * console.log(evens);
  8506. * // => [2, 4]
  8507. */
  8508. function remove(array, predicate) {
  8509. var result = [];
  8510. if (!(array && array.length)) {
  8511. return result;
  8512. }
  8513. var index = -1,
  8514. indexes = [],
  8515. length = array.length;
  8516. predicate = getIteratee(predicate, 3);
  8517. while (++index < length) {
  8518. var value = array[index];
  8519. if (predicate(value, index, array)) {
  8520. result.push(value);
  8521. indexes.push(index);
  8522. }
  8523. }
  8524. basePullAt(array, indexes);
  8525. return result;
  8526. }
  8527. /**
  8528. * Reverses `array` so that the first element becomes the last, the second
  8529. * element becomes the second to last, and so on.
  8530. *
  8531. * **Note:** This method mutates `array` and is based on
  8532. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8533. *
  8534. * @static
  8535. * @memberOf _
  8536. * @since 4.0.0
  8537. * @category Array
  8538. * @param {Array} array The array to modify.
  8539. * @returns {Array} Returns `array`.
  8540. * @example
  8541. *
  8542. * var array = [1, 2, 3];
  8543. *
  8544. * _.reverse(array);
  8545. * // => [3, 2, 1]
  8546. *
  8547. * console.log(array);
  8548. * // => [3, 2, 1]
  8549. */
  8550. function reverse(array) {
  8551. return array == null ? array : nativeReverse.call(array);
  8552. }
  8553. /**
  8554. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8555. *
  8556. * **Note:** This method is used instead of
  8557. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8558. * returned.
  8559. *
  8560. * @static
  8561. * @memberOf _
  8562. * @since 3.0.0
  8563. * @category Array
  8564. * @param {Array} array The array to slice.
  8565. * @param {number} [start=0] The start position.
  8566. * @param {number} [end=array.length] The end position.
  8567. * @returns {Array} Returns the slice of `array`.
  8568. */
  8569. function slice(array, start, end) {
  8570. var length = array == null ? 0 : array.length;
  8571. if (!length) {
  8572. return [];
  8573. }
  8574. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8575. start = 0;
  8576. end = length;
  8577. }
  8578. else {
  8579. start = start == null ? 0 : toInteger(start);
  8580. end = end === undefined ? length : toInteger(end);
  8581. }
  8582. return baseSlice(array, start, end);
  8583. }
  8584. /**
  8585. * Uses a binary search to determine the lowest index at which `value`
  8586. * should be inserted into `array` in order to maintain its sort order.
  8587. *
  8588. * @static
  8589. * @memberOf _
  8590. * @since 0.1.0
  8591. * @category Array
  8592. * @param {Array} array The sorted array to inspect.
  8593. * @param {*} value The value to evaluate.
  8594. * @returns {number} Returns the index at which `value` should be inserted
  8595. * into `array`.
  8596. * @example
  8597. *
  8598. * _.sortedIndex([30, 50], 40);
  8599. * // => 1
  8600. */
  8601. function sortedIndex(array, value) {
  8602. return baseSortedIndex(array, value);
  8603. }
  8604. /**
  8605. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8606. * which is invoked for `value` and each element of `array` to compute their
  8607. * sort ranking. The iteratee is invoked with one argument: (value).
  8608. *
  8609. * @static
  8610. * @memberOf _
  8611. * @since 4.0.0
  8612. * @category Array
  8613. * @param {Array} array The sorted array to inspect.
  8614. * @param {*} value The value to evaluate.
  8615. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8616. * @returns {number} Returns the index at which `value` should be inserted
  8617. * into `array`.
  8618. * @example
  8619. *
  8620. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8621. *
  8622. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8623. * // => 0
  8624. *
  8625. * // The `_.property` iteratee shorthand.
  8626. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8627. * // => 0
  8628. */
  8629. function sortedIndexBy(array, value, iteratee) {
  8630. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8631. }
  8632. /**
  8633. * This method is like `_.indexOf` except that it performs a binary
  8634. * search on a sorted `array`.
  8635. *
  8636. * @static
  8637. * @memberOf _
  8638. * @since 4.0.0
  8639. * @category Array
  8640. * @param {Array} array The array to inspect.
  8641. * @param {*} value The value to search for.
  8642. * @returns {number} Returns the index of the matched value, else `-1`.
  8643. * @example
  8644. *
  8645. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8646. * // => 1
  8647. */
  8648. function sortedIndexOf(array, value) {
  8649. var length = array == null ? 0 : array.length;
  8650. if (length) {
  8651. var index = baseSortedIndex(array, value);
  8652. if (index < length && eq(array[index], value)) {
  8653. return index;
  8654. }
  8655. }
  8656. return -1;
  8657. }
  8658. /**
  8659. * This method is like `_.sortedIndex` except that it returns the highest
  8660. * index at which `value` should be inserted into `array` in order to
  8661. * maintain its sort order.
  8662. *
  8663. * @static
  8664. * @memberOf _
  8665. * @since 3.0.0
  8666. * @category Array
  8667. * @param {Array} array The sorted array to inspect.
  8668. * @param {*} value The value to evaluate.
  8669. * @returns {number} Returns the index at which `value` should be inserted
  8670. * into `array`.
  8671. * @example
  8672. *
  8673. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8674. * // => 4
  8675. */
  8676. function sortedLastIndex(array, value) {
  8677. return baseSortedIndex(array, value, true);
  8678. }
  8679. /**
  8680. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8681. * which is invoked for `value` and each element of `array` to compute their
  8682. * sort ranking. The iteratee is invoked with one argument: (value).
  8683. *
  8684. * @static
  8685. * @memberOf _
  8686. * @since 4.0.0
  8687. * @category Array
  8688. * @param {Array} array The sorted array to inspect.
  8689. * @param {*} value The value to evaluate.
  8690. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8691. * @returns {number} Returns the index at which `value` should be inserted
  8692. * into `array`.
  8693. * @example
  8694. *
  8695. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8696. *
  8697. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8698. * // => 1
  8699. *
  8700. * // The `_.property` iteratee shorthand.
  8701. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8702. * // => 1
  8703. */
  8704. function sortedLastIndexBy(array, value, iteratee) {
  8705. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8706. }
  8707. /**
  8708. * This method is like `_.lastIndexOf` except that it performs a binary
  8709. * search on a sorted `array`.
  8710. *
  8711. * @static
  8712. * @memberOf _
  8713. * @since 4.0.0
  8714. * @category Array
  8715. * @param {Array} array The array to inspect.
  8716. * @param {*} value The value to search for.
  8717. * @returns {number} Returns the index of the matched value, else `-1`.
  8718. * @example
  8719. *
  8720. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8721. * // => 3
  8722. */
  8723. function sortedLastIndexOf(array, value) {
  8724. var length = array == null ? 0 : array.length;
  8725. if (length) {
  8726. var index = baseSortedIndex(array, value, true) - 1;
  8727. if (eq(array[index], value)) {
  8728. return index;
  8729. }
  8730. }
  8731. return -1;
  8732. }
  8733. /**
  8734. * This method is like `_.uniq` except that it's designed and optimized
  8735. * for sorted arrays.
  8736. *
  8737. * @static
  8738. * @memberOf _
  8739. * @since 4.0.0
  8740. * @category Array
  8741. * @param {Array} array The array to inspect.
  8742. * @returns {Array} Returns the new duplicate free array.
  8743. * @example
  8744. *
  8745. * _.sortedUniq([1, 1, 2]);
  8746. * // => [1, 2]
  8747. */
  8748. function sortedUniq(array) {
  8749. return (array && array.length)
  8750. ? baseSortedUniq(array)
  8751. : [];
  8752. }
  8753. /**
  8754. * This method is like `_.uniqBy` except that it's designed and optimized
  8755. * for sorted arrays.
  8756. *
  8757. * @static
  8758. * @memberOf _
  8759. * @since 4.0.0
  8760. * @category Array
  8761. * @param {Array} array The array to inspect.
  8762. * @param {Function} [iteratee] The iteratee invoked per element.
  8763. * @returns {Array} Returns the new duplicate free array.
  8764. * @example
  8765. *
  8766. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8767. * // => [1.1, 2.3]
  8768. */
  8769. function sortedUniqBy(array, iteratee) {
  8770. return (array && array.length)
  8771. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8772. : [];
  8773. }
  8774. /**
  8775. * Gets all but the first element of `array`.
  8776. *
  8777. * @static
  8778. * @memberOf _
  8779. * @since 4.0.0
  8780. * @category Array
  8781. * @param {Array} array The array to query.
  8782. * @returns {Array} Returns the slice of `array`.
  8783. * @example
  8784. *
  8785. * _.tail([1, 2, 3]);
  8786. * // => [2, 3]
  8787. */
  8788. function tail(array) {
  8789. var length = array == null ? 0 : array.length;
  8790. return length ? baseSlice(array, 1, length) : [];
  8791. }
  8792. /**
  8793. * Creates a slice of `array` with `n` elements taken from the beginning.
  8794. *
  8795. * @static
  8796. * @memberOf _
  8797. * @since 0.1.0
  8798. * @category Array
  8799. * @param {Array} array The array to query.
  8800. * @param {number} [n=1] The number of elements to take.
  8801. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8802. * @returns {Array} Returns the slice of `array`.
  8803. * @example
  8804. *
  8805. * _.take([1, 2, 3]);
  8806. * // => [1]
  8807. *
  8808. * _.take([1, 2, 3], 2);
  8809. * // => [1, 2]
  8810. *
  8811. * _.take([1, 2, 3], 5);
  8812. * // => [1, 2, 3]
  8813. *
  8814. * _.take([1, 2, 3], 0);
  8815. * // => []
  8816. */
  8817. function take(array, n, guard) {
  8818. if (!(array && array.length)) {
  8819. return [];
  8820. }
  8821. n = (guard || n === undefined) ? 1 : toInteger(n);
  8822. return baseSlice(array, 0, n < 0 ? 0 : n);
  8823. }
  8824. /**
  8825. * Creates a slice of `array` with `n` elements taken from the end.
  8826. *
  8827. * @static
  8828. * @memberOf _
  8829. * @since 3.0.0
  8830. * @category Array
  8831. * @param {Array} array The array to query.
  8832. * @param {number} [n=1] The number of elements to take.
  8833. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8834. * @returns {Array} Returns the slice of `array`.
  8835. * @example
  8836. *
  8837. * _.takeRight([1, 2, 3]);
  8838. * // => [3]
  8839. *
  8840. * _.takeRight([1, 2, 3], 2);
  8841. * // => [2, 3]
  8842. *
  8843. * _.takeRight([1, 2, 3], 5);
  8844. * // => [1, 2, 3]
  8845. *
  8846. * _.takeRight([1, 2, 3], 0);
  8847. * // => []
  8848. */
  8849. function takeRight(array, n, guard) {
  8850. var length = array == null ? 0 : array.length;
  8851. if (!length) {
  8852. return [];
  8853. }
  8854. n = (guard || n === undefined) ? 1 : toInteger(n);
  8855. n = length - n;
  8856. return baseSlice(array, n < 0 ? 0 : n, length);
  8857. }
  8858. /**
  8859. * Creates a slice of `array` with elements taken from the end. Elements are
  8860. * taken until `predicate` returns falsey. The predicate is invoked with
  8861. * three arguments: (value, index, array).
  8862. *
  8863. * @static
  8864. * @memberOf _
  8865. * @since 3.0.0
  8866. * @category Array
  8867. * @param {Array} array The array to query.
  8868. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8869. * @returns {Array} Returns the slice of `array`.
  8870. * @example
  8871. *
  8872. * var users = [
  8873. * { 'user': 'barney', 'active': true },
  8874. * { 'user': 'fred', 'active': false },
  8875. * { 'user': 'pebbles', 'active': false }
  8876. * ];
  8877. *
  8878. * _.takeRightWhile(users, function(o) { return !o.active; });
  8879. * // => objects for ['fred', 'pebbles']
  8880. *
  8881. * // The `_.matches` iteratee shorthand.
  8882. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8883. * // => objects for ['pebbles']
  8884. *
  8885. * // The `_.matchesProperty` iteratee shorthand.
  8886. * _.takeRightWhile(users, ['active', false]);
  8887. * // => objects for ['fred', 'pebbles']
  8888. *
  8889. * // The `_.property` iteratee shorthand.
  8890. * _.takeRightWhile(users, 'active');
  8891. * // => []
  8892. */
  8893. function takeRightWhile(array, predicate) {
  8894. return (array && array.length)
  8895. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8896. : [];
  8897. }
  8898. /**
  8899. * Creates a slice of `array` with elements taken from the beginning. Elements
  8900. * are taken until `predicate` returns falsey. The predicate is invoked with
  8901. * three arguments: (value, index, array).
  8902. *
  8903. * @static
  8904. * @memberOf _
  8905. * @since 3.0.0
  8906. * @category Array
  8907. * @param {Array} array The array to query.
  8908. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8909. * @returns {Array} Returns the slice of `array`.
  8910. * @example
  8911. *
  8912. * var users = [
  8913. * { 'user': 'barney', 'active': false },
  8914. * { 'user': 'fred', 'active': false },
  8915. * { 'user': 'pebbles', 'active': true }
  8916. * ];
  8917. *
  8918. * _.takeWhile(users, function(o) { return !o.active; });
  8919. * // => objects for ['barney', 'fred']
  8920. *
  8921. * // The `_.matches` iteratee shorthand.
  8922. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8923. * // => objects for ['barney']
  8924. *
  8925. * // The `_.matchesProperty` iteratee shorthand.
  8926. * _.takeWhile(users, ['active', false]);
  8927. * // => objects for ['barney', 'fred']
  8928. *
  8929. * // The `_.property` iteratee shorthand.
  8930. * _.takeWhile(users, 'active');
  8931. * // => []
  8932. */
  8933. function takeWhile(array, predicate) {
  8934. return (array && array.length)
  8935. ? baseWhile(array, getIteratee(predicate, 3))
  8936. : [];
  8937. }
  8938. /**
  8939. * Creates an array of unique values, in order, from all given arrays using
  8940. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8941. * for equality comparisons.
  8942. *
  8943. * @static
  8944. * @memberOf _
  8945. * @since 0.1.0
  8946. * @category Array
  8947. * @param {...Array} [arrays] The arrays to inspect.
  8948. * @returns {Array} Returns the new array of combined values.
  8949. * @example
  8950. *
  8951. * _.union([2], [1, 2]);
  8952. * // => [2, 1]
  8953. */
  8954. var union = baseRest(function(arrays) {
  8955. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8956. });
  8957. /**
  8958. * This method is like `_.union` except that it accepts `iteratee` which is
  8959. * invoked for each element of each `arrays` to generate the criterion by
  8960. * which uniqueness is computed. Result values are chosen from the first
  8961. * array in which the value occurs. The iteratee is invoked with one argument:
  8962. * (value).
  8963. *
  8964. * @static
  8965. * @memberOf _
  8966. * @since 4.0.0
  8967. * @category Array
  8968. * @param {...Array} [arrays] The arrays to inspect.
  8969. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8970. * @returns {Array} Returns the new array of combined values.
  8971. * @example
  8972. *
  8973. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8974. * // => [2.1, 1.2]
  8975. *
  8976. * // The `_.property` iteratee shorthand.
  8977. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8978. * // => [{ 'x': 1 }, { 'x': 2 }]
  8979. */
  8980. var unionBy = baseRest(function(arrays) {
  8981. var iteratee = last(arrays);
  8982. if (isArrayLikeObject(iteratee)) {
  8983. iteratee = undefined;
  8984. }
  8985. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8986. });
  8987. /**
  8988. * This method is like `_.union` except that it accepts `comparator` which
  8989. * is invoked to compare elements of `arrays`. Result values are chosen from
  8990. * the first array in which the value occurs. The comparator is invoked
  8991. * with two arguments: (arrVal, othVal).
  8992. *
  8993. * @static
  8994. * @memberOf _
  8995. * @since 4.0.0
  8996. * @category Array
  8997. * @param {...Array} [arrays] The arrays to inspect.
  8998. * @param {Function} [comparator] The comparator invoked per element.
  8999. * @returns {Array} Returns the new array of combined values.
  9000. * @example
  9001. *
  9002. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9003. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9004. *
  9005. * _.unionWith(objects, others, _.isEqual);
  9006. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9007. */
  9008. var unionWith = baseRest(function(arrays) {
  9009. var comparator = last(arrays);
  9010. comparator = typeof comparator == 'function' ? comparator : undefined;
  9011. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9012. });
  9013. /**
  9014. * Creates a duplicate-free version of an array, using
  9015. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9016. * for equality comparisons, in which only the first occurrence of each element
  9017. * is kept. The order of result values is determined by the order they occur
  9018. * in the array.
  9019. *
  9020. * @static
  9021. * @memberOf _
  9022. * @since 0.1.0
  9023. * @category Array
  9024. * @param {Array} array The array to inspect.
  9025. * @returns {Array} Returns the new duplicate free array.
  9026. * @example
  9027. *
  9028. * _.uniq([2, 1, 2]);
  9029. * // => [2, 1]
  9030. */
  9031. function uniq(array) {
  9032. return (array && array.length) ? baseUniq(array) : [];
  9033. }
  9034. /**
  9035. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9036. * invoked for each element in `array` to generate the criterion by which
  9037. * uniqueness is computed. The order of result values is determined by the
  9038. * order they occur in the array. The iteratee is invoked with one argument:
  9039. * (value).
  9040. *
  9041. * @static
  9042. * @memberOf _
  9043. * @since 4.0.0
  9044. * @category Array
  9045. * @param {Array} array The array to inspect.
  9046. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9047. * @returns {Array} Returns the new duplicate free array.
  9048. * @example
  9049. *
  9050. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9051. * // => [2.1, 1.2]
  9052. *
  9053. * // The `_.property` iteratee shorthand.
  9054. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9055. * // => [{ 'x': 1 }, { 'x': 2 }]
  9056. */
  9057. function uniqBy(array, iteratee) {
  9058. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9059. }
  9060. /**
  9061. * This method is like `_.uniq` except that it accepts `comparator` which
  9062. * is invoked to compare elements of `array`. The order of result values is
  9063. * determined by the order they occur in the array.The comparator is invoked
  9064. * with two arguments: (arrVal, othVal).
  9065. *
  9066. * @static
  9067. * @memberOf _
  9068. * @since 4.0.0
  9069. * @category Array
  9070. * @param {Array} array The array to inspect.
  9071. * @param {Function} [comparator] The comparator invoked per element.
  9072. * @returns {Array} Returns the new duplicate free array.
  9073. * @example
  9074. *
  9075. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9076. *
  9077. * _.uniqWith(objects, _.isEqual);
  9078. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9079. */
  9080. function uniqWith(array, comparator) {
  9081. comparator = typeof comparator == 'function' ? comparator : undefined;
  9082. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9083. }
  9084. /**
  9085. * This method is like `_.zip` except that it accepts an array of grouped
  9086. * elements and creates an array regrouping the elements to their pre-zip
  9087. * configuration.
  9088. *
  9089. * @static
  9090. * @memberOf _
  9091. * @since 1.2.0
  9092. * @category Array
  9093. * @param {Array} array The array of grouped elements to process.
  9094. * @returns {Array} Returns the new array of regrouped elements.
  9095. * @example
  9096. *
  9097. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9098. * // => [['a', 1, true], ['b', 2, false]]
  9099. *
  9100. * _.unzip(zipped);
  9101. * // => [['a', 'b'], [1, 2], [true, false]]
  9102. */
  9103. function unzip(array) {
  9104. if (!(array && array.length)) {
  9105. return [];
  9106. }
  9107. var length = 0;
  9108. array = arrayFilter(array, function(group) {
  9109. if (isArrayLikeObject(group)) {
  9110. length = nativeMax(group.length, length);
  9111. return true;
  9112. }
  9113. });
  9114. return baseTimes(length, function(index) {
  9115. return arrayMap(array, baseProperty(index));
  9116. });
  9117. }
  9118. /**
  9119. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9120. * how regrouped values should be combined. The iteratee is invoked with the
  9121. * elements of each group: (...group).
  9122. *
  9123. * @static
  9124. * @memberOf _
  9125. * @since 3.8.0
  9126. * @category Array
  9127. * @param {Array} array The array of grouped elements to process.
  9128. * @param {Function} [iteratee=_.identity] The function to combine
  9129. * regrouped values.
  9130. * @returns {Array} Returns the new array of regrouped elements.
  9131. * @example
  9132. *
  9133. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9134. * // => [[1, 10, 100], [2, 20, 200]]
  9135. *
  9136. * _.unzipWith(zipped, _.add);
  9137. * // => [3, 30, 300]
  9138. */
  9139. function unzipWith(array, iteratee) {
  9140. if (!(array && array.length)) {
  9141. return [];
  9142. }
  9143. var result = unzip(array);
  9144. if (iteratee == null) {
  9145. return result;
  9146. }
  9147. return arrayMap(result, function(group) {
  9148. return apply(iteratee, undefined, group);
  9149. });
  9150. }
  9151. /**
  9152. * Creates an array excluding all given values using
  9153. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9154. * for equality comparisons.
  9155. *
  9156. * **Note:** Unlike `_.pull`, this method returns a new array.
  9157. *
  9158. * @static
  9159. * @memberOf _
  9160. * @since 0.1.0
  9161. * @category Array
  9162. * @param {Array} array The array to inspect.
  9163. * @param {...*} [values] The values to exclude.
  9164. * @returns {Array} Returns the new array of filtered values.
  9165. * @see _.difference, _.xor
  9166. * @example
  9167. *
  9168. * _.without([2, 1, 2, 3], 1, 2);
  9169. * // => [3]
  9170. */
  9171. var without = baseRest(function(array, values) {
  9172. return isArrayLikeObject(array)
  9173. ? baseDifference(array, values)
  9174. : [];
  9175. });
  9176. /**
  9177. * Creates an array of unique values that is the
  9178. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9179. * of the given arrays. The order of result values is determined by the order
  9180. * they occur in the arrays.
  9181. *
  9182. * @static
  9183. * @memberOf _
  9184. * @since 2.4.0
  9185. * @category Array
  9186. * @param {...Array} [arrays] The arrays to inspect.
  9187. * @returns {Array} Returns the new array of filtered values.
  9188. * @see _.difference, _.without
  9189. * @example
  9190. *
  9191. * _.xor([2, 1], [2, 3]);
  9192. * // => [1, 3]
  9193. */
  9194. var xor = baseRest(function(arrays) {
  9195. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9196. });
  9197. /**
  9198. * This method is like `_.xor` except that it accepts `iteratee` which is
  9199. * invoked for each element of each `arrays` to generate the criterion by
  9200. * which by which they're compared. The order of result values is determined
  9201. * by the order they occur in the arrays. The iteratee is invoked with one
  9202. * argument: (value).
  9203. *
  9204. * @static
  9205. * @memberOf _
  9206. * @since 4.0.0
  9207. * @category Array
  9208. * @param {...Array} [arrays] The arrays to inspect.
  9209. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9210. * @returns {Array} Returns the new array of filtered values.
  9211. * @example
  9212. *
  9213. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9214. * // => [1.2, 3.4]
  9215. *
  9216. * // The `_.property` iteratee shorthand.
  9217. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9218. * // => [{ 'x': 2 }]
  9219. */
  9220. var xorBy = baseRest(function(arrays) {
  9221. var iteratee = last(arrays);
  9222. if (isArrayLikeObject(iteratee)) {
  9223. iteratee = undefined;
  9224. }
  9225. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9226. });
  9227. /**
  9228. * This method is like `_.xor` except that it accepts `comparator` which is
  9229. * invoked to compare elements of `arrays`. The order of result values is
  9230. * determined by the order they occur in the arrays. The comparator is invoked
  9231. * with two arguments: (arrVal, othVal).
  9232. *
  9233. * @static
  9234. * @memberOf _
  9235. * @since 4.0.0
  9236. * @category Array
  9237. * @param {...Array} [arrays] The arrays to inspect.
  9238. * @param {Function} [comparator] The comparator invoked per element.
  9239. * @returns {Array} Returns the new array of filtered values.
  9240. * @example
  9241. *
  9242. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9243. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9244. *
  9245. * _.xorWith(objects, others, _.isEqual);
  9246. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9247. */
  9248. var xorWith = baseRest(function(arrays) {
  9249. var comparator = last(arrays);
  9250. comparator = typeof comparator == 'function' ? comparator : undefined;
  9251. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9252. });
  9253. /**
  9254. * Creates an array of grouped elements, the first of which contains the
  9255. * first elements of the given arrays, the second of which contains the
  9256. * second elements of the given arrays, and so on.
  9257. *
  9258. * @static
  9259. * @memberOf _
  9260. * @since 0.1.0
  9261. * @category Array
  9262. * @param {...Array} [arrays] The arrays to process.
  9263. * @returns {Array} Returns the new array of grouped elements.
  9264. * @example
  9265. *
  9266. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9267. * // => [['a', 1, true], ['b', 2, false]]
  9268. */
  9269. var zip = baseRest(unzip);
  9270. /**
  9271. * This method is like `_.fromPairs` except that it accepts two arrays,
  9272. * one of property identifiers and one of corresponding values.
  9273. *
  9274. * @static
  9275. * @memberOf _
  9276. * @since 0.4.0
  9277. * @category Array
  9278. * @param {Array} [props=[]] The property identifiers.
  9279. * @param {Array} [values=[]] The property values.
  9280. * @returns {Object} Returns the new object.
  9281. * @example
  9282. *
  9283. * _.zipObject(['a', 'b'], [1, 2]);
  9284. * // => { 'a': 1, 'b': 2 }
  9285. */
  9286. function zipObject(props, values) {
  9287. return baseZipObject(props || [], values || [], assignValue);
  9288. }
  9289. /**
  9290. * This method is like `_.zipObject` except that it supports property paths.
  9291. *
  9292. * @static
  9293. * @memberOf _
  9294. * @since 4.1.0
  9295. * @category Array
  9296. * @param {Array} [props=[]] The property identifiers.
  9297. * @param {Array} [values=[]] The property values.
  9298. * @returns {Object} Returns the new object.
  9299. * @example
  9300. *
  9301. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9302. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9303. */
  9304. function zipObjectDeep(props, values) {
  9305. return baseZipObject(props || [], values || [], baseSet);
  9306. }
  9307. /**
  9308. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9309. * how grouped values should be combined. The iteratee is invoked with the
  9310. * elements of each group: (...group).
  9311. *
  9312. * @static
  9313. * @memberOf _
  9314. * @since 3.8.0
  9315. * @category Array
  9316. * @param {...Array} [arrays] The arrays to process.
  9317. * @param {Function} [iteratee=_.identity] The function to combine
  9318. * grouped values.
  9319. * @returns {Array} Returns the new array of grouped elements.
  9320. * @example
  9321. *
  9322. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9323. * return a + b + c;
  9324. * });
  9325. * // => [111, 222]
  9326. */
  9327. var zipWith = baseRest(function(arrays) {
  9328. var length = arrays.length,
  9329. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9330. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9331. return unzipWith(arrays, iteratee);
  9332. });
  9333. /*------------------------------------------------------------------------*/
  9334. /**
  9335. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9336. * chain sequences enabled. The result of such sequences must be unwrapped
  9337. * with `_#value`.
  9338. *
  9339. * @static
  9340. * @memberOf _
  9341. * @since 1.3.0
  9342. * @category Seq
  9343. * @param {*} value The value to wrap.
  9344. * @returns {Object} Returns the new `lodash` wrapper instance.
  9345. * @example
  9346. *
  9347. * var users = [
  9348. * { 'user': 'barney', 'age': 36 },
  9349. * { 'user': 'fred', 'age': 40 },
  9350. * { 'user': 'pebbles', 'age': 1 }
  9351. * ];
  9352. *
  9353. * var youngest = _
  9354. * .chain(users)
  9355. * .sortBy('age')
  9356. * .map(function(o) {
  9357. * return o.user + ' is ' + o.age;
  9358. * })
  9359. * .head()
  9360. * .value();
  9361. * // => 'pebbles is 1'
  9362. */
  9363. function chain(value) {
  9364. var result = lodash(value);
  9365. result.__chain__ = true;
  9366. return result;
  9367. }
  9368. /**
  9369. * This method invokes `interceptor` and returns `value`. The interceptor
  9370. * is invoked with one argument; (value). The purpose of this method is to
  9371. * "tap into" a method chain sequence in order to modify intermediate results.
  9372. *
  9373. * @static
  9374. * @memberOf _
  9375. * @since 0.1.0
  9376. * @category Seq
  9377. * @param {*} value The value to provide to `interceptor`.
  9378. * @param {Function} interceptor The function to invoke.
  9379. * @returns {*} Returns `value`.
  9380. * @example
  9381. *
  9382. * _([1, 2, 3])
  9383. * .tap(function(array) {
  9384. * // Mutate input array.
  9385. * array.pop();
  9386. * })
  9387. * .reverse()
  9388. * .value();
  9389. * // => [2, 1]
  9390. */
  9391. function tap(value, interceptor) {
  9392. interceptor(value);
  9393. return value;
  9394. }
  9395. /**
  9396. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9397. * The purpose of this method is to "pass thru" values replacing intermediate
  9398. * results in a method chain sequence.
  9399. *
  9400. * @static
  9401. * @memberOf _
  9402. * @since 3.0.0
  9403. * @category Seq
  9404. * @param {*} value The value to provide to `interceptor`.
  9405. * @param {Function} interceptor The function to invoke.
  9406. * @returns {*} Returns the result of `interceptor`.
  9407. * @example
  9408. *
  9409. * _(' abc ')
  9410. * .chain()
  9411. * .trim()
  9412. * .thru(function(value) {
  9413. * return [value];
  9414. * })
  9415. * .value();
  9416. * // => ['abc']
  9417. */
  9418. function thru(value, interceptor) {
  9419. return interceptor(value);
  9420. }
  9421. /**
  9422. * This method is the wrapper version of `_.at`.
  9423. *
  9424. * @name at
  9425. * @memberOf _
  9426. * @since 1.0.0
  9427. * @category Seq
  9428. * @param {...(string|string[])} [paths] The property paths to pick.
  9429. * @returns {Object} Returns the new `lodash` wrapper instance.
  9430. * @example
  9431. *
  9432. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9433. *
  9434. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9435. * // => [3, 4]
  9436. */
  9437. var wrapperAt = flatRest(function(paths) {
  9438. var length = paths.length,
  9439. start = length ? paths[0] : 0,
  9440. value = this.__wrapped__,
  9441. interceptor = function(object) { return baseAt(object, paths); };
  9442. if (length > 1 || this.__actions__.length ||
  9443. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9444. return this.thru(interceptor);
  9445. }
  9446. value = value.slice(start, +start + (length ? 1 : 0));
  9447. value.__actions__.push({
  9448. 'func': thru,
  9449. 'args': [interceptor],
  9450. 'thisArg': undefined
  9451. });
  9452. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9453. if (length && !array.length) {
  9454. array.push(undefined);
  9455. }
  9456. return array;
  9457. });
  9458. });
  9459. /**
  9460. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9461. *
  9462. * @name chain
  9463. * @memberOf _
  9464. * @since 0.1.0
  9465. * @category Seq
  9466. * @returns {Object} Returns the new `lodash` wrapper instance.
  9467. * @example
  9468. *
  9469. * var users = [
  9470. * { 'user': 'barney', 'age': 36 },
  9471. * { 'user': 'fred', 'age': 40 }
  9472. * ];
  9473. *
  9474. * // A sequence without explicit chaining.
  9475. * _(users).head();
  9476. * // => { 'user': 'barney', 'age': 36 }
  9477. *
  9478. * // A sequence with explicit chaining.
  9479. * _(users)
  9480. * .chain()
  9481. * .head()
  9482. * .pick('user')
  9483. * .value();
  9484. * // => { 'user': 'barney' }
  9485. */
  9486. function wrapperChain() {
  9487. return chain(this);
  9488. }
  9489. /**
  9490. * Executes the chain sequence and returns the wrapped result.
  9491. *
  9492. * @name commit
  9493. * @memberOf _
  9494. * @since 3.2.0
  9495. * @category Seq
  9496. * @returns {Object} Returns the new `lodash` wrapper instance.
  9497. * @example
  9498. *
  9499. * var array = [1, 2];
  9500. * var wrapped = _(array).push(3);
  9501. *
  9502. * console.log(array);
  9503. * // => [1, 2]
  9504. *
  9505. * wrapped = wrapped.commit();
  9506. * console.log(array);
  9507. * // => [1, 2, 3]
  9508. *
  9509. * wrapped.last();
  9510. * // => 3
  9511. *
  9512. * console.log(array);
  9513. * // => [1, 2, 3]
  9514. */
  9515. function wrapperCommit() {
  9516. return new LodashWrapper(this.value(), this.__chain__);
  9517. }
  9518. /**
  9519. * Gets the next value on a wrapped object following the
  9520. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9521. *
  9522. * @name next
  9523. * @memberOf _
  9524. * @since 4.0.0
  9525. * @category Seq
  9526. * @returns {Object} Returns the next iterator value.
  9527. * @example
  9528. *
  9529. * var wrapped = _([1, 2]);
  9530. *
  9531. * wrapped.next();
  9532. * // => { 'done': false, 'value': 1 }
  9533. *
  9534. * wrapped.next();
  9535. * // => { 'done': false, 'value': 2 }
  9536. *
  9537. * wrapped.next();
  9538. * // => { 'done': true, 'value': undefined }
  9539. */
  9540. function wrapperNext() {
  9541. if (this.__values__ === undefined) {
  9542. this.__values__ = toArray(this.value());
  9543. }
  9544. var done = this.__index__ >= this.__values__.length,
  9545. value = done ? undefined : this.__values__[this.__index__++];
  9546. return { 'done': done, 'value': value };
  9547. }
  9548. /**
  9549. * Enables the wrapper to be iterable.
  9550. *
  9551. * @name Symbol.iterator
  9552. * @memberOf _
  9553. * @since 4.0.0
  9554. * @category Seq
  9555. * @returns {Object} Returns the wrapper object.
  9556. * @example
  9557. *
  9558. * var wrapped = _([1, 2]);
  9559. *
  9560. * wrapped[Symbol.iterator]() === wrapped;
  9561. * // => true
  9562. *
  9563. * Array.from(wrapped);
  9564. * // => [1, 2]
  9565. */
  9566. function wrapperToIterator() {
  9567. return this;
  9568. }
  9569. /**
  9570. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9571. *
  9572. * @name plant
  9573. * @memberOf _
  9574. * @since 3.2.0
  9575. * @category Seq
  9576. * @param {*} value The value to plant.
  9577. * @returns {Object} Returns the new `lodash` wrapper instance.
  9578. * @example
  9579. *
  9580. * function square(n) {
  9581. * return n * n;
  9582. * }
  9583. *
  9584. * var wrapped = _([1, 2]).map(square);
  9585. * var other = wrapped.plant([3, 4]);
  9586. *
  9587. * other.value();
  9588. * // => [9, 16]
  9589. *
  9590. * wrapped.value();
  9591. * // => [1, 4]
  9592. */
  9593. function wrapperPlant(value) {
  9594. var result,
  9595. parent = this;
  9596. while (parent instanceof baseLodash) {
  9597. var clone = wrapperClone(parent);
  9598. clone.__index__ = 0;
  9599. clone.__values__ = undefined;
  9600. if (result) {
  9601. previous.__wrapped__ = clone;
  9602. } else {
  9603. result = clone;
  9604. }
  9605. var previous = clone;
  9606. parent = parent.__wrapped__;
  9607. }
  9608. previous.__wrapped__ = value;
  9609. return result;
  9610. }
  9611. /**
  9612. * This method is the wrapper version of `_.reverse`.
  9613. *
  9614. * **Note:** This method mutates the wrapped array.
  9615. *
  9616. * @name reverse
  9617. * @memberOf _
  9618. * @since 0.1.0
  9619. * @category Seq
  9620. * @returns {Object} Returns the new `lodash` wrapper instance.
  9621. * @example
  9622. *
  9623. * var array = [1, 2, 3];
  9624. *
  9625. * _(array).reverse().value()
  9626. * // => [3, 2, 1]
  9627. *
  9628. * console.log(array);
  9629. * // => [3, 2, 1]
  9630. */
  9631. function wrapperReverse() {
  9632. var value = this.__wrapped__;
  9633. if (value instanceof LazyWrapper) {
  9634. var wrapped = value;
  9635. if (this.__actions__.length) {
  9636. wrapped = new LazyWrapper(this);
  9637. }
  9638. wrapped = wrapped.reverse();
  9639. wrapped.__actions__.push({
  9640. 'func': thru,
  9641. 'args': [reverse],
  9642. 'thisArg': undefined
  9643. });
  9644. return new LodashWrapper(wrapped, this.__chain__);
  9645. }
  9646. return this.thru(reverse);
  9647. }
  9648. /**
  9649. * Executes the chain sequence to resolve the unwrapped value.
  9650. *
  9651. * @name value
  9652. * @memberOf _
  9653. * @since 0.1.0
  9654. * @alias toJSON, valueOf
  9655. * @category Seq
  9656. * @returns {*} Returns the resolved unwrapped value.
  9657. * @example
  9658. *
  9659. * _([1, 2, 3]).value();
  9660. * // => [1, 2, 3]
  9661. */
  9662. function wrapperValue() {
  9663. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9664. }
  9665. /*------------------------------------------------------------------------*/
  9666. /**
  9667. * Creates an object composed of keys generated from the results of running
  9668. * each element of `collection` thru `iteratee`. The corresponding value of
  9669. * each key is the number of times the key was returned by `iteratee`. The
  9670. * iteratee is invoked with one argument: (value).
  9671. *
  9672. * @static
  9673. * @memberOf _
  9674. * @since 0.5.0
  9675. * @category Collection
  9676. * @param {Array|Object} collection The collection to iterate over.
  9677. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9678. * @returns {Object} Returns the composed aggregate object.
  9679. * @example
  9680. *
  9681. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9682. * // => { '4': 1, '6': 2 }
  9683. *
  9684. * // The `_.property` iteratee shorthand.
  9685. * _.countBy(['one', 'two', 'three'], 'length');
  9686. * // => { '3': 2, '5': 1 }
  9687. */
  9688. var countBy = createAggregator(function(result, value, key) {
  9689. if (hasOwnProperty.call(result, key)) {
  9690. ++result[key];
  9691. } else {
  9692. baseAssignValue(result, key, 1);
  9693. }
  9694. });
  9695. /**
  9696. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9697. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9698. * invoked with three arguments: (value, index|key, collection).
  9699. *
  9700. * **Note:** This method returns `true` for
  9701. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9702. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9703. * elements of empty collections.
  9704. *
  9705. * @static
  9706. * @memberOf _
  9707. * @since 0.1.0
  9708. * @category Collection
  9709. * @param {Array|Object} collection The collection to iterate over.
  9710. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9711. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9712. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9713. * else `false`.
  9714. * @example
  9715. *
  9716. * _.every([true, 1, null, 'yes'], Boolean);
  9717. * // => false
  9718. *
  9719. * var users = [
  9720. * { 'user': 'barney', 'age': 36, 'active': false },
  9721. * { 'user': 'fred', 'age': 40, 'active': false }
  9722. * ];
  9723. *
  9724. * // The `_.matches` iteratee shorthand.
  9725. * _.every(users, { 'user': 'barney', 'active': false });
  9726. * // => false
  9727. *
  9728. * // The `_.matchesProperty` iteratee shorthand.
  9729. * _.every(users, ['active', false]);
  9730. * // => true
  9731. *
  9732. * // The `_.property` iteratee shorthand.
  9733. * _.every(users, 'active');
  9734. * // => false
  9735. */
  9736. function every(collection, predicate, guard) {
  9737. var func = isArray(collection) ? arrayEvery : baseEvery;
  9738. if (guard && isIterateeCall(collection, predicate, guard)) {
  9739. predicate = undefined;
  9740. }
  9741. return func(collection, getIteratee(predicate, 3));
  9742. }
  9743. /**
  9744. * Iterates over elements of `collection`, returning an array of all elements
  9745. * `predicate` returns truthy for. The predicate is invoked with three
  9746. * arguments: (value, index|key, collection).
  9747. *
  9748. * **Note:** Unlike `_.remove`, this method returns a new array.
  9749. *
  9750. * @static
  9751. * @memberOf _
  9752. * @since 0.1.0
  9753. * @category Collection
  9754. * @param {Array|Object} collection The collection to iterate over.
  9755. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9756. * @returns {Array} Returns the new filtered array.
  9757. * @see _.reject
  9758. * @example
  9759. *
  9760. * var users = [
  9761. * { 'user': 'barney', 'age': 36, 'active': true },
  9762. * { 'user': 'fred', 'age': 40, 'active': false }
  9763. * ];
  9764. *
  9765. * _.filter(users, function(o) { return !o.active; });
  9766. * // => objects for ['fred']
  9767. *
  9768. * // The `_.matches` iteratee shorthand.
  9769. * _.filter(users, { 'age': 36, 'active': true });
  9770. * // => objects for ['barney']
  9771. *
  9772. * // The `_.matchesProperty` iteratee shorthand.
  9773. * _.filter(users, ['active', false]);
  9774. * // => objects for ['fred']
  9775. *
  9776. * // The `_.property` iteratee shorthand.
  9777. * _.filter(users, 'active');
  9778. * // => objects for ['barney']
  9779. *
  9780. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9781. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9782. * // => objects for ['fred', 'barney']
  9783. */
  9784. function filter(collection, predicate) {
  9785. var func = isArray(collection) ? arrayFilter : baseFilter;
  9786. return func(collection, getIteratee(predicate, 3));
  9787. }
  9788. /**
  9789. * Iterates over elements of `collection`, returning the first element
  9790. * `predicate` returns truthy for. The predicate is invoked with three
  9791. * arguments: (value, index|key, collection).
  9792. *
  9793. * @static
  9794. * @memberOf _
  9795. * @since 0.1.0
  9796. * @category Collection
  9797. * @param {Array|Object} collection The collection to inspect.
  9798. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9799. * @param {number} [fromIndex=0] The index to search from.
  9800. * @returns {*} Returns the matched element, else `undefined`.
  9801. * @example
  9802. *
  9803. * var users = [
  9804. * { 'user': 'barney', 'age': 36, 'active': true },
  9805. * { 'user': 'fred', 'age': 40, 'active': false },
  9806. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9807. * ];
  9808. *
  9809. * _.find(users, function(o) { return o.age < 40; });
  9810. * // => object for 'barney'
  9811. *
  9812. * // The `_.matches` iteratee shorthand.
  9813. * _.find(users, { 'age': 1, 'active': true });
  9814. * // => object for 'pebbles'
  9815. *
  9816. * // The `_.matchesProperty` iteratee shorthand.
  9817. * _.find(users, ['active', false]);
  9818. * // => object for 'fred'
  9819. *
  9820. * // The `_.property` iteratee shorthand.
  9821. * _.find(users, 'active');
  9822. * // => object for 'barney'
  9823. */
  9824. var find = createFind(findIndex);
  9825. /**
  9826. * This method is like `_.find` except that it iterates over elements of
  9827. * `collection` from right to left.
  9828. *
  9829. * @static
  9830. * @memberOf _
  9831. * @since 2.0.0
  9832. * @category Collection
  9833. * @param {Array|Object} collection The collection to inspect.
  9834. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9835. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9836. * @returns {*} Returns the matched element, else `undefined`.
  9837. * @example
  9838. *
  9839. * _.findLast([1, 2, 3, 4], function(n) {
  9840. * return n % 2 == 1;
  9841. * });
  9842. * // => 3
  9843. */
  9844. var findLast = createFind(findLastIndex);
  9845. /**
  9846. * Creates a flattened array of values by running each element in `collection`
  9847. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9848. * with three arguments: (value, index|key, collection).
  9849. *
  9850. * @static
  9851. * @memberOf _
  9852. * @since 4.0.0
  9853. * @category Collection
  9854. * @param {Array|Object} collection The collection to iterate over.
  9855. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9856. * @returns {Array} Returns the new flattened array.
  9857. * @example
  9858. *
  9859. * function duplicate(n) {
  9860. * return [n, n];
  9861. * }
  9862. *
  9863. * _.flatMap([1, 2], duplicate);
  9864. * // => [1, 1, 2, 2]
  9865. */
  9866. function flatMap(collection, iteratee) {
  9867. return baseFlatten(map(collection, iteratee), 1);
  9868. }
  9869. /**
  9870. * This method is like `_.flatMap` except that it recursively flattens the
  9871. * mapped results.
  9872. *
  9873. * @static
  9874. * @memberOf _
  9875. * @since 4.7.0
  9876. * @category Collection
  9877. * @param {Array|Object} collection The collection to iterate over.
  9878. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9879. * @returns {Array} Returns the new flattened array.
  9880. * @example
  9881. *
  9882. * function duplicate(n) {
  9883. * return [[[n, n]]];
  9884. * }
  9885. *
  9886. * _.flatMapDeep([1, 2], duplicate);
  9887. * // => [1, 1, 2, 2]
  9888. */
  9889. function flatMapDeep(collection, iteratee) {
  9890. return baseFlatten(map(collection, iteratee), INFINITY);
  9891. }
  9892. /**
  9893. * This method is like `_.flatMap` except that it recursively flattens the
  9894. * mapped results up to `depth` times.
  9895. *
  9896. * @static
  9897. * @memberOf _
  9898. * @since 4.7.0
  9899. * @category Collection
  9900. * @param {Array|Object} collection The collection to iterate over.
  9901. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9902. * @param {number} [depth=1] The maximum recursion depth.
  9903. * @returns {Array} Returns the new flattened array.
  9904. * @example
  9905. *
  9906. * function duplicate(n) {
  9907. * return [[[n, n]]];
  9908. * }
  9909. *
  9910. * _.flatMapDepth([1, 2], duplicate, 2);
  9911. * // => [[1, 1], [2, 2]]
  9912. */
  9913. function flatMapDepth(collection, iteratee, depth) {
  9914. depth = depth === undefined ? 1 : toInteger(depth);
  9915. return baseFlatten(map(collection, iteratee), depth);
  9916. }
  9917. /**
  9918. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9919. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9920. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9921. *
  9922. * **Note:** As with other "Collections" methods, objects with a "length"
  9923. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9924. * or `_.forOwn` for object iteration.
  9925. *
  9926. * @static
  9927. * @memberOf _
  9928. * @since 0.1.0
  9929. * @alias each
  9930. * @category Collection
  9931. * @param {Array|Object} collection The collection to iterate over.
  9932. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9933. * @returns {Array|Object} Returns `collection`.
  9934. * @see _.forEachRight
  9935. * @example
  9936. *
  9937. * _.forEach([1, 2], function(value) {
  9938. * console.log(value);
  9939. * });
  9940. * // => Logs `1` then `2`.
  9941. *
  9942. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9943. * console.log(key);
  9944. * });
  9945. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9946. */
  9947. function forEach(collection, iteratee) {
  9948. var func = isArray(collection) ? arrayEach : baseEach;
  9949. return func(collection, getIteratee(iteratee, 3));
  9950. }
  9951. /**
  9952. * This method is like `_.forEach` except that it iterates over elements of
  9953. * `collection` from right to left.
  9954. *
  9955. * @static
  9956. * @memberOf _
  9957. * @since 2.0.0
  9958. * @alias eachRight
  9959. * @category Collection
  9960. * @param {Array|Object} collection The collection to iterate over.
  9961. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9962. * @returns {Array|Object} Returns `collection`.
  9963. * @see _.forEach
  9964. * @example
  9965. *
  9966. * _.forEachRight([1, 2], function(value) {
  9967. * console.log(value);
  9968. * });
  9969. * // => Logs `2` then `1`.
  9970. */
  9971. function forEachRight(collection, iteratee) {
  9972. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9973. return func(collection, getIteratee(iteratee, 3));
  9974. }
  9975. /**
  9976. * Creates an object composed of keys generated from the results of running
  9977. * each element of `collection` thru `iteratee`. The order of grouped values
  9978. * is determined by the order they occur in `collection`. The corresponding
  9979. * value of each key is an array of elements responsible for generating the
  9980. * key. The iteratee is invoked with one argument: (value).
  9981. *
  9982. * @static
  9983. * @memberOf _
  9984. * @since 0.1.0
  9985. * @category Collection
  9986. * @param {Array|Object} collection The collection to iterate over.
  9987. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9988. * @returns {Object} Returns the composed aggregate object.
  9989. * @example
  9990. *
  9991. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9992. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9993. *
  9994. * // The `_.property` iteratee shorthand.
  9995. * _.groupBy(['one', 'two', 'three'], 'length');
  9996. * // => { '3': ['one', 'two'], '5': ['three'] }
  9997. */
  9998. var groupBy = createAggregator(function(result, value, key) {
  9999. if (hasOwnProperty.call(result, key)) {
  10000. result[key].push(value);
  10001. } else {
  10002. baseAssignValue(result, key, [value]);
  10003. }
  10004. });
  10005. /**
  10006. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10007. * checked for a substring of `value`, otherwise
  10008. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10009. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10010. * the offset from the end of `collection`.
  10011. *
  10012. * @static
  10013. * @memberOf _
  10014. * @since 0.1.0
  10015. * @category Collection
  10016. * @param {Array|Object|string} collection The collection to inspect.
  10017. * @param {*} value The value to search for.
  10018. * @param {number} [fromIndex=0] The index to search from.
  10019. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10020. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10021. * @example
  10022. *
  10023. * _.includes([1, 2, 3], 1);
  10024. * // => true
  10025. *
  10026. * _.includes([1, 2, 3], 1, 2);
  10027. * // => false
  10028. *
  10029. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10030. * // => true
  10031. *
  10032. * _.includes('abcd', 'bc');
  10033. * // => true
  10034. */
  10035. function includes(collection, value, fromIndex, guard) {
  10036. collection = isArrayLike(collection) ? collection : values(collection);
  10037. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10038. var length = collection.length;
  10039. if (fromIndex < 0) {
  10040. fromIndex = nativeMax(length + fromIndex, 0);
  10041. }
  10042. return isString(collection)
  10043. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10044. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10045. }
  10046. /**
  10047. * Invokes the method at `path` of each element in `collection`, returning
  10048. * an array of the results of each invoked method. Any additional arguments
  10049. * are provided to each invoked method. If `path` is a function, it's invoked
  10050. * for, and `this` bound to, each element in `collection`.
  10051. *
  10052. * @static
  10053. * @memberOf _
  10054. * @since 4.0.0
  10055. * @category Collection
  10056. * @param {Array|Object} collection The collection to iterate over.
  10057. * @param {Array|Function|string} path The path of the method to invoke or
  10058. * the function invoked per iteration.
  10059. * @param {...*} [args] The arguments to invoke each method with.
  10060. * @returns {Array} Returns the array of results.
  10061. * @example
  10062. *
  10063. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10064. * // => [[1, 5, 7], [1, 2, 3]]
  10065. *
  10066. * _.invokeMap([123, 456], String.prototype.split, '');
  10067. * // => [['1', '2', '3'], ['4', '5', '6']]
  10068. */
  10069. var invokeMap = baseRest(function(collection, path, args) {
  10070. var index = -1,
  10071. isFunc = typeof path == 'function',
  10072. result = isArrayLike(collection) ? Array(collection.length) : [];
  10073. baseEach(collection, function(value) {
  10074. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10075. });
  10076. return result;
  10077. });
  10078. /**
  10079. * Creates an object composed of keys generated from the results of running
  10080. * each element of `collection` thru `iteratee`. The corresponding value of
  10081. * each key is the last element responsible for generating the key. The
  10082. * iteratee is invoked with one argument: (value).
  10083. *
  10084. * @static
  10085. * @memberOf _
  10086. * @since 4.0.0
  10087. * @category Collection
  10088. * @param {Array|Object} collection The collection to iterate over.
  10089. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10090. * @returns {Object} Returns the composed aggregate object.
  10091. * @example
  10092. *
  10093. * var array = [
  10094. * { 'dir': 'left', 'code': 97 },
  10095. * { 'dir': 'right', 'code': 100 }
  10096. * ];
  10097. *
  10098. * _.keyBy(array, function(o) {
  10099. * return String.fromCharCode(o.code);
  10100. * });
  10101. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10102. *
  10103. * _.keyBy(array, 'dir');
  10104. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10105. */
  10106. var keyBy = createAggregator(function(result, value, key) {
  10107. baseAssignValue(result, key, value);
  10108. });
  10109. /**
  10110. * Creates an array of values by running each element in `collection` thru
  10111. * `iteratee`. The iteratee is invoked with three arguments:
  10112. * (value, index|key, collection).
  10113. *
  10114. * Many lodash methods are guarded to work as iteratees for methods like
  10115. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10116. *
  10117. * The guarded methods are:
  10118. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10119. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10120. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10121. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10122. *
  10123. * @static
  10124. * @memberOf _
  10125. * @since 0.1.0
  10126. * @category Collection
  10127. * @param {Array|Object} collection The collection to iterate over.
  10128. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10129. * @returns {Array} Returns the new mapped array.
  10130. * @example
  10131. *
  10132. * function square(n) {
  10133. * return n * n;
  10134. * }
  10135. *
  10136. * _.map([4, 8], square);
  10137. * // => [16, 64]
  10138. *
  10139. * _.map({ 'a': 4, 'b': 8 }, square);
  10140. * // => [16, 64] (iteration order is not guaranteed)
  10141. *
  10142. * var users = [
  10143. * { 'user': 'barney' },
  10144. * { 'user': 'fred' }
  10145. * ];
  10146. *
  10147. * // The `_.property` iteratee shorthand.
  10148. * _.map(users, 'user');
  10149. * // => ['barney', 'fred']
  10150. */
  10151. function map(collection, iteratee) {
  10152. var func = isArray(collection) ? arrayMap : baseMap;
  10153. return func(collection, getIteratee(iteratee, 3));
  10154. }
  10155. /**
  10156. * This method is like `_.sortBy` except that it allows specifying the sort
  10157. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10158. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10159. * descending or "asc" for ascending sort order of corresponding values.
  10160. *
  10161. * @static
  10162. * @memberOf _
  10163. * @since 4.0.0
  10164. * @category Collection
  10165. * @param {Array|Object} collection The collection to iterate over.
  10166. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10167. * The iteratees to sort by.
  10168. * @param {string[]} [orders] The sort orders of `iteratees`.
  10169. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10170. * @returns {Array} Returns the new sorted array.
  10171. * @example
  10172. *
  10173. * var users = [
  10174. * { 'user': 'fred', 'age': 48 },
  10175. * { 'user': 'barney', 'age': 34 },
  10176. * { 'user': 'fred', 'age': 40 },
  10177. * { 'user': 'barney', 'age': 36 }
  10178. * ];
  10179. *
  10180. * // Sort by `user` in ascending order and by `age` in descending order.
  10181. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10182. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10183. */
  10184. function orderBy(collection, iteratees, orders, guard) {
  10185. if (collection == null) {
  10186. return [];
  10187. }
  10188. if (!isArray(iteratees)) {
  10189. iteratees = iteratees == null ? [] : [iteratees];
  10190. }
  10191. orders = guard ? undefined : orders;
  10192. if (!isArray(orders)) {
  10193. orders = orders == null ? [] : [orders];
  10194. }
  10195. return baseOrderBy(collection, iteratees, orders);
  10196. }
  10197. /**
  10198. * Creates an array of elements split into two groups, the first of which
  10199. * contains elements `predicate` returns truthy for, the second of which
  10200. * contains elements `predicate` returns falsey for. The predicate is
  10201. * invoked with one argument: (value).
  10202. *
  10203. * @static
  10204. * @memberOf _
  10205. * @since 3.0.0
  10206. * @category Collection
  10207. * @param {Array|Object} collection The collection to iterate over.
  10208. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10209. * @returns {Array} Returns the array of grouped elements.
  10210. * @example
  10211. *
  10212. * var users = [
  10213. * { 'user': 'barney', 'age': 36, 'active': false },
  10214. * { 'user': 'fred', 'age': 40, 'active': true },
  10215. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10216. * ];
  10217. *
  10218. * _.partition(users, function(o) { return o.active; });
  10219. * // => objects for [['fred'], ['barney', 'pebbles']]
  10220. *
  10221. * // The `_.matches` iteratee shorthand.
  10222. * _.partition(users, { 'age': 1, 'active': false });
  10223. * // => objects for [['pebbles'], ['barney', 'fred']]
  10224. *
  10225. * // The `_.matchesProperty` iteratee shorthand.
  10226. * _.partition(users, ['active', false]);
  10227. * // => objects for [['barney', 'pebbles'], ['fred']]
  10228. *
  10229. * // The `_.property` iteratee shorthand.
  10230. * _.partition(users, 'active');
  10231. * // => objects for [['fred'], ['barney', 'pebbles']]
  10232. */
  10233. var partition = createAggregator(function(result, value, key) {
  10234. result[key ? 0 : 1].push(value);
  10235. }, function() { return [[], []]; });
  10236. /**
  10237. * Reduces `collection` to a value which is the accumulated result of running
  10238. * each element in `collection` thru `iteratee`, where each successive
  10239. * invocation is supplied the return value of the previous. If `accumulator`
  10240. * is not given, the first element of `collection` is used as the initial
  10241. * value. The iteratee is invoked with four arguments:
  10242. * (accumulator, value, index|key, collection).
  10243. *
  10244. * Many lodash methods are guarded to work as iteratees for methods like
  10245. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10246. *
  10247. * The guarded methods are:
  10248. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10249. * and `sortBy`
  10250. *
  10251. * @static
  10252. * @memberOf _
  10253. * @since 0.1.0
  10254. * @category Collection
  10255. * @param {Array|Object} collection The collection to iterate over.
  10256. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10257. * @param {*} [accumulator] The initial value.
  10258. * @returns {*} Returns the accumulated value.
  10259. * @see _.reduceRight
  10260. * @example
  10261. *
  10262. * _.reduce([1, 2], function(sum, n) {
  10263. * return sum + n;
  10264. * }, 0);
  10265. * // => 3
  10266. *
  10267. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10268. * (result[value] || (result[value] = [])).push(key);
  10269. * return result;
  10270. * }, {});
  10271. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10272. */
  10273. function reduce(collection, iteratee, accumulator) {
  10274. var func = isArray(collection) ? arrayReduce : baseReduce,
  10275. initAccum = arguments.length < 3;
  10276. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10277. }
  10278. /**
  10279. * This method is like `_.reduce` except that it iterates over elements of
  10280. * `collection` from right to left.
  10281. *
  10282. * @static
  10283. * @memberOf _
  10284. * @since 0.1.0
  10285. * @category Collection
  10286. * @param {Array|Object} collection The collection to iterate over.
  10287. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10288. * @param {*} [accumulator] The initial value.
  10289. * @returns {*} Returns the accumulated value.
  10290. * @see _.reduce
  10291. * @example
  10292. *
  10293. * var array = [[0, 1], [2, 3], [4, 5]];
  10294. *
  10295. * _.reduceRight(array, function(flattened, other) {
  10296. * return flattened.concat(other);
  10297. * }, []);
  10298. * // => [4, 5, 2, 3, 0, 1]
  10299. */
  10300. function reduceRight(collection, iteratee, accumulator) {
  10301. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10302. initAccum = arguments.length < 3;
  10303. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10304. }
  10305. /**
  10306. * The opposite of `_.filter`; this method returns the elements of `collection`
  10307. * that `predicate` does **not** return truthy for.
  10308. *
  10309. * @static
  10310. * @memberOf _
  10311. * @since 0.1.0
  10312. * @category Collection
  10313. * @param {Array|Object} collection The collection to iterate over.
  10314. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10315. * @returns {Array} Returns the new filtered array.
  10316. * @see _.filter
  10317. * @example
  10318. *
  10319. * var users = [
  10320. * { 'user': 'barney', 'age': 36, 'active': false },
  10321. * { 'user': 'fred', 'age': 40, 'active': true }
  10322. * ];
  10323. *
  10324. * _.reject(users, function(o) { return !o.active; });
  10325. * // => objects for ['fred']
  10326. *
  10327. * // The `_.matches` iteratee shorthand.
  10328. * _.reject(users, { 'age': 40, 'active': true });
  10329. * // => objects for ['barney']
  10330. *
  10331. * // The `_.matchesProperty` iteratee shorthand.
  10332. * _.reject(users, ['active', false]);
  10333. * // => objects for ['fred']
  10334. *
  10335. * // The `_.property` iteratee shorthand.
  10336. * _.reject(users, 'active');
  10337. * // => objects for ['barney']
  10338. */
  10339. function reject(collection, predicate) {
  10340. var func = isArray(collection) ? arrayFilter : baseFilter;
  10341. return func(collection, negate(getIteratee(predicate, 3)));
  10342. }
  10343. /**
  10344. * Gets a random element from `collection`.
  10345. *
  10346. * @static
  10347. * @memberOf _
  10348. * @since 2.0.0
  10349. * @category Collection
  10350. * @param {Array|Object} collection The collection to sample.
  10351. * @returns {*} Returns the random element.
  10352. * @example
  10353. *
  10354. * _.sample([1, 2, 3, 4]);
  10355. * // => 2
  10356. */
  10357. function sample(collection) {
  10358. var func = isArray(collection) ? arraySample : baseSample;
  10359. return func(collection);
  10360. }
  10361. /**
  10362. * Gets `n` random elements at unique keys from `collection` up to the
  10363. * size of `collection`.
  10364. *
  10365. * @static
  10366. * @memberOf _
  10367. * @since 4.0.0
  10368. * @category Collection
  10369. * @param {Array|Object} collection The collection to sample.
  10370. * @param {number} [n=1] The number of elements to sample.
  10371. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10372. * @returns {Array} Returns the random elements.
  10373. * @example
  10374. *
  10375. * _.sampleSize([1, 2, 3], 2);
  10376. * // => [3, 1]
  10377. *
  10378. * _.sampleSize([1, 2, 3], 4);
  10379. * // => [2, 3, 1]
  10380. */
  10381. function sampleSize(collection, n, guard) {
  10382. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10383. n = 1;
  10384. } else {
  10385. n = toInteger(n);
  10386. }
  10387. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10388. return func(collection, n);
  10389. }
  10390. /**
  10391. * Creates an array of shuffled values, using a version of the
  10392. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10393. *
  10394. * @static
  10395. * @memberOf _
  10396. * @since 0.1.0
  10397. * @category Collection
  10398. * @param {Array|Object} collection The collection to shuffle.
  10399. * @returns {Array} Returns the new shuffled array.
  10400. * @example
  10401. *
  10402. * _.shuffle([1, 2, 3, 4]);
  10403. * // => [4, 1, 3, 2]
  10404. */
  10405. function shuffle(collection) {
  10406. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10407. return func(collection);
  10408. }
  10409. /**
  10410. * Gets the size of `collection` by returning its length for array-like
  10411. * values or the number of own enumerable string keyed properties for objects.
  10412. *
  10413. * @static
  10414. * @memberOf _
  10415. * @since 0.1.0
  10416. * @category Collection
  10417. * @param {Array|Object|string} collection The collection to inspect.
  10418. * @returns {number} Returns the collection size.
  10419. * @example
  10420. *
  10421. * _.size([1, 2, 3]);
  10422. * // => 3
  10423. *
  10424. * _.size({ 'a': 1, 'b': 2 });
  10425. * // => 2
  10426. *
  10427. * _.size('pebbles');
  10428. * // => 7
  10429. */
  10430. function size(collection) {
  10431. if (collection == null) {
  10432. return 0;
  10433. }
  10434. if (isArrayLike(collection)) {
  10435. return isString(collection) ? stringSize(collection) : collection.length;
  10436. }
  10437. var tag = getTag(collection);
  10438. if (tag == mapTag || tag == setTag) {
  10439. return collection.size;
  10440. }
  10441. return baseKeys(collection).length;
  10442. }
  10443. /**
  10444. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10445. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10446. * invoked with three arguments: (value, index|key, collection).
  10447. *
  10448. * @static
  10449. * @memberOf _
  10450. * @since 0.1.0
  10451. * @category Collection
  10452. * @param {Array|Object} collection The collection to iterate over.
  10453. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10454. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10455. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10456. * else `false`.
  10457. * @example
  10458. *
  10459. * _.some([null, 0, 'yes', false], Boolean);
  10460. * // => true
  10461. *
  10462. * var users = [
  10463. * { 'user': 'barney', 'active': true },
  10464. * { 'user': 'fred', 'active': false }
  10465. * ];
  10466. *
  10467. * // The `_.matches` iteratee shorthand.
  10468. * _.some(users, { 'user': 'barney', 'active': false });
  10469. * // => false
  10470. *
  10471. * // The `_.matchesProperty` iteratee shorthand.
  10472. * _.some(users, ['active', false]);
  10473. * // => true
  10474. *
  10475. * // The `_.property` iteratee shorthand.
  10476. * _.some(users, 'active');
  10477. * // => true
  10478. */
  10479. function some(collection, predicate, guard) {
  10480. var func = isArray(collection) ? arraySome : baseSome;
  10481. if (guard && isIterateeCall(collection, predicate, guard)) {
  10482. predicate = undefined;
  10483. }
  10484. return func(collection, getIteratee(predicate, 3));
  10485. }
  10486. /**
  10487. * Creates an array of elements, sorted in ascending order by the results of
  10488. * running each element in a collection thru each iteratee. This method
  10489. * performs a stable sort, that is, it preserves the original sort order of
  10490. * equal elements. The iteratees are invoked with one argument: (value).
  10491. *
  10492. * @static
  10493. * @memberOf _
  10494. * @since 0.1.0
  10495. * @category Collection
  10496. * @param {Array|Object} collection The collection to iterate over.
  10497. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10498. * The iteratees to sort by.
  10499. * @returns {Array} Returns the new sorted array.
  10500. * @example
  10501. *
  10502. * var users = [
  10503. * { 'user': 'fred', 'age': 48 },
  10504. * { 'user': 'barney', 'age': 36 },
  10505. * { 'user': 'fred', 'age': 30 },
  10506. * { 'user': 'barney', 'age': 34 }
  10507. * ];
  10508. *
  10509. * _.sortBy(users, [function(o) { return o.user; }]);
  10510. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10511. *
  10512. * _.sortBy(users, ['user', 'age']);
  10513. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10514. */
  10515. var sortBy = baseRest(function(collection, iteratees) {
  10516. if (collection == null) {
  10517. return [];
  10518. }
  10519. var length = iteratees.length;
  10520. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10521. iteratees = [];
  10522. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10523. iteratees = [iteratees[0]];
  10524. }
  10525. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10526. });
  10527. /*------------------------------------------------------------------------*/
  10528. /**
  10529. * Gets the timestamp of the number of milliseconds that have elapsed since
  10530. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10531. *
  10532. * @static
  10533. * @memberOf _
  10534. * @since 2.4.0
  10535. * @category Date
  10536. * @returns {number} Returns the timestamp.
  10537. * @example
  10538. *
  10539. * _.defer(function(stamp) {
  10540. * console.log(_.now() - stamp);
  10541. * }, _.now());
  10542. * // => Logs the number of milliseconds it took for the deferred invocation.
  10543. */
  10544. var now = ctxNow || function() {
  10545. return root.Date.now();
  10546. };
  10547. /*------------------------------------------------------------------------*/
  10548. /**
  10549. * The opposite of `_.before`; this method creates a function that invokes
  10550. * `func` once it's called `n` or more times.
  10551. *
  10552. * @static
  10553. * @memberOf _
  10554. * @since 0.1.0
  10555. * @category Function
  10556. * @param {number} n The number of calls before `func` is invoked.
  10557. * @param {Function} func The function to restrict.
  10558. * @returns {Function} Returns the new restricted function.
  10559. * @example
  10560. *
  10561. * var saves = ['profile', 'settings'];
  10562. *
  10563. * var done = _.after(saves.length, function() {
  10564. * console.log('done saving!');
  10565. * });
  10566. *
  10567. * _.forEach(saves, function(type) {
  10568. * asyncSave({ 'type': type, 'complete': done });
  10569. * });
  10570. * // => Logs 'done saving!' after the two async saves have completed.
  10571. */
  10572. function after(n, func) {
  10573. if (typeof func != 'function') {
  10574. throw new TypeError(FUNC_ERROR_TEXT);
  10575. }
  10576. n = toInteger(n);
  10577. return function() {
  10578. if (--n < 1) {
  10579. return func.apply(this, arguments);
  10580. }
  10581. };
  10582. }
  10583. /**
  10584. * Creates a function that invokes `func`, with up to `n` arguments,
  10585. * ignoring any additional arguments.
  10586. *
  10587. * @static
  10588. * @memberOf _
  10589. * @since 3.0.0
  10590. * @category Function
  10591. * @param {Function} func The function to cap arguments for.
  10592. * @param {number} [n=func.length] The arity cap.
  10593. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10594. * @returns {Function} Returns the new capped function.
  10595. * @example
  10596. *
  10597. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10598. * // => [6, 8, 10]
  10599. */
  10600. function ary(func, n, guard) {
  10601. n = guard ? undefined : n;
  10602. n = (func && n == null) ? func.length : n;
  10603. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10604. }
  10605. /**
  10606. * Creates a function that invokes `func`, with the `this` binding and arguments
  10607. * of the created function, while it's called less than `n` times. Subsequent
  10608. * calls to the created function return the result of the last `func` invocation.
  10609. *
  10610. * @static
  10611. * @memberOf _
  10612. * @since 3.0.0
  10613. * @category Function
  10614. * @param {number} n The number of calls at which `func` is no longer invoked.
  10615. * @param {Function} func The function to restrict.
  10616. * @returns {Function} Returns the new restricted function.
  10617. * @example
  10618. *
  10619. * jQuery(element).on('click', _.before(5, addContactToList));
  10620. * // => Allows adding up to 4 contacts to the list.
  10621. */
  10622. function before(n, func) {
  10623. var result;
  10624. if (typeof func != 'function') {
  10625. throw new TypeError(FUNC_ERROR_TEXT);
  10626. }
  10627. n = toInteger(n);
  10628. return function() {
  10629. if (--n > 0) {
  10630. result = func.apply(this, arguments);
  10631. }
  10632. if (n <= 1) {
  10633. func = undefined;
  10634. }
  10635. return result;
  10636. };
  10637. }
  10638. /**
  10639. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10640. * and `partials` prepended to the arguments it receives.
  10641. *
  10642. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10643. * may be used as a placeholder for partially applied arguments.
  10644. *
  10645. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10646. * property of bound functions.
  10647. *
  10648. * @static
  10649. * @memberOf _
  10650. * @since 0.1.0
  10651. * @category Function
  10652. * @param {Function} func The function to bind.
  10653. * @param {*} thisArg The `this` binding of `func`.
  10654. * @param {...*} [partials] The arguments to be partially applied.
  10655. * @returns {Function} Returns the new bound function.
  10656. * @example
  10657. *
  10658. * function greet(greeting, punctuation) {
  10659. * return greeting + ' ' + this.user + punctuation;
  10660. * }
  10661. *
  10662. * var object = { 'user': 'fred' };
  10663. *
  10664. * var bound = _.bind(greet, object, 'hi');
  10665. * bound('!');
  10666. * // => 'hi fred!'
  10667. *
  10668. * // Bound with placeholders.
  10669. * var bound = _.bind(greet, object, _, '!');
  10670. * bound('hi');
  10671. * // => 'hi fred!'
  10672. */
  10673. var bind = baseRest(function(func, thisArg, partials) {
  10674. var bitmask = WRAP_BIND_FLAG;
  10675. if (partials.length) {
  10676. var holders = replaceHolders(partials, getHolder(bind));
  10677. bitmask |= WRAP_PARTIAL_FLAG;
  10678. }
  10679. return createWrap(func, bitmask, thisArg, partials, holders);
  10680. });
  10681. /**
  10682. * Creates a function that invokes the method at `object[key]` with `partials`
  10683. * prepended to the arguments it receives.
  10684. *
  10685. * This method differs from `_.bind` by allowing bound functions to reference
  10686. * methods that may be redefined or don't yet exist. See
  10687. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10688. * for more details.
  10689. *
  10690. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10691. * builds, may be used as a placeholder for partially applied arguments.
  10692. *
  10693. * @static
  10694. * @memberOf _
  10695. * @since 0.10.0
  10696. * @category Function
  10697. * @param {Object} object The object to invoke the method on.
  10698. * @param {string} key The key of the method.
  10699. * @param {...*} [partials] The arguments to be partially applied.
  10700. * @returns {Function} Returns the new bound function.
  10701. * @example
  10702. *
  10703. * var object = {
  10704. * 'user': 'fred',
  10705. * 'greet': function(greeting, punctuation) {
  10706. * return greeting + ' ' + this.user + punctuation;
  10707. * }
  10708. * };
  10709. *
  10710. * var bound = _.bindKey(object, 'greet', 'hi');
  10711. * bound('!');
  10712. * // => 'hi fred!'
  10713. *
  10714. * object.greet = function(greeting, punctuation) {
  10715. * return greeting + 'ya ' + this.user + punctuation;
  10716. * };
  10717. *
  10718. * bound('!');
  10719. * // => 'hiya fred!'
  10720. *
  10721. * // Bound with placeholders.
  10722. * var bound = _.bindKey(object, 'greet', _, '!');
  10723. * bound('hi');
  10724. * // => 'hiya fred!'
  10725. */
  10726. var bindKey = baseRest(function(object, key, partials) {
  10727. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10728. if (partials.length) {
  10729. var holders = replaceHolders(partials, getHolder(bindKey));
  10730. bitmask |= WRAP_PARTIAL_FLAG;
  10731. }
  10732. return createWrap(key, bitmask, object, partials, holders);
  10733. });
  10734. /**
  10735. * Creates a function that accepts arguments of `func` and either invokes
  10736. * `func` returning its result, if at least `arity` number of arguments have
  10737. * been provided, or returns a function that accepts the remaining `func`
  10738. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10739. * is not sufficient.
  10740. *
  10741. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10742. * may be used as a placeholder for provided arguments.
  10743. *
  10744. * **Note:** This method doesn't set the "length" property of curried functions.
  10745. *
  10746. * @static
  10747. * @memberOf _
  10748. * @since 2.0.0
  10749. * @category Function
  10750. * @param {Function} func The function to curry.
  10751. * @param {number} [arity=func.length] The arity of `func`.
  10752. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10753. * @returns {Function} Returns the new curried function.
  10754. * @example
  10755. *
  10756. * var abc = function(a, b, c) {
  10757. * return [a, b, c];
  10758. * };
  10759. *
  10760. * var curried = _.curry(abc);
  10761. *
  10762. * curried(1)(2)(3);
  10763. * // => [1, 2, 3]
  10764. *
  10765. * curried(1, 2)(3);
  10766. * // => [1, 2, 3]
  10767. *
  10768. * curried(1, 2, 3);
  10769. * // => [1, 2, 3]
  10770. *
  10771. * // Curried with placeholders.
  10772. * curried(1)(_, 3)(2);
  10773. * // => [1, 2, 3]
  10774. */
  10775. function curry(func, arity, guard) {
  10776. arity = guard ? undefined : arity;
  10777. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10778. result.placeholder = curry.placeholder;
  10779. return result;
  10780. }
  10781. /**
  10782. * This method is like `_.curry` except that arguments are applied to `func`
  10783. * in the manner of `_.partialRight` instead of `_.partial`.
  10784. *
  10785. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10786. * builds, may be used as a placeholder for provided arguments.
  10787. *
  10788. * **Note:** This method doesn't set the "length" property of curried functions.
  10789. *
  10790. * @static
  10791. * @memberOf _
  10792. * @since 3.0.0
  10793. * @category Function
  10794. * @param {Function} func The function to curry.
  10795. * @param {number} [arity=func.length] The arity of `func`.
  10796. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10797. * @returns {Function} Returns the new curried function.
  10798. * @example
  10799. *
  10800. * var abc = function(a, b, c) {
  10801. * return [a, b, c];
  10802. * };
  10803. *
  10804. * var curried = _.curryRight(abc);
  10805. *
  10806. * curried(3)(2)(1);
  10807. * // => [1, 2, 3]
  10808. *
  10809. * curried(2, 3)(1);
  10810. * // => [1, 2, 3]
  10811. *
  10812. * curried(1, 2, 3);
  10813. * // => [1, 2, 3]
  10814. *
  10815. * // Curried with placeholders.
  10816. * curried(3)(1, _)(2);
  10817. * // => [1, 2, 3]
  10818. */
  10819. function curryRight(func, arity, guard) {
  10820. arity = guard ? undefined : arity;
  10821. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10822. result.placeholder = curryRight.placeholder;
  10823. return result;
  10824. }
  10825. /**
  10826. * Creates a debounced function that delays invoking `func` until after `wait`
  10827. * milliseconds have elapsed since the last time the debounced function was
  10828. * invoked. The debounced function comes with a `cancel` method to cancel
  10829. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10830. * Provide `options` to indicate whether `func` should be invoked on the
  10831. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10832. * with the last arguments provided to the debounced function. Subsequent
  10833. * calls to the debounced function return the result of the last `func`
  10834. * invocation.
  10835. *
  10836. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10837. * invoked on the trailing edge of the timeout only if the debounced function
  10838. * is invoked more than once during the `wait` timeout.
  10839. *
  10840. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10841. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10842. *
  10843. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10844. * for details over the differences between `_.debounce` and `_.throttle`.
  10845. *
  10846. * @static
  10847. * @memberOf _
  10848. * @since 0.1.0
  10849. * @category Function
  10850. * @param {Function} func The function to debounce.
  10851. * @param {number} [wait=0] The number of milliseconds to delay.
  10852. * @param {Object} [options={}] The options object.
  10853. * @param {boolean} [options.leading=false]
  10854. * Specify invoking on the leading edge of the timeout.
  10855. * @param {number} [options.maxWait]
  10856. * The maximum time `func` is allowed to be delayed before it's invoked.
  10857. * @param {boolean} [options.trailing=true]
  10858. * Specify invoking on the trailing edge of the timeout.
  10859. * @returns {Function} Returns the new debounced function.
  10860. * @example
  10861. *
  10862. * // Avoid costly calculations while the window size is in flux.
  10863. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10864. *
  10865. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10866. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10867. * 'leading': true,
  10868. * 'trailing': false
  10869. * }));
  10870. *
  10871. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10872. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10873. * var source = new EventSource('/stream');
  10874. * jQuery(source).on('message', debounced);
  10875. *
  10876. * // Cancel the trailing debounced invocation.
  10877. * jQuery(window).on('popstate', debounced.cancel);
  10878. */
  10879. function debounce(func, wait, options) {
  10880. var lastArgs,
  10881. lastThis,
  10882. maxWait,
  10883. result,
  10884. timerId,
  10885. lastCallTime,
  10886. lastInvokeTime = 0,
  10887. leading = false,
  10888. maxing = false,
  10889. trailing = true;
  10890. if (typeof func != 'function') {
  10891. throw new TypeError(FUNC_ERROR_TEXT);
  10892. }
  10893. wait = toNumber(wait) || 0;
  10894. if (isObject(options)) {
  10895. leading = !!options.leading;
  10896. maxing = 'maxWait' in options;
  10897. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10898. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10899. }
  10900. function invokeFunc(time) {
  10901. var args = lastArgs,
  10902. thisArg = lastThis;
  10903. lastArgs = lastThis = undefined;
  10904. lastInvokeTime = time;
  10905. result = func.apply(thisArg, args);
  10906. return result;
  10907. }
  10908. function leadingEdge(time) {
  10909. // Reset any `maxWait` timer.
  10910. lastInvokeTime = time;
  10911. // Start the timer for the trailing edge.
  10912. timerId = setTimeout(timerExpired, wait);
  10913. // Invoke the leading edge.
  10914. return leading ? invokeFunc(time) : result;
  10915. }
  10916. function remainingWait(time) {
  10917. var timeSinceLastCall = time - lastCallTime,
  10918. timeSinceLastInvoke = time - lastInvokeTime,
  10919. timeWaiting = wait - timeSinceLastCall;
  10920. return maxing
  10921. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10922. : timeWaiting;
  10923. }
  10924. function shouldInvoke(time) {
  10925. var timeSinceLastCall = time - lastCallTime,
  10926. timeSinceLastInvoke = time - lastInvokeTime;
  10927. // Either this is the first call, activity has stopped and we're at the
  10928. // trailing edge, the system time has gone backwards and we're treating
  10929. // it as the trailing edge, or we've hit the `maxWait` limit.
  10930. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10931. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10932. }
  10933. function timerExpired() {
  10934. var time = now();
  10935. if (shouldInvoke(time)) {
  10936. return trailingEdge(time);
  10937. }
  10938. // Restart the timer.
  10939. timerId = setTimeout(timerExpired, remainingWait(time));
  10940. }
  10941. function trailingEdge(time) {
  10942. timerId = undefined;
  10943. // Only invoke if we have `lastArgs` which means `func` has been
  10944. // debounced at least once.
  10945. if (trailing && lastArgs) {
  10946. return invokeFunc(time);
  10947. }
  10948. lastArgs = lastThis = undefined;
  10949. return result;
  10950. }
  10951. function cancel() {
  10952. if (timerId !== undefined) {
  10953. clearTimeout(timerId);
  10954. }
  10955. lastInvokeTime = 0;
  10956. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10957. }
  10958. function flush() {
  10959. return timerId === undefined ? result : trailingEdge(now());
  10960. }
  10961. function debounced() {
  10962. var time = now(),
  10963. isInvoking = shouldInvoke(time);
  10964. lastArgs = arguments;
  10965. lastThis = this;
  10966. lastCallTime = time;
  10967. if (isInvoking) {
  10968. if (timerId === undefined) {
  10969. return leadingEdge(lastCallTime);
  10970. }
  10971. if (maxing) {
  10972. // Handle invocations in a tight loop.
  10973. clearTimeout(timerId);
  10974. timerId = setTimeout(timerExpired, wait);
  10975. return invokeFunc(lastCallTime);
  10976. }
  10977. }
  10978. if (timerId === undefined) {
  10979. timerId = setTimeout(timerExpired, wait);
  10980. }
  10981. return result;
  10982. }
  10983. debounced.cancel = cancel;
  10984. debounced.flush = flush;
  10985. return debounced;
  10986. }
  10987. /**
  10988. * Defers invoking the `func` until the current call stack has cleared. Any
  10989. * additional arguments are provided to `func` when it's invoked.
  10990. *
  10991. * @static
  10992. * @memberOf _
  10993. * @since 0.1.0
  10994. * @category Function
  10995. * @param {Function} func The function to defer.
  10996. * @param {...*} [args] The arguments to invoke `func` with.
  10997. * @returns {number} Returns the timer id.
  10998. * @example
  10999. *
  11000. * _.defer(function(text) {
  11001. * console.log(text);
  11002. * }, 'deferred');
  11003. * // => Logs 'deferred' after one millisecond.
  11004. */
  11005. var defer = baseRest(function(func, args) {
  11006. return baseDelay(func, 1, args);
  11007. });
  11008. /**
  11009. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11010. * provided to `func` when it's invoked.
  11011. *
  11012. * @static
  11013. * @memberOf _
  11014. * @since 0.1.0
  11015. * @category Function
  11016. * @param {Function} func The function to delay.
  11017. * @param {number} wait The number of milliseconds to delay invocation.
  11018. * @param {...*} [args] The arguments to invoke `func` with.
  11019. * @returns {number} Returns the timer id.
  11020. * @example
  11021. *
  11022. * _.delay(function(text) {
  11023. * console.log(text);
  11024. * }, 1000, 'later');
  11025. * // => Logs 'later' after one second.
  11026. */
  11027. var delay = baseRest(function(func, wait, args) {
  11028. return baseDelay(func, toNumber(wait) || 0, args);
  11029. });
  11030. /**
  11031. * Creates a function that invokes `func` with arguments reversed.
  11032. *
  11033. * @static
  11034. * @memberOf _
  11035. * @since 4.0.0
  11036. * @category Function
  11037. * @param {Function} func The function to flip arguments for.
  11038. * @returns {Function} Returns the new flipped function.
  11039. * @example
  11040. *
  11041. * var flipped = _.flip(function() {
  11042. * return _.toArray(arguments);
  11043. * });
  11044. *
  11045. * flipped('a', 'b', 'c', 'd');
  11046. * // => ['d', 'c', 'b', 'a']
  11047. */
  11048. function flip(func) {
  11049. return createWrap(func, WRAP_FLIP_FLAG);
  11050. }
  11051. /**
  11052. * Creates a function that memoizes the result of `func`. If `resolver` is
  11053. * provided, it determines the cache key for storing the result based on the
  11054. * arguments provided to the memoized function. By default, the first argument
  11055. * provided to the memoized function is used as the map cache key. The `func`
  11056. * is invoked with the `this` binding of the memoized function.
  11057. *
  11058. * **Note:** The cache is exposed as the `cache` property on the memoized
  11059. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11060. * constructor with one whose instances implement the
  11061. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11062. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11063. *
  11064. * @static
  11065. * @memberOf _
  11066. * @since 0.1.0
  11067. * @category Function
  11068. * @param {Function} func The function to have its output memoized.
  11069. * @param {Function} [resolver] The function to resolve the cache key.
  11070. * @returns {Function} Returns the new memoized function.
  11071. * @example
  11072. *
  11073. * var object = { 'a': 1, 'b': 2 };
  11074. * var other = { 'c': 3, 'd': 4 };
  11075. *
  11076. * var values = _.memoize(_.values);
  11077. * values(object);
  11078. * // => [1, 2]
  11079. *
  11080. * values(other);
  11081. * // => [3, 4]
  11082. *
  11083. * object.a = 2;
  11084. * values(object);
  11085. * // => [1, 2]
  11086. *
  11087. * // Modify the result cache.
  11088. * values.cache.set(object, ['a', 'b']);
  11089. * values(object);
  11090. * // => ['a', 'b']
  11091. *
  11092. * // Replace `_.memoize.Cache`.
  11093. * _.memoize.Cache = WeakMap;
  11094. */
  11095. function memoize(func, resolver) {
  11096. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11097. throw new TypeError(FUNC_ERROR_TEXT);
  11098. }
  11099. var memoized = function() {
  11100. var args = arguments,
  11101. key = resolver ? resolver.apply(this, args) : args[0],
  11102. cache = memoized.cache;
  11103. if (cache.has(key)) {
  11104. return cache.get(key);
  11105. }
  11106. var result = func.apply(this, args);
  11107. memoized.cache = cache.set(key, result) || cache;
  11108. return result;
  11109. };
  11110. memoized.cache = new (memoize.Cache || MapCache);
  11111. return memoized;
  11112. }
  11113. // Expose `MapCache`.
  11114. memoize.Cache = MapCache;
  11115. /**
  11116. * Creates a function that negates the result of the predicate `func`. The
  11117. * `func` predicate is invoked with the `this` binding and arguments of the
  11118. * created function.
  11119. *
  11120. * @static
  11121. * @memberOf _
  11122. * @since 3.0.0
  11123. * @category Function
  11124. * @param {Function} predicate The predicate to negate.
  11125. * @returns {Function} Returns the new negated function.
  11126. * @example
  11127. *
  11128. * function isEven(n) {
  11129. * return n % 2 == 0;
  11130. * }
  11131. *
  11132. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11133. * // => [1, 3, 5]
  11134. */
  11135. function negate(predicate) {
  11136. if (typeof predicate != 'function') {
  11137. throw new TypeError(FUNC_ERROR_TEXT);
  11138. }
  11139. return function() {
  11140. var args = arguments;
  11141. switch (args.length) {
  11142. case 0: return !predicate.call(this);
  11143. case 1: return !predicate.call(this, args[0]);
  11144. case 2: return !predicate.call(this, args[0], args[1]);
  11145. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11146. }
  11147. return !predicate.apply(this, args);
  11148. };
  11149. }
  11150. /**
  11151. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11152. * to the function return the value of the first invocation. The `func` is
  11153. * invoked with the `this` binding and arguments of the created function.
  11154. *
  11155. * @static
  11156. * @memberOf _
  11157. * @since 0.1.0
  11158. * @category Function
  11159. * @param {Function} func The function to restrict.
  11160. * @returns {Function} Returns the new restricted function.
  11161. * @example
  11162. *
  11163. * var initialize = _.once(createApplication);
  11164. * initialize();
  11165. * initialize();
  11166. * // => `createApplication` is invoked once
  11167. */
  11168. function once(func) {
  11169. return before(2, func);
  11170. }
  11171. /**
  11172. * Creates a function that invokes `func` with its arguments transformed.
  11173. *
  11174. * @static
  11175. * @since 4.0.0
  11176. * @memberOf _
  11177. * @category Function
  11178. * @param {Function} func The function to wrap.
  11179. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11180. * The argument transforms.
  11181. * @returns {Function} Returns the new function.
  11182. * @example
  11183. *
  11184. * function doubled(n) {
  11185. * return n * 2;
  11186. * }
  11187. *
  11188. * function square(n) {
  11189. * return n * n;
  11190. * }
  11191. *
  11192. * var func = _.overArgs(function(x, y) {
  11193. * return [x, y];
  11194. * }, [square, doubled]);
  11195. *
  11196. * func(9, 3);
  11197. * // => [81, 6]
  11198. *
  11199. * func(10, 5);
  11200. * // => [100, 10]
  11201. */
  11202. var overArgs = castRest(function(func, transforms) {
  11203. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11204. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11205. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11206. var funcsLength = transforms.length;
  11207. return baseRest(function(args) {
  11208. var index = -1,
  11209. length = nativeMin(args.length, funcsLength);
  11210. while (++index < length) {
  11211. args[index] = transforms[index].call(this, args[index]);
  11212. }
  11213. return apply(func, this, args);
  11214. });
  11215. });
  11216. /**
  11217. * Creates a function that invokes `func` with `partials` prepended to the
  11218. * arguments it receives. This method is like `_.bind` except it does **not**
  11219. * alter the `this` binding.
  11220. *
  11221. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11222. * builds, may be used as a placeholder for partially applied arguments.
  11223. *
  11224. * **Note:** This method doesn't set the "length" property of partially
  11225. * applied functions.
  11226. *
  11227. * @static
  11228. * @memberOf _
  11229. * @since 0.2.0
  11230. * @category Function
  11231. * @param {Function} func The function to partially apply arguments to.
  11232. * @param {...*} [partials] The arguments to be partially applied.
  11233. * @returns {Function} Returns the new partially applied function.
  11234. * @example
  11235. *
  11236. * function greet(greeting, name) {
  11237. * return greeting + ' ' + name;
  11238. * }
  11239. *
  11240. * var sayHelloTo = _.partial(greet, 'hello');
  11241. * sayHelloTo('fred');
  11242. * // => 'hello fred'
  11243. *
  11244. * // Partially applied with placeholders.
  11245. * var greetFred = _.partial(greet, _, 'fred');
  11246. * greetFred('hi');
  11247. * // => 'hi fred'
  11248. */
  11249. var partial = baseRest(function(func, partials) {
  11250. var holders = replaceHolders(partials, getHolder(partial));
  11251. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11252. });
  11253. /**
  11254. * This method is like `_.partial` except that partially applied arguments
  11255. * are appended to the arguments it receives.
  11256. *
  11257. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11258. * builds, may be used as a placeholder for partially applied arguments.
  11259. *
  11260. * **Note:** This method doesn't set the "length" property of partially
  11261. * applied functions.
  11262. *
  11263. * @static
  11264. * @memberOf _
  11265. * @since 1.0.0
  11266. * @category Function
  11267. * @param {Function} func The function to partially apply arguments to.
  11268. * @param {...*} [partials] The arguments to be partially applied.
  11269. * @returns {Function} Returns the new partially applied function.
  11270. * @example
  11271. *
  11272. * function greet(greeting, name) {
  11273. * return greeting + ' ' + name;
  11274. * }
  11275. *
  11276. * var greetFred = _.partialRight(greet, 'fred');
  11277. * greetFred('hi');
  11278. * // => 'hi fred'
  11279. *
  11280. * // Partially applied with placeholders.
  11281. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11282. * sayHelloTo('fred');
  11283. * // => 'hello fred'
  11284. */
  11285. var partialRight = baseRest(function(func, partials) {
  11286. var holders = replaceHolders(partials, getHolder(partialRight));
  11287. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11288. });
  11289. /**
  11290. * Creates a function that invokes `func` with arguments arranged according
  11291. * to the specified `indexes` where the argument value at the first index is
  11292. * provided as the first argument, the argument value at the second index is
  11293. * provided as the second argument, and so on.
  11294. *
  11295. * @static
  11296. * @memberOf _
  11297. * @since 3.0.0
  11298. * @category Function
  11299. * @param {Function} func The function to rearrange arguments for.
  11300. * @param {...(number|number[])} indexes The arranged argument indexes.
  11301. * @returns {Function} Returns the new function.
  11302. * @example
  11303. *
  11304. * var rearged = _.rearg(function(a, b, c) {
  11305. * return [a, b, c];
  11306. * }, [2, 0, 1]);
  11307. *
  11308. * rearged('b', 'c', 'a')
  11309. * // => ['a', 'b', 'c']
  11310. */
  11311. var rearg = flatRest(function(func, indexes) {
  11312. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11313. });
  11314. /**
  11315. * Creates a function that invokes `func` with the `this` binding of the
  11316. * created function and arguments from `start` and beyond provided as
  11317. * an array.
  11318. *
  11319. * **Note:** This method is based on the
  11320. * [rest parameter](https://mdn.io/rest_parameters).
  11321. *
  11322. * @static
  11323. * @memberOf _
  11324. * @since 4.0.0
  11325. * @category Function
  11326. * @param {Function} func The function to apply a rest parameter to.
  11327. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11328. * @returns {Function} Returns the new function.
  11329. * @example
  11330. *
  11331. * var say = _.rest(function(what, names) {
  11332. * return what + ' ' + _.initial(names).join(', ') +
  11333. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11334. * });
  11335. *
  11336. * say('hello', 'fred', 'barney', 'pebbles');
  11337. * // => 'hello fred, barney, & pebbles'
  11338. */
  11339. function rest(func, start) {
  11340. if (typeof func != 'function') {
  11341. throw new TypeError(FUNC_ERROR_TEXT);
  11342. }
  11343. start = start === undefined ? start : toInteger(start);
  11344. return baseRest(func, start);
  11345. }
  11346. /**
  11347. * Creates a function that invokes `func` with the `this` binding of the
  11348. * create function and an array of arguments much like
  11349. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11350. *
  11351. * **Note:** This method is based on the
  11352. * [spread operator](https://mdn.io/spread_operator).
  11353. *
  11354. * @static
  11355. * @memberOf _
  11356. * @since 3.2.0
  11357. * @category Function
  11358. * @param {Function} func The function to spread arguments over.
  11359. * @param {number} [start=0] The start position of the spread.
  11360. * @returns {Function} Returns the new function.
  11361. * @example
  11362. *
  11363. * var say = _.spread(function(who, what) {
  11364. * return who + ' says ' + what;
  11365. * });
  11366. *
  11367. * say(['fred', 'hello']);
  11368. * // => 'fred says hello'
  11369. *
  11370. * var numbers = Promise.all([
  11371. * Promise.resolve(40),
  11372. * Promise.resolve(36)
  11373. * ]);
  11374. *
  11375. * numbers.then(_.spread(function(x, y) {
  11376. * return x + y;
  11377. * }));
  11378. * // => a Promise of 76
  11379. */
  11380. function spread(func, start) {
  11381. if (typeof func != 'function') {
  11382. throw new TypeError(FUNC_ERROR_TEXT);
  11383. }
  11384. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11385. return baseRest(function(args) {
  11386. var array = args[start],
  11387. otherArgs = castSlice(args, 0, start);
  11388. if (array) {
  11389. arrayPush(otherArgs, array);
  11390. }
  11391. return apply(func, this, otherArgs);
  11392. });
  11393. }
  11394. /**
  11395. * Creates a throttled function that only invokes `func` at most once per
  11396. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11397. * method to cancel delayed `func` invocations and a `flush` method to
  11398. * immediately invoke them. Provide `options` to indicate whether `func`
  11399. * should be invoked on the leading and/or trailing edge of the `wait`
  11400. * timeout. The `func` is invoked with the last arguments provided to the
  11401. * throttled function. Subsequent calls to the throttled function return the
  11402. * result of the last `func` invocation.
  11403. *
  11404. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11405. * invoked on the trailing edge of the timeout only if the throttled function
  11406. * is invoked more than once during the `wait` timeout.
  11407. *
  11408. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11409. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11410. *
  11411. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11412. * for details over the differences between `_.throttle` and `_.debounce`.
  11413. *
  11414. * @static
  11415. * @memberOf _
  11416. * @since 0.1.0
  11417. * @category Function
  11418. * @param {Function} func The function to throttle.
  11419. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11420. * @param {Object} [options={}] The options object.
  11421. * @param {boolean} [options.leading=true]
  11422. * Specify invoking on the leading edge of the timeout.
  11423. * @param {boolean} [options.trailing=true]
  11424. * Specify invoking on the trailing edge of the timeout.
  11425. * @returns {Function} Returns the new throttled function.
  11426. * @example
  11427. *
  11428. * // Avoid excessively updating the position while scrolling.
  11429. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11430. *
  11431. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11432. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11433. * jQuery(element).on('click', throttled);
  11434. *
  11435. * // Cancel the trailing throttled invocation.
  11436. * jQuery(window).on('popstate', throttled.cancel);
  11437. */
  11438. function throttle(func, wait, options) {
  11439. var leading = true,
  11440. trailing = true;
  11441. if (typeof func != 'function') {
  11442. throw new TypeError(FUNC_ERROR_TEXT);
  11443. }
  11444. if (isObject(options)) {
  11445. leading = 'leading' in options ? !!options.leading : leading;
  11446. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11447. }
  11448. return debounce(func, wait, {
  11449. 'leading': leading,
  11450. 'maxWait': wait,
  11451. 'trailing': trailing
  11452. });
  11453. }
  11454. /**
  11455. * Creates a function that accepts up to one argument, ignoring any
  11456. * additional arguments.
  11457. *
  11458. * @static
  11459. * @memberOf _
  11460. * @since 4.0.0
  11461. * @category Function
  11462. * @param {Function} func The function to cap arguments for.
  11463. * @returns {Function} Returns the new capped function.
  11464. * @example
  11465. *
  11466. * _.map(['6', '8', '10'], _.unary(parseInt));
  11467. * // => [6, 8, 10]
  11468. */
  11469. function unary(func) {
  11470. return ary(func, 1);
  11471. }
  11472. /**
  11473. * Creates a function that provides `value` to `wrapper` as its first
  11474. * argument. Any additional arguments provided to the function are appended
  11475. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11476. * binding of the created function.
  11477. *
  11478. * @static
  11479. * @memberOf _
  11480. * @since 0.1.0
  11481. * @category Function
  11482. * @param {*} value The value to wrap.
  11483. * @param {Function} [wrapper=identity] The wrapper function.
  11484. * @returns {Function} Returns the new function.
  11485. * @example
  11486. *
  11487. * var p = _.wrap(_.escape, function(func, text) {
  11488. * return '<p>' + func(text) + '</p>';
  11489. * });
  11490. *
  11491. * p('fred, barney, & pebbles');
  11492. * // => '<p>fred, barney, &amp; pebbles</p>'
  11493. */
  11494. function wrap(value, wrapper) {
  11495. return partial(castFunction(wrapper), value);
  11496. }
  11497. /*------------------------------------------------------------------------*/
  11498. /**
  11499. * Casts `value` as an array if it's not one.
  11500. *
  11501. * @static
  11502. * @memberOf _
  11503. * @since 4.4.0
  11504. * @category Lang
  11505. * @param {*} value The value to inspect.
  11506. * @returns {Array} Returns the cast array.
  11507. * @example
  11508. *
  11509. * _.castArray(1);
  11510. * // => [1]
  11511. *
  11512. * _.castArray({ 'a': 1 });
  11513. * // => [{ 'a': 1 }]
  11514. *
  11515. * _.castArray('abc');
  11516. * // => ['abc']
  11517. *
  11518. * _.castArray(null);
  11519. * // => [null]
  11520. *
  11521. * _.castArray(undefined);
  11522. * // => [undefined]
  11523. *
  11524. * _.castArray();
  11525. * // => []
  11526. *
  11527. * var array = [1, 2, 3];
  11528. * console.log(_.castArray(array) === array);
  11529. * // => true
  11530. */
  11531. function castArray() {
  11532. if (!arguments.length) {
  11533. return [];
  11534. }
  11535. var value = arguments[0];
  11536. return isArray(value) ? value : [value];
  11537. }
  11538. /**
  11539. * Creates a shallow clone of `value`.
  11540. *
  11541. * **Note:** This method is loosely based on the
  11542. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11543. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11544. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11545. * arrays. The own enumerable properties of `arguments` objects are cloned
  11546. * as plain objects. An empty object is returned for uncloneable values such
  11547. * as error objects, functions, DOM nodes, and WeakMaps.
  11548. *
  11549. * @static
  11550. * @memberOf _
  11551. * @since 0.1.0
  11552. * @category Lang
  11553. * @param {*} value The value to clone.
  11554. * @returns {*} Returns the cloned value.
  11555. * @see _.cloneDeep
  11556. * @example
  11557. *
  11558. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11559. *
  11560. * var shallow = _.clone(objects);
  11561. * console.log(shallow[0] === objects[0]);
  11562. * // => true
  11563. */
  11564. function clone(value) {
  11565. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11566. }
  11567. /**
  11568. * This method is like `_.clone` except that it accepts `customizer` which
  11569. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11570. * cloning is handled by the method instead. The `customizer` is invoked with
  11571. * up to four arguments; (value [, index|key, object, stack]).
  11572. *
  11573. * @static
  11574. * @memberOf _
  11575. * @since 4.0.0
  11576. * @category Lang
  11577. * @param {*} value The value to clone.
  11578. * @param {Function} [customizer] The function to customize cloning.
  11579. * @returns {*} Returns the cloned value.
  11580. * @see _.cloneDeepWith
  11581. * @example
  11582. *
  11583. * function customizer(value) {
  11584. * if (_.isElement(value)) {
  11585. * return value.cloneNode(false);
  11586. * }
  11587. * }
  11588. *
  11589. * var el = _.cloneWith(document.body, customizer);
  11590. *
  11591. * console.log(el === document.body);
  11592. * // => false
  11593. * console.log(el.nodeName);
  11594. * // => 'BODY'
  11595. * console.log(el.childNodes.length);
  11596. * // => 0
  11597. */
  11598. function cloneWith(value, customizer) {
  11599. customizer = typeof customizer == 'function' ? customizer : undefined;
  11600. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11601. }
  11602. /**
  11603. * This method is like `_.clone` except that it recursively clones `value`.
  11604. *
  11605. * @static
  11606. * @memberOf _
  11607. * @since 1.0.0
  11608. * @category Lang
  11609. * @param {*} value The value to recursively clone.
  11610. * @returns {*} Returns the deep cloned value.
  11611. * @see _.clone
  11612. * @example
  11613. *
  11614. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11615. *
  11616. * var deep = _.cloneDeep(objects);
  11617. * console.log(deep[0] === objects[0]);
  11618. * // => false
  11619. */
  11620. function cloneDeep(value) {
  11621. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11622. }
  11623. /**
  11624. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11625. *
  11626. * @static
  11627. * @memberOf _
  11628. * @since 4.0.0
  11629. * @category Lang
  11630. * @param {*} value The value to recursively clone.
  11631. * @param {Function} [customizer] The function to customize cloning.
  11632. * @returns {*} Returns the deep cloned value.
  11633. * @see _.cloneWith
  11634. * @example
  11635. *
  11636. * function customizer(value) {
  11637. * if (_.isElement(value)) {
  11638. * return value.cloneNode(true);
  11639. * }
  11640. * }
  11641. *
  11642. * var el = _.cloneDeepWith(document.body, customizer);
  11643. *
  11644. * console.log(el === document.body);
  11645. * // => false
  11646. * console.log(el.nodeName);
  11647. * // => 'BODY'
  11648. * console.log(el.childNodes.length);
  11649. * // => 20
  11650. */
  11651. function cloneDeepWith(value, customizer) {
  11652. customizer = typeof customizer == 'function' ? customizer : undefined;
  11653. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11654. }
  11655. /**
  11656. * Checks if `object` conforms to `source` by invoking the predicate
  11657. * properties of `source` with the corresponding property values of `object`.
  11658. *
  11659. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11660. * partially applied.
  11661. *
  11662. * @static
  11663. * @memberOf _
  11664. * @since 4.14.0
  11665. * @category Lang
  11666. * @param {Object} object The object to inspect.
  11667. * @param {Object} source The object of property predicates to conform to.
  11668. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11669. * @example
  11670. *
  11671. * var object = { 'a': 1, 'b': 2 };
  11672. *
  11673. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11674. * // => true
  11675. *
  11676. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11677. * // => false
  11678. */
  11679. function conformsTo(object, source) {
  11680. return source == null || baseConformsTo(object, source, keys(source));
  11681. }
  11682. /**
  11683. * Performs a
  11684. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11685. * comparison between two values to determine if they are equivalent.
  11686. *
  11687. * @static
  11688. * @memberOf _
  11689. * @since 4.0.0
  11690. * @category Lang
  11691. * @param {*} value The value to compare.
  11692. * @param {*} other The other value to compare.
  11693. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11694. * @example
  11695. *
  11696. * var object = { 'a': 1 };
  11697. * var other = { 'a': 1 };
  11698. *
  11699. * _.eq(object, object);
  11700. * // => true
  11701. *
  11702. * _.eq(object, other);
  11703. * // => false
  11704. *
  11705. * _.eq('a', 'a');
  11706. * // => true
  11707. *
  11708. * _.eq('a', Object('a'));
  11709. * // => false
  11710. *
  11711. * _.eq(NaN, NaN);
  11712. * // => true
  11713. */
  11714. function eq(value, other) {
  11715. return value === other || (value !== value && other !== other);
  11716. }
  11717. /**
  11718. * Checks if `value` is greater than `other`.
  11719. *
  11720. * @static
  11721. * @memberOf _
  11722. * @since 3.9.0
  11723. * @category Lang
  11724. * @param {*} value The value to compare.
  11725. * @param {*} other The other value to compare.
  11726. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11727. * else `false`.
  11728. * @see _.lt
  11729. * @example
  11730. *
  11731. * _.gt(3, 1);
  11732. * // => true
  11733. *
  11734. * _.gt(3, 3);
  11735. * // => false
  11736. *
  11737. * _.gt(1, 3);
  11738. * // => false
  11739. */
  11740. var gt = createRelationalOperation(baseGt);
  11741. /**
  11742. * Checks if `value` is greater than or equal to `other`.
  11743. *
  11744. * @static
  11745. * @memberOf _
  11746. * @since 3.9.0
  11747. * @category Lang
  11748. * @param {*} value The value to compare.
  11749. * @param {*} other The other value to compare.
  11750. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11751. * `other`, else `false`.
  11752. * @see _.lte
  11753. * @example
  11754. *
  11755. * _.gte(3, 1);
  11756. * // => true
  11757. *
  11758. * _.gte(3, 3);
  11759. * // => true
  11760. *
  11761. * _.gte(1, 3);
  11762. * // => false
  11763. */
  11764. var gte = createRelationalOperation(function(value, other) {
  11765. return value >= other;
  11766. });
  11767. /**
  11768. * Checks if `value` is likely an `arguments` object.
  11769. *
  11770. * @static
  11771. * @memberOf _
  11772. * @since 0.1.0
  11773. * @category Lang
  11774. * @param {*} value The value to check.
  11775. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11776. * else `false`.
  11777. * @example
  11778. *
  11779. * _.isArguments(function() { return arguments; }());
  11780. * // => true
  11781. *
  11782. * _.isArguments([1, 2, 3]);
  11783. * // => false
  11784. */
  11785. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11786. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11787. !propertyIsEnumerable.call(value, 'callee');
  11788. };
  11789. /**
  11790. * Checks if `value` is classified as an `Array` object.
  11791. *
  11792. * @static
  11793. * @memberOf _
  11794. * @since 0.1.0
  11795. * @category Lang
  11796. * @param {*} value The value to check.
  11797. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11798. * @example
  11799. *
  11800. * _.isArray([1, 2, 3]);
  11801. * // => true
  11802. *
  11803. * _.isArray(document.body.children);
  11804. * // => false
  11805. *
  11806. * _.isArray('abc');
  11807. * // => false
  11808. *
  11809. * _.isArray(_.noop);
  11810. * // => false
  11811. */
  11812. var isArray = Array.isArray;
  11813. /**
  11814. * Checks if `value` is classified as an `ArrayBuffer` object.
  11815. *
  11816. * @static
  11817. * @memberOf _
  11818. * @since 4.3.0
  11819. * @category Lang
  11820. * @param {*} value The value to check.
  11821. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11822. * @example
  11823. *
  11824. * _.isArrayBuffer(new ArrayBuffer(2));
  11825. * // => true
  11826. *
  11827. * _.isArrayBuffer(new Array(2));
  11828. * // => false
  11829. */
  11830. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11831. /**
  11832. * Checks if `value` is array-like. A value is considered array-like if it's
  11833. * not a function and has a `value.length` that's an integer greater than or
  11834. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11835. *
  11836. * @static
  11837. * @memberOf _
  11838. * @since 4.0.0
  11839. * @category Lang
  11840. * @param {*} value The value to check.
  11841. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11842. * @example
  11843. *
  11844. * _.isArrayLike([1, 2, 3]);
  11845. * // => true
  11846. *
  11847. * _.isArrayLike(document.body.children);
  11848. * // => true
  11849. *
  11850. * _.isArrayLike('abc');
  11851. * // => true
  11852. *
  11853. * _.isArrayLike(_.noop);
  11854. * // => false
  11855. */
  11856. function isArrayLike(value) {
  11857. return value != null && isLength(value.length) && !isFunction(value);
  11858. }
  11859. /**
  11860. * This method is like `_.isArrayLike` except that it also checks if `value`
  11861. * is an object.
  11862. *
  11863. * @static
  11864. * @memberOf _
  11865. * @since 4.0.0
  11866. * @category Lang
  11867. * @param {*} value The value to check.
  11868. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11869. * else `false`.
  11870. * @example
  11871. *
  11872. * _.isArrayLikeObject([1, 2, 3]);
  11873. * // => true
  11874. *
  11875. * _.isArrayLikeObject(document.body.children);
  11876. * // => true
  11877. *
  11878. * _.isArrayLikeObject('abc');
  11879. * // => false
  11880. *
  11881. * _.isArrayLikeObject(_.noop);
  11882. * // => false
  11883. */
  11884. function isArrayLikeObject(value) {
  11885. return isObjectLike(value) && isArrayLike(value);
  11886. }
  11887. /**
  11888. * Checks if `value` is classified as a boolean primitive or object.
  11889. *
  11890. * @static
  11891. * @memberOf _
  11892. * @since 0.1.0
  11893. * @category Lang
  11894. * @param {*} value The value to check.
  11895. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11896. * @example
  11897. *
  11898. * _.isBoolean(false);
  11899. * // => true
  11900. *
  11901. * _.isBoolean(null);
  11902. * // => false
  11903. */
  11904. function isBoolean(value) {
  11905. return value === true || value === false ||
  11906. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11907. }
  11908. /**
  11909. * Checks if `value` is a buffer.
  11910. *
  11911. * @static
  11912. * @memberOf _
  11913. * @since 4.3.0
  11914. * @category Lang
  11915. * @param {*} value The value to check.
  11916. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11917. * @example
  11918. *
  11919. * _.isBuffer(new Buffer(2));
  11920. * // => true
  11921. *
  11922. * _.isBuffer(new Uint8Array(2));
  11923. * // => false
  11924. */
  11925. var isBuffer = nativeIsBuffer || stubFalse;
  11926. /**
  11927. * Checks if `value` is classified as a `Date` object.
  11928. *
  11929. * @static
  11930. * @memberOf _
  11931. * @since 0.1.0
  11932. * @category Lang
  11933. * @param {*} value The value to check.
  11934. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11935. * @example
  11936. *
  11937. * _.isDate(new Date);
  11938. * // => true
  11939. *
  11940. * _.isDate('Mon April 23 2012');
  11941. * // => false
  11942. */
  11943. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11944. /**
  11945. * Checks if `value` is likely a DOM element.
  11946. *
  11947. * @static
  11948. * @memberOf _
  11949. * @since 0.1.0
  11950. * @category Lang
  11951. * @param {*} value The value to check.
  11952. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11953. * @example
  11954. *
  11955. * _.isElement(document.body);
  11956. * // => true
  11957. *
  11958. * _.isElement('<body>');
  11959. * // => false
  11960. */
  11961. function isElement(value) {
  11962. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11963. }
  11964. /**
  11965. * Checks if `value` is an empty object, collection, map, or set.
  11966. *
  11967. * Objects are considered empty if they have no own enumerable string keyed
  11968. * properties.
  11969. *
  11970. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11971. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11972. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11973. *
  11974. * @static
  11975. * @memberOf _
  11976. * @since 0.1.0
  11977. * @category Lang
  11978. * @param {*} value The value to check.
  11979. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11980. * @example
  11981. *
  11982. * _.isEmpty(null);
  11983. * // => true
  11984. *
  11985. * _.isEmpty(true);
  11986. * // => true
  11987. *
  11988. * _.isEmpty(1);
  11989. * // => true
  11990. *
  11991. * _.isEmpty([1, 2, 3]);
  11992. * // => false
  11993. *
  11994. * _.isEmpty({ 'a': 1 });
  11995. * // => false
  11996. */
  11997. function isEmpty(value) {
  11998. if (value == null) {
  11999. return true;
  12000. }
  12001. if (isArrayLike(value) &&
  12002. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12003. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12004. return !value.length;
  12005. }
  12006. var tag = getTag(value);
  12007. if (tag == mapTag || tag == setTag) {
  12008. return !value.size;
  12009. }
  12010. if (isPrototype(value)) {
  12011. return !baseKeys(value).length;
  12012. }
  12013. for (var key in value) {
  12014. if (hasOwnProperty.call(value, key)) {
  12015. return false;
  12016. }
  12017. }
  12018. return true;
  12019. }
  12020. /**
  12021. * Performs a deep comparison between two values to determine if they are
  12022. * equivalent.
  12023. *
  12024. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12025. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12026. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12027. * by their own, not inherited, enumerable properties. Functions and DOM
  12028. * nodes are compared by strict equality, i.e. `===`.
  12029. *
  12030. * @static
  12031. * @memberOf _
  12032. * @since 0.1.0
  12033. * @category Lang
  12034. * @param {*} value The value to compare.
  12035. * @param {*} other The other value to compare.
  12036. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12037. * @example
  12038. *
  12039. * var object = { 'a': 1 };
  12040. * var other = { 'a': 1 };
  12041. *
  12042. * _.isEqual(object, other);
  12043. * // => true
  12044. *
  12045. * object === other;
  12046. * // => false
  12047. */
  12048. function isEqual(value, other) {
  12049. return baseIsEqual(value, other);
  12050. }
  12051. /**
  12052. * This method is like `_.isEqual` except that it accepts `customizer` which
  12053. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12054. * are handled by the method instead. The `customizer` is invoked with up to
  12055. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12056. *
  12057. * @static
  12058. * @memberOf _
  12059. * @since 4.0.0
  12060. * @category Lang
  12061. * @param {*} value The value to compare.
  12062. * @param {*} other The other value to compare.
  12063. * @param {Function} [customizer] The function to customize comparisons.
  12064. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12065. * @example
  12066. *
  12067. * function isGreeting(value) {
  12068. * return /^h(?:i|ello)$/.test(value);
  12069. * }
  12070. *
  12071. * function customizer(objValue, othValue) {
  12072. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12073. * return true;
  12074. * }
  12075. * }
  12076. *
  12077. * var array = ['hello', 'goodbye'];
  12078. * var other = ['hi', 'goodbye'];
  12079. *
  12080. * _.isEqualWith(array, other, customizer);
  12081. * // => true
  12082. */
  12083. function isEqualWith(value, other, customizer) {
  12084. customizer = typeof customizer == 'function' ? customizer : undefined;
  12085. var result = customizer ? customizer(value, other) : undefined;
  12086. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12087. }
  12088. /**
  12089. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12090. * `SyntaxError`, `TypeError`, or `URIError` object.
  12091. *
  12092. * @static
  12093. * @memberOf _
  12094. * @since 3.0.0
  12095. * @category Lang
  12096. * @param {*} value The value to check.
  12097. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12098. * @example
  12099. *
  12100. * _.isError(new Error);
  12101. * // => true
  12102. *
  12103. * _.isError(Error);
  12104. * // => false
  12105. */
  12106. function isError(value) {
  12107. if (!isObjectLike(value)) {
  12108. return false;
  12109. }
  12110. var tag = baseGetTag(value);
  12111. return tag == errorTag || tag == domExcTag ||
  12112. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12113. }
  12114. /**
  12115. * Checks if `value` is a finite primitive number.
  12116. *
  12117. * **Note:** This method is based on
  12118. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12119. *
  12120. * @static
  12121. * @memberOf _
  12122. * @since 0.1.0
  12123. * @category Lang
  12124. * @param {*} value The value to check.
  12125. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12126. * @example
  12127. *
  12128. * _.isFinite(3);
  12129. * // => true
  12130. *
  12131. * _.isFinite(Number.MIN_VALUE);
  12132. * // => true
  12133. *
  12134. * _.isFinite(Infinity);
  12135. * // => false
  12136. *
  12137. * _.isFinite('3');
  12138. * // => false
  12139. */
  12140. function isFinite(value) {
  12141. return typeof value == 'number' && nativeIsFinite(value);
  12142. }
  12143. /**
  12144. * Checks if `value` is classified as a `Function` object.
  12145. *
  12146. * @static
  12147. * @memberOf _
  12148. * @since 0.1.0
  12149. * @category Lang
  12150. * @param {*} value The value to check.
  12151. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12152. * @example
  12153. *
  12154. * _.isFunction(_);
  12155. * // => true
  12156. *
  12157. * _.isFunction(/abc/);
  12158. * // => false
  12159. */
  12160. function isFunction(value) {
  12161. if (!isObject(value)) {
  12162. return false;
  12163. }
  12164. // The use of `Object#toString` avoids issues with the `typeof` operator
  12165. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12166. var tag = baseGetTag(value);
  12167. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12168. }
  12169. /**
  12170. * Checks if `value` is an integer.
  12171. *
  12172. * **Note:** This method is based on
  12173. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12174. *
  12175. * @static
  12176. * @memberOf _
  12177. * @since 4.0.0
  12178. * @category Lang
  12179. * @param {*} value The value to check.
  12180. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12181. * @example
  12182. *
  12183. * _.isInteger(3);
  12184. * // => true
  12185. *
  12186. * _.isInteger(Number.MIN_VALUE);
  12187. * // => false
  12188. *
  12189. * _.isInteger(Infinity);
  12190. * // => false
  12191. *
  12192. * _.isInteger('3');
  12193. * // => false
  12194. */
  12195. function isInteger(value) {
  12196. return typeof value == 'number' && value == toInteger(value);
  12197. }
  12198. /**
  12199. * Checks if `value` is a valid array-like length.
  12200. *
  12201. * **Note:** This method is loosely based on
  12202. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12203. *
  12204. * @static
  12205. * @memberOf _
  12206. * @since 4.0.0
  12207. * @category Lang
  12208. * @param {*} value The value to check.
  12209. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12210. * @example
  12211. *
  12212. * _.isLength(3);
  12213. * // => true
  12214. *
  12215. * _.isLength(Number.MIN_VALUE);
  12216. * // => false
  12217. *
  12218. * _.isLength(Infinity);
  12219. * // => false
  12220. *
  12221. * _.isLength('3');
  12222. * // => false
  12223. */
  12224. function isLength(value) {
  12225. return typeof value == 'number' &&
  12226. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12227. }
  12228. /**
  12229. * Checks if `value` is the
  12230. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12231. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  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 an object, else `false`.
  12239. * @example
  12240. *
  12241. * _.isObject({});
  12242. * // => true
  12243. *
  12244. * _.isObject([1, 2, 3]);
  12245. * // => true
  12246. *
  12247. * _.isObject(_.noop);
  12248. * // => true
  12249. *
  12250. * _.isObject(null);
  12251. * // => false
  12252. */
  12253. function isObject(value) {
  12254. var type = typeof value;
  12255. return value != null && (type == 'object' || type == 'function');
  12256. }
  12257. /**
  12258. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12259. * and has a `typeof` result of "object".
  12260. *
  12261. * @static
  12262. * @memberOf _
  12263. * @since 4.0.0
  12264. * @category Lang
  12265. * @param {*} value The value to check.
  12266. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12267. * @example
  12268. *
  12269. * _.isObjectLike({});
  12270. * // => true
  12271. *
  12272. * _.isObjectLike([1, 2, 3]);
  12273. * // => true
  12274. *
  12275. * _.isObjectLike(_.noop);
  12276. * // => false
  12277. *
  12278. * _.isObjectLike(null);
  12279. * // => false
  12280. */
  12281. function isObjectLike(value) {
  12282. return value != null && typeof value == 'object';
  12283. }
  12284. /**
  12285. * Checks if `value` is classified as a `Map` object.
  12286. *
  12287. * @static
  12288. * @memberOf _
  12289. * @since 4.3.0
  12290. * @category Lang
  12291. * @param {*} value The value to check.
  12292. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12293. * @example
  12294. *
  12295. * _.isMap(new Map);
  12296. * // => true
  12297. *
  12298. * _.isMap(new WeakMap);
  12299. * // => false
  12300. */
  12301. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12302. /**
  12303. * Performs a partial deep comparison between `object` and `source` to
  12304. * determine if `object` contains equivalent property values.
  12305. *
  12306. * **Note:** This method is equivalent to `_.matches` when `source` is
  12307. * partially applied.
  12308. *
  12309. * Partial comparisons will match empty array and empty object `source`
  12310. * values against any array or object value, respectively. See `_.isEqual`
  12311. * for a list of supported value comparisons.
  12312. *
  12313. * @static
  12314. * @memberOf _
  12315. * @since 3.0.0
  12316. * @category Lang
  12317. * @param {Object} object The object to inspect.
  12318. * @param {Object} source The object of property values to match.
  12319. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12320. * @example
  12321. *
  12322. * var object = { 'a': 1, 'b': 2 };
  12323. *
  12324. * _.isMatch(object, { 'b': 2 });
  12325. * // => true
  12326. *
  12327. * _.isMatch(object, { 'b': 1 });
  12328. * // => false
  12329. */
  12330. function isMatch(object, source) {
  12331. return object === source || baseIsMatch(object, source, getMatchData(source));
  12332. }
  12333. /**
  12334. * This method is like `_.isMatch` except that it accepts `customizer` which
  12335. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12336. * are handled by the method instead. The `customizer` is invoked with five
  12337. * arguments: (objValue, srcValue, index|key, object, source).
  12338. *
  12339. * @static
  12340. * @memberOf _
  12341. * @since 4.0.0
  12342. * @category Lang
  12343. * @param {Object} object The object to inspect.
  12344. * @param {Object} source The object of property values to match.
  12345. * @param {Function} [customizer] The function to customize comparisons.
  12346. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12347. * @example
  12348. *
  12349. * function isGreeting(value) {
  12350. * return /^h(?:i|ello)$/.test(value);
  12351. * }
  12352. *
  12353. * function customizer(objValue, srcValue) {
  12354. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12355. * return true;
  12356. * }
  12357. * }
  12358. *
  12359. * var object = { 'greeting': 'hello' };
  12360. * var source = { 'greeting': 'hi' };
  12361. *
  12362. * _.isMatchWith(object, source, customizer);
  12363. * // => true
  12364. */
  12365. function isMatchWith(object, source, customizer) {
  12366. customizer = typeof customizer == 'function' ? customizer : undefined;
  12367. return baseIsMatch(object, source, getMatchData(source), customizer);
  12368. }
  12369. /**
  12370. * Checks if `value` is `NaN`.
  12371. *
  12372. * **Note:** This method is based on
  12373. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12374. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12375. * `undefined` and other non-number values.
  12376. *
  12377. * @static
  12378. * @memberOf _
  12379. * @since 0.1.0
  12380. * @category Lang
  12381. * @param {*} value The value to check.
  12382. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12383. * @example
  12384. *
  12385. * _.isNaN(NaN);
  12386. * // => true
  12387. *
  12388. * _.isNaN(new Number(NaN));
  12389. * // => true
  12390. *
  12391. * isNaN(undefined);
  12392. * // => true
  12393. *
  12394. * _.isNaN(undefined);
  12395. * // => false
  12396. */
  12397. function isNaN(value) {
  12398. // An `NaN` primitive is the only value that is not equal to itself.
  12399. // Perform the `toStringTag` check first to avoid errors with some
  12400. // ActiveX objects in IE.
  12401. return isNumber(value) && value != +value;
  12402. }
  12403. /**
  12404. * Checks if `value` is a pristine native function.
  12405. *
  12406. * **Note:** This method can't reliably detect native functions in the presence
  12407. * of the core-js package because core-js circumvents this kind of detection.
  12408. * Despite multiple requests, the core-js maintainer has made it clear: any
  12409. * attempt to fix the detection will be obstructed. As a result, we're left
  12410. * with little choice but to throw an error. Unfortunately, this also affects
  12411. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12412. * which rely on core-js.
  12413. *
  12414. * @static
  12415. * @memberOf _
  12416. * @since 3.0.0
  12417. * @category Lang
  12418. * @param {*} value The value to check.
  12419. * @returns {boolean} Returns `true` if `value` is a native function,
  12420. * else `false`.
  12421. * @example
  12422. *
  12423. * _.isNative(Array.prototype.push);
  12424. * // => true
  12425. *
  12426. * _.isNative(_);
  12427. * // => false
  12428. */
  12429. function isNative(value) {
  12430. if (isMaskable(value)) {
  12431. throw new Error(CORE_ERROR_TEXT);
  12432. }
  12433. return baseIsNative(value);
  12434. }
  12435. /**
  12436. * Checks if `value` is `null`.
  12437. *
  12438. * @static
  12439. * @memberOf _
  12440. * @since 0.1.0
  12441. * @category Lang
  12442. * @param {*} value The value to check.
  12443. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12444. * @example
  12445. *
  12446. * _.isNull(null);
  12447. * // => true
  12448. *
  12449. * _.isNull(void 0);
  12450. * // => false
  12451. */
  12452. function isNull(value) {
  12453. return value === null;
  12454. }
  12455. /**
  12456. * Checks if `value` is `null` or `undefined`.
  12457. *
  12458. * @static
  12459. * @memberOf _
  12460. * @since 4.0.0
  12461. * @category Lang
  12462. * @param {*} value The value to check.
  12463. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12464. * @example
  12465. *
  12466. * _.isNil(null);
  12467. * // => true
  12468. *
  12469. * _.isNil(void 0);
  12470. * // => true
  12471. *
  12472. * _.isNil(NaN);
  12473. * // => false
  12474. */
  12475. function isNil(value) {
  12476. return value == null;
  12477. }
  12478. /**
  12479. * Checks if `value` is classified as a `Number` primitive or object.
  12480. *
  12481. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12482. * classified as numbers, use the `_.isFinite` method.
  12483. *
  12484. * @static
  12485. * @memberOf _
  12486. * @since 0.1.0
  12487. * @category Lang
  12488. * @param {*} value The value to check.
  12489. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12490. * @example
  12491. *
  12492. * _.isNumber(3);
  12493. * // => true
  12494. *
  12495. * _.isNumber(Number.MIN_VALUE);
  12496. * // => true
  12497. *
  12498. * _.isNumber(Infinity);
  12499. * // => true
  12500. *
  12501. * _.isNumber('3');
  12502. * // => false
  12503. */
  12504. function isNumber(value) {
  12505. return typeof value == 'number' ||
  12506. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12507. }
  12508. /**
  12509. * Checks if `value` is a plain object, that is, an object created by the
  12510. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12511. *
  12512. * @static
  12513. * @memberOf _
  12514. * @since 0.8.0
  12515. * @category Lang
  12516. * @param {*} value The value to check.
  12517. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12518. * @example
  12519. *
  12520. * function Foo() {
  12521. * this.a = 1;
  12522. * }
  12523. *
  12524. * _.isPlainObject(new Foo);
  12525. * // => false
  12526. *
  12527. * _.isPlainObject([1, 2, 3]);
  12528. * // => false
  12529. *
  12530. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12531. * // => true
  12532. *
  12533. * _.isPlainObject(Object.create(null));
  12534. * // => true
  12535. */
  12536. function isPlainObject(value) {
  12537. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12538. return false;
  12539. }
  12540. var proto = getPrototype(value);
  12541. if (proto === null) {
  12542. return true;
  12543. }
  12544. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12545. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12546. funcToString.call(Ctor) == objectCtorString;
  12547. }
  12548. /**
  12549. * Checks if `value` is classified as a `RegExp` object.
  12550. *
  12551. * @static
  12552. * @memberOf _
  12553. * @since 0.1.0
  12554. * @category Lang
  12555. * @param {*} value The value to check.
  12556. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12557. * @example
  12558. *
  12559. * _.isRegExp(/abc/);
  12560. * // => true
  12561. *
  12562. * _.isRegExp('/abc/');
  12563. * // => false
  12564. */
  12565. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12566. /**
  12567. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12568. * double precision number which isn't the result of a rounded unsafe integer.
  12569. *
  12570. * **Note:** This method is based on
  12571. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12572. *
  12573. * @static
  12574. * @memberOf _
  12575. * @since 4.0.0
  12576. * @category Lang
  12577. * @param {*} value The value to check.
  12578. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12579. * @example
  12580. *
  12581. * _.isSafeInteger(3);
  12582. * // => true
  12583. *
  12584. * _.isSafeInteger(Number.MIN_VALUE);
  12585. * // => false
  12586. *
  12587. * _.isSafeInteger(Infinity);
  12588. * // => false
  12589. *
  12590. * _.isSafeInteger('3');
  12591. * // => false
  12592. */
  12593. function isSafeInteger(value) {
  12594. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12595. }
  12596. /**
  12597. * Checks if `value` is classified as a `Set` object.
  12598. *
  12599. * @static
  12600. * @memberOf _
  12601. * @since 4.3.0
  12602. * @category Lang
  12603. * @param {*} value The value to check.
  12604. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12605. * @example
  12606. *
  12607. * _.isSet(new Set);
  12608. * // => true
  12609. *
  12610. * _.isSet(new WeakSet);
  12611. * // => false
  12612. */
  12613. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12614. /**
  12615. * Checks if `value` is classified as a `String` primitive or object.
  12616. *
  12617. * @static
  12618. * @since 0.1.0
  12619. * @memberOf _
  12620. * @category Lang
  12621. * @param {*} value The value to check.
  12622. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12623. * @example
  12624. *
  12625. * _.isString('abc');
  12626. * // => true
  12627. *
  12628. * _.isString(1);
  12629. * // => false
  12630. */
  12631. function isString(value) {
  12632. return typeof value == 'string' ||
  12633. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12634. }
  12635. /**
  12636. * Checks if `value` is classified as a `Symbol` primitive or object.
  12637. *
  12638. * @static
  12639. * @memberOf _
  12640. * @since 4.0.0
  12641. * @category Lang
  12642. * @param {*} value The value to check.
  12643. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12644. * @example
  12645. *
  12646. * _.isSymbol(Symbol.iterator);
  12647. * // => true
  12648. *
  12649. * _.isSymbol('abc');
  12650. * // => false
  12651. */
  12652. function isSymbol(value) {
  12653. return typeof value == 'symbol' ||
  12654. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12655. }
  12656. /**
  12657. * Checks if `value` is classified as a typed array.
  12658. *
  12659. * @static
  12660. * @memberOf _
  12661. * @since 3.0.0
  12662. * @category Lang
  12663. * @param {*} value The value to check.
  12664. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12665. * @example
  12666. *
  12667. * _.isTypedArray(new Uint8Array);
  12668. * // => true
  12669. *
  12670. * _.isTypedArray([]);
  12671. * // => false
  12672. */
  12673. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12674. /**
  12675. * Checks if `value` is `undefined`.
  12676. *
  12677. * @static
  12678. * @since 0.1.0
  12679. * @memberOf _
  12680. * @category Lang
  12681. * @param {*} value The value to check.
  12682. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12683. * @example
  12684. *
  12685. * _.isUndefined(void 0);
  12686. * // => true
  12687. *
  12688. * _.isUndefined(null);
  12689. * // => false
  12690. */
  12691. function isUndefined(value) {
  12692. return value === undefined;
  12693. }
  12694. /**
  12695. * Checks if `value` is classified as a `WeakMap` object.
  12696. *
  12697. * @static
  12698. * @memberOf _
  12699. * @since 4.3.0
  12700. * @category Lang
  12701. * @param {*} value The value to check.
  12702. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12703. * @example
  12704. *
  12705. * _.isWeakMap(new WeakMap);
  12706. * // => true
  12707. *
  12708. * _.isWeakMap(new Map);
  12709. * // => false
  12710. */
  12711. function isWeakMap(value) {
  12712. return isObjectLike(value) && getTag(value) == weakMapTag;
  12713. }
  12714. /**
  12715. * Checks if `value` is classified as a `WeakSet` object.
  12716. *
  12717. * @static
  12718. * @memberOf _
  12719. * @since 4.3.0
  12720. * @category Lang
  12721. * @param {*} value The value to check.
  12722. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12723. * @example
  12724. *
  12725. * _.isWeakSet(new WeakSet);
  12726. * // => true
  12727. *
  12728. * _.isWeakSet(new Set);
  12729. * // => false
  12730. */
  12731. function isWeakSet(value) {
  12732. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12733. }
  12734. /**
  12735. * Checks if `value` is less than `other`.
  12736. *
  12737. * @static
  12738. * @memberOf _
  12739. * @since 3.9.0
  12740. * @category Lang
  12741. * @param {*} value The value to compare.
  12742. * @param {*} other The other value to compare.
  12743. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12744. * else `false`.
  12745. * @see _.gt
  12746. * @example
  12747. *
  12748. * _.lt(1, 3);
  12749. * // => true
  12750. *
  12751. * _.lt(3, 3);
  12752. * // => false
  12753. *
  12754. * _.lt(3, 1);
  12755. * // => false
  12756. */
  12757. var lt = createRelationalOperation(baseLt);
  12758. /**
  12759. * Checks if `value` is less than or equal to `other`.
  12760. *
  12761. * @static
  12762. * @memberOf _
  12763. * @since 3.9.0
  12764. * @category Lang
  12765. * @param {*} value The value to compare.
  12766. * @param {*} other The other value to compare.
  12767. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12768. * `other`, else `false`.
  12769. * @see _.gte
  12770. * @example
  12771. *
  12772. * _.lte(1, 3);
  12773. * // => true
  12774. *
  12775. * _.lte(3, 3);
  12776. * // => true
  12777. *
  12778. * _.lte(3, 1);
  12779. * // => false
  12780. */
  12781. var lte = createRelationalOperation(function(value, other) {
  12782. return value <= other;
  12783. });
  12784. /**
  12785. * Converts `value` to an array.
  12786. *
  12787. * @static
  12788. * @since 0.1.0
  12789. * @memberOf _
  12790. * @category Lang
  12791. * @param {*} value The value to convert.
  12792. * @returns {Array} Returns the converted array.
  12793. * @example
  12794. *
  12795. * _.toArray({ 'a': 1, 'b': 2 });
  12796. * // => [1, 2]
  12797. *
  12798. * _.toArray('abc');
  12799. * // => ['a', 'b', 'c']
  12800. *
  12801. * _.toArray(1);
  12802. * // => []
  12803. *
  12804. * _.toArray(null);
  12805. * // => []
  12806. */
  12807. function toArray(value) {
  12808. if (!value) {
  12809. return [];
  12810. }
  12811. if (isArrayLike(value)) {
  12812. return isString(value) ? stringToArray(value) : copyArray(value);
  12813. }
  12814. if (symIterator && value[symIterator]) {
  12815. return iteratorToArray(value[symIterator]());
  12816. }
  12817. var tag = getTag(value),
  12818. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12819. return func(value);
  12820. }
  12821. /**
  12822. * Converts `value` to a finite number.
  12823. *
  12824. * @static
  12825. * @memberOf _
  12826. * @since 4.12.0
  12827. * @category Lang
  12828. * @param {*} value The value to convert.
  12829. * @returns {number} Returns the converted number.
  12830. * @example
  12831. *
  12832. * _.toFinite(3.2);
  12833. * // => 3.2
  12834. *
  12835. * _.toFinite(Number.MIN_VALUE);
  12836. * // => 5e-324
  12837. *
  12838. * _.toFinite(Infinity);
  12839. * // => 1.7976931348623157e+308
  12840. *
  12841. * _.toFinite('3.2');
  12842. * // => 3.2
  12843. */
  12844. function toFinite(value) {
  12845. if (!value) {
  12846. return value === 0 ? value : 0;
  12847. }
  12848. value = toNumber(value);
  12849. if (value === INFINITY || value === -INFINITY) {
  12850. var sign = (value < 0 ? -1 : 1);
  12851. return sign * MAX_INTEGER;
  12852. }
  12853. return value === value ? value : 0;
  12854. }
  12855. /**
  12856. * Converts `value` to an integer.
  12857. *
  12858. * **Note:** This method is loosely based on
  12859. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12860. *
  12861. * @static
  12862. * @memberOf _
  12863. * @since 4.0.0
  12864. * @category Lang
  12865. * @param {*} value The value to convert.
  12866. * @returns {number} Returns the converted integer.
  12867. * @example
  12868. *
  12869. * _.toInteger(3.2);
  12870. * // => 3
  12871. *
  12872. * _.toInteger(Number.MIN_VALUE);
  12873. * // => 0
  12874. *
  12875. * _.toInteger(Infinity);
  12876. * // => 1.7976931348623157e+308
  12877. *
  12878. * _.toInteger('3.2');
  12879. * // => 3
  12880. */
  12881. function toInteger(value) {
  12882. var result = toFinite(value),
  12883. remainder = result % 1;
  12884. return result === result ? (remainder ? result - remainder : result) : 0;
  12885. }
  12886. /**
  12887. * Converts `value` to an integer suitable for use as the length of an
  12888. * array-like object.
  12889. *
  12890. * **Note:** This method is based on
  12891. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12892. *
  12893. * @static
  12894. * @memberOf _
  12895. * @since 4.0.0
  12896. * @category Lang
  12897. * @param {*} value The value to convert.
  12898. * @returns {number} Returns the converted integer.
  12899. * @example
  12900. *
  12901. * _.toLength(3.2);
  12902. * // => 3
  12903. *
  12904. * _.toLength(Number.MIN_VALUE);
  12905. * // => 0
  12906. *
  12907. * _.toLength(Infinity);
  12908. * // => 4294967295
  12909. *
  12910. * _.toLength('3.2');
  12911. * // => 3
  12912. */
  12913. function toLength(value) {
  12914. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12915. }
  12916. /**
  12917. * Converts `value` to a number.
  12918. *
  12919. * @static
  12920. * @memberOf _
  12921. * @since 4.0.0
  12922. * @category Lang
  12923. * @param {*} value The value to process.
  12924. * @returns {number} Returns the number.
  12925. * @example
  12926. *
  12927. * _.toNumber(3.2);
  12928. * // => 3.2
  12929. *
  12930. * _.toNumber(Number.MIN_VALUE);
  12931. * // => 5e-324
  12932. *
  12933. * _.toNumber(Infinity);
  12934. * // => Infinity
  12935. *
  12936. * _.toNumber('3.2');
  12937. * // => 3.2
  12938. */
  12939. function toNumber(value) {
  12940. if (typeof value == 'number') {
  12941. return value;
  12942. }
  12943. if (isSymbol(value)) {
  12944. return NAN;
  12945. }
  12946. if (isObject(value)) {
  12947. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12948. value = isObject(other) ? (other + '') : other;
  12949. }
  12950. if (typeof value != 'string') {
  12951. return value === 0 ? value : +value;
  12952. }
  12953. value = baseTrim(value);
  12954. var isBinary = reIsBinary.test(value);
  12955. return (isBinary || reIsOctal.test(value))
  12956. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12957. : (reIsBadHex.test(value) ? NAN : +value);
  12958. }
  12959. /**
  12960. * Converts `value` to a plain object flattening inherited enumerable string
  12961. * keyed properties of `value` to own properties of the plain object.
  12962. *
  12963. * @static
  12964. * @memberOf _
  12965. * @since 3.0.0
  12966. * @category Lang
  12967. * @param {*} value The value to convert.
  12968. * @returns {Object} Returns the converted plain object.
  12969. * @example
  12970. *
  12971. * function Foo() {
  12972. * this.b = 2;
  12973. * }
  12974. *
  12975. * Foo.prototype.c = 3;
  12976. *
  12977. * _.assign({ 'a': 1 }, new Foo);
  12978. * // => { 'a': 1, 'b': 2 }
  12979. *
  12980. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12981. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12982. */
  12983. function toPlainObject(value) {
  12984. return copyObject(value, keysIn(value));
  12985. }
  12986. /**
  12987. * Converts `value` to a safe integer. A safe integer can be compared and
  12988. * represented correctly.
  12989. *
  12990. * @static
  12991. * @memberOf _
  12992. * @since 4.0.0
  12993. * @category Lang
  12994. * @param {*} value The value to convert.
  12995. * @returns {number} Returns the converted integer.
  12996. * @example
  12997. *
  12998. * _.toSafeInteger(3.2);
  12999. * // => 3
  13000. *
  13001. * _.toSafeInteger(Number.MIN_VALUE);
  13002. * // => 0
  13003. *
  13004. * _.toSafeInteger(Infinity);
  13005. * // => 9007199254740991
  13006. *
  13007. * _.toSafeInteger('3.2');
  13008. * // => 3
  13009. */
  13010. function toSafeInteger(value) {
  13011. return value
  13012. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13013. : (value === 0 ? value : 0);
  13014. }
  13015. /**
  13016. * Converts `value` to a string. An empty string is returned for `null`
  13017. * and `undefined` values. The sign of `-0` is preserved.
  13018. *
  13019. * @static
  13020. * @memberOf _
  13021. * @since 4.0.0
  13022. * @category Lang
  13023. * @param {*} value The value to convert.
  13024. * @returns {string} Returns the converted string.
  13025. * @example
  13026. *
  13027. * _.toString(null);
  13028. * // => ''
  13029. *
  13030. * _.toString(-0);
  13031. * // => '-0'
  13032. *
  13033. * _.toString([1, 2, 3]);
  13034. * // => '1,2,3'
  13035. */
  13036. function toString(value) {
  13037. return value == null ? '' : baseToString(value);
  13038. }
  13039. /*------------------------------------------------------------------------*/
  13040. /**
  13041. * Assigns own enumerable string keyed properties of source objects to the
  13042. * destination object. Source objects are applied from left to right.
  13043. * Subsequent sources overwrite property assignments of previous sources.
  13044. *
  13045. * **Note:** This method mutates `object` and is loosely based on
  13046. * [`Object.assign`](https://mdn.io/Object/assign).
  13047. *
  13048. * @static
  13049. * @memberOf _
  13050. * @since 0.10.0
  13051. * @category Object
  13052. * @param {Object} object The destination object.
  13053. * @param {...Object} [sources] The source objects.
  13054. * @returns {Object} Returns `object`.
  13055. * @see _.assignIn
  13056. * @example
  13057. *
  13058. * function Foo() {
  13059. * this.a = 1;
  13060. * }
  13061. *
  13062. * function Bar() {
  13063. * this.c = 3;
  13064. * }
  13065. *
  13066. * Foo.prototype.b = 2;
  13067. * Bar.prototype.d = 4;
  13068. *
  13069. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13070. * // => { 'a': 1, 'c': 3 }
  13071. */
  13072. var assign = createAssigner(function(object, source) {
  13073. if (isPrototype(source) || isArrayLike(source)) {
  13074. copyObject(source, keys(source), object);
  13075. return;
  13076. }
  13077. for (var key in source) {
  13078. if (hasOwnProperty.call(source, key)) {
  13079. assignValue(object, key, source[key]);
  13080. }
  13081. }
  13082. });
  13083. /**
  13084. * This method is like `_.assign` except that it iterates over own and
  13085. * inherited source properties.
  13086. *
  13087. * **Note:** This method mutates `object`.
  13088. *
  13089. * @static
  13090. * @memberOf _
  13091. * @since 4.0.0
  13092. * @alias extend
  13093. * @category Object
  13094. * @param {Object} object The destination object.
  13095. * @param {...Object} [sources] The source objects.
  13096. * @returns {Object} Returns `object`.
  13097. * @see _.assign
  13098. * @example
  13099. *
  13100. * function Foo() {
  13101. * this.a = 1;
  13102. * }
  13103. *
  13104. * function Bar() {
  13105. * this.c = 3;
  13106. * }
  13107. *
  13108. * Foo.prototype.b = 2;
  13109. * Bar.prototype.d = 4;
  13110. *
  13111. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13112. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13113. */
  13114. var assignIn = createAssigner(function(object, source) {
  13115. copyObject(source, keysIn(source), object);
  13116. });
  13117. /**
  13118. * This method is like `_.assignIn` except that it accepts `customizer`
  13119. * which is invoked to produce the assigned values. If `customizer` returns
  13120. * `undefined`, assignment is handled by the method instead. The `customizer`
  13121. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13122. *
  13123. * **Note:** This method mutates `object`.
  13124. *
  13125. * @static
  13126. * @memberOf _
  13127. * @since 4.0.0
  13128. * @alias extendWith
  13129. * @category Object
  13130. * @param {Object} object The destination object.
  13131. * @param {...Object} sources The source objects.
  13132. * @param {Function} [customizer] The function to customize assigned values.
  13133. * @returns {Object} Returns `object`.
  13134. * @see _.assignWith
  13135. * @example
  13136. *
  13137. * function customizer(objValue, srcValue) {
  13138. * return _.isUndefined(objValue) ? srcValue : objValue;
  13139. * }
  13140. *
  13141. * var defaults = _.partialRight(_.assignInWith, customizer);
  13142. *
  13143. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13144. * // => { 'a': 1, 'b': 2 }
  13145. */
  13146. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13147. copyObject(source, keysIn(source), object, customizer);
  13148. });
  13149. /**
  13150. * This method is like `_.assign` except that it accepts `customizer`
  13151. * which is invoked to produce the assigned values. If `customizer` returns
  13152. * `undefined`, assignment is handled by the method instead. The `customizer`
  13153. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13154. *
  13155. * **Note:** This method mutates `object`.
  13156. *
  13157. * @static
  13158. * @memberOf _
  13159. * @since 4.0.0
  13160. * @category Object
  13161. * @param {Object} object The destination object.
  13162. * @param {...Object} sources The source objects.
  13163. * @param {Function} [customizer] The function to customize assigned values.
  13164. * @returns {Object} Returns `object`.
  13165. * @see _.assignInWith
  13166. * @example
  13167. *
  13168. * function customizer(objValue, srcValue) {
  13169. * return _.isUndefined(objValue) ? srcValue : objValue;
  13170. * }
  13171. *
  13172. * var defaults = _.partialRight(_.assignWith, customizer);
  13173. *
  13174. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13175. * // => { 'a': 1, 'b': 2 }
  13176. */
  13177. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13178. copyObject(source, keys(source), object, customizer);
  13179. });
  13180. /**
  13181. * Creates an array of values corresponding to `paths` of `object`.
  13182. *
  13183. * @static
  13184. * @memberOf _
  13185. * @since 1.0.0
  13186. * @category Object
  13187. * @param {Object} object The object to iterate over.
  13188. * @param {...(string|string[])} [paths] The property paths to pick.
  13189. * @returns {Array} Returns the picked values.
  13190. * @example
  13191. *
  13192. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13193. *
  13194. * _.at(object, ['a[0].b.c', 'a[1]']);
  13195. * // => [3, 4]
  13196. */
  13197. var at = flatRest(baseAt);
  13198. /**
  13199. * Creates an object that inherits from the `prototype` object. If a
  13200. * `properties` object is given, its own enumerable string keyed properties
  13201. * are assigned to the created object.
  13202. *
  13203. * @static
  13204. * @memberOf _
  13205. * @since 2.3.0
  13206. * @category Object
  13207. * @param {Object} prototype The object to inherit from.
  13208. * @param {Object} [properties] The properties to assign to the object.
  13209. * @returns {Object} Returns the new object.
  13210. * @example
  13211. *
  13212. * function Shape() {
  13213. * this.x = 0;
  13214. * this.y = 0;
  13215. * }
  13216. *
  13217. * function Circle() {
  13218. * Shape.call(this);
  13219. * }
  13220. *
  13221. * Circle.prototype = _.create(Shape.prototype, {
  13222. * 'constructor': Circle
  13223. * });
  13224. *
  13225. * var circle = new Circle;
  13226. * circle instanceof Circle;
  13227. * // => true
  13228. *
  13229. * circle instanceof Shape;
  13230. * // => true
  13231. */
  13232. function create(prototype, properties) {
  13233. var result = baseCreate(prototype);
  13234. return properties == null ? result : baseAssign(result, properties);
  13235. }
  13236. /**
  13237. * Assigns own and inherited enumerable string keyed properties of source
  13238. * objects to the destination object for all destination properties that
  13239. * resolve to `undefined`. Source objects are applied from left to right.
  13240. * Once a property is set, additional values of the same property are ignored.
  13241. *
  13242. * **Note:** This method mutates `object`.
  13243. *
  13244. * @static
  13245. * @since 0.1.0
  13246. * @memberOf _
  13247. * @category Object
  13248. * @param {Object} object The destination object.
  13249. * @param {...Object} [sources] The source objects.
  13250. * @returns {Object} Returns `object`.
  13251. * @see _.defaultsDeep
  13252. * @example
  13253. *
  13254. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13255. * // => { 'a': 1, 'b': 2 }
  13256. */
  13257. var defaults = baseRest(function(object, sources) {
  13258. object = Object(object);
  13259. var index = -1;
  13260. var length = sources.length;
  13261. var guard = length > 2 ? sources[2] : undefined;
  13262. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13263. length = 1;
  13264. }
  13265. while (++index < length) {
  13266. var source = sources[index];
  13267. var props = keysIn(source);
  13268. var propsIndex = -1;
  13269. var propsLength = props.length;
  13270. while (++propsIndex < propsLength) {
  13271. var key = props[propsIndex];
  13272. var value = object[key];
  13273. if (value === undefined ||
  13274. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13275. object[key] = source[key];
  13276. }
  13277. }
  13278. }
  13279. return object;
  13280. });
  13281. /**
  13282. * This method is like `_.defaults` except that it recursively assigns
  13283. * default properties.
  13284. *
  13285. * **Note:** This method mutates `object`.
  13286. *
  13287. * @static
  13288. * @memberOf _
  13289. * @since 3.10.0
  13290. * @category Object
  13291. * @param {Object} object The destination object.
  13292. * @param {...Object} [sources] The source objects.
  13293. * @returns {Object} Returns `object`.
  13294. * @see _.defaults
  13295. * @example
  13296. *
  13297. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13298. * // => { 'a': { 'b': 2, 'c': 3 } }
  13299. */
  13300. var defaultsDeep = baseRest(function(args) {
  13301. args.push(undefined, customDefaultsMerge);
  13302. return apply(mergeWith, undefined, args);
  13303. });
  13304. /**
  13305. * This method is like `_.find` except that it returns the key of the first
  13306. * element `predicate` returns truthy for instead of the element itself.
  13307. *
  13308. * @static
  13309. * @memberOf _
  13310. * @since 1.1.0
  13311. * @category Object
  13312. * @param {Object} object The object to inspect.
  13313. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13314. * @returns {string|undefined} Returns the key of the matched element,
  13315. * else `undefined`.
  13316. * @example
  13317. *
  13318. * var users = {
  13319. * 'barney': { 'age': 36, 'active': true },
  13320. * 'fred': { 'age': 40, 'active': false },
  13321. * 'pebbles': { 'age': 1, 'active': true }
  13322. * };
  13323. *
  13324. * _.findKey(users, function(o) { return o.age < 40; });
  13325. * // => 'barney' (iteration order is not guaranteed)
  13326. *
  13327. * // The `_.matches` iteratee shorthand.
  13328. * _.findKey(users, { 'age': 1, 'active': true });
  13329. * // => 'pebbles'
  13330. *
  13331. * // The `_.matchesProperty` iteratee shorthand.
  13332. * _.findKey(users, ['active', false]);
  13333. * // => 'fred'
  13334. *
  13335. * // The `_.property` iteratee shorthand.
  13336. * _.findKey(users, 'active');
  13337. * // => 'barney'
  13338. */
  13339. function findKey(object, predicate) {
  13340. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13341. }
  13342. /**
  13343. * This method is like `_.findKey` except that it iterates over elements of
  13344. * a collection in the opposite order.
  13345. *
  13346. * @static
  13347. * @memberOf _
  13348. * @since 2.0.0
  13349. * @category Object
  13350. * @param {Object} object The object to inspect.
  13351. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13352. * @returns {string|undefined} Returns the key of the matched element,
  13353. * else `undefined`.
  13354. * @example
  13355. *
  13356. * var users = {
  13357. * 'barney': { 'age': 36, 'active': true },
  13358. * 'fred': { 'age': 40, 'active': false },
  13359. * 'pebbles': { 'age': 1, 'active': true }
  13360. * };
  13361. *
  13362. * _.findLastKey(users, function(o) { return o.age < 40; });
  13363. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13364. *
  13365. * // The `_.matches` iteratee shorthand.
  13366. * _.findLastKey(users, { 'age': 36, 'active': true });
  13367. * // => 'barney'
  13368. *
  13369. * // The `_.matchesProperty` iteratee shorthand.
  13370. * _.findLastKey(users, ['active', false]);
  13371. * // => 'fred'
  13372. *
  13373. * // The `_.property` iteratee shorthand.
  13374. * _.findLastKey(users, 'active');
  13375. * // => 'pebbles'
  13376. */
  13377. function findLastKey(object, predicate) {
  13378. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13379. }
  13380. /**
  13381. * Iterates over own and inherited enumerable string keyed properties of an
  13382. * object and invokes `iteratee` for each property. The iteratee is invoked
  13383. * with three arguments: (value, key, object). Iteratee functions may exit
  13384. * iteration early by explicitly returning `false`.
  13385. *
  13386. * @static
  13387. * @memberOf _
  13388. * @since 0.3.0
  13389. * @category Object
  13390. * @param {Object} object The object to iterate over.
  13391. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13392. * @returns {Object} Returns `object`.
  13393. * @see _.forInRight
  13394. * @example
  13395. *
  13396. * function Foo() {
  13397. * this.a = 1;
  13398. * this.b = 2;
  13399. * }
  13400. *
  13401. * Foo.prototype.c = 3;
  13402. *
  13403. * _.forIn(new Foo, function(value, key) {
  13404. * console.log(key);
  13405. * });
  13406. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13407. */
  13408. function forIn(object, iteratee) {
  13409. return object == null
  13410. ? object
  13411. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13412. }
  13413. /**
  13414. * This method is like `_.forIn` except that it iterates over properties of
  13415. * `object` in the opposite order.
  13416. *
  13417. * @static
  13418. * @memberOf _
  13419. * @since 2.0.0
  13420. * @category Object
  13421. * @param {Object} object The object to iterate over.
  13422. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13423. * @returns {Object} Returns `object`.
  13424. * @see _.forIn
  13425. * @example
  13426. *
  13427. * function Foo() {
  13428. * this.a = 1;
  13429. * this.b = 2;
  13430. * }
  13431. *
  13432. * Foo.prototype.c = 3;
  13433. *
  13434. * _.forInRight(new Foo, function(value, key) {
  13435. * console.log(key);
  13436. * });
  13437. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13438. */
  13439. function forInRight(object, iteratee) {
  13440. return object == null
  13441. ? object
  13442. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13443. }
  13444. /**
  13445. * Iterates over own enumerable string keyed properties of an object and
  13446. * invokes `iteratee` for each property. The iteratee is invoked with three
  13447. * arguments: (value, key, object). Iteratee functions may exit iteration
  13448. * early by explicitly returning `false`.
  13449. *
  13450. * @static
  13451. * @memberOf _
  13452. * @since 0.3.0
  13453. * @category Object
  13454. * @param {Object} object The object to iterate over.
  13455. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13456. * @returns {Object} Returns `object`.
  13457. * @see _.forOwnRight
  13458. * @example
  13459. *
  13460. * function Foo() {
  13461. * this.a = 1;
  13462. * this.b = 2;
  13463. * }
  13464. *
  13465. * Foo.prototype.c = 3;
  13466. *
  13467. * _.forOwn(new Foo, function(value, key) {
  13468. * console.log(key);
  13469. * });
  13470. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13471. */
  13472. function forOwn(object, iteratee) {
  13473. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13474. }
  13475. /**
  13476. * This method is like `_.forOwn` except that it iterates over properties of
  13477. * `object` in the opposite order.
  13478. *
  13479. * @static
  13480. * @memberOf _
  13481. * @since 2.0.0
  13482. * @category Object
  13483. * @param {Object} object The object to iterate over.
  13484. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13485. * @returns {Object} Returns `object`.
  13486. * @see _.forOwn
  13487. * @example
  13488. *
  13489. * function Foo() {
  13490. * this.a = 1;
  13491. * this.b = 2;
  13492. * }
  13493. *
  13494. * Foo.prototype.c = 3;
  13495. *
  13496. * _.forOwnRight(new Foo, function(value, key) {
  13497. * console.log(key);
  13498. * });
  13499. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13500. */
  13501. function forOwnRight(object, iteratee) {
  13502. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13503. }
  13504. /**
  13505. * Creates an array of function property names from own enumerable properties
  13506. * of `object`.
  13507. *
  13508. * @static
  13509. * @since 0.1.0
  13510. * @memberOf _
  13511. * @category Object
  13512. * @param {Object} object The object to inspect.
  13513. * @returns {Array} Returns the function names.
  13514. * @see _.functionsIn
  13515. * @example
  13516. *
  13517. * function Foo() {
  13518. * this.a = _.constant('a');
  13519. * this.b = _.constant('b');
  13520. * }
  13521. *
  13522. * Foo.prototype.c = _.constant('c');
  13523. *
  13524. * _.functions(new Foo);
  13525. * // => ['a', 'b']
  13526. */
  13527. function functions(object) {
  13528. return object == null ? [] : baseFunctions(object, keys(object));
  13529. }
  13530. /**
  13531. * Creates an array of function property names from own and inherited
  13532. * enumerable properties of `object`.
  13533. *
  13534. * @static
  13535. * @memberOf _
  13536. * @since 4.0.0
  13537. * @category Object
  13538. * @param {Object} object The object to inspect.
  13539. * @returns {Array} Returns the function names.
  13540. * @see _.functions
  13541. * @example
  13542. *
  13543. * function Foo() {
  13544. * this.a = _.constant('a');
  13545. * this.b = _.constant('b');
  13546. * }
  13547. *
  13548. * Foo.prototype.c = _.constant('c');
  13549. *
  13550. * _.functionsIn(new Foo);
  13551. * // => ['a', 'b', 'c']
  13552. */
  13553. function functionsIn(object) {
  13554. return object == null ? [] : baseFunctions(object, keysIn(object));
  13555. }
  13556. /**
  13557. * Gets the value at `path` of `object`. If the resolved value is
  13558. * `undefined`, the `defaultValue` is returned in its place.
  13559. *
  13560. * @static
  13561. * @memberOf _
  13562. * @since 3.7.0
  13563. * @category Object
  13564. * @param {Object} object The object to query.
  13565. * @param {Array|string} path The path of the property to get.
  13566. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13567. * @returns {*} Returns the resolved value.
  13568. * @example
  13569. *
  13570. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13571. *
  13572. * _.get(object, 'a[0].b.c');
  13573. * // => 3
  13574. *
  13575. * _.get(object, ['a', '0', 'b', 'c']);
  13576. * // => 3
  13577. *
  13578. * _.get(object, 'a.b.c', 'default');
  13579. * // => 'default'
  13580. */
  13581. function get(object, path, defaultValue) {
  13582. var result = object == null ? undefined : baseGet(object, path);
  13583. return result === undefined ? defaultValue : result;
  13584. }
  13585. /**
  13586. * Checks if `path` is a direct property of `object`.
  13587. *
  13588. * @static
  13589. * @since 0.1.0
  13590. * @memberOf _
  13591. * @category Object
  13592. * @param {Object} object The object to query.
  13593. * @param {Array|string} path The path to check.
  13594. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13595. * @example
  13596. *
  13597. * var object = { 'a': { 'b': 2 } };
  13598. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13599. *
  13600. * _.has(object, 'a');
  13601. * // => true
  13602. *
  13603. * _.has(object, 'a.b');
  13604. * // => true
  13605. *
  13606. * _.has(object, ['a', 'b']);
  13607. * // => true
  13608. *
  13609. * _.has(other, 'a');
  13610. * // => false
  13611. */
  13612. function has(object, path) {
  13613. return object != null && hasPath(object, path, baseHas);
  13614. }
  13615. /**
  13616. * Checks if `path` is a direct or inherited property of `object`.
  13617. *
  13618. * @static
  13619. * @memberOf _
  13620. * @since 4.0.0
  13621. * @category Object
  13622. * @param {Object} object The object to query.
  13623. * @param {Array|string} path The path to check.
  13624. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13625. * @example
  13626. *
  13627. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13628. *
  13629. * _.hasIn(object, 'a');
  13630. * // => true
  13631. *
  13632. * _.hasIn(object, 'a.b');
  13633. * // => true
  13634. *
  13635. * _.hasIn(object, ['a', 'b']);
  13636. * // => true
  13637. *
  13638. * _.hasIn(object, 'b');
  13639. * // => false
  13640. */
  13641. function hasIn(object, path) {
  13642. return object != null && hasPath(object, path, baseHasIn);
  13643. }
  13644. /**
  13645. * Creates an object composed of the inverted keys and values of `object`.
  13646. * If `object` contains duplicate values, subsequent values overwrite
  13647. * property assignments of previous values.
  13648. *
  13649. * @static
  13650. * @memberOf _
  13651. * @since 0.7.0
  13652. * @category Object
  13653. * @param {Object} object The object to invert.
  13654. * @returns {Object} Returns the new inverted object.
  13655. * @example
  13656. *
  13657. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13658. *
  13659. * _.invert(object);
  13660. * // => { '1': 'c', '2': 'b' }
  13661. */
  13662. var invert = createInverter(function(result, value, key) {
  13663. if (value != null &&
  13664. typeof value.toString != 'function') {
  13665. value = nativeObjectToString.call(value);
  13666. }
  13667. result[value] = key;
  13668. }, constant(identity));
  13669. /**
  13670. * This method is like `_.invert` except that the inverted object is generated
  13671. * from the results of running each element of `object` thru `iteratee`. The
  13672. * corresponding inverted value of each inverted key is an array of keys
  13673. * responsible for generating the inverted value. The iteratee is invoked
  13674. * with one argument: (value).
  13675. *
  13676. * @static
  13677. * @memberOf _
  13678. * @since 4.1.0
  13679. * @category Object
  13680. * @param {Object} object The object to invert.
  13681. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13682. * @returns {Object} Returns the new inverted object.
  13683. * @example
  13684. *
  13685. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13686. *
  13687. * _.invertBy(object);
  13688. * // => { '1': ['a', 'c'], '2': ['b'] }
  13689. *
  13690. * _.invertBy(object, function(value) {
  13691. * return 'group' + value;
  13692. * });
  13693. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13694. */
  13695. var invertBy = createInverter(function(result, value, key) {
  13696. if (value != null &&
  13697. typeof value.toString != 'function') {
  13698. value = nativeObjectToString.call(value);
  13699. }
  13700. if (hasOwnProperty.call(result, value)) {
  13701. result[value].push(key);
  13702. } else {
  13703. result[value] = [key];
  13704. }
  13705. }, getIteratee);
  13706. /**
  13707. * Invokes the method at `path` of `object`.
  13708. *
  13709. * @static
  13710. * @memberOf _
  13711. * @since 4.0.0
  13712. * @category Object
  13713. * @param {Object} object The object to query.
  13714. * @param {Array|string} path The path of the method to invoke.
  13715. * @param {...*} [args] The arguments to invoke the method with.
  13716. * @returns {*} Returns the result of the invoked method.
  13717. * @example
  13718. *
  13719. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13720. *
  13721. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13722. * // => [2, 3]
  13723. */
  13724. var invoke = baseRest(baseInvoke);
  13725. /**
  13726. * Creates an array of the own enumerable property names of `object`.
  13727. *
  13728. * **Note:** Non-object values are coerced to objects. See the
  13729. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13730. * for more details.
  13731. *
  13732. * @static
  13733. * @since 0.1.0
  13734. * @memberOf _
  13735. * @category Object
  13736. * @param {Object} object The object to query.
  13737. * @returns {Array} Returns the array of property names.
  13738. * @example
  13739. *
  13740. * function Foo() {
  13741. * this.a = 1;
  13742. * this.b = 2;
  13743. * }
  13744. *
  13745. * Foo.prototype.c = 3;
  13746. *
  13747. * _.keys(new Foo);
  13748. * // => ['a', 'b'] (iteration order is not guaranteed)
  13749. *
  13750. * _.keys('hi');
  13751. * // => ['0', '1']
  13752. */
  13753. function keys(object) {
  13754. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13755. }
  13756. /**
  13757. * Creates an array of the own and inherited enumerable property names of `object`.
  13758. *
  13759. * **Note:** Non-object values are coerced to objects.
  13760. *
  13761. * @static
  13762. * @memberOf _
  13763. * @since 3.0.0
  13764. * @category Object
  13765. * @param {Object} object The object to query.
  13766. * @returns {Array} Returns the array of property names.
  13767. * @example
  13768. *
  13769. * function Foo() {
  13770. * this.a = 1;
  13771. * this.b = 2;
  13772. * }
  13773. *
  13774. * Foo.prototype.c = 3;
  13775. *
  13776. * _.keysIn(new Foo);
  13777. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13778. */
  13779. function keysIn(object) {
  13780. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13781. }
  13782. /**
  13783. * The opposite of `_.mapValues`; this method creates an object with the
  13784. * same values as `object` and keys generated by running each own enumerable
  13785. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13786. * with three arguments: (value, key, object).
  13787. *
  13788. * @static
  13789. * @memberOf _
  13790. * @since 3.8.0
  13791. * @category Object
  13792. * @param {Object} object The object to iterate over.
  13793. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13794. * @returns {Object} Returns the new mapped object.
  13795. * @see _.mapValues
  13796. * @example
  13797. *
  13798. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13799. * return key + value;
  13800. * });
  13801. * // => { 'a1': 1, 'b2': 2 }
  13802. */
  13803. function mapKeys(object, iteratee) {
  13804. var result = {};
  13805. iteratee = getIteratee(iteratee, 3);
  13806. baseForOwn(object, function(value, key, object) {
  13807. baseAssignValue(result, iteratee(value, key, object), value);
  13808. });
  13809. return result;
  13810. }
  13811. /**
  13812. * Creates an object with the same keys as `object` and values generated
  13813. * by running each own enumerable string keyed property of `object` thru
  13814. * `iteratee`. The iteratee is invoked with three arguments:
  13815. * (value, key, object).
  13816. *
  13817. * @static
  13818. * @memberOf _
  13819. * @since 2.4.0
  13820. * @category Object
  13821. * @param {Object} object The object to iterate over.
  13822. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13823. * @returns {Object} Returns the new mapped object.
  13824. * @see _.mapKeys
  13825. * @example
  13826. *
  13827. * var users = {
  13828. * 'fred': { 'user': 'fred', 'age': 40 },
  13829. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13830. * };
  13831. *
  13832. * _.mapValues(users, function(o) { return o.age; });
  13833. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13834. *
  13835. * // The `_.property` iteratee shorthand.
  13836. * _.mapValues(users, 'age');
  13837. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13838. */
  13839. function mapValues(object, iteratee) {
  13840. var result = {};
  13841. iteratee = getIteratee(iteratee, 3);
  13842. baseForOwn(object, function(value, key, object) {
  13843. baseAssignValue(result, key, iteratee(value, key, object));
  13844. });
  13845. return result;
  13846. }
  13847. /**
  13848. * This method is like `_.assign` except that it recursively merges own and
  13849. * inherited enumerable string keyed properties of source objects into the
  13850. * destination object. Source properties that resolve to `undefined` are
  13851. * skipped if a destination value exists. Array and plain object properties
  13852. * are merged recursively. Other objects and value types are overridden by
  13853. * assignment. Source objects are applied from left to right. Subsequent
  13854. * sources overwrite property assignments of previous sources.
  13855. *
  13856. * **Note:** This method mutates `object`.
  13857. *
  13858. * @static
  13859. * @memberOf _
  13860. * @since 0.5.0
  13861. * @category Object
  13862. * @param {Object} object The destination object.
  13863. * @param {...Object} [sources] The source objects.
  13864. * @returns {Object} Returns `object`.
  13865. * @example
  13866. *
  13867. * var object = {
  13868. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13869. * };
  13870. *
  13871. * var other = {
  13872. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13873. * };
  13874. *
  13875. * _.merge(object, other);
  13876. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13877. */
  13878. var merge = createAssigner(function(object, source, srcIndex) {
  13879. baseMerge(object, source, srcIndex);
  13880. });
  13881. /**
  13882. * This method is like `_.merge` except that it accepts `customizer` which
  13883. * is invoked to produce the merged values of the destination and source
  13884. * properties. If `customizer` returns `undefined`, merging is handled by the
  13885. * method instead. The `customizer` is invoked with six arguments:
  13886. * (objValue, srcValue, key, object, source, stack).
  13887. *
  13888. * **Note:** This method mutates `object`.
  13889. *
  13890. * @static
  13891. * @memberOf _
  13892. * @since 4.0.0
  13893. * @category Object
  13894. * @param {Object} object The destination object.
  13895. * @param {...Object} sources The source objects.
  13896. * @param {Function} customizer The function to customize assigned values.
  13897. * @returns {Object} Returns `object`.
  13898. * @example
  13899. *
  13900. * function customizer(objValue, srcValue) {
  13901. * if (_.isArray(objValue)) {
  13902. * return objValue.concat(srcValue);
  13903. * }
  13904. * }
  13905. *
  13906. * var object = { 'a': [1], 'b': [2] };
  13907. * var other = { 'a': [3], 'b': [4] };
  13908. *
  13909. * _.mergeWith(object, other, customizer);
  13910. * // => { 'a': [1, 3], 'b': [2, 4] }
  13911. */
  13912. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13913. baseMerge(object, source, srcIndex, customizer);
  13914. });
  13915. /**
  13916. * The opposite of `_.pick`; this method creates an object composed of the
  13917. * own and inherited enumerable property paths of `object` that are not omitted.
  13918. *
  13919. * **Note:** This method is considerably slower than `_.pick`.
  13920. *
  13921. * @static
  13922. * @since 0.1.0
  13923. * @memberOf _
  13924. * @category Object
  13925. * @param {Object} object The source object.
  13926. * @param {...(string|string[])} [paths] The property paths to omit.
  13927. * @returns {Object} Returns the new object.
  13928. * @example
  13929. *
  13930. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13931. *
  13932. * _.omit(object, ['a', 'c']);
  13933. * // => { 'b': '2' }
  13934. */
  13935. var omit = flatRest(function(object, paths) {
  13936. var result = {};
  13937. if (object == null) {
  13938. return result;
  13939. }
  13940. var isDeep = false;
  13941. paths = arrayMap(paths, function(path) {
  13942. path = castPath(path, object);
  13943. isDeep || (isDeep = path.length > 1);
  13944. return path;
  13945. });
  13946. copyObject(object, getAllKeysIn(object), result);
  13947. if (isDeep) {
  13948. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13949. }
  13950. var length = paths.length;
  13951. while (length--) {
  13952. baseUnset(result, paths[length]);
  13953. }
  13954. return result;
  13955. });
  13956. /**
  13957. * The opposite of `_.pickBy`; this method creates an object composed of
  13958. * the own and inherited enumerable string keyed properties of `object` that
  13959. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13960. * arguments: (value, key).
  13961. *
  13962. * @static
  13963. * @memberOf _
  13964. * @since 4.0.0
  13965. * @category Object
  13966. * @param {Object} object The source object.
  13967. * @param {Function} [predicate=_.identity] The function invoked per property.
  13968. * @returns {Object} Returns the new object.
  13969. * @example
  13970. *
  13971. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13972. *
  13973. * _.omitBy(object, _.isNumber);
  13974. * // => { 'b': '2' }
  13975. */
  13976. function omitBy(object, predicate) {
  13977. return pickBy(object, negate(getIteratee(predicate)));
  13978. }
  13979. /**
  13980. * Creates an object composed of the picked `object` properties.
  13981. *
  13982. * @static
  13983. * @since 0.1.0
  13984. * @memberOf _
  13985. * @category Object
  13986. * @param {Object} object The source object.
  13987. * @param {...(string|string[])} [paths] The property paths to pick.
  13988. * @returns {Object} Returns the new object.
  13989. * @example
  13990. *
  13991. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13992. *
  13993. * _.pick(object, ['a', 'c']);
  13994. * // => { 'a': 1, 'c': 3 }
  13995. */
  13996. var pick = flatRest(function(object, paths) {
  13997. return object == null ? {} : basePick(object, paths);
  13998. });
  13999. /**
  14000. * Creates an object composed of the `object` properties `predicate` returns
  14001. * truthy for. The predicate is invoked with two arguments: (value, key).
  14002. *
  14003. * @static
  14004. * @memberOf _
  14005. * @since 4.0.0
  14006. * @category Object
  14007. * @param {Object} object The source object.
  14008. * @param {Function} [predicate=_.identity] The function invoked per property.
  14009. * @returns {Object} Returns the new object.
  14010. * @example
  14011. *
  14012. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14013. *
  14014. * _.pickBy(object, _.isNumber);
  14015. * // => { 'a': 1, 'c': 3 }
  14016. */
  14017. function pickBy(object, predicate) {
  14018. if (object == null) {
  14019. return {};
  14020. }
  14021. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14022. return [prop];
  14023. });
  14024. predicate = getIteratee(predicate);
  14025. return basePickBy(object, props, function(value, path) {
  14026. return predicate(value, path[0]);
  14027. });
  14028. }
  14029. /**
  14030. * This method is like `_.get` except that if the resolved value is a
  14031. * function it's invoked with the `this` binding of its parent object and
  14032. * its result is returned.
  14033. *
  14034. * @static
  14035. * @since 0.1.0
  14036. * @memberOf _
  14037. * @category Object
  14038. * @param {Object} object The object to query.
  14039. * @param {Array|string} path The path of the property to resolve.
  14040. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14041. * @returns {*} Returns the resolved value.
  14042. * @example
  14043. *
  14044. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14045. *
  14046. * _.result(object, 'a[0].b.c1');
  14047. * // => 3
  14048. *
  14049. * _.result(object, 'a[0].b.c2');
  14050. * // => 4
  14051. *
  14052. * _.result(object, 'a[0].b.c3', 'default');
  14053. * // => 'default'
  14054. *
  14055. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14056. * // => 'default'
  14057. */
  14058. function result(object, path, defaultValue) {
  14059. path = castPath(path, object);
  14060. var index = -1,
  14061. length = path.length;
  14062. // Ensure the loop is entered when path is empty.
  14063. if (!length) {
  14064. length = 1;
  14065. object = undefined;
  14066. }
  14067. while (++index < length) {
  14068. var value = object == null ? undefined : object[toKey(path[index])];
  14069. if (value === undefined) {
  14070. index = length;
  14071. value = defaultValue;
  14072. }
  14073. object = isFunction(value) ? value.call(object) : value;
  14074. }
  14075. return object;
  14076. }
  14077. /**
  14078. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14079. * it's created. Arrays are created for missing index properties while objects
  14080. * are created for all other missing properties. Use `_.setWith` to customize
  14081. * `path` creation.
  14082. *
  14083. * **Note:** This method mutates `object`.
  14084. *
  14085. * @static
  14086. * @memberOf _
  14087. * @since 3.7.0
  14088. * @category Object
  14089. * @param {Object} object The object to modify.
  14090. * @param {Array|string} path The path of the property to set.
  14091. * @param {*} value The value to set.
  14092. * @returns {Object} Returns `object`.
  14093. * @example
  14094. *
  14095. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14096. *
  14097. * _.set(object, 'a[0].b.c', 4);
  14098. * console.log(object.a[0].b.c);
  14099. * // => 4
  14100. *
  14101. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14102. * console.log(object.x[0].y.z);
  14103. * // => 5
  14104. */
  14105. function set(object, path, value) {
  14106. return object == null ? object : baseSet(object, path, value);
  14107. }
  14108. /**
  14109. * This method is like `_.set` except that it accepts `customizer` which is
  14110. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14111. * path creation is handled by the method instead. The `customizer` is invoked
  14112. * with three arguments: (nsValue, key, nsObject).
  14113. *
  14114. * **Note:** This method mutates `object`.
  14115. *
  14116. * @static
  14117. * @memberOf _
  14118. * @since 4.0.0
  14119. * @category Object
  14120. * @param {Object} object The object to modify.
  14121. * @param {Array|string} path The path of the property to set.
  14122. * @param {*} value The value to set.
  14123. * @param {Function} [customizer] The function to customize assigned values.
  14124. * @returns {Object} Returns `object`.
  14125. * @example
  14126. *
  14127. * var object = {};
  14128. *
  14129. * _.setWith(object, '[0][1]', 'a', Object);
  14130. * // => { '0': { '1': 'a' } }
  14131. */
  14132. function setWith(object, path, value, customizer) {
  14133. customizer = typeof customizer == 'function' ? customizer : undefined;
  14134. return object == null ? object : baseSet(object, path, value, customizer);
  14135. }
  14136. /**
  14137. * Creates an array of own enumerable string keyed-value pairs for `object`
  14138. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14139. * entries are returned.
  14140. *
  14141. * @static
  14142. * @memberOf _
  14143. * @since 4.0.0
  14144. * @alias entries
  14145. * @category Object
  14146. * @param {Object} object The object to query.
  14147. * @returns {Array} Returns the key-value pairs.
  14148. * @example
  14149. *
  14150. * function Foo() {
  14151. * this.a = 1;
  14152. * this.b = 2;
  14153. * }
  14154. *
  14155. * Foo.prototype.c = 3;
  14156. *
  14157. * _.toPairs(new Foo);
  14158. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14159. */
  14160. var toPairs = createToPairs(keys);
  14161. /**
  14162. * Creates an array of own and inherited enumerable string keyed-value pairs
  14163. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14164. * or set, its entries are returned.
  14165. *
  14166. * @static
  14167. * @memberOf _
  14168. * @since 4.0.0
  14169. * @alias entriesIn
  14170. * @category Object
  14171. * @param {Object} object The object to query.
  14172. * @returns {Array} Returns the key-value pairs.
  14173. * @example
  14174. *
  14175. * function Foo() {
  14176. * this.a = 1;
  14177. * this.b = 2;
  14178. * }
  14179. *
  14180. * Foo.prototype.c = 3;
  14181. *
  14182. * _.toPairsIn(new Foo);
  14183. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14184. */
  14185. var toPairsIn = createToPairs(keysIn);
  14186. /**
  14187. * An alternative to `_.reduce`; this method transforms `object` to a new
  14188. * `accumulator` object which is the result of running each of its own
  14189. * enumerable string keyed properties thru `iteratee`, with each invocation
  14190. * potentially mutating the `accumulator` object. If `accumulator` is not
  14191. * provided, a new object with the same `[[Prototype]]` will be used. The
  14192. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14193. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14194. *
  14195. * @static
  14196. * @memberOf _
  14197. * @since 1.3.0
  14198. * @category Object
  14199. * @param {Object} object The object to iterate over.
  14200. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14201. * @param {*} [accumulator] The custom accumulator value.
  14202. * @returns {*} Returns the accumulated value.
  14203. * @example
  14204. *
  14205. * _.transform([2, 3, 4], function(result, n) {
  14206. * result.push(n *= n);
  14207. * return n % 2 == 0;
  14208. * }, []);
  14209. * // => [4, 9]
  14210. *
  14211. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14212. * (result[value] || (result[value] = [])).push(key);
  14213. * }, {});
  14214. * // => { '1': ['a', 'c'], '2': ['b'] }
  14215. */
  14216. function transform(object, iteratee, accumulator) {
  14217. var isArr = isArray(object),
  14218. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14219. iteratee = getIteratee(iteratee, 4);
  14220. if (accumulator == null) {
  14221. var Ctor = object && object.constructor;
  14222. if (isArrLike) {
  14223. accumulator = isArr ? new Ctor : [];
  14224. }
  14225. else if (isObject(object)) {
  14226. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14227. }
  14228. else {
  14229. accumulator = {};
  14230. }
  14231. }
  14232. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14233. return iteratee(accumulator, value, index, object);
  14234. });
  14235. return accumulator;
  14236. }
  14237. /**
  14238. * Removes the property at `path` of `object`.
  14239. *
  14240. * **Note:** This method mutates `object`.
  14241. *
  14242. * @static
  14243. * @memberOf _
  14244. * @since 4.0.0
  14245. * @category Object
  14246. * @param {Object} object The object to modify.
  14247. * @param {Array|string} path The path of the property to unset.
  14248. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14249. * @example
  14250. *
  14251. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14252. * _.unset(object, 'a[0].b.c');
  14253. * // => true
  14254. *
  14255. * console.log(object);
  14256. * // => { 'a': [{ 'b': {} }] };
  14257. *
  14258. * _.unset(object, ['a', '0', 'b', 'c']);
  14259. * // => true
  14260. *
  14261. * console.log(object);
  14262. * // => { 'a': [{ 'b': {} }] };
  14263. */
  14264. function unset(object, path) {
  14265. return object == null ? true : baseUnset(object, path);
  14266. }
  14267. /**
  14268. * This method is like `_.set` except that accepts `updater` to produce the
  14269. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14270. * is invoked with one argument: (value).
  14271. *
  14272. * **Note:** This method mutates `object`.
  14273. *
  14274. * @static
  14275. * @memberOf _
  14276. * @since 4.6.0
  14277. * @category Object
  14278. * @param {Object} object The object to modify.
  14279. * @param {Array|string} path The path of the property to set.
  14280. * @param {Function} updater The function to produce the updated value.
  14281. * @returns {Object} Returns `object`.
  14282. * @example
  14283. *
  14284. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14285. *
  14286. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14287. * console.log(object.a[0].b.c);
  14288. * // => 9
  14289. *
  14290. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14291. * console.log(object.x[0].y.z);
  14292. * // => 0
  14293. */
  14294. function update(object, path, updater) {
  14295. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14296. }
  14297. /**
  14298. * This method is like `_.update` except that it accepts `customizer` which is
  14299. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14300. * path creation is handled by the method instead. The `customizer` is invoked
  14301. * with three arguments: (nsValue, key, nsObject).
  14302. *
  14303. * **Note:** This method mutates `object`.
  14304. *
  14305. * @static
  14306. * @memberOf _
  14307. * @since 4.6.0
  14308. * @category Object
  14309. * @param {Object} object The object to modify.
  14310. * @param {Array|string} path The path of the property to set.
  14311. * @param {Function} updater The function to produce the updated value.
  14312. * @param {Function} [customizer] The function to customize assigned values.
  14313. * @returns {Object} Returns `object`.
  14314. * @example
  14315. *
  14316. * var object = {};
  14317. *
  14318. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14319. * // => { '0': { '1': 'a' } }
  14320. */
  14321. function updateWith(object, path, updater, customizer) {
  14322. customizer = typeof customizer == 'function' ? customizer : undefined;
  14323. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14324. }
  14325. /**
  14326. * Creates an array of the own enumerable string keyed property values of `object`.
  14327. *
  14328. * **Note:** Non-object values are coerced to objects.
  14329. *
  14330. * @static
  14331. * @since 0.1.0
  14332. * @memberOf _
  14333. * @category Object
  14334. * @param {Object} object The object to query.
  14335. * @returns {Array} Returns the array of property values.
  14336. * @example
  14337. *
  14338. * function Foo() {
  14339. * this.a = 1;
  14340. * this.b = 2;
  14341. * }
  14342. *
  14343. * Foo.prototype.c = 3;
  14344. *
  14345. * _.values(new Foo);
  14346. * // => [1, 2] (iteration order is not guaranteed)
  14347. *
  14348. * _.values('hi');
  14349. * // => ['h', 'i']
  14350. */
  14351. function values(object) {
  14352. return object == null ? [] : baseValues(object, keys(object));
  14353. }
  14354. /**
  14355. * Creates an array of the own and inherited enumerable string keyed property
  14356. * values of `object`.
  14357. *
  14358. * **Note:** Non-object values are coerced to objects.
  14359. *
  14360. * @static
  14361. * @memberOf _
  14362. * @since 3.0.0
  14363. * @category Object
  14364. * @param {Object} object The object to query.
  14365. * @returns {Array} Returns the array of property values.
  14366. * @example
  14367. *
  14368. * function Foo() {
  14369. * this.a = 1;
  14370. * this.b = 2;
  14371. * }
  14372. *
  14373. * Foo.prototype.c = 3;
  14374. *
  14375. * _.valuesIn(new Foo);
  14376. * // => [1, 2, 3] (iteration order is not guaranteed)
  14377. */
  14378. function valuesIn(object) {
  14379. return object == null ? [] : baseValues(object, keysIn(object));
  14380. }
  14381. /*------------------------------------------------------------------------*/
  14382. /**
  14383. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14384. *
  14385. * @static
  14386. * @memberOf _
  14387. * @since 4.0.0
  14388. * @category Number
  14389. * @param {number} number The number to clamp.
  14390. * @param {number} [lower] The lower bound.
  14391. * @param {number} upper The upper bound.
  14392. * @returns {number} Returns the clamped number.
  14393. * @example
  14394. *
  14395. * _.clamp(-10, -5, 5);
  14396. * // => -5
  14397. *
  14398. * _.clamp(10, -5, 5);
  14399. * // => 5
  14400. */
  14401. function clamp(number, lower, upper) {
  14402. if (upper === undefined) {
  14403. upper = lower;
  14404. lower = undefined;
  14405. }
  14406. if (upper !== undefined) {
  14407. upper = toNumber(upper);
  14408. upper = upper === upper ? upper : 0;
  14409. }
  14410. if (lower !== undefined) {
  14411. lower = toNumber(lower);
  14412. lower = lower === lower ? lower : 0;
  14413. }
  14414. return baseClamp(toNumber(number), lower, upper);
  14415. }
  14416. /**
  14417. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14418. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14419. * If `start` is greater than `end` the params are swapped to support
  14420. * negative ranges.
  14421. *
  14422. * @static
  14423. * @memberOf _
  14424. * @since 3.3.0
  14425. * @category Number
  14426. * @param {number} number The number to check.
  14427. * @param {number} [start=0] The start of the range.
  14428. * @param {number} end The end of the range.
  14429. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14430. * @see _.range, _.rangeRight
  14431. * @example
  14432. *
  14433. * _.inRange(3, 2, 4);
  14434. * // => true
  14435. *
  14436. * _.inRange(4, 8);
  14437. * // => true
  14438. *
  14439. * _.inRange(4, 2);
  14440. * // => false
  14441. *
  14442. * _.inRange(2, 2);
  14443. * // => false
  14444. *
  14445. * _.inRange(1.2, 2);
  14446. * // => true
  14447. *
  14448. * _.inRange(5.2, 4);
  14449. * // => false
  14450. *
  14451. * _.inRange(-3, -2, -6);
  14452. * // => true
  14453. */
  14454. function inRange(number, start, end) {
  14455. start = toFinite(start);
  14456. if (end === undefined) {
  14457. end = start;
  14458. start = 0;
  14459. } else {
  14460. end = toFinite(end);
  14461. }
  14462. number = toNumber(number);
  14463. return baseInRange(number, start, end);
  14464. }
  14465. /**
  14466. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14467. * If only one argument is provided a number between `0` and the given number
  14468. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14469. * floats, a floating-point number is returned instead of an integer.
  14470. *
  14471. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14472. * floating-point values which can produce unexpected results.
  14473. *
  14474. * @static
  14475. * @memberOf _
  14476. * @since 0.7.0
  14477. * @category Number
  14478. * @param {number} [lower=0] The lower bound.
  14479. * @param {number} [upper=1] The upper bound.
  14480. * @param {boolean} [floating] Specify returning a floating-point number.
  14481. * @returns {number} Returns the random number.
  14482. * @example
  14483. *
  14484. * _.random(0, 5);
  14485. * // => an integer between 0 and 5
  14486. *
  14487. * _.random(5);
  14488. * // => also an integer between 0 and 5
  14489. *
  14490. * _.random(5, true);
  14491. * // => a floating-point number between 0 and 5
  14492. *
  14493. * _.random(1.2, 5.2);
  14494. * // => a floating-point number between 1.2 and 5.2
  14495. */
  14496. function random(lower, upper, floating) {
  14497. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14498. upper = floating = undefined;
  14499. }
  14500. if (floating === undefined) {
  14501. if (typeof upper == 'boolean') {
  14502. floating = upper;
  14503. upper = undefined;
  14504. }
  14505. else if (typeof lower == 'boolean') {
  14506. floating = lower;
  14507. lower = undefined;
  14508. }
  14509. }
  14510. if (lower === undefined && upper === undefined) {
  14511. lower = 0;
  14512. upper = 1;
  14513. }
  14514. else {
  14515. lower = toFinite(lower);
  14516. if (upper === undefined) {
  14517. upper = lower;
  14518. lower = 0;
  14519. } else {
  14520. upper = toFinite(upper);
  14521. }
  14522. }
  14523. if (lower > upper) {
  14524. var temp = lower;
  14525. lower = upper;
  14526. upper = temp;
  14527. }
  14528. if (floating || lower % 1 || upper % 1) {
  14529. var rand = nativeRandom();
  14530. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14531. }
  14532. return baseRandom(lower, upper);
  14533. }
  14534. /*------------------------------------------------------------------------*/
  14535. /**
  14536. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14537. *
  14538. * @static
  14539. * @memberOf _
  14540. * @since 3.0.0
  14541. * @category String
  14542. * @param {string} [string=''] The string to convert.
  14543. * @returns {string} Returns the camel cased string.
  14544. * @example
  14545. *
  14546. * _.camelCase('Foo Bar');
  14547. * // => 'fooBar'
  14548. *
  14549. * _.camelCase('--foo-bar--');
  14550. * // => 'fooBar'
  14551. *
  14552. * _.camelCase('__FOO_BAR__');
  14553. * // => 'fooBar'
  14554. */
  14555. var camelCase = createCompounder(function(result, word, index) {
  14556. word = word.toLowerCase();
  14557. return result + (index ? capitalize(word) : word);
  14558. });
  14559. /**
  14560. * Converts the first character of `string` to upper case and the remaining
  14561. * to lower case.
  14562. *
  14563. * @static
  14564. * @memberOf _
  14565. * @since 3.0.0
  14566. * @category String
  14567. * @param {string} [string=''] The string to capitalize.
  14568. * @returns {string} Returns the capitalized string.
  14569. * @example
  14570. *
  14571. * _.capitalize('FRED');
  14572. * // => 'Fred'
  14573. */
  14574. function capitalize(string) {
  14575. return upperFirst(toString(string).toLowerCase());
  14576. }
  14577. /**
  14578. * Deburrs `string` by converting
  14579. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14580. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14581. * letters to basic Latin letters and removing
  14582. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14583. *
  14584. * @static
  14585. * @memberOf _
  14586. * @since 3.0.0
  14587. * @category String
  14588. * @param {string} [string=''] The string to deburr.
  14589. * @returns {string} Returns the deburred string.
  14590. * @example
  14591. *
  14592. * _.deburr('déjà vu');
  14593. * // => 'deja vu'
  14594. */
  14595. function deburr(string) {
  14596. string = toString(string);
  14597. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14598. }
  14599. /**
  14600. * Checks if `string` ends with the given target string.
  14601. *
  14602. * @static
  14603. * @memberOf _
  14604. * @since 3.0.0
  14605. * @category String
  14606. * @param {string} [string=''] The string to inspect.
  14607. * @param {string} [target] The string to search for.
  14608. * @param {number} [position=string.length] The position to search up to.
  14609. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14610. * else `false`.
  14611. * @example
  14612. *
  14613. * _.endsWith('abc', 'c');
  14614. * // => true
  14615. *
  14616. * _.endsWith('abc', 'b');
  14617. * // => false
  14618. *
  14619. * _.endsWith('abc', 'b', 2);
  14620. * // => true
  14621. */
  14622. function endsWith(string, target, position) {
  14623. string = toString(string);
  14624. target = baseToString(target);
  14625. var length = string.length;
  14626. position = position === undefined
  14627. ? length
  14628. : baseClamp(toInteger(position), 0, length);
  14629. var end = position;
  14630. position -= target.length;
  14631. return position >= 0 && string.slice(position, end) == target;
  14632. }
  14633. /**
  14634. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14635. * corresponding HTML entities.
  14636. *
  14637. * **Note:** No other characters are escaped. To escape additional
  14638. * characters use a third-party library like [_he_](https://mths.be/he).
  14639. *
  14640. * Though the ">" character is escaped for symmetry, characters like
  14641. * ">" and "/" don't need escaping in HTML and have no special meaning
  14642. * unless they're part of a tag or unquoted attribute value. See
  14643. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14644. * (under "semi-related fun fact") for more details.
  14645. *
  14646. * When working with HTML you should always
  14647. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14648. * XSS vectors.
  14649. *
  14650. * @static
  14651. * @since 0.1.0
  14652. * @memberOf _
  14653. * @category String
  14654. * @param {string} [string=''] The string to escape.
  14655. * @returns {string} Returns the escaped string.
  14656. * @example
  14657. *
  14658. * _.escape('fred, barney, & pebbles');
  14659. * // => 'fred, barney, &amp; pebbles'
  14660. */
  14661. function escape(string) {
  14662. string = toString(string);
  14663. return (string && reHasUnescapedHtml.test(string))
  14664. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14665. : string;
  14666. }
  14667. /**
  14668. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14669. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14670. *
  14671. * @static
  14672. * @memberOf _
  14673. * @since 3.0.0
  14674. * @category String
  14675. * @param {string} [string=''] The string to escape.
  14676. * @returns {string} Returns the escaped string.
  14677. * @example
  14678. *
  14679. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14680. * // => '\[lodash\]\(https://lodash\.com/\)'
  14681. */
  14682. function escapeRegExp(string) {
  14683. string = toString(string);
  14684. return (string && reHasRegExpChar.test(string))
  14685. ? string.replace(reRegExpChar, '\\$&')
  14686. : string;
  14687. }
  14688. /**
  14689. * Converts `string` to
  14690. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14691. *
  14692. * @static
  14693. * @memberOf _
  14694. * @since 3.0.0
  14695. * @category String
  14696. * @param {string} [string=''] The string to convert.
  14697. * @returns {string} Returns the kebab cased string.
  14698. * @example
  14699. *
  14700. * _.kebabCase('Foo Bar');
  14701. * // => 'foo-bar'
  14702. *
  14703. * _.kebabCase('fooBar');
  14704. * // => 'foo-bar'
  14705. *
  14706. * _.kebabCase('__FOO_BAR__');
  14707. * // => 'foo-bar'
  14708. */
  14709. var kebabCase = createCompounder(function(result, word, index) {
  14710. return result + (index ? '-' : '') + word.toLowerCase();
  14711. });
  14712. /**
  14713. * Converts `string`, as space separated words, to lower case.
  14714. *
  14715. * @static
  14716. * @memberOf _
  14717. * @since 4.0.0
  14718. * @category String
  14719. * @param {string} [string=''] The string to convert.
  14720. * @returns {string} Returns the lower cased string.
  14721. * @example
  14722. *
  14723. * _.lowerCase('--Foo-Bar--');
  14724. * // => 'foo bar'
  14725. *
  14726. * _.lowerCase('fooBar');
  14727. * // => 'foo bar'
  14728. *
  14729. * _.lowerCase('__FOO_BAR__');
  14730. * // => 'foo bar'
  14731. */
  14732. var lowerCase = createCompounder(function(result, word, index) {
  14733. return result + (index ? ' ' : '') + word.toLowerCase();
  14734. });
  14735. /**
  14736. * Converts the first character of `string` to lower case.
  14737. *
  14738. * @static
  14739. * @memberOf _
  14740. * @since 4.0.0
  14741. * @category String
  14742. * @param {string} [string=''] The string to convert.
  14743. * @returns {string} Returns the converted string.
  14744. * @example
  14745. *
  14746. * _.lowerFirst('Fred');
  14747. * // => 'fred'
  14748. *
  14749. * _.lowerFirst('FRED');
  14750. * // => 'fRED'
  14751. */
  14752. var lowerFirst = createCaseFirst('toLowerCase');
  14753. /**
  14754. * Pads `string` on the left and right sides if it's shorter than `length`.
  14755. * Padding characters are truncated if they can't be evenly divided by `length`.
  14756. *
  14757. * @static
  14758. * @memberOf _
  14759. * @since 3.0.0
  14760. * @category String
  14761. * @param {string} [string=''] The string to pad.
  14762. * @param {number} [length=0] The padding length.
  14763. * @param {string} [chars=' '] The string used as padding.
  14764. * @returns {string} Returns the padded string.
  14765. * @example
  14766. *
  14767. * _.pad('abc', 8);
  14768. * // => ' abc '
  14769. *
  14770. * _.pad('abc', 8, '_-');
  14771. * // => '_-abc_-_'
  14772. *
  14773. * _.pad('abc', 3);
  14774. * // => 'abc'
  14775. */
  14776. function pad(string, length, chars) {
  14777. string = toString(string);
  14778. length = toInteger(length);
  14779. var strLength = length ? stringSize(string) : 0;
  14780. if (!length || strLength >= length) {
  14781. return string;
  14782. }
  14783. var mid = (length - strLength) / 2;
  14784. return (
  14785. createPadding(nativeFloor(mid), chars) +
  14786. string +
  14787. createPadding(nativeCeil(mid), chars)
  14788. );
  14789. }
  14790. /**
  14791. * Pads `string` on the right side if it's shorter than `length`. Padding
  14792. * characters are truncated if they exceed `length`.
  14793. *
  14794. * @static
  14795. * @memberOf _
  14796. * @since 4.0.0
  14797. * @category String
  14798. * @param {string} [string=''] The string to pad.
  14799. * @param {number} [length=0] The padding length.
  14800. * @param {string} [chars=' '] The string used as padding.
  14801. * @returns {string} Returns the padded string.
  14802. * @example
  14803. *
  14804. * _.padEnd('abc', 6);
  14805. * // => 'abc '
  14806. *
  14807. * _.padEnd('abc', 6, '_-');
  14808. * // => 'abc_-_'
  14809. *
  14810. * _.padEnd('abc', 3);
  14811. * // => 'abc'
  14812. */
  14813. function padEnd(string, length, chars) {
  14814. string = toString(string);
  14815. length = toInteger(length);
  14816. var strLength = length ? stringSize(string) : 0;
  14817. return (length && strLength < length)
  14818. ? (string + createPadding(length - strLength, chars))
  14819. : string;
  14820. }
  14821. /**
  14822. * Pads `string` on the left side if it's shorter than `length`. Padding
  14823. * characters are truncated if they exceed `length`.
  14824. *
  14825. * @static
  14826. * @memberOf _
  14827. * @since 4.0.0
  14828. * @category String
  14829. * @param {string} [string=''] The string to pad.
  14830. * @param {number} [length=0] The padding length.
  14831. * @param {string} [chars=' '] The string used as padding.
  14832. * @returns {string} Returns the padded string.
  14833. * @example
  14834. *
  14835. * _.padStart('abc', 6);
  14836. * // => ' abc'
  14837. *
  14838. * _.padStart('abc', 6, '_-');
  14839. * // => '_-_abc'
  14840. *
  14841. * _.padStart('abc', 3);
  14842. * // => 'abc'
  14843. */
  14844. function padStart(string, length, chars) {
  14845. string = toString(string);
  14846. length = toInteger(length);
  14847. var strLength = length ? stringSize(string) : 0;
  14848. return (length && strLength < length)
  14849. ? (createPadding(length - strLength, chars) + string)
  14850. : string;
  14851. }
  14852. /**
  14853. * Converts `string` to an integer of the specified radix. If `radix` is
  14854. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14855. * hexadecimal, in which case a `radix` of `16` is used.
  14856. *
  14857. * **Note:** This method aligns with the
  14858. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14859. *
  14860. * @static
  14861. * @memberOf _
  14862. * @since 1.1.0
  14863. * @category String
  14864. * @param {string} string The string to convert.
  14865. * @param {number} [radix=10] The radix to interpret `value` by.
  14866. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14867. * @returns {number} Returns the converted integer.
  14868. * @example
  14869. *
  14870. * _.parseInt('08');
  14871. * // => 8
  14872. *
  14873. * _.map(['6', '08', '10'], _.parseInt);
  14874. * // => [6, 8, 10]
  14875. */
  14876. function parseInt(string, radix, guard) {
  14877. if (guard || radix == null) {
  14878. radix = 0;
  14879. } else if (radix) {
  14880. radix = +radix;
  14881. }
  14882. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14883. }
  14884. /**
  14885. * Repeats the given string `n` times.
  14886. *
  14887. * @static
  14888. * @memberOf _
  14889. * @since 3.0.0
  14890. * @category String
  14891. * @param {string} [string=''] The string to repeat.
  14892. * @param {number} [n=1] The number of times to repeat the string.
  14893. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14894. * @returns {string} Returns the repeated string.
  14895. * @example
  14896. *
  14897. * _.repeat('*', 3);
  14898. * // => '***'
  14899. *
  14900. * _.repeat('abc', 2);
  14901. * // => 'abcabc'
  14902. *
  14903. * _.repeat('abc', 0);
  14904. * // => ''
  14905. */
  14906. function repeat(string, n, guard) {
  14907. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14908. n = 1;
  14909. } else {
  14910. n = toInteger(n);
  14911. }
  14912. return baseRepeat(toString(string), n);
  14913. }
  14914. /**
  14915. * Replaces matches for `pattern` in `string` with `replacement`.
  14916. *
  14917. * **Note:** This method is based on
  14918. * [`String#replace`](https://mdn.io/String/replace).
  14919. *
  14920. * @static
  14921. * @memberOf _
  14922. * @since 4.0.0
  14923. * @category String
  14924. * @param {string} [string=''] The string to modify.
  14925. * @param {RegExp|string} pattern The pattern to replace.
  14926. * @param {Function|string} replacement The match replacement.
  14927. * @returns {string} Returns the modified string.
  14928. * @example
  14929. *
  14930. * _.replace('Hi Fred', 'Fred', 'Barney');
  14931. * // => 'Hi Barney'
  14932. */
  14933. function replace() {
  14934. var args = arguments,
  14935. string = toString(args[0]);
  14936. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14937. }
  14938. /**
  14939. * Converts `string` to
  14940. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14941. *
  14942. * @static
  14943. * @memberOf _
  14944. * @since 3.0.0
  14945. * @category String
  14946. * @param {string} [string=''] The string to convert.
  14947. * @returns {string} Returns the snake cased string.
  14948. * @example
  14949. *
  14950. * _.snakeCase('Foo Bar');
  14951. * // => 'foo_bar'
  14952. *
  14953. * _.snakeCase('fooBar');
  14954. * // => 'foo_bar'
  14955. *
  14956. * _.snakeCase('--FOO-BAR--');
  14957. * // => 'foo_bar'
  14958. */
  14959. var snakeCase = createCompounder(function(result, word, index) {
  14960. return result + (index ? '_' : '') + word.toLowerCase();
  14961. });
  14962. /**
  14963. * Splits `string` by `separator`.
  14964. *
  14965. * **Note:** This method is based on
  14966. * [`String#split`](https://mdn.io/String/split).
  14967. *
  14968. * @static
  14969. * @memberOf _
  14970. * @since 4.0.0
  14971. * @category String
  14972. * @param {string} [string=''] The string to split.
  14973. * @param {RegExp|string} separator The separator pattern to split by.
  14974. * @param {number} [limit] The length to truncate results to.
  14975. * @returns {Array} Returns the string segments.
  14976. * @example
  14977. *
  14978. * _.split('a-b-c', '-', 2);
  14979. * // => ['a', 'b']
  14980. */
  14981. function split(string, separator, limit) {
  14982. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14983. separator = limit = undefined;
  14984. }
  14985. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14986. if (!limit) {
  14987. return [];
  14988. }
  14989. string = toString(string);
  14990. if (string && (
  14991. typeof separator == 'string' ||
  14992. (separator != null && !isRegExp(separator))
  14993. )) {
  14994. separator = baseToString(separator);
  14995. if (!separator && hasUnicode(string)) {
  14996. return castSlice(stringToArray(string), 0, limit);
  14997. }
  14998. }
  14999. return string.split(separator, limit);
  15000. }
  15001. /**
  15002. * Converts `string` to
  15003. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15004. *
  15005. * @static
  15006. * @memberOf _
  15007. * @since 3.1.0
  15008. * @category String
  15009. * @param {string} [string=''] The string to convert.
  15010. * @returns {string} Returns the start cased string.
  15011. * @example
  15012. *
  15013. * _.startCase('--foo-bar--');
  15014. * // => 'Foo Bar'
  15015. *
  15016. * _.startCase('fooBar');
  15017. * // => 'Foo Bar'
  15018. *
  15019. * _.startCase('__FOO_BAR__');
  15020. * // => 'FOO BAR'
  15021. */
  15022. var startCase = createCompounder(function(result, word, index) {
  15023. return result + (index ? ' ' : '') + upperFirst(word);
  15024. });
  15025. /**
  15026. * Checks if `string` starts with the given target string.
  15027. *
  15028. * @static
  15029. * @memberOf _
  15030. * @since 3.0.0
  15031. * @category String
  15032. * @param {string} [string=''] The string to inspect.
  15033. * @param {string} [target] The string to search for.
  15034. * @param {number} [position=0] The position to search from.
  15035. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15036. * else `false`.
  15037. * @example
  15038. *
  15039. * _.startsWith('abc', 'a');
  15040. * // => true
  15041. *
  15042. * _.startsWith('abc', 'b');
  15043. * // => false
  15044. *
  15045. * _.startsWith('abc', 'b', 1);
  15046. * // => true
  15047. */
  15048. function startsWith(string, target, position) {
  15049. string = toString(string);
  15050. position = position == null
  15051. ? 0
  15052. : baseClamp(toInteger(position), 0, string.length);
  15053. target = baseToString(target);
  15054. return string.slice(position, position + target.length) == target;
  15055. }
  15056. /**
  15057. * Creates a compiled template function that can interpolate data properties
  15058. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15059. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15060. * properties may be accessed as free variables in the template. If a setting
  15061. * object is given, it takes precedence over `_.templateSettings` values.
  15062. *
  15063. * **Note:** In the development build `_.template` utilizes
  15064. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15065. * for easier debugging.
  15066. *
  15067. * For more information on precompiling templates see
  15068. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15069. *
  15070. * For more information on Chrome extension sandboxes see
  15071. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15072. *
  15073. * @static
  15074. * @since 0.1.0
  15075. * @memberOf _
  15076. * @category String
  15077. * @param {string} [string=''] The template string.
  15078. * @param {Object} [options={}] The options object.
  15079. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15080. * The HTML "escape" delimiter.
  15081. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15082. * The "evaluate" delimiter.
  15083. * @param {Object} [options.imports=_.templateSettings.imports]
  15084. * An object to import into the template as free variables.
  15085. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15086. * The "interpolate" delimiter.
  15087. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15088. * The sourceURL of the compiled template.
  15089. * @param {string} [options.variable='obj']
  15090. * The data object variable name.
  15091. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15092. * @returns {Function} Returns the compiled template function.
  15093. * @example
  15094. *
  15095. * // Use the "interpolate" delimiter to create a compiled template.
  15096. * var compiled = _.template('hello <%= user %>!');
  15097. * compiled({ 'user': 'fred' });
  15098. * // => 'hello fred!'
  15099. *
  15100. * // Use the HTML "escape" delimiter to escape data property values.
  15101. * var compiled = _.template('<b><%- value %></b>');
  15102. * compiled({ 'value': '<script>' });
  15103. * // => '<b>&lt;script&gt;</b>'
  15104. *
  15105. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15106. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15107. * compiled({ 'users': ['fred', 'barney'] });
  15108. * // => '<li>fred</li><li>barney</li>'
  15109. *
  15110. * // Use the internal `print` function in "evaluate" delimiters.
  15111. * var compiled = _.template('<% print("hello " + user); %>!');
  15112. * compiled({ 'user': 'barney' });
  15113. * // => 'hello barney!'
  15114. *
  15115. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15116. * // Disable support by replacing the "interpolate" delimiter.
  15117. * var compiled = _.template('hello ${ user }!');
  15118. * compiled({ 'user': 'pebbles' });
  15119. * // => 'hello pebbles!'
  15120. *
  15121. * // Use backslashes to treat delimiters as plain text.
  15122. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15123. * compiled({ 'value': 'ignored' });
  15124. * // => '<%- value %>'
  15125. *
  15126. * // Use the `imports` option to import `jQuery` as `jq`.
  15127. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15128. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15129. * compiled({ 'users': ['fred', 'barney'] });
  15130. * // => '<li>fred</li><li>barney</li>'
  15131. *
  15132. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15133. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15134. * compiled(data);
  15135. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15136. *
  15137. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15138. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15139. * compiled.source;
  15140. * // => function(data) {
  15141. * // var __t, __p = '';
  15142. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15143. * // return __p;
  15144. * // }
  15145. *
  15146. * // Use custom template delimiters.
  15147. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15148. * var compiled = _.template('hello {{ user }}!');
  15149. * compiled({ 'user': 'mustache' });
  15150. * // => 'hello mustache!'
  15151. *
  15152. * // Use the `source` property to inline compiled templates for meaningful
  15153. * // line numbers in error messages and stack traces.
  15154. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15155. * var JST = {\
  15156. * "main": ' + _.template(mainText).source + '\
  15157. * };\
  15158. * ');
  15159. */
  15160. function template(string, options, guard) {
  15161. // Based on John Resig's `tmpl` implementation
  15162. // (http://ejohn.org/blog/javascript-micro-templating/)
  15163. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15164. var settings = lodash.templateSettings;
  15165. if (guard && isIterateeCall(string, options, guard)) {
  15166. options = undefined;
  15167. }
  15168. string = toString(string);
  15169. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15170. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15171. importsKeys = keys(imports),
  15172. importsValues = baseValues(imports, importsKeys);
  15173. var isEscaping,
  15174. isEvaluating,
  15175. index = 0,
  15176. interpolate = options.interpolate || reNoMatch,
  15177. source = "__p += '";
  15178. // Compile the regexp to match each delimiter.
  15179. var reDelimiters = RegExp(
  15180. (options.escape || reNoMatch).source + '|' +
  15181. interpolate.source + '|' +
  15182. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15183. (options.evaluate || reNoMatch).source + '|$'
  15184. , 'g');
  15185. // Use a sourceURL for easier debugging.
  15186. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15187. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15188. // and escape the comment, thus injecting code that gets evaled.
  15189. var sourceURL = '//# sourceURL=' +
  15190. (hasOwnProperty.call(options, 'sourceURL')
  15191. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15192. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15193. ) + '\n';
  15194. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15195. interpolateValue || (interpolateValue = esTemplateValue);
  15196. // Escape characters that can't be included in string literals.
  15197. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15198. // Replace delimiters with snippets.
  15199. if (escapeValue) {
  15200. isEscaping = true;
  15201. source += "' +\n__e(" + escapeValue + ") +\n'";
  15202. }
  15203. if (evaluateValue) {
  15204. isEvaluating = true;
  15205. source += "';\n" + evaluateValue + ";\n__p += '";
  15206. }
  15207. if (interpolateValue) {
  15208. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15209. }
  15210. index = offset + match.length;
  15211. // The JS engine embedded in Adobe products needs `match` returned in
  15212. // order to produce the correct `offset` value.
  15213. return match;
  15214. });
  15215. source += "';\n";
  15216. // If `variable` is not specified wrap a with-statement around the generated
  15217. // code to add the data object to the top of the scope chain.
  15218. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15219. if (!variable) {
  15220. source = 'with (obj) {\n' + source + '\n}\n';
  15221. }
  15222. // Throw an error if a forbidden character was found in `variable`, to prevent
  15223. // potential command injection attacks.
  15224. else if (reForbiddenIdentifierChars.test(variable)) {
  15225. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15226. }
  15227. // Cleanup code by stripping empty strings.
  15228. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15229. .replace(reEmptyStringMiddle, '$1')
  15230. .replace(reEmptyStringTrailing, '$1;');
  15231. // Frame code as the function body.
  15232. source = 'function(' + (variable || 'obj') + ') {\n' +
  15233. (variable
  15234. ? ''
  15235. : 'obj || (obj = {});\n'
  15236. ) +
  15237. "var __t, __p = ''" +
  15238. (isEscaping
  15239. ? ', __e = _.escape'
  15240. : ''
  15241. ) +
  15242. (isEvaluating
  15243. ? ', __j = Array.prototype.join;\n' +
  15244. "function print() { __p += __j.call(arguments, '') }\n"
  15245. : ';\n'
  15246. ) +
  15247. source +
  15248. 'return __p\n}';
  15249. var result = attempt(function() {
  15250. return Function(importsKeys, sourceURL + 'return ' + source)
  15251. .apply(undefined, importsValues);
  15252. });
  15253. // Provide the compiled function's source by its `toString` method or
  15254. // the `source` property as a convenience for inlining compiled templates.
  15255. result.source = source;
  15256. if (isError(result)) {
  15257. throw result;
  15258. }
  15259. return result;
  15260. }
  15261. /**
  15262. * Converts `string`, as a whole, to lower case just like
  15263. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15264. *
  15265. * @static
  15266. * @memberOf _
  15267. * @since 4.0.0
  15268. * @category String
  15269. * @param {string} [string=''] The string to convert.
  15270. * @returns {string} Returns the lower cased string.
  15271. * @example
  15272. *
  15273. * _.toLower('--Foo-Bar--');
  15274. * // => '--foo-bar--'
  15275. *
  15276. * _.toLower('fooBar');
  15277. * // => 'foobar'
  15278. *
  15279. * _.toLower('__FOO_BAR__');
  15280. * // => '__foo_bar__'
  15281. */
  15282. function toLower(value) {
  15283. return toString(value).toLowerCase();
  15284. }
  15285. /**
  15286. * Converts `string`, as a whole, to upper case just like
  15287. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15288. *
  15289. * @static
  15290. * @memberOf _
  15291. * @since 4.0.0
  15292. * @category String
  15293. * @param {string} [string=''] The string to convert.
  15294. * @returns {string} Returns the upper cased string.
  15295. * @example
  15296. *
  15297. * _.toUpper('--foo-bar--');
  15298. * // => '--FOO-BAR--'
  15299. *
  15300. * _.toUpper('fooBar');
  15301. * // => 'FOOBAR'
  15302. *
  15303. * _.toUpper('__foo_bar__');
  15304. * // => '__FOO_BAR__'
  15305. */
  15306. function toUpper(value) {
  15307. return toString(value).toUpperCase();
  15308. }
  15309. /**
  15310. * Removes leading and trailing whitespace or specified characters from `string`.
  15311. *
  15312. * @static
  15313. * @memberOf _
  15314. * @since 3.0.0
  15315. * @category String
  15316. * @param {string} [string=''] The string to trim.
  15317. * @param {string} [chars=whitespace] The characters to trim.
  15318. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15319. * @returns {string} Returns the trimmed string.
  15320. * @example
  15321. *
  15322. * _.trim(' abc ');
  15323. * // => 'abc'
  15324. *
  15325. * _.trim('-_-abc-_-', '_-');
  15326. * // => 'abc'
  15327. *
  15328. * _.map([' foo ', ' bar '], _.trim);
  15329. * // => ['foo', 'bar']
  15330. */
  15331. function trim(string, chars, guard) {
  15332. string = toString(string);
  15333. if (string && (guard || chars === undefined)) {
  15334. return baseTrim(string);
  15335. }
  15336. if (!string || !(chars = baseToString(chars))) {
  15337. return string;
  15338. }
  15339. var strSymbols = stringToArray(string),
  15340. chrSymbols = stringToArray(chars),
  15341. start = charsStartIndex(strSymbols, chrSymbols),
  15342. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15343. return castSlice(strSymbols, start, end).join('');
  15344. }
  15345. /**
  15346. * Removes trailing whitespace or specified characters from `string`.
  15347. *
  15348. * @static
  15349. * @memberOf _
  15350. * @since 4.0.0
  15351. * @category String
  15352. * @param {string} [string=''] The string to trim.
  15353. * @param {string} [chars=whitespace] The characters to trim.
  15354. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15355. * @returns {string} Returns the trimmed string.
  15356. * @example
  15357. *
  15358. * _.trimEnd(' abc ');
  15359. * // => ' abc'
  15360. *
  15361. * _.trimEnd('-_-abc-_-', '_-');
  15362. * // => '-_-abc'
  15363. */
  15364. function trimEnd(string, chars, guard) {
  15365. string = toString(string);
  15366. if (string && (guard || chars === undefined)) {
  15367. return string.slice(0, trimmedEndIndex(string) + 1);
  15368. }
  15369. if (!string || !(chars = baseToString(chars))) {
  15370. return string;
  15371. }
  15372. var strSymbols = stringToArray(string),
  15373. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15374. return castSlice(strSymbols, 0, end).join('');
  15375. }
  15376. /**
  15377. * Removes leading whitespace or specified characters from `string`.
  15378. *
  15379. * @static
  15380. * @memberOf _
  15381. * @since 4.0.0
  15382. * @category String
  15383. * @param {string} [string=''] The string to trim.
  15384. * @param {string} [chars=whitespace] The characters to trim.
  15385. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15386. * @returns {string} Returns the trimmed string.
  15387. * @example
  15388. *
  15389. * _.trimStart(' abc ');
  15390. * // => 'abc '
  15391. *
  15392. * _.trimStart('-_-abc-_-', '_-');
  15393. * // => 'abc-_-'
  15394. */
  15395. function trimStart(string, chars, guard) {
  15396. string = toString(string);
  15397. if (string && (guard || chars === undefined)) {
  15398. return string.replace(reTrimStart, '');
  15399. }
  15400. if (!string || !(chars = baseToString(chars))) {
  15401. return string;
  15402. }
  15403. var strSymbols = stringToArray(string),
  15404. start = charsStartIndex(strSymbols, stringToArray(chars));
  15405. return castSlice(strSymbols, start).join('');
  15406. }
  15407. /**
  15408. * Truncates `string` if it's longer than the given maximum string length.
  15409. * The last characters of the truncated string are replaced with the omission
  15410. * string which defaults to "...".
  15411. *
  15412. * @static
  15413. * @memberOf _
  15414. * @since 4.0.0
  15415. * @category String
  15416. * @param {string} [string=''] The string to truncate.
  15417. * @param {Object} [options={}] The options object.
  15418. * @param {number} [options.length=30] The maximum string length.
  15419. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15420. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15421. * @returns {string} Returns the truncated string.
  15422. * @example
  15423. *
  15424. * _.truncate('hi-diddly-ho there, neighborino');
  15425. * // => 'hi-diddly-ho there, neighbo...'
  15426. *
  15427. * _.truncate('hi-diddly-ho there, neighborino', {
  15428. * 'length': 24,
  15429. * 'separator': ' '
  15430. * });
  15431. * // => 'hi-diddly-ho there,...'
  15432. *
  15433. * _.truncate('hi-diddly-ho there, neighborino', {
  15434. * 'length': 24,
  15435. * 'separator': /,? +/
  15436. * });
  15437. * // => 'hi-diddly-ho there...'
  15438. *
  15439. * _.truncate('hi-diddly-ho there, neighborino', {
  15440. * 'omission': ' [...]'
  15441. * });
  15442. * // => 'hi-diddly-ho there, neig [...]'
  15443. */
  15444. function truncate(string, options) {
  15445. var length = DEFAULT_TRUNC_LENGTH,
  15446. omission = DEFAULT_TRUNC_OMISSION;
  15447. if (isObject(options)) {
  15448. var separator = 'separator' in options ? options.separator : separator;
  15449. length = 'length' in options ? toInteger(options.length) : length;
  15450. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15451. }
  15452. string = toString(string);
  15453. var strLength = string.length;
  15454. if (hasUnicode(string)) {
  15455. var strSymbols = stringToArray(string);
  15456. strLength = strSymbols.length;
  15457. }
  15458. if (length >= strLength) {
  15459. return string;
  15460. }
  15461. var end = length - stringSize(omission);
  15462. if (end < 1) {
  15463. return omission;
  15464. }
  15465. var result = strSymbols
  15466. ? castSlice(strSymbols, 0, end).join('')
  15467. : string.slice(0, end);
  15468. if (separator === undefined) {
  15469. return result + omission;
  15470. }
  15471. if (strSymbols) {
  15472. end += (result.length - end);
  15473. }
  15474. if (isRegExp(separator)) {
  15475. if (string.slice(end).search(separator)) {
  15476. var match,
  15477. substring = result;
  15478. if (!separator.global) {
  15479. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15480. }
  15481. separator.lastIndex = 0;
  15482. while ((match = separator.exec(substring))) {
  15483. var newEnd = match.index;
  15484. }
  15485. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15486. }
  15487. } else if (string.indexOf(baseToString(separator), end) != end) {
  15488. var index = result.lastIndexOf(separator);
  15489. if (index > -1) {
  15490. result = result.slice(0, index);
  15491. }
  15492. }
  15493. return result + omission;
  15494. }
  15495. /**
  15496. * The inverse of `_.escape`; this method converts the HTML entities
  15497. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15498. * their corresponding characters.
  15499. *
  15500. * **Note:** No other HTML entities are unescaped. To unescape additional
  15501. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15502. *
  15503. * @static
  15504. * @memberOf _
  15505. * @since 0.6.0
  15506. * @category String
  15507. * @param {string} [string=''] The string to unescape.
  15508. * @returns {string} Returns the unescaped string.
  15509. * @example
  15510. *
  15511. * _.unescape('fred, barney, &amp; pebbles');
  15512. * // => 'fred, barney, & pebbles'
  15513. */
  15514. function unescape(string) {
  15515. string = toString(string);
  15516. return (string && reHasEscapedHtml.test(string))
  15517. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15518. : string;
  15519. }
  15520. /**
  15521. * Converts `string`, as space separated words, to upper case.
  15522. *
  15523. * @static
  15524. * @memberOf _
  15525. * @since 4.0.0
  15526. * @category String
  15527. * @param {string} [string=''] The string to convert.
  15528. * @returns {string} Returns the upper cased string.
  15529. * @example
  15530. *
  15531. * _.upperCase('--foo-bar');
  15532. * // => 'FOO BAR'
  15533. *
  15534. * _.upperCase('fooBar');
  15535. * // => 'FOO BAR'
  15536. *
  15537. * _.upperCase('__foo_bar__');
  15538. * // => 'FOO BAR'
  15539. */
  15540. var upperCase = createCompounder(function(result, word, index) {
  15541. return result + (index ? ' ' : '') + word.toUpperCase();
  15542. });
  15543. /**
  15544. * Converts the first character of `string` to upper case.
  15545. *
  15546. * @static
  15547. * @memberOf _
  15548. * @since 4.0.0
  15549. * @category String
  15550. * @param {string} [string=''] The string to convert.
  15551. * @returns {string} Returns the converted string.
  15552. * @example
  15553. *
  15554. * _.upperFirst('fred');
  15555. * // => 'Fred'
  15556. *
  15557. * _.upperFirst('FRED');
  15558. * // => 'FRED'
  15559. */
  15560. var upperFirst = createCaseFirst('toUpperCase');
  15561. /**
  15562. * Splits `string` into an array of its words.
  15563. *
  15564. * @static
  15565. * @memberOf _
  15566. * @since 3.0.0
  15567. * @category String
  15568. * @param {string} [string=''] The string to inspect.
  15569. * @param {RegExp|string} [pattern] The pattern to match words.
  15570. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15571. * @returns {Array} Returns the words of `string`.
  15572. * @example
  15573. *
  15574. * _.words('fred, barney, & pebbles');
  15575. * // => ['fred', 'barney', 'pebbles']
  15576. *
  15577. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15578. * // => ['fred', 'barney', '&', 'pebbles']
  15579. */
  15580. function words(string, pattern, guard) {
  15581. string = toString(string);
  15582. pattern = guard ? undefined : pattern;
  15583. if (pattern === undefined) {
  15584. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15585. }
  15586. return string.match(pattern) || [];
  15587. }
  15588. /*------------------------------------------------------------------------*/
  15589. /**
  15590. * Attempts to invoke `func`, returning either the result or the caught error
  15591. * object. Any additional arguments are provided to `func` when it's invoked.
  15592. *
  15593. * @static
  15594. * @memberOf _
  15595. * @since 3.0.0
  15596. * @category Util
  15597. * @param {Function} func The function to attempt.
  15598. * @param {...*} [args] The arguments to invoke `func` with.
  15599. * @returns {*} Returns the `func` result or error object.
  15600. * @example
  15601. *
  15602. * // Avoid throwing errors for invalid selectors.
  15603. * var elements = _.attempt(function(selector) {
  15604. * return document.querySelectorAll(selector);
  15605. * }, '>_>');
  15606. *
  15607. * if (_.isError(elements)) {
  15608. * elements = [];
  15609. * }
  15610. */
  15611. var attempt = baseRest(function(func, args) {
  15612. try {
  15613. return apply(func, undefined, args);
  15614. } catch (e) {
  15615. return isError(e) ? e : new Error(e);
  15616. }
  15617. });
  15618. /**
  15619. * Binds methods of an object to the object itself, overwriting the existing
  15620. * method.
  15621. *
  15622. * **Note:** This method doesn't set the "length" property of bound functions.
  15623. *
  15624. * @static
  15625. * @since 0.1.0
  15626. * @memberOf _
  15627. * @category Util
  15628. * @param {Object} object The object to bind and assign the bound methods to.
  15629. * @param {...(string|string[])} methodNames The object method names to bind.
  15630. * @returns {Object} Returns `object`.
  15631. * @example
  15632. *
  15633. * var view = {
  15634. * 'label': 'docs',
  15635. * 'click': function() {
  15636. * console.log('clicked ' + this.label);
  15637. * }
  15638. * };
  15639. *
  15640. * _.bindAll(view, ['click']);
  15641. * jQuery(element).on('click', view.click);
  15642. * // => Logs 'clicked docs' when clicked.
  15643. */
  15644. var bindAll = flatRest(function(object, methodNames) {
  15645. arrayEach(methodNames, function(key) {
  15646. key = toKey(key);
  15647. baseAssignValue(object, key, bind(object[key], object));
  15648. });
  15649. return object;
  15650. });
  15651. /**
  15652. * Creates a function that iterates over `pairs` and invokes the corresponding
  15653. * function of the first predicate to return truthy. The predicate-function
  15654. * pairs are invoked with the `this` binding and arguments of the created
  15655. * function.
  15656. *
  15657. * @static
  15658. * @memberOf _
  15659. * @since 4.0.0
  15660. * @category Util
  15661. * @param {Array} pairs The predicate-function pairs.
  15662. * @returns {Function} Returns the new composite function.
  15663. * @example
  15664. *
  15665. * var func = _.cond([
  15666. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15667. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15668. * [_.stubTrue, _.constant('no match')]
  15669. * ]);
  15670. *
  15671. * func({ 'a': 1, 'b': 2 });
  15672. * // => 'matches A'
  15673. *
  15674. * func({ 'a': 0, 'b': 1 });
  15675. * // => 'matches B'
  15676. *
  15677. * func({ 'a': '1', 'b': '2' });
  15678. * // => 'no match'
  15679. */
  15680. function cond(pairs) {
  15681. var length = pairs == null ? 0 : pairs.length,
  15682. toIteratee = getIteratee();
  15683. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15684. if (typeof pair[1] != 'function') {
  15685. throw new TypeError(FUNC_ERROR_TEXT);
  15686. }
  15687. return [toIteratee(pair[0]), pair[1]];
  15688. });
  15689. return baseRest(function(args) {
  15690. var index = -1;
  15691. while (++index < length) {
  15692. var pair = pairs[index];
  15693. if (apply(pair[0], this, args)) {
  15694. return apply(pair[1], this, args);
  15695. }
  15696. }
  15697. });
  15698. }
  15699. /**
  15700. * Creates a function that invokes the predicate properties of `source` with
  15701. * the corresponding property values of a given object, returning `true` if
  15702. * all predicates return truthy, else `false`.
  15703. *
  15704. * **Note:** The created function is equivalent to `_.conformsTo` with
  15705. * `source` partially applied.
  15706. *
  15707. * @static
  15708. * @memberOf _
  15709. * @since 4.0.0
  15710. * @category Util
  15711. * @param {Object} source The object of property predicates to conform to.
  15712. * @returns {Function} Returns the new spec function.
  15713. * @example
  15714. *
  15715. * var objects = [
  15716. * { 'a': 2, 'b': 1 },
  15717. * { 'a': 1, 'b': 2 }
  15718. * ];
  15719. *
  15720. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15721. * // => [{ 'a': 1, 'b': 2 }]
  15722. */
  15723. function conforms(source) {
  15724. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15725. }
  15726. /**
  15727. * Creates a function that returns `value`.
  15728. *
  15729. * @static
  15730. * @memberOf _
  15731. * @since 2.4.0
  15732. * @category Util
  15733. * @param {*} value The value to return from the new function.
  15734. * @returns {Function} Returns the new constant function.
  15735. * @example
  15736. *
  15737. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15738. *
  15739. * console.log(objects);
  15740. * // => [{ 'a': 1 }, { 'a': 1 }]
  15741. *
  15742. * console.log(objects[0] === objects[1]);
  15743. * // => true
  15744. */
  15745. function constant(value) {
  15746. return function() {
  15747. return value;
  15748. };
  15749. }
  15750. /**
  15751. * Checks `value` to determine whether a default value should be returned in
  15752. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15753. * or `undefined`.
  15754. *
  15755. * @static
  15756. * @memberOf _
  15757. * @since 4.14.0
  15758. * @category Util
  15759. * @param {*} value The value to check.
  15760. * @param {*} defaultValue The default value.
  15761. * @returns {*} Returns the resolved value.
  15762. * @example
  15763. *
  15764. * _.defaultTo(1, 10);
  15765. * // => 1
  15766. *
  15767. * _.defaultTo(undefined, 10);
  15768. * // => 10
  15769. */
  15770. function defaultTo(value, defaultValue) {
  15771. return (value == null || value !== value) ? defaultValue : value;
  15772. }
  15773. /**
  15774. * Creates a function that returns the result of invoking the given functions
  15775. * with the `this` binding of the created function, where each successive
  15776. * invocation is supplied the return value of the previous.
  15777. *
  15778. * @static
  15779. * @memberOf _
  15780. * @since 3.0.0
  15781. * @category Util
  15782. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15783. * @returns {Function} Returns the new composite function.
  15784. * @see _.flowRight
  15785. * @example
  15786. *
  15787. * function square(n) {
  15788. * return n * n;
  15789. * }
  15790. *
  15791. * var addSquare = _.flow([_.add, square]);
  15792. * addSquare(1, 2);
  15793. * // => 9
  15794. */
  15795. var flow = createFlow();
  15796. /**
  15797. * This method is like `_.flow` except that it creates a function that
  15798. * invokes the given functions from right to left.
  15799. *
  15800. * @static
  15801. * @since 3.0.0
  15802. * @memberOf _
  15803. * @category Util
  15804. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15805. * @returns {Function} Returns the new composite function.
  15806. * @see _.flow
  15807. * @example
  15808. *
  15809. * function square(n) {
  15810. * return n * n;
  15811. * }
  15812. *
  15813. * var addSquare = _.flowRight([square, _.add]);
  15814. * addSquare(1, 2);
  15815. * // => 9
  15816. */
  15817. var flowRight = createFlow(true);
  15818. /**
  15819. * This method returns the first argument it receives.
  15820. *
  15821. * @static
  15822. * @since 0.1.0
  15823. * @memberOf _
  15824. * @category Util
  15825. * @param {*} value Any value.
  15826. * @returns {*} Returns `value`.
  15827. * @example
  15828. *
  15829. * var object = { 'a': 1 };
  15830. *
  15831. * console.log(_.identity(object) === object);
  15832. * // => true
  15833. */
  15834. function identity(value) {
  15835. return value;
  15836. }
  15837. /**
  15838. * Creates a function that invokes `func` with the arguments of the created
  15839. * function. If `func` is a property name, the created function returns the
  15840. * property value for a given element. If `func` is an array or object, the
  15841. * created function returns `true` for elements that contain the equivalent
  15842. * source properties, otherwise it returns `false`.
  15843. *
  15844. * @static
  15845. * @since 4.0.0
  15846. * @memberOf _
  15847. * @category Util
  15848. * @param {*} [func=_.identity] The value to convert to a callback.
  15849. * @returns {Function} Returns the callback.
  15850. * @example
  15851. *
  15852. * var users = [
  15853. * { 'user': 'barney', 'age': 36, 'active': true },
  15854. * { 'user': 'fred', 'age': 40, 'active': false }
  15855. * ];
  15856. *
  15857. * // The `_.matches` iteratee shorthand.
  15858. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15859. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15860. *
  15861. * // The `_.matchesProperty` iteratee shorthand.
  15862. * _.filter(users, _.iteratee(['user', 'fred']));
  15863. * // => [{ 'user': 'fred', 'age': 40 }]
  15864. *
  15865. * // The `_.property` iteratee shorthand.
  15866. * _.map(users, _.iteratee('user'));
  15867. * // => ['barney', 'fred']
  15868. *
  15869. * // Create custom iteratee shorthands.
  15870. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15871. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15872. * return func.test(string);
  15873. * };
  15874. * });
  15875. *
  15876. * _.filter(['abc', 'def'], /ef/);
  15877. * // => ['def']
  15878. */
  15879. function iteratee(func) {
  15880. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15881. }
  15882. /**
  15883. * Creates a function that performs a partial deep comparison between a given
  15884. * object and `source`, returning `true` if the given object has equivalent
  15885. * property values, else `false`.
  15886. *
  15887. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15888. * partially applied.
  15889. *
  15890. * Partial comparisons will match empty array and empty object `source`
  15891. * values against any array or object value, respectively. See `_.isEqual`
  15892. * for a list of supported value comparisons.
  15893. *
  15894. * **Note:** Multiple values can be checked by combining several matchers
  15895. * using `_.overSome`
  15896. *
  15897. * @static
  15898. * @memberOf _
  15899. * @since 3.0.0
  15900. * @category Util
  15901. * @param {Object} source The object of property values to match.
  15902. * @returns {Function} Returns the new spec function.
  15903. * @example
  15904. *
  15905. * var objects = [
  15906. * { 'a': 1, 'b': 2, 'c': 3 },
  15907. * { 'a': 4, 'b': 5, 'c': 6 }
  15908. * ];
  15909. *
  15910. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15911. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15912. *
  15913. * // Checking for several possible values
  15914. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15915. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15916. */
  15917. function matches(source) {
  15918. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15919. }
  15920. /**
  15921. * Creates a function that performs a partial deep comparison between the
  15922. * value at `path` of a given object to `srcValue`, returning `true` if the
  15923. * object value is equivalent, else `false`.
  15924. *
  15925. * **Note:** Partial comparisons will match empty array and empty object
  15926. * `srcValue` values against any array or object value, respectively. See
  15927. * `_.isEqual` for a list of supported value comparisons.
  15928. *
  15929. * **Note:** Multiple values can be checked by combining several matchers
  15930. * using `_.overSome`
  15931. *
  15932. * @static
  15933. * @memberOf _
  15934. * @since 3.2.0
  15935. * @category Util
  15936. * @param {Array|string} path The path of the property to get.
  15937. * @param {*} srcValue The value to match.
  15938. * @returns {Function} Returns the new spec function.
  15939. * @example
  15940. *
  15941. * var objects = [
  15942. * { 'a': 1, 'b': 2, 'c': 3 },
  15943. * { 'a': 4, 'b': 5, 'c': 6 }
  15944. * ];
  15945. *
  15946. * _.find(objects, _.matchesProperty('a', 4));
  15947. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15948. *
  15949. * // Checking for several possible values
  15950. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15951. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15952. */
  15953. function matchesProperty(path, srcValue) {
  15954. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15955. }
  15956. /**
  15957. * Creates a function that invokes the method at `path` of a given object.
  15958. * Any additional arguments are provided to the invoked method.
  15959. *
  15960. * @static
  15961. * @memberOf _
  15962. * @since 3.7.0
  15963. * @category Util
  15964. * @param {Array|string} path The path of the method to invoke.
  15965. * @param {...*} [args] The arguments to invoke the method with.
  15966. * @returns {Function} Returns the new invoker function.
  15967. * @example
  15968. *
  15969. * var objects = [
  15970. * { 'a': { 'b': _.constant(2) } },
  15971. * { 'a': { 'b': _.constant(1) } }
  15972. * ];
  15973. *
  15974. * _.map(objects, _.method('a.b'));
  15975. * // => [2, 1]
  15976. *
  15977. * _.map(objects, _.method(['a', 'b']));
  15978. * // => [2, 1]
  15979. */
  15980. var method = baseRest(function(path, args) {
  15981. return function(object) {
  15982. return baseInvoke(object, path, args);
  15983. };
  15984. });
  15985. /**
  15986. * The opposite of `_.method`; this method creates a function that invokes
  15987. * the method at a given path of `object`. Any additional arguments are
  15988. * provided to the invoked method.
  15989. *
  15990. * @static
  15991. * @memberOf _
  15992. * @since 3.7.0
  15993. * @category Util
  15994. * @param {Object} object The object to query.
  15995. * @param {...*} [args] The arguments to invoke the method with.
  15996. * @returns {Function} Returns the new invoker function.
  15997. * @example
  15998. *
  15999. * var array = _.times(3, _.constant),
  16000. * object = { 'a': array, 'b': array, 'c': array };
  16001. *
  16002. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16003. * // => [2, 0]
  16004. *
  16005. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16006. * // => [2, 0]
  16007. */
  16008. var methodOf = baseRest(function(object, args) {
  16009. return function(path) {
  16010. return baseInvoke(object, path, args);
  16011. };
  16012. });
  16013. /**
  16014. * Adds all own enumerable string keyed function properties of a source
  16015. * object to the destination object. If `object` is a function, then methods
  16016. * are added to its prototype as well.
  16017. *
  16018. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16019. * avoid conflicts caused by modifying the original.
  16020. *
  16021. * @static
  16022. * @since 0.1.0
  16023. * @memberOf _
  16024. * @category Util
  16025. * @param {Function|Object} [object=lodash] The destination object.
  16026. * @param {Object} source The object of functions to add.
  16027. * @param {Object} [options={}] The options object.
  16028. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16029. * @returns {Function|Object} Returns `object`.
  16030. * @example
  16031. *
  16032. * function vowels(string) {
  16033. * return _.filter(string, function(v) {
  16034. * return /[aeiou]/i.test(v);
  16035. * });
  16036. * }
  16037. *
  16038. * _.mixin({ 'vowels': vowels });
  16039. * _.vowels('fred');
  16040. * // => ['e']
  16041. *
  16042. * _('fred').vowels().value();
  16043. * // => ['e']
  16044. *
  16045. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16046. * _('fred').vowels();
  16047. * // => ['e']
  16048. */
  16049. function mixin(object, source, options) {
  16050. var props = keys(source),
  16051. methodNames = baseFunctions(source, props);
  16052. if (options == null &&
  16053. !(isObject(source) && (methodNames.length || !props.length))) {
  16054. options = source;
  16055. source = object;
  16056. object = this;
  16057. methodNames = baseFunctions(source, keys(source));
  16058. }
  16059. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16060. isFunc = isFunction(object);
  16061. arrayEach(methodNames, function(methodName) {
  16062. var func = source[methodName];
  16063. object[methodName] = func;
  16064. if (isFunc) {
  16065. object.prototype[methodName] = function() {
  16066. var chainAll = this.__chain__;
  16067. if (chain || chainAll) {
  16068. var result = object(this.__wrapped__),
  16069. actions = result.__actions__ = copyArray(this.__actions__);
  16070. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16071. result.__chain__ = chainAll;
  16072. return result;
  16073. }
  16074. return func.apply(object, arrayPush([this.value()], arguments));
  16075. };
  16076. }
  16077. });
  16078. return object;
  16079. }
  16080. /**
  16081. * Reverts the `_` variable to its previous value and returns a reference to
  16082. * the `lodash` function.
  16083. *
  16084. * @static
  16085. * @since 0.1.0
  16086. * @memberOf _
  16087. * @category Util
  16088. * @returns {Function} Returns the `lodash` function.
  16089. * @example
  16090. *
  16091. * var lodash = _.noConflict();
  16092. */
  16093. function noConflict() {
  16094. if (root._ === this) {
  16095. root._ = oldDash;
  16096. }
  16097. return this;
  16098. }
  16099. /**
  16100. * This method returns `undefined`.
  16101. *
  16102. * @static
  16103. * @memberOf _
  16104. * @since 2.3.0
  16105. * @category Util
  16106. * @example
  16107. *
  16108. * _.times(2, _.noop);
  16109. * // => [undefined, undefined]
  16110. */
  16111. function noop() {
  16112. // No operation performed.
  16113. }
  16114. /**
  16115. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16116. * the nth argument from the end is returned.
  16117. *
  16118. * @static
  16119. * @memberOf _
  16120. * @since 4.0.0
  16121. * @category Util
  16122. * @param {number} [n=0] The index of the argument to return.
  16123. * @returns {Function} Returns the new pass-thru function.
  16124. * @example
  16125. *
  16126. * var func = _.nthArg(1);
  16127. * func('a', 'b', 'c', 'd');
  16128. * // => 'b'
  16129. *
  16130. * var func = _.nthArg(-2);
  16131. * func('a', 'b', 'c', 'd');
  16132. * // => 'c'
  16133. */
  16134. function nthArg(n) {
  16135. n = toInteger(n);
  16136. return baseRest(function(args) {
  16137. return baseNth(args, n);
  16138. });
  16139. }
  16140. /**
  16141. * Creates a function that invokes `iteratees` with the arguments it receives
  16142. * and returns their results.
  16143. *
  16144. * @static
  16145. * @memberOf _
  16146. * @since 4.0.0
  16147. * @category Util
  16148. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16149. * The iteratees to invoke.
  16150. * @returns {Function} Returns the new function.
  16151. * @example
  16152. *
  16153. * var func = _.over([Math.max, Math.min]);
  16154. *
  16155. * func(1, 2, 3, 4);
  16156. * // => [4, 1]
  16157. */
  16158. var over = createOver(arrayMap);
  16159. /**
  16160. * Creates a function that checks if **all** of the `predicates` return
  16161. * truthy when invoked with the arguments it receives.
  16162. *
  16163. * Following shorthands are possible for providing predicates.
  16164. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16165. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16166. *
  16167. * @static
  16168. * @memberOf _
  16169. * @since 4.0.0
  16170. * @category Util
  16171. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16172. * The predicates to check.
  16173. * @returns {Function} Returns the new function.
  16174. * @example
  16175. *
  16176. * var func = _.overEvery([Boolean, isFinite]);
  16177. *
  16178. * func('1');
  16179. * // => true
  16180. *
  16181. * func(null);
  16182. * // => false
  16183. *
  16184. * func(NaN);
  16185. * // => false
  16186. */
  16187. var overEvery = createOver(arrayEvery);
  16188. /**
  16189. * Creates a function that checks if **any** of the `predicates` return
  16190. * truthy when invoked with the arguments it receives.
  16191. *
  16192. * Following shorthands are possible for providing predicates.
  16193. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16194. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16195. *
  16196. * @static
  16197. * @memberOf _
  16198. * @since 4.0.0
  16199. * @category Util
  16200. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16201. * The predicates to check.
  16202. * @returns {Function} Returns the new function.
  16203. * @example
  16204. *
  16205. * var func = _.overSome([Boolean, isFinite]);
  16206. *
  16207. * func('1');
  16208. * // => true
  16209. *
  16210. * func(null);
  16211. * // => true
  16212. *
  16213. * func(NaN);
  16214. * // => false
  16215. *
  16216. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16217. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16218. */
  16219. var overSome = createOver(arraySome);
  16220. /**
  16221. * Creates a function that returns the value at `path` of a given object.
  16222. *
  16223. * @static
  16224. * @memberOf _
  16225. * @since 2.4.0
  16226. * @category Util
  16227. * @param {Array|string} path The path of the property to get.
  16228. * @returns {Function} Returns the new accessor function.
  16229. * @example
  16230. *
  16231. * var objects = [
  16232. * { 'a': { 'b': 2 } },
  16233. * { 'a': { 'b': 1 } }
  16234. * ];
  16235. *
  16236. * _.map(objects, _.property('a.b'));
  16237. * // => [2, 1]
  16238. *
  16239. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16240. * // => [1, 2]
  16241. */
  16242. function property(path) {
  16243. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16244. }
  16245. /**
  16246. * The opposite of `_.property`; this method creates a function that returns
  16247. * the value at a given path of `object`.
  16248. *
  16249. * @static
  16250. * @memberOf _
  16251. * @since 3.0.0
  16252. * @category Util
  16253. * @param {Object} object The object to query.
  16254. * @returns {Function} Returns the new accessor function.
  16255. * @example
  16256. *
  16257. * var array = [0, 1, 2],
  16258. * object = { 'a': array, 'b': array, 'c': array };
  16259. *
  16260. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16261. * // => [2, 0]
  16262. *
  16263. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16264. * // => [2, 0]
  16265. */
  16266. function propertyOf(object) {
  16267. return function(path) {
  16268. return object == null ? undefined : baseGet(object, path);
  16269. };
  16270. }
  16271. /**
  16272. * Creates an array of numbers (positive and/or negative) progressing from
  16273. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16274. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16275. * it's set to `start` with `start` then set to `0`.
  16276. *
  16277. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16278. * floating-point values which can produce unexpected results.
  16279. *
  16280. * @static
  16281. * @since 0.1.0
  16282. * @memberOf _
  16283. * @category Util
  16284. * @param {number} [start=0] The start of the range.
  16285. * @param {number} end The end of the range.
  16286. * @param {number} [step=1] The value to increment or decrement by.
  16287. * @returns {Array} Returns the range of numbers.
  16288. * @see _.inRange, _.rangeRight
  16289. * @example
  16290. *
  16291. * _.range(4);
  16292. * // => [0, 1, 2, 3]
  16293. *
  16294. * _.range(-4);
  16295. * // => [0, -1, -2, -3]
  16296. *
  16297. * _.range(1, 5);
  16298. * // => [1, 2, 3, 4]
  16299. *
  16300. * _.range(0, 20, 5);
  16301. * // => [0, 5, 10, 15]
  16302. *
  16303. * _.range(0, -4, -1);
  16304. * // => [0, -1, -2, -3]
  16305. *
  16306. * _.range(1, 4, 0);
  16307. * // => [1, 1, 1]
  16308. *
  16309. * _.range(0);
  16310. * // => []
  16311. */
  16312. var range = createRange();
  16313. /**
  16314. * This method is like `_.range` except that it populates values in
  16315. * descending order.
  16316. *
  16317. * @static
  16318. * @memberOf _
  16319. * @since 4.0.0
  16320. * @category Util
  16321. * @param {number} [start=0] The start of the range.
  16322. * @param {number} end The end of the range.
  16323. * @param {number} [step=1] The value to increment or decrement by.
  16324. * @returns {Array} Returns the range of numbers.
  16325. * @see _.inRange, _.range
  16326. * @example
  16327. *
  16328. * _.rangeRight(4);
  16329. * // => [3, 2, 1, 0]
  16330. *
  16331. * _.rangeRight(-4);
  16332. * // => [-3, -2, -1, 0]
  16333. *
  16334. * _.rangeRight(1, 5);
  16335. * // => [4, 3, 2, 1]
  16336. *
  16337. * _.rangeRight(0, 20, 5);
  16338. * // => [15, 10, 5, 0]
  16339. *
  16340. * _.rangeRight(0, -4, -1);
  16341. * // => [-3, -2, -1, 0]
  16342. *
  16343. * _.rangeRight(1, 4, 0);
  16344. * // => [1, 1, 1]
  16345. *
  16346. * _.rangeRight(0);
  16347. * // => []
  16348. */
  16349. var rangeRight = createRange(true);
  16350. /**
  16351. * This method returns a new empty array.
  16352. *
  16353. * @static
  16354. * @memberOf _
  16355. * @since 4.13.0
  16356. * @category Util
  16357. * @returns {Array} Returns the new empty array.
  16358. * @example
  16359. *
  16360. * var arrays = _.times(2, _.stubArray);
  16361. *
  16362. * console.log(arrays);
  16363. * // => [[], []]
  16364. *
  16365. * console.log(arrays[0] === arrays[1]);
  16366. * // => false
  16367. */
  16368. function stubArray() {
  16369. return [];
  16370. }
  16371. /**
  16372. * This method returns `false`.
  16373. *
  16374. * @static
  16375. * @memberOf _
  16376. * @since 4.13.0
  16377. * @category Util
  16378. * @returns {boolean} Returns `false`.
  16379. * @example
  16380. *
  16381. * _.times(2, _.stubFalse);
  16382. * // => [false, false]
  16383. */
  16384. function stubFalse() {
  16385. return false;
  16386. }
  16387. /**
  16388. * This method returns a new empty object.
  16389. *
  16390. * @static
  16391. * @memberOf _
  16392. * @since 4.13.0
  16393. * @category Util
  16394. * @returns {Object} Returns the new empty object.
  16395. * @example
  16396. *
  16397. * var objects = _.times(2, _.stubObject);
  16398. *
  16399. * console.log(objects);
  16400. * // => [{}, {}]
  16401. *
  16402. * console.log(objects[0] === objects[1]);
  16403. * // => false
  16404. */
  16405. function stubObject() {
  16406. return {};
  16407. }
  16408. /**
  16409. * This method returns an empty string.
  16410. *
  16411. * @static
  16412. * @memberOf _
  16413. * @since 4.13.0
  16414. * @category Util
  16415. * @returns {string} Returns the empty string.
  16416. * @example
  16417. *
  16418. * _.times(2, _.stubString);
  16419. * // => ['', '']
  16420. */
  16421. function stubString() {
  16422. return '';
  16423. }
  16424. /**
  16425. * This method returns `true`.
  16426. *
  16427. * @static
  16428. * @memberOf _
  16429. * @since 4.13.0
  16430. * @category Util
  16431. * @returns {boolean} Returns `true`.
  16432. * @example
  16433. *
  16434. * _.times(2, _.stubTrue);
  16435. * // => [true, true]
  16436. */
  16437. function stubTrue() {
  16438. return true;
  16439. }
  16440. /**
  16441. * Invokes the iteratee `n` times, returning an array of the results of
  16442. * each invocation. The iteratee is invoked with one argument; (index).
  16443. *
  16444. * @static
  16445. * @since 0.1.0
  16446. * @memberOf _
  16447. * @category Util
  16448. * @param {number} n The number of times to invoke `iteratee`.
  16449. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16450. * @returns {Array} Returns the array of results.
  16451. * @example
  16452. *
  16453. * _.times(3, String);
  16454. * // => ['0', '1', '2']
  16455. *
  16456. * _.times(4, _.constant(0));
  16457. * // => [0, 0, 0, 0]
  16458. */
  16459. function times(n, iteratee) {
  16460. n = toInteger(n);
  16461. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16462. return [];
  16463. }
  16464. var index = MAX_ARRAY_LENGTH,
  16465. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16466. iteratee = getIteratee(iteratee);
  16467. n -= MAX_ARRAY_LENGTH;
  16468. var result = baseTimes(length, iteratee);
  16469. while (++index < n) {
  16470. iteratee(index);
  16471. }
  16472. return result;
  16473. }
  16474. /**
  16475. * Converts `value` to a property path array.
  16476. *
  16477. * @static
  16478. * @memberOf _
  16479. * @since 4.0.0
  16480. * @category Util
  16481. * @param {*} value The value to convert.
  16482. * @returns {Array} Returns the new property path array.
  16483. * @example
  16484. *
  16485. * _.toPath('a.b.c');
  16486. * // => ['a', 'b', 'c']
  16487. *
  16488. * _.toPath('a[0].b.c');
  16489. * // => ['a', '0', 'b', 'c']
  16490. */
  16491. function toPath(value) {
  16492. if (isArray(value)) {
  16493. return arrayMap(value, toKey);
  16494. }
  16495. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16496. }
  16497. /**
  16498. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16499. *
  16500. * @static
  16501. * @since 0.1.0
  16502. * @memberOf _
  16503. * @category Util
  16504. * @param {string} [prefix=''] The value to prefix the ID with.
  16505. * @returns {string} Returns the unique ID.
  16506. * @example
  16507. *
  16508. * _.uniqueId('contact_');
  16509. * // => 'contact_104'
  16510. *
  16511. * _.uniqueId();
  16512. * // => '105'
  16513. */
  16514. function uniqueId(prefix) {
  16515. var id = ++idCounter;
  16516. return toString(prefix) + id;
  16517. }
  16518. /*------------------------------------------------------------------------*/
  16519. /**
  16520. * Adds two numbers.
  16521. *
  16522. * @static
  16523. * @memberOf _
  16524. * @since 3.4.0
  16525. * @category Math
  16526. * @param {number} augend The first number in an addition.
  16527. * @param {number} addend The second number in an addition.
  16528. * @returns {number} Returns the total.
  16529. * @example
  16530. *
  16531. * _.add(6, 4);
  16532. * // => 10
  16533. */
  16534. var add = createMathOperation(function(augend, addend) {
  16535. return augend + addend;
  16536. }, 0);
  16537. /**
  16538. * Computes `number` rounded up to `precision`.
  16539. *
  16540. * @static
  16541. * @memberOf _
  16542. * @since 3.10.0
  16543. * @category Math
  16544. * @param {number} number The number to round up.
  16545. * @param {number} [precision=0] The precision to round up to.
  16546. * @returns {number} Returns the rounded up number.
  16547. * @example
  16548. *
  16549. * _.ceil(4.006);
  16550. * // => 5
  16551. *
  16552. * _.ceil(6.004, 2);
  16553. * // => 6.01
  16554. *
  16555. * _.ceil(6040, -2);
  16556. * // => 6100
  16557. */
  16558. var ceil = createRound('ceil');
  16559. /**
  16560. * Divide two numbers.
  16561. *
  16562. * @static
  16563. * @memberOf _
  16564. * @since 4.7.0
  16565. * @category Math
  16566. * @param {number} dividend The first number in a division.
  16567. * @param {number} divisor The second number in a division.
  16568. * @returns {number} Returns the quotient.
  16569. * @example
  16570. *
  16571. * _.divide(6, 4);
  16572. * // => 1.5
  16573. */
  16574. var divide = createMathOperation(function(dividend, divisor) {
  16575. return dividend / divisor;
  16576. }, 1);
  16577. /**
  16578. * Computes `number` rounded down to `precision`.
  16579. *
  16580. * @static
  16581. * @memberOf _
  16582. * @since 3.10.0
  16583. * @category Math
  16584. * @param {number} number The number to round down.
  16585. * @param {number} [precision=0] The precision to round down to.
  16586. * @returns {number} Returns the rounded down number.
  16587. * @example
  16588. *
  16589. * _.floor(4.006);
  16590. * // => 4
  16591. *
  16592. * _.floor(0.046, 2);
  16593. * // => 0.04
  16594. *
  16595. * _.floor(4060, -2);
  16596. * // => 4000
  16597. */
  16598. var floor = createRound('floor');
  16599. /**
  16600. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16601. * `undefined` is returned.
  16602. *
  16603. * @static
  16604. * @since 0.1.0
  16605. * @memberOf _
  16606. * @category Math
  16607. * @param {Array} array The array to iterate over.
  16608. * @returns {*} Returns the maximum value.
  16609. * @example
  16610. *
  16611. * _.max([4, 2, 8, 6]);
  16612. * // => 8
  16613. *
  16614. * _.max([]);
  16615. * // => undefined
  16616. */
  16617. function max(array) {
  16618. return (array && array.length)
  16619. ? baseExtremum(array, identity, baseGt)
  16620. : undefined;
  16621. }
  16622. /**
  16623. * This method is like `_.max` except that it accepts `iteratee` which is
  16624. * invoked for each element in `array` to generate the criterion by which
  16625. * the value is ranked. The iteratee is invoked with one argument: (value).
  16626. *
  16627. * @static
  16628. * @memberOf _
  16629. * @since 4.0.0
  16630. * @category Math
  16631. * @param {Array} array The array to iterate over.
  16632. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16633. * @returns {*} Returns the maximum value.
  16634. * @example
  16635. *
  16636. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16637. *
  16638. * _.maxBy(objects, function(o) { return o.n; });
  16639. * // => { 'n': 2 }
  16640. *
  16641. * // The `_.property` iteratee shorthand.
  16642. * _.maxBy(objects, 'n');
  16643. * // => { 'n': 2 }
  16644. */
  16645. function maxBy(array, iteratee) {
  16646. return (array && array.length)
  16647. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16648. : undefined;
  16649. }
  16650. /**
  16651. * Computes the mean of the values in `array`.
  16652. *
  16653. * @static
  16654. * @memberOf _
  16655. * @since 4.0.0
  16656. * @category Math
  16657. * @param {Array} array The array to iterate over.
  16658. * @returns {number} Returns the mean.
  16659. * @example
  16660. *
  16661. * _.mean([4, 2, 8, 6]);
  16662. * // => 5
  16663. */
  16664. function mean(array) {
  16665. return baseMean(array, identity);
  16666. }
  16667. /**
  16668. * This method is like `_.mean` except that it accepts `iteratee` which is
  16669. * invoked for each element in `array` to generate the value to be averaged.
  16670. * The iteratee is invoked with one argument: (value).
  16671. *
  16672. * @static
  16673. * @memberOf _
  16674. * @since 4.7.0
  16675. * @category Math
  16676. * @param {Array} array The array to iterate over.
  16677. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16678. * @returns {number} Returns the mean.
  16679. * @example
  16680. *
  16681. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16682. *
  16683. * _.meanBy(objects, function(o) { return o.n; });
  16684. * // => 5
  16685. *
  16686. * // The `_.property` iteratee shorthand.
  16687. * _.meanBy(objects, 'n');
  16688. * // => 5
  16689. */
  16690. function meanBy(array, iteratee) {
  16691. return baseMean(array, getIteratee(iteratee, 2));
  16692. }
  16693. /**
  16694. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16695. * `undefined` is returned.
  16696. *
  16697. * @static
  16698. * @since 0.1.0
  16699. * @memberOf _
  16700. * @category Math
  16701. * @param {Array} array The array to iterate over.
  16702. * @returns {*} Returns the minimum value.
  16703. * @example
  16704. *
  16705. * _.min([4, 2, 8, 6]);
  16706. * // => 2
  16707. *
  16708. * _.min([]);
  16709. * // => undefined
  16710. */
  16711. function min(array) {
  16712. return (array && array.length)
  16713. ? baseExtremum(array, identity, baseLt)
  16714. : undefined;
  16715. }
  16716. /**
  16717. * This method is like `_.min` except that it accepts `iteratee` which is
  16718. * invoked for each element in `array` to generate the criterion by which
  16719. * the value is ranked. The iteratee is invoked with one argument: (value).
  16720. *
  16721. * @static
  16722. * @memberOf _
  16723. * @since 4.0.0
  16724. * @category Math
  16725. * @param {Array} array The array to iterate over.
  16726. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16727. * @returns {*} Returns the minimum value.
  16728. * @example
  16729. *
  16730. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16731. *
  16732. * _.minBy(objects, function(o) { return o.n; });
  16733. * // => { 'n': 1 }
  16734. *
  16735. * // The `_.property` iteratee shorthand.
  16736. * _.minBy(objects, 'n');
  16737. * // => { 'n': 1 }
  16738. */
  16739. function minBy(array, iteratee) {
  16740. return (array && array.length)
  16741. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16742. : undefined;
  16743. }
  16744. /**
  16745. * Multiply two numbers.
  16746. *
  16747. * @static
  16748. * @memberOf _
  16749. * @since 4.7.0
  16750. * @category Math
  16751. * @param {number} multiplier The first number in a multiplication.
  16752. * @param {number} multiplicand The second number in a multiplication.
  16753. * @returns {number} Returns the product.
  16754. * @example
  16755. *
  16756. * _.multiply(6, 4);
  16757. * // => 24
  16758. */
  16759. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16760. return multiplier * multiplicand;
  16761. }, 1);
  16762. /**
  16763. * Computes `number` rounded to `precision`.
  16764. *
  16765. * @static
  16766. * @memberOf _
  16767. * @since 3.10.0
  16768. * @category Math
  16769. * @param {number} number The number to round.
  16770. * @param {number} [precision=0] The precision to round to.
  16771. * @returns {number} Returns the rounded number.
  16772. * @example
  16773. *
  16774. * _.round(4.006);
  16775. * // => 4
  16776. *
  16777. * _.round(4.006, 2);
  16778. * // => 4.01
  16779. *
  16780. * _.round(4060, -2);
  16781. * // => 4100
  16782. */
  16783. var round = createRound('round');
  16784. /**
  16785. * Subtract two numbers.
  16786. *
  16787. * @static
  16788. * @memberOf _
  16789. * @since 4.0.0
  16790. * @category Math
  16791. * @param {number} minuend The first number in a subtraction.
  16792. * @param {number} subtrahend The second number in a subtraction.
  16793. * @returns {number} Returns the difference.
  16794. * @example
  16795. *
  16796. * _.subtract(6, 4);
  16797. * // => 2
  16798. */
  16799. var subtract = createMathOperation(function(minuend, subtrahend) {
  16800. return minuend - subtrahend;
  16801. }, 0);
  16802. /**
  16803. * Computes the sum of the values in `array`.
  16804. *
  16805. * @static
  16806. * @memberOf _
  16807. * @since 3.4.0
  16808. * @category Math
  16809. * @param {Array} array The array to iterate over.
  16810. * @returns {number} Returns the sum.
  16811. * @example
  16812. *
  16813. * _.sum([4, 2, 8, 6]);
  16814. * // => 20
  16815. */
  16816. function sum(array) {
  16817. return (array && array.length)
  16818. ? baseSum(array, identity)
  16819. : 0;
  16820. }
  16821. /**
  16822. * This method is like `_.sum` except that it accepts `iteratee` which is
  16823. * invoked for each element in `array` to generate the value to be summed.
  16824. * The iteratee is invoked with one argument: (value).
  16825. *
  16826. * @static
  16827. * @memberOf _
  16828. * @since 4.0.0
  16829. * @category Math
  16830. * @param {Array} array The array to iterate over.
  16831. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16832. * @returns {number} Returns the sum.
  16833. * @example
  16834. *
  16835. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16836. *
  16837. * _.sumBy(objects, function(o) { return o.n; });
  16838. * // => 20
  16839. *
  16840. * // The `_.property` iteratee shorthand.
  16841. * _.sumBy(objects, 'n');
  16842. * // => 20
  16843. */
  16844. function sumBy(array, iteratee) {
  16845. return (array && array.length)
  16846. ? baseSum(array, getIteratee(iteratee, 2))
  16847. : 0;
  16848. }
  16849. /*------------------------------------------------------------------------*/
  16850. // Add methods that return wrapped values in chain sequences.
  16851. lodash.after = after;
  16852. lodash.ary = ary;
  16853. lodash.assign = assign;
  16854. lodash.assignIn = assignIn;
  16855. lodash.assignInWith = assignInWith;
  16856. lodash.assignWith = assignWith;
  16857. lodash.at = at;
  16858. lodash.before = before;
  16859. lodash.bind = bind;
  16860. lodash.bindAll = bindAll;
  16861. lodash.bindKey = bindKey;
  16862. lodash.castArray = castArray;
  16863. lodash.chain = chain;
  16864. lodash.chunk = chunk;
  16865. lodash.compact = compact;
  16866. lodash.concat = concat;
  16867. lodash.cond = cond;
  16868. lodash.conforms = conforms;
  16869. lodash.constant = constant;
  16870. lodash.countBy = countBy;
  16871. lodash.create = create;
  16872. lodash.curry = curry;
  16873. lodash.curryRight = curryRight;
  16874. lodash.debounce = debounce;
  16875. lodash.defaults = defaults;
  16876. lodash.defaultsDeep = defaultsDeep;
  16877. lodash.defer = defer;
  16878. lodash.delay = delay;
  16879. lodash.difference = difference;
  16880. lodash.differenceBy = differenceBy;
  16881. lodash.differenceWith = differenceWith;
  16882. lodash.drop = drop;
  16883. lodash.dropRight = dropRight;
  16884. lodash.dropRightWhile = dropRightWhile;
  16885. lodash.dropWhile = dropWhile;
  16886. lodash.fill = fill;
  16887. lodash.filter = filter;
  16888. lodash.flatMap = flatMap;
  16889. lodash.flatMapDeep = flatMapDeep;
  16890. lodash.flatMapDepth = flatMapDepth;
  16891. lodash.flatten = flatten;
  16892. lodash.flattenDeep = flattenDeep;
  16893. lodash.flattenDepth = flattenDepth;
  16894. lodash.flip = flip;
  16895. lodash.flow = flow;
  16896. lodash.flowRight = flowRight;
  16897. lodash.fromPairs = fromPairs;
  16898. lodash.functions = functions;
  16899. lodash.functionsIn = functionsIn;
  16900. lodash.groupBy = groupBy;
  16901. lodash.initial = initial;
  16902. lodash.intersection = intersection;
  16903. lodash.intersectionBy = intersectionBy;
  16904. lodash.intersectionWith = intersectionWith;
  16905. lodash.invert = invert;
  16906. lodash.invertBy = invertBy;
  16907. lodash.invokeMap = invokeMap;
  16908. lodash.iteratee = iteratee;
  16909. lodash.keyBy = keyBy;
  16910. lodash.keys = keys;
  16911. lodash.keysIn = keysIn;
  16912. lodash.map = map;
  16913. lodash.mapKeys = mapKeys;
  16914. lodash.mapValues = mapValues;
  16915. lodash.matches = matches;
  16916. lodash.matchesProperty = matchesProperty;
  16917. lodash.memoize = memoize;
  16918. lodash.merge = merge;
  16919. lodash.mergeWith = mergeWith;
  16920. lodash.method = method;
  16921. lodash.methodOf = methodOf;
  16922. lodash.mixin = mixin;
  16923. lodash.negate = negate;
  16924. lodash.nthArg = nthArg;
  16925. lodash.omit = omit;
  16926. lodash.omitBy = omitBy;
  16927. lodash.once = once;
  16928. lodash.orderBy = orderBy;
  16929. lodash.over = over;
  16930. lodash.overArgs = overArgs;
  16931. lodash.overEvery = overEvery;
  16932. lodash.overSome = overSome;
  16933. lodash.partial = partial;
  16934. lodash.partialRight = partialRight;
  16935. lodash.partition = partition;
  16936. lodash.pick = pick;
  16937. lodash.pickBy = pickBy;
  16938. lodash.property = property;
  16939. lodash.propertyOf = propertyOf;
  16940. lodash.pull = pull;
  16941. lodash.pullAll = pullAll;
  16942. lodash.pullAllBy = pullAllBy;
  16943. lodash.pullAllWith = pullAllWith;
  16944. lodash.pullAt = pullAt;
  16945. lodash.range = range;
  16946. lodash.rangeRight = rangeRight;
  16947. lodash.rearg = rearg;
  16948. lodash.reject = reject;
  16949. lodash.remove = remove;
  16950. lodash.rest = rest;
  16951. lodash.reverse = reverse;
  16952. lodash.sampleSize = sampleSize;
  16953. lodash.set = set;
  16954. lodash.setWith = setWith;
  16955. lodash.shuffle = shuffle;
  16956. lodash.slice = slice;
  16957. lodash.sortBy = sortBy;
  16958. lodash.sortedUniq = sortedUniq;
  16959. lodash.sortedUniqBy = sortedUniqBy;
  16960. lodash.split = split;
  16961. lodash.spread = spread;
  16962. lodash.tail = tail;
  16963. lodash.take = take;
  16964. lodash.takeRight = takeRight;
  16965. lodash.takeRightWhile = takeRightWhile;
  16966. lodash.takeWhile = takeWhile;
  16967. lodash.tap = tap;
  16968. lodash.throttle = throttle;
  16969. lodash.thru = thru;
  16970. lodash.toArray = toArray;
  16971. lodash.toPairs = toPairs;
  16972. lodash.toPairsIn = toPairsIn;
  16973. lodash.toPath = toPath;
  16974. lodash.toPlainObject = toPlainObject;
  16975. lodash.transform = transform;
  16976. lodash.unary = unary;
  16977. lodash.union = union;
  16978. lodash.unionBy = unionBy;
  16979. lodash.unionWith = unionWith;
  16980. lodash.uniq = uniq;
  16981. lodash.uniqBy = uniqBy;
  16982. lodash.uniqWith = uniqWith;
  16983. lodash.unset = unset;
  16984. lodash.unzip = unzip;
  16985. lodash.unzipWith = unzipWith;
  16986. lodash.update = update;
  16987. lodash.updateWith = updateWith;
  16988. lodash.values = values;
  16989. lodash.valuesIn = valuesIn;
  16990. lodash.without = without;
  16991. lodash.words = words;
  16992. lodash.wrap = wrap;
  16993. lodash.xor = xor;
  16994. lodash.xorBy = xorBy;
  16995. lodash.xorWith = xorWith;
  16996. lodash.zip = zip;
  16997. lodash.zipObject = zipObject;
  16998. lodash.zipObjectDeep = zipObjectDeep;
  16999. lodash.zipWith = zipWith;
  17000. // Add aliases.
  17001. lodash.entries = toPairs;
  17002. lodash.entriesIn = toPairsIn;
  17003. lodash.extend = assignIn;
  17004. lodash.extendWith = assignInWith;
  17005. // Add methods to `lodash.prototype`.
  17006. mixin(lodash, lodash);
  17007. /*------------------------------------------------------------------------*/
  17008. // Add methods that return unwrapped values in chain sequences.
  17009. lodash.add = add;
  17010. lodash.attempt = attempt;
  17011. lodash.camelCase = camelCase;
  17012. lodash.capitalize = capitalize;
  17013. lodash.ceil = ceil;
  17014. lodash.clamp = clamp;
  17015. lodash.clone = clone;
  17016. lodash.cloneDeep = cloneDeep;
  17017. lodash.cloneDeepWith = cloneDeepWith;
  17018. lodash.cloneWith = cloneWith;
  17019. lodash.conformsTo = conformsTo;
  17020. lodash.deburr = deburr;
  17021. lodash.defaultTo = defaultTo;
  17022. lodash.divide = divide;
  17023. lodash.endsWith = endsWith;
  17024. lodash.eq = eq;
  17025. lodash.escape = escape;
  17026. lodash.escapeRegExp = escapeRegExp;
  17027. lodash.every = every;
  17028. lodash.find = find;
  17029. lodash.findIndex = findIndex;
  17030. lodash.findKey = findKey;
  17031. lodash.findLast = findLast;
  17032. lodash.findLastIndex = findLastIndex;
  17033. lodash.findLastKey = findLastKey;
  17034. lodash.floor = floor;
  17035. lodash.forEach = forEach;
  17036. lodash.forEachRight = forEachRight;
  17037. lodash.forIn = forIn;
  17038. lodash.forInRight = forInRight;
  17039. lodash.forOwn = forOwn;
  17040. lodash.forOwnRight = forOwnRight;
  17041. lodash.get = get;
  17042. lodash.gt = gt;
  17043. lodash.gte = gte;
  17044. lodash.has = has;
  17045. lodash.hasIn = hasIn;
  17046. lodash.head = head;
  17047. lodash.identity = identity;
  17048. lodash.includes = includes;
  17049. lodash.indexOf = indexOf;
  17050. lodash.inRange = inRange;
  17051. lodash.invoke = invoke;
  17052. lodash.isArguments = isArguments;
  17053. lodash.isArray = isArray;
  17054. lodash.isArrayBuffer = isArrayBuffer;
  17055. lodash.isArrayLike = isArrayLike;
  17056. lodash.isArrayLikeObject = isArrayLikeObject;
  17057. lodash.isBoolean = isBoolean;
  17058. lodash.isBuffer = isBuffer;
  17059. lodash.isDate = isDate;
  17060. lodash.isElement = isElement;
  17061. lodash.isEmpty = isEmpty;
  17062. lodash.isEqual = isEqual;
  17063. lodash.isEqualWith = isEqualWith;
  17064. lodash.isError = isError;
  17065. lodash.isFinite = isFinite;
  17066. lodash.isFunction = isFunction;
  17067. lodash.isInteger = isInteger;
  17068. lodash.isLength = isLength;
  17069. lodash.isMap = isMap;
  17070. lodash.isMatch = isMatch;
  17071. lodash.isMatchWith = isMatchWith;
  17072. lodash.isNaN = isNaN;
  17073. lodash.isNative = isNative;
  17074. lodash.isNil = isNil;
  17075. lodash.isNull = isNull;
  17076. lodash.isNumber = isNumber;
  17077. lodash.isObject = isObject;
  17078. lodash.isObjectLike = isObjectLike;
  17079. lodash.isPlainObject = isPlainObject;
  17080. lodash.isRegExp = isRegExp;
  17081. lodash.isSafeInteger = isSafeInteger;
  17082. lodash.isSet = isSet;
  17083. lodash.isString = isString;
  17084. lodash.isSymbol = isSymbol;
  17085. lodash.isTypedArray = isTypedArray;
  17086. lodash.isUndefined = isUndefined;
  17087. lodash.isWeakMap = isWeakMap;
  17088. lodash.isWeakSet = isWeakSet;
  17089. lodash.join = join;
  17090. lodash.kebabCase = kebabCase;
  17091. lodash.last = last;
  17092. lodash.lastIndexOf = lastIndexOf;
  17093. lodash.lowerCase = lowerCase;
  17094. lodash.lowerFirst = lowerFirst;
  17095. lodash.lt = lt;
  17096. lodash.lte = lte;
  17097. lodash.max = max;
  17098. lodash.maxBy = maxBy;
  17099. lodash.mean = mean;
  17100. lodash.meanBy = meanBy;
  17101. lodash.min = min;
  17102. lodash.minBy = minBy;
  17103. lodash.stubArray = stubArray;
  17104. lodash.stubFalse = stubFalse;
  17105. lodash.stubObject = stubObject;
  17106. lodash.stubString = stubString;
  17107. lodash.stubTrue = stubTrue;
  17108. lodash.multiply = multiply;
  17109. lodash.nth = nth;
  17110. lodash.noConflict = noConflict;
  17111. lodash.noop = noop;
  17112. lodash.now = now;
  17113. lodash.pad = pad;
  17114. lodash.padEnd = padEnd;
  17115. lodash.padStart = padStart;
  17116. lodash.parseInt = parseInt;
  17117. lodash.random = random;
  17118. lodash.reduce = reduce;
  17119. lodash.reduceRight = reduceRight;
  17120. lodash.repeat = repeat;
  17121. lodash.replace = replace;
  17122. lodash.result = result;
  17123. lodash.round = round;
  17124. lodash.runInContext = runInContext;
  17125. lodash.sample = sample;
  17126. lodash.size = size;
  17127. lodash.snakeCase = snakeCase;
  17128. lodash.some = some;
  17129. lodash.sortedIndex = sortedIndex;
  17130. lodash.sortedIndexBy = sortedIndexBy;
  17131. lodash.sortedIndexOf = sortedIndexOf;
  17132. lodash.sortedLastIndex = sortedLastIndex;
  17133. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17134. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17135. lodash.startCase = startCase;
  17136. lodash.startsWith = startsWith;
  17137. lodash.subtract = subtract;
  17138. lodash.sum = sum;
  17139. lodash.sumBy = sumBy;
  17140. lodash.template = template;
  17141. lodash.times = times;
  17142. lodash.toFinite = toFinite;
  17143. lodash.toInteger = toInteger;
  17144. lodash.toLength = toLength;
  17145. lodash.toLower = toLower;
  17146. lodash.toNumber = toNumber;
  17147. lodash.toSafeInteger = toSafeInteger;
  17148. lodash.toString = toString;
  17149. lodash.toUpper = toUpper;
  17150. lodash.trim = trim;
  17151. lodash.trimEnd = trimEnd;
  17152. lodash.trimStart = trimStart;
  17153. lodash.truncate = truncate;
  17154. lodash.unescape = unescape;
  17155. lodash.uniqueId = uniqueId;
  17156. lodash.upperCase = upperCase;
  17157. lodash.upperFirst = upperFirst;
  17158. // Add aliases.
  17159. lodash.each = forEach;
  17160. lodash.eachRight = forEachRight;
  17161. lodash.first = head;
  17162. mixin(lodash, (function() {
  17163. var source = {};
  17164. baseForOwn(lodash, function(func, methodName) {
  17165. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17166. source[methodName] = func;
  17167. }
  17168. });
  17169. return source;
  17170. }()), { 'chain': false });
  17171. /*------------------------------------------------------------------------*/
  17172. /**
  17173. * The semantic version number.
  17174. *
  17175. * @static
  17176. * @memberOf _
  17177. * @type {string}
  17178. */
  17179. lodash.VERSION = VERSION;
  17180. // Assign default placeholders.
  17181. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17182. lodash[methodName].placeholder = lodash;
  17183. });
  17184. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17185. arrayEach(['drop', 'take'], function(methodName, index) {
  17186. LazyWrapper.prototype[methodName] = function(n) {
  17187. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17188. var result = (this.__filtered__ && !index)
  17189. ? new LazyWrapper(this)
  17190. : this.clone();
  17191. if (result.__filtered__) {
  17192. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17193. } else {
  17194. result.__views__.push({
  17195. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17196. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17197. });
  17198. }
  17199. return result;
  17200. };
  17201. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17202. return this.reverse()[methodName](n).reverse();
  17203. };
  17204. });
  17205. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17206. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17207. var type = index + 1,
  17208. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17209. LazyWrapper.prototype[methodName] = function(iteratee) {
  17210. var result = this.clone();
  17211. result.__iteratees__.push({
  17212. 'iteratee': getIteratee(iteratee, 3),
  17213. 'type': type
  17214. });
  17215. result.__filtered__ = result.__filtered__ || isFilter;
  17216. return result;
  17217. };
  17218. });
  17219. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17220. arrayEach(['head', 'last'], function(methodName, index) {
  17221. var takeName = 'take' + (index ? 'Right' : '');
  17222. LazyWrapper.prototype[methodName] = function() {
  17223. return this[takeName](1).value()[0];
  17224. };
  17225. });
  17226. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17227. arrayEach(['initial', 'tail'], function(methodName, index) {
  17228. var dropName = 'drop' + (index ? '' : 'Right');
  17229. LazyWrapper.prototype[methodName] = function() {
  17230. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17231. };
  17232. });
  17233. LazyWrapper.prototype.compact = function() {
  17234. return this.filter(identity);
  17235. };
  17236. LazyWrapper.prototype.find = function(predicate) {
  17237. return this.filter(predicate).head();
  17238. };
  17239. LazyWrapper.prototype.findLast = function(predicate) {
  17240. return this.reverse().find(predicate);
  17241. };
  17242. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17243. if (typeof path == 'function') {
  17244. return new LazyWrapper(this);
  17245. }
  17246. return this.map(function(value) {
  17247. return baseInvoke(value, path, args);
  17248. });
  17249. });
  17250. LazyWrapper.prototype.reject = function(predicate) {
  17251. return this.filter(negate(getIteratee(predicate)));
  17252. };
  17253. LazyWrapper.prototype.slice = function(start, end) {
  17254. start = toInteger(start);
  17255. var result = this;
  17256. if (result.__filtered__ && (start > 0 || end < 0)) {
  17257. return new LazyWrapper(result);
  17258. }
  17259. if (start < 0) {
  17260. result = result.takeRight(-start);
  17261. } else if (start) {
  17262. result = result.drop(start);
  17263. }
  17264. if (end !== undefined) {
  17265. end = toInteger(end);
  17266. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17267. }
  17268. return result;
  17269. };
  17270. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17271. return this.reverse().takeWhile(predicate).reverse();
  17272. };
  17273. LazyWrapper.prototype.toArray = function() {
  17274. return this.take(MAX_ARRAY_LENGTH);
  17275. };
  17276. // Add `LazyWrapper` methods to `lodash.prototype`.
  17277. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17278. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17279. isTaker = /^(?:head|last)$/.test(methodName),
  17280. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17281. retUnwrapped = isTaker || /^find/.test(methodName);
  17282. if (!lodashFunc) {
  17283. return;
  17284. }
  17285. lodash.prototype[methodName] = function() {
  17286. var value = this.__wrapped__,
  17287. args = isTaker ? [1] : arguments,
  17288. isLazy = value instanceof LazyWrapper,
  17289. iteratee = args[0],
  17290. useLazy = isLazy || isArray(value);
  17291. var interceptor = function(value) {
  17292. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17293. return (isTaker && chainAll) ? result[0] : result;
  17294. };
  17295. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17296. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17297. isLazy = useLazy = false;
  17298. }
  17299. var chainAll = this.__chain__,
  17300. isHybrid = !!this.__actions__.length,
  17301. isUnwrapped = retUnwrapped && !chainAll,
  17302. onlyLazy = isLazy && !isHybrid;
  17303. if (!retUnwrapped && useLazy) {
  17304. value = onlyLazy ? value : new LazyWrapper(this);
  17305. var result = func.apply(value, args);
  17306. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17307. return new LodashWrapper(result, chainAll);
  17308. }
  17309. if (isUnwrapped && onlyLazy) {
  17310. return func.apply(this, args);
  17311. }
  17312. result = this.thru(interceptor);
  17313. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17314. };
  17315. });
  17316. // Add `Array` methods to `lodash.prototype`.
  17317. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17318. var func = arrayProto[methodName],
  17319. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17320. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17321. lodash.prototype[methodName] = function() {
  17322. var args = arguments;
  17323. if (retUnwrapped && !this.__chain__) {
  17324. var value = this.value();
  17325. return func.apply(isArray(value) ? value : [], args);
  17326. }
  17327. return this[chainName](function(value) {
  17328. return func.apply(isArray(value) ? value : [], args);
  17329. });
  17330. };
  17331. });
  17332. // Map minified method names to their real names.
  17333. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17334. var lodashFunc = lodash[methodName];
  17335. if (lodashFunc) {
  17336. var key = lodashFunc.name + '';
  17337. if (!hasOwnProperty.call(realNames, key)) {
  17338. realNames[key] = [];
  17339. }
  17340. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17341. }
  17342. });
  17343. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17344. 'name': 'wrapper',
  17345. 'func': undefined
  17346. }];
  17347. // Add methods to `LazyWrapper`.
  17348. LazyWrapper.prototype.clone = lazyClone;
  17349. LazyWrapper.prototype.reverse = lazyReverse;
  17350. LazyWrapper.prototype.value = lazyValue;
  17351. // Add chain sequence methods to the `lodash` wrapper.
  17352. lodash.prototype.at = wrapperAt;
  17353. lodash.prototype.chain = wrapperChain;
  17354. lodash.prototype.commit = wrapperCommit;
  17355. lodash.prototype.next = wrapperNext;
  17356. lodash.prototype.plant = wrapperPlant;
  17357. lodash.prototype.reverse = wrapperReverse;
  17358. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17359. // Add lazy aliases.
  17360. lodash.prototype.first = lodash.prototype.head;
  17361. if (symIterator) {
  17362. lodash.prototype[symIterator] = wrapperToIterator;
  17363. }
  17364. return lodash;
  17365. });
  17366. /*--------------------------------------------------------------------------*/
  17367. // Export lodash.
  17368. var _ = runInContext();
  17369. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17370. if (true) {
  17371. // Expose Lodash on the global object to prevent errors when Lodash is
  17372. // loaded by a script tag in the presence of an AMD loader.
  17373. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17374. // Use `_.noConflict` to remove Lodash from the global object.
  17375. root._ = _;
  17376. // Define as an anonymous module so, through path mapping, it can be
  17377. // referenced as the "underscore" module.
  17378. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17379. return _;
  17380. }).call(exports, __webpack_require__, exports, module),
  17381. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17382. }
  17383. // Check for `exports` after `define` in case a build optimizer adds it.
  17384. else {}
  17385. }.call(this));
  17386. /***/ }),
  17387. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17388. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17389. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17390. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17391. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17392. "use strict";
  17393. __webpack_require__.r(__webpack_exports__);
  17394. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17395. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17396. /* harmony export */ });
  17397. /* 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");
  17398. /* 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__);
  17399. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17400. var options = {};
  17401. options.insert = "head";
  17402. options.singleton = false;
  17403. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17404. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17405. /***/ }),
  17406. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17407. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17408. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17409. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17410. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17411. "use strict";
  17412. __webpack_require__.r(__webpack_exports__);
  17413. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17414. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17415. /* harmony export */ });
  17416. /* 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");
  17417. /* 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__);
  17418. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17419. var options = {};
  17420. options.insert = "head";
  17421. options.singleton = false;
  17422. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17423. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17424. /***/ }),
  17425. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17426. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17427. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17428. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17429. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17430. "use strict";
  17431. __webpack_require__.r(__webpack_exports__);
  17432. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17433. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17434. /* harmony export */ });
  17435. /* 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");
  17436. /* 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__);
  17437. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17438. var options = {};
  17439. options.insert = "head";
  17440. options.singleton = false;
  17441. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17442. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17443. /***/ }),
  17444. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17445. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17446. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17447. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17448. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17449. "use strict";
  17450. __webpack_require__.r(__webpack_exports__);
  17451. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17452. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17453. /* harmony export */ });
  17454. /* 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");
  17455. /* 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__);
  17456. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17457. var options = {};
  17458. options.insert = "head";
  17459. options.singleton = false;
  17460. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17461. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17462. /***/ }),
  17463. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17464. /*!******************************************************!*\
  17465. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17466. \******************************************************/
  17467. /***/ ((__unused_webpack_module, exports) => {
  17468. "use strict";
  17469. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17470. // runtime helper for setting properties on components
  17471. // in a tree-shakable way
  17472. exports["default"] = (sfc, props) => {
  17473. const target = sfc.__vccOpts || sfc;
  17474. for (const [key, val] of props) {
  17475. target[key] = val;
  17476. }
  17477. return target;
  17478. };
  17479. /***/ }),
  17480. /***/ "./resources/js/components/AppButtonLink.vue":
  17481. /*!***************************************************!*\
  17482. !*** ./resources/js/components/AppButtonLink.vue ***!
  17483. \***************************************************/
  17484. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17485. "use strict";
  17486. __webpack_require__.r(__webpack_exports__);
  17487. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17488. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17489. /* harmony export */ });
  17490. /* 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");
  17491. /* 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");
  17492. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17493. ;
  17494. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17495. /* hot reload */
  17496. if (false) {}
  17497. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17498. /***/ }),
  17499. /***/ "./resources/js/components/AppMessage.vue":
  17500. /*!************************************************!*\
  17501. !*** ./resources/js/components/AppMessage.vue ***!
  17502. \************************************************/
  17503. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17504. "use strict";
  17505. __webpack_require__.r(__webpack_exports__);
  17506. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17507. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17508. /* harmony export */ });
  17509. /* 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");
  17510. /* 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");
  17511. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17512. ;
  17513. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17514. /* hot reload */
  17515. if (false) {}
  17516. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17517. /***/ }),
  17518. /***/ "./resources/js/components/AppPagination.vue":
  17519. /*!***************************************************!*\
  17520. !*** ./resources/js/components/AppPagination.vue ***!
  17521. \***************************************************/
  17522. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17523. "use strict";
  17524. __webpack_require__.r(__webpack_exports__);
  17525. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17526. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17527. /* harmony export */ });
  17528. /* 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");
  17529. /* 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");
  17530. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17531. ;
  17532. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17533. /* hot reload */
  17534. if (false) {}
  17535. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17536. /***/ }),
  17537. /***/ "./resources/js/components/AppSearch.vue":
  17538. /*!***********************************************!*\
  17539. !*** ./resources/js/components/AppSearch.vue ***!
  17540. \***********************************************/
  17541. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17542. "use strict";
  17543. __webpack_require__.r(__webpack_exports__);
  17544. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17545. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17546. /* harmony export */ });
  17547. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17548. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17549. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17550. ;
  17551. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17552. /* hot reload */
  17553. if (false) {}
  17554. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17555. /***/ }),
  17556. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17557. /*!**************************************************************!*\
  17558. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17559. \**************************************************************/
  17560. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17561. "use strict";
  17562. __webpack_require__.r(__webpack_exports__);
  17563. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17564. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17565. /* harmony export */ });
  17566. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17567. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17568. const script = {}
  17569. ;
  17570. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17571. /* hot reload */
  17572. if (false) {}
  17573. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17574. /***/ }),
  17575. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17576. /*!***************************************************************!*\
  17577. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17578. \***************************************************************/
  17579. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17580. "use strict";
  17581. __webpack_require__.r(__webpack_exports__);
  17582. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17583. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17584. /* harmony export */ });
  17585. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17586. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17587. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17588. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17589. ;
  17590. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17591. /* hot reload */
  17592. if (false) {}
  17593. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17594. /***/ }),
  17595. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17596. /*!******************************************************************!*\
  17597. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17598. \******************************************************************/
  17599. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17600. "use strict";
  17601. __webpack_require__.r(__webpack_exports__);
  17602. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17603. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17604. /* harmony export */ });
  17605. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17606. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17607. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17608. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17609. ;
  17610. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17611. /* hot reload */
  17612. if (false) {}
  17613. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17614. /***/ }),
  17615. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17616. /*!**************************************************************!*\
  17617. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17618. \**************************************************************/
  17619. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17620. "use strict";
  17621. __webpack_require__.r(__webpack_exports__);
  17622. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17623. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17624. /* harmony export */ });
  17625. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17626. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17627. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17628. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17629. ;
  17630. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17631. /* hot reload */
  17632. if (false) {}
  17633. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17634. /***/ }),
  17635. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17636. /*!************************************************************!*\
  17637. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17638. \************************************************************/
  17639. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17640. "use strict";
  17641. __webpack_require__.r(__webpack_exports__);
  17642. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17643. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17644. /* harmony export */ });
  17645. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17646. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17647. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17648. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17649. ;
  17650. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17651. /* hot reload */
  17652. if (false) {}
  17653. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17654. /***/ }),
  17655. /***/ "./resources/js/pages/Suppliers/Index.vue":
  17656. /*!************************************************!*\
  17657. !*** ./resources/js/pages/Suppliers/Index.vue ***!
  17658. \************************************************/
  17659. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17660. "use strict";
  17661. __webpack_require__.r(__webpack_exports__);
  17662. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17663. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17664. /* harmony export */ });
  17665. /* harmony import */ var _Index_vue_vue_type_template_id_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=06c8ed5e */ "./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e");
  17666. /* harmony import */ var _Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js");
  17667. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17668. ;
  17669. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Suppliers/Index.vue"]])
  17670. /* hot reload */
  17671. if (false) {}
  17672. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17673. /***/ }),
  17674. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17675. /*!**************************************************************************************!*\
  17676. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17677. \**************************************************************************************/
  17678. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17679. "use strict";
  17680. __webpack_require__.r(__webpack_exports__);
  17681. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17682. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17683. /* harmony export */ });
  17684. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17685. /***/ }),
  17686. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17687. /*!***********************************************************************************!*\
  17688. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17689. \***********************************************************************************/
  17690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17691. "use strict";
  17692. __webpack_require__.r(__webpack_exports__);
  17693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17694. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17695. /* harmony export */ });
  17696. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17697. /***/ }),
  17698. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17699. /*!**************************************************************************************!*\
  17700. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17701. \**************************************************************************************/
  17702. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17703. "use strict";
  17704. __webpack_require__.r(__webpack_exports__);
  17705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17706. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17707. /* harmony export */ });
  17708. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17709. /***/ }),
  17710. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17711. /*!**********************************************************************************!*\
  17712. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17713. \**********************************************************************************/
  17714. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17715. "use strict";
  17716. __webpack_require__.r(__webpack_exports__);
  17717. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17718. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17719. /* harmony export */ });
  17720. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17721. /***/ }),
  17722. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17723. /*!**************************************************************************************************!*\
  17724. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17725. \**************************************************************************************************/
  17726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17727. "use strict";
  17728. __webpack_require__.r(__webpack_exports__);
  17729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17730. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17731. /* harmony export */ });
  17732. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17733. /***/ }),
  17734. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17735. /*!*****************************************************************************************************!*\
  17736. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17737. \*****************************************************************************************************/
  17738. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17739. "use strict";
  17740. __webpack_require__.r(__webpack_exports__);
  17741. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17742. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17743. /* harmony export */ });
  17744. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17745. /***/ }),
  17746. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17747. /*!*************************************************************************************************!*\
  17748. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17749. \*************************************************************************************************/
  17750. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17751. "use strict";
  17752. __webpack_require__.r(__webpack_exports__);
  17753. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17754. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17755. /* harmony export */ });
  17756. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17757. /***/ }),
  17758. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17759. /*!***********************************************************************************************!*\
  17760. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17761. \***********************************************************************************************/
  17762. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17763. "use strict";
  17764. __webpack_require__.r(__webpack_exports__);
  17765. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17766. /* harmony export */ "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"])
  17767. /* harmony export */ });
  17768. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17769. /***/ }),
  17770. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  17771. /*!***********************************************************************************!*\
  17772. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17773. \***********************************************************************************/
  17774. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17775. "use strict";
  17776. __webpack_require__.r(__webpack_exports__);
  17777. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17778. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17779. /* harmony export */ });
  17780. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js");
  17781. /***/ }),
  17782. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17783. /*!*********************************************************************************!*\
  17784. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17785. \*********************************************************************************/
  17786. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17787. "use strict";
  17788. __webpack_require__.r(__webpack_exports__);
  17789. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17790. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17791. /* harmony export */ });
  17792. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17793. /***/ }),
  17794. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17795. /*!******************************************************************************!*\
  17796. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17797. \******************************************************************************/
  17798. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17799. "use strict";
  17800. __webpack_require__.r(__webpack_exports__);
  17801. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17802. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17803. /* harmony export */ });
  17804. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17805. /***/ }),
  17806. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17807. /*!*********************************************************************************!*\
  17808. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17809. \*********************************************************************************/
  17810. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17811. "use strict";
  17812. __webpack_require__.r(__webpack_exports__);
  17813. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17814. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17815. /* harmony export */ });
  17816. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17817. /***/ }),
  17818. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17819. /*!*****************************************************************************!*\
  17820. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17821. \*****************************************************************************/
  17822. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17823. "use strict";
  17824. __webpack_require__.r(__webpack_exports__);
  17825. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17826. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17827. /* harmony export */ });
  17828. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17829. /***/ }),
  17830. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17831. /*!********************************************************************************************!*\
  17832. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17833. \********************************************************************************************/
  17834. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17835. "use strict";
  17836. __webpack_require__.r(__webpack_exports__);
  17837. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17838. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17839. /* harmony export */ });
  17840. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17841. /***/ }),
  17842. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17843. /*!*********************************************************************************************************!*\
  17844. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17845. \*********************************************************************************************************/
  17846. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17847. "use strict";
  17848. __webpack_require__.r(__webpack_exports__);
  17849. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17850. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17851. /* harmony export */ });
  17852. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17853. /***/ }),
  17854. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17855. /*!************************************************************************************************************!*\
  17856. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17857. \************************************************************************************************************/
  17858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17859. "use strict";
  17860. __webpack_require__.r(__webpack_exports__);
  17861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17862. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17863. /* harmony export */ });
  17864. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17865. /***/ }),
  17866. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17867. /*!********************************************************************************************************!*\
  17868. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17869. \********************************************************************************************************/
  17870. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17871. "use strict";
  17872. __webpack_require__.r(__webpack_exports__);
  17873. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17874. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17875. /* harmony export */ });
  17876. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17877. /***/ }),
  17878. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17879. /*!******************************************************************************************************!*\
  17880. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17881. \******************************************************************************************************/
  17882. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17883. "use strict";
  17884. __webpack_require__.r(__webpack_exports__);
  17885. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17886. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17887. /* harmony export */ });
  17888. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17889. /***/ }),
  17890. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  17891. /*!******************************************************************************!*\
  17892. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  17893. \******************************************************************************/
  17894. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17895. "use strict";
  17896. __webpack_require__.r(__webpack_exports__);
  17897. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17898. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__.render)
  17899. /* harmony export */ });
  17900. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=06c8ed5e */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Suppliers/Index.vue?vue&type=template&id=06c8ed5e");
  17901. /***/ }),
  17902. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17903. /*!************************************************************************************************************************!*\
  17904. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17905. \************************************************************************************************************************/
  17906. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17907. "use strict";
  17908. __webpack_require__.r(__webpack_exports__);
  17909. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17910. /***/ }),
  17911. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17912. /*!***************************************************************************************************************************!*\
  17913. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17914. \***************************************************************************************************************************/
  17915. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17916. "use strict";
  17917. __webpack_require__.r(__webpack_exports__);
  17918. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17919. /***/ }),
  17920. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17921. /*!***********************************************************************************************************************!*\
  17922. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17923. \***********************************************************************************************************************/
  17924. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17925. "use strict";
  17926. __webpack_require__.r(__webpack_exports__);
  17927. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17928. /***/ }),
  17929. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17930. /*!*********************************************************************************************************************!*\
  17931. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17932. \*********************************************************************************************************************/
  17933. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17934. "use strict";
  17935. __webpack_require__.r(__webpack_exports__);
  17936. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader/dist/cjs.js!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17937. /***/ })
  17938. }]);